StatusUtil.java 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. package com.fdkankan.sale.util;
  2. import com.fdkankan.sale.common.ResultCode;
  3. import com.fdkankan.sale.exception.BusinessException;
  4. import org.bouncycastle.cert.ocsp.Req;
  5. import java.util.ArrayList;
  6. import java.util.Arrays;
  7. import java.util.Collections;
  8. import java.util.List;
  9. import java.util.concurrent.RecursiveTask;
  10. public class StatusUtil {
  11. //已完结状态
  12. public static List<Integer> overStatusList = Arrays.asList(110);
  13. /**
  14. * 售后工程师
  15. * statusParam 0 待接单,1待跟进,2已完结
  16. * * status 0待接单,10待检测,20待报价,30待确认,40已取消,50待备料,60维修中,70待测试,
  17. * * 80待支付(已完结),90待回收,100待发货,110已发货
  18. */
  19. public static List<Integer> getSaleStatus(Integer statusParam){
  20. if(statusParam == null){
  21. throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
  22. }
  23. switch (statusParam){
  24. case 0 : return Collections.singletonList(0);
  25. case 1 : return Arrays.asList(10,20,30,40,41,50,60,70,80,90,91,100);
  26. case 2 : return Arrays.asList(110);
  27. default: throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
  28. }
  29. }
  30. /**
  31. * 维修工程师
  32. * statusParam 0 待检测,1待跟进,2维修完成
  33. * * status 0待接单,10待检测,20待报价,30待确认,40已取消,50待备料,60维修中,70待测试,
  34. * * 80待支付(已完结),90待回收,91取消维修备件回收,100待发货,110已发货
  35. */
  36. public static List<Integer> getRepairerStatus(Integer statusParam){
  37. if(statusParam == null){
  38. throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
  39. }
  40. switch (statusParam){
  41. case 0 : return Collections.singletonList(10);
  42. case 1 : return Arrays.asList(20,50,60,70);
  43. case 2 : return Arrays.asList(80,90,91,100,110);
  44. default: throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
  45. }
  46. }
  47. /**
  48. * 维修备件管理 供应链
  49. * statusParam 0 待备料,1已备料,2待回收
  50. * * status 0待接单,10待检测,20待报价,30待确认,40已取消,50待备料,60维修中,70待测试,
  51. * * 80待支付(已完结),90待回收,100待发货,110已发货
  52. */
  53. public static List<Integer> getSupplyStatus(Integer statusParam){
  54. if(statusParam == null){
  55. throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
  56. }
  57. switch (statusParam){
  58. case 0 : return Collections.singletonList(50);
  59. case 1 : return Arrays.asList(60,70,80,90,91,100,110);
  60. case 2 : return Arrays.asList(90,91);
  61. default: throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
  62. }
  63. }
  64. /**
  65. * 测试工程师
  66. * statusParam 0 待测试,1测试完成
  67. * * status 0待接单,10待检测,20待报价,30待确认,40已取消,41u8待发货,50待备料,60维修中,70待测试,
  68. * * 80待支付(已完结),90待回收,100待发货,110已发货
  69. */
  70. public static List<Integer> getTesterStatus(Integer statusParam) {
  71. if(statusParam == null){
  72. throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
  73. }
  74. switch (statusParam){
  75. case 0 : return Collections.singletonList(70);
  76. case 1 : return Arrays.asList(80,90,91,100,110);
  77. default: throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
  78. }
  79. }
  80. public static List<Integer> getU8Status(Integer statusParam) {
  81. if(statusParam == null){
  82. throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
  83. }
  84. switch (statusParam){
  85. case 0 : return Collections.singletonList(41);
  86. case 1 : return Arrays.asList(50,60,70,80,90,91,100,110);
  87. default: throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
  88. }
  89. }
  90. public static List<Integer> getCheckAccountStatus(Integer statusParam) {
  91. if(statusParam == null){
  92. throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
  93. }
  94. switch (statusParam){
  95. case 0 : return Collections.singletonList(82);
  96. case 1 : return Arrays.asList(90,91,100,110);
  97. default: throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
  98. }
  99. }
  100. public static String getCameraName(Integer cameraType){
  101. switch (cameraType){
  102. case 0 : return "四维看看";
  103. case 1 : return "四维看见";
  104. case 2 : return "四维深时";
  105. }
  106. return null;
  107. }
  108. //保修类型 0保修期内,1保修期外,2非保修项目
  109. public static String getWarrantyType(Integer type){
  110. switch (type){
  111. case 0 : return "保内维修";
  112. case 1 : return "保内转保外";
  113. case 2 : return "保外维修";
  114. case 3 : return "保外转保内";
  115. }
  116. return null;
  117. }
  118. public static String getWarrantyType(String type){
  119. switch (type){
  120. case "0" : return "保内维修";
  121. case "1" : return "保内转保外";
  122. case "2" : return "保外维修";
  123. case "3" : return "保外转保内";
  124. }
  125. return null;
  126. }
  127. public static Boolean getWarranty(Integer type,Integer defineDamage){
  128. if(type == 0){
  129. return defineDamage == 0;
  130. }
  131. return getWarranty(type);
  132. }
  133. public static Boolean getWarranty(Integer type){
  134. switch (type){
  135. case 0 :
  136. case 3 :
  137. return true;
  138. case 1 :
  139. case 2 :
  140. return false;
  141. }
  142. return false;
  143. }
  144. //0银行转账,1微信,2支付宝
  145. public static String getPayTypeStr(Integer payType) {
  146. switch (payType){
  147. case 0: return "银行转账";
  148. case 1: return "微信支付";
  149. case 2: return "支付宝支付";
  150. }
  151. return null;
  152. }
  153. }