diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpMaterialMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpMaterialMapper.java index 3431b774..d7902847 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpMaterialMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpMaterialMapper.java @@ -97,4 +97,12 @@ public interface ErpMaterialMapper * 批量查找物料信息 */ List selectErpMaterialByIds(String[] ids); + + /** + * 查询所有物料信息列表 + * + * @return 物料信息集合 + */ + List selectAllErpMaterialList(); + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java index 97740569..c849aa3e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java @@ -31,6 +31,15 @@ public interface IErpMaterialService */ public List selectErpMaterialList(ErpMaterialVo erpMaterialVo); + + /** + * 查询所有物料信息列表 + * + * @return 物料信息集合 + */ + public List selectAllErpMaterialList(); + + /** * 新增物料信息 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java index bc35da27..50ac90cd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java +++ b/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 selectAllErpMaterialList() { + + List erpMaterialVos = erpMaterialMapper.selectAllErpMaterialList(); + return erpMaterialVos; + } + /** * 新增物料信息 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityRefundsExchangesController.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityRefundsExchangesController.java index 1995bf1f..e57be105 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityRefundsExchangesController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityRefundsExchangesController.java @@ -1,15 +1,16 @@ 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.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 +35,9 @@ public class QualityRefundsExchangesController extends BaseController @Autowired private IQualityRefundsExchangesService qualityRefundsExchangesService; + @Autowired + private IErpMaterialService erpMaterialService; + @RequiresPermissions("quality:refundsExchanges:view") @GetMapping() public String refundsExchanges() @@ -84,7 +88,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,40 +116,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 erpMaterialVos = erpMaterialService.selectAllErpMaterialList(); + return getDataTable(erpMaterialVos); } - } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchanges.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchanges.java index 4d61e8b2..672feaf1 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchanges.java +++ b/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 refundsExchangesDetails; + public void setRefundsExchangesId(Long refundsExchangesId) { this.refundsExchangesId = refundsExchangesId; @@ -174,6 +180,14 @@ public class QualityRefundsExchanges extends BaseEntity return qualityRemark; } + public List getRefundsExchangesDetails() { + return refundsExchangesDetails; + } + + public void setRefundsExchangesDetails(List 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(); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchangesDetail.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchangesDetail.java new file mode 100644 index 00000000..0f75ed65 --- /dev/null +++ b/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(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityRefundsExchangesDetailMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityRefundsExchangesDetailMapper.java new file mode 100644 index 00000000..d76accdc --- /dev/null +++ b/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 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); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityRefundsExchangesMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityRefundsExchangesMapper.java index 92807dee..593e76a1 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityRefundsExchangesMapper.java +++ b/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); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesDetailService.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesDetailService.java new file mode 100644 index 00000000..55eee25e --- /dev/null +++ b/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 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); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesDetailServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesDetailServiceImpl.java new file mode 100644 index 00000000..e008cf5c --- /dev/null +++ b/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 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); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesServiceImpl.java index 6084f386..31862ddd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesServiceImpl.java +++ b/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 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】, + *自增长,如:THH20231111001,THH20231111002 + * + */ + private String generateNewCode(String prefix, String maxCode) { + if (StringUtils.isEmpty(maxCode)){ + return prefix + "001"; + } + + int sequence = Integer.parseInt(maxCode.substring(4)) + 1; + if (sequence > 999){ + throw new BusinessException("当日编号已达到最大值999,请检查或调整策略。"); + } + + //格式化数据 + DecimalFormat df = new DecimalFormat("000"); + return prefix+df.format(sequence); + } } diff --git a/ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml b/ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml index 7fe89b5c..4ef8bdf7 100644 --- a/ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml @@ -151,6 +151,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + insert into erp_material diff --git a/ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesDetailMapper.xml b/ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesDetailMapper.xml new file mode 100644 index 00000000..0ed8e0eb --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesDetailMapper.xml @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + insert into quality_refunds_exchanges_detail + + 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, + + + #{refundsExchangesCode}, + #{refundsExchangesStatus}, + #{qualityWarehouseStatus}, + #{qualityPurchaseStatus}, + #{relatedOrderCode}, + #{inStorageCode}, + #{qualityReturnNode}, + #{materialTotal}, + #{numTotal}, + #{materialNo}, + #{materialName}, + #{materialType}, + #{materialPhotourl}, + #{materialBrand}, + #{materialUnit}, + #{materialDescribe}, + #{materialProcessMethod}, + #{refundsExchangesNum}, + #{deliveryInspectionTime}, + #{qualityRemark}, + #{remark}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update quality_refunds_exchanges_detail + + refunds_exchanges_code = #{refundsExchangesCode}, + refunds_exchanges_status = #{refundsExchangesStatus}, + quality_warehouse_status = #{qualityWarehouseStatus}, + quality_purchase_status = #{qualityPurchaseStatus}, + related_order_code = #{relatedOrderCode}, + in_storage_code = #{inStorageCode}, + quality_return_node = #{qualityReturnNode}, + material_total = #{materialTotal}, + num_total = #{numTotal}, + material_no = #{materialNo}, + material_name = #{materialName}, + material_type = #{materialType}, + material_photoUrl = #{materialPhotourl}, + material_brand = #{materialBrand}, + material_unit = #{materialUnit}, + material_describe = #{materialDescribe}, + material_process_method = #{materialProcessMethod}, + refunds_exchanges_num = #{refundsExchangesNum}, + delivery_inspection_time = #{deliveryInspectionTime}, + quality_remark = #{qualityRemark}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where refunds_exchanges_detail_id = #{refundsExchangesDetailId} + + + + delete from quality_refunds_exchanges_detail where refunds_exchanges_detail_id = #{refundsExchangesDetailId} + + + + delete from quality_refunds_exchanges_detail where refunds_exchanges_detail_id in + + #{refundsExchangesDetailId} + + + + + update quality_refunds_exchanges_detail set del_flag = '1' where refunds_exchanges_detail_id = #{refundsExchangesDetailId} + + + + update quality_refunds_exchanges_detail set del_flag = '0' where refunds_exchanges_detail_id = #{refundsExchangesDetailId} + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesMapper.xml b/ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesMapper.xml index 166299cc..58d25f11 100644 --- a/ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesMapper.xml +++ b/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} + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/add.html b/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/add.html index 3a338908..a3b4a6a5 100644 --- a/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/add.html +++ b/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/add.html @@ -7,68 +7,6 @@
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
@@ -84,26 +22,73 @@
-
- -
- + +
+
+
+ 选择物料 + + 选择物料 +
- +
+
+
+
+
+
+ + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/materialSelect.html b/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/materialSelect.html new file mode 100644 index 00000000..f6fa0d67 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/materialSelect.html @@ -0,0 +1,70 @@ + + + + + + +
+
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/refundsExchanges.html b/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/refundsExchanges.html index 3a72f1ae..5ea44599 100644 --- a/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/refundsExchanges.html +++ b/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/refundsExchanges.html @@ -65,13 +65,7 @@
- 添加 - - - 修改 - - - 删除 + 添加退货单 导出 @@ -85,9 +79,6 @@