Browse Source

[feat]品质管理:

退换货详情
新增入库前退货品质报告Mapper
新增入库前退货品质报告Mapper.xml
新增入库前退货品质报告Service
新增入库前退货品质报告ServiceImpl
新增如果是采购订单和委外订单进行品质,退换货进行记录信息,自动生成退换货单号
dev
liuxiaoxu 6 months ago
parent
commit
52722845cb
  1. 269
      ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchangesOrder.java
  2. 2
      ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderDetailMapper.java
  3. 85
      ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityRefundsExchangesOrderMapper.java
  4. 75
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesOrderService.java
  5. 75
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java
  6. 126
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesOrderServiceImpl.java
  7. 2
      ruoyi-admin/src/main/resources/mapper/quality/QualityOrderDetailMapper.xml
  8. 149
      ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesOrderMapper.xml

269
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();
}
}

2
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);
}

85
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<QualityRefundsExchangesOrder> 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);
}

75
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<QualityRefundsExchangesOrder> 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);
}

75
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<QualityOrderReportUnqualified> 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<QualityOrderReportUnqualified> 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
*自增长:THH20231111001THH20231111002
*
*/
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);
}
}

126
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<QualityRefundsExchangesOrder> 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);
}
}

2
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}
</select>
<select id="selectQualityOrderDetailListByCodeAndNo" parameterType="QualityOrderDetail" resultMap="QualityOrderDetailResult">
<select id="selectQualityOrderDetailByCodeAndNo" parameterType="QualityOrderDetail" resultMap="QualityOrderDetailResult">
<include refid="selectQualityOrderDetailVo"/>
where supplier_code = #{supplierCode}
and material_no = #{materialNo}

149
ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesOrderMapper.xml

@ -0,0 +1,149 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.quality.mapper.QualityRefundsExchangesOrderMapper">
<resultMap type="QualityRefundsExchangesOrder" id="QualityRefundsExchangesOrderResult">
<result property="qualityRefundsExchangesOrderId" column="quality_refunds_exchanges_order_id" />
<result property="refundsExchangesCode" column="refunds_exchanges_code" />
<result property="supplierCode" column="supplier_code" />
<result property="supplierName" column="supplier_name" />
<result property="materialNo" column="material_no" />
<result property="materialName" column="material_name" />
<result property="makeTotal" column="make_total" />
<result property="qualityHasqualifiedNum" column="quality_hasqualified_num" />
<result property="okAcceptedNum" column="ok_accepted_num" />
<result property="okReportUrl" column="ok_report_url" />
<result property="specialConcessionsNum" column="special_concessions_num" />
<result property="specialReportUrl" column="special_report_url" />
<result property="checkoutCompletionTime" column="checkout_completion_time" />
<result property="processBadClassification" column="process_bad_classification" />
<result property="processBadGrade" column="process_bad_grade" />
<result property="processBadNum" column="process_bad_num" />
<result property="unqualifiedReportUrl" column="unqualified_report_url" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectQualityRefundsExchangesOrderVo">
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
</sql>
<select id="selectQualityRefundsExchangesOrderList" parameterType="QualityRefundsExchangesOrder" resultMap="QualityRefundsExchangesOrderResult">
<include refid="selectQualityRefundsExchangesOrderVo"/>
<where>
</where>
</select>
<select id="selectQualityRefundsExchangesOrderById" parameterType="Long" resultMap="QualityRefundsExchangesOrderResult">
<include refid="selectQualityRefundsExchangesOrderVo"/>
where quality_refunds_exchanges_order_id = #{qualityRefundsExchangesOrderId}
</select>
<insert id="insertQualityRefundsExchangesOrder" parameterType="QualityRefundsExchangesOrder" useGeneratedKeys="true" keyProperty="qualityRefundsExchangesOrderId">
insert into quality_refunds_exchanges_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="refundsExchangesCode != null">refunds_exchanges_code,</if>
<if test="supplierCode != null">supplier_code,</if>
<if test="supplierName != null">supplier_name,</if>
<if test="materialNo != null">material_no,</if>
<if test="materialName != null">material_name,</if>
<if test="makeTotal != null">make_total,</if>
<if test="qualityHasqualifiedNum != null">quality_hasqualified_num,</if>
<if test="okAcceptedNum != null">ok_accepted_num,</if>
<if test="okReportUrl != null">ok_report_url,</if>
<if test="specialConcessionsNum != null">special_concessions_num,</if>
<if test="specialReportUrl != null">special_report_url,</if>
<if test="checkoutCompletionTime != null">checkout_completion_time,</if>
<if test="processBadClassification != null">process_bad_classification,</if>
<if test="processBadGrade != null">process_bad_grade,</if>
<if test="processBadNum != null">process_bad_num,</if>
<if test="unqualifiedReportUrl != null">unqualified_report_url,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="refundsExchangesCode != null">#{refundsExchangesCode},</if>
<if test="supplierCode != null">#{supplierCode},</if>
<if test="supplierName != null">#{supplierName},</if>
<if test="materialNo != null">#{materialNo},</if>
<if test="materialName != null">#{materialName},</if>
<if test="makeTotal != null">#{makeTotal},</if>
<if test="qualityHasqualifiedNum != null">#{qualityHasqualifiedNum},</if>
<if test="okAcceptedNum != null">#{okAcceptedNum},</if>
<if test="okReportUrl != null">#{okReportUrl},</if>
<if test="specialConcessionsNum != null">#{specialConcessionsNum},</if>
<if test="specialReportUrl != null">#{specialReportUrl},</if>
<if test="checkoutCompletionTime != null">#{checkoutCompletionTime},</if>
<if test="processBadClassification != null">#{processBadClassification},</if>
<if test="processBadGrade != null">#{processBadGrade},</if>
<if test="processBadNum != null">#{processBadNum},</if>
<if test="unqualifiedReportUrl != null">#{unqualifiedReportUrl},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateQualityRefundsExchangesOrder" parameterType="QualityRefundsExchangesOrder">
update quality_refunds_exchanges_order
<trim prefix="SET" suffixOverrides=",">
<if test="refundsExchangesCode != null">refunds_exchanges_code = #{refundsExchangesCode},</if>
<if test="supplierCode != null">supplier_code = #{supplierCode},</if>
<if test="supplierName != null">supplier_name = #{supplierName},</if>
<if test="materialNo != null">material_no = #{materialNo},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="makeTotal != null">make_total = #{makeTotal},</if>
<if test="qualityHasqualifiedNum != null">quality_hasqualified_num = #{qualityHasqualifiedNum},</if>
<if test="okAcceptedNum != null">ok_accepted_num = #{okAcceptedNum},</if>
<if test="okReportUrl != null">ok_report_url = #{okReportUrl},</if>
<if test="specialConcessionsNum != null">special_concessions_num = #{specialConcessionsNum},</if>
<if test="specialReportUrl != null">special_report_url = #{specialReportUrl},</if>
<if test="checkoutCompletionTime != null">checkout_completion_time = #{checkoutCompletionTime},</if>
<if test="processBadClassification != null">process_bad_classification = #{processBadClassification},</if>
<if test="processBadGrade != null">process_bad_grade = #{processBadGrade},</if>
<if test="processBadNum != null">process_bad_num = #{processBadNum},</if>
<if test="unqualifiedReportUrl != null">unqualified_report_url = #{unqualifiedReportUrl},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where quality_refunds_exchanges_order_id = #{qualityRefundsExchangesOrderId}
</update>
<delete id="deleteQualityRefundsExchangesOrderById" parameterType="Long">
delete from quality_refunds_exchanges_order where quality_refunds_exchanges_order_id = #{qualityRefundsExchangesOrderId}
</delete>
<delete id="deleteQualityRefundsExchangesOrderByIds" parameterType="String">
delete from quality_refunds_exchanges_order where quality_refunds_exchanges_order_id in
<foreach item="qualityRefundsExchangesOrderId" collection="array" open="(" separator="," close=")">
#{qualityRefundsExchangesOrderId}
</foreach>
</delete>
<update id="cancelQualityRefundsExchangesOrderById" parameterType="Long">
update quality_refunds_exchanges_order set del_flag = '1' where quality_refunds_exchanges_order_id = #{qualityRefundsExchangesOrderId}
</update>
<update id="restoreQualityRefundsExchangesOrderById" parameterType="Long">
update quality_refunds_exchanges_order set del_flag = '0' where quality_refunds_exchanges_order_id = #{qualityRefundsExchangesOrderId}
</update>
<select id="findMaxRoundCode" resultType="String">
select max(substring(refunds_exchanges_code,7)) from quality_refunds_exchanges_order where refunds_exchanges_code like concat(#{refundsExchangesCode},'%')
</select>
</mapper>
Loading…
Cancel
Save