|
@@ -502,6 +502,16 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
@Transactional
|
|
|
public void setName(CmRelation cr) {
|
|
|
for (int i=0;i<cr.getSendProdcues().size();i++) {
|
|
|
+ if("123456".equals(cr.getSendProdcues().get(i).getColorBar())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if("6970465730030".equals(cr.getSendProdcues().get(i).getColorBar())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if("6970465730023".equals(cr.getSendProdcues().get(i).getColorBar())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
ProductColor productColor = productMapper.getProductBySku(cr.getSendProdcues().get(i).getColorBar());
|
|
|
cr.getSendProdcues().get(i).setProductColor(productColor);
|
|
|
cr.getSendProdcues().get(i).setColorId(productColor.getColorId());
|
|
@@ -512,6 +522,15 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
cr.getSendProdcues().get(i).setProductNumber(product.getProductNumber());
|
|
|
}
|
|
|
for (int i=0;i<cr.getClosedProdcues().size();i++) {
|
|
|
+ if(("123456").equals(cr.getClosedProdcues().get(i).getColorBar())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if(("6970465730030").equals(cr.getClosedProdcues().get(i).getColorBar())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if(("6970465730023").equals(cr.getClosedProdcues().get(i).getColorBar())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
ProductColor productColor = productMapper.getProductBySku(cr.getClosedProdcues().get(i).getColorBar());
|
|
|
cr.getClosedProdcues().get(i).setProductColor(productColor);
|
|
|
cr.getClosedProdcues().get(i).setColorId(productColor.getColorId());
|
|
@@ -1323,6 +1342,7 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional
|
|
|
public Integer updateRelation(CustomerInfo customerInfo) {
|
|
|
/*
|
|
|
* 查询客诉
|
|
@@ -1342,6 +1362,12 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
CmRelation cmRelation = new CmRelation();
|
|
|
cmRelation.setCustomerId(customerInfo.getCustomerId());
|
|
|
|
|
|
+ /*判断是否是新加的客诉*/
|
|
|
+ CmRelation crold = cmRelationMapper.getCmRelationByCustomerId(customerInfo.getCustomerId());
|
|
|
+ if(crold != null ){
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
CustomerCommon customerCommon = new CustomerCommon();
|
|
|
customerCommon.setCustomerId(customerInfo.getCustomerId());
|
|
|
List<CustomerCommon> customerCommonList = customerCommonService.listCustomerCommon(customerCommon);
|
|
@@ -1373,6 +1399,9 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
cmRelation.setRelationCustomerCosts(customerCommon.getRelationCustomerCosts()); //客户报价
|
|
|
cmRelation.setRelationCreateTime(customerCommon.getRelationCreateTime());
|
|
|
cmRelation.setRelationUpdateTime(customerCommon.getRelationUpdateTime());
|
|
|
+
|
|
|
+ cmRelation.setSendProdcues(customerCommon.getSendProdcues());
|
|
|
+ cmRelation.setClosedProdcues(customerCommon.getClosedProdcues());
|
|
|
}
|
|
|
|
|
|
Integer procMethodId;
|
|
@@ -1462,9 +1491,6 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
rol.setRelationId(customerCommon.getRelationId());
|
|
|
relationOrderService.deleteByRelationOrder(rol);
|
|
|
|
|
|
- /*产品整理*/
|
|
|
- customerService.setName(cmRelation);
|
|
|
-
|
|
|
/*添加客诉-添加处理与订单关联表 ---------- */
|
|
|
List<RelationOrder> relationAndOrderList = new ArrayList<>();
|
|
|
for (RelationOrder sokk : relationOrderList) {
|
|
@@ -1478,13 +1504,24 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
relationOrderService.saveList(relationAndOrderList);
|
|
|
}
|
|
|
|
|
|
- CustomerCommonUtil.setProduce(cmRelation);
|
|
|
- if(cmRelation.getClosedProdcues() != null && cmRelation.getClosedProdcues().size()>0){
|
|
|
- closedProdcueMapper.insert(cmRelation.getClosedProdcues());
|
|
|
- }
|
|
|
- if(cmRelation.getSendProdcues() != null && cmRelation.getSendProdcues().size() > 0){
|
|
|
- sendProdcueMapper.insert(cmRelation.getSendProdcues());
|
|
|
- }
|
|
|
+ Integer fl = 0;
|
|
|
+ /*产品整理*/
|
|
|
+ try{
|
|
|
+ customerService.setName(cmRelation);
|
|
|
+ fl = 1;
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ if(fl == 1){
|
|
|
+ CustomerCommonUtil.setProduce(cmRelation);
|
|
|
+ if(cmRelation.getClosedProdcues() != null && cmRelation.getClosedProdcues().size()>0){
|
|
|
+ closedProdcueMapper.insert(cmRelation.getClosedProdcues());
|
|
|
+ }
|
|
|
+ if(cmRelation.getSendProdcues() != null && cmRelation.getSendProdcues().size() > 0){
|
|
|
+ sendProdcueMapper.insert(cmRelation.getSendProdcues());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
return flag;
|
|
|
}
|