CustomerCommonUtil.java 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. package com.iamberry.rst.util;
  2. import com.iamberry.rst.core.cm.*;
  3. import java.util.ArrayList;
  4. import java.util.List;
  5. public class CustomerCommonUtil {
  6. /**
  7. * @param type 处理结果: 1:已解决 2:未解决 3:换新 4:维修 5:补发 6:退货 7:无理由退货
  8. * @return
  9. */
  10. @Deprecated
  11. public static Object getRelation(Integer type,CustomerCommon c){
  12. switch (type){
  13. case 3: //换新
  14. Renewed renewed = new Renewed();
  15. renewed.setRenewedId(c.getRelationId());
  16. renewed.setCustomerId(c.getCustomerId());
  17. renewed.setOrderId(c.getOrderId());
  18. renewed.setSignclosedId(c.getSignclosedId());
  19. renewed.setRenewedBackEfastOrderId(c.getRelationBackEfastOrderId());
  20. renewed.setRenewedBackStatus(c.getRelationBackStatus());
  21. renewed.setRenewedBackName(c.getRelationBackName());
  22. renewed.setRenewedBackTel(c.getRelationBackTel());
  23. renewed.setRenewedBackLogisticsCompany(c.getRelationBackLogisticsCompany());
  24. renewed.setRenewedBackLogisticsNo(c.getRelationBackLogisticsNo());
  25. renewed.setRenewedBackPostage(c.getRelationBackPostage());
  26. renewed.setRenewedBackMachineNo(c.getRelationBackMachineNo());
  27. renewed.setRenewedSendStatus(c.getRelationSendStatus());
  28. renewed.setRenewedSendName(c.getRelationSendName());
  29. renewed.setRenewedSendTel(c.getRelationSendTel());
  30. renewed.setProvinceNumber(c.getProvinceNumber());
  31. renewed.setCityNumber(c.getCityNumber());
  32. renewed.setAreaNumber(c.getAreaNumber());
  33. renewed.setRenewedSendMergeAddress(c.getRelationSendMergeAddress());
  34. renewed.setRenewedSendAddress(c.getRelationSendAddress());
  35. renewed.setRenewedSendLogisticsCompany(c.getRelationSendLogisticsCompany());
  36. renewed.setRenewedSendLogisticsNo(c.getRelationSendLogisticsNo());
  37. renewed.setRenewedDesc(c.getRelationDesc());
  38. renewed.setRenewedState(c.getRelationState());
  39. renewed.setRenewedAlipay(c.getRelationAlipay());
  40. renewed.setRenewedAlipayName(c.getRelationAlipayName());
  41. renewed.setRenewedIsTransfer(c.getRelationIsTransfer());
  42. renewed.setRenewedCreateTime(c.getRelationCreateTime());
  43. renewed.setRenewedUpdateTime(c.getRelationUpdateTime());
  44. return renewed;
  45. case 4: //维修
  46. Repair repair = new Repair();
  47. repair.setRepairId(c.getRelationId());
  48. repair.setCustomerId(c.getCustomerId());
  49. repair.setOrderId(c.getOrderId());
  50. repair.setSignclosedId(c.getSignclosedId());
  51. repair.setRepairBackEfastOrderId( c.getRelationBackEfastOrderId());
  52. repair.setRepairBackStatus(c.getRelationBackStatus());
  53. repair.setRepairBackName(c.getRelationBackName());
  54. repair.setRepairBackTel(c.getRelationBackTel());
  55. repair.setRepairBackLogisticsCompany(c.getRelationBackLogisticsCompany());
  56. repair.setRepairBackLogisticsNo(c.getRelationBackLogisticsNo());
  57. repair.setRepairBackPostage(c.getRelationBackPostage());
  58. repair.setRepairBackMachineNo(c.getRelationBackMachineNo());
  59. repair.setRepairSendStatus(c.getRelationSendStatus());
  60. repair.setRepairSendName(c.getRelationSendName());
  61. repair.setRepairSendTel(c.getRelationSendTel());
  62. repair.setProvinceNumber(c.getProvinceNumber());
  63. repair.setCityNumber(c.getCityNumber());
  64. repair.setAreaNumber(c.getAreaNumber());
  65. repair.setRepairSendMergeAddress(c.getRelationSendMergeAddress());
  66. repair.setRepairSendAddress(c.getRelationSendAddress());
  67. repair.setRepairSendLogisticsCompany(c.getRelationSendLogisticsCompany());
  68. repair.setRepairSendLogisticsNo(c.getRelationSendLogisticsNo());
  69. repair.setRepairDesc(c.getRelationDesc());
  70. repair.setRepairState(c.getRelationState());
  71. repair.setRepairAlipay(c.getRelationAlipay());
  72. repair.setRepairAlipayName(c.getRelationAlipayName());
  73. repair.setRepairIsTransfer(c.getRelationIsTransfer());
  74. repair.setRepairCreateTime(c.getRelationCreateTime());
  75. repair.setRepairUpdateTime(c.getRelationUpdateTime());
  76. repair.setRepairFactoryCosts(c.getRelationFactoryCosts() == null ? null : c.getRelationFactoryCosts()*100);
  77. repair.setRepairCustomerCosts(c.getRelationCustomerCosts() == null ? null : c.getRelationCustomerCosts()*100);
  78. return repair;
  79. case 5://补发
  80. Reissue reissue = new Reissue();
  81. reissue.setReissueId(c.getRelationId());
  82. reissue.setCustomerId(c.getCustomerId());
  83. reissue.setOrderId(c.getOrderId());
  84. reissue.setReissueBackEfastOrderId(c.getRelationBackEfastOrderId());
  85. reissue.setReissueSendStatus(c.getRelationSendStatus());
  86. reissue.setReissueSendName(c.getRelationSendName());
  87. reissue.setReissueSendTel(c.getRelationSendTel());
  88. reissue.setProvinceNumber(c.getProvinceNumber());
  89. reissue.setCityNumber(c.getCityNumber());
  90. reissue.setAreaNumber(c.getAreaNumber());
  91. reissue.setReissueSendMergeAddress(c.getRelationSendMergeAddress());
  92. reissue.setReissueSendAddress(c.getRelationSendAddress());
  93. reissue.setReissueSendLogisticsCompany(c.getRelationSendLogisticsCompany());
  94. reissue.setReissueSendLogisticsNo(c.getRelationSendLogisticsNo());
  95. reissue.setReissueDesc(c.getRelationDesc());
  96. reissue.setReissueState(c.getRelationState());
  97. reissue.setReissueCreateTime(c.getRelationCreateTime());
  98. reissue.setReissueUpdateTime(c.getRelationUpdateTime());
  99. return reissue;
  100. case 6://退货
  101. BackGoods backGoods = new BackGoods();
  102. backGoods.setBackGoodsId(c.getRelationId());
  103. backGoods.setCustomerId(c.getCustomerId());
  104. backGoods.setOrderId(c.getOrderId());
  105. backGoods.setSignclosedId(c.getSignclosedId());
  106. backGoods.setBackGoodsBackStatus(c.getRelationBackStatus());
  107. backGoods.setBackGoodsBackName(c.getRelationBackName());
  108. backGoods.setBackGoodsBackTel(c.getRelationBackTel());
  109. backGoods.setBackGoodsBackLogisticsCompany(c.getRelationBackLogisticsCompany());
  110. backGoods.setBackGoodsBackLogisticsNo(c.getRelationBackLogisticsNo());
  111. backGoods.setBackGoodsBackPostage(c.getRelationBackPostage());
  112. backGoods.setBackGoodsBackMachineNo(c.getRelationBackMachineNo());
  113. backGoods.setBackGoodsDesc(c.getRelationDesc());
  114. backGoods.setBackGoodsState(c.getRelationState());
  115. backGoods.setBackGoodsAlipay(c.getRelationAlipay());
  116. backGoods.setBackGoodsAlipayName(c.getRelationAlipayName());
  117. backGoods.setBackGoodsIsTransfer(c.getRelationIsTransfer());
  118. backGoods.setBackGoodsCreateTime(c.getRelationCreateTime());
  119. backGoods.setBackGoodsUpdateTime(c.getRelationUpdateTime());
  120. return backGoods;
  121. case 7://无理由退货
  122. NoreasonBack noreasonBack = new NoreasonBack();
  123. noreasonBack.setNoreasonBackId( c.getRelationId());
  124. noreasonBack.setCustomerId(c.getCustomerId());
  125. noreasonBack.setOrderId(c.getOrderId());
  126. noreasonBack.setSignclosedId(c.getSignclosedId());
  127. noreasonBack.setNoreasonBackBackStatus(c.getRelationBackStatus());
  128. noreasonBack.setNoreasonBackBackName(c.getRelationBackName());
  129. noreasonBack.setNoreasonBackBackTel(c.getRelationBackTel());
  130. noreasonBack.setNoreasonBackBackLogisticsCompany(c.getRelationBackLogisticsCompany());
  131. noreasonBack.setNoreasonBackBackLogisticsNo(c.getRelationBackLogisticsNo());
  132. noreasonBack.setNoreasonBackBackPostage(c.getRelationBackPostage());
  133. noreasonBack.setNoreasonBackBackMachineNo(c.getRelationBackMachineNo());
  134. noreasonBack.setNoreasonBackDesc(c.getRelationDesc());
  135. noreasonBack.setNoreasonBackState(c.getRelationState());
  136. noreasonBack.setNoreasonBackAlipay(c.getRelationAlipay());
  137. noreasonBack.setNoreasonBackAlipayName(c.getRelationAlipayName());
  138. noreasonBack.setNoreasonBackIsTransfer(c.getRelationIsTransfer());
  139. noreasonBack.setNoreasonBackCreateTime(c.getRelationCreateTime());
  140. noreasonBack.setNoreasonBackUpdateTime(c.getRelationUpdateTime());
  141. return noreasonBack;
  142. default :
  143. return null;
  144. }
  145. }
  146. /**
  147. * 封装参数
  148. * @param solve 处理类型
  149. * @param object
  150. * @return
  151. */
  152. @Deprecated
  153. public static CustomerCommon getCustomerCommon(int solve, Object object) {
  154. if (object == null) {
  155. return null;
  156. }
  157. CustomerCommon customerCommon = new CustomerCommon();
  158. switch (solve) {
  159. case 3://换新
  160. Renewed renewed = (Renewed)object;
  161. customerCommon.setRelationId(renewed.getRenewedId());
  162. customerCommon.setCustomerId(renewed.getCustomerId());
  163. customerCommon.setOrderId(renewed.getOrderId());
  164. customerCommon.setSignclosedId(renewed.getSignclosedId());
  165. customerCommon.setRelationBackEfastOrderId(renewed.getRenewedBackEfastOrderId());
  166. customerCommon.setRelationBackStatus(renewed.getRenewedBackStatus());
  167. customerCommon.setRelationBackName(renewed.getRenewedBackName());
  168. customerCommon.setRelationBackTel(renewed.getRenewedBackTel());
  169. customerCommon.setRelationBackLogisticsCompany(renewed.getRenewedBackLogisticsCompany());
  170. customerCommon.setRelationBackLogisticsNo(renewed.getRenewedBackLogisticsNo());
  171. customerCommon.setRelationBackPostage(renewed.getRenewedBackPostage());
  172. customerCommon.setRelationBackMachineNo(renewed.getRenewedBackMachineNo());
  173. customerCommon.setRelationSendStatus(renewed.getRenewedSendStatus());
  174. customerCommon.setRelationSendName(renewed.getRenewedSendName());
  175. customerCommon.setRelationSendTel(renewed.getRenewedSendTel());
  176. customerCommon.setProvinceNumber(renewed.getProvinceNumber());
  177. customerCommon.setCityNumber(renewed.getCityNumber());
  178. customerCommon.setAreaNumber(renewed.getAreaNumber());
  179. customerCommon.setRelationSendMergeAddress(renewed.getRenewedSendMergeAddress());
  180. customerCommon.setRelationSendAddress(renewed.getRenewedSendAddress());
  181. customerCommon.setRelationSendLogisticsCompany(renewed.getRenewedSendLogisticsCompany());
  182. customerCommon.setRelationSendLogisticsNo(renewed.getRenewedSendLogisticsNo());
  183. customerCommon.setRelationDesc(renewed.getRenewedDesc());
  184. customerCommon.setRelationState(renewed.getRenewedState());
  185. customerCommon.setRelationAlipay(renewed.getRenewedAlipay());
  186. customerCommon.setRelationAlipayName(renewed.getRenewedAlipayName());
  187. customerCommon.setRelationIsTransfer(renewed.getRenewedIsTransfer());
  188. customerCommon.setRelationCreateTime(renewed.getRenewedCreateTime());
  189. customerCommon.setRelationUpdateTime(renewed.getRenewedUpdateTime());
  190. customerCommon.setMaintenanceIsRepair(renewed.getMaintenanceIsRepair());
  191. break;
  192. case 4://维修
  193. Repair repair = (Repair)object;
  194. customerCommon.setRelationId(repair.getRepairId());
  195. customerCommon.setCustomerId(repair.getCustomerId());
  196. customerCommon.setOrderId(repair.getOrderId());
  197. customerCommon.setSignclosedId(repair.getSignclosedId());
  198. customerCommon.setRelationBackEfastOrderId(repair.getRepairBackEfastOrderId());
  199. customerCommon.setRelationBackStatus(repair.getRepairBackStatus());
  200. customerCommon.setRelationBackName(repair.getRepairBackName());
  201. customerCommon.setRelationBackTel(repair.getRepairBackTel());
  202. customerCommon.setRelationBackLogisticsCompany(repair.getRepairBackLogisticsCompany());
  203. customerCommon.setRelationBackLogisticsNo(repair.getRepairBackLogisticsNo());
  204. customerCommon.setRelationBackPostage(repair.getRepairBackPostage());
  205. customerCommon.setRelationBackMachineNo(repair.getRepairBackMachineNo());
  206. customerCommon.setRelationSendStatus(repair.getRepairSendStatus());
  207. customerCommon.setRelationSendName(repair.getRepairSendName());
  208. customerCommon.setRelationSendTel(repair.getRepairSendTel());
  209. customerCommon.setProvinceNumber(repair.getProvinceNumber());
  210. customerCommon.setCityNumber(repair.getCityNumber());
  211. customerCommon.setAreaNumber(repair.getAreaNumber());
  212. customerCommon.setRelationSendMergeAddress(repair.getRepairSendMergeAddress());
  213. customerCommon.setRelationSendAddress(repair.getRepairSendAddress());
  214. customerCommon.setRelationSendLogisticsCompany(repair.getRepairSendLogisticsCompany());
  215. customerCommon.setRelationSendLogisticsNo(repair.getRepairSendLogisticsNo());
  216. customerCommon.setRelationDesc(repair.getRepairDesc());
  217. customerCommon.setRelationState(repair.getRepairState());
  218. customerCommon.setRelationAlipay(repair.getRepairAlipay());
  219. customerCommon.setRelationAlipayName(repair.getRepairAlipayName());
  220. customerCommon.setRelationIsTransfer(repair.getRepairIsTransfer());
  221. customerCommon.setRelationCreateTime(repair.getRepairCreateTime());
  222. customerCommon.setRelationUpdateTime(repair.getRepairUpdateTime());
  223. customerCommon.setMaintenanceIsRepair(repair.getMaintenanceIsRepair());
  224. customerCommon.setDetectState(repair.getDetectState());
  225. customerCommon.setRelationFactoryCosts(repair.getRepairFactoryCosts()== null ? null: repair.getRepairFactoryCosts()/100);
  226. customerCommon.setRelationCustomerCosts(repair.getRepairCustomerCosts() == null ? null:repair.getRepairCustomerCosts()/100);
  227. break;
  228. case 5://补发
  229. Reissue reissue = (Reissue)object;
  230. customerCommon.setRelationId(reissue.getReissueId());
  231. customerCommon.setCustomerId(reissue.getCustomerId());
  232. customerCommon.setOrderId(reissue.getOrderId());
  233. customerCommon.setRelationBackEfastOrderId(reissue.getReissueBackEfastOrderId());
  234. customerCommon.setRelationSendStatus(reissue.getReissueSendStatus());
  235. customerCommon.setRelationSendName(reissue.getReissueSendName());
  236. customerCommon.setRelationSendTel(reissue.getReissueSendTel());
  237. customerCommon.setProvinceNumber(reissue.getProvinceNumber());
  238. customerCommon.setCityNumber(reissue.getCityNumber());
  239. customerCommon.setAreaNumber(reissue.getAreaNumber());
  240. customerCommon.setRelationSendMergeAddress(reissue.getReissueSendMergeAddress());
  241. customerCommon.setRelationSendAddress(reissue.getReissueSendAddress());
  242. customerCommon.setRelationSendLogisticsCompany(reissue.getReissueSendLogisticsCompany());
  243. customerCommon.setRelationSendLogisticsNo(reissue.getReissueSendLogisticsNo());
  244. customerCommon.setRelationDesc(reissue.getReissueDesc());
  245. customerCommon.setRelationState(reissue.getReissueState());
  246. customerCommon.setRelationCreateTime(reissue.getReissueCreateTime());
  247. customerCommon.setRelationUpdateTime(reissue.getReissueUpdateTime());
  248. break;
  249. case 6://退货
  250. BackGoods backGoods = (BackGoods)object;
  251. customerCommon.setRelationId(backGoods.getBackGoodsId());
  252. customerCommon.setCustomerId(backGoods.getCustomerId());
  253. customerCommon.setOrderId(backGoods.getOrderId());
  254. customerCommon.setSignclosedId(backGoods.getSignclosedId());
  255. customerCommon.setRelationBackStatus(backGoods.getBackGoodsBackStatus());
  256. customerCommon.setRelationBackName(backGoods.getBackGoodsBackName());
  257. customerCommon.setRelationBackTel(backGoods.getBackGoodsBackTel());
  258. customerCommon.setRelationBackLogisticsCompany(backGoods.getBackGoodsBackLogisticsCompany());
  259. customerCommon.setRelationBackLogisticsNo(backGoods.getBackGoodsBackLogisticsNo());
  260. customerCommon.setRelationBackPostage(backGoods.getBackGoodsBackPostage());
  261. customerCommon.setRelationBackMachineNo(backGoods.getBackGoodsBackMachineNo());
  262. customerCommon.setRelationDesc(backGoods.getBackGoodsDesc());
  263. customerCommon.setRelationState(backGoods.getBackGoodsState());
  264. customerCommon.setRelationAlipay(backGoods.getBackGoodsAlipay());
  265. customerCommon.setRelationAlipayName(backGoods.getBackGoodsAlipayName());
  266. customerCommon.setRelationIsTransfer(backGoods.getBackGoodsIsTransfer());
  267. customerCommon.setRelationCreateTime(backGoods.getBackGoodsCreateTime());
  268. customerCommon.setRelationUpdateTime(backGoods.getBackGoodsUpdateTime());
  269. customerCommon.setDetectState(backGoods.getDetectState());
  270. break;
  271. case 7://无理由退货
  272. NoreasonBack noreasonBack = (NoreasonBack)object;
  273. customerCommon.setRelationId(noreasonBack.getNoreasonBackId());
  274. customerCommon.setCustomerId(noreasonBack.getCustomerId());
  275. customerCommon.setOrderId(noreasonBack.getOrderId());
  276. customerCommon.setSignclosedId(noreasonBack.getSignclosedId());
  277. customerCommon.setRelationBackStatus(noreasonBack.getNoreasonBackBackStatus());
  278. customerCommon.setRelationBackName(noreasonBack.getNoreasonBackBackName());
  279. customerCommon.setRelationBackTel(noreasonBack.getNoreasonBackBackTel());
  280. customerCommon.setRelationBackLogisticsCompany(noreasonBack.getNoreasonBackBackLogisticsCompany());
  281. customerCommon.setRelationBackLogisticsNo(noreasonBack.getNoreasonBackBackLogisticsNo());
  282. customerCommon.setRelationBackPostage(noreasonBack.getNoreasonBackBackPostage());
  283. customerCommon.setRelationBackMachineNo(noreasonBack.getNoreasonBackBackMachineNo());
  284. customerCommon.setRelationDesc(noreasonBack.getNoreasonBackDesc());
  285. customerCommon.setRelationState(noreasonBack.getNoreasonBackState());
  286. customerCommon.setRelationAlipay(noreasonBack.getNoreasonBackAlipay());
  287. customerCommon.setRelationAlipayName(noreasonBack.getNoreasonBackAlipayName());
  288. customerCommon.setRelationIsTransfer(noreasonBack.getNoreasonBackIsTransfer());
  289. customerCommon.setRelationCreateTime(noreasonBack.getNoreasonBackCreateTime());
  290. customerCommon.setRelationUpdateTime(noreasonBack.getNoreasonBackUpdateTime());
  291. customerCommon.setDetectState(noreasonBack.getDetectState());
  292. break;
  293. default:
  294. customerCommon = null;
  295. break;
  296. }
  297. return customerCommon;
  298. }
  299. /**
  300. * 封装参数 list
  301. * @param solve 处理类型
  302. * @param relationList
  303. * @return
  304. */
  305. @Deprecated
  306. public static List<CustomerCommon> listToCustomerCommon(int solve,List<?> relationList){
  307. List<CustomerCommon> ccList = new ArrayList<>();
  308. for (Object relation : relationList){
  309. CustomerCommon cc = CustomerCommonUtil.getCustomerCommon(solve,relationList);
  310. ccList.add(cc);
  311. }
  312. return ccList;
  313. }
  314. /**
  315. * 将所有的寄回寄出中的类型改为 type
  316. * 售后类型 3:换新;4:维修;5:补发;6:退货;7:无理由退货
  317. * @param type
  318. */
  319. @Deprecated
  320. public static void setProduceOrFitting(Integer type,CustomerCommon cc){
  321. for (int i=0;i<cc.getSendProdcues().size();i++) {
  322. cc.getSendProdcues().get(i).setSendProduceType(type);
  323. cc.getSendProdcues().get(i).setRelationId(cc.getRelationId());
  324. }
  325. for (int i=0;i<cc.getSendFittings().size();i++) {
  326. cc.getSendFittings().get(i).setSendFittingType(type);
  327. cc.getSendFittings().get(i).setRelationId(cc.getRelationId());
  328. }
  329. for (int i=0;i<cc.getClosedProdcues().size();i++) {
  330. cc.getClosedProdcues().get(i).setClosedProdcueType(type);
  331. cc.getClosedProdcues().get(i).setRelationId(cc.getRelationId());
  332. }
  333. for (int i=0;i<cc.getClosedFittings().size();i++) {
  334. cc.getClosedFittings().get(i).setClosedFittingType(type);
  335. cc.getClosedFittings().get(i).setRelationId(cc.getRelationId());
  336. }
  337. }
  338. /**
  339. * 将所有的寄回寄出中的类型改为 type
  340. * @param cc
  341. */
  342. public static void setProduceOrFitting(CmRelation cc){
  343. for (int i=0;i<cc.getSendProdcues().size();i++) {
  344. cc.getSendProdcues().get(i).setRelationId(cc.getRelationId());
  345. }
  346. for (int i=0;i<cc.getClosedProdcues().size();i++) {
  347. cc.getClosedProdcues().get(i).setRelationId(cc.getRelationId());
  348. }
  349. }
  350. }