Browse Source

[fix]

售后管理 客诉通知
修改客诉通知添加页面,新增检查sn号存在方法;
修改客诉通知编辑页面,新增出库数量字段;
修改售后客诉通知实体类,修改物料合计、数量合计字段为Integer;
修改售后客诉通知详情实体类,修改交货数量、数量合计、客诉数量字段为Integer;
修改客诉通知service接口,修改查找与生产单号有关的物料信息方法;
修改客诉通知详情service接口,修改导出售后客诉通知单详情列表方法、新增售后客诉通知单详情方法、更新售后客诉通知单详情方法;
dev
王晓迪 3 months ago
parent
commit
71cf4e0806
  1. 14
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AftersalesComplaintNotice.java
  2. 18
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AftersalesComplaintNoticeDetail.java
  3. 102
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeDetailServiceImpl.java
  4. 57
      ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeServiceImpl.java
  5. 39
      ruoyi-admin/src/main/resources/templates/aftersales/complaintNotice/add.html
  6. 12
      ruoyi-admin/src/main/resources/templates/aftersales/complaintNotice/edit.html

14
ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AftersalesComplaintNotice.java

@ -51,11 +51,11 @@ public class AftersalesComplaintNotice extends BaseEntity
/** 物料合计 */ /** 物料合计 */
@Excel(name = "物料合计") @Excel(name = "物料合计")
private String materialSum; private Integer materialSum;
/** 数量合计 */ /** 数量合计 */
@Excel(name = "数量合计") @Excel(name = "数量合计")
private String enterpriseSum; private Integer enterpriseSum;
/** 交货数量 */ /** 交货数量 */
private String deliveryGoodsNum; private String deliveryGoodsNum;
@ -146,25 +146,25 @@ public class AftersalesComplaintNotice extends BaseEntity
this.materialName = materialName; this.materialName = materialName;
} }
public String getMaterialName() public String getMaterialName()
{ {
return materialName; return materialName;
} }
public void setMaterialSum(String materialSum) public void setMaterialSum(Integer materialSum)
{ {
this.materialSum = materialSum; this.materialSum = materialSum;
} }
public String getMaterialSum() public Integer getMaterialSum()
{ {
return materialSum; return materialSum;
} }
public void setEnterpriseSum(String enterpriseSum) public void setEnterpriseSum(Integer enterpriseSum)
{ {
this.enterpriseSum = enterpriseSum; this.enterpriseSum = enterpriseSum;
} }
public String getEnterpriseSum() public Integer getEnterpriseSum()
{ {
return enterpriseSum; return enterpriseSum;
} }

18
ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/AftersalesComplaintNoticeDetail.java

@ -102,14 +102,14 @@ public class AftersalesComplaintNoticeDetail extends BaseEntity
/** 已出库数量 */ /** 已出库数量 */
@Excel(name = "交货数量",sort = 8) @Excel(name = "交货数量",sort = 8)
private String shippedGoodsSum; private Integer shippedGoodsSum;
/** 物料数合计 */ /** 物料数合计 */
private String materialSum; private Integer materialSum;
/** 数量合计 */ /** 数量合计 */
@Excel(name = "客诉数量",sort = 9) @Excel(name = "客诉数量",sort = 9)
private String enterpriseSum; private Integer enterpriseSum;
/** 备注 */ /** 备注 */
@Excel(name = "备注", sort = 14) @Excel(name = "备注", sort = 14)
@ -324,30 +324,30 @@ public class AftersalesComplaintNoticeDetail extends BaseEntity
{ {
return materialProcessMethod; return materialProcessMethod;
} }
public void setShippedGoodsSum(String shippedGoodsSum) public void setShippedGoodsSum(Integer shippedGoodsSum)
{ {
this.shippedGoodsSum = shippedGoodsSum; this.shippedGoodsSum = shippedGoodsSum;
} }
public String getShippedGoodsSum() public Integer getShippedGoodsSum()
{ {
return shippedGoodsSum; return shippedGoodsSum;
} }
public void setMaterialSum(String materialSum) public void setMaterialSum(Integer materialSum)
{ {
this.materialSum = materialSum; this.materialSum = materialSum;
} }
public String getMaterialSum() public Integer getMaterialSum()
{ {
return materialSum; return materialSum;
} }
public void setEnterpriseSum(String enterpriseSum) public void setEnterpriseSum(Integer enterpriseSum)
{ {
this.enterpriseSum = enterpriseSum; this.enterpriseSum = enterpriseSum;
} }
public String getEnterpriseSum() public Integer getEnterpriseSum()
{ {
return enterpriseSum; return enterpriseSum;
} }

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

@ -5,14 +5,21 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Optional;
import com.ruoyi.aftersales.domain.AfterSalesShippingDevice;
import com.ruoyi.aftersales.domain.AftersalesComplaintNotice; import com.ruoyi.aftersales.domain.AftersalesComplaintNotice;
import com.ruoyi.aftersales.domain.vo.AftersalesMaterialVO; import com.ruoyi.aftersales.domain.vo.AftersalesMaterialVO;
import com.ruoyi.aftersales.mapper.AftersalesComplaintNoticeMapper; import com.ruoyi.aftersales.mapper.AftersalesComplaintNoticeMapper;
import com.ruoyi.aftersales.service.IAfterSalesShippingDeviceService;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.SysMakeorderBom; import com.ruoyi.system.domain.SysMakeorderBom;
import com.ruoyi.warehouse.domain.WarehouseOutOrder;
import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail;
import com.ruoyi.warehouse.mapper.WarehouseOutOrderDetailMapper;
import com.ruoyi.warehouse.mapper.WarehouseOutOrderMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -38,6 +45,12 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
@Autowired @Autowired
private AftersalesComplaintNoticeMapper complaintNoticeMapper; private AftersalesComplaintNoticeMapper complaintNoticeMapper;
@Autowired
private IAfterSalesShippingDeviceService afterSalesShippingDeviceService;
@Autowired
private WarehouseOutOrderMapper warehouseOutOrderMapper;
/** /**
* 查询售后客诉通知单详情 * 查询售后客诉通知单详情
* *
@ -61,10 +74,41 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
{ {
return aftersalesComplaintNoticeDetailMapper.selectAftersalesComplaintNoticeDetailList(aftersalesComplaintNoticeDetail); return aftersalesComplaintNoticeDetailMapper.selectAftersalesComplaintNoticeDetailList(aftersalesComplaintNoticeDetail);
} }
/**
@Override * 导出售后客诉通知单详情列表
*/
@Override
public List<AftersalesComplaintNoticeDetail> selectDetailListByNoticeCodes(String[] complaintNoticeCodes) { public List<AftersalesComplaintNoticeDetail> selectDetailListByNoticeCodes(String[] complaintNoticeCodes) {
return aftersalesComplaintNoticeDetailMapper.selectDetailListByNoticeCodes(complaintNoticeCodes); List<AftersalesComplaintNoticeDetail> complaintNoticeDetailList = aftersalesComplaintNoticeDetailMapper.selectDetailListByNoticeCodes(complaintNoticeCodes);
List<AftersalesComplaintNoticeDetail> exportDetailList = new ArrayList<>();
for (AftersalesComplaintNoticeDetail noticeDetail:complaintNoticeDetailList) {
String snCodes = noticeDetail.getSnCode();
String[] snCodeArray = snCodes.split(",");
List<AfterSalesShippingDevice> salesShippingDeviceList = afterSalesShippingDeviceService.selectShippingDeviceListBySnCode(snCodeArray);
for (String snCode:snCodeArray) {
AftersalesComplaintNoticeDetail exportDetail = new AftersalesComplaintNoticeDetail();
Optional<AfterSalesShippingDevice> matchingDevice = salesShippingDeviceList.stream()
.filter(detail -> detail.getSnCode().equals(snCode))
.findFirst();
matchingDevice.ifPresent(detail -> {
exportDetail.setCustomerId(noticeDetail.getCustomerId());
exportDetail.setCustomerName(noticeDetail.getCustomerName());
exportDetail.setDeviceModelCode(detail.getDeviceModelCode());
exportDetail.setDeviceModelName(detail.getMaterialName());
exportDetail.setMakeNo(detail.getSalesOrderCode());
exportDetail.setDeviceRunningNumber(detail.getDeviceRunningNumber());
exportDetail.setShippedGoodsSum(noticeDetail.getShippedGoodsSum());
exportDetail.setEnterpriseSum(1);
exportDetail.setComplaintProblem(noticeDetail.getComplaintProblem());
exportDetail.setAdverseReportUrl(noticeDetail.getAdverseReportUrl());
exportDetail.setEmergencyDegree(noticeDetail.getEmergencyDegree());
exportDetail.setClosingProcedures(noticeDetail.getClosingProcedures());
exportDetail.setRemark(noticeDetail.getRemark());
});
exportDetailList.add(exportDetail);
}
}
return exportDetailList;
} }
/** /**
@ -95,35 +139,43 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
String loginName = ShiroUtils.getLoginName(); String loginName = ShiroUtils.getLoginName();
complaintNoticeDetail.setCreateBy(loginName); complaintNoticeDetail.setCreateBy(loginName);
complaintNoticeDetail.setCreateTime(DateUtils.getNowDate()); complaintNoticeDetail.setCreateTime(DateUtils.getNowDate());
String makeNo = complaintNoticeDetail.getMakeNo();
//保存信息到AftersalesComplaintNotice数据表中 //保存信息到AftersalesComplaintNotice数据表中
complaintNotice.setComplaintNoticeCode(newCode); complaintNotice.setComplaintNoticeCode(newCode);
complaintNotice.setCreateBy(loginName); complaintNotice.setCreateBy(loginName);
complaintNotice.setCreateTime(new Date()); complaintNotice.setCreateTime(DateUtils.getNowDate());
complaintNotice.setMakeNo(complaintNoticeDetail.getMakeNo()); complaintNotice.setMakeNo(complaintNoticeDetail.getMakeNo());
complaintNotice.setCustomerId(complaintNoticeDetail.getCustomerId()); complaintNotice.setCustomerId(complaintNoticeDetail.getCustomerId());
complaintNotice.setCustomerName(complaintNoticeDetail.getCustomerName()); complaintNotice.setCustomerName(complaintNoticeDetail.getCustomerName());
complaintNotice.setClosingProcedures("1");
complaintNotice.setEmergencyDegree(complaintNoticeDetail.getEmergencyDegree()); complaintNotice.setEmergencyDegree(complaintNoticeDetail.getEmergencyDegree());
complaintNoticeMapper.insertAftersalesComplaintNotice(complaintNotice); if(complaintNoticeDetail.getAftersalesMaterialVOs()!=null){
complaintNotice.setMaterialSum(complaintNoticeDetail.getAftersalesMaterialVOs().size());
}
List<AftersalesMaterialVO> aftersalesMaterialVOs = complaintNoticeDetail.getAftersalesMaterialVOs(); List<AftersalesMaterialVO> aftersalesMaterialVOs = complaintNoticeDetail.getAftersalesMaterialVOs();
if (StringUtils.isEmpty(aftersalesMaterialVOs)){ if (StringUtils.isEmpty(aftersalesMaterialVOs)){
return aftersalesComplaintNoticeDetailMapper.insertAftersalesComplaintNoticeDetail(complaintNoticeDetail);
}
for (AftersalesMaterialVO aftersalesMaterialVO : aftersalesMaterialVOs) {
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());
aftersalesComplaintNoticeDetailMapper.insertAftersalesComplaintNoticeDetail(complaintNoticeDetail); aftersalesComplaintNoticeDetailMapper.insertAftersalesComplaintNoticeDetail(complaintNoticeDetail);
} }else{
for (AftersalesMaterialVO aftersalesMaterialVO : aftersalesMaterialVOs) {
complaintNoticeDetail.setMaterialNo(aftersalesMaterialVO.getMaterialNo());
complaintNoticeDetail.setMaterialName(aftersalesMaterialVO.getMaterialName());
complaintNoticeDetail.setMaterialType(aftersalesMaterialVO.getMaterialType());
complaintNoticeDetail.setMaterialUnit(aftersalesMaterialVO.getMaterialUnit());
complaintNoticeDetail.setMaterialDescribe(aftersalesMaterialVO.getMaterialDescribe());
complaintNoticeDetail.setMaterialPhotourl(aftersalesMaterialVO.getMaterialPhotourl());
complaintNoticeDetail.setMaterialBrand(aftersalesMaterialVO.getMaterialBrand());
complaintNoticeDetail.setSnCode(aftersalesMaterialVO.getSnCode());
complaintNoticeDetail.setClosingProcedures("1");
complaintNoticeDetail.setComplaintProblem(aftersalesMaterialVO.getComplaintProblem());
complaintNoticeDetail.setAdverseReportUrl(aftersalesMaterialVO.getAdverseReportUrl());
// int totalQuantity = warehouseOutOrderMapper.sumOutOrderQuantityByMakeNo(makeNo);
complaintNoticeDetail.setShippedGoodsSum(aftersalesMaterialVO.getShippedGoodsSum());
complaintNotice.setEnterpriseSum(aftersalesMaterialVO.getShippedGoodsSum());
aftersalesComplaintNoticeDetailMapper.insertAftersalesComplaintNoticeDetail(complaintNoticeDetail);
}
}
complaintNoticeMapper.insertAftersalesComplaintNotice(complaintNotice);
return 1; return 1;
} }
@ -142,7 +194,7 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
//更新主表内容 //更新主表内容
aftersalesComplaintNotice.setComplaintNoticeCode(aftersalesComplaintNoticeDetail.getComplaintNoticeCode()); aftersalesComplaintNotice.setComplaintNoticeCode(aftersalesComplaintNoticeDetail.getComplaintNoticeCode());
aftersalesComplaintNotice.setUpdateBy(loginName); aftersalesComplaintNotice.setUpdateBy(loginName);
aftersalesComplaintNotice.setUpdateTime(new Date()); aftersalesComplaintNotice.setUpdateTime(DateUtils.getNowDate());
aftersalesComplaintNotice.setMakeNo(aftersalesComplaintNoticeDetail.getMakeNo()); aftersalesComplaintNotice.setMakeNo(aftersalesComplaintNoticeDetail.getMakeNo());
aftersalesComplaintNotice.setEmergencyDegree(aftersalesComplaintNoticeDetail.getEmergencyDegree()); aftersalesComplaintNotice.setEmergencyDegree(aftersalesComplaintNoticeDetail.getEmergencyDegree());
aftersalesComplaintNotice.setRemark(aftersalesComplaintNoticeDetail.getRemark()); aftersalesComplaintNotice.setRemark(aftersalesComplaintNoticeDetail.getRemark());
@ -166,7 +218,7 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
complaintNoticeDetail.setCreateBy(aftersalesComplaintNoticeDetail.getCreateBy()); complaintNoticeDetail.setCreateBy(aftersalesComplaintNoticeDetail.getCreateBy());
complaintNoticeDetail.setCreateTime(aftersalesComplaintNoticeDetail.getCreateTime()); complaintNoticeDetail.setCreateTime(aftersalesComplaintNoticeDetail.getCreateTime());
complaintNoticeDetail.setUpdateBy(loginName); complaintNoticeDetail.setUpdateBy(loginName);
complaintNoticeDetail.setUpdateTime(new Date()); complaintNoticeDetail.setUpdateTime(DateUtils.getNowDate());
complaintNoticeDetail.setCustomerId(aftersalesComplaintNoticeDetail.getCustomerId()); complaintNoticeDetail.setCustomerId(aftersalesComplaintNoticeDetail.getCustomerId());
complaintNoticeDetail.setCustomerName(aftersalesComplaintNoticeDetail.getCustomerName()); complaintNoticeDetail.setCustomerName(aftersalesComplaintNoticeDetail.getCustomerName());
complaintNoticeDetail.setEmergencyDegree(aftersalesComplaintNoticeDetail.getEmergencyDegree()); complaintNoticeDetail.setEmergencyDegree(aftersalesComplaintNoticeDetail.getEmergencyDegree());
@ -183,6 +235,8 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
complaintNoticeDetail.setComplaintProblem(aftersalesMaterialVO.getComplaintProblem()); complaintNoticeDetail.setComplaintProblem(aftersalesMaterialVO.getComplaintProblem());
complaintNoticeDetail.setSnCode(aftersalesMaterialVO.getSnCode()); complaintNoticeDetail.setSnCode(aftersalesMaterialVO.getSnCode());
complaintNoticeDetail.setAdverseReportUrl(aftersalesMaterialVO.getAdverseReportUrl()); complaintNoticeDetail.setAdverseReportUrl(aftersalesMaterialVO.getAdverseReportUrl());
complaintNoticeDetail.setShippedGoodsSum(aftersalesMaterialVO.getShippedGoodsSum());
complaintNoticeDetail.setClosingProcedures("1");
aftersalesComplaintNoticeDetailMapper.insertAftersalesComplaintNoticeDetail(complaintNoticeDetail); aftersalesComplaintNoticeDetailMapper.insertAftersalesComplaintNoticeDetail(complaintNoticeDetail);
} }
return 1; return 1;
@ -261,6 +315,8 @@ public class AftersalesComplaintNoticeDetailServiceImpl implements IAftersalesCo
aftersalesMaterialVO.setMaterialUnit(complaintNoticeDetail.getMaterialUnit()); aftersalesMaterialVO.setMaterialUnit(complaintNoticeDetail.getMaterialUnit());
aftersalesMaterialVO.setMaterialType(complaintNoticeDetail.getMaterialType()); aftersalesMaterialVO.setMaterialType(complaintNoticeDetail.getMaterialType());
aftersalesMaterialVO.setComplaintProblem(complaintNoticeDetail.getComplaintProblem()); aftersalesMaterialVO.setComplaintProblem(complaintNoticeDetail.getComplaintProblem());
aftersalesMaterialVO.setShippedGoodsSum(complaintNoticeDetail.getShippedGoodsSum());
aftersalesMaterialVO.setEmergencyDegree(complaintNoticeDetail.getEmergencyDegree());
aftersalesMaterialVO.setSnCode(complaintNoticeDetail.getSnCode()); aftersalesMaterialVO.setSnCode(complaintNoticeDetail.getSnCode());
aftersalesMaterialVO.setAdverseReportUrl(complaintNoticeDetail.getAdverseReportUrl()); aftersalesMaterialVO.setAdverseReportUrl(complaintNoticeDetail.getAdverseReportUrl());
aftersalesMaterialVOs.add(aftersalesMaterialVO); aftersalesMaterialVOs.add(aftersalesMaterialVO);

57
ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesComplaintNoticeServiceImpl.java

@ -16,10 +16,13 @@ import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.SysMakeOrder; import com.ruoyi.system.domain.SysMakeOrder;
import com.ruoyi.system.domain.SysMakeorderBom; import com.ruoyi.system.domain.SysMakeorderBom;
import com.ruoyi.system.domain.SysSalesOrderChild;
import com.ruoyi.system.mapper.SysMakeOrderMapper; import com.ruoyi.system.mapper.SysMakeOrderMapper;
import com.ruoyi.system.mapper.SysMakeorderBomMapper; import com.ruoyi.system.mapper.SysMakeorderBomMapper;
import com.ruoyi.system.mapper.SysSalesOrderChildMapper;
import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail; import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail;
import com.ruoyi.warehouse.mapper.WarehouseOutOrderDetailMapper; import com.ruoyi.warehouse.mapper.WarehouseOutOrderDetailMapper;
import com.ruoyi.warehouse.mapper.WarehouseOutOrderMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -49,7 +52,10 @@ public class AftersalesComplaintNoticeServiceImpl implements IAftersalesComplain
private SysMakeorderBomMapper sysMakeorderBomMapper; private SysMakeorderBomMapper sysMakeorderBomMapper;
@Autowired @Autowired
private WarehouseOutOrderDetailMapper warehouseOutOrderDetailMapper; private WarehouseOutOrderMapper warehouseOutOrderMapper;
@Autowired
private SysSalesOrderChildMapper sysSalesOrderChildMapper;
/** /**
* 查询售后客诉通知单 * 查询售后客诉通知单
@ -191,34 +197,33 @@ public class AftersalesComplaintNoticeServiceImpl implements IAftersalesComplain
public List<AftersalesMaterialVO> selectMaterialInfoByMakeNo(String makeNo) { public List<AftersalesMaterialVO> selectMaterialInfoByMakeNo(String makeNo) {
ArrayList<AftersalesMaterialVO> aftersalesMaterialVOs = new ArrayList<>(); ArrayList<AftersalesMaterialVO> aftersalesMaterialVOs = new ArrayList<>();
List<SysMakeorderBom> sysMakeorderBoms = sysMakeorderBomMapper.selectSysMakeorderBomByMakeNo(makeNo); // List<SysMakeorderBom> sysMakeorderBoms = sysMakeorderBomMapper.selectSysMakeorderBomByMakeNo(makeNo);
if (StringUtils.isEmpty(sysMakeorderBoms)){ // if (StringUtils.isEmpty(sysMakeorderBoms)){
// // 记录日志
// log.warn("未查找到与生产订单关联的物料相关数据, 生产订单号: {}", makeNo);
// }
SysMakeOrder sysMakeOrder = sysMakeOrderMapper.selectSaleNoByMakeNo(makeNo);
if (StringUtils.isEmpty(sysMakeOrder.getSaleNo())){
log.warn("未查找到与生产订单关联的销售订单, 生产订单号: {}", makeNo);
}
List<SysSalesOrderChild> sysSalesOrderChildList = sysSalesOrderChildMapper.selectSysSalesOrderChildByQuoteId(sysMakeOrder.getSaleNo());
if (StringUtils.isEmpty(sysSalesOrderChildList)){
// 记录日志 // 记录日志
log.warn("未查找到与生产订单关联的物料相关数据, 生产订单号: {}", makeNo); log.warn("未查找到与销售订单关联的物料相关数据, 销售订单号: {}", sysMakeOrder.getSaleNo());
} }
List<WarehouseOutOrderDetail> outOrderDetails = warehouseOutOrderDetailMapper.selectOutOrderDetailListByMakeNo(makeNo); int totalQuantity = warehouseOutOrderMapper.sumOutOrderQuantityByMakeNo(makeNo);
for (SysMakeorderBom sysMakeorderBom : sysMakeorderBoms) { for (SysSalesOrderChild salesOrderChild : sysSalesOrderChildList) {
AftersalesMaterialVO aftersalesMaterialVO = new AftersalesMaterialVO(); AftersalesMaterialVO aftersalesMaterialVO = new AftersalesMaterialVO();
aftersalesMaterialVO.setMaterialNo(sysMakeorderBom.getMaterialNo()); aftersalesMaterialVO.setMaterialNo(salesOrderChild.getMaterialCode());
if (StringUtils.isEmpty(outOrderDetails)){ aftersalesMaterialVO.setShippedGoodsSum(totalQuantity);
aftersalesMaterialVO.setShippedGoodsSum(0); aftersalesMaterialVO.setMaterialBrand(salesOrderChild.getBrand());
}else { aftersalesMaterialVO.setMaterialDescribe(salesOrderChild.getDescribe());
Optional<WarehouseOutOrderDetail> matchingDetail = outOrderDetails.stream() aftersalesMaterialVO.setMaterialName(salesOrderChild.getMaterialName());
.filter(detail -> detail.getMaterialNo().equals(sysMakeorderBom.getMaterialNo())) aftersalesMaterialVO.setMaterialProcessMethod(salesOrderChild.getProcessMethod());
.findFirst(); aftersalesMaterialVO.setMaterialPhotourl(salesOrderChild.getPhotoUrl());
aftersalesMaterialVO.setMaterialUnit(salesOrderChild.getUnit());
matchingDetail.ifPresent(detail -> { aftersalesMaterialVO.setMaterialType(salesOrderChild.getMaterialType());
int sum = detail.getHasOutOrderSum();
aftersalesMaterialVO.setShippedGoodsSum(detail.getHasOutOrderSum()==null?0:detail.getHasOutOrderSum());
});
}
aftersalesMaterialVO.setMaterialBrand(sysMakeorderBom.getBrand());
aftersalesMaterialVO.setMaterialDescribe(sysMakeorderBom.getDescribe());
aftersalesMaterialVO.setMaterialName(sysMakeorderBom.getMaterialName());
aftersalesMaterialVO.setMaterialProcessMethod(sysMakeorderBom.getProcessMethod());
aftersalesMaterialVO.setMaterialPhotourl(sysMakeorderBom.getPhotoUrl());
aftersalesMaterialVO.setMaterialUnit(sysMakeorderBom.getUnit());
aftersalesMaterialVO.setMaterialType(sysMakeorderBom.getMaterialType());
aftersalesMaterialVOs.add(aftersalesMaterialVO); aftersalesMaterialVOs.add(aftersalesMaterialVO);
} }
return aftersalesMaterialVOs; return aftersalesMaterialVOs;

39
ruoyi-admin/src/main/resources/templates/aftersales/complaintNotice/add.html

@ -331,6 +331,16 @@
field: 'snCode', field: 'snCode',
editable: { editable: {
type: 'text', // 表示该列可以被编辑为文本 type: 'text', // 表示该列可以被编辑为文本
validate: function(value, row) {
// 检查 SN 号是否已存在
// var materialNo = row.materialNo;
// checkSnCodeExists(materialNo, value, function(exists) {
// if (!exists) {
// // 如果 SN 号不存在,则返回错误信息
// return '该SN号不存在!';
// }
// });
}
}, },
}, },
@ -342,13 +352,13 @@
}, },
}, },
{ {
title: '售后问题', // title: '售后问题',
field: 'adverseReportUrl', // field: 'adverseReportUrl',
editable: { // editable: {
type: 'text', // 表示该列可以被编辑为文本 // type: 'text', // 表示该列可以被编辑为文本
//
// 可以在这里定义更多编辑行为,比如验证、提交等 // // 可以在这里定义更多编辑行为,比如验证、提交等
}, // },
}, },
{ {
title: '不良报告', title: '不良报告',
@ -385,7 +395,20 @@
}; };
$.table.init(options); $.table.init(options);
}) })
function checkSnCodeExists(materialNo,snCode, callback) {
$.ajax({
url: ctx + 'aftersales/complaintNotice/checkSnCode',
method: 'POST',
data: { materialNo: materialNo,snCode: snCode },
success: function(response) {
callback(response.exists); // 假设响应中有一个布尔值表示是否存在
},
error: function(xhr, status, error) {
console.error(error);
callback(false); // 如果出现错误,默认认为不存在
}
});
}
function doSubmit(index, layero,uniqueId){ function doSubmit(index, layero,uniqueId){
console.log(uniqueId); console.log(uniqueId);

12
ruoyi-admin/src/main/resources/templates/aftersales/complaintNotice/edit.html

@ -100,6 +100,7 @@
"materialUnit": item.materialUnit, "materialUnit": item.materialUnit,
"materialBrand": item.materialBrand, "materialBrand": item.materialBrand,
"materialDescribe": item.materialDescribe, "materialDescribe": item.materialDescribe,
"shippedGoodsSum": item.shippedGoodsSum,
"snCode": item.snCode, "snCode": item.snCode,
"complaintProblem": item.complaintProblem, "complaintProblem": item.complaintProblem,
// "emergencyDegree": item.emergencyDegree, // "emergencyDegree": item.emergencyDegree,
@ -283,6 +284,10 @@
title: '描述', title: '描述',
field: 'materialDescribe', field: 'materialDescribe',
}, },
{
title: '已出库数',
field: 'shippedGoodsSum',
},
{ {
title: 'SN号', title: 'SN号',
field: 'snCode', field: 'snCode',
@ -299,13 +304,18 @@
}, },
}, },
{ {
title: '售后问题', title: '不良报告',
field: 'adverseReportUrl', field: 'adverseReportUrl',
editable: { editable: {
type: 'text', // 表示该列可以被编辑为文本 type: 'text', // 表示该列可以被编辑为文本
// 可以在这里定义更多编辑行为,比如验证、提交等 // 可以在这里定义更多编辑行为,比如验证、提交等
}, },
}, },
{
title: '是否结案',
field: 'closingProcedures',
visible: false,
},
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',

Loading…
Cancel
Save