|
@@ -15,10 +15,7 @@ import com.iamberry.rst.faces.sms.SmsService;
|
|
|
import com.iamberry.rst.faces.sys.SysService;
|
|
|
import com.iamberry.rst.util.CustomerCommonUtil;
|
|
|
import com.iamberry.rst.util.SmsConfig;
|
|
|
-import com.iamberry.rst.utils.AdminUtils;
|
|
|
-import com.iamberry.rst.utils.OrderNoUtil;
|
|
|
-import com.iamberry.rst.utils.ResultMsg;
|
|
|
-import com.iamberry.rst.utils.StitchAttrUtil;
|
|
|
+import com.iamberry.rst.utils.*;
|
|
|
import com.iamberry.wechat.tools.NameUtils;
|
|
|
import com.iamberry.wechat.tools.ResponseJson;
|
|
|
import com.iamberry.wechat.tools.ResultInfo;
|
|
@@ -30,6 +27,7 @@ import org.apache.poi.hssf.usermodel.*;
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -104,7 +102,6 @@ public class AdminCustomerController {
|
|
|
private RelationOrderService relationOrderService;
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 获取客诉列表
|
|
|
*
|
|
@@ -154,7 +151,7 @@ public class AdminCustomerController {
|
|
|
*/
|
|
|
@RequiresPermissions("customer:update:customer")
|
|
|
@RequestMapping(value = "/to_update_customer")
|
|
|
- public ModelAndView toUpdateCustomer(HttpServletRequest request,Integer customerId) {
|
|
|
+ public ModelAndView toUpdateCustomer(HttpServletRequest request, Integer customerId) {
|
|
|
ModelAndView mv = new ModelAndView("cm/customer/update_customer");
|
|
|
|
|
|
ProductType productType = new ProductType();
|
|
@@ -173,7 +170,7 @@ public class AdminCustomerController {
|
|
|
CustomerInfo customerInfo = customerService.getCustomerInfo(customerId);
|
|
|
/*客诉信息处理-stast*/
|
|
|
//对于区域处理
|
|
|
- if(customerInfo!=null && customerInfo.getCustomerArea() != null){
|
|
|
+ if (customerInfo != null && customerInfo.getCustomerArea() != null) {
|
|
|
// String[] customerAreaAndCity = customerInfo.getCustomerArea().split("-");
|
|
|
// customerInfo.setProvinceName(customerAreaAndCity[0]);
|
|
|
// City city
|
|
@@ -182,37 +179,37 @@ public class AdminCustomerController {
|
|
|
}
|
|
|
/*客诉信息处理-end*/
|
|
|
CustomerCommon customerCommon = new CustomerCommon();
|
|
|
- if(customerInfo.getCustomerIsSolve() != null){
|
|
|
- switch (customerInfo.getCustomerIsSolve()){ //处理结果: 1:已解决 2:未解决 3:换新 4:维修 5:补发 6:退货 7:无理由退货
|
|
|
+ if (customerInfo.getCustomerIsSolve() != null) {
|
|
|
+ switch (customerInfo.getCustomerIsSolve()) { //处理结果: 1:已解决 2:未解决 3:换新 4:维修 5:补发 6:退货 7:无理由退货
|
|
|
case 3://获取换新
|
|
|
Renewed renewed = new Renewed();
|
|
|
renewed.setCustomerId(customerInfo.getCustomerId());
|
|
|
renewed = renewedService.getRenewed(renewed);
|
|
|
- customerCommon = CustomerCommonUtil.getCustomerCommon(3,renewed);
|
|
|
+ customerCommon = CustomerCommonUtil.getCustomerCommon(3, renewed);
|
|
|
break;
|
|
|
case 4://维修
|
|
|
Repair repair = new Repair();
|
|
|
repair.setCustomerId(customerInfo.getCustomerId());
|
|
|
repair = repairService.getRepair(repair);
|
|
|
- customerCommon = CustomerCommonUtil.getCustomerCommon(4,repair);
|
|
|
+ customerCommon = CustomerCommonUtil.getCustomerCommon(4, repair);
|
|
|
break;
|
|
|
case 5:
|
|
|
- Reissue reissue = new Reissue();
|
|
|
+ Reissue reissue = new Reissue();
|
|
|
reissue.setCustomerId(customerInfo.getCustomerId());
|
|
|
reissue = reissueService.getReissue(reissue);
|
|
|
- customerCommon = CustomerCommonUtil.getCustomerCommon(5,reissue);
|
|
|
+ customerCommon = CustomerCommonUtil.getCustomerCommon(5, reissue);
|
|
|
break;
|
|
|
case 6:
|
|
|
- BackGoods backGoods = new BackGoods();
|
|
|
+ BackGoods backGoods = new BackGoods();
|
|
|
backGoods.setCustomerId(customerInfo.getCustomerId());
|
|
|
backGoods = backGoodsService.getBackGoods(backGoods);
|
|
|
- customerCommon = CustomerCommonUtil.getCustomerCommon(6,backGoods);
|
|
|
+ customerCommon = CustomerCommonUtil.getCustomerCommon(6, backGoods);
|
|
|
break;
|
|
|
case 7:
|
|
|
- NoreasonBack noreasonBack = new NoreasonBack();
|
|
|
+ NoreasonBack noreasonBack = new NoreasonBack();
|
|
|
noreasonBack.setCustomerId(customerInfo.getCustomerId());
|
|
|
noreasonBack = noreasonBackService.getNoreasonBack(noreasonBack);
|
|
|
- customerCommon = CustomerCommonUtil.getCustomerCommon(7,noreasonBack);
|
|
|
+ customerCommon = CustomerCommonUtil.getCustomerCommon(7, noreasonBack);
|
|
|
break;
|
|
|
}
|
|
|
|
|
@@ -221,7 +218,7 @@ public class AdminCustomerController {
|
|
|
customerCommon = customerCommonService.getListProduceAndFitting(customerCommon);
|
|
|
|
|
|
// 2018/4/18 页面只会给寄回的赋值,在处理方式为补发的情况下,寄出需要赋值到寄回当中
|
|
|
- if(customerInfo.getCustomerIsSolve() == 5){
|
|
|
+ if (customerInfo.getCustomerIsSolve() == 5) {
|
|
|
//售后寄回产品表
|
|
|
List<ClosedProdcue> closedProdcues = new ArrayList<ClosedProdcue>();
|
|
|
for (SendProdcue sendProdcue : customerCommon.getSendProdcues()) {
|
|
@@ -255,9 +252,9 @@ public class AdminCustomerController {
|
|
|
}
|
|
|
mv.addObject("customerCommon", customerCommon);
|
|
|
|
|
|
- if(customerInfo.getTypeId() == 1){
|
|
|
+ if (customerInfo.getTypeId() == 1) {
|
|
|
customerInfo.setIsNeedSelectOrder(2); //不需要订单
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
customerInfo.setIsNeedSelectOrder(1);
|
|
|
}
|
|
|
|
|
@@ -276,32 +273,32 @@ public class AdminCustomerController {
|
|
|
// }
|
|
|
// mv.addObject("productList", productList);
|
|
|
|
|
|
- if(customerInfo.getTypeId() != 1 && (customerInfo.getCustomerIsSolve() == 3 || customerInfo.getCustomerIsSolve() == 4 || customerInfo.getCustomerIsSolve() == 5 ||
|
|
|
- customerInfo.getCustomerIsSolve() == 6 || customerInfo.getCustomerIsSolve() == 7)){
|
|
|
+ if (customerInfo.getTypeId() != 1 && (customerInfo.getCustomerIsSolve() == 3 || customerInfo.getCustomerIsSolve() == 4 || customerInfo.getCustomerIsSolve() == 5 ||
|
|
|
+ customerInfo.getCustomerIsSolve() == 6 || customerInfo.getCustomerIsSolve() == 7)) {
|
|
|
RelationOrder relationOrder = new RelationOrder();
|
|
|
relationOrder.setRelationType(customerCommon.getCustomerIsSolve());
|
|
|
relationOrder.setRelationId(customerCommon.getRelationId());
|
|
|
List<RelationOrder> relationOrderList = relationOrderService.getRelationOrderList(relationOrder);
|
|
|
|
|
|
String[] salesIds = new String[relationOrderList.size()];
|
|
|
- for (int k=0; k<relationOrderList.size();k++){
|
|
|
+ for (int k = 0; k < relationOrderList.size(); k++) {
|
|
|
salesIds[k] = String.valueOf(relationOrderList.get(k).getSalesId());
|
|
|
}
|
|
|
SalesOrder so = new SalesOrder();
|
|
|
so.setSalesIds(salesIds);
|
|
|
List<SalesOrder> orderList = salesOrderService.listSalesOrder(so);
|
|
|
- for (SalesOrder sor: orderList) {
|
|
|
+ for (SalesOrder sor : orderList) {
|
|
|
SalesOrderItem salesOrderItem = new SalesOrderItem();
|
|
|
salesOrderItem.setItemOrderId(sor.getSalesId());
|
|
|
List<SalesOrderItem> salesOrderItemList = salesOrderService.listSalesOrderItem(salesOrderItem);
|
|
|
sor.setSalesOrderItemList(salesOrderItemList);
|
|
|
}
|
|
|
mv.addObject("salesOrderList", orderList);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
mv.addObject("salesOrderList", null);
|
|
|
}
|
|
|
}
|
|
|
- if ("2".equals(customerInfo.getCustomerIsVisit())){ //1:不需要回访 2:需要回访
|
|
|
+ if ("2".equals(customerInfo.getCustomerIsVisit())) { //1:不需要回访 2:需要回访
|
|
|
Visit visit = new Visit();
|
|
|
visit.setCustomerId(customerInfo.getCustomerId());
|
|
|
visit = visitService.getVisit(visit);
|
|
@@ -334,13 +331,14 @@ public class AdminCustomerController {
|
|
|
|
|
|
/**
|
|
|
* 查询问题描述
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequiresPermissions("customer:add:customer")
|
|
|
@RequestMapping(value = "/select_question_describe")
|
|
|
public ResponseJson selectQuestionDescribe(HttpServletRequest request, Integer customerId) throws Exception {
|
|
|
- if(customerId == null || customerId == 0){
|
|
|
+ if (customerId == null || customerId == 0) {
|
|
|
return new ResponseJson(500, "未获取到问题描述", 500);
|
|
|
}
|
|
|
//查询问题描述表
|
|
@@ -460,9 +458,9 @@ public class AdminCustomerController {
|
|
|
salesOrder.setSalesOrderItemList(list);
|
|
|
|
|
|
try {
|
|
|
- Integer flag = customerService.addOrder(salesOrder);
|
|
|
+ Integer flag = customerService.addOrder(salesOrder);
|
|
|
} catch (RuntimeException e) {
|
|
|
- return new ResponseJson(500, "添加订单失败--"+ e.getMessage(), 500);
|
|
|
+ return new ResponseJson(500, "添加订单失败--" + e.getMessage(), 500);
|
|
|
}
|
|
|
Integer orderId = salesOrder.getSalesId();
|
|
|
ResponseJson rj = new ResponseJson(200, "添加订单成功", 200);
|
|
@@ -473,6 +471,7 @@ public class AdminCustomerController {
|
|
|
|
|
|
/**
|
|
|
* 查询销售公司
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@ResponseBody
|
|
@@ -487,6 +486,7 @@ public class AdminCustomerController {
|
|
|
rj.addResponseKeyValue("companyInfoList", companyInfoList);
|
|
|
return rj;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 获取店铺集合
|
|
|
*
|
|
@@ -520,12 +520,12 @@ public class AdminCustomerController {
|
|
|
@ResponseBody
|
|
|
@RequiresPermissions("customer:add:customer")
|
|
|
@RequestMapping(value = "/select_salesOrder")
|
|
|
- public ResponseJson listOrder(HttpServletRequest request, SalesOrder salesOrder,String ids,
|
|
|
- @RequestParam(value = "pageSize", defaultValue = "20", required = false) Integer pageSize,
|
|
|
- @RequestParam(value = "pageNO", defaultValue = "1", required = false) Integer pageNO,
|
|
|
- @RequestParam(value = "totalNum", defaultValue = "0", required = false) Integer totalNum) {
|
|
|
+ public ResponseJson listOrder(HttpServletRequest request, SalesOrder salesOrder, String ids,
|
|
|
+ @RequestParam(value = "pageSize", defaultValue = "20", required = false) Integer pageSize,
|
|
|
+ @RequestParam(value = "pageNO", defaultValue = "1", required = false) Integer pageNO,
|
|
|
+ @RequestParam(value = "totalNum", defaultValue = "0", required = false) Integer totalNum) {
|
|
|
|
|
|
- if(ids!= null && ids.indexOf("_") > -1){
|
|
|
+ if (ids != null && ids.indexOf("_") > -1) {
|
|
|
String[] salesIds = ids.split("_");
|
|
|
salesOrder.setSalesIds(salesIds);
|
|
|
}
|
|
@@ -569,9 +569,9 @@ public class AdminCustomerController {
|
|
|
@RequestParam(value = "pageSize", defaultValue = "10", required = false) Integer pageSize,
|
|
|
@RequestParam(value = "pageNO", defaultValue = "1", required = false) Integer pageNO,
|
|
|
@RequestParam(value = "totalNum", defaultValue = "0", required = false) Integer totalNum) throws Exception {
|
|
|
- long x = new Date().getTime();
|
|
|
+ long x = new Date().getTime();
|
|
|
ModelAndView mv = new ModelAndView("cm/customer/custome_list");
|
|
|
- if(customerInfo.getAdminId() == null && isFirst == 1){
|
|
|
+ if (customerInfo.getAdminId() == null && isFirst == 1) {
|
|
|
//获取登录员工id
|
|
|
Integer adminId = AdminUtils.getLoginAdminId();
|
|
|
customerInfo.setAdminId(adminId);
|
|
@@ -610,11 +610,11 @@ public class AdminCustomerController {
|
|
|
customerInfo.setComplaintDetectList(null);
|
|
|
|
|
|
StitchAttrUtil sa = StitchAttrUtil.getSa();
|
|
|
- sa.addDatePro("yyyy-MM-dd","startTime","endTime");
|
|
|
+ sa.addDatePro("yyyy-MM-dd", "startTime", "endTime");
|
|
|
sa.setModelAndView(customerInfo, mv, "/admin/customer/select_customer_list", pagedResult);
|
|
|
|
|
|
long y = new Date().getTime();
|
|
|
- System.out.println("使用时间:"+(y-x));
|
|
|
+ System.out.println("使用时间:" + (y - x));
|
|
|
return mv;
|
|
|
}
|
|
|
|
|
@@ -860,7 +860,7 @@ public class AdminCustomerController {
|
|
|
public ResponseJson addCustomer(HttpServletRequest request, CustomerInfo customerInfo, SalesOrder salesOrder, CustomerCommon customerCommon,
|
|
|
String sendProdcuesJson, String sendFittingsJson, String closedProdcuesJson, String closedFittingsJson) throws Exception {
|
|
|
ResponseJson rjx = this.isValiData(customerInfo);
|
|
|
- if(rjx.getResultCode() == 500){
|
|
|
+ if (rjx.getResultCode() == 500) {
|
|
|
return rjx;
|
|
|
}
|
|
|
|
|
@@ -869,7 +869,7 @@ public class AdminCustomerController {
|
|
|
Integer typeCompany = customerInfo.getTypeCompany(); // 所属商城 1:美国watero; 2:上朵电动牙刷 3:优尼雅净水机
|
|
|
|
|
|
Integer flag = 0;
|
|
|
- if(customerInfo.getIsNeedSelectOrder() == 1){ ////1:需要有订单 2:不需要有订单
|
|
|
+ if (customerInfo.getIsNeedSelectOrder() == 1) { ////1:需要有订单 2:不需要有订单
|
|
|
JSONArray jsonArray;
|
|
|
List<SendProdcue> sendProdcueList;
|
|
|
List<SendFitting> sendFittingList;
|
|
@@ -909,9 +909,9 @@ public class AdminCustomerController {
|
|
|
} catch (RuntimeException e) {
|
|
|
e.printStackTrace();
|
|
|
return new ResponseJson(500, e.getMessage(), 500);
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- return new ResponseJson(500,"添加失败", 500);
|
|
|
+ return new ResponseJson(500, "添加失败", 500);
|
|
|
}
|
|
|
customerId = customerInfo.getCustomerId();
|
|
|
logger.info("-----------------添加客诉结束----------------------");
|
|
@@ -983,9 +983,9 @@ public class AdminCustomerController {
|
|
|
@RequiresPermissions("customer:update:customer")
|
|
|
@RequestMapping("/update_customer")
|
|
|
public ResponseJson updateCustomer(HttpServletRequest request, CustomerInfo customerInfo, SalesOrder salesOrder, CustomerCommon customerCommon,
|
|
|
- String sendProdcuesJson, String sendFittingsJson, String closedProdcuesJson, String closedFittingsJson) throws Exception {
|
|
|
+ String sendProdcuesJson, String sendFittingsJson, String closedProdcuesJson, String closedFittingsJson) throws Exception {
|
|
|
ResponseJson rjx = this.isValiData(customerInfo);
|
|
|
- if(rjx.getResultCode() == 500){
|
|
|
+ if (rjx.getResultCode() == 500) {
|
|
|
return rjx;
|
|
|
}
|
|
|
Integer flag = 0;
|
|
@@ -994,7 +994,7 @@ public class AdminCustomerController {
|
|
|
String phone = customerInfo.getCustomerTel(); //手机号码
|
|
|
Integer typeCompany = customerInfo.getTypeCompany(); // 所属商城 1:美国watero; 2:上朵电动牙刷 3:优尼雅净水机
|
|
|
|
|
|
- if(customerInfo.getIsNeedSelectOrder() == 1){
|
|
|
+ if (customerInfo.getIsNeedSelectOrder() == 1) {
|
|
|
JSONArray jsonArray;
|
|
|
List<SendProdcue> sendProdcueList;
|
|
|
List<SendFitting> sendFittingList;
|
|
@@ -1033,9 +1033,9 @@ public class AdminCustomerController {
|
|
|
} catch (RuntimeException e) {
|
|
|
e.printStackTrace();
|
|
|
return new ResponseJson(500, e.getMessage(), 500);
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- return new ResponseJson(500,"修改失败", 500);
|
|
|
+ return new ResponseJson(500, "修改失败", 500);
|
|
|
}
|
|
|
customerId = customerInfo.getCustomerId();
|
|
|
logger.info("-----------------修改客诉结束----------------------");
|
|
@@ -1055,7 +1055,7 @@ public class AdminCustomerController {
|
|
|
*/
|
|
|
public ResponseJson isValiData(CustomerInfo customerInfo) {
|
|
|
ResponseJson rj = new ResponseJson();
|
|
|
- if(customerInfo.getAdminId() == null){
|
|
|
+ if (customerInfo.getAdminId() == null) {
|
|
|
return new ResponseJson(500, "未填写客诉id", 500);
|
|
|
}
|
|
|
return rj;
|
|
@@ -1091,7 +1091,7 @@ public class AdminCustomerController {
|
|
|
return new ResponseJson(500, "问题修改失败!", 500);
|
|
|
}
|
|
|
}
|
|
|
- url += "/" + complaintQuestionInfo.getQuestionId()+"/"+typeCompany;
|
|
|
+ url += "/" + complaintQuestionInfo.getQuestionId() + "/" + typeCompany;
|
|
|
switch (typeCompany) {
|
|
|
case 1:
|
|
|
con = SmsConfig.SEND_PRODUCT_SEND_WATERO;
|
|
@@ -1144,19 +1144,18 @@ public class AdminCustomerController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- String encodePhoneNumber(String number)
|
|
|
- {
|
|
|
+ String encodePhoneNumber(String number) {
|
|
|
int encnum = Integer.parseInt(number.substring(2));
|
|
|
|
|
|
- int prefix = (number.charAt(1) - '2') /2; // '3'=>0, '5'=>1, '[67]'=>2, '8'=>3
|
|
|
+ int prefix = (number.charAt(1) - '2') / 2; // '3'=>0, '5'=>1, '[67]'=>2, '8'=>3
|
|
|
|
|
|
encnum |= (prefix <<= 30);
|
|
|
|
|
|
final byte[] raw = new byte[4];
|
|
|
|
|
|
- raw[0] = (byte)(encnum >>> 24);
|
|
|
- raw[1] = (byte)(encnum >>> 16);
|
|
|
- raw[2] = (byte)(encnum >>> 8);
|
|
|
+ raw[0] = (byte) (encnum >>> 24);
|
|
|
+ raw[1] = (byte) (encnum >>> 16);
|
|
|
+ raw[2] = (byte) (encnum >>> 8);
|
|
|
raw[3] = (byte) encnum;
|
|
|
|
|
|
return Base64.encodeBase64URLSafeString(raw);
|
|
@@ -1368,15 +1367,15 @@ public class AdminCustomerController {
|
|
|
if (StringUtils.isNotEmpty(mergeAddress)) {
|
|
|
renewed.setRenewedSendMergeAddress(mergeAddress);
|
|
|
}
|
|
|
- if(renewed.getRenewedBackStatus() != null){
|
|
|
- if(renewed.getRenewedBackStatus() != 1){
|
|
|
- ComplaintSignclosedInfo cs = new ComplaintSignclosedInfo();
|
|
|
- cs.setSignclosedCustomerId(renewed.getCustomerId());
|
|
|
- cs.setSignclosedLogistics(renewed.getRenewedBackLogisticsCompany());
|
|
|
- cs.setSignclosedLogisticsNumber(renewed.getRenewedBackLogisticsNo());
|
|
|
- complaintSignclosedInfoService.updateSignclosedByCustomerId(cs);
|
|
|
+ if (renewed.getRenewedBackStatus() != null) {
|
|
|
+ if (renewed.getRenewedBackStatus() != 1) {
|
|
|
+ ComplaintSignclosedInfo cs = new ComplaintSignclosedInfo();
|
|
|
+ cs.setSignclosedCustomerId(renewed.getCustomerId());
|
|
|
+ cs.setSignclosedLogistics(renewed.getRenewedBackLogisticsCompany());
|
|
|
+ cs.setSignclosedLogisticsNumber(renewed.getRenewedBackLogisticsNo());
|
|
|
+ complaintSignclosedInfoService.updateSignclosedByCustomerId(cs);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
//修改换新信息
|
|
|
int num = renewedService.updateRenewedInfo(renewed, null, null);
|
|
@@ -1484,8 +1483,8 @@ public class AdminCustomerController {
|
|
|
return new ResponseJson(500, "该efast订单号无效,请重新输入!", 500);
|
|
|
}*/
|
|
|
|
|
|
- if(repair.getRepairBackStatus() != null){
|
|
|
- if(repair.getRepairBackStatus() != 1){
|
|
|
+ if (repair.getRepairBackStatus() != null) {
|
|
|
+ if (repair.getRepairBackStatus() != 1) {
|
|
|
ComplaintSignclosedInfo cs = new ComplaintSignclosedInfo();
|
|
|
cs.setSignclosedCustomerId(repair.getCustomerId());
|
|
|
cs.setSignclosedLogistics(repair.getRepairBackLogisticsCompany());
|
|
@@ -1755,7 +1754,7 @@ public class AdminCustomerController {
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping(value = "/selectNumberBacklog")
|
|
|
- public ResultMsg selectTodo(HttpServletRequest request){
|
|
|
+ public ResultMsg selectTodo(HttpServletRequest request) {
|
|
|
ResultMsg msg = new ResultMsg();
|
|
|
CustomerInfo customerInfo = new CustomerInfo();
|
|
|
//获取登录员工id
|
|
@@ -1777,12 +1776,12 @@ public class AdminCustomerController {
|
|
|
customerCommon.setRelationCreateTime(new Date());
|
|
|
Integer notSendCustomer = customerCommonService.listCustomerCommonByStatus(customerCommon);
|
|
|
|
|
|
- Map<String,Integer> numberMap = new HashMap<>();
|
|
|
- numberMap.put("notSolvedCustomer",notSolvedCustomer);
|
|
|
- numberMap.put("amountReceivedCustomer",amountReceivedCustomer);
|
|
|
- numberMap.put("noEntryCustomer",noEntryCustomer);
|
|
|
- numberMap.put("notSendCustomer",notSendCustomer);
|
|
|
- numberMap.put("adminDept",admin.getAdminDept());
|
|
|
+ Map<String, Integer> numberMap = new HashMap<>();
|
|
|
+ numberMap.put("notSolvedCustomer", notSolvedCustomer);
|
|
|
+ numberMap.put("amountReceivedCustomer", amountReceivedCustomer);
|
|
|
+ numberMap.put("noEntryCustomer", noEntryCustomer);
|
|
|
+ numberMap.put("notSendCustomer", notSendCustomer);
|
|
|
+ numberMap.put("adminDept", admin.getAdminDept());
|
|
|
msg.setResultCode(ResultInfo.SUCCESSCODE);
|
|
|
msg.setStatus(true);
|
|
|
msg.setData(numberMap);
|
|
@@ -1798,12 +1797,12 @@ public class AdminCustomerController {
|
|
|
@ResponseBody
|
|
|
@RequiresPermissions("customer:list:customer")
|
|
|
@RequestMapping("/get_custoner_info")
|
|
|
- public ResponseJson getCustonerInfo(HttpServletRequest request,CustomerCommon customerCommon) throws Exception {
|
|
|
+ public ResponseJson getCustonerInfo(HttpServletRequest request, CustomerCommon customerCommon) throws Exception {
|
|
|
if (customerCommon == null) {
|
|
|
return new ResponseJson(500, "参数错误!", 500);
|
|
|
}
|
|
|
List<CustomerCommon> customerCommonList = customerCommonService.listCustomerCommon(customerCommon);
|
|
|
- if(customerCommonList.size() < 1){
|
|
|
+ if (customerCommonList.size() < 1) {
|
|
|
return new ResponseJson(500, "不存在相关客诉信息!", 500);
|
|
|
} else {
|
|
|
ResponseJson rj = new ResponseJson(200, "查询成功", 200);
|
|
@@ -1815,6 +1814,7 @@ public class AdminCustomerController {
|
|
|
|
|
|
/**
|
|
|
* 申请邮费
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@ResponseBody
|
|
@@ -1822,7 +1822,7 @@ public class AdminCustomerController {
|
|
|
@RequestMapping(value = "/apply_postage")
|
|
|
public ResponseJson applyPostage(HttpServletRequest request, Integer customerId) throws Exception {
|
|
|
CustomerInfo customerInfo = customerService.getCustomerInfo(customerId);
|
|
|
- if(customerInfo == null){
|
|
|
+ if (customerInfo == null) {
|
|
|
return new ResponseJson(500, "未获取到客诉", 500);
|
|
|
}
|
|
|
|
|
@@ -1831,50 +1831,51 @@ public class AdminCustomerController {
|
|
|
List<CustomerCommon> customerCommonList = customerCommonService.listCustomerCommon(customerCommon);
|
|
|
customerCommon = customerCommonList.get(0);
|
|
|
|
|
|
- if(customerCommon.getRelationBackStatus() == 1){ //1:未寄回 2:已寄回 3:已收货 4:已签收待确认
|
|
|
+ if (customerCommon.getRelationBackStatus() == 1) { //1:未寄回 2:已寄回 3:已收货 4:已签收待确认
|
|
|
return new ResponseJson(500, "请修改寄回状态,并填写寄回信息", 500);
|
|
|
}
|
|
|
|
|
|
- if(customerCommon.getRelationBackStatus() == 2){ //1:未寄回 2:已寄回 3:已收货 4:已签收待确认
|
|
|
+ if (customerCommon.getRelationBackStatus() == 2) { //1:未寄回 2:已寄回 3:已收货 4:已签收待确认
|
|
|
return new ResponseJson(500, "产品正在寄回中!", 500);
|
|
|
}
|
|
|
|
|
|
- if(customerCommon.getRelationIsTransfer() == 0){ //relationIsTransfer 是否需要转账邮费 0:不需要 10:需要转账
|
|
|
+ if (customerCommon.getRelationIsTransfer() == 0) { //relationIsTransfer 是否需要转账邮费 0:不需要 10:需要转账
|
|
|
return new ResponseJson(500, "请修改邮费转账状态,并填写邮费信息", 500);
|
|
|
}
|
|
|
|
|
|
- if(customerCommon.getRelationBackPostage() == null || customerCommon.getRelationBackPostage() == 0 //relationBackPostage
|
|
|
- || customerCommon.getRelationAlipay() == null || customerCommon.getRelationAlipayName() == null ){
|
|
|
+ if (customerCommon.getRelationBackPostage() == null || customerCommon.getRelationBackPostage() == 0 //relationBackPostage
|
|
|
+ || customerCommon.getRelationAlipay() == null || customerCommon.getRelationAlipayName() == null) {
|
|
|
return new ResponseJson(500, "请填写邮费信息", 500);
|
|
|
}
|
|
|
|
|
|
- if(customerInfo.getCompanyId() == null || customerInfo.getCompanyId() == 0 ){
|
|
|
+ if (customerInfo.getCompanyId() == null || customerInfo.getCompanyId() == 0) {
|
|
|
return new ResponseJson(500, "未正确选择销售公司", 500);
|
|
|
}
|
|
|
|
|
|
Postage age = new Postage();
|
|
|
age.setCustomerId(customerInfo.getCustomerId()); //客诉id
|
|
|
List<Postage> postageList = postageService.listPostage(age);
|
|
|
- if(postageList != null && postageList.size() > 0){
|
|
|
+ if (postageList != null && postageList.size() > 0) {
|
|
|
return new ResponseJson(500, "该条客诉已在申请邮费中了", 500);
|
|
|
}
|
|
|
|
|
|
ResponseJson rj = new ResponseJson(200, "可以申请邮费", 200);
|
|
|
- rj.addResponseKeyValue("customerCommon",customerCommon);
|
|
|
- rj.addResponseKeyValue("customerInfo",customerInfo);
|
|
|
+ rj.addResponseKeyValue("customerCommon", customerCommon);
|
|
|
+ rj.addResponseKeyValue("customerInfo", customerInfo);
|
|
|
return rj;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 申请邮费
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequiresPermissions("customer:applyPostage:customer")
|
|
|
@RequestMapping(value = "/add_postage")
|
|
|
- public ResponseJson addPostage(HttpServletRequest request, Integer customerId,String postageLogisticsImg) throws Exception {
|
|
|
+ public ResponseJson addPostage(HttpServletRequest request, Integer customerId, String postageLogisticsImg) throws Exception {
|
|
|
CustomerInfo customerInfo = customerService.getCustomerInfo(customerId);
|
|
|
- if(customerInfo == null){
|
|
|
+ if (customerInfo == null) {
|
|
|
return new ResponseJson(500, "未获取到客诉", 500);
|
|
|
}
|
|
|
|
|
@@ -1883,40 +1884,40 @@ public class AdminCustomerController {
|
|
|
List<CustomerCommon> customerCommonList = customerCommonService.listCustomerCommon(customerCommon);
|
|
|
customerCommon = customerCommonList.get(0);
|
|
|
|
|
|
- if(customerCommon.getRelationBackStatus() == 1){ //1:未寄回 2:已寄回 3:已收货 4:已签收待确认
|
|
|
+ if (customerCommon.getRelationBackStatus() == 1) { //1:未寄回 2:已寄回 3:已收货 4:已签收待确认
|
|
|
return new ResponseJson(500, "请修改寄回状态,并填写寄回信息", 500);
|
|
|
}
|
|
|
|
|
|
- if(customerCommon.getRelationBackStatus() == 2){ //1:未寄回 2:已寄回 3:已收货 4:已签收待确认
|
|
|
+ if (customerCommon.getRelationBackStatus() == 2) { //1:未寄回 2:已寄回 3:已收货 4:已签收待确认
|
|
|
return new ResponseJson(500, "产品正在寄回中!", 500);
|
|
|
}
|
|
|
|
|
|
- if(customerCommon.getRelationIsTransfer() == 0){ //relationIsTransfer 是否需要转账邮费 0:不需要 10:需要转账
|
|
|
+ if (customerCommon.getRelationIsTransfer() == 0) { //relationIsTransfer 是否需要转账邮费 0:不需要 10:需要转账
|
|
|
return new ResponseJson(500, "请修改邮费转账状态,并填写邮费信息", 500);
|
|
|
}
|
|
|
|
|
|
- if(customerCommon.getRelationBackPostage() == null || customerCommon.getRelationBackPostage() == 0 //relationBackPostage
|
|
|
- || customerCommon.getRelationAlipay() == null || customerCommon.getRelationAlipayName() == null ){
|
|
|
+ if (customerCommon.getRelationBackPostage() == null || customerCommon.getRelationBackPostage() == 0 //relationBackPostage
|
|
|
+ || customerCommon.getRelationAlipay() == null || customerCommon.getRelationAlipayName() == null) {
|
|
|
return new ResponseJson(500, "请填写邮费信息", 500);
|
|
|
}
|
|
|
|
|
|
- if(customerInfo.getCompanyId() == null || customerInfo.getCompanyId() == 0 ){
|
|
|
+ if (customerInfo.getCompanyId() == null || customerInfo.getCompanyId() == 0) {
|
|
|
return new ResponseJson(500, "未正确选择销售公司", 500);
|
|
|
}
|
|
|
|
|
|
Postage age = new Postage();
|
|
|
age.setCustomerId(customerInfo.getCustomerId()); //客诉id
|
|
|
List<Postage> postageList = postageService.listPostage(age);
|
|
|
- if(postageList != null && postageList.size() > 0){
|
|
|
+ if (postageList != null && postageList.size() > 0) {
|
|
|
return new ResponseJson(500, "该条客诉已在申请邮费中了", 500);
|
|
|
}
|
|
|
|
|
|
String orderId = "";
|
|
|
- for (SalesOrder salesOrder : customerCommon.getSalesOrderList()){
|
|
|
- if("".equals(orderId)){
|
|
|
+ for (SalesOrder salesOrder : customerCommon.getSalesOrderList()) {
|
|
|
+ if ("".equals(orderId)) {
|
|
|
orderId = salesOrder.getSalesOrderId();
|
|
|
- }else{
|
|
|
- orderId += ","+salesOrder.getSalesOrderId();
|
|
|
+ } else {
|
|
|
+ orderId += "," + salesOrder.getSalesOrderId();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1941,7 +1942,7 @@ public class AdminCustomerController {
|
|
|
postage.setPostageLogisticsImg(postageLogisticsImg);
|
|
|
flag = postageService.savePostage(postage);
|
|
|
|
|
|
- if(flag < 1){
|
|
|
+ if (flag < 1) {
|
|
|
return new ResponseJson(500, "申请失败", 500);
|
|
|
}
|
|
|
|
|
@@ -1984,7 +1985,7 @@ public class AdminCustomerController {
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping("/selectOnCustomer")
|
|
|
- public ResponseJson listOnCustomer(HttpServletRequest request,CustomerInfo customerInfo) throws Exception {
|
|
|
+ public ResponseJson listOnCustomer(HttpServletRequest request, CustomerInfo customerInfo) throws Exception {
|
|
|
if (customerInfo == null) {
|
|
|
return new ResponseJson(500, "查询客诉失败!", 500);
|
|
|
}
|
|
@@ -2000,13 +2001,14 @@ public class AdminCustomerController {
|
|
|
|
|
|
/**
|
|
|
* 根据efast订单号查询efast订单物流信息
|
|
|
+ *
|
|
|
* @param request
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@RequestMapping("/getefastOrder")
|
|
|
- public ResponseJson getEfastOrderInfo(HttpServletRequest request,String efastOrderId) throws Exception {
|
|
|
+ public ResponseJson getEfastOrderInfo(HttpServletRequest request, String efastOrderId) throws Exception {
|
|
|
if (efastOrderId == null) {
|
|
|
return new ResponseJson(500, "查询失败!", 500);
|
|
|
}
|
|
@@ -2024,28 +2026,69 @@ public class AdminCustomerController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 下载客诉信息 (2018-05-29)
|
|
|
+ *
|
|
|
* @param request
|
|
|
* @param res
|
|
|
* @param
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
@RequestMapping("/download_customer_excel")
|
|
|
- public void downloadEfastOrderExcel(HttpServletRequest request,HttpServletResponse res) throws Exception{
|
|
|
+ public void downloadEfastOrderExcel(HttpServletRequest request, HttpServletResponse res) throws Exception {
|
|
|
List<CustomerStatisticalInfo> customerList = customerService.listStatisticalCustomer();
|
|
|
String[] cells = {
|
|
|
- "日期","姓名","联系电话","类别","来源入口",
|
|
|
- "问题类别","小类名称","客诉问题","处理过程","购买日期",
|
|
|
- "处理结果","销售公司","销售渠道","产品型号","产品颜色",
|
|
|
- "产品数量","寄回快递","寄回单号","签收日期",
|
|
|
- "状态","寄出快递","寄出快递","开箱损","二次客诉"
|
|
|
+ "日期", "姓名", "联系电话", "类别", "来源入口",
|
|
|
+ "问题类别", "小类名称", "客诉问题", "处理过程", "购买日期",
|
|
|
+ "处理结果", "销售公司", "销售渠道", "产品型号", "产品颜色",
|
|
|
+ "产品数量", "寄回快递", "寄回单号", "签收日期",
|
|
|
+ "状态", "寄出快递", "寄出快递", "开箱损", "二次客诉"
|
|
|
};
|
|
|
- //导出订单Excel并下载
|
|
|
- customerExcel(request,res,cells,customerList);
|
|
|
+ List<CustomerStatisticalInfo> customerStatisticalInfoList = new ArrayList<>();
|
|
|
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ for (CustomerStatisticalInfo customerInfo : customerList) {
|
|
|
+ //新建一个容器
|
|
|
+ CustomerStatisticalInfo customer = new CustomerStatisticalInfo();
|
|
|
+ //将数据copy到新容器
|
|
|
+ BeanUtils.copyProperties(customerInfo, customer);
|
|
|
+ CustomerCommon customerCommon = new CustomerCommon();
|
|
|
+ customerCommon.setCustomerId(customerInfo.getCustomerId());
|
|
|
+ List<CustomerCommon> listCustomerCommon = customerCommonService.listCustomerCommon(customerCommon);
|
|
|
+ if(listCustomerCommon.size() > 0) {
|
|
|
+ for (CustomerCommon common : listCustomerCommon) {
|
|
|
+ if (common.getSalesOrderList().size() > 0) {
|
|
|
+ for (SalesOrder salesOrder : common.getSalesOrderList()) {
|
|
|
+ if (salesOrder.getSalesOrderItemList().size() > 0) {
|
|
|
+ for (SalesOrderItem salesOrderItem : salesOrder.getSalesOrderItemList()) {
|
|
|
+ customer.setRelationBackLogisticsCompany(common.getRelationBackLogisticsCompany());
|
|
|
+ customer.setRelationBackLogisticsNo(common.getRelationBackLogisticsNo());
|
|
|
+ customer.setRelationSendLogisticsCompany(common.getRelationSendLogisticsCompany());
|
|
|
+ customer.setRelationSendLogisticsNo(common.getRelationSendLogisticsNo());
|
|
|
+ customer.setRelationBackStatus(String.valueOf(common.getRelationBackStatus()));
|
|
|
+ customer.setRelationBackReceiptDate(common.getRelationBackReceiptDate() == null?null:format.format(common.getRelationBackReceiptDate()));
|
|
|
+ customer.setSalesPayTime(salesOrder.getSalesPayTime());
|
|
|
+ customer.setItemProductName(salesOrderItem.getItemProductName());
|
|
|
+ customer.setItemProductColor(salesOrderItem.getItemProductColor());
|
|
|
+ customer.setItemNum(String.valueOf(salesOrderItem.getItemNum()));
|
|
|
+ customerStatisticalInfoList.add(customer);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ customerStatisticalInfoList.add(customer);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ customerStatisticalInfoList.add(customer);
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ customerStatisticalInfoList.add(customer);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //导出订单Excel并下载
|
|
|
+ customerExcel(request,res,cells,customerStatisticalInfoList);
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -2095,6 +2138,26 @@ public class AdminCustomerController {
|
|
|
if(customerStatisticalInfo.getSalesPayTime() != null ){
|
|
|
salesPayTime = format.format(customerStatisticalInfo.getSalesPayTime());
|
|
|
}
|
|
|
+ String backLogisticsCompany = "";
|
|
|
+ if(customerStatisticalInfo.getRelationBackLogisticsCompany() != null){
|
|
|
+ backLogisticsCompany = KuaiDi100.replace(customerStatisticalInfo.getRelationBackLogisticsCompany());
|
|
|
+ }
|
|
|
+ String backStatus = "未知";
|
|
|
+ if(customerStatisticalInfo.getRelationBackStatus() != null){
|
|
|
+ if(customerStatisticalInfo.getRelationBackStatus().equals("1")){
|
|
|
+ backStatus = "未寄回";
|
|
|
+ }
|
|
|
+ if(customerStatisticalInfo.getRelationBackStatus().equals("2")){
|
|
|
+ backStatus = "已寄回";
|
|
|
+ }
|
|
|
+ if(customerStatisticalInfo.getRelationBackStatus().equals("3")){
|
|
|
+ backStatus = "已收货";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String sendLogisticsCompany = "";
|
|
|
+ if(customerStatisticalInfo.getRelationSendLogisticsCompany() != null){
|
|
|
+ sendLogisticsCompany = KuaiDi100.replace(customerStatisticalInfo.getRelationSendLogisticsCompany());
|
|
|
+ }
|
|
|
|
|
|
// 创建单元格,设置值
|
|
|
row.createCell(0).setCellValue(createTime);
|
|
@@ -2106,18 +2169,18 @@ public class AdminCustomerController {
|
|
|
row.createCell(6).setCellValue(customerStatisticalInfo.getSmallClassName() == null ? null : customerStatisticalInfo.getSmallClassName());
|
|
|
row.createCell(7).setCellValue(customerStatisticalInfo.getDescribeTitle() == null ? null : customerStatisticalInfo.getDescribeTitle());
|
|
|
row.createCell(8).setCellValue(customerStatisticalInfo.getDescribeHandleDesc() == null ? null : customerStatisticalInfo.getDescribeHandleDesc());
|
|
|
- row.createCell(9).setCellValue(customerStatisticalInfo.getCustomerIsSolve() == null ? null : customerStatisticalInfo.getCustomerIsSolve());
|
|
|
- row.createCell(10).setCellValue(salesPayTime);
|
|
|
+ row.createCell(9).setCellValue(salesPayTime);
|
|
|
+ row.createCell(10).setCellValue(customerStatisticalInfo.getCustomerIsSolve() == null ? null : customerStatisticalInfo.getCustomerIsSolve());
|
|
|
row.createCell(11).setCellValue(customerStatisticalInfo.getCompanyName() == null ? null : customerStatisticalInfo.getCompanyName());
|
|
|
row.createCell(12).setCellValue(customerStatisticalInfo.getStoreName() == null ? null : customerStatisticalInfo.getStoreName());
|
|
|
row.createCell(13).setCellValue(customerStatisticalInfo.getItemProductName() == null ? null : customerStatisticalInfo.getItemProductName());
|
|
|
row.createCell(14).setCellValue(customerStatisticalInfo.getItemProductColor() == null ? null : customerStatisticalInfo.getItemProductColor());
|
|
|
row.createCell(15).setCellValue(customerStatisticalInfo.getItemNum() == null ? null : customerStatisticalInfo.getItemNum());
|
|
|
- row.createCell(16).setCellValue(customerStatisticalInfo.getRelationBackLogisticsCompany() == null ? null : customerStatisticalInfo.getRelationBackLogisticsCompany());
|
|
|
+ row.createCell(16).setCellValue(backLogisticsCompany);
|
|
|
row.createCell(17).setCellValue(customerStatisticalInfo.getRelationBackLogisticsNo() == null ? null : customerStatisticalInfo.getRelationBackLogisticsNo());
|
|
|
row.createCell(18).setCellValue(customerStatisticalInfo.getRelationBackReceiptDate() == null ? null : customerStatisticalInfo.getRelationBackReceiptDate());
|
|
|
- row.createCell(19).setCellValue(customerStatisticalInfo.getRelationBackStatus() == null ? null : customerStatisticalInfo.getRelationBackStatus());
|
|
|
- row.createCell(20).setCellValue(customerStatisticalInfo.getRelationSendLogisticsCompany() == null ? null : customerStatisticalInfo.getRelationSendLogisticsCompany());
|
|
|
+ row.createCell(19).setCellValue(backStatus);
|
|
|
+ row.createCell(20).setCellValue(sendLogisticsCompany);
|
|
|
row.createCell(21).setCellValue(customerStatisticalInfo.getRelationSendLogisticsNo() == null ? null : customerStatisticalInfo.getRelationSendLogisticsNo());
|
|
|
row.createCell(22).setCellValue(customerStatisticalInfo.getCustomerOutDamaged() == null ? null : customerStatisticalInfo.getCustomerOutDamaged());
|
|
|
row.createCell(23).setCellValue(customerStatisticalInfo.getCustomerSecondaryCustomer() == null ? null : customerStatisticalInfo.getCustomerSecondaryCustomer());
|