AdminCustomerController.java 65 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625
  1. package com.iamberry.rst.controllers.cm;
  2. import com.iamberry.rst.core.address.City;
  3. import com.iamberry.rst.core.cm.*;
  4. import com.iamberry.rst.core.order.Product;
  5. import com.iamberry.rst.core.order.ProductColor;
  6. import com.iamberry.rst.core.order.ProductType;
  7. import com.iamberry.rst.core.page.PagedResult;
  8. import com.iamberry.rst.core.sys.Admin;
  9. import com.iamberry.rst.faces.address.AddressService;
  10. import com.iamberry.rst.faces.cm.*;
  11. import com.iamberry.rst.faces.product.ProductService;
  12. import com.iamberry.rst.faces.sms.SmsService;
  13. import com.iamberry.rst.faces.sys.SysService;
  14. import com.iamberry.rst.util.SmsConfig;
  15. import com.iamberry.rst.utils.AdminUtils;
  16. import com.iamberry.rst.utils.OrderNoUtil;
  17. import com.iamberry.rst.utils.StitchAttrUtil;
  18. import com.iamberry.wechat.tools.NameUtils;
  19. import com.iamberry.wechat.tools.ResponseJson;
  20. import net.sf.json.JSONArray;
  21. import org.apache.commons.codec.binary.Base64;
  22. import org.apache.commons.lang.StringUtils;
  23. import org.apache.shiro.authz.annotation.RequiresPermissions;
  24. import org.slf4j.Logger;
  25. import org.slf4j.LoggerFactory;
  26. import org.springframework.beans.factory.annotation.Autowired;
  27. import org.springframework.stereotype.Controller;
  28. import org.springframework.web.bind.annotation.RequestMapping;
  29. import org.springframework.web.bind.annotation.RequestParam;
  30. import org.springframework.web.bind.annotation.ResponseBody;
  31. import org.springframework.web.servlet.ModelAndView;
  32. import javax.servlet.http.HttpServletRequest;
  33. import java.text.MessageFormat;
  34. import java.util.ArrayList;
  35. import java.util.Date;
  36. import java.util.List;
  37. import java.util.Map;
  38. /**
  39. * Created by wxm
  40. */
  41. @Controller
  42. @RequestMapping("/admin/customer")
  43. public class AdminCustomerController {
  44. private Logger logger = LoggerFactory.getLogger(AdminCustomerController.class);
  45. @Autowired
  46. private CompanyInfoService companyInfoService;
  47. @Autowired
  48. private StoreInfoService storeInfoService;
  49. @Autowired
  50. private SalesOrderService salesOrderService;
  51. @Autowired
  52. private CustomerService customerService;
  53. @Autowired
  54. private ProductService productService;
  55. @Autowired
  56. private SysService sysService;
  57. @Autowired
  58. private ComplaintTypeInfoService complaintTypeInfoService;
  59. @Autowired
  60. private VisitService visitService;
  61. @Autowired
  62. private QuestionDescribeService questionDescribeService;
  63. @Autowired
  64. private RenewedService renewedService;
  65. @Autowired
  66. private RepairService repairService;
  67. @Autowired
  68. private BackGoodsService backGoodsService;
  69. @Autowired
  70. private FittingsInfoService fittingsInfoService;
  71. @Autowired
  72. private ReissueService reissueService;
  73. @Autowired
  74. private NoreasonBackService noreasonBackService;
  75. @Autowired
  76. private ComplaintQuestionInfoService complaintQuestionInfoService;
  77. @Autowired
  78. private SmsService smsService;
  79. @Autowired
  80. private ComplaintSignclosedInfoService complaintSignclosedInfoService;
  81. @Autowired
  82. private ComplaintSmallClassInfoService complaintSmallClassInfoService;
  83. @Autowired
  84. private CustomerCommonService customerCommonService;
  85. @Autowired
  86. private AddressService addressService;
  87. /**
  88. * 获取客诉列表
  89. *
  90. * @param request
  91. * @return
  92. */
  93. @RequiresPermissions("customer:list:customer")
  94. @RequestMapping("/_customer_list")
  95. public ModelAndView getCustomer(HttpServletRequest request, CustomerInfo customer,
  96. @RequestParam(value = "pageSize", defaultValue = "10", required = false) Integer pageSize,
  97. @RequestParam(value = "pageNO", defaultValue = "1", required = false) Integer pageNO,
  98. @RequestParam(value = "totalNum", defaultValue = "0", required = false) Integer totalNum) {
  99. ModelAndView mv = new ModelAndView("cm/customer/custome_list");
  100. // PagedResult<Customer> pagedResult = ptsBomService.listCustomer(pageNO, pageSize, ptsBom, totalNum == 0);
  101. // if (totalNum != 0) {
  102. // pagedResult.setTotal(totalNum);
  103. // }
  104. // //获取产品集合,用于页面选择产品
  105. // List<Produce> list = produceService.getProduceList();
  106. // mv.addObject("produceList", list);
  107. // StitchAttrUtil.setModelAndView(customer, mv, "/admin/bom/_bom_list", pagedResult);
  108. return mv;
  109. }
  110. /**
  111. * 跳转到添加客诉页面
  112. *
  113. * @return
  114. */
  115. @RequiresPermissions("customer:add:customer")
  116. @RequestMapping(value = "/to_add_customer")
  117. public ModelAndView toAddCustomer(HttpServletRequest request) {
  118. ModelAndView mv = new ModelAndView("cm/customer/add_customer");
  119. //获取产品集合,用于页面选择产品
  120. // List<Produce> produceList = produceService.getProduceList();
  121. // mv.addObject("produceList", produceList);
  122. return mv;
  123. }
  124. /**
  125. * 跳转到修改客诉页面
  126. *
  127. * @return
  128. */
  129. @RequiresPermissions("customer:update:customer")
  130. @RequestMapping(value = "/to_update_customer")
  131. public ModelAndView toUpdateCustomer(HttpServletRequest request,Integer customerId) {
  132. ModelAndView mv = new ModelAndView("cm/customer/update_customer");
  133. ProductType productType = new ProductType();
  134. //查询产品类型集合
  135. List<ProductType> typeList = productService.listProductType(productType);
  136. //查询客诉类型集合
  137. List<ComplaintTypeInfo> complaintTypeList = complaintTypeInfoService.listComplaintTypeInfo(new ComplaintTypeInfo());
  138. //查询跟进客服集合
  139. Admin admin = new Admin();
  140. admin.setAdminStatus(1);
  141. List<Admin> adminList = sysService.listSelectAdmin(admin);
  142. //获取登录人id
  143. Integer loginAdminId = AdminUtils.getLoginAdminId();
  144. //查询客诉基本信息
  145. CustomerInfo customerInfo = customerService.getCustomerInfo(customerId);
  146. /*客诉信息处理-stast*/
  147. //对于区域处理
  148. if(customerInfo!=null && customerInfo.getCustomerArea() != null){
  149. // String[] customerAreaAndCity = customerInfo.getCustomerArea().split("-");
  150. // customerInfo.setProvinceName(customerAreaAndCity[0]);
  151. // City city
  152. // addressService.listCity(customerAreaAndCity[0]);
  153. // customerInfo.setCityName(customerAreaAndCity[0]);
  154. }
  155. /*客诉信息处理-end*/
  156. CustomerCommon customerCommon = new CustomerCommon();
  157. if(customerInfo.getCustomerIsSolve() != null){
  158. switch (customerInfo.getCustomerIsSolve()){ //处理结果: 1:已解决 2:未解决 3:换新 4:维修 5:补发 6:退货 7:无理由退货
  159. case 3://获取换新
  160. Renewed renewed = new Renewed();
  161. renewed.setCustomerId(customerInfo.getCustomerId());
  162. renewed = renewedService.getRenewed(renewed);
  163. customerCommon = customerCommon.getCustomerCommon(3,renewed);
  164. break;
  165. case 4://维修
  166. Repair repair = new Repair();
  167. repair.setCustomerId(customerInfo.getCustomerId());
  168. repair = repairService.getRepair(repair);
  169. customerCommon = customerCommon.getCustomerCommon(4,repair);
  170. break;
  171. case 5:
  172. Reissue reissue = new Reissue();
  173. reissue.setCustomerId(customerInfo.getCustomerId());
  174. reissue = reissueService.getReissue(reissue);
  175. customerCommon = customerCommon.getCustomerCommon(5,reissue);
  176. break;
  177. case 6:
  178. BackGoods backGoods = new BackGoods();
  179. backGoods.setCustomerId(customerInfo.getCustomerId());
  180. backGoods = backGoodsService.getBackGoods(backGoods);
  181. customerCommon = customerCommon.getCustomerCommon(6,backGoods);
  182. break;
  183. case 7:
  184. NoreasonBack noreasonBack = new NoreasonBack();
  185. noreasonBack.setCustomerId(customerInfo.getCustomerId());
  186. noreasonBack = noreasonBackService.getNoreasonBack(noreasonBack);
  187. customerCommon = customerCommon.getCustomerCommon(7,noreasonBack);
  188. break;
  189. }
  190. /*查询所有需要寄入寄出的产品*/
  191. customerCommon.setCustomerIsSolve(customerInfo.getCustomerIsSolve());
  192. customerCommon = customerCommonService.getListProduceAndFitting(customerCommon);
  193. mv.addObject("customerCommon", customerCommon);
  194. /*查询所有的产品,颜色和配件信息*/
  195. List<Product> productList = productService.listProduce(new Product());
  196. for(Product product : productList){
  197. ProductColor productColor = new ProductColor();
  198. productColor.setColorProductId(product.getProductId());
  199. List<ProductColor> productColorList = productService.listProduceColor(productColor);
  200. product.setColorList(productColorList);
  201. FittingsInfo fittingsInfo = new FittingsInfo();
  202. fittingsInfo.setProductId(product.getProductId());
  203. List<FittingsInfo> fittingsInfoList = fittingsInfoService.listFittings(fittingsInfo);
  204. product.setFittingsList(fittingsInfoList);
  205. }
  206. mv.addObject("productList", productList);
  207. if(customerCommon.getOrderId() != null){
  208. /*查询订单信息*/
  209. SalesOrder salesOrder = salesOrderService.getSalesOrderById(customerCommon.getOrderId());
  210. SalesOrderItem salesOrderItem = new SalesOrderItem();
  211. salesOrderItem.setItemOrderId(salesOrder.getSalesId());
  212. List<SalesOrderItem> salesOrderItemList = salesOrderService.listSalesOrderItem(salesOrderItem);
  213. salesOrder.setSalesOrderItemList(salesOrderItemList);
  214. mv.addObject("salesOrder", salesOrder);
  215. }
  216. }
  217. if ("2".equals(customerInfo.getCustomerIsVisit())){ //1:不需要回访 2:需要回访
  218. Visit visit = new Visit();
  219. visit.setCustomerId(customerInfo.getCustomerId());
  220. visit = visitService.getVisit(visit);
  221. mv.addObject("visit", visit);
  222. }
  223. //查询关联问题
  224. ComplaintQuestionInfo complaintQuestionInfo = complaintQuestionInfoService.getQuestionById(customerInfo.getQuestionId());
  225. //查询问题小类
  226. ComplaintSmallClassInfo complaintSmallClassInfo = new ComplaintSmallClassInfo();
  227. complaintSmallClassInfo.setComplaintId(complaintQuestionInfo.getComplaintId());
  228. List<ComplaintSmallClassInfo> complaintSmallClassInfoList = complaintSmallClassInfoService.listComplaintSmallClassInfo(complaintSmallClassInfo);
  229. //查询问题大类
  230. ComplaintTypeInfo complaintTypeInfo = new ComplaintTypeInfo();
  231. List<ComplaintTypeInfo> complaintTypeInfoList = complaintTypeInfoService.listComplaintTypeInfo(complaintTypeInfo);
  232. mv.addObject("customerInfo", customerInfo);
  233. mv.addObject("typeList", typeList);
  234. mv.addObject("complaintTypeList", complaintTypeList);
  235. mv.addObject("complaintTypeList", complaintTypeList);
  236. mv.addObject("adminList", adminList);
  237. mv.addObject("loginAdminId", loginAdminId);
  238. mv.addObject("complaintQuestionInfo", complaintQuestionInfo);
  239. mv.addObject("complaintSmallClassInfoList", complaintSmallClassInfoList);
  240. mv.addObject("complaintTypeInfoList", complaintTypeInfoList);
  241. //mv.addObject("questionDescribe", questionDescribe);
  242. return mv;
  243. }
  244. /**
  245. * 查询问题描述
  246. * @return
  247. */
  248. @ResponseBody
  249. @RequiresPermissions("customer:add:customer")
  250. @RequestMapping(value = "/select_question_describe")
  251. public ResponseJson selectQuestionDescribe(HttpServletRequest request, Integer customerId) throws Exception {
  252. if(customerId == null || customerId == 0){
  253. return new ResponseJson(500, "未获取到问题描述", 500);
  254. }
  255. //查询问题描述表
  256. QuestionDescribe questionDescribe = new QuestionDescribe();
  257. questionDescribe.setCustomerId(customerId);
  258. questionDescribe = questionDescribeService.listQuestionDescribe(questionDescribe).get(0);
  259. ResponseJson rj = new ResponseJson(200, "查询成功", 200);
  260. rj.addResponseKeyValue("questionDescribe", questionDescribe);
  261. return rj;
  262. }
  263. /**
  264. * 搜索订单列表弹出框
  265. *
  266. * @return
  267. */
  268. @RequiresPermissions("customer:add:customer")
  269. @RequestMapping(value = "/select_order")
  270. public ModelAndView selectOrder(HttpServletRequest request) {
  271. ModelAndView mv = new ModelAndView("cm/customer/order_list");
  272. //获取销售公司
  273. List<CompanyInfo> companyInfoList = companyInfoService.listCompanyInfo(new CompanyInfo());
  274. mv.addObject("companyInfoList", companyInfoList);
  275. return mv;
  276. }
  277. /**
  278. * 添加订单列表弹出框
  279. *
  280. * @return
  281. */
  282. @RequiresPermissions("customer:add:customer")
  283. @RequestMapping(value = "/add_order")
  284. public ModelAndView addOder(HttpServletRequest request) {
  285. ModelAndView mv = new ModelAndView("cm/customer/order_add");
  286. return mv;
  287. }
  288. /**
  289. * 添加订单
  290. *
  291. * @return
  292. */
  293. @ResponseBody
  294. @RequiresPermissions("customer:add:customer")
  295. @RequestMapping(value = "/add_order_info")
  296. public ResponseJson addOrderInfo(HttpServletRequest request, SalesOrder salesOrder, String itemJson) throws Exception {
  297. List<SalesOrderItem> list = new ArrayList<>();
  298. JSONArray jsonArray = JSONArray.fromObject(itemJson);
  299. list = (List) JSONArray.toCollection(jsonArray, SalesOrderItem.class);
  300. Integer salesAmount = 0;
  301. for (int i = 0; i < list.size(); i++) {
  302. SalesOrderItem salesOrderItem = list.get(i);
  303. if (salesOrderItem.getItemIsSource() == 1) { //产品来源 1:产品颜色表,2:配件表
  304. Product product = productService.getProductById(salesOrderItem.getItemProductId());
  305. ProductColor productColor = productService.getProduceColor(salesOrderItem.getItemProductId());
  306. salesOrderItem.setItemProductType(product.getProductType());
  307. salesOrderItem.setItemProductName(product.getProductName());
  308. salesOrderItem.setItemProductPic(productColor.getColorPicture());
  309. salesOrderItem.setItemProductColor(productColor.getColorName());
  310. salesOrderItem.setItemColorBar(productColor.getColorBar());
  311. salesOrderItem.setItemProductPrice(productColor.getColorPrice());
  312. salesOrderItem.setItemProductDiscount(productColor.getColorDiscount());
  313. salesOrderItem.setItemIsSource(1);
  314. salesAmount += productColor.getColorDiscount();
  315. } else if (salesOrderItem.getItemIsSource() == 2) {
  316. Product product = productService.getProductById(salesOrderItem.getItemProductId());
  317. FittingsInfo fittingsInfo = fittingsInfoService.getFittingsById(salesOrderItem.getItemColorId());
  318. salesOrderItem.setItemProductType(product.getProductType());
  319. salesOrderItem.setItemProductName(product.getProductName());
  320. salesOrderItem.setItemProductColor(fittingsInfo.getFittingsName());
  321. salesOrderItem.setItemColorBar(fittingsInfo.getFittingsBar());
  322. salesOrderItem.setItemProductPrice(fittingsInfo.getFittingsPrice());
  323. salesOrderItem.setItemProductDiscount(fittingsInfo.getFittingsDiscount());
  324. salesOrderItem.setItemIsSource(2);
  325. salesAmount += fittingsInfo.getFittingsDiscount();
  326. }
  327. }
  328. salesOrder.setSalesOpenId("0");
  329. salesOrder.setSalesAmount(salesAmount);
  330. salesOrder.setSalesPayMoney(salesAmount);
  331. salesOrder.setSalesOrderStatus(1);
  332. salesOrder.setSalesCreateTime(new Date());
  333. //salesOrder.setSalesPayTime(new Date());
  334. salesOrder.setSalesLastMoney(salesAmount);
  335. salesOrder.setSalesWaitMoney(0);
  336. salesOrder.setSalesPayMoney(salesAmount);
  337. salesOrder.setSalesSalesTime(new Date());
  338. salesOrder.setSalesDiscountMoney(salesAmount);
  339. salesOrder.setSalesPledgeMoney(0);
  340. salesOrder.setSalesRemainDeposit(0);
  341. salesOrder.setSalesType(1);
  342. salesOrder.setSalesStatus(1);//确认状态:0(未确认)1(确认)2(挂起)3(作废)
  343. salesOrder.setSalesShippingStatus(1); //发货状态: 0(未发货)1(已发货,即已扫描出库)3(备货中)*****+++
  344. salesOrder.setSalesPayStatus(2); //已付款
  345. salesOrder.setSalesProcessStatus(0); //单据状态:0(正常单)1(问题单)
  346. salesOrder.setSalesIsSend(0); //0:否 1:是 是否通知配货
  347. salesOrder.setSalesIsLocked(0); //是否锁定 0:否 1:是
  348. salesOrder.setSalesIsSeparate(0); //是否缺货 0:否 1:是
  349. salesOrder.setSalesShippingFee(0); //邮费
  350. Integer adminId = AdminUtils.getLoginAdminId();
  351. String orderCode = OrderNoUtil.createOrderCode(adminId);
  352. salesOrder.setSalesDealCode(orderCode);
  353. salesOrder.setSalesOrderId(orderCode);
  354. //salesOrder = salesOrderService.addOrderAndIteminfo(salesOrder,list);
  355. salesOrder.setSalesOrderItemList(list);
  356. try {
  357. Map<String, Object> map = customerService.sendEfastOrder(salesOrder);
  358. // if (map.get("status") == 1) {
  359. // salesOrder.setSalesOrderId((String) map.get("EfastOrderId"));
  360. // }
  361. } catch (RuntimeException e) {
  362. return new ResponseJson(500, "添加订单成功--"+ e.getMessage(), 500);
  363. }
  364. Integer orderId = salesOrder.getSalesId();
  365. ResponseJson rj = new ResponseJson(200, "添加订单成功", 200);
  366. rj.addResponseKeyValue("orderId", orderId);
  367. return rj;
  368. }
  369. /**
  370. * 获取店铺集合
  371. *
  372. * @param request
  373. * @param storeInfo
  374. * @return
  375. */
  376. @ResponseBody
  377. @RequiresPermissions("customer:add:customer")
  378. @RequestMapping(value = "/select_storeInfo")
  379. public ResponseJson listStoreInfo(HttpServletRequest request, StoreInfo storeInfo) {
  380. storeInfo.setStoreStatus(1);
  381. List<StoreInfo> storeInfoList = storeInfoService.listStore(storeInfo);
  382. if (storeInfoList == null || storeInfoList.size() < 1) {
  383. return new ResponseJson(500, "查询失败", 500);
  384. } else {
  385. ResponseJson rj = new ResponseJson(200, "查询成功", 200);
  386. rj.addResponseKeyValue("storeInfoList", storeInfoList);
  387. return rj;
  388. }
  389. }
  390. /**
  391. * 获取订单集合
  392. *
  393. * @param request
  394. * @param salesOrder
  395. * @return
  396. */
  397. @ResponseBody
  398. @RequiresPermissions("customer:add:customer")
  399. @RequestMapping(value = "/select_salesOrder")
  400. public ResponseJson listOrder(HttpServletRequest request, SalesOrder salesOrder,
  401. @RequestParam(value = "pageSize", defaultValue = "10", required = false) Integer pageSize,
  402. @RequestParam(value = "pageNO", defaultValue = "1", required = false) Integer pageNO,
  403. @RequestParam(value = "totalNum", defaultValue = "0", required = false) Integer totalNum) {
  404. //分页获取订单信息
  405. PagedResult<SalesOrder> pagedResult = salesOrderService.listSalesOrderPage(pageNO, pageSize, salesOrder, totalNum == 0);
  406. List<SalesOrder> salesOrderList = pagedResult.getDataList();
  407. for (SalesOrder order : salesOrderList) {
  408. SalesOrderItem salesOrderItem = new SalesOrderItem();
  409. salesOrderItem.setItemOrderId(order.getSalesId());
  410. List<SalesOrderItem> salesOrderItemList = salesOrderService.listSalesOrderItem(salesOrderItem);
  411. order.setSalesOrderItemList(salesOrderItemList);
  412. }
  413. if (salesOrderList == null || salesOrderList.size() < 1) {
  414. return new ResponseJson(500, "查询失败", 500);
  415. } else {
  416. ResponseJson rj = new ResponseJson(200, "查询成功", 200);
  417. rj.addResponseKeyValue("salesOrderList", salesOrderList);
  418. return rj;
  419. }
  420. }
  421. /**
  422. * 分页查询客诉列表信息
  423. *
  424. * @param request
  425. * @param customerInfo
  426. * @param pageSize
  427. * @param pageNO
  428. * @param totalNum
  429. * @return
  430. * @throws Exception
  431. */
  432. @RequiresPermissions("customer:select:customer")
  433. @RequestMapping("/select_customer_list")
  434. public ModelAndView selectCustomerList(HttpServletRequest request, CustomerInfo customerInfo,
  435. @RequestParam(value = "pageSize", defaultValue = "10", required = false) Integer pageSize,
  436. @RequestParam(value = "pageNO", defaultValue = "1", required = false) Integer pageNO,
  437. @RequestParam(value = "totalNum", defaultValue = "0", required = false) Integer totalNum) throws Exception {
  438. ModelAndView mv = new ModelAndView("cm/customer/custome_list");
  439. if(customerInfo.getAdminId() == null){
  440. //获取登录员工id
  441. Integer adminId = AdminUtils.getLoginAdminId();
  442. customerInfo.setAdminId(adminId);
  443. }
  444. PagedResult<CustomerInfo> pagedResult = customerService.listCustomer(pageNO, pageSize, customerInfo, totalNum == 0);
  445. if (totalNum != 0) {
  446. pagedResult.setTotal(totalNum);
  447. }
  448. ProductType productType = new ProductType();
  449. //查询产品类型集合
  450. List<ProductType> typeList = productService.listProductType(productType);
  451. //查询客诉类型集合
  452. List<ComplaintTypeInfo> complaintTypeList = complaintTypeInfoService.listComplaintTypeInfo(new ComplaintTypeInfo());
  453. //查询跟进客服集合
  454. Admin admin = new Admin();
  455. admin.setAdminStatus(1);
  456. List<Admin> adminList = sysService.listSelectAdmin(admin);
  457. //获取登录人id
  458. Integer loginAdminId = AdminUtils.getLoginAdminId();
  459. mv.addObject("loginAdminId", loginAdminId);
  460. mv.addObject("typeList", typeList);
  461. mv.addObject("complaintTypeList", complaintTypeList);
  462. mv.addObject("adminList", adminList);
  463. customerInfo.setVisit(null);
  464. customerInfo.setCustomerCommon(null);
  465. customerInfo.setComplaintDetectList(null);
  466. StitchAttrUtil.setModelAndView(customerInfo, mv, "/admin/customer/select_customer_list", pagedResult);
  467. return mv;
  468. }
  469. /**
  470. * 进入客诉基本信息页面
  471. *
  472. * @param request
  473. * @return
  474. * @throws Exception
  475. */
  476. @RequiresPermissions("customer:select:customer")
  477. @RequestMapping("/_customer_info")
  478. public ModelAndView toCustomerInfo(HttpServletRequest request) throws Exception {
  479. ModelAndView mv = new ModelAndView("cm/customer/custome_detail");
  480. String customerId = request.getParameter("customerId");
  481. mv.addObject("customerId", customerId);
  482. return mv;
  483. }
  484. /**
  485. * 查询客诉基本信息
  486. *
  487. * @param request
  488. * @return
  489. * @throws Exception
  490. */
  491. @ResponseBody
  492. @RequiresPermissions("customer:select:customer")
  493. @RequestMapping("/get_customer_info")
  494. public ResponseJson getCustomerInfo(HttpServletRequest request) throws Exception {
  495. String customerId = request.getParameter("customerId");
  496. if (!StringUtils.isNotEmpty(customerId)) {
  497. return new ResponseJson(500, "该客诉信息不存在!", 500);
  498. }
  499. CustomerInfo customerInfo = new CustomerInfo();
  500. customerInfo.setCustomerId(Integer.parseInt(customerId));
  501. Map<String, Object> map = customerService.getCustomerInfo(customerInfo);
  502. ResponseJson rj = new ResponseJson(200, "修改成功!", 200);
  503. rj.addResponseKeyValue("customerCommon", map.get("customerCommon"));
  504. rj.addResponseKeyValue("customer", map.get("customer"));
  505. rj.addResponseKeyValue("salesOrder", map.get("salesOrder"));
  506. return rj;
  507. }
  508. /**
  509. * 进入添加回访页面
  510. *
  511. * @param request
  512. * @return
  513. * @throws Exception
  514. */
  515. @RequiresPermissions("customer:select:customer")
  516. @RequestMapping("/_add_visit")
  517. public ModelAndView toAddVisit(HttpServletRequest request) throws Exception {
  518. ModelAndView mv = new ModelAndView("cm/customer/add_visit");
  519. String customerId = request.getParameter("customerId");
  520. //查询跟进客服集合
  521. Admin admin = new Admin();
  522. admin.setAdminStatus(1);
  523. List<Admin> adminList = sysService.listSelectAdmin(admin);
  524. //获取登录人id
  525. Integer loginAdminId = AdminUtils.getLoginAdminId();
  526. mv.addObject("loginAdminId", loginAdminId);
  527. mv.addObject("customerId", customerId);
  528. mv.addObject("adminList", adminList);
  529. return mv;
  530. }
  531. /**
  532. * 添加回访信息
  533. *
  534. * @param request
  535. * @param visit
  536. * @return
  537. */
  538. @ResponseBody
  539. @RequiresPermissions("customer:add:visit")
  540. @RequestMapping("/add_visit_info")
  541. public ResponseJson addVisitInfo(HttpServletRequest request, Visit visit) throws Exception {
  542. String visitAdminId = request.getParameter("visitAdminId");
  543. if (!StringUtils.isNotEmpty(visitAdminId)) {
  544. return new ResponseJson(500, "请选择回访人!", 500);
  545. }
  546. Integer loginAdminId = AdminUtils.getLoginAdminId();
  547. visit.setAdminId(loginAdminId);
  548. visit.setDesignatedAdminId(Integer.parseInt(visitAdminId));
  549. visit.setVisitStatus(1);
  550. visit.setVisitCreateTime(new Date());
  551. int num = visitService.addVisitInfo(visit, visit.getCustomerId());
  552. if (num > 0) {
  553. return new ResponseJson(200, "修改成功!", 200);
  554. } else {
  555. return new ResponseJson(500, "修改失败!", 500);
  556. }
  557. }
  558. /**
  559. * 修改客诉状态为已解决
  560. *
  561. * @param request
  562. * @return
  563. */
  564. @ResponseBody
  565. @RequiresPermissions("customer:update:customerIsSolve")
  566. @RequestMapping("/update_customerIsSolve")
  567. public ResponseJson updateCustomerIsSolve(HttpServletRequest request) throws Exception {
  568. String customerId = request.getParameter("customerId");
  569. if (!StringUtils.isNotEmpty(customerId)) {
  570. return new ResponseJson(500, "该客诉信息不存在!", 500);
  571. }
  572. //根据id获取客诉信息
  573. CustomerInfo customer = customerService.getCustomerInfo(Integer.parseInt(customerId));
  574. if (customer == null) {
  575. return new ResponseJson(500, "该客诉信息不存在!", 500);
  576. }
  577. if (customer.getCustomerIsSolve().intValue() != 2) {
  578. return new ResponseJson(500, "该客诉信息不能修改为已解决状态!", 500);
  579. }
  580. CustomerInfo customerInfo = new CustomerInfo();
  581. customerInfo.setCustomerId(Integer.parseInt(customerId));
  582. customerInfo.setCustomerIsSolve(1);
  583. //修改客诉信息
  584. int num = customerService.updateCustomerInfo(customerInfo);
  585. if (num > 0) {
  586. return new ResponseJson(200, "修改成功!", 200);
  587. } else {
  588. return new ResponseJson(500, "修改失败!", 500);
  589. }
  590. }
  591. /**
  592. * 查询客服
  593. *
  594. * @param request
  595. * @return
  596. */
  597. @ResponseBody
  598. @RequiresPermissions("customer:add:customer")
  599. @RequestMapping("/select_sys_admin")
  600. public ResponseJson selectSysAdmin(HttpServletRequest request) throws Exception {
  601. ResponseJson rj = new ResponseJson(200, "修改成功!", 200);
  602. Integer adminId = AdminUtils.getLoginAdminId();
  603. Admin admin = new Admin();
  604. List<Admin> adminList = sysService.listSelectAdmin(admin);
  605. if (adminList.size() > 0) {
  606. rj.addResponseKeyValue("adminList", adminList);
  607. rj.addResponseKeyValue("adminId", adminId);
  608. return rj;
  609. } else {
  610. return new ResponseJson(500, "查询失败!", 500);
  611. }
  612. }
  613. /**
  614. * 查询产品类型
  615. *
  616. * @param request
  617. * @return
  618. */
  619. @ResponseBody
  620. @RequiresPermissions("customer:add:customer")
  621. @RequestMapping("/select_produce_type")
  622. public ResponseJson selectProduceType(HttpServletRequest request) throws Exception {
  623. ResponseJson rj = new ResponseJson(200, "修改成功!", 200);
  624. ProductType productType = new ProductType();
  625. productType.setTypeStatus(1);
  626. List<ProductType> productTypeList = productService.listProductType(productType);
  627. if (productTypeList != null && productTypeList.size() > 0) {
  628. rj.addResponseKeyValue("productTypeList", productTypeList);
  629. return rj;
  630. } else {
  631. return new ResponseJson(500, "查询失败!", 500);
  632. }
  633. }
  634. /**
  635. * 查询产品
  636. *
  637. * @param request
  638. * @return
  639. */
  640. @ResponseBody
  641. @RequiresPermissions("customer:add:customer")
  642. @RequestMapping("/select_produce")
  643. public ResponseJson selectProduce(HttpServletRequest request) {
  644. ResponseJson rj = new ResponseJson(200, "查询成功!", 200);
  645. Product product = new Product();
  646. List<Product> productList = productService.listProduce(product);
  647. for (Product pro : productList) {
  648. ProductColor productColor = new ProductColor();
  649. productColor.setColorProductId(pro.getProductId());
  650. List<ProductColor> productColorList = productService.listProduceColor(productColor);
  651. pro.setColorList(productColorList);
  652. }
  653. if (productList != null && productList.size() > 0) {
  654. rj.addResponseKeyValue("productList", productList);
  655. return rj;
  656. } else {
  657. return new ResponseJson(500, "查询失败!", 500);
  658. }
  659. }
  660. /**
  661. * 查询产品
  662. *
  663. * @param request
  664. * @return
  665. */
  666. @ResponseBody
  667. @RequiresPermissions("customer:add:customer")
  668. @RequestMapping("/select_produce_fittings")
  669. public ResponseJson selectProduceFittings(HttpServletRequest request, FittingsInfo fittingsInfo) {
  670. ResponseJson rj = new ResponseJson(200, "查询成功!", 200);
  671. List<FittingsInfo> produceFittingsList = fittingsInfoService.listFittings(fittingsInfo);
  672. if (produceFittingsList != null && produceFittingsList.size() > 0) {
  673. rj.addResponseKeyValue("produceFittingsList", produceFittingsList);
  674. return rj;
  675. } else {
  676. return new ResponseJson(500, "查询失败!", 500);
  677. }
  678. }
  679. /**
  680. * 添加客诉
  681. *
  682. * @param request
  683. * @return
  684. */
  685. @ResponseBody
  686. @RequiresPermissions("customer:add:customer")
  687. @RequestMapping("/save_customer")
  688. public ResponseJson addCustomer(HttpServletRequest request, CustomerInfo customerInfo, SalesOrder salesOrder, CustomerCommon customerCommon,
  689. String sendProdcuesJson, String sendFittingsJson, String closedProdcuesJson, String closedFittingsJson) throws Exception {
  690. ResponseJson rjx = this.isValiData(customerInfo);
  691. if(rjx.getResultCode() == 500){
  692. return rjx;
  693. }
  694. Integer flag = 0;
  695. JSONArray jsonArray;
  696. List<SendProdcue> sendProdcueList;
  697. List<SendFitting> sendFittingList;
  698. List<ClosedProdcue> closedProdcueList;
  699. List<ClosedFitting> closedFittingList;
  700. Integer customerIsSolve = customerInfo.getCustomerIsSolve(); //处理类型
  701. String phone = customerInfo.getCustomerTel(); //手机号码
  702. Integer typeCompany = customerInfo.getTypeCompany(); // 所属商城 1:美国watero; 2:上朵电动牙刷 3:优尼雅净水机
  703. jsonArray = JSONArray.fromObject(sendProdcuesJson);
  704. sendProdcueList = (List) JSONArray.toCollection(jsonArray, SendProdcue.class);
  705. jsonArray = JSONArray.fromObject(sendFittingsJson);
  706. sendFittingList = (List) JSONArray.toCollection(jsonArray, SendFitting.class);
  707. jsonArray = JSONArray.fromObject(closedProdcuesJson);
  708. closedProdcueList = (List) JSONArray.toCollection(jsonArray, ClosedProdcue.class);
  709. jsonArray = JSONArray.fromObject(closedFittingsJson);
  710. closedFittingList = (List) JSONArray.toCollection(jsonArray, ClosedFitting.class);
  711. customerCommon.setSendProdcues(sendProdcueList);
  712. customerCommon.setSendFittings(sendFittingList);
  713. customerCommon.setClosedProdcues(closedProdcueList);
  714. customerCommon.setClosedFittings(closedFittingList);
  715. customerInfo.setCustomerCommon(customerCommon);
  716. String orderId = "";
  717. if (customerInfo.getCustomerIsSolve() == 3 || customerInfo.getCustomerIsSolve() == 4 || customerInfo.getCustomerIsSolve() == 5) {
  718. Integer adminId = AdminUtils.getLoginAdminId();
  719. orderId = OrderNoUtil.createOrderCode(adminId);
  720. }
  721. customerInfo.setTransactionNumber(orderId);
  722. Integer customerId = customerInfo.getCustomerId();
  723. logger.info("-----------------添加客诉开始----------------------");
  724. try {
  725. flag = customerService.saveCustomerInfo(customerInfo, salesOrder);
  726. } catch (RuntimeException e) {
  727. return new ResponseJson(500, e.getMessage(), 500);
  728. }
  729. customerId = customerInfo.getCustomerId();
  730. logger.info("-----------------添加客诉结束----------------------");
  731. if (flag < 1) {
  732. return new ResponseJson(500, "添加客诉失败!", 500);
  733. }
  734. //处理结果: 1:已解决 2:未解决 3:换新 4:维修 5:补发 6:退货 7:无理由退货
  735. if (customerIsSolve == 3 || customerIsSolve == 4 || customerIsSolve == 5 || customerIsSolve == 6 || customerIsSolve == 7) {
  736. String solveMsg = "";
  737. switch (customerIsSolve) {
  738. case 3:
  739. solveMsg = "为您更换新机";
  740. break;
  741. case 4:
  742. solveMsg = "为您维修机器";
  743. break;
  744. case 5:
  745. solveMsg = "为您补发产品";
  746. break;
  747. case 6:
  748. solveMsg = "为您办理退货";
  749. break;
  750. case 7:
  751. solveMsg = "为您办理退货";
  752. break;
  753. }
  754. String addCustomerSuccessMsg = "";
  755. String typeMsg = "";
  756. switch (typeCompany) {
  757. case 1:
  758. addCustomerSuccessMsg = SmsConfig.ADD_CUSTOMER_SUCCESS_WATERO;
  759. typeMsg = "美国WaterO售后";
  760. break;
  761. case 2:
  762. addCustomerSuccessMsg = SmsConfig.ADD_CUSTOMER_SUCCESS_SHANGDUO;
  763. typeMsg = "上朵售后";
  764. break;
  765. case 3:
  766. addCustomerSuccessMsg = SmsConfig.ADD_CUSTOMER_SUCCESS_YULIA;
  767. typeMsg = "YULIA售后";
  768. break;
  769. }
  770. // Object [] msg = new Object[]{solveMsg,typeMsg};
  771. // String text = MessageFormat.format(addCustomerSuccessMsg, msg);
  772. // logger.info("添加客诉成功后,给 "+ phone +" 手机用户发送短信:" + text );
  773. // String result = smsService.sendOtherCMS(phone, text);
  774. //
  775. // if (!"SUCCESS".equals(result)) {
  776. // return new ResponseJson(505, "添加客诉发送短信失败,失败原因:" + result + "<br>客诉信息发送失败并不影响客诉添加。客诉编号为:"+ customerId, 505);
  777. // }
  778. }
  779. return new ResponseJson(200, "录入客诉成功!客诉编号:" + customerId + ",请前往Efast进行换货/退货操作。", 200);
  780. }
  781. /**
  782. * 修改客诉
  783. *
  784. * @param request
  785. * @return
  786. */
  787. @ResponseBody
  788. @RequiresPermissions("customer:update:customer")
  789. @RequestMapping("/update_customer")
  790. public ResponseJson updateCustomer(HttpServletRequest request, CustomerInfo customerInfo, SalesOrder salesOrder, CustomerCommon customerCommon,
  791. String sendProdcuesJson, String sendFittingsJson, String closedProdcuesJson, String closedFittingsJson) throws Exception {
  792. ResponseJson rjx = this.isValiData(customerInfo);
  793. if(rjx.getResultCode() == 500){
  794. return rjx;
  795. }
  796. Integer flag = 0;
  797. JSONArray jsonArray;
  798. List<SendProdcue> sendProdcueList;
  799. List<SendFitting> sendFittingList;
  800. List<ClosedProdcue> closedProdcueList;
  801. List<ClosedFitting> closedFittingList;
  802. Integer customerIsSolve = customerInfo.getCustomerIsSolve(); //处理类型
  803. String phone = customerInfo.getCustomerTel(); //手机号码
  804. Integer typeCompany = customerInfo.getTypeCompany(); // 所属商城 1:美国watero; 2:上朵电动牙刷 3:优尼雅净水机
  805. jsonArray = JSONArray.fromObject(sendProdcuesJson);
  806. sendProdcueList = (List) JSONArray.toCollection(jsonArray, SendProdcue.class);
  807. jsonArray = JSONArray.fromObject(sendFittingsJson);
  808. sendFittingList = (List) JSONArray.toCollection(jsonArray, SendFitting.class);
  809. jsonArray = JSONArray.fromObject(closedProdcuesJson);
  810. closedProdcueList = (List) JSONArray.toCollection(jsonArray, ClosedProdcue.class);
  811. jsonArray = JSONArray.fromObject(closedFittingsJson);
  812. closedFittingList = (List) JSONArray.toCollection(jsonArray, ClosedFitting.class);
  813. customerCommon.setSendProdcues(sendProdcueList);
  814. customerCommon.setSendFittings(sendFittingList);
  815. customerCommon.setClosedProdcues(closedProdcueList);
  816. customerCommon.setClosedFittings(closedFittingList);
  817. customerInfo.setCustomerCommon(customerCommon);
  818. String orderId = "";
  819. if (customerInfo.getCustomerIsSolve() == 3 || customerInfo.getCustomerIsSolve() == 4 || customerInfo.getCustomerIsSolve() == 5) {
  820. Integer adminId = AdminUtils.getLoginAdminId();
  821. orderId = OrderNoUtil.createOrderCode(adminId);
  822. }
  823. customerInfo.setTransactionNumber(orderId);
  824. Integer customerId = customerInfo.getCustomerId();
  825. logger.info("-----------------修改客诉开始----------------------");
  826. try {
  827. flag = customerService.updateCustomerInfo(customerInfo, salesOrder);
  828. } catch (RuntimeException e) {
  829. return new ResponseJson(500, e.getMessage(), 500);
  830. }
  831. customerId = customerInfo.getCustomerId();
  832. logger.info("-----------------修改客诉结束----------------------");
  833. if (flag < 1) {
  834. return new ResponseJson(500, "修改客诉失败!", 500);
  835. }
  836. return new ResponseJson(200, "修改客诉成功!客诉编号为:" + customerId, 200);
  837. }
  838. /**
  839. * 验证方法
  840. *
  841. * @param customerInfo
  842. * @return
  843. */
  844. public ResponseJson isValiData(CustomerInfo customerInfo) {
  845. ResponseJson rj = new ResponseJson();
  846. if(customerInfo.getAdminId() == null){
  847. return new ResponseJson(500, "未填写客诉id", 500);
  848. }
  849. return rj;
  850. }
  851. /**
  852. * 发送短信
  853. *
  854. * @param request
  855. * @return
  856. */
  857. @ResponseBody
  858. @RequiresPermissions("customer:add:customer")
  859. @RequestMapping("/send_phone_sms")
  860. public ResponseJson sendPhoneSms(HttpServletRequest request, String type, String phone, Integer typeCompany, ComplaintQuestionInfo complaintQuestionInfo) throws Exception {
  861. String url = NameUtils.getConfig("website");
  862. Integer flag = 1;
  863. if (typeCompany == null || typeCompany == 0) {
  864. return new ResponseJson(500, "未获取到产品类型!", 500);
  865. }
  866. String con = "";
  867. if (type != null && !"".equals(type)) {
  868. if ("p".equals(type)) { //problem" 问题处理; mailAddress:邮寄地址;
  869. if (complaintQuestionInfo.getQuestionId() == null || "".equals(complaintQuestionInfo.getQuestionId())) {
  870. complaintQuestionInfo.setQuestionState(1);
  871. complaintQuestionInfo.setQuestionIsQcDetect(0);
  872. complaintQuestionInfo = complaintQuestionInfoService.insertBackInfo(complaintQuestionInfo);
  873. } else {
  874. complaintQuestionInfo.setSmallClassId(null); //不能修改小类类型
  875. flag = complaintQuestionInfoService.updateQuestionById(complaintQuestionInfo);
  876. if (flag < 1) {
  877. return new ResponseJson(500, "问题修改失败!", 500);
  878. }
  879. }
  880. url += "/" + complaintQuestionInfo.getQuestionId();
  881. switch (typeCompany) {
  882. case 1:
  883. con = SmsConfig.SEND_PRODUCT_SEND_WATERO;
  884. break;
  885. case 2:
  886. con = SmsConfig.SEND_PRODUCT_SEND_SHANGDUO;
  887. break;
  888. case 3:
  889. con = SmsConfig.SEND_PRODUCT_SEND_YULIA;
  890. break;
  891. }
  892. } else if ("m".equals(type)) {
  893. if (complaintQuestionInfo.getQuestionId() == null) {
  894. return new ResponseJson(500, "未获取到邮寄信息!", 500);
  895. }
  896. complaintQuestionInfo.setQuestionName(null);
  897. complaintQuestionInfo.setSmallClassId(null);
  898. url += "/5";
  899. switch (typeCompany) {
  900. case 1:
  901. con = SmsConfig.SEND_PRODUCT_SMS_WATERO;
  902. break;
  903. case 2:
  904. con = SmsConfig.SEND_PRODUCT_SMS_SHANGDUO;
  905. break;
  906. case 3:
  907. con = SmsConfig.SEND_PRODUCT_SMS_YULIA;
  908. break;
  909. }
  910. }
  911. }
  912. String userPhone = encodePhoneNumber(phone);
  913. String text = MessageFormat.format(con, url);
  914. logger.info("给 " + phone + " 手机用户发送短信:" + text);
  915. String result = smsService.sendOtherCMS(phone, text);
  916. if ("SUCCESS".equals(result)) {
  917. return new ResponseJson(200, "发送短信成功!", 200);
  918. } else {
  919. return new ResponseJson(500, "发送短信失败,失败原因:" + result, 500);
  920. }
  921. }
  922. String encodePhoneNumber(String number)
  923. {
  924. int encnum = Integer.parseInt(number.substring(2));
  925. int prefix = (number.charAt(1) - '2') /2; // '3'=>0, '5'=>1, '[67]'=>2, '8'=>3
  926. encnum |= (prefix <<= 30);
  927. final byte[] raw = new byte[4];
  928. raw[0] = (byte)(encnum >>> 24);
  929. raw[1] = (byte)(encnum >>> 16);
  930. raw[2] = (byte)(encnum >>> 8);
  931. raw[3] = (byte) encnum;
  932. return Base64.encodeBase64URLSafeString(raw);
  933. }
  934. /**
  935. * 进入回访完成页面
  936. *
  937. * @param request
  938. * @return
  939. * @throws Exception
  940. */
  941. @RequiresPermissions("customer:update:visit")
  942. @RequestMapping("/_update_visit_info")
  943. public ModelAndView toUpdateVisitFinish(HttpServletRequest request) throws Exception {
  944. ModelAndView mv = new ModelAndView("cm/customer/visit_finish");
  945. String customerId = request.getParameter("customerId");
  946. mv.addObject("customerId", customerId);
  947. return mv;
  948. }
  949. /**
  950. * 添加回访完成内容
  951. *
  952. * @param request
  953. * @param visit
  954. * @return
  955. */
  956. @ResponseBody
  957. @RequiresPermissions("customer:update:visit")
  958. @RequestMapping("/update_visit_finish")
  959. public ResponseJson updateVisitFinish(HttpServletRequest request, Visit visit) throws Exception {
  960. String customerId = request.getParameter("finish_customerId");
  961. if (!StringUtils.isNotEmpty(customerId)) {
  962. return new ResponseJson(500, "该客诉信息不存在!", 500);
  963. }
  964. visit.setCustomerId(Integer.parseInt(customerId));
  965. visit.setVisitStatus(2);
  966. //修改回访信息内容
  967. int num = visitService.updateVisit(visit);
  968. if (num > 0) {
  969. return new ResponseJson(200, "添加成功!", 200);
  970. } else {
  971. return new ResponseJson(500, "添加失败!", 500);
  972. }
  973. }
  974. /**
  975. * 进入回访信息详情
  976. *
  977. * @param request
  978. * @return
  979. * @throws Exception
  980. */
  981. @RequiresPermissions("customer:get:visit")
  982. @RequestMapping("/_visit_info")
  983. public ModelAndView toVisitInfo(HttpServletRequest request) throws Exception {
  984. ModelAndView mv = new ModelAndView("cm/customer/visit_detail");
  985. String customerId = request.getParameter("customerId");
  986. // 1:未回访,2:已回访
  987. String num = request.getParameter("num");
  988. if (!StringUtils.isNotEmpty(num)) {
  989. num = "2";
  990. }
  991. mv.addObject("customerId", customerId);
  992. mv.addObject("num", num);
  993. return mv;
  994. }
  995. /**
  996. * 获取回访信息详情
  997. *
  998. * @param request
  999. * @return
  1000. */
  1001. @ResponseBody
  1002. @RequiresPermissions("customer:get:visit")
  1003. @RequestMapping("/get_visit_info")
  1004. public ResponseJson getVisitInfo(HttpServletRequest request) throws Exception {
  1005. String customerId = request.getParameter("customerId");
  1006. if (!StringUtils.isNotEmpty(customerId)) {
  1007. return new ResponseJson(500, "该客诉信息不存在!", 500);
  1008. }
  1009. Visit visit = new Visit();
  1010. visit.setCustomerId(Integer.parseInt(customerId));
  1011. //查询回访信息集合
  1012. List<Visit> visitList = visitService.listVisit(visit);
  1013. if (visitList == null || visitList.size() == 0) {
  1014. return new ResponseJson(500, "该客诉没有回访信息!", 500);
  1015. }
  1016. visit = visitList.get(0);
  1017. ResponseJson rj = new ResponseJson(200, "查询成功", 200);
  1018. rj.addResponseKeyValue("visit", visit);
  1019. return rj;
  1020. }
  1021. /**
  1022. * 进入问题描述页面
  1023. *
  1024. * @param request
  1025. * @return
  1026. * @throws Exception
  1027. */
  1028. @RequiresPermissions("customer:get:describe")
  1029. @RequestMapping("/_question_describe")
  1030. public ModelAndView toQuestionDescribe(HttpServletRequest request) throws Exception {
  1031. ModelAndView mv = new ModelAndView("cm/customer/describe_detail");
  1032. String customerId = request.getParameter("customerId");
  1033. mv.addObject("customerId", customerId);
  1034. return mv;
  1035. }
  1036. /**
  1037. * 获取问题描述信息
  1038. *
  1039. * @param request
  1040. * @return
  1041. */
  1042. @ResponseBody
  1043. @RequiresPermissions("customer:get:describe")
  1044. @RequestMapping("/get_describe_info")
  1045. public ResponseJson getDescribeInfo(HttpServletRequest request) throws Exception {
  1046. String customerId = request.getParameter("customerId");
  1047. if (!StringUtils.isNotEmpty(customerId)) {
  1048. return new ResponseJson(500, "该客诉信息不存在!", 500);
  1049. }
  1050. QuestionDescribe describe = new QuestionDescribe();
  1051. describe.setCustomerId(Integer.parseInt(customerId));
  1052. //查询问题集合
  1053. List<QuestionDescribe> questionList = questionDescribeService.listQuestionDescribe(describe);
  1054. if (questionList == null || questionList.size() == 0) {
  1055. return new ResponseJson(500, "该客诉信息没有问题描述!", 500);
  1056. }
  1057. describe = questionList.get(0);
  1058. ResponseJson rj = new ResponseJson(200, "查询成功", 200);
  1059. rj.addResponseKeyValue("describe", describe);
  1060. return rj;
  1061. }
  1062. /**
  1063. * 进入修改换新页面
  1064. *
  1065. * @param request
  1066. * @return
  1067. * @throws Exception
  1068. */
  1069. @RequiresPermissions("customer:update:renewed")
  1070. @RequestMapping("/_update_renewed")
  1071. public ModelAndView toUpdateRenewed(HttpServletRequest request) throws Exception {
  1072. ModelAndView mv = new ModelAndView("cm/customer/update_renewed");
  1073. String customerId = request.getParameter("customerId");
  1074. mv.addObject("customerId", customerId);
  1075. return mv;
  1076. }
  1077. /**
  1078. * 获取换新详情
  1079. *
  1080. * @param request
  1081. * @return
  1082. */
  1083. @ResponseBody
  1084. @RequiresPermissions("customer:get:renewed")
  1085. @RequestMapping("/get_renewed_info")
  1086. public ResponseJson getRenewedInfo(HttpServletRequest request) throws Exception {
  1087. String customerId = request.getParameter("customerId");
  1088. if (!StringUtils.isNotEmpty(customerId)) {
  1089. return new ResponseJson(500, "该客诉信息不存在!", 500);
  1090. }
  1091. Renewed renewed = new Renewed();
  1092. renewed.setCustomerId(Integer.parseInt(customerId));
  1093. renewed.setRenewedState(1);
  1094. //获取换新详情和检测信息
  1095. renewed = customerService.getRenewedInfo(renewed);
  1096. if (renewed == null) {
  1097. return new ResponseJson(500, "该客诉没有换新信息!", 500);
  1098. } else {
  1099. ResponseJson rj = new ResponseJson(200, "查询成功", 200);
  1100. rj.addResponseKeyValue("renewed", renewed);
  1101. return rj;
  1102. }
  1103. }
  1104. /**
  1105. * 修改换新信息
  1106. *
  1107. * @param request
  1108. * @param renewed
  1109. * @return
  1110. * @throws Exception
  1111. */
  1112. @ResponseBody
  1113. @RequiresPermissions("customer:update:renewed")
  1114. @RequestMapping("/update_renewed_info")
  1115. public ResponseJson updateRenewedInfo(HttpServletRequest request, Renewed renewed) throws Exception {
  1116. /*String closedProducts = request.getParameter("closed_products");
  1117. String closedFittings = request.getParameter("closed_fittings");*/
  1118. String mergeAddress = request.getParameter("merge_address");
  1119. if (!StringUtils.isNotEmpty(renewed.getRenewedId().toString())) {
  1120. return new ResponseJson(500, "该换新信息不能修改!", 500);
  1121. }
  1122. // if (StringUtils.isNotEmpty(renewed.getRenewedBackPostage().toString())) {
  1123. // renewed.setRenewedBackPostage(renewed.getRenewedBackPostage().intValue() * 100);
  1124. // }
  1125. /*if (!StringUtils.isNotEmpty(renewed.getRenewedBackEfastOrderId())) {
  1126. return new ResponseJson(500, "请输入efast订单号!", 500);
  1127. }*/
  1128. if (StringUtils.isNotEmpty(mergeAddress)) {
  1129. renewed.setRenewedSendMergeAddress(mergeAddress);
  1130. }
  1131. if(renewed.getRenewedBackStatus() != null){
  1132. if(renewed.getRenewedBackStatus() != 1){
  1133. ComplaintSignclosedInfo cs = new ComplaintSignclosedInfo();
  1134. cs.setSignclosedCustomerId(renewed.getCustomerId());
  1135. cs.setSignclosedLogistics(renewed.getRenewedBackLogisticsCompany());
  1136. cs.setSignclosedLogisticsNumber(renewed.getRenewedBackLogisticsNo());
  1137. complaintSignclosedInfoService.updateSignclosedByCustomerId(cs);
  1138. }
  1139. }
  1140. //修改换新信息
  1141. int num = renewedService.updateRenewedInfo(renewed, null, null);
  1142. if (num > 0) {
  1143. return new ResponseJson(200, "修改成功!", 200);
  1144. } else {
  1145. return new ResponseJson(500, "修改失败!", 500);
  1146. }
  1147. }
  1148. /**
  1149. * 进入修改维修页面
  1150. *
  1151. * @param request
  1152. * @return
  1153. * @throws Exception
  1154. */
  1155. @RequiresPermissions("customer:update:repair")
  1156. @RequestMapping("/_to_update_repair")
  1157. public ModelAndView toUpdateRepair(HttpServletRequest request) throws Exception {
  1158. ModelAndView mv = new ModelAndView("cm/customer/update_repair");
  1159. String customerId = request.getParameter("customerId");
  1160. mv.addObject("customerId", customerId);
  1161. return mv;
  1162. }
  1163. /**
  1164. * 进入修改维修页面
  1165. *
  1166. * @param request
  1167. * @return
  1168. * @throws Exception
  1169. */
  1170. @ResponseBody
  1171. @RequiresPermissions("customer:update:repair")
  1172. @RequestMapping("/_update_repair")
  1173. public ResponseJson updateRepairUI(HttpServletRequest request) throws Exception {
  1174. String customerId = request.getParameter("customerId");
  1175. if (!StringUtils.isNotEmpty(customerId)) {
  1176. return new ResponseJson(500, "该客诉信息不存在!", 500);
  1177. }
  1178. Repair repair = new Repair();
  1179. repair.setCustomerId(Integer.parseInt(customerId));
  1180. repair.setRepairState(1);
  1181. //获取维修详情和品质检测信息
  1182. repair = customerService.getRepairInfo(repair);
  1183. if (repair == null) {
  1184. return new ResponseJson(500, "该客诉没有维修信息!", 500);
  1185. } else {
  1186. ResponseJson rj = new ResponseJson(200, "查询成功", 200);
  1187. rj.addResponseKeyValue("repair", repair);
  1188. return rj;
  1189. }
  1190. }
  1191. /**
  1192. * 修改维修处理信息
  1193. *
  1194. * @param request
  1195. * @param repair
  1196. * @return
  1197. * @throws Exception
  1198. */
  1199. @ResponseBody
  1200. @RequiresPermissions("customer:update:repair")
  1201. @RequestMapping("/update_repair_info")
  1202. public ResponseJson updateRepairInfo(HttpServletRequest request, Repair repair) throws Exception {
  1203. if (!StringUtils.isNotEmpty(repair.getRepairId().toString())) {
  1204. return new ResponseJson(500, "该换新信息不能修改!", 500);
  1205. }
  1206. /* String closedProducts = request.getParameter("closed_products");
  1207. String closedFittings = request.getParameter("closed_fittings");*/
  1208. String provinceNumber = request.getParameter("repairProvinceNumber");
  1209. String cityNumber = request.getParameter("repairCityNumber");
  1210. String areaNumber = request.getParameter("repairAreaNumber");
  1211. String mergeAddress = request.getParameter("merge_address");
  1212. if (StringUtils.isNotEmpty(provinceNumber)) {
  1213. repair.setProvinceNumber(Integer.parseInt(provinceNumber));
  1214. }
  1215. if (StringUtils.isNotEmpty(cityNumber)) {
  1216. repair.setCityNumber(Integer.parseInt(cityNumber));
  1217. }
  1218. if (StringUtils.isNotEmpty(areaNumber)) {
  1219. repair.setAreaNumber(Integer.parseInt(areaNumber));
  1220. }
  1221. if (StringUtils.isNotEmpty(mergeAddress)) {
  1222. repair.setRepairSendMergeAddress(mergeAddress);
  1223. }
  1224. // if (StringUtils.isNotEmpty(repair.getRepairBackPostage().toString())) {
  1225. // repair.setRepairBackPostage(repair.getRepairBackPostage().intValue() * 100);
  1226. // }
  1227. /*if (!StringUtils.isNotEmpty(repair.getRepairBackEfastOrderId())) {
  1228. return new ResponseJson(500, "请输入efast订单号!", 500);
  1229. }*/
  1230. if (StringUtils.isNotEmpty(mergeAddress)) {
  1231. repair.setRepairSendMergeAddress(mergeAddress);
  1232. }
  1233. /*SalesOrder order = new SalesOrder();
  1234. order.setSalesOrderStatus(1);
  1235. order.setSalesOrderId(repair.getRepairBackEfastOrderId());
  1236. int count = salesOrderService.getOrderInfoCount(order);
  1237. //判断efast订单是否可查出有效数据
  1238. if (count == 0) {
  1239. return new ResponseJson(500, "该efast订单号无效,请重新输入!", 500);
  1240. }*/
  1241. if(repair.getRepairBackStatus() != null){
  1242. if(repair.getRepairBackStatus() != 1){
  1243. ComplaintSignclosedInfo cs = new ComplaintSignclosedInfo();
  1244. cs.setSignclosedCustomerId(repair.getCustomerId());
  1245. cs.setSignclosedLogistics(repair.getRepairBackLogisticsCompany());
  1246. cs.setSignclosedLogisticsNumber(repair.getRepairBackLogisticsNo());
  1247. complaintSignclosedInfoService.updateSignclosedByCustomerId(cs);
  1248. }
  1249. }
  1250. //修改维修信息
  1251. int num = repairService.updateRepairInfo(repair, null, null);
  1252. if (num > 0) {
  1253. return new ResponseJson(200, "修改成功!", 200);
  1254. } else {
  1255. return new ResponseJson(500, "修改失败!", 500);
  1256. }
  1257. }
  1258. /**
  1259. * 进入修改退货页面
  1260. *
  1261. * @param request
  1262. * @return
  1263. * @throws Exception
  1264. */
  1265. @RequiresPermissions("customer:update:backGoods")
  1266. @RequestMapping("/_to_update_book_goods")
  1267. public ModelAndView toUpdateBookGoods(HttpServletRequest request) throws Exception {
  1268. ModelAndView mv = new ModelAndView("cm/customer/update_back_goods");
  1269. String customerId = request.getParameter("customerId");
  1270. mv.addObject("customerId", customerId);
  1271. return mv;
  1272. }
  1273. /**
  1274. * 进入修改售后退货页面
  1275. *
  1276. * @param request
  1277. * @return
  1278. * @throws Exception
  1279. */
  1280. @ResponseBody
  1281. @RequiresPermissions("customer:update:backGoods")
  1282. @RequestMapping("/_update_back_goods")
  1283. public ResponseJson updateBackGoodsUI(HttpServletRequest request) throws Exception {
  1284. String customerId = request.getParameter("customerId");
  1285. if (!StringUtils.isNotEmpty(customerId)) {
  1286. return new ResponseJson(500, "该客诉信息不存在!", 500);
  1287. }
  1288. BackGoods backGoods = new BackGoods();
  1289. backGoods.setCustomerId(Integer.parseInt(customerId));
  1290. //获取售后退货信息
  1291. backGoods = customerService.getBackGoods(backGoods);
  1292. if (backGoods == null) {
  1293. return new ResponseJson(500, "该客诉没有售后退货信息!", 500);
  1294. } else {
  1295. ResponseJson rj = new ResponseJson(200, "查询成功", 200);
  1296. rj.addResponseKeyValue("backGoods", backGoods);
  1297. return rj;
  1298. }
  1299. }
  1300. /**
  1301. * 修改售后退货信息
  1302. *
  1303. * @param request
  1304. * @param backGoods
  1305. * @return
  1306. * @throws Exception
  1307. */
  1308. @ResponseBody
  1309. @RequiresPermissions("customer:update:backGoods")
  1310. @RequestMapping("/update_back_goods")
  1311. public ResponseJson updateBackGoods(HttpServletRequest request, BackGoods backGoods) throws Exception {
  1312. String closedProducts = request.getParameter("closed_products");
  1313. String closedFittings = request.getParameter("closed_fittings");
  1314. if (!StringUtils.isNotEmpty(backGoods.getBackGoodsId().toString())) {
  1315. return new ResponseJson(500, "该售后退货信息不能修改!", 500);
  1316. }
  1317. // if (StringUtils.isNotEmpty(backGoods.getBackGoodsBackPostage().toString())) {
  1318. // backGoods.setBackGoodsBackPostage(backGoods.getBackGoodsBackPostage().intValue() * 100);
  1319. // }
  1320. if(backGoods.getBackGoodsBackStatus() != 1){
  1321. ComplaintSignclosedInfo cs = new ComplaintSignclosedInfo();
  1322. cs.setSignclosedCustomerId(backGoods.getCustomerId());
  1323. cs.setSignclosedLogistics(backGoods.getBackGoodsBackLogisticsCompany());
  1324. cs.setSignclosedLogisticsNumber(backGoods.getBackGoodsBackLogisticsNo());
  1325. complaintSignclosedInfoService.updateSignclosedByCustomerId(cs);
  1326. }
  1327. int num = backGoodsService.updateBackGoods(backGoods, closedProducts, closedFittings);
  1328. if (num > 0) {
  1329. return new ResponseJson(200, "修改成功!", 200);
  1330. } else {
  1331. return new ResponseJson(500, "修改失败!", 500);
  1332. }
  1333. }
  1334. /**
  1335. * 进入修改补寄页面
  1336. *
  1337. * @param request
  1338. * @return
  1339. * @throws Exception
  1340. */
  1341. @RequiresPermissions("customer:update:reissue")
  1342. @RequestMapping("/_to_update_reissue")
  1343. public ModelAndView toUpdateReissue(HttpServletRequest request) throws Exception {
  1344. ModelAndView mv = new ModelAndView("cm/customer/update_reissue");
  1345. String customerId = request.getParameter("customerId");
  1346. mv.addObject("customerId", customerId);
  1347. return mv;
  1348. }
  1349. /**
  1350. * 进入修改补寄信息页面
  1351. *
  1352. * @param request
  1353. * @return
  1354. */
  1355. @ResponseBody
  1356. @RequiresPermissions("customer:update:reissue")
  1357. @RequestMapping("/get_reissue_info")
  1358. public ResponseJson getReissueInfo(HttpServletRequest request) {
  1359. String customerId = request.getParameter("customerId");
  1360. if (!StringUtils.isNotEmpty(customerId)) {
  1361. return new ResponseJson(500, "该客诉信息不存在!", 500);
  1362. }
  1363. Reissue reissue = new Reissue();
  1364. reissue.setCustomerId(Integer.parseInt(customerId));
  1365. //获取售后补寄信息
  1366. reissue = customerService.getReissue(reissue);
  1367. if (reissue == null) {
  1368. return new ResponseJson(500, "该客诉没有售后退货信息!", 500);
  1369. } else {
  1370. ResponseJson rj = new ResponseJson(200, "查询成功", 200);
  1371. rj.addResponseKeyValue("reissue", reissue);
  1372. return rj;
  1373. }
  1374. }
  1375. /**
  1376. * 修改售后补寄信息
  1377. *
  1378. * @param request
  1379. * @param reissue
  1380. * @return
  1381. * @throws Exception
  1382. */
  1383. @ResponseBody
  1384. @RequiresPermissions("customer:update:reissue")
  1385. @RequestMapping("/update_reissue_info")
  1386. public ResponseJson updateReissueInfo(HttpServletRequest request, Reissue reissue) throws Exception {
  1387. String provinceNumber = request.getParameter("reissueProvinceNumber");
  1388. String cityNumber = request.getParameter("reissueCityNumber");
  1389. String areaNumber = request.getParameter("reissueAreaNumber");
  1390. String mergeAddress = request.getParameter("merge_address");
  1391. if (!StringUtils.isNotEmpty(reissue.getReissueId().toString())) {
  1392. return new ResponseJson(500, "该售后补寄信息不能修改!", 500);
  1393. }
  1394. if (StringUtils.isNotEmpty(provinceNumber)) {
  1395. reissue.setProvinceNumber(Integer.parseInt(provinceNumber));
  1396. }
  1397. if (StringUtils.isNotEmpty(cityNumber)) {
  1398. reissue.setCityNumber(Integer.parseInt(cityNumber));
  1399. }
  1400. if (StringUtils.isNotEmpty(areaNumber)) {
  1401. reissue.setAreaNumber(Integer.parseInt(areaNumber));
  1402. }
  1403. if (StringUtils.isNotEmpty(mergeAddress)) {
  1404. reissue.setReissueSendMergeAddress(mergeAddress);
  1405. }
  1406. //修改售后补寄信息
  1407. int num = reissueService.updateReissueInfo(reissue);
  1408. if (num > 0) {
  1409. return new ResponseJson(200, "修改成功!", 200);
  1410. } else {
  1411. return new ResponseJson(500, "修改失败!", 500);
  1412. }
  1413. }
  1414. /**
  1415. * 进入修改退货页面
  1416. *
  1417. * @param request
  1418. * @return
  1419. * @throws Exception
  1420. */
  1421. @RequiresPermissions("customer:update:noreason")
  1422. @RequestMapping("/_update_noreason_back")
  1423. public ModelAndView toUpdateNoreasonBack(HttpServletRequest request) throws Exception {
  1424. ModelAndView mv = new ModelAndView("cm/customer/update_noreason_back");
  1425. String customerId = request.getParameter("customerId");
  1426. mv.addObject("customerId", customerId);
  1427. return mv;
  1428. }
  1429. /**
  1430. * 获取无理由退货信息
  1431. *
  1432. * @param request
  1433. * @return
  1434. * @throws Exception
  1435. */
  1436. @ResponseBody
  1437. @RequiresPermissions("customer:update:noreason")
  1438. @RequestMapping("/get_noreason_back")
  1439. public ResponseJson getNoreasonBack(HttpServletRequest request) throws Exception {
  1440. String customerId = request.getParameter("customerId");
  1441. if (!StringUtils.isNotEmpty(customerId)) {
  1442. return new ResponseJson(500, "该客诉信息不存在!", 500);
  1443. }
  1444. NoreasonBack noreasonBack = new NoreasonBack();
  1445. noreasonBack.setCustomerId(Integer.parseInt(customerId));
  1446. noreasonBack.setNoreasonBackState(1);
  1447. //获取无理由退货信息
  1448. noreasonBack = customerService.getNoreasonBack(noreasonBack);
  1449. if (noreasonBack == null) {
  1450. return new ResponseJson(500, "该客诉没有无理由售后退货信息!", 500);
  1451. } else {
  1452. ResponseJson rj = new ResponseJson(200, "查询成功", 200);
  1453. rj.addResponseKeyValue("noreasonBack", noreasonBack);
  1454. return rj;
  1455. }
  1456. }
  1457. /**
  1458. * 修改售后无理由退货信息
  1459. *
  1460. * @param request
  1461. * @param noreasonBack
  1462. * @return
  1463. * @throws Exception
  1464. */
  1465. @ResponseBody
  1466. @RequiresPermissions("customer:update:noreason")
  1467. @RequestMapping("/update_noreason")
  1468. public ResponseJson updateNoreason(HttpServletRequest request, NoreasonBack noreasonBack) throws Exception {
  1469. String closedProducts = request.getParameter("closed_products");
  1470. String closedFittings = request.getParameter("closed_fittings");
  1471. if (!StringUtils.isNotEmpty(noreasonBack.getNoreasonBackId().toString())) {
  1472. return new ResponseJson(500, "该售后无理由退货信息不能修改!", 500);
  1473. }
  1474. // if (StringUtils.isNotEmpty(noreasonBack.getNoreasonBackBackPostage().toString())) {
  1475. // noreasonBack.setNoreasonBackBackPostage(noreasonBack.getNoreasonBackBackPostage().intValue() * 100);
  1476. // }
  1477. if(noreasonBack.getNoreasonBackBackStatus() != 1){
  1478. ComplaintSignclosedInfo cs = new ComplaintSignclosedInfo();
  1479. cs.setSignclosedCustomerId(noreasonBack.getCustomerId());
  1480. cs.setSignclosedLogistics(noreasonBack.getNoreasonBackBackLogisticsCompany());
  1481. cs.setSignclosedLogisticsNumber(noreasonBack.getNoreasonBackBackLogisticsNo());
  1482. complaintSignclosedInfoService.updateSignclosedByCustomerId(cs);
  1483. }
  1484. int num = noreasonBackService.updateNoreasonBack(noreasonBack, closedProducts, closedFittings);
  1485. if (num > 0) {
  1486. return new ResponseJson(200, "修改成功!", 200);
  1487. } else {
  1488. return new ResponseJson(500, "修改失败!", 500);
  1489. }
  1490. }
  1491. }