diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchangesOrder.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchangesOrder.java new file mode 100644 index 00000000..2669b523 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchangesOrder.java @@ -0,0 +1,269 @@ +package com.ruoyi.quality.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 品质管理退换货品质报告对象(针对入库前退货) quality_refunds_exchanges_order + * + * @author 刘晓旭 + * @date 2024-05-28 + */ +public class QualityRefundsExchangesOrder extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 品质单报告Id */ + private Long qualityRefundsExchangesOrderId; + + /** 退换货单号 */ + @Excel(name = "退换货单号") + private String refundsExchangesCode; + + /** 供应商Id */ + @Excel(name = "供应商Id") + private String supplierCode; + + /** 供应商名称 */ + @Excel(name = "供应商名称") + private String supplierName; + + /** 料号 */ + @Excel(name = "料号") + private String materialNo; + + /** 物料名称 */ + @Excel(name = "物料名称") + private String materialName; + + /** 生产订单数 */ + @Excel(name = "生产订单数") + private Integer makeTotal; + + /** 品质已合格数 */ + @Excel(name = "品质已合格数") + private Integer qualityHasqualifiedNum; + + /** ok允收数 */ + @Excel(name = "ok允收数") + private Integer okAcceptedNum; + + /** ok报告图片 */ + @Excel(name = "ok报告图片") + private String okReportUrl; + + /** 特采/让步数 */ + @Excel(name = "特采/让步数") + private Integer specialConcessionsNum; + + /** 特采报告图片 */ + @Excel(name = "特采报告图片") + private String specialReportUrl; + + /** 检验完成时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "检验完成时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date checkoutCompletionTime; + + /** 不良分类 */ + @Excel(name = "不良分类") + private String processBadClassification; + + /** 不良等级 */ + @Excel(name = "不良等级") + private String processBadGrade; + + /** 不良数量 */ + @Excel(name = "不良数量") + private Integer processBadNum; + + /** 不合格报告url */ + @Excel(name = "不合格报告url") + private String unqualifiedReportUrl; + + public void setQualityRefundsExchangesOrderId(Long qualityRefundsExchangesOrderId) + { + this.qualityRefundsExchangesOrderId = qualityRefundsExchangesOrderId; + } + + public Long getQualityRefundsExchangesOrderId() + { + return qualityRefundsExchangesOrderId; + } + public void setRefundsExchangesCode(String refundsExchangesCode) + { + this.refundsExchangesCode = refundsExchangesCode; + } + + public String getRefundsExchangesCode() + { + return refundsExchangesCode; + } + public void setSupplierCode(String supplierCode) + { + this.supplierCode = supplierCode; + } + + public String getSupplierCode() + { + return supplierCode; + } + public void setSupplierName(String supplierName) + { + this.supplierName = supplierName; + } + + public String getSupplierName() + { + return supplierName; + } + public void setMaterialNo(String materialNo) + { + this.materialNo = materialNo; + } + + public String getMaterialNo() + { + return materialNo; + } + public void setMaterialName(String materialName) + { + this.materialName = materialName; + } + + public String getMaterialName() + { + return materialName; + } + public void setMakeTotal(Integer makeTotal) + { + this.makeTotal = makeTotal; + } + + public Integer getMakeTotal() + { + return makeTotal; + } + public void setQualityHasqualifiedNum(Integer qualityHasqualifiedNum) + { + this.qualityHasqualifiedNum = qualityHasqualifiedNum; + } + + public Integer getQualityHasqualifiedNum() + { + return qualityHasqualifiedNum; + } + public void setOkAcceptedNum(Integer okAcceptedNum) + { + this.okAcceptedNum = okAcceptedNum; + } + + public Integer getOkAcceptedNum() + { + return okAcceptedNum; + } + public void setOkReportUrl(String okReportUrl) + { + this.okReportUrl = okReportUrl; + } + + public String getOkReportUrl() + { + return okReportUrl; + } + public void setSpecialConcessionsNum(Integer specialConcessionsNum) + { + this.specialConcessionsNum = specialConcessionsNum; + } + + public Integer getSpecialConcessionsNum() + { + return specialConcessionsNum; + } + public void setSpecialReportUrl(String specialReportUrl) + { + this.specialReportUrl = specialReportUrl; + } + + public String getSpecialReportUrl() + { + return specialReportUrl; + } + public void setCheckoutCompletionTime(Date checkoutCompletionTime) + { + this.checkoutCompletionTime = checkoutCompletionTime; + } + + public Date getCheckoutCompletionTime() + { + return checkoutCompletionTime; + } + public void setProcessBadClassification(String processBadClassification) + { + this.processBadClassification = processBadClassification; + } + + public String getProcessBadClassification() + { + return processBadClassification; + } + public void setProcessBadGrade(String processBadGrade) + { + this.processBadGrade = processBadGrade; + } + + public String getProcessBadGrade() + { + return processBadGrade; + } + public void setProcessBadNum(Integer processBadNum) + { + this.processBadNum = processBadNum; + } + + public Integer getProcessBadNum() + { + return processBadNum; + } + public void setUnqualifiedReportUrl(String unqualifiedReportUrl) + { + this.unqualifiedReportUrl = unqualifiedReportUrl; + } + + public String getUnqualifiedReportUrl() + { + return unqualifiedReportUrl; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("qualityRefundsExchangesOrderId", getQualityRefundsExchangesOrderId()) + .append("refundsExchangesCode", getRefundsExchangesCode()) + .append("supplierCode", getSupplierCode()) + .append("supplierName", getSupplierName()) + .append("materialNo", getMaterialNo()) + .append("materialName", getMaterialName()) + .append("makeTotal", getMakeTotal()) + .append("qualityHasqualifiedNum", getQualityHasqualifiedNum()) + .append("okAcceptedNum", getOkAcceptedNum()) + .append("okReportUrl", getOkReportUrl()) + .append("specialConcessionsNum", getSpecialConcessionsNum()) + .append("specialReportUrl", getSpecialReportUrl()) + .append("checkoutCompletionTime", getCheckoutCompletionTime()) + .append("processBadClassification", getProcessBadClassification()) + .append("processBadGrade", getProcessBadGrade()) + .append("processBadNum", getProcessBadNum()) + .append("unqualifiedReportUrl", getUnqualifiedReportUrl()) + .append("remark", getRemark()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderDetailMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderDetailMapper.java index a9c241ac..f966fe3e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderDetailMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderDetailMapper.java @@ -96,6 +96,6 @@ public interface QualityOrderDetailMapper * 根据供应商Id和物料号查询品质管理品质单详情 * */ - QualityOrderDetail selectQualityOrderDetailListByCodeAndNo(QualityOrderDetail qualityOrderDetail); + QualityOrderDetail selectQualityOrderDetailByCodeAndNo(QualityOrderDetail qualityOrderDetail); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityRefundsExchangesOrderMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityRefundsExchangesOrderMapper.java new file mode 100644 index 00000000..99856482 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityRefundsExchangesOrderMapper.java @@ -0,0 +1,85 @@ +package com.ruoyi.quality.mapper; + +import java.util.List; +import com.ruoyi.quality.domain.QualityRefundsExchangesOrder; +import org.apache.ibatis.annotations.Param; + +/** + * 品质管理退换货品质报告Mapper接口 + * + * @author 刘晓旭 + * @date 2024-05-28 + */ +public interface QualityRefundsExchangesOrderMapper +{ + /** + * 查询品质管理退换货品质报告 + * + * @param qualityRefundsExchangesOrderId 品质管理退换货品质报告ID + * @return 品质管理退换货品质报告 + */ + public QualityRefundsExchangesOrder selectQualityRefundsExchangesOrderById(Long qualityRefundsExchangesOrderId); + + /** + * 查询品质管理退换货品质报告列表 + * + * @param qualityRefundsExchangesOrder 品质管理退换货品质报告 + * @return 品质管理退换货品质报告集合 + */ + public List selectQualityRefundsExchangesOrderList(QualityRefundsExchangesOrder qualityRefundsExchangesOrder); + + /** + * 新增品质管理退换货品质报告 + * + * @param qualityRefundsExchangesOrder 品质管理退换货品质报告 + * @return 结果 + */ + public int insertQualityRefundsExchangesOrder(QualityRefundsExchangesOrder qualityRefundsExchangesOrder); + + /** + * 修改品质管理退换货品质报告 + * + * @param qualityRefundsExchangesOrder 品质管理退换货品质报告 + * @return 结果 + */ + public int updateQualityRefundsExchangesOrder(QualityRefundsExchangesOrder qualityRefundsExchangesOrder); + + /** + * 删除品质管理退换货品质报告 + * + * @param qualityRefundsExchangesOrderId 品质管理退换货品质报告ID + * @return 结果 + */ + public int deleteQualityRefundsExchangesOrderById(Long qualityRefundsExchangesOrderId); + + /** + * 批量删除品质管理退换货品质报告 + * + * @param qualityRefundsExchangesOrderIds 需要删除的数据ID + * @return 结果 + */ + public int deleteQualityRefundsExchangesOrderByIds(String[] qualityRefundsExchangesOrderIds); + + /** + * 作废品质管理退换货品质报告 + * + * @param qualityRefundsExchangesOrderId 品质管理退换货品质报告ID + * @return 结果 + */ + public int cancelQualityRefundsExchangesOrderById(Long qualityRefundsExchangesOrderId); + + /** + * 恢复品质管理退换货品质报告 + * + * @param qualityRefundsExchangesOrderId 品质管理退换货品质报告ID + * @return 结果 + */ + public int restoreQualityRefundsExchangesOrderById(Long qualityRefundsExchangesOrderId); + + + /* + * 查询数据库当前最大编号 + * 前面的 THH年月日 + * */ + public String findMaxRoundCode(@Param("prefix") String prefix); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesOrderService.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesOrderService.java new file mode 100644 index 00000000..ad2504ae --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesOrderService.java @@ -0,0 +1,75 @@ +package com.ruoyi.quality.service; + +import java.util.List; +import com.ruoyi.quality.domain.QualityRefundsExchangesOrder; + +/** + * 品质管理退换货品质报告Service接口 + * + * @author 刘晓旭 + * @date 2024-05-28 + */ +public interface IQualityRefundsExchangesOrderService +{ + /** + * 查询品质管理退换货品质报告 + * + * @param qualityRefundsExchangesOrderId 品质管理退换货品质报告ID + * @return 品质管理退换货品质报告 + */ + public QualityRefundsExchangesOrder selectQualityRefundsExchangesOrderById(Long qualityRefundsExchangesOrderId); + + /** + * 查询品质管理退换货品质报告列表 + * + * @param qualityRefundsExchangesOrder 品质管理退换货品质报告 + * @return 品质管理退换货品质报告集合 + */ + public List selectQualityRefundsExchangesOrderList(QualityRefundsExchangesOrder qualityRefundsExchangesOrder); + + /** + * 新增品质管理退换货品质报告 + * + * @param qualityRefundsExchangesOrder 品质管理退换货品质报告 + * @return 结果 + */ + public int insertQualityRefundsExchangesOrder(QualityRefundsExchangesOrder qualityRefundsExchangesOrder); + + /** + * 修改品质管理退换货品质报告 + * + * @param qualityRefundsExchangesOrder 品质管理退换货品质报告 + * @return 结果 + */ + public int updateQualityRefundsExchangesOrder(QualityRefundsExchangesOrder qualityRefundsExchangesOrder); + + /** + * 批量删除品质管理退换货品质报告 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteQualityRefundsExchangesOrderByIds(String ids); + + /** + * 删除品质管理退换货品质报告信息 + * + * @param qualityRefundsExchangesOrderId 品质管理退换货品质报告ID + * @return 结果 + */ + public int deleteQualityRefundsExchangesOrderById(Long qualityRefundsExchangesOrderId); + + /** + * 作废品质管理退换货品质报告 + * @param qualityRefundsExchangesOrderId 品质管理退换货品质报告ID + * @return + */ + int cancelQualityRefundsExchangesOrderById(Long qualityRefundsExchangesOrderId); + + /** + * 恢复品质管理退换货品质报告 + * @param qualityRefundsExchangesOrderId 品质管理退换货品质报告ID + * @return + */ + int restoreQualityRefundsExchangesOrderById(Long qualityRefundsExchangesOrderId); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java index 467b3fc7..1eaafa43 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java @@ -1,5 +1,7 @@ package com.ruoyi.quality.service.impl; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; @@ -7,15 +9,14 @@ import com.ruoyi.common.exception.BusinessException; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.quality.domain.QualityOrderDetail; -import com.ruoyi.quality.domain.QualityOrderReportUnqualified; +import com.ruoyi.quality.domain.*; import com.ruoyi.quality.mapper.QualityOrderDetailMapper; import com.ruoyi.quality.mapper.QualityOrderReportUnqualifiedMapper; +import com.ruoyi.quality.mapper.QualityRefundsExchangesOrderMapper; import org.apache.avalon.framework.service.ServiceException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.quality.mapper.QualityOrderReportMapper; -import com.ruoyi.quality.domain.QualityOrderReport; import com.ruoyi.quality.service.IQualityOrderReportService; import com.ruoyi.common.core.text.Convert; import org.springframework.transaction.annotation.Transactional; @@ -38,6 +39,9 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService @Autowired private QualityOrderDetailMapper orderDetailMapper; + @Autowired + private QualityRefundsExchangesOrderMapper refundsExchangesOrderMapper; + /** * 查询品质管理品质单报告 * @@ -101,7 +105,7 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService //从数据库查询品质报告详情数据 - QualityOrderDetail qualityOrderDetail = orderDetailMapper.selectQualityOrderDetailListByCodeAndNo(tempQualityOrderDetail); + QualityOrderDetail qualityOrderDetail = orderDetailMapper.selectQualityOrderDetailByCodeAndNo(tempQualityOrderDetail); //计算品质单详情中的品质合格数量 Integer okAcceptedNum = qualityOrderReport.getOkAcceptedNum(); Integer specialConcessionsNum = qualityOrderReport.getSpecialConcessionsNum(); @@ -118,6 +122,43 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService List unqualifiedDataList = qualityOrderReport.getUnqualifiedDataList(); + /*如果进行品质的订单类型是采购或者委外*/ + if (qualityOrderDetail.getQualityOrderType().equals("0") || qualityOrderDetail.getQualityOrderType().equals("2")){ + /*有品质不合格,需要在退换货入库前退货进行记录*/ + //更改日期格式,以提高可读性 + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); + String dataPart = df.format(new Date()); + + //移除日期中的分隔符以便于后续处理 + String prefix = "ZCGX"+dataPart.replace("-",""); + + //查询数据库中退换货单号最大的编号 + String maxCode = refundsExchangesOrderMapper.findMaxRoundCode(prefix); + String newCode = generateNewCode(prefix,maxCode); + QualityRefundsExchanges qualityRefundsExchanges = new QualityRefundsExchanges(); + qualityRefundsExchanges.setRefundsExchangesCode(newCode); + qualityRefundsExchanges.setRefundsExchangesStatus("0"); + + for (QualityOrderReportUnqualified tempQualityOrderReportUnqualified : unqualifiedDataList) { + QualityRefundsExchangesOrder qualityRefundsExchangesOrder = new QualityRefundsExchangesOrder(); + qualityRefundsExchangesOrder.setRefundsExchangesCode(newCode); + qualityRefundsExchangesOrder.setOkReportUrl(qualityOrderReport.getOkReportUrl()); + qualityRefundsExchangesOrder.setOkAcceptedNum(qualityOrderReport.getOkAcceptedNum()); + qualityRefundsExchangesOrder.setSpecialReportUrl(qualityOrderReport.getSpecialReportUrl()); + qualityRefundsExchangesOrder.setSpecialConcessionsNum(qualityOrderReport.getSpecialConcessionsNum()); + qualityRefundsExchangesOrder.setMaterialNo(materialNo); + qualityRefundsExchangesOrder.setMaterialName(qualityOrderReport.getMaterialName()); + qualityRefundsExchangesOrder.setMakeTotal(qualityOrderReport.getMakeTotal()); + qualityRefundsExchangesOrder.setQualityHasqualifiedNum(qualityOrderReport.getQualityHasqualifiedNum()); + qualityRefundsExchangesOrder.setProcessBadNum(tempQualityOrderReportUnqualified.getProcessBadNum()); + qualityRefundsExchangesOrder.setProcessBadClassification(tempQualityOrderReportUnqualified.getProcessBadClassification()); + qualityRefundsExchangesOrder.setProcessBadGrade(tempQualityOrderReportUnqualified.getProcessBadGrade()); + qualityRefundsExchangesOrder.setUpdateBy(loginName); + qualityRefundsExchangesOrder.setUpdateTime(new Date()); + refundsExchangesOrderMapper.insertQualityRefundsExchangesOrder(qualityRefundsExchangesOrder); + } + } + //计算不良数量的合计值 int processBadNumTotal = unqualifiedDataList.stream().mapToInt(QualityOrderReportUnqualified::getProcessBadNum).sum(); @@ -129,6 +170,7 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService orderDetailMapper.updateQualityOrderDetail(qualityOrderDetail); + List qualityOrderReportUnqualifieds = unqualifiedMapper.selectQualityOrderReportUnqualifiedByCodeAndNo(tempOrderReportUnqualified); if (StringUtils.isEmpty(qualityOrderReportUnqualifieds)){ //如果后端不合格数列表值为空,就新增一个 @@ -220,4 +262,29 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService QualityOrderReport qualityOrderReport = qualityOrderReportMapper.selectQualityOrderReportByNoAndCode(tempQualityOrderReport); return qualityOrderReport; } + + /** + *退换货单号生产规则 + *系统自动生成,按照特定编码,编码暂用【THH+年月日+001】, + *自增长,如:THH20231111001,THH20231111002 + * + */ + + private String generateNewCode(String prefix, String maxCode) { + if (StringUtils.isEmpty(maxCode)){ + return prefix+"001"; + } + //解析并递增编号 + int sequence = Integer.parseInt(maxCode.substring(4)) + 1 ; + + //检查序列号是否溢出 + if (sequence > 999){ + throw new BusinessException("当日编号已达到最大值999,请检查或调整策略"); + } + + //格式化序列号,自动补零至三位 + DecimalFormat df = new DecimalFormat("000"); + + return prefix + df.format(sequence); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesOrderServiceImpl.java new file mode 100644 index 00000000..9b61340a --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesOrderServiceImpl.java @@ -0,0 +1,126 @@ +package com.ruoyi.quality.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.ShiroUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.quality.mapper.QualityRefundsExchangesOrderMapper; +import com.ruoyi.quality.domain.QualityRefundsExchangesOrder; +import com.ruoyi.quality.service.IQualityRefundsExchangesOrderService; +import com.ruoyi.common.core.text.Convert; + +/** + * 品质管理退换货品质报告Service业务层处理 + * + * @author 刘晓旭 + * @date 2024-05-28 + */ +@Service +public class QualityRefundsExchangesOrderServiceImpl implements IQualityRefundsExchangesOrderService +{ + @Autowired + private QualityRefundsExchangesOrderMapper qualityRefundsExchangesOrderMapper; + + /** + * 查询品质管理退换货品质报告 + * + * @param qualityRefundsExchangesOrderId 品质管理退换货品质报告ID + * @return 品质管理退换货品质报告 + */ + @Override + public QualityRefundsExchangesOrder selectQualityRefundsExchangesOrderById(Long qualityRefundsExchangesOrderId) + { + return qualityRefundsExchangesOrderMapper.selectQualityRefundsExchangesOrderById(qualityRefundsExchangesOrderId); + } + + /** + * 查询品质管理退换货品质报告列表 + * + * @param qualityRefundsExchangesOrder 品质管理退换货品质报告 + * @return 品质管理退换货品质报告 + */ + @Override + public List selectQualityRefundsExchangesOrderList(QualityRefundsExchangesOrder qualityRefundsExchangesOrder) + { + return qualityRefundsExchangesOrderMapper.selectQualityRefundsExchangesOrderList(qualityRefundsExchangesOrder); + } + + /** + * 新增品质管理退换货品质报告 + * + * @param qualityRefundsExchangesOrder 品质管理退换货品质报告 + * @return 结果 + */ + @Override + public int insertQualityRefundsExchangesOrder(QualityRefundsExchangesOrder qualityRefundsExchangesOrder) + { + String loginName = ShiroUtils.getLoginName(); + qualityRefundsExchangesOrder.setCreateBy(loginName); + qualityRefundsExchangesOrder.setCreateTime(DateUtils.getNowDate()); + return qualityRefundsExchangesOrderMapper.insertQualityRefundsExchangesOrder(qualityRefundsExchangesOrder); + } + + /** + * 修改品质管理退换货品质报告 + * + * @param qualityRefundsExchangesOrder 品质管理退换货品质报告 + * @return 结果 + */ + @Override + public int updateQualityRefundsExchangesOrder(QualityRefundsExchangesOrder qualityRefundsExchangesOrder) + { + String loginName = ShiroUtils.getLoginName(); + qualityRefundsExchangesOrder.setUpdateBy(loginName); + qualityRefundsExchangesOrder.setUpdateTime(DateUtils.getNowDate()); + return qualityRefundsExchangesOrderMapper.updateQualityRefundsExchangesOrder(qualityRefundsExchangesOrder); + } + + /** + * 删除品质管理退换货品质报告对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + @Override + public int deleteQualityRefundsExchangesOrderByIds(String ids) + { + return qualityRefundsExchangesOrderMapper.deleteQualityRefundsExchangesOrderByIds(Convert.toStrArray(ids)); + } + + /** + * 删除品质管理退换货品质报告信息 + * + * @param qualityRefundsExchangesOrderId 品质管理退换货品质报告ID + * @return 结果 + */ + @Override + public int deleteQualityRefundsExchangesOrderById(Long qualityRefundsExchangesOrderId) + { + return qualityRefundsExchangesOrderMapper.deleteQualityRefundsExchangesOrderById(qualityRefundsExchangesOrderId); + } + + /** + * 作废品质管理退换货品质报告 + * + * @param qualityRefundsExchangesOrderId 品质管理退换货品质报告ID + * @return 结果 + */ + @Override + public int cancelQualityRefundsExchangesOrderById(Long qualityRefundsExchangesOrderId) + { + return qualityRefundsExchangesOrderMapper.cancelQualityRefundsExchangesOrderById(qualityRefundsExchangesOrderId); + } + + /** + * 恢复品质管理退换货品质报告信息 + * + * @param qualityRefundsExchangesOrderId 品质管理退换货品质报告ID + * @return 结果 + */ + @Override + public int restoreQualityRefundsExchangesOrderById(Long qualityRefundsExchangesOrderId) + { + return qualityRefundsExchangesOrderMapper.restoreQualityRefundsExchangesOrderById(qualityRefundsExchangesOrderId); + } +} diff --git a/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderDetailMapper.xml b/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderDetailMapper.xml index 94774c6b..75cd8ba0 100644 --- a/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderDetailMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderDetailMapper.xml @@ -66,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where quality_order_code = #{qualityOrderCode} - where supplier_code = #{supplierCode} and material_no = #{materialNo} diff --git a/ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesOrderMapper.xml b/ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesOrderMapper.xml new file mode 100644 index 00000000..c5303bb8 --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesOrderMapper.xml @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select quality_refunds_exchanges_order_id, refunds_exchanges_code, supplier_code, supplier_name, material_no, material_name, make_total, quality_hasqualified_num, ok_accepted_num, ok_report_url, special_concessions_num, special_report_url, checkout_completion_time, process_bad_classification, process_bad_grade, process_bad_num, unqualified_report_url, remark, create_by, create_time, update_by, update_time from quality_refunds_exchanges_order + + + + + + + + insert into quality_refunds_exchanges_order + + refunds_exchanges_code, + supplier_code, + supplier_name, + material_no, + material_name, + make_total, + quality_hasqualified_num, + ok_accepted_num, + ok_report_url, + special_concessions_num, + special_report_url, + checkout_completion_time, + process_bad_classification, + process_bad_grade, + process_bad_num, + unqualified_report_url, + remark, + create_by, + create_time, + update_by, + update_time, + + + #{refundsExchangesCode}, + #{supplierCode}, + #{supplierName}, + #{materialNo}, + #{materialName}, + #{makeTotal}, + #{qualityHasqualifiedNum}, + #{okAcceptedNum}, + #{okReportUrl}, + #{specialConcessionsNum}, + #{specialReportUrl}, + #{checkoutCompletionTime}, + #{processBadClassification}, + #{processBadGrade}, + #{processBadNum}, + #{unqualifiedReportUrl}, + #{remark}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update quality_refunds_exchanges_order + + refunds_exchanges_code = #{refundsExchangesCode}, + supplier_code = #{supplierCode}, + supplier_name = #{supplierName}, + material_no = #{materialNo}, + material_name = #{materialName}, + make_total = #{makeTotal}, + quality_hasqualified_num = #{qualityHasqualifiedNum}, + ok_accepted_num = #{okAcceptedNum}, + ok_report_url = #{okReportUrl}, + special_concessions_num = #{specialConcessionsNum}, + special_report_url = #{specialReportUrl}, + checkout_completion_time = #{checkoutCompletionTime}, + process_bad_classification = #{processBadClassification}, + process_bad_grade = #{processBadGrade}, + process_bad_num = #{processBadNum}, + unqualified_report_url = #{unqualifiedReportUrl}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where quality_refunds_exchanges_order_id = #{qualityRefundsExchangesOrderId} + + + + delete from quality_refunds_exchanges_order where quality_refunds_exchanges_order_id = #{qualityRefundsExchangesOrderId} + + + + delete from quality_refunds_exchanges_order where quality_refunds_exchanges_order_id in + + #{qualityRefundsExchangesOrderId} + + + + + update quality_refunds_exchanges_order set del_flag = '1' where quality_refunds_exchanges_order_id = #{qualityRefundsExchangesOrderId} + + + + update quality_refunds_exchanges_order set del_flag = '0' where quality_refunds_exchanges_order_id = #{qualityRefundsExchangesOrderId} + + + + + + \ No newline at end of file