Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
zhangsiqi 6 months ago
parent
commit
99671cc955
  1. 8
      ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpMaterialMapper.java
  2. 9
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java
  3. 12
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java
  4. 54
      ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityRefundsExchangesController.java
  5. 15
      ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchanges.java
  6. 325
      ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchangesDetail.java
  7. 157
      ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchangesUnqualified.java
  8. 77
      ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityRefundsExchangesDetailMapper.java
  9. 4
      ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityRefundsExchangesMapper.java
  10. 77
      ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityRefundsExchangesUnqualifiedMapper.java
  11. 75
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesDetailService.java
  12. 75
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesUnqualifiedService.java
  13. 126
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesDetailServiceImpl.java
  14. 61
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesServiceImpl.java
  15. 126
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesUnqualifiedServiceImpl.java
  16. 3
      ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml
  17. 160
      ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesDetailMapper.xml
  18. 4
      ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesMapper.xml
  19. 112
      ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesUnqualifiedMapper.xml
  20. 251
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/add.html
  21. 70
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/materialSelect.html
  22. 258
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/qualityOrderReport.html
  23. 20
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/refundsExchanges.html

8
ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpMaterialMapper.java

@ -97,4 +97,12 @@ public interface ErpMaterialMapper
* 批量查找物料信息
*/
List<ErpMaterialVo> selectErpMaterialByIds(String[] ids);
/**
* 查询所有物料信息列表
*
* @return 物料信息集合
*/
List<ErpMaterialVo> selectAllErpMaterialList();
}

9
ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java

@ -31,6 +31,15 @@ public interface IErpMaterialService
*/
public List<ErpMaterialVo> selectErpMaterialList(ErpMaterialVo erpMaterialVo);
/**
* 查询所有物料信息列表
*
* @return 物料信息集合
*/
public List<ErpMaterialVo> selectAllErpMaterialList();
/**
* 新增物料信息
*

12
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java

@ -149,6 +149,18 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
return returnList;
}
/**
* 查询所有物料信息列表
*
* @return 物料信息集合
*/
@Override
public List<ErpMaterialVo> selectAllErpMaterialList() {
List<ErpMaterialVo> erpMaterialVos = erpMaterialMapper.selectAllErpMaterialList();
return erpMaterialVos;
}
/**
* 新增物料信息
*

54
ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityRefundsExchangesController.java

@ -1,15 +1,17 @@
package com.ruoyi.quality.controller;
import java.util.List;
import com.ruoyi.erp.domain.ErpMaterialVo;
import com.ruoyi.erp.service.IErpMaterialService;
import com.ruoyi.quality.domain.QualityOrderReport;
import com.ruoyi.quality.domain.VO.CheckoutMaterialVO;
import org.apache.poi.ss.formula.functions.T;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.quality.domain.QualityRefundsExchanges;
@ -34,6 +36,9 @@ public class QualityRefundsExchangesController extends BaseController
@Autowired
private IQualityRefundsExchangesService qualityRefundsExchangesService;
@Autowired
private IErpMaterialService erpMaterialService;
@RequiresPermissions("quality:refundsExchanges:view")
@GetMapping()
public String refundsExchanges()
@ -84,7 +89,7 @@ public class QualityRefundsExchangesController extends BaseController
@Log(title = "品质管理退换货单", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(QualityRefundsExchanges qualityRefundsExchanges)
public AjaxResult addSave(@RequestBody QualityRefundsExchanges qualityRefundsExchanges)
{
return toAjax(qualityRefundsExchangesService.insertQualityRefundsExchanges(qualityRefundsExchanges));
}
@ -112,39 +117,26 @@ public class QualityRefundsExchangesController extends BaseController
return toAjax(qualityRefundsExchangesService.updateQualityRefundsExchanges(qualityRefundsExchanges));
}
/**
* 删除品质管理退换货单
*/
@RequiresPermissions("quality:refundsExchanges:remove")
@Log(title = "品质管理退换货单", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(qualityRefundsExchangesService.deleteQualityRefundsExchangesByIds(ids));
}
/**
* 作废品质管理退换货单
* 选择物料信息页面
*/
@RequiresPermissions("quality:refundsExchanges:cancel")
@Log(title = "品质管理退换货单", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}")
@ResponseBody
public AjaxResult cancel(@PathVariable("id") Long id){
return toAjax(qualityRefundsExchangesService.cancelQualityRefundsExchangesById(id));
@GetMapping("/materialSelect")
public String materialSelect()
{
return prefix + "/materialSelect";
}
/**
* 恢复品质管理退换货单
*/
@RequiresPermissions("quality:refundsExchanges:restore")
@Log(title = "品质管理退换货单", businessType = BusinessType.RESTORE)
@GetMapping( "/restore/{id}")
* 查询所有物料信息
* */
@PostMapping( "/getAllMaterial")
@ResponseBody
public AjaxResult restore(@PathVariable("id")Long id)
public TableDataInfo getAllMaterial()
{
return toAjax(qualityRefundsExchangesService.restoreQualityRefundsExchangesById(id));
startPage();
List<ErpMaterialVo> erpMaterialVos = erpMaterialService.selectAllErpMaterialList();
return getDataTable(erpMaterialVos);
}

15
ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchanges.java

@ -1,6 +1,8 @@
package com.ruoyi.quality.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -65,6 +67,10 @@ public class QualityRefundsExchanges extends BaseEntity
@Excel(name = "品质备注")
private String qualityRemark;
/*退换货详情列表*/
private List<QualityRefundsExchangesDetail> refundsExchangesDetails;
public void setRefundsExchangesId(Long refundsExchangesId)
{
this.refundsExchangesId = refundsExchangesId;
@ -174,6 +180,14 @@ public class QualityRefundsExchanges extends BaseEntity
return qualityRemark;
}
public List<QualityRefundsExchangesDetail> getRefundsExchangesDetails() {
return refundsExchangesDetails;
}
public void setRefundsExchangesDetails(List<QualityRefundsExchangesDetail> refundsExchangesDetails) {
this.refundsExchangesDetails = refundsExchangesDetails;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -194,6 +208,7 @@ public class QualityRefundsExchanges extends BaseEntity
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("refundsExchangesDetails",getRefundsExchangesDetails())
.toString();
}
}

325
ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchangesDetail.java

@ -0,0 +1,325 @@
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_detail
*
* @author 刘晓旭
* @date 2024-05-24
*/
public class QualityRefundsExchangesDetail extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 退换货详情Id */
private Long refundsExchangesDetailId;
/** 退换货单号 */
@Excel(name = "退换货单号")
private String refundsExchangesCode;
/** 退换货状态 */
@Excel(name = "退换货状态")
private String refundsExchangesStatus;
/** 仓库状态 */
@Excel(name = "仓库状态")
private String qualityWarehouseStatus;
/** 采购状态 */
@Excel(name = "采购状态")
private String qualityPurchaseStatus;
/** 关联订单号 */
@Excel(name = "关联订单号")
private String relatedOrderCode;
/** 入库单号 */
@Excel(name = "入库单号")
private String inStorageCode;
/** 退货节点 */
@Excel(name = "退货节点")
private String qualityReturnNode;
/** 物料数合计 */
@Excel(name = "物料数合计")
private Long materialTotal;
/** 数量合计 */
@Excel(name = "数量合计")
private Long numTotal;
/** 料号 */
@Excel(name = "料号")
private String materialNo;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
/** 物料类型 */
@Excel(name = "物料类型")
private String materialType;
/** 物料图片地址 */
@Excel(name = "物料图片地址")
private String materialPhotourl;
/** 物料品牌 */
@Excel(name = "物料品牌")
private String materialBrand;
/** 物料单位 */
@Excel(name = "物料单位")
private String materialUnit;
/** 物料描述 */
@Excel(name = "物料描述")
private String materialDescribe;
/** 物料加工方式 */
@Excel(name = "物料加工方式")
private String materialProcessMethod;
/** 退换货数 */
@Excel(name = "退换货数")
private Long refundsExchangesNum;
/** 交付质检时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "交付质检时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date deliveryInspectionTime;
/** 品质备注 */
@Excel(name = "品质备注")
private String qualityRemark;
public void setRefundsExchangesDetailId(Long refundsExchangesDetailId)
{
this.refundsExchangesDetailId = refundsExchangesDetailId;
}
public Long getRefundsExchangesDetailId()
{
return refundsExchangesDetailId;
}
public void setRefundsExchangesCode(String refundsExchangesCode)
{
this.refundsExchangesCode = refundsExchangesCode;
}
public String getRefundsExchangesCode()
{
return refundsExchangesCode;
}
public void setRefundsExchangesStatus(String refundsExchangesStatus)
{
this.refundsExchangesStatus = refundsExchangesStatus;
}
public String getRefundsExchangesStatus()
{
return refundsExchangesStatus;
}
public void setQualityWarehouseStatus(String qualityWarehouseStatus)
{
this.qualityWarehouseStatus = qualityWarehouseStatus;
}
public String getQualityWarehouseStatus()
{
return qualityWarehouseStatus;
}
public void setQualityPurchaseStatus(String qualityPurchaseStatus)
{
this.qualityPurchaseStatus = qualityPurchaseStatus;
}
public String getQualityPurchaseStatus()
{
return qualityPurchaseStatus;
}
public void setRelatedOrderCode(String relatedOrderCode)
{
this.relatedOrderCode = relatedOrderCode;
}
public String getRelatedOrderCode()
{
return relatedOrderCode;
}
public void setInStorageCode(String inStorageCode)
{
this.inStorageCode = inStorageCode;
}
public String getInStorageCode()
{
return inStorageCode;
}
public void setQualityReturnNode(String qualityReturnNode)
{
this.qualityReturnNode = qualityReturnNode;
}
public String getQualityReturnNode()
{
return qualityReturnNode;
}
public void setMaterialTotal(Long materialTotal)
{
this.materialTotal = materialTotal;
}
public Long getMaterialTotal()
{
return materialTotal;
}
public void setNumTotal(Long numTotal)
{
this.numTotal = numTotal;
}
public Long getNumTotal()
{
return numTotal;
}
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 setMaterialType(String materialType)
{
this.materialType = materialType;
}
public String getMaterialType()
{
return materialType;
}
public void setMaterialPhotourl(String materialPhotourl)
{
this.materialPhotourl = materialPhotourl;
}
public String getMaterialPhotourl()
{
return materialPhotourl;
}
public void setMaterialBrand(String materialBrand)
{
this.materialBrand = materialBrand;
}
public String getMaterialBrand()
{
return materialBrand;
}
public void setMaterialUnit(String materialUnit)
{
this.materialUnit = materialUnit;
}
public String getMaterialUnit()
{
return materialUnit;
}
public void setMaterialDescribe(String materialDescribe)
{
this.materialDescribe = materialDescribe;
}
public String getMaterialDescribe()
{
return materialDescribe;
}
public void setMaterialProcessMethod(String materialProcessMethod)
{
this.materialProcessMethod = materialProcessMethod;
}
public String getMaterialProcessMethod()
{
return materialProcessMethod;
}
public void setRefundsExchangesNum(Long refundsExchangesNum)
{
this.refundsExchangesNum = refundsExchangesNum;
}
public Long getRefundsExchangesNum()
{
return refundsExchangesNum;
}
public void setDeliveryInspectionTime(Date deliveryInspectionTime)
{
this.deliveryInspectionTime = deliveryInspectionTime;
}
public Date getDeliveryInspectionTime()
{
return deliveryInspectionTime;
}
public void setQualityRemark(String qualityRemark)
{
this.qualityRemark = qualityRemark;
}
public String getQualityRemark()
{
return qualityRemark;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("refundsExchangesDetailId", getRefundsExchangesDetailId())
.append("refundsExchangesCode", getRefundsExchangesCode())
.append("refundsExchangesStatus", getRefundsExchangesStatus())
.append("qualityWarehouseStatus", getQualityWarehouseStatus())
.append("qualityPurchaseStatus", getQualityPurchaseStatus())
.append("relatedOrderCode", getRelatedOrderCode())
.append("inStorageCode", getInStorageCode())
.append("qualityReturnNode", getQualityReturnNode())
.append("materialTotal", getMaterialTotal())
.append("numTotal", getNumTotal())
.append("materialNo", getMaterialNo())
.append("materialName", getMaterialName())
.append("materialType", getMaterialType())
.append("materialPhotourl", getMaterialPhotourl())
.append("materialBrand", getMaterialBrand())
.append("materialUnit", getMaterialUnit())
.append("materialDescribe", getMaterialDescribe())
.append("materialProcessMethod", getMaterialProcessMethod())
.append("refundsExchangesNum", getRefundsExchangesNum())
.append("deliveryInspectionTime", getDeliveryInspectionTime())
.append("qualityRemark", getQualityRemark())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

157
ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchangesUnqualified.java

@ -0,0 +1,157 @@
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_unqualified
*
* @author 刘晓旭
* @date 2024-05-24
*/
public class QualityRefundsExchangesUnqualified extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 退换货不合格分类Id */
private Long refundsExchangesUnqualifiedId;
/** 退换货单号 */
@Excel(name = "退换货单号")
private String refundsExchangesCode;
/** 料号 */
@Excel(name = "料号")
private String materialNo;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
/** 制程工序不良分类 */
@Excel(name = "制程工序不良分类")
private String processBadClassification;
/** 制程工序不良等级 */
@Excel(name = "制程工序不良等级")
private String processBadGrade;
/** 制程工序不良数量 */
@Excel(name = "制程工序不良数量")
private Integer processBadNum;
/** 不合格报告url */
@Excel(name = "不合格报告url")
private String unqualifiedReportUrl;
/** 检验完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "检验完成时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date inspectionTime;
public void setRefundsExchangesUnqualifiedId(Long refundsExchangesUnqualifiedId)
{
this.refundsExchangesUnqualifiedId = refundsExchangesUnqualifiedId;
}
public Long getRefundsExchangesUnqualifiedId()
{
return refundsExchangesUnqualifiedId;
}
public void setRefundsExchangesCode(String refundsExchangesCode)
{
this.refundsExchangesCode = refundsExchangesCode;
}
public String getRefundsExchangesCode()
{
return refundsExchangesCode;
}
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 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;
}
public void setInspectionTime(Date inspectionTime)
{
this.inspectionTime = inspectionTime;
}
public Date getInspectionTime()
{
return inspectionTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("refundsExchangesUnqualifiedId", getRefundsExchangesUnqualifiedId())
.append("refundsExchangesCode", getRefundsExchangesCode())
.append("materialNo", getMaterialNo())
.append("materialName", getMaterialName())
.append("processBadClassification", getProcessBadClassification())
.append("processBadGrade", getProcessBadGrade())
.append("processBadNum", getProcessBadNum())
.append("unqualifiedReportUrl", getUnqualifiedReportUrl())
.append("inspectionTime", getInspectionTime())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

77
ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityRefundsExchangesDetailMapper.java

@ -0,0 +1,77 @@
package com.ruoyi.quality.mapper;
import java.util.List;
import com.ruoyi.quality.domain.QualityRefundsExchangesDetail;
/**
* 品质管理退换货单详情Mapper接口
*
* @author 刘晓旭
* @date 2024-05-24
*/
public interface QualityRefundsExchangesDetailMapper
{
/**
* 查询品质管理退换货单详情
*
* @param refundsExchangesDetailId 品质管理退换货单详情ID
* @return 品质管理退换货单详情
*/
public QualityRefundsExchangesDetail selectQualityRefundsExchangesDetailById(Long refundsExchangesDetailId);
/**
* 查询品质管理退换货单详情列表
*
* @param qualityRefundsExchangesDetail 品质管理退换货单详情
* @return 品质管理退换货单详情集合
*/
public List<QualityRefundsExchangesDetail> selectQualityRefundsExchangesDetailList(QualityRefundsExchangesDetail qualityRefundsExchangesDetail);
/**
* 新增品质管理退换货单详情
*
* @param qualityRefundsExchangesDetail 品质管理退换货单详情
* @return 结果
*/
public int insertQualityRefundsExchangesDetail(QualityRefundsExchangesDetail qualityRefundsExchangesDetail);
/**
* 修改品质管理退换货单详情
*
* @param qualityRefundsExchangesDetail 品质管理退换货单详情
* @return 结果
*/
public int updateQualityRefundsExchangesDetail(QualityRefundsExchangesDetail qualityRefundsExchangesDetail);
/**
* 删除品质管理退换货单详情
*
* @param refundsExchangesDetailId 品质管理退换货单详情ID
* @return 结果
*/
public int deleteQualityRefundsExchangesDetailById(Long refundsExchangesDetailId);
/**
* 批量删除品质管理退换货单详情
*
* @param refundsExchangesDetailIds 需要删除的数据ID
* @return 结果
*/
public int deleteQualityRefundsExchangesDetailByIds(String[] refundsExchangesDetailIds);
/**
* 作废品质管理退换货单详情
*
* @param refundsExchangesDetailId 品质管理退换货单详情ID
* @return 结果
*/
public int cancelQualityRefundsExchangesDetailById(Long refundsExchangesDetailId);
/**
* 恢复品质管理退换货单详情
*
* @param refundsExchangesDetailId 品质管理退换货单详情ID
* @return 结果
*/
public int restoreQualityRefundsExchangesDetailById(Long refundsExchangesDetailId);
}

4
ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityRefundsExchangesMapper.java

@ -2,6 +2,7 @@ package com.ruoyi.quality.mapper;
import java.util.List;
import com.ruoyi.quality.domain.QualityRefundsExchanges;
import org.apache.ibatis.annotations.Param;
/**
* 品质管理退换货单Mapper接口
@ -74,4 +75,7 @@ public interface QualityRefundsExchangesMapper
* @return 结果
*/
public int restoreQualityRefundsExchangesById(Long refundsExchangesId);
/*查找当前最大编号*/
public String findMaxRoundCode(@Param("prefix") String prefix);
}

77
ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityRefundsExchangesUnqualifiedMapper.java

@ -0,0 +1,77 @@
package com.ruoyi.quality.mapper;
import java.util.List;
import com.ruoyi.quality.domain.QualityRefundsExchangesUnqualified;
/**
* 品质管理退换货不合格分类Mapper接口
*
* @author 刘晓旭
* @date 2024-05-24
*/
public interface QualityRefundsExchangesUnqualifiedMapper
{
/**
* 查询品质管理退换货不合格分类
*
* @param refundsExchangesUnqualifiedId 品质管理退换货不合格分类ID
* @return 品质管理退换货不合格分类
*/
public QualityRefundsExchangesUnqualified selectQualityRefundsExchangesUnqualifiedById(Long refundsExchangesUnqualifiedId);
/**
* 查询品质管理退换货不合格分类列表
*
* @param qualityRefundsExchangesUnqualified 品质管理退换货不合格分类
* @return 品质管理退换货不合格分类集合
*/
public List<QualityRefundsExchangesUnqualified> selectQualityRefundsExchangesUnqualifiedList(QualityRefundsExchangesUnqualified qualityRefundsExchangesUnqualified);
/**
* 新增品质管理退换货不合格分类
*
* @param qualityRefundsExchangesUnqualified 品质管理退换货不合格分类
* @return 结果
*/
public int insertQualityRefundsExchangesUnqualified(QualityRefundsExchangesUnqualified qualityRefundsExchangesUnqualified);
/**
* 修改品质管理退换货不合格分类
*
* @param qualityRefundsExchangesUnqualified 品质管理退换货不合格分类
* @return 结果
*/
public int updateQualityRefundsExchangesUnqualified(QualityRefundsExchangesUnqualified qualityRefundsExchangesUnqualified);
/**
* 删除品质管理退换货不合格分类
*
* @param refundsExchangesUnqualifiedId 品质管理退换货不合格分类ID
* @return 结果
*/
public int deleteQualityRefundsExchangesUnqualifiedById(Long refundsExchangesUnqualifiedId);
/**
* 批量删除品质管理退换货不合格分类
*
* @param refundsExchangesUnqualifiedIds 需要删除的数据ID
* @return 结果
*/
public int deleteQualityRefundsExchangesUnqualifiedByIds(String[] refundsExchangesUnqualifiedIds);
/**
* 作废品质管理退换货不合格分类
*
* @param refundsExchangesUnqualifiedId 品质管理退换货不合格分类ID
* @return 结果
*/
public int cancelQualityRefundsExchangesUnqualifiedById(Long refundsExchangesUnqualifiedId);
/**
* 恢复品质管理退换货不合格分类
*
* @param refundsExchangesUnqualifiedId 品质管理退换货不合格分类ID
* @return 结果
*/
public int restoreQualityRefundsExchangesUnqualifiedById(Long refundsExchangesUnqualifiedId);
}

75
ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesDetailService.java

@ -0,0 +1,75 @@
package com.ruoyi.quality.service;
import java.util.List;
import com.ruoyi.quality.domain.QualityRefundsExchangesDetail;
/**
* 品质管理退换货单详情Service接口
*
* @author 刘晓旭
* @date 2024-05-24
*/
public interface IQualityRefundsExchangesDetailService
{
/**
* 查询品质管理退换货单详情
*
* @param refundsExchangesDetailId 品质管理退换货单详情ID
* @return 品质管理退换货单详情
*/
public QualityRefundsExchangesDetail selectQualityRefundsExchangesDetailById(Long refundsExchangesDetailId);
/**
* 查询品质管理退换货单详情列表
*
* @param qualityRefundsExchangesDetail 品质管理退换货单详情
* @return 品质管理退换货单详情集合
*/
public List<QualityRefundsExchangesDetail> selectQualityRefundsExchangesDetailList(QualityRefundsExchangesDetail qualityRefundsExchangesDetail);
/**
* 新增品质管理退换货单详情
*
* @param qualityRefundsExchangesDetail 品质管理退换货单详情
* @return 结果
*/
public int insertQualityRefundsExchangesDetail(QualityRefundsExchangesDetail qualityRefundsExchangesDetail);
/**
* 修改品质管理退换货单详情
*
* @param qualityRefundsExchangesDetail 品质管理退换货单详情
* @return 结果
*/
public int updateQualityRefundsExchangesDetail(QualityRefundsExchangesDetail qualityRefundsExchangesDetail);
/**
* 批量删除品质管理退换货单详情
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteQualityRefundsExchangesDetailByIds(String ids);
/**
* 删除品质管理退换货单详情信息
*
* @param refundsExchangesDetailId 品质管理退换货单详情ID
* @return 结果
*/
public int deleteQualityRefundsExchangesDetailById(Long refundsExchangesDetailId);
/**
* 作废品质管理退换货单详情
* @param refundsExchangesDetailId 品质管理退换货单详情ID
* @return
*/
int cancelQualityRefundsExchangesDetailById(Long refundsExchangesDetailId);
/**
* 恢复品质管理退换货单详情
* @param refundsExchangesDetailId 品质管理退换货单详情ID
* @return
*/
int restoreQualityRefundsExchangesDetailById(Long refundsExchangesDetailId);
}

75
ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesUnqualifiedService.java

@ -0,0 +1,75 @@
package com.ruoyi.quality.service;
import java.util.List;
import com.ruoyi.quality.domain.QualityRefundsExchangesUnqualified;
/**
* 品质管理退换货不合格分类Service接口
*
* @author 刘晓旭
* @date 2024-05-24
*/
public interface IQualityRefundsExchangesUnqualifiedService
{
/**
* 查询品质管理退换货不合格分类
*
* @param refundsExchangesUnqualifiedId 品质管理退换货不合格分类ID
* @return 品质管理退换货不合格分类
*/
public QualityRefundsExchangesUnqualified selectQualityRefundsExchangesUnqualifiedById(Long refundsExchangesUnqualifiedId);
/**
* 查询品质管理退换货不合格分类列表
*
* @param qualityRefundsExchangesUnqualified 品质管理退换货不合格分类
* @return 品质管理退换货不合格分类集合
*/
public List<QualityRefundsExchangesUnqualified> selectQualityRefundsExchangesUnqualifiedList(QualityRefundsExchangesUnqualified qualityRefundsExchangesUnqualified);
/**
* 新增品质管理退换货不合格分类
*
* @param qualityRefundsExchangesUnqualified 品质管理退换货不合格分类
* @return 结果
*/
public int insertQualityRefundsExchangesUnqualified(QualityRefundsExchangesUnqualified qualityRefundsExchangesUnqualified);
/**
* 修改品质管理退换货不合格分类
*
* @param qualityRefundsExchangesUnqualified 品质管理退换货不合格分类
* @return 结果
*/
public int updateQualityRefundsExchangesUnqualified(QualityRefundsExchangesUnqualified qualityRefundsExchangesUnqualified);
/**
* 批量删除品质管理退换货不合格分类
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteQualityRefundsExchangesUnqualifiedByIds(String ids);
/**
* 删除品质管理退换货不合格分类信息
*
* @param refundsExchangesUnqualifiedId 品质管理退换货不合格分类ID
* @return 结果
*/
public int deleteQualityRefundsExchangesUnqualifiedById(Long refundsExchangesUnqualifiedId);
/**
* 作废品质管理退换货不合格分类
* @param refundsExchangesUnqualifiedId 品质管理退换货不合格分类ID
* @return
*/
int cancelQualityRefundsExchangesUnqualifiedById(Long refundsExchangesUnqualifiedId);
/**
* 恢复品质管理退换货不合格分类
* @param refundsExchangesUnqualifiedId 品质管理退换货不合格分类ID
* @return
*/
int restoreQualityRefundsExchangesUnqualifiedById(Long refundsExchangesUnqualifiedId);
}

126
ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesDetailServiceImpl.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.QualityRefundsExchangesDetailMapper;
import com.ruoyi.quality.domain.QualityRefundsExchangesDetail;
import com.ruoyi.quality.service.IQualityRefundsExchangesDetailService;
import com.ruoyi.common.core.text.Convert;
/**
* 品质管理退换货单详情Service业务层处理
*
* @author 刘晓旭
* @date 2024-05-24
*/
@Service
public class QualityRefundsExchangesDetailServiceImpl implements IQualityRefundsExchangesDetailService
{
@Autowired
private QualityRefundsExchangesDetailMapper qualityRefundsExchangesDetailMapper;
/**
* 查询品质管理退换货单详情
*
* @param refundsExchangesDetailId 品质管理退换货单详情ID
* @return 品质管理退换货单详情
*/
@Override
public QualityRefundsExchangesDetail selectQualityRefundsExchangesDetailById(Long refundsExchangesDetailId)
{
return qualityRefundsExchangesDetailMapper.selectQualityRefundsExchangesDetailById(refundsExchangesDetailId);
}
/**
* 查询品质管理退换货单详情列表
*
* @param qualityRefundsExchangesDetail 品质管理退换货单详情
* @return 品质管理退换货单详情
*/
@Override
public List<QualityRefundsExchangesDetail> selectQualityRefundsExchangesDetailList(QualityRefundsExchangesDetail qualityRefundsExchangesDetail)
{
return qualityRefundsExchangesDetailMapper.selectQualityRefundsExchangesDetailList(qualityRefundsExchangesDetail);
}
/**
* 新增品质管理退换货单详情
*
* @param qualityRefundsExchangesDetail 品质管理退换货单详情
* @return 结果
*/
@Override
public int insertQualityRefundsExchangesDetail(QualityRefundsExchangesDetail qualityRefundsExchangesDetail)
{
String loginName = ShiroUtils.getLoginName();
qualityRefundsExchangesDetail.setCreateBy(loginName);
qualityRefundsExchangesDetail.setCreateTime(DateUtils.getNowDate());
return qualityRefundsExchangesDetailMapper.insertQualityRefundsExchangesDetail(qualityRefundsExchangesDetail);
}
/**
* 修改品质管理退换货单详情
*
* @param qualityRefundsExchangesDetail 品质管理退换货单详情
* @return 结果
*/
@Override
public int updateQualityRefundsExchangesDetail(QualityRefundsExchangesDetail qualityRefundsExchangesDetail)
{
String loginName = ShiroUtils.getLoginName();
qualityRefundsExchangesDetail.setUpdateBy(loginName);
qualityRefundsExchangesDetail.setUpdateTime(DateUtils.getNowDate());
return qualityRefundsExchangesDetailMapper.updateQualityRefundsExchangesDetail(qualityRefundsExchangesDetail);
}
/**
* 删除品质管理退换货单详情对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteQualityRefundsExchangesDetailByIds(String ids)
{
return qualityRefundsExchangesDetailMapper.deleteQualityRefundsExchangesDetailByIds(Convert.toStrArray(ids));
}
/**
* 删除品质管理退换货单详情信息
*
* @param refundsExchangesDetailId 品质管理退换货单详情ID
* @return 结果
*/
@Override
public int deleteQualityRefundsExchangesDetailById(Long refundsExchangesDetailId)
{
return qualityRefundsExchangesDetailMapper.deleteQualityRefundsExchangesDetailById(refundsExchangesDetailId);
}
/**
* 作废品质管理退换货单详情
*
* @param refundsExchangesDetailId 品质管理退换货单详情ID
* @return 结果
*/
@Override
public int cancelQualityRefundsExchangesDetailById(Long refundsExchangesDetailId)
{
return qualityRefundsExchangesDetailMapper.cancelQualityRefundsExchangesDetailById(refundsExchangesDetailId);
}
/**
* 恢复品质管理退换货单详情信息
*
* @param refundsExchangesDetailId 品质管理退换货单详情ID
* @return 结果
*/
@Override
public int restoreQualityRefundsExchangesDetailById(Long refundsExchangesDetailId)
{
return qualityRefundsExchangesDetailMapper.restoreQualityRefundsExchangesDetailById(refundsExchangesDetailId);
}
}

61
ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesServiceImpl.java

@ -1,8 +1,17 @@
package com.ruoyi.quality.service.impl;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
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.QualityRefundsExchangesDetail;
import com.ruoyi.quality.mapper.QualityRefundsExchangesDetailMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.quality.mapper.QualityRefundsExchangesMapper;
@ -17,11 +26,15 @@ import com.ruoyi.common.core.text.Convert;
* @date 2024-05-23
*/
@Service
@Slf4j
public class QualityRefundsExchangesServiceImpl implements IQualityRefundsExchangesService
{
@Autowired
private QualityRefundsExchangesMapper qualityRefundsExchangesMapper;
@Autowired
private QualityRefundsExchangesDetailMapper refundsExchangesDetailMapper;
/**
* 查询品质管理退换货单
*
@ -55,10 +68,30 @@ public class QualityRefundsExchangesServiceImpl implements IQualityRefundsExchan
@Override
public int insertQualityRefundsExchanges(QualityRefundsExchanges qualityRefundsExchanges)
{
String loginName = ShiroUtils.getLoginName();
qualityRefundsExchanges.setCreateBy(loginName);
qualityRefundsExchanges.setCreateTime(DateUtils.getNowDate());
return qualityRefundsExchangesMapper.insertQualityRefundsExchanges(qualityRefundsExchanges);
List<QualityRefundsExchangesDetail> refundsExchangesDetails = qualityRefundsExchanges.getRefundsExchangesDetails();
if (StringUtils.isEmpty(refundsExchangesDetails)){
log.warn("物料数据为空:{}",qualityRefundsExchanges.getRefundsExchangesDetails());
}
for (QualityRefundsExchangesDetail tempDetail : refundsExchangesDetails) {
QualityRefundsExchangesDetail refundsExchangesDetail = new QualityRefundsExchangesDetail();
refundsExchangesDetail.setRefundsExchangesCode(tempDetail.getRefundsExchangesCode());
refundsExchangesDetail.setDeliveryInspectionTime(tempDetail.getDeliveryInspectionTime());
refundsExchangesDetail.setQualityRemark(tempDetail.getQualityRemark());
refundsExchangesDetail.setMaterialNo(tempDetail.getMaterialNo());
refundsExchangesDetail.setMaterialName(tempDetail.getMaterialName());
refundsExchangesDetail.setMaterialBrand(tempDetail.getMaterialBrand());
refundsExchangesDetail.setMaterialDescribe(tempDetail.getMaterialDescribe());
refundsExchangesDetail.setMaterialPhotourl(tempDetail.getMaterialPhotourl());
refundsExchangesDetail.setMaterialType(tempDetail.getMaterialType());
refundsExchangesDetail.setMaterialProcessMethod(tempDetail.getMaterialProcessMethod());
refundsExchangesDetail.setMaterialUnit(tempDetail.getMaterialUnit());
refundsExchangesDetail.setCreateBy(loginName);
refundsExchangesDetail.setCreateTime(new Date());
refundsExchangesDetailMapper.insertQualityRefundsExchangesDetail(refundsExchangesDetail);
}
return 1;
}
/**
@ -123,4 +156,26 @@ public class QualityRefundsExchangesServiceImpl implements IQualityRefundsExchan
{
return qualityRefundsExchangesMapper.restoreQualityRefundsExchangesById(refundsExchangesId);
}
/**
*退换货单号:
*系统自动生成按照特定编码编码暂用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/QualityRefundsExchangesUnqualifiedServiceImpl.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.QualityRefundsExchangesUnqualifiedMapper;
import com.ruoyi.quality.domain.QualityRefundsExchangesUnqualified;
import com.ruoyi.quality.service.IQualityRefundsExchangesUnqualifiedService;
import com.ruoyi.common.core.text.Convert;
/**
* 品质管理退换货不合格分类Service业务层处理
*
* @author 刘晓旭
* @date 2024-05-24
*/
@Service
public class QualityRefundsExchangesUnqualifiedServiceImpl implements IQualityRefundsExchangesUnqualifiedService
{
@Autowired
private QualityRefundsExchangesUnqualifiedMapper qualityRefundsExchangesUnqualifiedMapper;
/**
* 查询品质管理退换货不合格分类
*
* @param refundsExchangesUnqualifiedId 品质管理退换货不合格分类ID
* @return 品质管理退换货不合格分类
*/
@Override
public QualityRefundsExchangesUnqualified selectQualityRefundsExchangesUnqualifiedById(Long refundsExchangesUnqualifiedId)
{
return qualityRefundsExchangesUnqualifiedMapper.selectQualityRefundsExchangesUnqualifiedById(refundsExchangesUnqualifiedId);
}
/**
* 查询品质管理退换货不合格分类列表
*
* @param qualityRefundsExchangesUnqualified 品质管理退换货不合格分类
* @return 品质管理退换货不合格分类
*/
@Override
public List<QualityRefundsExchangesUnqualified> selectQualityRefundsExchangesUnqualifiedList(QualityRefundsExchangesUnqualified qualityRefundsExchangesUnqualified)
{
return qualityRefundsExchangesUnqualifiedMapper.selectQualityRefundsExchangesUnqualifiedList(qualityRefundsExchangesUnqualified);
}
/**
* 新增品质管理退换货不合格分类
*
* @param qualityRefundsExchangesUnqualified 品质管理退换货不合格分类
* @return 结果
*/
@Override
public int insertQualityRefundsExchangesUnqualified(QualityRefundsExchangesUnqualified qualityRefundsExchangesUnqualified)
{
String loginName = ShiroUtils.getLoginName();
qualityRefundsExchangesUnqualified.setCreateBy(loginName);
qualityRefundsExchangesUnqualified.setCreateTime(DateUtils.getNowDate());
return qualityRefundsExchangesUnqualifiedMapper.insertQualityRefundsExchangesUnqualified(qualityRefundsExchangesUnqualified);
}
/**
* 修改品质管理退换货不合格分类
*
* @param qualityRefundsExchangesUnqualified 品质管理退换货不合格分类
* @return 结果
*/
@Override
public int updateQualityRefundsExchangesUnqualified(QualityRefundsExchangesUnqualified qualityRefundsExchangesUnqualified)
{
String loginName = ShiroUtils.getLoginName();
qualityRefundsExchangesUnqualified.setUpdateBy(loginName);
qualityRefundsExchangesUnqualified.setUpdateTime(DateUtils.getNowDate());
return qualityRefundsExchangesUnqualifiedMapper.updateQualityRefundsExchangesUnqualified(qualityRefundsExchangesUnqualified);
}
/**
* 删除品质管理退换货不合格分类对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteQualityRefundsExchangesUnqualifiedByIds(String ids)
{
return qualityRefundsExchangesUnqualifiedMapper.deleteQualityRefundsExchangesUnqualifiedByIds(Convert.toStrArray(ids));
}
/**
* 删除品质管理退换货不合格分类信息
*
* @param refundsExchangesUnqualifiedId 品质管理退换货不合格分类ID
* @return 结果
*/
@Override
public int deleteQualityRefundsExchangesUnqualifiedById(Long refundsExchangesUnqualifiedId)
{
return qualityRefundsExchangesUnqualifiedMapper.deleteQualityRefundsExchangesUnqualifiedById(refundsExchangesUnqualifiedId);
}
/**
* 作废品质管理退换货不合格分类
*
* @param refundsExchangesUnqualifiedId 品质管理退换货不合格分类ID
* @return 结果
*/
@Override
public int cancelQualityRefundsExchangesUnqualifiedById(Long refundsExchangesUnqualifiedId)
{
return qualityRefundsExchangesUnqualifiedMapper.cancelQualityRefundsExchangesUnqualifiedById(refundsExchangesUnqualifiedId);
}
/**
* 恢复品质管理退换货不合格分类信息
*
* @param refundsExchangesUnqualifiedId 品质管理退换货不合格分类ID
* @return 结果
*/
@Override
public int restoreQualityRefundsExchangesUnqualifiedById(Long refundsExchangesUnqualifiedId)
{
return qualityRefundsExchangesUnqualifiedMapper.restoreQualityRefundsExchangesUnqualifiedById(refundsExchangesUnqualifiedId);
}
}

3
ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml

@ -151,6 +151,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</select>
<select id="selectAllErpMaterialList" resultMap="ErpMaterialResult">
<include refid="selectErpMaterialVo"/>
</select>
<insert id="insertErpMaterial" parameterType="ErpMaterial" useGeneratedKeys="true" keyProperty="id">
insert into erp_material

160
ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesDetailMapper.xml

@ -0,0 +1,160 @@
<?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.QualityRefundsExchangesDetailMapper">
<resultMap type="QualityRefundsExchangesDetail" id="QualityRefundsExchangesDetailResult">
<result property="refundsExchangesDetailId" column="refunds_exchanges_detail_id" />
<result property="refundsExchangesCode" column="refunds_exchanges_code" />
<result property="refundsExchangesStatus" column="refunds_exchanges_status" />
<result property="qualityWarehouseStatus" column="quality_warehouse_status" />
<result property="qualityPurchaseStatus" column="quality_purchase_status" />
<result property="relatedOrderCode" column="related_order_code" />
<result property="inStorageCode" column="in_storage_code" />
<result property="qualityReturnNode" column="quality_return_node" />
<result property="materialTotal" column="material_total" />
<result property="numTotal" column="num_total" />
<result property="materialNo" column="material_no" />
<result property="materialName" column="material_name" />
<result property="materialType" column="material_type" />
<result property="materialPhotourl" column="material_photoUrl" />
<result property="materialBrand" column="material_brand" />
<result property="materialUnit" column="material_unit" />
<result property="materialDescribe" column="material_describe" />
<result property="materialProcessMethod" column="material_process_method" />
<result property="refundsExchangesNum" column="refunds_exchanges_num" />
<result property="deliveryInspectionTime" column="delivery_inspection_time" />
<result property="qualityRemark" column="quality_remark" />
<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="selectQualityRefundsExchangesDetailVo">
select refunds_exchanges_detail_id, refunds_exchanges_code, refunds_exchanges_status, quality_warehouse_status, quality_purchase_status, related_order_code, in_storage_code, quality_return_node, material_total, num_total, material_no, material_name, material_type, material_photoUrl, material_brand, material_unit, material_describe, material_process_method, refunds_exchanges_num, delivery_inspection_time, quality_remark, remark, create_by, create_time, update_by, update_time from quality_refunds_exchanges_detail
</sql>
<select id="selectQualityRefundsExchangesDetailList" parameterType="QualityRefundsExchangesDetail" resultMap="QualityRefundsExchangesDetailResult">
<include refid="selectQualityRefundsExchangesDetailVo"/>
<where>
</where>
</select>
<select id="selectQualityRefundsExchangesDetailById" parameterType="Long" resultMap="QualityRefundsExchangesDetailResult">
<include refid="selectQualityRefundsExchangesDetailVo"/>
where refunds_exchanges_detail_id = #{refundsExchangesDetailId}
</select>
<insert id="insertQualityRefundsExchangesDetail" parameterType="QualityRefundsExchangesDetail" useGeneratedKeys="true" keyProperty="refundsExchangesDetailId">
insert into quality_refunds_exchanges_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="refundsExchangesCode != null">refunds_exchanges_code,</if>
<if test="refundsExchangesStatus != null">refunds_exchanges_status,</if>
<if test="qualityWarehouseStatus != null">quality_warehouse_status,</if>
<if test="qualityPurchaseStatus != null">quality_purchase_status,</if>
<if test="relatedOrderCode != null">related_order_code,</if>
<if test="inStorageCode != null">in_storage_code,</if>
<if test="qualityReturnNode != null">quality_return_node,</if>
<if test="materialTotal != null">material_total,</if>
<if test="numTotal != null">num_total,</if>
<if test="materialNo != null">material_no,</if>
<if test="materialName != null">material_name,</if>
<if test="materialType != null">material_type,</if>
<if test="materialPhotourl != null">material_photoUrl,</if>
<if test="materialBrand != null">material_brand,</if>
<if test="materialUnit != null">material_unit,</if>
<if test="materialDescribe != null">material_describe,</if>
<if test="materialProcessMethod != null">material_process_method,</if>
<if test="refundsExchangesNum != null">refunds_exchanges_num,</if>
<if test="deliveryInspectionTime != null">delivery_inspection_time,</if>
<if test="qualityRemark != null">quality_remark,</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="refundsExchangesStatus != null">#{refundsExchangesStatus},</if>
<if test="qualityWarehouseStatus != null">#{qualityWarehouseStatus},</if>
<if test="qualityPurchaseStatus != null">#{qualityPurchaseStatus},</if>
<if test="relatedOrderCode != null">#{relatedOrderCode},</if>
<if test="inStorageCode != null">#{inStorageCode},</if>
<if test="qualityReturnNode != null">#{qualityReturnNode},</if>
<if test="materialTotal != null">#{materialTotal},</if>
<if test="numTotal != null">#{numTotal},</if>
<if test="materialNo != null">#{materialNo},</if>
<if test="materialName != null">#{materialName},</if>
<if test="materialType != null">#{materialType},</if>
<if test="materialPhotourl != null">#{materialPhotourl},</if>
<if test="materialBrand != null">#{materialBrand},</if>
<if test="materialUnit != null">#{materialUnit},</if>
<if test="materialDescribe != null">#{materialDescribe},</if>
<if test="materialProcessMethod != null">#{materialProcessMethod},</if>
<if test="refundsExchangesNum != null">#{refundsExchangesNum},</if>
<if test="deliveryInspectionTime != null">#{deliveryInspectionTime},</if>
<if test="qualityRemark != null">#{qualityRemark},</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="updateQualityRefundsExchangesDetail" parameterType="QualityRefundsExchangesDetail">
update quality_refunds_exchanges_detail
<trim prefix="SET" suffixOverrides=",">
<if test="refundsExchangesCode != null">refunds_exchanges_code = #{refundsExchangesCode},</if>
<if test="refundsExchangesStatus != null">refunds_exchanges_status = #{refundsExchangesStatus},</if>
<if test="qualityWarehouseStatus != null">quality_warehouse_status = #{qualityWarehouseStatus},</if>
<if test="qualityPurchaseStatus != null">quality_purchase_status = #{qualityPurchaseStatus},</if>
<if test="relatedOrderCode != null">related_order_code = #{relatedOrderCode},</if>
<if test="inStorageCode != null">in_storage_code = #{inStorageCode},</if>
<if test="qualityReturnNode != null">quality_return_node = #{qualityReturnNode},</if>
<if test="materialTotal != null">material_total = #{materialTotal},</if>
<if test="numTotal != null">num_total = #{numTotal},</if>
<if test="materialNo != null">material_no = #{materialNo},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="materialType != null">material_type = #{materialType},</if>
<if test="materialPhotourl != null">material_photoUrl = #{materialPhotourl},</if>
<if test="materialBrand != null">material_brand = #{materialBrand},</if>
<if test="materialUnit != null">material_unit = #{materialUnit},</if>
<if test="materialDescribe != null">material_describe = #{materialDescribe},</if>
<if test="materialProcessMethod != null">material_process_method = #{materialProcessMethod},</if>
<if test="refundsExchangesNum != null">refunds_exchanges_num = #{refundsExchangesNum},</if>
<if test="deliveryInspectionTime != null">delivery_inspection_time = #{deliveryInspectionTime},</if>
<if test="qualityRemark != null">quality_remark = #{qualityRemark},</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 refunds_exchanges_detail_id = #{refundsExchangesDetailId}
</update>
<delete id="deleteQualityRefundsExchangesDetailById" parameterType="Long">
delete from quality_refunds_exchanges_detail where refunds_exchanges_detail_id = #{refundsExchangesDetailId}
</delete>
<delete id="deleteQualityRefundsExchangesDetailByIds" parameterType="String">
delete from quality_refunds_exchanges_detail where refunds_exchanges_detail_id in
<foreach item="refundsExchangesDetailId" collection="array" open="(" separator="," close=")">
#{refundsExchangesDetailId}
</foreach>
</delete>
<update id="cancelQualityRefundsExchangesDetailById" parameterType="Long">
update quality_refunds_exchanges_detail set del_flag = '1' where refunds_exchanges_detail_id = #{refundsExchangesDetailId}
</update>
<update id="restoreQualityRefundsExchangesDetailById" parameterType="Long">
update quality_refunds_exchanges_detail set del_flag = '0' where refunds_exchanges_detail_id = #{refundsExchangesDetailId}
</update>
</mapper>

4
ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesMapper.xml

@ -129,4 +129,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update quality_refunds_exchanges set del_flag = '0' where refunds_exchanges_id = #{refundsExchangesId}
</update>
<select id="findMaxRoundCode" resultType="String">
select max(substring(manufacturing_checkout_code,9)) from quality_manufacturing_checkout where manufacturing_checkout_code like concat(#{prefix},'%')
</select>
</mapper>

112
ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesUnqualifiedMapper.xml

@ -0,0 +1,112 @@
<?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.QualityRefundsExchangesUnqualifiedMapper">
<resultMap type="QualityRefundsExchangesUnqualified" id="QualityRefundsExchangesUnqualifiedResult">
<result property="refundsExchangesUnqualifiedId" column="refunds_exchanges_unqualified_id" />
<result property="refundsExchangesCode" column="refunds_exchanges_code" />
<result property="materialNo" column="material_no" />
<result property="materialName" column="material_name" />
<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="inspectionTime" column="inspection_time" />
<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="selectQualityRefundsExchangesUnqualifiedVo">
select refunds_exchanges_unqualified_id, refunds_exchanges_code, material_no, material_name, process_bad_classification, process_bad_grade, process_bad_num, unqualified_report_url, inspection_time, remark, create_by, create_time, update_by, update_time from quality_refunds_exchanges_unqualified
</sql>
<select id="selectQualityRefundsExchangesUnqualifiedList" parameterType="QualityRefundsExchangesUnqualified" resultMap="QualityRefundsExchangesUnqualifiedResult">
<include refid="selectQualityRefundsExchangesUnqualifiedVo"/>
<where>
</where>
</select>
<select id="selectQualityRefundsExchangesUnqualifiedById" parameterType="Long" resultMap="QualityRefundsExchangesUnqualifiedResult">
<include refid="selectQualityRefundsExchangesUnqualifiedVo"/>
where refunds_exchanges_unqualified_id = #{refundsExchangesUnqualifiedId}
</select>
<insert id="insertQualityRefundsExchangesUnqualified" parameterType="QualityRefundsExchangesUnqualified" useGeneratedKeys="true" keyProperty="refundsExchangesUnqualifiedId">
insert into quality_refunds_exchanges_unqualified
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="refundsExchangesCode != null">refunds_exchanges_code,</if>
<if test="materialNo != null">material_no,</if>
<if test="materialName != null">material_name,</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="inspectionTime != null">inspection_time,</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="materialNo != null">#{materialNo},</if>
<if test="materialName != null">#{materialName},</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="inspectionTime != null">#{inspectionTime},</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="updateQualityRefundsExchangesUnqualified" parameterType="QualityRefundsExchangesUnqualified">
update quality_refunds_exchanges_unqualified
<trim prefix="SET" suffixOverrides=",">
<if test="refundsExchangesCode != null">refunds_exchanges_code = #{refundsExchangesCode},</if>
<if test="materialNo != null">material_no = #{materialNo},</if>
<if test="materialName != null">material_name = #{materialName},</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="inspectionTime != null">inspection_time = #{inspectionTime},</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 refunds_exchanges_unqualified_id = #{refundsExchangesUnqualifiedId}
</update>
<delete id="deleteQualityRefundsExchangesUnqualifiedById" parameterType="Long">
delete from quality_refunds_exchanges_unqualified where refunds_exchanges_unqualified_id = #{refundsExchangesUnqualifiedId}
</delete>
<delete id="deleteQualityRefundsExchangesUnqualifiedByIds" parameterType="String">
delete from quality_refunds_exchanges_unqualified where refunds_exchanges_unqualified_id in
<foreach item="refundsExchangesUnqualifiedId" collection="array" open="(" separator="," close=")">
#{refundsExchangesUnqualifiedId}
</foreach>
</delete>
<update id="cancelQualityRefundsExchangesUnqualifiedById" parameterType="Long">
update quality_refunds_exchanges_unqualified set del_flag = '1' where refunds_exchanges_unqualified_id = #{refundsExchangesUnqualifiedId}
</update>
<update id="restoreQualityRefundsExchangesUnqualifiedById" parameterType="Long">
update quality_refunds_exchanges_unqualified set del_flag = '0' where refunds_exchanges_unqualified_id = #{refundsExchangesUnqualifiedId}
</update>
</mapper>

251
ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/add.html

@ -7,68 +7,6 @@
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-refundsExchanges-add">
<div class="form-group">
<label class="col-sm-3 control-label">退换货单号:</label>
<div class="col-sm-8">
<input name="refundsExchangesCode" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">退换货状态:</label>
<div class="col-sm-8">
<select name="refundsExchangesStatus" class="form-control m-b" th:with="type=${@dict.getType('refunds_exchanges_status')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">仓库状态:</label>
<div class="col-sm-8">
<select name="qualityWarehouseStatus" class="form-control m-b" th:with="type=${@dict.getType('quality_warehouse_status')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">采购状态:</label>
<div class="col-sm-8">
<select name="qualityPurchaseStatus" class="form-control m-b" th:with="type=${@dict.getType('quality_purchase_status')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联订单号:</label>
<div class="col-sm-8">
<input name="relatedOrderCode" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">入库单号:</label>
<div class="col-sm-8">
<input name="inStorageCode" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">退货节点:</label>
<div class="col-sm-8">
<select name="qualityReturnNode" class="form-control m-b" th:with="type=${@dict.getType('quality_return_node')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料数合计:</label>
<div class="col-sm-8">
<input name="materialTotal" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">数量合计:</label>
<div class="col-sm-8">
<input name="numTotal" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交付质检时间:</label>
<div class="col-sm-8">
@ -84,26 +22,73 @@
<input name="qualityRemark" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" class="form-control" type="text">
</form>
<div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span>选择物料</span>
<a class="btn btn-success" onclick="insertRow()">
<i class="fa fa-plus"></i> 选择物料
</a>
</div>
</div>
</form>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<!--用于可以修改列表字段的插件-->
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript">
var prefix = ctx + "quality/refundsExchanges"
$("#form-refundsExchanges-add").validate({
focusCleanup: true
});
// 新增提交
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-refundsExchanges-add').serialize());
// 获取表单数据
const refundsExchangesData = $("#form-refundsExchanges-add").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据
var table = $('#bootstrap-table').bootstrapTable('getData');
// 检查表格数据是否为空
if (table.length===0){
$.modal.alertWarning("请至少添加一条物料数据后再保存!");
return;
}
console.log(table);
// 将表数据转换成与complaintNoticeData格式一致的数组
var materialDataList = table.map(function(item) {
// 根据实际字段名调整
return {
"materialNo": item.materialNo, // 假设id对应materialId
"materialPhotourl": item.materialPhotourl, // 假设quantity是物料数量字段
"materialName": item.materialName,
"materialType": item.materialType,
"materialDescribe": item.materialDescribe,
"materialUnit": item.materialUnit,
"materialBrand": item.materialBrand,
"materialProcessMethod":item.materialProcessMethod,
"refundsExchangesNum":item.refundsExchangesNum
// ...其他字段
};
});
const combinedData = Object.assign({}, refundsExchangesData, { refundsExchangesDetails: materialDataList });
// 合并表单数据和表格数据
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/add", jsonData);
}
$("input[name='deliveryInspectionTime']").datetimepicker({
@ -111,6 +96,134 @@
minView: "month",
autoclose: true
});
//物料信息展示列表
$(function() {
var options = {
modalName: "选择物料",
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
columns: [{
checkbox: true
},
{
title: '料号',
field: 'materialNo',
},
{
title: '图片',
field: 'materialPhotourl',
},
{
title: '物料名称',
field: 'materialName',
},
{
title: '物料类型',
field: 'materialType',
},
{
title: '描述',
field: 'materialDescribe',
},
{
title: '品牌',
field: 'materialBrand',
},
{
title: '单位',
field: 'materialUnit',
},
{
title: '物料加工方式',
field: 'materialProcessMethod',
},
{
title: '品质报告',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="checkoutReport(\'' + row.materialNo + '\')"><i class="fa fa-plus"></i>报告</a> ');
return actions.join('');
}
},
{
title: '退换数',
field: 'refundsExchangesNum',
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.materialNo + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
}
]
};
$.table.init(options);
})
/*选择物料按钮*/
function insertRow() {
var url = ctx + 'quality/refundsExchanges/materialSelect';
var options = {
title: '选择物料',
url: url,
callBack: doSubmit
};
$.modal.openOptions(options);
}
function doSubmit(index, layero,uniqueId){
console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-materialSelect-table').bootstrapTable('getSelections')[0];
console.log("rowData: "+rowData);
$("#bootstrap-table").bootstrapTable('insertRow', {
index:1,
row: {
materialNo:rowData.materialNo,
materialPhotourl:rowData.materialPhotourl,
materialName: rowData.materialName,
materialType: rowData.materialType,
materialDescribe: rowData.materialDescribe,
materialBrand: rowData.materialBrand,
materialUnit: rowData.materialUnit,
materialProcessMethod: rowData.materialProcessMethod,
makeTotal:rowData.makeTotal
}
})
layer.close(index);
}
// 逻辑删除前端的一行数据
function removeRow(materialNo){
$("#bootstrap-table").bootstrapTable('remove', {
field: 'materialNo',
values: materialNo
})
}
/*品质报告*/
function qualityReport(materialNo, supplierCode) {
var queryParams = new URLSearchParams();
queryParams.append('materialNo', materialNo);
queryParams.append('supplierCode', encodeURIComponent(supplierCode));
var url = ctx + 'quality/qualityOrder/qualityReport?' + queryParams.toString();
$.modal.open("品质报告", url);
}
</script>
</body>
</html>

70
ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/materialSelect.html

@ -0,0 +1,70 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('选择物料信息列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-materialSelect-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "quality/refundsExchanges";
// 从后端拿到传入的makeNo
var makeNo = /*[[${makeNo}]]*/ '';
$(function() {
var options = {
id: 'bootstrap-materialSelect-table',
clickToSelect: true, // 点击选中行
singleSelect: true, // 单选
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
url: prefix + "/getAllMaterial",
modalName: "物料信息",
columns: [{
checkbox: true
},
{
title: '料号',
field: 'materialNo',
},
{
title: '图片',
field: 'materialPhotourl',
},
{
title: '物料名称',
field: 'materialName',
},
{
title: '类型',
field: 'materialType',
},
{
title: '描述',
field: 'materialDescribe',
},
{
title: '品牌',
field: 'materialBrand',
},
{
title: '单位',
field: 'materialUnit',
},
]
};
$.table.init(options);
});
</script>
</body>
</html>

258
ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/qualityOrderReport.html

@ -0,0 +1,258 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改品质管理退换货报告')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-qualityOrderReport-edit" th:object="${QualityRefundsExchangesUnqualified}">
<input name="materialNo" th:field="*{materialNo}" type="hidden">
<div class="container">
<!--不合格数-->
<div class="col-sm-12">
<div class="row">
<div class="col-sm-12 d-flex align-items-center">
<span style="font-weight: bold; font-family: Arial, sans-serif; font-size: 15px;">不合格数</span>
<a class="btn btn-success ml-auto" onclick="addUnqualified()">
<i class="fa fa-plus"></i> 添加
</a>
</div>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-unqualified-table"></table>
</div>
</div>
</div>
</div>
<!--其他字段-->
<div class="form-group">
<label class="col-sm-4 control-label">检验完成时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="inspectionTime" th:value="${#dates.format(QualityRefundsExchangesUnqualified.inspectionTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" th:field="*{remark}" class="form-control" type="text"></textarea>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-table-editable-js"/>
<script th:inline="javascript">
var processBadClassificationDatas = [[${@dict.getType('process_bad_classification')}]];
var processBadGradeDatas = [[${@dict.getType('process_bad_grade')}]];
var $table = $("#bootstrap-unqualified-table");
var prefix = ctx + "quality/qualityOrder";
$("#form-qualityOrderReport-edit").validate({
focusCleanup: true
});
function submitHandler() {
// 获取表单数据
const qualityReportData = $("#form-qualityOrderReport-edit").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据
var table = $('#bootstrap-unqualified-table').bootstrapTable('getData');
// 检查表格数据是否为空
if (table.length===0){
$.modal.alertWarning("请至少添加一条不合格数再保存!");
return;
}
console.log(JSON.stringify(table));
// 将表数据转换成与qualityReportData格式一致的数组
var unqualifiedDataList = table.map(function(item) {
// 根据实际字段名调整
return {
"processBadClassification": item.processBadClassification,
"processBadGrade": item.processBadGrade,
"processBadNum": item.processBadNum,
"unqualifiedReportUrl": item.unqualifiedReportUrl
// ...其他字段
};
});
const combinedData = Object.assign({}, qualityReportData, { unqualifiedDataList: unqualifiedDataList });
// 合并表单数据和表格数据
// const combinedData = Object.assign({}, ...complaintNoticeData.array(item => ({ [item.name]: item.value })), ...materialData);
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/qualityReport", jsonData);
}
$("input[name='inspectionTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
//添加不合格数
function addUnqualified() {
// 生成一个简单的唯一标识,这里使用时间戳作为示例
var uniqueId = new Date().getTime();
// 创建一个新行数据模板,这里仅为示例,具体根据表格列来定义
var newRow = {
qualityOrderReportId:uniqueId,
processBadClassification: "",
processBadGrade: "",
processBadNum: "",
unqualifiedReportUrl: ""
};
// 使用Bootstrap Table的API插入新行
$('#bootstrap-unqualified-table').bootstrapTable('append', newRow);
}
//收款凭证table列表
$(function() {
var options = {
id:"bootstrap-unqualified-table",
modalName: "收款凭证",
showColumns: false,
pagination: false,
showToggle: false,
showRefresh:false,
showSearch:false,
singleSelect:true,
columns: [{
checkbox: false
},
{
title: '品质报告单id',
field: 'qualityOrderReportId',
visible: false
},
{title: '不良分类',field: 'processBadClassification',
formatter:function (value, row, index) {
return processBadClassificationFormatter(value,row,index);
}
},
{title: '不良等级',field: 'processBadGrade',
formatter:function (value, row, index) {
return processBadGradeFormatter(value,row,index);
}
},
{
title: '数量',
field: 'processBadNum',
editable:{
type: 'text',
mode:'inline',
validate: function (v) {
if (!v) return '数量不能为空';
if (isNaN(v)) return '数量必须是数字';
var processBadNum = parseInt(v);
if (processBadNum <= 0) return '数量必须是正整数';
}
}
},
{
title: '报告',
field: 'unqualifiedReportUrl',
editable: {
mode:'inline',
type: 'text', // 表示该列可以被编辑为文本
},
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.qualityOrderReportId + '\')"><i class="fa fa-remove"></i>删除</a> ');
return actions.join('');
}
}
]
};
$.table.init(options);
});
// 逻辑删除不合格数前端的一行数据
function removeRow(qualityOrderReportId){
console.log(qualityOrderReportId);
// 直接使用 receivablesRecordsId 值进行删除操作
$("#bootstrap-unqualified-table").bootstrapTable('remove', {
field: 'qualityOrderReportId',
values: qualityOrderReportId
});
}
// 列中获取不良分类的下拉改变数据
function onProcessBadClassification(selectElement, rowIndex) {
var processBadClassificationValue = $(selectElement).val();
var tableData = $table.bootstrapTable('getData');
var newRow = tableData[rowIndex]; // 获取当前行数据
// 重新渲染成本小类的设备名称列
// 更新行数据
newRow.processBadClassification = processBadClassificationValue;
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
}
// 自定义不良分类的格式化函数
function processBadClassificationFormatter(value, row, index) {
var selectHtml = '<select class="form-control" onchange="onProcessBadClassification(this, ' + index + ')">';
// 添加默认选项
selectHtml += '<option value=""' + (value === undefined || value === '' ? ' selected' : '') + '>所有</option>';
processBadClassificationDatas.forEach(function (child) {
selectHtml += '<option value="' + child.dictValue + '"' + (value === child.dictValue ? ' selected' : '') + '>' + child.dictLabel + '</option>';
});
selectHtml += '</select>';
return selectHtml;
}
// 列中获取不良等级的下拉改变数据
function onProcessBadGrade(selectElement, rowIndex) {
var processBadGradeValue = $(selectElement).val();
var tableData = $table.bootstrapTable('getData');
var newRow = tableData[rowIndex]; // 获取当前行数据
// 重新渲染成本小类的设备名称列
// 更新行数据
newRow.processBadGrade = processBadGradeValue;
$table.bootstrapTable('updateRow', {index: rowIndex, row: newRow});
}
// 自定义不良等级的格式化函数
function processBadGradeFormatter(value, row, index) {
var selectHtml = '<select class="form-control" onchange="onProcessBadGrade(this, ' + index + ')">';
// 添加默认选项
selectHtml += '<option value=""' + (value === undefined || value === '' ? ' selected' : '') + '>所有</option>';
processBadGradeDatas.forEach(function (child) {
selectHtml += '<option value="' + child.dictValue + '"' + (value === child.dictValue ? ' selected' : '') + '>' + child.dictLabel + '</option>';
});
selectHtml += '</select>';
return selectHtml;
}
</script>
</body>
</html>

20
ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/refundsExchanges.html

@ -65,13 +65,7 @@
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="quality:refundsExchanges:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="quality:refundsExchanges:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="quality:refundsExchanges:remove">
<i class="fa fa-remove"></i> 删除
<i class="fa fa-plus"></i> 添加退货单
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="quality:refundsExchanges:export">
<i class="fa fa-download"></i> 导出
@ -85,9 +79,6 @@
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('quality:refundsExchanges:edit')}]];
var removeFlag = [[${@permission.hasPermi('quality:refundsExchanges:remove')}]];
var cancelFlag = [[${@permission.hasPermi('quality:refundsExchanges:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('quality:refundsExchanges:restore')}]];
var refundsExchangesStatusDatas = [[${@dict.getType('refunds_exchanges_status')}]];
var qualityWarehouseStatusDatas = [[${@dict.getType('quality_warehouse_status')}]];
var qualityPurchaseStatusDatas = [[${@dict.getType('quality_purchase_status')}]];
@ -99,9 +90,6 @@
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
cancelUrl: prefix + "/cancel/{id}",
restoreUrl: prefix + "/restore/{id}",
exportUrl: prefix + "/export",
modalName: "品质管理退换货单",
columns: [{
@ -194,12 +182,6 @@
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.refundsExchangesId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.refundsExchangesId + '\')"><i class="fa fa-remove"></i>删除</a> ');
if(row.delFlag == '0'){
actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + '" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i>作废</a> ');
}else{
actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i>恢复</a> ');
}
return actions.join('');
}
}]

Loading…
Cancel
Save