Browse Source

[fix]

售后管理 客诉通知
修改客诉通知service新增和编辑接口,处理sn号字符串得到数组,数组长度赋值给数量合计字段;
dev
王晓迪 3 months ago
parent
commit
389937749d
  1. 75
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeDetailServiceImpl.java

75
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeDetailServiceImpl.java

@ -140,6 +140,7 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
complaintNoticeDetail.setCreateBy(loginName);
complaintNoticeDetail.setCreateTime(DateUtils.getNowDate());
String makeNo = complaintNoticeDetail.getMakeNo();
int enterpriseSum = 0;
//保存信息到AftersalesComplaintNotice数据表中
complaintNotice.setComplaintNoticeCode(newCode);
complaintNotice.setCreateBy(loginName);
@ -171,10 +172,13 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
complaintNoticeDetail.setAdverseReportUrl(aftersalesMaterialVO.getAdverseReportUrl());
// int totalQuantity = warehouseOutOrderMapper.sumOutOrderQuantityByMakeNo(makeNo);
complaintNoticeDetail.setShippedGoodsSum(aftersalesMaterialVO.getShippedGoodsSum());
complaintNotice.setEnterpriseSum(aftersalesMaterialVO.getShippedGoodsSum());
String snCodes = aftersalesMaterialVO.getSnCode();
String[] snCodeArray = snCodes.split(",");
enterpriseSum += snCodeArray.length;
aftersalesComplaintNoticeDetailMapper.insertAftersalesComplaintNoticeDetail(complaintNoticeDetail);
}
}
complaintNotice.setEnterpriseSum(enterpriseSum);
}
complaintNoticeMapper.insertAftersalesComplaintNotice(complaintNotice);
return 1;
}
@ -191,6 +195,7 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
{
AftersalesComplaintNotice aftersalesComplaintNotice = new AftersalesComplaintNotice();
String loginName = ShiroUtils.getLoginName();
int enterpriseSum = 0;
//更新主表内容
aftersalesComplaintNotice.setComplaintNoticeCode(aftersalesComplaintNoticeDetail.getComplaintNoticeCode());
aftersalesComplaintNotice.setUpdateBy(loginName);
@ -201,44 +206,48 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
aftersalesComplaintNotice.setCustomerName(aftersalesComplaintNoticeDetail.getCustomerName());
aftersalesComplaintNotice.setCustomerId(aftersalesComplaintNoticeDetail.getCustomerId());
aftersalesComplaintNotice.setClosingProcedures(aftersalesComplaintNoticeDetail.getClosingProcedures());
complaintNoticeMapper.updateAftersalesComplaintNotice(aftersalesComplaintNotice);
String complaintNoticeCode = aftersalesComplaintNoticeDetail.getComplaintNoticeCode();
List<AftersalesMaterialVO> aftersalesMaterialVOs = aftersalesComplaintNoticeDetail.getAftersalesMaterialVOs();
//如果前面相关物料信息为空
if (StringUtils.isEmpty(aftersalesMaterialVOs)){
//删除子表中的数据
int result = aftersalesComplaintNoticeDetailMapper.deleteAftersalesComplaintNoticeDetailByCode(complaintNoticeCode);
return result;
}
//如果有物料信息
int result = aftersalesComplaintNoticeDetailMapper.deleteAftersalesComplaintNoticeDetailByCode(complaintNoticeCode);
for (AftersalesMaterialVO aftersalesMaterialVO : aftersalesMaterialVOs) {
AftersalesComplaintNoticeDetail complaintNoticeDetail = new AftersalesComplaintNoticeDetail();
complaintNoticeDetail.setComplaintNoticeCode(complaintNoticeCode);
complaintNoticeDetail.setCreateBy(aftersalesComplaintNoticeDetail.getCreateBy());
complaintNoticeDetail.setCreateTime(aftersalesComplaintNoticeDetail.getCreateTime());
complaintNoticeDetail.setUpdateBy(loginName);
complaintNoticeDetail.setUpdateTime(DateUtils.getNowDate());
complaintNoticeDetail.setCustomerId(aftersalesComplaintNoticeDetail.getCustomerId());
complaintNoticeDetail.setCustomerName(aftersalesComplaintNoticeDetail.getCustomerName());
complaintNoticeDetail.setEmergencyDegree(aftersalesComplaintNoticeDetail.getEmergencyDegree());
complaintNoticeDetail.setMakeNo(aftersalesComplaintNoticeDetail.getMakeNo());
complaintNoticeDetail.setRemark(aftersalesComplaintNoticeDetail.getRemark());
complaintNoticeDetail.setMaterialType(aftersalesMaterialVO.getMaterialType());
complaintNoticeDetail.setMaterialUnit(aftersalesMaterialVO.getMaterialUnit());
complaintNoticeDetail.setMaterialProcessMethod(aftersalesMaterialVO.getMaterialProcessMethod());
complaintNoticeDetail.setMaterialName(aftersalesMaterialVO.getMaterialName());
complaintNoticeDetail.setMaterialDescribe(aftersalesMaterialVO.getMaterialDescribe());
complaintNoticeDetail.setMaterialNo(aftersalesMaterialVO.getMaterialNo());
complaintNoticeDetail.setMaterialPhotourl(aftersalesMaterialVO.getMaterialPhotourl());
complaintNoticeDetail.setMaterialBrand(aftersalesMaterialVO.getMaterialBrand());
complaintNoticeDetail.setComplaintProblem(aftersalesMaterialVO.getComplaintProblem());
complaintNoticeDetail.setSnCode(aftersalesMaterialVO.getSnCode());
complaintNoticeDetail.setAdverseReportUrl(aftersalesMaterialVO.getAdverseReportUrl());
complaintNoticeDetail.setShippedGoodsSum(aftersalesMaterialVO.getShippedGoodsSum());
complaintNoticeDetail.setClosingProcedures("1");
aftersalesComplaintNoticeDetailMapper.insertAftersalesComplaintNoticeDetail(complaintNoticeDetail);
}else{
//如果有物料信息
int result = aftersalesComplaintNoticeDetailMapper.deleteAftersalesComplaintNoticeDetailByCode(complaintNoticeCode);
for (AftersalesMaterialVO aftersalesMaterialVO : aftersalesMaterialVOs) {
AftersalesComplaintNoticeDetail complaintNoticeDetail = new AftersalesComplaintNoticeDetail();
complaintNoticeDetail.setComplaintNoticeCode(complaintNoticeCode);
complaintNoticeDetail.setCreateBy(aftersalesComplaintNoticeDetail.getCreateBy());
complaintNoticeDetail.setCreateTime(aftersalesComplaintNoticeDetail.getCreateTime());
complaintNoticeDetail.setUpdateBy(loginName);
complaintNoticeDetail.setUpdateTime(DateUtils.getNowDate());
complaintNoticeDetail.setCustomerId(aftersalesComplaintNoticeDetail.getCustomerId());
complaintNoticeDetail.setCustomerName(aftersalesComplaintNoticeDetail.getCustomerName());
complaintNoticeDetail.setEmergencyDegree(aftersalesComplaintNoticeDetail.getEmergencyDegree());
complaintNoticeDetail.setMakeNo(aftersalesComplaintNoticeDetail.getMakeNo());
complaintNoticeDetail.setRemark(aftersalesComplaintNoticeDetail.getRemark());
complaintNoticeDetail.setMaterialType(aftersalesMaterialVO.getMaterialType());
complaintNoticeDetail.setMaterialUnit(aftersalesMaterialVO.getMaterialUnit());
complaintNoticeDetail.setMaterialProcessMethod(aftersalesMaterialVO.getMaterialProcessMethod());
complaintNoticeDetail.setMaterialName(aftersalesMaterialVO.getMaterialName());
complaintNoticeDetail.setMaterialDescribe(aftersalesMaterialVO.getMaterialDescribe());
complaintNoticeDetail.setMaterialNo(aftersalesMaterialVO.getMaterialNo());
complaintNoticeDetail.setMaterialPhotourl(aftersalesMaterialVO.getMaterialPhotourl());
complaintNoticeDetail.setMaterialBrand(aftersalesMaterialVO.getMaterialBrand());
complaintNoticeDetail.setComplaintProblem(aftersalesMaterialVO.getComplaintProblem());
complaintNoticeDetail.setSnCode(aftersalesMaterialVO.getSnCode());
complaintNoticeDetail.setAdverseReportUrl(aftersalesMaterialVO.getAdverseReportUrl());
complaintNoticeDetail.setShippedGoodsSum(aftersalesMaterialVO.getShippedGoodsSum());
complaintNoticeDetail.setClosingProcedures("1");
String snCodes = aftersalesMaterialVO.getSnCode();
String[] snCodeArray = snCodes.split(",");
enterpriseSum += snCodeArray.length;
aftersalesComplaintNoticeDetailMapper.insertAftersalesComplaintNoticeDetail(complaintNoticeDetail);
}
}
aftersalesComplaintNotice.setEnterpriseSum(enterpriseSum);
complaintNoticeMapper.updateAftersalesComplaintNotice(aftersalesComplaintNotice);
return 1;
}

Loading…
Cancel
Save