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 f34df9e6..c42a71ab 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 @@ -352,4 +352,43 @@ public class QualityRefundsExchangesController extends BaseController return toAjax(qualityRefundsExchangesService.returnBeforeStorageDetail(qualityRefundsExchanges)); } + + + + /** + * 入库后退货-选择供应商-无供应商 + */ + @GetMapping("/afterNoConfirmSupplier/{refundsExchangesId}") + public String afterNoConfirmSupplier(@PathVariable("refundsExchangesId") Long refundsExchangesId, ModelMap mmap) + { + QualityRefundsExchanges qualityRefundsExchanges = qualityRefundsExchangesService.selectQualityRefundsExchangesById(refundsExchangesId); + mmap.put("qualityRefundsExchanges", qualityRefundsExchanges); + return prefix + "/afterNoConfirmSupplier"; + } + + /** + * 保存入库后退货-选择供应商-无供应商 + */ + @RequiresPermissions("quality:refundsExchanges:afterNoConfirmSupplier") + @Log(title = "品质管理退换货单", businessType = BusinessType.UPDATE) + @PostMapping("/afterNoConfirmSupplier") + @ResponseBody + public AjaxResult afterNoConfirmSupplierSave(@RequestBody QualityRefundsExchanges qualityRefundsExchanges) + { + return toAjax(qualityRefundsExchangesService.updateAfterNoConfirmSupplier(qualityRefundsExchanges)); + } + + /** + * 入库后退货-选择供应商-无供应商 物料列表信息 + * */ + @ResponseBody + @PostMapping("/getAfterMaterialListByCode") + public TableDataInfo getAfterMaterialListByCode(QualityRefundsExchanges qualityRefundsExchanges){ + startPage(); + List list = refundsExchangesDetailService.selectRefundsExchangesDetailListByCode(qualityRefundsExchanges.getRefundsExchangesCode()); + return getDataTable(list); + } + + + } 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 index 9cb117bf..21e87de8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchangesDetail.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchangesDetail.java @@ -114,7 +114,12 @@ public class QualityRefundsExchangesDetail extends BaseEntity /** 退换货数 */ @Excel(name = "退换货数") - private Long refundsExchangesNum; + private Integer refundsExchangesNum; + + /** 品质不合格数 */ + @Excel(name = "品质不合格数") + private Integer qualityUnqualifiedNum; + /** 交付质检时间 */ @JsonFormat(pattern = "yyyy-MM-dd") @@ -295,16 +300,24 @@ public class QualityRefundsExchangesDetail extends BaseEntity { return materialProcessMethod; } - public void setRefundsExchangesNum(Long refundsExchangesNum) - { + + public Integer getRefundsExchangesNum() { + return refundsExchangesNum; + } + + public void setRefundsExchangesNum(Integer refundsExchangesNum) { this.refundsExchangesNum = refundsExchangesNum; } - public Long getRefundsExchangesNum() - { - return refundsExchangesNum; + public Integer getQualityUnqualifiedNum() { + return qualityUnqualifiedNum; } - public void setDeliveryInspectionTime(Date deliveryInspectionTime) + + public void setQualityUnqualifiedNum(Integer qualityUnqualifiedNum) { + this.qualityUnqualifiedNum = qualityUnqualifiedNum; + } + + public void setDeliveryInspectionTime(Date deliveryInspectionTime) { this.deliveryInspectionTime = deliveryInspectionTime; } @@ -407,6 +420,7 @@ public class QualityRefundsExchangesDetail extends BaseEntity .append("materialDescribe", getMaterialDescribe()) .append("materialProcessMethod", getMaterialProcessMethod()) .append("refundsExchangesNum", getRefundsExchangesNum()) + .append("qualityUnqualifiedNum",getQualityUnqualifiedNum()) .append("deliveryInspectionTime", getDeliveryInspectionTime()) .append("inspectionTime", getInspectionTime()) .append("qualityRemark", getQualityRemark()) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesService.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesService.java index da4082d8..410365e1 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesService.java @@ -78,4 +78,10 @@ public interface IQualityRefundsExchangesService /*入库前退换货详情*/ int returnBeforeStorageDetail(QualityRefundsExchanges qualityRefundsExchanges); + + + /** + * 保存入库后退货-选择供应商-无供应商 + */ + int updateAfterNoConfirmSupplier(QualityRefundsExchanges qualityRefundsExchanges); } 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 67310eb2..e82dc68d 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 @@ -18,6 +18,7 @@ import com.ruoyi.quality.mapper.QualityRefundsExchangesMapper; import com.ruoyi.quality.domain.QualityRefundsExchanges; import com.ruoyi.quality.service.IQualityRefundsExchangesService; import com.ruoyi.common.core.text.Convert; +import org.springframework.transaction.annotation.Transactional; /** * 品质管理退换货单Service业务层处理 @@ -180,6 +181,39 @@ public class QualityRefundsExchangesServiceImpl implements IQualityRefundsExchan return 1; } + /** + * 保存入库后退货-选择供应商-无供应商 + */ + @Transactional + @Override + public int updateAfterNoConfirmSupplier(QualityRefundsExchanges qualityRefundsExchanges) { + String loginName = ShiroUtils.getLoginName(); + List refundsExchangesDetails = qualityRefundsExchanges.getRefundsExchangesDetails(); + if (StringUtils.isEmpty(refundsExchangesDetails)){ + log.warn("退款换货单[{}]无关联的物料详情信息", qualityRefundsExchanges.getRefundsExchangesCode()); + } + + int updateRows = 0; + for (QualityRefundsExchangesDetail refundsExchangesDetail : refundsExchangesDetails) { + refundsExchangesDetail.setRefundsExchangesCode(qualityRefundsExchanges.getRefundsExchangesCode()); + refundsExchangesDetail.setDeliveryInspectionTime(qualityRefundsExchanges.getDeliveryInspectionTime()); + refundsExchangesDetail.setQualityRemark(qualityRefundsExchanges.getQualityRemark()); +// refundsExchangesDetail.setSupplierCode(tempRefundsExchangesDetail.getSupplierCode()); +// refundsExchangesDetail.setSupplierName(tempRefundsExchangesDetail.getSupplierName()); +// refundsExchangesDetail.setCustomerContact(tempRefundsExchangesDetail.getCustomerContact()); +// refundsExchangesDetail.setContactNumber(tempRefundsExchangesDetail.getContactNumber()); +// refundsExchangesDetail.setSupplierAddress(tempRefundsExchangesDetail.getSupplierAddress()); +// refundsExchangesDetail.setQualityUnqualifiedNum(tempRefundsExchangesDetail.getQualityUnqualifiedNum()); + refundsExchangesDetail.setUpdateBy(loginName); + refundsExchangesDetail.setUpdateTime(new Date()); + + //更新数据库记录 + updateRows += refundsExchangesDetailMapper.updateQualityRefundsExchangesDetail(refundsExchangesDetail); + + } + return updateRows; + } + /** *退换货单号: diff --git a/ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesDetailMapper.xml b/ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesDetailMapper.xml index 2ab29598..18a547ba 100644 --- a/ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesDetailMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesDetailMapper.xml @@ -29,6 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -40,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - 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, supplier_code, supplier_name, customer_contact, contact_number, supplier_address, material_no, material_name, material_type, material_photoUrl, material_brand, material_unit, material_describe, material_process_method, refunds_exchanges_num, delivery_inspection_time, inspection_time ,quality_remark, remark, create_by, create_time, update_by, update_time from quality_refunds_exchanges_detail + 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, supplier_code, supplier_name, customer_contact, contact_number, supplier_address, material_no, material_name, material_type, material_photoUrl, material_brand, material_unit, material_describe, material_process_method, refunds_exchanges_num, quality_unqualified_num ,delivery_inspection_time, inspection_time ,quality_remark, remark, create_by, create_time, update_by, update_time from quality_refunds_exchanges_detail + + +
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+
+
+
+ + + + + + + \ 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 871e1231..c6865a8c 100644 --- a/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/refundsExchanges.html +++ b/ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/refundsExchanges.html @@ -85,7 +85,7 @@ var returnAfterStorageDetailFlag = [[${@permission.hasPermi('quality:refundsExchanges:returnAfterStorageDetail')}]]; var beforeHasConfirmSupplierFlag = [[${@permission.hasPermi('quality:refundsExchanges:beforeHasConfirmSupplier')}]]; - + var afterNoConfirmSupplierFlag = [[${@permission.hasPermi('quality:refundsExchanges:afterNoConfirmSupplier')}]]; var refundsExchangesStatusDatas = [[${@dict.getType('refunds_exchanges_status')}]]; var qualityWarehouseStatusDatas = [[${@dict.getType('quality_warehouse_status')}]]; @@ -206,6 +206,11 @@ actions.push('确认供应商 '); } + /*入库后退货-确认供应商-没有供应商*/ + if (row.qualityReturnNode == 1){ + actions.push('确认供应商 '); + } + return actions.join(''); } }] @@ -253,12 +258,18 @@ }; - /*入库前退货-确认供应商-已经-有供应商*/ + /*入库前退货-确认供应商-已经有供应商*/ function beforeHasConfirmSupplier(refundsExchangesId){ var url = ctx + 'quality/refundsExchanges/beforeHasConfirmSupplier/' + refundsExchangesId; $.modal.open("确认供应商",url); } + /*入库后退货-确认供应商-没有供应商*/ + function afterNoConfirmSupplier(refundsExchangesId){ + var url = ctx + 'quality/refundsExchanges/afterNoConfirmSupplier/' + refundsExchangesId; + $.modal.open("确认供应商",url); + } + \ No newline at end of file