diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpInboundOrder.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpInboundOrder.java index 94565d3d..ca434aaa 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpInboundOrder.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpInboundOrder.java @@ -32,6 +32,9 @@ public class ErpInboundOrder extends BaseEntity @Excel(name = "生产订单号") private String makeNo; + /** 销售订单物料号 */ + private String salesOrderMaterialNo; + /** 品质状态(0待品质、1部分品质、全部品质) */ @Excel(name = "品质状态(0待品质、1部分品质、全部品质)") private String qualityStatus; @@ -137,6 +140,15 @@ public class ErpInboundOrder extends BaseEntity { return makeNo; } + + public String getSalesOrderMaterialNo() { + return salesOrderMaterialNo; + } + + public void setSalesOrderMaterialNo(String salesOrderMaterialNo) { + this.salesOrderMaterialNo = salesOrderMaterialNo; + } + public void setQualityStatus(String qualityStatus) { this.qualityStatus = qualityStatus; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpInboundOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpInboundOrderServiceImpl.java index 2553db35..cbb79d7e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpInboundOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpInboundOrderServiceImpl.java @@ -1,12 +1,15 @@ package com.ruoyi.erp.service.impl; +import java.util.Date; import java.util.List; +import java.util.stream.Collectors; import cn.hutool.core.collection.CollectionUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.TypeReference; import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.exception.BusinessException; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.StringUtils; @@ -14,7 +17,20 @@ import com.ruoyi.erp.domain.ErpEquipmentResume; import com.ruoyi.erp.domain.ErpInboundOrderDetail; import com.ruoyi.erp.service.IErpEquipmentResumeService; import com.ruoyi.erp.service.IErpInboundOrderDetailService; +import com.ruoyi.quality.domain.QualityOrder; +import com.ruoyi.quality.domain.QualityOrderDetail; +import com.ruoyi.quality.domain.QualityOrderReport; +import com.ruoyi.quality.domain.QualityOrderReportUnqualified; +import com.ruoyi.quality.mapper.QualityOrderDetailMapper; +import com.ruoyi.quality.mapper.QualityOrderMapper; +import com.ruoyi.quality.mapper.QualityOrderReportMapper; +import com.ruoyi.quality.mapper.QualityOrderReportUnqualifiedMapper; +import com.ruoyi.system.domain.SysMakeorderBom; import com.ruoyi.system.domain.SysMakeorderPickDetail; +import com.ruoyi.system.domain.SysSalesOrderChild; +import com.ruoyi.system.mapper.SysMakeorderBomMapper; +import com.ruoyi.system.mapper.SysSalesOrderChildMapper; +import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.erp.mapper.ErpInboundOrderMapper; @@ -22,6 +38,7 @@ import com.ruoyi.erp.domain.ErpInboundOrder; import com.ruoyi.erp.service.IErpInboundOrderService; import com.ruoyi.common.core.text.Convert; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; /** * 入库单Service业务层处理 @@ -44,6 +61,24 @@ public class ErpInboundOrderServiceImpl implements IErpInboundOrderService @Autowired private IErpEquipmentResumeService erpEquipmentResumeService; + @Autowired + private QualityOrderMapper qualityOrderMapper; + + @Autowired + private QualityOrderDetailMapper qualityOrderDetailMapper; + + @Autowired + private QualityOrderReportMapper qualityOrderReportMapper; + + @Autowired + private QualityOrderReportUnqualifiedMapper orderReportUnqualifiedMapper; + + @Autowired + private SysSalesOrderChildMapper salesOrderChildMapper; + + @Autowired + private SysMakeorderBomMapper makeorderBomMapper; + /** * 查询入库单 * @@ -69,44 +104,129 @@ public class ErpInboundOrderServiceImpl implements IErpInboundOrderService } /** - * 新增入库单 + * 生产订单新增委内加工入库单(先品质) * - * @param erpInboundOrder 入库单 + * @param erpInboundOrder 委内加工入库单 * @return 结果 */ @Override @Transactional(rollbackFor = Exception.class) public int insertErpInboundOrder(ErpInboundOrder erpInboundOrder) { + + QualityOrder qualityOrder = new QualityOrder(); String loginName = ShiroUtils.getLoginName(); erpInboundOrder.setCreateBy(loginName); erpInboundOrder.setCreateTime(DateUtils.getNowDate()); // 生成编号,年月日规则 - String billNo = redisCache.generateBillNo("RK"); - erpInboundOrder.setInboundOrderNo(billNo); - int id = erpInboundOrderMapper.insertErpInboundOrder(erpInboundOrder); + String qualityOrderCode = redisCache.generateBillNo("PZ"); + qualityOrder.setQualityOrderCode(qualityOrderCode); + //设置关联单号 + qualityOrder.setRelatedOrderCode(erpInboundOrder.getMakeNo()); + //设置为待品质 + qualityOrder.setQualityStatus("0"); + //设置为委内入库 + qualityOrder.setQualityStorageStatus("1"); + //设置订单类型 + qualityOrder.setQualityOrderType("1"); + qualityOrder.setCreateTime(new Date()); + qualityOrder.setCreateBy(loginName); + + List sysMakeorderBoms = erpInboundOrder.getInboundDetails().stream() + .map(ErpInboundOrderDetail::getMakeorderBomId) + .map(this::getSysMakeorderBomById) + .collect(Collectors.toList()); + + //添加委内加工品质单详情数据 + addQualityOrderDetail(erpInboundOrder,qualityOrderCode,sysMakeorderBoms); + //添加委内加工品质单报告数据 + addQualityOrderReport(erpInboundOrder,qualityOrderCode,sysMakeorderBoms); + + //插入品质单 + return qualityOrderMapper.insertQualityOrder(qualityOrder); + } + + // 提取公共方法 + private SysMakeorderBom getSysMakeorderBomById(Long makeorderBomId) { + return makeorderBomMapper.selectSysMakeorderBomById(makeorderBomId); + } + + //添加委内加工品质单报告数据 + private void addQualityOrderReport(ErpInboundOrder erpInboundOrder,String qualityOrderCode,List sysMakeorderBoms) { List inboundDetails = erpInboundOrder.getInboundDetails(); - if(CollectionUtil.isNotEmpty(inboundDetails)){ - // 插入子表 - for (int i = 0; i < inboundDetails.size(); i++) { - ErpInboundOrderDetail inboundOrderDetail = inboundDetails.get(i); - inboundOrderDetail.setInboundOrderNo(billNo); - inboundOrderDetailService.insertErpInboundOrderDetail(inboundOrderDetail); - String equipResumeArrayStr = inboundOrderDetail.getEquipResumeArrayStr(); - if(StringUtils.isNotBlank(equipResumeArrayStr)){ - List equipmentResumes = JSON.parseObject(equipResumeArrayStr, new TypeReference>(){}); - equipmentResumes.forEach(t->{ - t.setInboundOrderNo(billNo); - t.setMakeNo(erpInboundOrder.getMakeNo()); - t.setSaleNo(erpInboundOrder.getSaleNo()); - t.setMaterialNo(inboundOrderDetail.getMaterialNo()); - erpEquipmentResumeService.insertErpEquipmentResume(t); - }); + if (CollectionUtils.isEmpty(inboundDetails)) { + throw new BusinessException("委内加工详情数据为空"); + } + for (int i = 0; i < inboundDetails.size(); i++) { + ErpInboundOrderDetail inboundDetail = inboundDetails.get(i); + SysMakeorderBom sysMakeorderBom = sysMakeorderBoms.get(i); + QualityOrderReport qualityOrderReport = new QualityOrderReport(); + qualityOrderReport.setQualityOrderCode(qualityOrderCode); + qualityOrderReport.setMaterialNo(sysMakeorderBom.getMaterialNo()); + + QualityOrderReport tempQualityOrderReport = qualityOrderReportMapper.selectMakeInOrderReportByNoAndCode(qualityOrderReport); + if (tempQualityOrderReport != null){ + qualityOrderReport.setQualityOrderReportId(tempQualityOrderReport.getQualityOrderReportId()); + Long currentNum = inboundDetail.getCurrentNum(); + qualityOrderReport.setMakeInNum((int) (tempQualityOrderReport.getMakeInNum()+currentNum)); + int updateQualityOrderReportResult = qualityOrderReportMapper.updateQualityOrderReportById(qualityOrderReport); + if (updateQualityOrderReportResult <= 0){ + throw new BusinessException("更新品质单报告数据失败"); } + }else { + qualityOrderReport.setMaterialName(sysMakeorderBom.getMaterialName()); + //添加委内已完成数 + qualityOrderReport.setMakeInNum(Math.toIntExact(inboundDetail.getCurrentNum())); + qualityOrderReport.setCreateBy(ShiroUtils.getLoginName()); + qualityOrderReport.setCreateTime(new Date()); + qualityOrderReportMapper.insertQualityOrderReport(qualityOrderReport); } + + } + } - return id; + //添加委内加工品质单详情数据 + private void addQualityOrderDetail(ErpInboundOrder erpInboundOrder,String qualityOrderCode,List sysMakeorderBoms) { + List inboundDetails = erpInboundOrder.getInboundDetails(); + if (CollectionUtils.isEmpty(inboundDetails)) { + throw new BusinessException("委内加工详情数据为空"); + } + for (int i = 0; i < inboundDetails.size(); i++) { + ErpInboundOrderDetail inboundDetail = inboundDetails.get(i); + SysMakeorderBom sysMakeorderBom = sysMakeorderBoms.get(i); + + QualityOrderDetail qualityOrderDetail = new QualityOrderDetail(); + qualityOrderDetail.setMaterialNo(sysMakeorderBom.getMaterialNo()); + qualityOrderDetail.setQualityOrderCode(qualityOrderCode); + QualityOrderDetail tempQualityOrderDetail = qualityOrderDetailMapper.selectMakeInOrderDetailByCodeAndNo(qualityOrderDetail); + if (tempQualityOrderDetail != null){ + qualityOrderDetail.setQualityOrderDetailId(tempQualityOrderDetail.getQualityOrderDetailId()); + Long currentNum = inboundDetail.getCurrentNum(); + qualityOrderDetail.setMakeInNum((int) (tempQualityOrderDetail.getMakeInNum()+currentNum)); + int updateQualityOrderDetailResult = qualityOrderDetailMapper.updateQualityOrderDetail(qualityOrderDetail); + if (updateQualityOrderDetailResult <= 0){ + throw new BusinessException("更新品质单详情数据失败"); + } + }else { + qualityOrderDetail.setRelatedOrderCode(erpInboundOrder.getMakeNo()); + + qualityOrderDetail.setMaterialName(sysMakeorderBom.getMaterialName()); + qualityOrderDetail.setMaterialBrand(sysMakeorderBom.getBrand()); + qualityOrderDetail.setMaterialDescribe(sysMakeorderBom.getDescribe()); + qualityOrderDetail.setMaterialProcessMethod(sysMakeorderBom.getProcessMethod()); + qualityOrderDetail.setMaterialDeptType(sysMakeorderBom.getMaterialType()); + qualityOrderDetail.setMaterialPhotourl(sysMakeorderBom.getPhotoUrl()); + qualityOrderDetail.setMaterialUnit(sysMakeorderBom.getUnit()); + qualityOrderDetail.setMaterialType(sysMakeorderBom.getMaterialType()); + //添加委内已完成数 + qualityOrderDetail.setMakeInNum(Math.toIntExact(inboundDetail.getCurrentNum())); + qualityOrderDetail.setCreateBy(ShiroUtils.getLoginName()); + qualityOrderDetail.setCreateTime(new Date()); + qualityOrderDetailMapper.insertQualityOrderDetail(qualityOrderDetail); + } + + } } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java index f31fc8ea..67b98638 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityOrderController.java @@ -8,6 +8,8 @@ import com.ruoyi.quality.domain.QualityOrderDetail; import com.ruoyi.quality.domain.QualityOrderReport; import com.ruoyi.quality.service.IQualityOrderDetailService; import com.ruoyi.quality.service.IQualityOrderReportService; +import com.ruoyi.warehouse.domain.WarehouseOutOrder; +import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -208,8 +210,74 @@ public class QualityOrderController extends BaseController @Log(title = "品质管理品质单", businessType = BusinessType.UPDATE) @PostMapping("/qualityReport") @ResponseBody - public AjaxResult orderReportSave(@RequestBody QualityOrderReport qualityOrderReport) + public AjaxResult qualityReportSave(@RequestBody QualityOrderReport qualityOrderReport) { return toAjax(orderReportService.updateQualityOrderReport(qualityOrderReport)); } + + + /** + * 委内加工品质单开始品质 + */ + @GetMapping("/makeInStartingQuality/{qualityOrderId}") + public String makeInStartingQuality(@PathVariable("qualityOrderId") Long qualityOrderId, ModelMap mmap) + { + QualityOrder qualityOrder = qualityOrderService.selectQualityOrderById(qualityOrderId); + mmap.put("qualityOrder", qualityOrder); + return prefix + "/makeInStartingQuality"; + } + + /** + * 修改保存委内加工品质单开始品质 + */ + @RequiresPermissions("quality:qualityOrder:makeInStartingQuality") + @Log(title = "品质管理品质单", businessType = BusinessType.UPDATE) + @PostMapping("/makeInStartingQuality") + @ResponseBody + public AjaxResult makeInStartingQualitySave(@RequestBody QualityOrder qualityOrder) + { + return toAjax(qualityOrderService.updateMakeInStartingQuality(qualityOrder)); + } + + + /** + * 委内加工品质单开始品质 物料相关信息 + */ + @PostMapping("/getMaterialListByQualityOrderCode") + @ResponseBody + public TableDataInfo getMaterialListByOutOrderCode(QualityOrder qualityOrder) + { + startPage(); + List list = qualityOrderService.getMaterialListByQualityOrderCode(qualityOrder); + return getDataTable(list); + } + + + /** + * 修改委内加工入库单品质报告按钮 + */ + @GetMapping("/makeInOrderReport") + public String makeInOrderReport( @RequestParam("materialNo") String materialNo, + @RequestParam("qualityOrderCode") String qualityOrderCode, + ModelMap mmap) + { + QualityOrderReport qualityOrderReport = orderReportService.selectMakeInOrderReportByNoAndCode(materialNo,qualityOrderCode); + mmap.put("qualityOrderReport", qualityOrderReport); + mmap.put("qualityOrderCode",qualityOrderCode); + return prefix + "/makeInOrderReport"; + } + + /** + * 修改保存委内加工入库单品质报告按钮 + */ + @RequiresPermissions("quality:qualityOrder:makeInOrderReport") + @Log(title = "品质管理品质单", businessType = BusinessType.UPDATE) + @PostMapping("/makeInOrderReport") + @ResponseBody + public AjaxResult makeInOrderReportSave(@RequestBody QualityOrderReport qualityOrderReport) + { + return toAjax(orderReportService.updateMakeInOrderReport(qualityOrderReport)); + } + + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrderDetail.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrderDetail.java index a9cb4842..53504c23 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrderDetail.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrderDetail.java @@ -137,6 +137,11 @@ public class QualityOrderDetail extends BaseEntity @Excel(name = "品质不合格数") private Integer qualityUnqualifiedNum; + /** 委内已完成数 */ + @Excel(name = "委内已完成数") + private Integer makeInNum; + + public void setQualityOrderDetailId(Long qualityOrderDetailId) { this.qualityOrderDetailId = qualityOrderDetailId; @@ -392,6 +397,14 @@ public class QualityOrderDetail extends BaseEntity this.qualityUnqualifiedNum = qualityUnqualifiedNum; } + public Integer getMakeInNum() { + return makeInNum; + } + + public void setMakeInNum(Integer makeInNum) { + this.makeInNum = makeInNum; + } + public String getMaterialDeptType() { return materialDeptType; } @@ -433,6 +446,7 @@ public class QualityOrderDetail extends BaseEntity .append("qualityHasqualifiedNum", getQualityHasqualifiedNum()) .append("qualityQualifiedNum", getQualityQualifiedNum()) .append("qualityUnqualifiedNum", getQualityUnqualifiedNum()) + .append("makeInNum",getMakeInNum()) .append("remark", getRemark()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrderReport.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrderReport.java index 6b4e405e..4fbc151f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrderReport.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrderReport.java @@ -46,6 +46,10 @@ public class QualityOrderReport extends BaseEntity @Excel(name = "生产订单数") private Integer makeTotal; + /** 委内已完成数 */ + @Excel(name = "委内已完成数") + private Integer makeInNum; + /** 实际到货数量 */ @Excel(name = "实际到货数量") private Integer actualArriveNum; @@ -159,6 +163,14 @@ public class QualityOrderReport extends BaseEntity return makeTotal; } + public Integer getMakeInNum() { + return makeInNum; + } + + public void setMakeInNum(Integer makeInNum) { + this.makeInNum = makeInNum; + } + public Integer getActualArriveNum() { return actualArriveNum; } @@ -277,6 +289,7 @@ public class QualityOrderReport extends BaseEntity .append("materialNo", getMaterialNo()) .append("materialName", getMaterialName()) .append("makeTotal", getMakeTotal()) + .append("makeInNum",getMakeInNum()) .append("actualArriveNum", getActualArriveNum()) .append("qualityHasqualifiedNum", getQualityHasqualifiedNum()) .append("okAcceptedNum", getOkAcceptedNum()) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrderReportUnqualified.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrderReportUnqualified.java index d5b7426e..6cbb0a3c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrderReportUnqualified.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityOrderReportUnqualified.java @@ -18,6 +18,9 @@ public class QualityOrderReportUnqualified extends BaseEntity /** 品质单报告不合格数Id */ private Long orderReportUnqualifiedId; + /** 品质单报告Id */ + private Long qualityOrderReportId; + /** 供应商Id */ @Excel(name = "供应商Id") private String supplierCode; @@ -59,7 +62,16 @@ public class QualityOrderReportUnqualified extends BaseEntity { return orderReportUnqualifiedId; } - public void setSupplierCode(String supplierCode) + + public Long getQualityOrderReportId() { + return qualityOrderReportId; + } + + public void setQualityOrderReportId(Long qualityOrderReportId) { + this.qualityOrderReportId = qualityOrderReportId; + } + + public void setSupplierCode(String supplierCode) { this.supplierCode = supplierCode; } @@ -136,6 +148,7 @@ public class QualityOrderReportUnqualified extends BaseEntity public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("orderReportUnqualifiedId", getOrderReportUnqualifiedId()) + .append("qualityOrderReportId", getQualityOrderReportId()) .append("supplierCode", getSupplierCode()) .append("supplierName", getSupplierName()) .append("materialNo", getMaterialNo()) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderDetailMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderDetailMapper.java index f966fe3e..6accbe3f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderDetailMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderDetailMapper.java @@ -93,9 +93,19 @@ public interface QualityOrderDetailMapper List selectQualityOrderDetailListByCode(String qualityOrderCode); /** - * 根据供应商Id和物料号查询品质管理品质单详情 + * 根据供应商Id和物料号以及品质单号查询品质管理品质单详情 * */ QualityOrderDetail selectQualityOrderDetailByCodeAndNo(QualityOrderDetail qualityOrderDetail); + /** + * 根据物料号和品质单号查询品质管理品质单详情 + * + */ + QualityOrderDetail selectMakeInOrderDetailByCodeAndNo(QualityOrderDetail tempQualityOrderDetail); + + /** + * 查询委内加工品质单开始品质 物料相关信息 + */ + List selectMakeInOrderDetailListByCode(String qualityOrderCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderMapper.java index 8aba1a73..b15cb088 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderMapper.java @@ -2,6 +2,8 @@ package com.ruoyi.quality.mapper; import java.util.List; import com.ruoyi.quality.domain.QualityOrder; +import com.ruoyi.quality.domain.QualityOrderDetail; +import com.ruoyi.quality.domain.QualityOrderReport; /** * 品质管理品质单Mapper接口 @@ -82,4 +84,5 @@ public interface QualityOrderMapper * @return 品质管理品质单 */ public QualityOrder selectQualityOrderByCode(String qualityOrderCode); + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderReportMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderReportMapper.java index 53e03cc4..7977d3b8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderReportMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderReportMapper.java @@ -36,13 +36,24 @@ public interface QualityOrderReportMapper public int insertQualityOrderReport(QualityOrderReport qualityOrderReport); /** - * 修改品质管理品质单报告 + * 通过品质单报告物料号和供应商编号修改品质管理品质单报告 * * @param qualityOrderReport 品质管理品质单报告 * @return 结果 */ public int updateQualityOrderReport(QualityOrderReport qualityOrderReport); + + + /** + * 通过品质单报告Id修改品质管理品质单报告 + * + * @param qualityOrderReport 品质管理品质单报告 + * @return 结果 + */ + public int updateQualityOrderReportById(QualityOrderReport qualityOrderReport); + + /** * 删除品质管理品质单报告 * @@ -75,6 +86,12 @@ public interface QualityOrderReportMapper */ public int restoreQualityOrderReportById(Long qualityOrderReportId); - /*根据供应商ID和物料号查询品质报告*/ + /*根据供应商ID和物料号以及品质单号查询品质报告*/ QualityOrderReport selectQualityOrderReportByNoAndCode(QualityOrderReport qualityOrderReport); + + /* + * 查询委内加工入库单品质报告 + * */ + QualityOrderReport selectMakeInOrderReportByNoAndCode(QualityOrderReport tempQualityOrderReport); + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderReportUnqualifiedMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderReportUnqualifiedMapper.java index cb8d539e..4831ec35 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderReportUnqualifiedMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityOrderReportUnqualifiedMapper.java @@ -83,4 +83,9 @@ public interface QualityOrderReportUnqualifiedMapper * @return 结果 */ public int restoreQualityOrderReportUnqualifiedById(Long orderReportUnqualifiedId); + + /* + * 根据品质单报告id查询品质单报告不合格分类 + * */ + List selectOrderReportUnqualifiedByOrderReportId(QualityOrderReportUnqualified tempOrderReportUnqualified); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderReportService.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderReportService.java index d1a361d9..0dd64487 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderReportService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderReportService.java @@ -75,4 +75,14 @@ public interface IQualityOrderReportService /*根据供应商ID和物料号查询品质报告*/ QualityOrderReport selectQualityOrderReportByNoAndCode(String materialNo, String supplierCode,String qualityOrderCode); + + /* + * 查询委内加工入库单品质报告 + * */ + QualityOrderReport selectMakeInOrderReportByNoAndCode(String materialNo, String qualityOrderCode); + + /** + * 修改保存委内加工入库单品质报告按钮 + */ + int updateMakeInOrderReport(QualityOrderReport qualityOrderReport); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderService.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderService.java index f6a4e709..a5c0f9a1 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityOrderService.java @@ -2,6 +2,8 @@ package com.ruoyi.quality.service; import java.util.List; import com.ruoyi.quality.domain.QualityOrder; +import com.ruoyi.quality.domain.QualityOrderDetail; +import com.ruoyi.quality.domain.QualityOrderReport; import com.ruoyi.warehouse.domain.WarehouseStorageOrder; import com.ruoyi.warehouse.domain.WarehouseStorageOrderDetail; @@ -79,4 +81,14 @@ public interface IQualityOrderService * * */ void insertQualityOrderByWarehouseStorageOrder(WarehouseStorageOrder warehouseStorageOrder, List warehouseStorageOrderDetailList); + + /* + * 修改保存委内加工品质单开始品质 + * */ + int updateMakeInStartingQuality(QualityOrder qualityOrder); + + /** + * 查询委内加工品质单开始品质 物料相关信息 + */ + List getMaterialListByQualityOrderCode(QualityOrder qualityOrder); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java index ecc990ab..e0b9ff4b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderReportServiceImpl.java @@ -21,6 +21,7 @@ import com.ruoyi.quality.mapper.QualityOrderReportMapper; import com.ruoyi.quality.service.IQualityOrderReportService; import com.ruoyi.common.core.text.Convert; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; /** * 品质管理品质单报告Service业务层处理 @@ -118,12 +119,12 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService Integer qualityQualifiedNum = okAcceptedNum + specialConcessionsNum; //后续要处理这个本次到货数 //本次到货数 - Integer thisArrivedNum = qualityOrderDetail.getThisArrivedNum(); - if (thisArrivedNum != null){ - if (qualityQualifiedNum>thisArrivedNum){ - throw new BusinessException("OK允收数和特采/让步数总和小于等于本次到货数"); - } - } +// Integer thisArrivedNum = qualityOrderDetail.getThisArrivedNum(); +// if (thisArrivedNum != null){ +// if (qualityQualifiedNum>thisArrivedNum){ +// throw new BusinessException("OK允收数和特采/让步数总和小于等于本次到货数"); +// } +// } //更新品质报告详情中的品质合格数的数据 qualityOrderDetail.setQualityQualifiedNum(qualityQualifiedNum); //更新品质已合格数 @@ -264,7 +265,7 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService return qualityOrderReportMapper.restoreQualityOrderReportById(qualityOrderReportId); } - /*根据供应商ID和物料号查询品质报告*/ + /*根据供应商ID和物料号以及品质单号查询品质报告*/ @Override public QualityOrderReport selectQualityOrderReportByNoAndCode(String materialNo, String supplierCode,String qualityOrderCode) { @@ -276,6 +277,94 @@ public class QualityOrderReportServiceImpl implements IQualityOrderReportService return qualityOrderReport; } + /* + * 查询委内加工入库单品质报告 + * */ + @Override + public QualityOrderReport selectMakeInOrderReportByNoAndCode(String materialNo, String qualityOrderCode) { + QualityOrderReport tempQualityOrderReport = new QualityOrderReport(); + tempQualityOrderReport.setMaterialNo(materialNo); + tempQualityOrderReport.setQualityOrderCode(qualityOrderCode); + QualityOrderReport qualityOrderReport = qualityOrderReportMapper.selectMakeInOrderReportByNoAndCode(tempQualityOrderReport); + return qualityOrderReport; + + } + + /** + * 修改保存委内加工入库单品质报告按钮 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public int updateMakeInOrderReport(QualityOrderReport qualityOrderReport) { + + String loginName = ShiroUtils.getLoginName(); + + + String materialNo = qualityOrderReport.getMaterialNo(); + String qualityOrderCode = qualityOrderReport.getQualityOrderCode(); + + QualityOrderDetail tempQualityOrderDetail = new QualityOrderDetail(); + tempQualityOrderDetail.setMaterialNo(materialNo); + tempQualityOrderDetail.setQualityOrderCode(qualityOrderCode); + + //从数据库查询品质报告详情数据 + QualityOrderDetail qualityOrderDetail = orderDetailMapper.selectMakeInOrderDetailByCodeAndNo(tempQualityOrderDetail); + //计算品质单详情中的品质合格数量 + Integer okAcceptedNum = qualityOrderReport.getOkAcceptedNum(); + Integer specialConcessionsNum = qualityOrderReport.getSpecialConcessionsNum(); + //品质合格数 + Integer qualityQualifiedNum = okAcceptedNum + specialConcessionsNum; + //后续要处理这个本次到货数 + //本次到货数 +// Integer thisArrivedNum = qualityOrderDetail.getThisArrivedNum(); +// if (thisArrivedNum != null){ +// if (qualityQualifiedNum>thisArrivedNum){ +// throw new BusinessException("OK允收数和特采/让步数总和小于等于本次到货数"); +// } +// } + //更新品质报告详情中的品质合格数的数据 + qualityOrderDetail.setQualityQualifiedNum(qualityQualifiedNum); + //更新品质已合格数 + qualityOrderDetail.setQualityHasqualifiedNum(qualityQualifiedNum); + //获得品质报告中的不合格数模块数据 + List unqualifiedDataList = qualityOrderReport.getUnqualifiedDataList(); + if (CollectionUtils.isEmpty(unqualifiedDataList)){ + throw new BusinessException("品质单不合格数数据为空"); + } + + //计算不良数量的合计值 + int processBadNumTotal = unqualifiedDataList.stream().mapToInt(QualityOrderReportUnqualified::getProcessBadNum).sum(); + + //更新品质报告详情品质不合格数 + qualityOrderDetail.setQualityUnqualifiedNum(processBadNumTotal); + qualityOrderDetail.setUpdateBy(loginName); + qualityOrderDetail.setUpdateTime(new Date()); + //更新品质报告详情数据表 + int updateQualityOrderDetailResult = orderDetailMapper.updateQualityOrderDetail(qualityOrderDetail); + + if (updateQualityOrderDetailResult <= 0){ + throw new BusinessException("更新品质单详情数据失败"); + } + + + //生成品质报告不合格数 + for (QualityOrderReportUnqualified qualityOrderReportUnqualified : unqualifiedDataList) { + qualityOrderReportUnqualified.setQualityOrderReportId(qualityOrderReport.getQualityOrderReportId()); + qualityOrderReportUnqualified.setCreateBy(loginName); + qualityOrderReportUnqualified.setCreateTime(new Date()); + qualityOrderReportUnqualified.setMaterialNo(qualityOrderReport.getMaterialNo()); + qualityOrderReportUnqualified.setMaterialName(qualityOrderReport.getMaterialName()); + int insertUnqualifiedResult = unqualifiedMapper.insertQualityOrderReportUnqualified(qualityOrderReportUnqualified); + if (insertUnqualifiedResult <= 0){ + throw new BusinessException("新增品质报告不合格数数据失败"); + } + } + + qualityOrderReport.setUpdateBy(loginName); + qualityOrderReport.setUpdateTime(new Date()); + return qualityOrderReportMapper.updateQualityOrderReportById(qualityOrderReport); + } + /** *退换货单号生产规则 *系统自动生成,按照特定编码,编码暂用【THH+年月日+001】, diff --git a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java index 11dc615e..49615733 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityOrderServiceImpl.java @@ -8,6 +8,7 @@ import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.exception.BusinessException; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.quality.domain.QualityOrderDetail; import com.ruoyi.quality.domain.QualityOrderReport; import com.ruoyi.quality.domain.QualityOrderReportUnqualified; @@ -307,8 +308,137 @@ public class QualityOrderServiceImpl implements IQualityOrderService } + /* + * 修改保存委内加工品质单开始品质 + * */ + @Transactional(rollbackFor = Exception.class) + @Override + public int updateMakeInStartingQuality(QualityOrder qualityOrder) { + + + String loginName = ShiroUtils.getLoginName(); + qualityOrder.setUpdateBy(loginName); + qualityOrder.setUpdateTime(new Date()); + + List qualityOrderDetailList = qualityOrder.getQualityOrderDetailList(); + + if (CollectionUtils.isEmpty(qualityOrderDetailList)){ + throw new BusinessException("品质单详情数据为空"); + } + + for (QualityOrderDetail qualityOrderDetail : qualityOrderDetailList) { + qualityOrderDetail.setUpdateBy(loginName); + qualityOrderDetail.setUpdateTime(new Date()); + Long qualityOrderDetailId = qualityOrderDetail.getQualityOrderDetailId(); + QualityOrderDetail tempQualityOrderDetail = orderDetailMapper.selectQualityOrderDetailById(qualityOrderDetailId); + Integer qualifiedNum = tempQualityOrderDetail.getQualityQualifiedNum(); + Integer unqualifiedNum = tempQualityOrderDetail.getQualityUnqualifiedNum(); + if (qualifiedNum == null || unqualifiedNum == null){ + throw new BusinessException("请先进行品质报告操作"); + } + //更新品质单详情数据 + int updateQualityOrderDetailResult = orderDetailMapper.updateQualityOrderDetail(qualityOrderDetail); + if (updateQualityOrderDetailResult <= 0){ + throw new BusinessException("更新品质单详情数据失败"); + } + } + + + //根据品质单号从数据库查询 用于更新入库单 + QualityOrder tempQualityOrder = qualityOrderMapper.selectQualityOrderByCode(qualityOrder.getQualityOrderCode()); + String qualityStatus = tempQualityOrder.getQualityStatus(); + String qualityStorageStatus = tempQualityOrder.getQualityStorageStatus(); + + Integer thisArrivedNumSum = 0; + Integer qualityQualifiedNumSum = 0; + Integer qualityUnqualifiedNumSum = 0; + +// 检查thisArrivedNum是否含有null值 + boolean hasThisArrivedNumNull = qualityOrderDetailList.stream() + .anyMatch(item -> item.getThisArrivedNum() == null); + +// 检查qualityQualifiedNum是否含有null值 + boolean hasQualityQualifiedNumNull = qualityOrderDetailList.stream() + .anyMatch(item -> item.getQualityQualifiedNum() == null); + +// 检查qualityUnqualifiedNum是否含有null值 + boolean hasQualityUnqualifiedNumNull = qualityOrderDetailList.stream() + .anyMatch(item -> item.getQualityUnqualifiedNum() == null); + + if (hasThisArrivedNumNull) { + throw new BusinessException("存在本次到货数为空,请检查!"); + } + if (hasQualityQualifiedNumNull) { + throw new BusinessException("存在品质已合格数为空,请检查!"); + } + if (hasQualityUnqualifiedNumNull) { + throw new BusinessException("存在品质不合格数为空,请检查!"); + } +// 计算各个字段的总和 + thisArrivedNumSum = qualityOrderDetailList.stream() + .mapToInt(QualityOrderDetail::getThisArrivedNum) + .sum(); + + qualityQualifiedNumSum = qualityOrderDetailList.stream() + .mapToInt(QualityOrderDetail::getQualityQualifiedNum) + .sum(); + + qualityUnqualifiedNumSum = qualityOrderDetailList.stream() + .mapToInt(QualityOrderDetail::getQualityUnqualifiedNum) + .sum(); + //插入主表中本次到货数 + qualityOrder.setThisArrivedNum(thisArrivedNumSum); + //插入主表中品质合格数 + qualityOrder.setQualityQualifiedNum(qualityQualifiedNumSum); + //插入主表中品质不合格数 + qualityOrder.setQualityUnqualifiedNum(qualityUnqualifiedNumSum); + +// if (thisArrivedNum == qualityQualifiedNum){ + //全部品质 + qualityOrder.setQualityStatus("2"); + tempQualityOrder.setQualityStatus("2"); +// }else { +// //部分品质 +// qualityOrder.setQualityStatus("1"); +// tempQualityOrder.setQualityStatus("1"); +// } + + + //如果品质时修改交检时间 + tempQualityOrder.setDeliveryInspectionTime(qualityOrder.getDeliveryInspectionTime()); + tempQualityOrder.setQualityQualifiedNum(qualityQualifiedNumSum); + tempQualityOrder.setQualityUnqualifiedNum(qualityUnqualifiedNumSum); + tempQualityOrder.setThisArrivedNum(thisArrivedNumSum); + + //数据生成到入库单中,后续进行入库操作 + int updateStorageOrderResult = warehouseStorageOrderService.insertWarehouseStorageOrderByMakeInQualityOrder(tempQualityOrder, qualityOrderDetailList); + if (updateStorageOrderResult <= 0){ + throw new BusinessException("更新入库单数据失败"); + } + + int updateResult = qualityOrderMapper.updateQualityOrder(qualityOrder); + if (updateResult <= 0){ + log.warn("更新品质单失败,未影响任何行"); + } + return updateResult; + + } + + /** + * 查询委内加工品质单开始品质 物料相关信息 + */ + @Override + public List getMaterialListByQualityOrderCode(QualityOrder qualityOrder) { + String qualityOrderCode = qualityOrder.getQualityOrderCode(); + if (StringUtils.isEmpty(qualityOrderCode)){ + log.warn("品质单号为空:{}",qualityOrderCode); + } + List details = orderDetailMapper.selectMakeInOrderDetailListByCode(qualityOrderCode); + return details; + } + //品质单不合格分类表 - private void insertQualityOrderUnqualifiedByWarehouseStorageOrder( WarehouseStorageOrderDetail warehouseStorageOrderDetail) { + private void insertQualityOrderUnqualifiedByWarehouseStorageOrder(WarehouseStorageOrderDetail warehouseStorageOrderDetail) { QualityOrderReportUnqualified qualityOrderReportUnqualified = new QualityOrderReportUnqualified(); //插入品质报告不合格数 qualityOrderReportUnqualified.setSupplierCode(warehouseStorageOrderDetail.getSupplierCode()); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseStorageOrderService.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseStorageOrderService.java index 13dc18e2..75567e13 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseStorageOrderService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseStorageOrderService.java @@ -108,4 +108,9 @@ public interface IWarehouseStorageOrderService * 通用入库单详情保存接口 * */ int updateWarehouseStorageOrderSave(WarehouseStorageOrder warehouseStorageOrder); + + /** + * 通过委内加工入库单品质后生成入库单 + * */ + int insertWarehouseStorageOrderByMakeInQualityOrder(QualityOrder tempQualityOrder, List qualityOrderDetailList); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java index 248267e0..16590d0c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java @@ -392,6 +392,51 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS return 1; } + + /** + * 通过委内加工入库单品质后生成入库单 调用此方法的地方已经加事务,这里不需要加事务了 + * */ + @Override + public int insertWarehouseStorageOrderByMakeInQualityOrder(QualityOrder tempQualityOrder, List qualityOrderDetailList) { + WarehouseStorageOrder warehouseStorageOrder = new WarehouseStorageOrder(); + String loginName = ShiroUtils.getLoginName(); + String warehouseStorageCode = redisCache.generateBillNo("RK"); + warehouseStorageOrder.setWarehouseStorageCode(warehouseStorageCode); + warehouseStorageOrder.setRelatedOrderCode(tempQualityOrder.getRelatedOrderCode()); + warehouseStorageOrder.setWarehouseStorageStatus("2"); + warehouseStorageOrder.setWarehouseStorageType("2"); + warehouseStorageOrder.setWarehouseOrderType("1"); + warehouseStorageOrder.setDeliveryInspectionTime(tempQualityOrder.getDeliveryInspectionTime()); + warehouseStorageOrder.setQualityUnqualifiedNum(tempQualityOrder.getQualityUnqualifiedNum()); + warehouseStorageOrder.setQualityQualifiedNum(tempQualityOrder.getQualityQualifiedNum()); + warehouseStorageOrder.setCreateBy(loginName); + warehouseStorageOrder.setQualityTime(new Date()); + warehouseStorageOrder.setCreateTime(new Date()); + + //插入入库单详情数据 + for (QualityOrderDetail qualityOrderDetail : qualityOrderDetailList) { + WarehouseStorageOrderDetail warehouseStorageOrderDetail = new WarehouseStorageOrderDetail(); + warehouseStorageOrderDetail.setWarehouseStorageCode(warehouseStorageCode); + warehouseStorageOrderDetail.setRelatedOrderCode(tempQualityOrder.getRelatedOrderCode()); + warehouseStorageOrderDetail.setWarehouseOrderType("2"); + warehouseStorageOrderDetail.setWarehouseStorageType("2"); + warehouseStorageOrderDetail.setWarehouseOrderType("1"); + warehouseStorageOrderDetail.setMaterialNo(qualityOrderDetail.getMaterialNo()); + warehouseStorageOrderDetail.setMaterialName(qualityOrderDetail.getMaterialName()); + warehouseStorageOrderDetail.setMaterialBrand(qualityOrderDetail.getMaterialBrand()); + warehouseStorageOrderDetail.setMaterialDescribe(qualityOrderDetail.getMaterialDescribe()); + warehouseStorageOrderDetail.setMaterialPhotourl(qualityOrderDetail.getMaterialPhotourl()); + warehouseStorageOrderDetail.setMaterialProcessMethod(qualityOrderDetail.getMaterialProcessMethod()); + warehouseStorageOrderDetail.setMaterialType(qualityOrderDetail.getMaterialType()); + warehouseStorageOrderDetail.setMaterialUnit(qualityOrderDetail.getMaterialUnit()); + warehouseStorageOrderDetail.setCreateBy(loginName); + warehouseStorageOrderDetail.setCreateTime(new Date()); + storageOrderDetailMapper.insertWarehouseStorageOrderDetail(warehouseStorageOrderDetail); + } + + return warehouseStorageOrderMapper.insertWarehouseStorageOrder(warehouseStorageOrder); + } + /** * 修改保存暂收-采购单(采购入库) 子表数据 * */ diff --git a/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderDetailMapper.xml b/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderDetailMapper.xml index 4619fd55..578828a6 100644 --- a/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderDetailMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderDetailMapper.xml @@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -43,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select quality_order_detail_id, quality_order_code, in_storage_code, related_order_code, quality_status, quality_order_type, quality_storage_status, delivery_inspection_time, warehouse_code, warehouse_name, 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, material_dept_type ,make_total, actual_arrive_num, this_arrived_num, quality_hasqualified_num, quality_qualified_num, quality_unqualified_num, remark, create_by, create_time, update_by, update_time from quality_order_detail + select quality_order_detail_id, quality_order_code, in_storage_code, related_order_code, quality_status, quality_order_type, quality_storage_status, delivery_inspection_time, warehouse_code, warehouse_name, 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, material_dept_type ,make_total, actual_arrive_num, this_arrived_num, quality_hasqualified_num, quality_qualified_num, quality_unqualified_num, make_in_num, remark, create_by, create_time, update_by, update_time from quality_order_detail + + + + @@ -109,6 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" quality_hasqualified_num, quality_qualified_num, quality_unqualified_num, + make_in_num, remark, create_by, create_time, @@ -145,6 +158,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{qualityHasqualifiedNum}, #{qualityQualifiedNum}, #{qualityUnqualifiedNum}, + #{makeInNum}, #{remark}, #{createBy}, #{createTime}, @@ -185,6 +199,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" quality_hasqualified_num = #{qualityHasqualifiedNum}, quality_qualified_num = #{qualityQualifiedNum}, quality_unqualified_num = #{qualityUnqualifiedNum}, + make_in_num = #{makeInNum}, remark = #{remark}, create_by = #{createBy}, create_time = #{createTime}, diff --git a/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderReportMapper.xml b/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderReportMapper.xml index 7fea3876..ff95d6b7 100644 --- a/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderReportMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderReportMapper.xml @@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -31,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select quality_order_report_id, quality_order_code, supplier_code, supplier_name, material_no, material_name, make_total, actual_arrive_num,quality_hasqualified_num, ok_accepted_num, ok_report_url, special_concessions_num, special_report_url, checkout_completion_time, process_bad_classification, process_bad_grade, process_bad_num, unqualified_report_url, remark, create_by, create_time, update_by, update_time from quality_order_report + select quality_order_report_id, quality_order_code, supplier_code, supplier_name, material_no, material_name, make_total, make_in_num, actual_arrive_num,quality_hasqualified_num, ok_accepted_num, ok_report_url, special_concessions_num, special_report_url, checkout_completion_time, process_bad_classification, process_bad_grade, process_bad_num, unqualified_report_url, remark, create_by, create_time, update_by, update_time from quality_order_report + + + + insert into quality_order_report @@ -61,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" material_no, material_name, make_total, + make_in_num, actual_arrive_num, quality_hasqualified_num, ok_accepted_num, @@ -85,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{materialNo}, #{materialName}, #{makeTotal}, + #{makeInNum}, #{actualArriveNum}, #{qualityHasqualifiedNum}, #{okAcceptedNum}, @@ -113,6 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" material_no = #{materialNo}, material_name = #{materialName}, make_total = #{makeTotal}, + make_in_num = #{makeInNum}, actual_arrive_num = #{actualArriveNum}, quality_hasqualified_num = #{qualityHasqualifiedNum}, ok_accepted_num = #{okAcceptedNum}, @@ -134,6 +146,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and supplier_code = #{supplierCode} + + + update quality_order_report + + quality_order_code = #{qualityOrderCode}, + supplier_code = #{supplierCode}, + supplier_name = #{supplierName}, + material_no = #{materialNo}, + material_name = #{materialName}, + make_total = #{makeTotal}, + make_in_num = #{makeInNum}, + actual_arrive_num = #{actualArriveNum}, + quality_hasqualified_num = #{qualityHasqualifiedNum}, + ok_accepted_num = #{okAcceptedNum}, + ok_report_url = #{okReportUrl}, + special_concessions_num = #{specialConcessionsNum}, + special_report_url = #{specialReportUrl}, + checkout_completion_time = #{checkoutCompletionTime}, + process_bad_classification = #{processBadClassification}, + process_bad_grade = #{processBadGrade}, + process_bad_num = #{processBadNum}, + unqualified_report_url = #{unqualifiedReportUrl}, + remark = #{remark}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where quality_order_report_id = #{qualityOrderReportId} + + + delete from quality_order_report where quality_order_report_id = #{qualityOrderReportId} diff --git a/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderReportUnqualifiedMapper.xml b/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderReportUnqualifiedMapper.xml index e1733db4..df948a76 100644 --- a/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderReportUnqualifiedMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/quality/QualityOrderReportUnqualifiedMapper.xml @@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -22,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select order_report_unqualified_id, supplier_code, supplier_name, material_no, material_name, process_bad_classification, process_bad_grade, process_bad_num, unqualified_report_url, remark, create_by, create_time, update_by, update_time from quality_order_report_unqualified + select order_report_unqualified_id, quality_order_report_id, supplier_code, supplier_name, material_no, material_name, process_bad_classification, process_bad_grade, process_bad_num, unqualified_report_url, remark, create_by, create_time, update_by, update_time from quality_order_report_unqualified + + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+

合格数

+
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+
+ +
+
+
+ 不合格数 + + 添加 + +
+
+
+
+
+
+
+
+ +
+ + +
+ +
+
+ + +
+
+
+
+ +
+ +
+
+ + + + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/makeInStartingQuality.html b/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/makeInStartingQuality.html new file mode 100644 index 00000000..17c5e2eb --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/makeInStartingQuality.html @@ -0,0 +1,237 @@ + + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+
+
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrder.html b/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrder.html index 16f481e7..e1f1f5ff 100644 --- a/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrder.html +++ b/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/qualityOrder.html @@ -57,6 +57,8 @@ \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/startingQuality.html b/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/startingQuality.html index 587fac80..a0d196e7 100644 --- a/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/startingQuality.html +++ b/ruoyi-admin/src/main/resources/templates/quality/qualityOrder/startingQuality.html @@ -198,7 +198,7 @@ visible: false }, { - title: '物料详情ID', + title: '品质单详情ID', field: 'qualityOrderDetailId', visible: false diff --git a/ruoyi-admin/src/main/resources/templates/system/makeorder/addProcessInbound.html b/ruoyi-admin/src/main/resources/templates/system/makeorder/addProcessInbound.html index 143436e8..50ddce86 100644 --- a/ruoyi-admin/src/main/resources/templates/system/makeorder/addProcessInbound.html +++ b/ruoyi-admin/src/main/resources/templates/system/makeorder/addProcessInbound.html @@ -160,18 +160,18 @@ }, {field: 'useNum',title: '用量',}, {field: 'lossRate',title: '损耗率', - formatter: function (value,row,index){ - //百分号匹配 - if(value == null || value == ""){ - return "/"; - } - var reg = /^[0-9]+.?[0-9]*$/; - if (!reg.test(value)){ - return value + "%"; - }else{ - return value; - } - } + // formatter: function (value,row,index){ + // //百分号匹配 + // if(value == null || value == ""){ + // return "/"; + // } + // var reg = /^[0-9]+.?[0-9]*$/; + // if (!reg.test(value)){ + // return value + "%"; + // }else{ + // return value; + // } + // } }, {field: 'materialNum',title: '订单用量', formatter: function (value,row,index){