From 30c0376ac77462d04cbfc269af3758d361d9a72b Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Mon, 15 Jul 2024 10:57:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=8C=81=E5=8F=91=E8=B5=B7oa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ProOrderServiceImpl.java | 6 ++ .../op/quality/controller/QuaController.java | 21 ++-- .../op/quality/domain/QcCheckTaskIncome.java | 99 +++++++++++++++++++ .../op/quality/domain/QcCheckUnqualified.java | 63 ++++++++++++ .../mapper/QcCheckTaskIncomeMapper.java | 4 + .../service/IQcCheckTaskIncomeService.java | 3 + .../impl/QcCheckTaskIncomeServiceImpl.java | 44 ++++++++- .../impl/QcCheckUnqualifiedServiceImpl.java | 40 +++++--- .../quality/QcCheckTaskIncomeMapper.xml | 8 ++ .../quality/QcCheckTypeProjectMapper.xml | 4 +- 10 files changed, 263 insertions(+), 29 deletions(-) diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java index 1a38c0d7..32ab6907 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java @@ -1440,6 +1440,12 @@ public class ProOrderServiceImpl implements IProOrderService { /**pro_order_workorder_batch**/ if(!CollectionUtils.isEmpty(workBatchs)) { + + if(workBatchs.size()>100){ + logger.error("批次太多,请检查产品批次数量是否设置正常。"); + return R.fail("批次太多,请检查产品批次数量是否设置正常。"); + } + int pn = proOrderWorkorderBatchMapper.insertWorkorderBatchs(workBatchs); System.out.println("pn:"+pn); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java index 34347764..e44657e9 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QuaController.java @@ -2,24 +2,19 @@ package com.op.quality.controller; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.op.common.core.domain.R; -import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.StringUtils; import com.op.common.core.web.controller.BaseController; import com.op.common.core.web.domain.AjaxResult; import com.op.common.core.web.page.TableDataInfo; -import com.op.common.security.annotation.RequiresPermissions; -import com.op.common.security.utils.SecurityUtils; import com.op.quality.domain.*; import com.op.quality.service.*; import com.op.system.api.RemoteMesService; import com.op.system.api.domain.SysDictData; +import com.op.system.api.domain.SysUser; import com.op.system.api.domain.dto.WCSDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; - -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; import java.util.List; /** @@ -233,6 +228,20 @@ public class QuaController extends BaseController { // } return toAjax(qcCheckTaskIncomeService.commitCheckResults(qcCheckTaskIncome)); } + + @PostMapping(value = "getUserIdList") + public List getUserIdList(@RequestBody SysUser sysUser) { + DynamicDataSourceContextHolder.push("master"); + return qcCheckTaskIncomeService.getUserIdList(sysUser); + } + + @PostMapping(value = "/getOaUserId") + public SysUser getOaUserId(@RequestBody SysUser sysUser) { + DynamicDataSourceContextHolder.push("master"); + return qcCheckTaskIncomeService.getOaUserId(sysUser); + } + + /** * 检验单位 */ diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskIncome.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskIncome.java index 977572e4..9b7f1462 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskIncome.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckTaskIncome.java @@ -203,6 +203,105 @@ public class QcCheckTaskIncome extends BaseEntity { private String sampleAql; private String reason; private String sfgyswt;//是否供应商问题 + private String czbjr;//仓储报检人 + private String zcf;//转出方 + private String zcoemcm;//转出OEM厂名 + private String qczg;//QC主管 + private String sqr;//申请人 + private String oaFactory;//厂区 + private String sqbm;//申请部门 + private String sfxyzg;//是否需要主管审核 + private String pgzg;//QC主管:SFXYZG字段为"是",则此项选择QC主管信息 + private String pgzr;//质量主管 + private String oaFactoryF;//异常范围 + + public String getOaFactoryF() { + return oaFactoryF; + } + + public void setOaFactoryF(String oaFactoryF) { + this.oaFactoryF = oaFactoryF; + } + + public String getSfxyzg() { + return sfxyzg; + } + + public void setSfxyzg(String sfxyzg) { + this.sfxyzg = sfxyzg; + } + + public String getPgzg() { + return pgzg; + } + + public void setPgzg(String pgzg) { + this.pgzg = pgzg; + } + + public String getPgzr() { + return pgzr; + } + + public void setPgzr(String pgzr) { + this.pgzr = pgzr; + } + + public String getSqbm() { + return sqbm; + } + + public void setSqbm(String sqbm) { + this.sqbm = sqbm; + } + + public String getOaFactory() { + return oaFactory; + } + + public void setOaFactory(String oaFactory) { + this.oaFactory = oaFactory; + } + + public String getSqr() { + return sqr; + } + + public void setSqr(String sqr) { + this.sqr = sqr; + } + + public String getQczg() { + return qczg; + } + + public void setQczg(String qczg) { + this.qczg = qczg; + } + + public String getZcf() { + return zcf; + } + + public void setZcf(String zcf) { + this.zcf = zcf; + } + + public String getZcoemcm() { + return zcoemcm; + } + + public void setZcoemcm(String zcoemcm) { + this.zcoemcm = zcoemcm; + } + + public String getCzbjr() { + return czbjr; + } + + public void setCzbjr(String czbjr) { + this.czbjr = czbjr; + } public String getSfgyswt() { return sfgyswt; diff --git a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckUnqualified.java b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckUnqualified.java index 23ab32eb..971a2d15 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckUnqualified.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/domain/QcCheckUnqualified.java @@ -125,6 +125,69 @@ public class QcCheckUnqualified extends BaseEntity { private String user; private String sqr; private String sfgyswt;//是否供应商问题 + private String zcf;//转出方 + private String zcoemcm;//转出OEM厂名 + private String sqbm;//申请部门 + private String sfxyzg;//是否需要主管审核 + private String pgzg;//QC主管:SFXYZG字段为"是",则此项选择QC主管信息 + private String pgzr;//质量主管 + private String oaFactoryF; + + public String getOaFactoryF() { + return oaFactoryF; + } + + public void setOaFactoryF(String oaFactoryF) { + this.oaFactoryF = oaFactoryF; + } + + public String getSfxyzg() { + return sfxyzg; + } + + public void setSfxyzg(String sfxyzg) { + this.sfxyzg = sfxyzg; + } + + public String getPgzg() { + return pgzg; + } + + public void setPgzg(String pgzg) { + this.pgzg = pgzg; + } + + public String getPgzr() { + return pgzr; + } + + public void setPgzr(String pgzr) { + this.pgzr = pgzr; + } + + public String getSqbm() { + return sqbm; + } + + public void setSqbm(String sqbm) { + this.sqbm = sqbm; + } + + public String getZcf() { + return zcf; + } + + public void setZcf(String zcf) { + this.zcf = zcf; + } + + public String getZcoemcm() { + return zcoemcm; + } + + public void setZcoemcm(String zcoemcm) { + this.zcoemcm = zcoemcm; + } public String getSfgyswt() { return sfgyswt; diff --git a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskIncomeMapper.java b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskIncomeMapper.java index 83206e9a..b6503405 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskIncomeMapper.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/mapper/QcCheckTaskIncomeMapper.java @@ -134,4 +134,8 @@ public interface QcCheckTaskIncomeMapper { String getSampleQua(QcCheckTaskIncome qcCheckTaskIncome); Integer getnoOkVals(QcCheckTaskIncome qcCheckTaskIncome); + + List getUserIdList(SysUser getUserIdList); + + SysUser getOaUserId(SysUser getUserIdList); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTaskIncomeService.java b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTaskIncomeService.java index 05895e56..0f0487bf 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTaskIncomeService.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/IQcCheckTaskIncomeService.java @@ -106,4 +106,7 @@ public interface IQcCheckTaskIncomeService { QcCheckTaskIncome hasIncomeTask(QcCheckTaskIncomeDTO income); + List getUserIdList(SysUser sysUser); + + SysUser getOaUserId(SysUser sysUser); } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java index 7693fccb..cb645337 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java @@ -814,11 +814,31 @@ public class QcCheckTaskIncomeServiceImpl implements unqualified.setRemark(qcCheckTaskIncome.getRemark()); if("produce".equals(qcCheckTaskIncome.getTypeCode())){ unqualified.setSfgyswt(qcCheckTaskIncome.getSfgyswt()); + + //申请人- + unqualified.setSqr(qcCheckTaskIncome.getSqr()); + //申请部门 + unqualified.setSqbm(qcCheckTaskIncome.getSqbm()); + //实际生产数量 + unqualified.setQuality(qcCheckTaskIncome.getQuality().toString()); + //发现地点 + unqualified.setCheckLoc(qcCheckTaskIncome.getCheckLoc()); + //是否需要主管审核 + unqualified.setSfgyswt(qcCheckTaskIncome.getSfgyswt()); + if(qcCheckTaskIncome.getSfgyswt().equals("0")){//是 + //qc主管 + unqualified.setPgzg(qcCheckTaskIncome.getPgzg()); + //质量主管 + unqualified.setPgzr(qcCheckTaskIncome.getPgzr()); + } + //是否供应商问题 + unqualified.setSfgyswt(qcCheckTaskIncome.getSfgyswt()); + }else if("material".equals(qcCheckTaskIncome.getTypeCode())){ unqualified.setTypeCode(qcCheckTaskIncome.getTypeCode()); //厂区(小榄固定值) - unqualified.setOaFactory("0"); + unqualified.setOaFactory(qcCheckTaskIncome.getOaFactory()); //来料类别 unqualified.setMaterialType(qcCheckTaskIncome.getMaterialType()); //物料来源 @@ -842,16 +862,20 @@ public class QcCheckTaskIncomeServiceImpl implements //检验编号 unqualified.setCheckNo(qcCheckTaskIncome.getCheckNo()); //仓储报检人-李爱娟 - unqualified.setCzbjr("284"); + unqualified.setCzbjr(qcCheckTaskIncome.getCzbjr()); //物料类别 unqualified.setMaterialType(qcCheckTaskIncome.getMaterialType()); //物料来源 unqualified.setMaterialFrom(qcCheckTaskIncome.getMaterialFrom()); //QC主管-朱继新 - unqualified.setQczg("660"); - //申请人-朱继新 - unqualified.setSqr("660"); + unqualified.setQczg(qcCheckTaskIncome.getQczg()); + //申请人- + unqualified.setSqr(qcCheckTaskIncome.getSqr()); unqualified.setUser(qcCheckTaskIncome.getUpdateBy()); + //转出方 + unqualified.setZcf(qcCheckTaskIncome.getUpdateBy()); + //转出OEM厂名 + unqualified.setZcoemcm(qcCheckTaskIncome.getUpdateBy()); } qcCheckUnqualifiedService.updateQcCheckUnqualified(unqualified); @@ -958,4 +982,14 @@ public class QcCheckTaskIncomeServiceImpl implements public QcCheckTaskIncome hasIncomeTask(QcCheckTaskIncomeDTO income) { return qcCheckTaskIncomeMapper.hasIncomeTask(income); } + + @Override + public List getUserIdList(SysUser getUserIdList) { + return qcCheckTaskIncomeMapper.getUserIdList(getUserIdList); + } + + @Override + public SysUser getOaUserId(SysUser getUserIdList) { + return qcCheckTaskIncomeMapper.getOaUserId(getUserIdList); + } } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedServiceImpl.java index 0ebebf28..13995dc5 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedServiceImpl.java @@ -6,6 +6,7 @@ import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; import com.baomidou.dynamic.datasource.annotation.DS; import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.StringUtils; import com.op.common.core.web.domain.AjaxResult; import com.op.common.security.utils.SecurityUtils; import com.op.system.api.domain.quality.OAInfo; @@ -188,10 +189,14 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService paramMap.put("requestName","ZL0010-来料检验不合格控制流程");//流程名称 paramMap.put("workflowId",113454);//该流程对应的唯- workFlowld + if(StringUtils.isEmpty(task.getIncomeBatchNo())){ + task.setIncomeBatchNo(DateUtils.parseDateToStr("yyyy-MM-dd",new Date())); + } + StringBuffer mainObject = new StringBuffer(); mainObject.append("{"); - mainObject.append("\"SQR\":"+"\""+task.getSqr()+"\"");//申请人 - mainObject.append(",\"CQ\":"+task.getOaFactory());//厂区 + mainObject.append("\"SQR\":"+"\""+task.getSqr()+"\"");//申请人-- + mainObject.append(",\"CQ\":"+task.getOaFactory());//厂区-- mainObject.append(",\"LLLB\":"+task.getMaterialType());//来料类别【0、1】 mainObject.append(",\"MATNR\":"+"\""+task.getMaterialCode()+"\"");//物料编码 mainObject.append(",\"MAKTX\":"+"\""+task.getMaterialName()+"\"");//物料名称 @@ -200,11 +205,14 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService mainObject.append(",\"CHARG\":"+"\""+task.getIncomeBatchNo()+"\"");//生产批号 mainObject.append(",\"comeQty\":"+"\""+task.getQuality()+"\"");//来料数量 mainObject.append(",\"DW\":"+"\""+task.getUnit()+"\"");//来料单位 + mainObject.append(",\"testDate\":"+"\""+DateUtils.parseDateToStr("yyyy-MM-dd",new Date())+"\"");//检验日期 mainObject.append(",\"JYBH\":"+"\""+task.getCheckNo()+"\"");//检验编码 - mainObject.append(",\"BJY\":"+"\""+task.getCzbjr()+"\"");//仓储报检人 + mainObject.append(",\"BJY\":"+"\""+task.getCzbjr()+"\"");//仓储报检人-- mainObject.append(",\"WLLY\":"+"\""+task.getMaterialFrom()+"\"");//物料来源 + mainObject.append(",\"ZCF\":"+"\""+task.getZcf()+"\"");//转出方 + mainObject.append(",\"ZCOEMCM \":"+"\""+task.getZcoemcm()+"\"");//转出OEM厂名 mainObject.append(",\"memo\":"+"\""+task.getRemark()+"\"");//不合格描述 - mainObject.append(",\"PZGLBZG\":"+"\""+task.getQczg()+"\"");//qc主管 + mainObject.append(",\"PZGLBZG\":"+"\""+task.getQczg()+"\"");//qc主管-- mainObject.append("}"); paramMap.put("mainObject",mainObject.toString()); @@ -271,7 +279,7 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService return oaR; } - /** + /**过程-品质异常检验 { "user": "999999", 提交用户账号 "requestLevel": "0", 紧急程度,默认0 @@ -306,7 +314,7 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService QcCheckTaskIncome detailInfo = qcCheckTaskIncomeMapper.getTaskInfo(task.getTaskId()); //发起来料检验OA流程 Map paramMap = new HashMap<>(); - paramMap.put("user",SecurityUtils.getUsername());//提交人工号 + paramMap.put("user",task.getSqr());//提交人工号 paramMap.put("requestLevel",0);//流程紧急度 paramMap.put("requestName","ZL0030-品质异常流程-智能制造-"+DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",detailInfo.getIncomeTime())+"(产品名称:"+detailInfo.getMaterialName()+")");//流程名称 paramMap.put("workflowId",113455);//该流程对应的唯- workFlowld @@ -315,22 +323,22 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService mainObject.append("{"); mainObject.append("\"CPMC\":"+detailInfo.getMaterialName());//产品名称 mainObject.append(",\"CPBM\":"+detailInfo.getMaterialCode());//产品编码 - mainObject.append(",\"SQBM\":"+"\"0\"");//0品质保障部 - mainObject.append(",\"SQR\":"+"\""+SecurityUtils.getUsername()+"\"");//申请人:默认当前用户 - mainObject.append(",\"SQSJ\":"+"\""+DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",detailInfo.getCheckTime())+"\"");//申请时间 + mainObject.append(",\"SQBM\":"+task.getSqbm());//0品质保障部 + mainObject.append(",\"SQR\":"+"\""+task.getSqr()+"\"");//申请人:默认当前用户 + mainObject.append(",\"SQSJ\":"+"\""+DateUtils.parseDateToStr("yyyy-MM-dd",detailInfo.getCheckTime())+"\"");//申请时间 mainObject.append(",\"SCCJ\":"+"\"162\"");//所属车间 mainObject.append(",\"SCPH\":"+"\""+detailInfo.getIncomeBatchNo()+"\"");//生产批号 - mainObject.append(",\"SCSL\":"+"\""+detailInfo.getQuality()+"\"");//生产数量 - mainObject.append(",\"FXDD\":"+"\""+detailInfo.getCheckLoc()+"\"");//发现地点 + mainObject.append(",\"SCSL\":"+"\""+task.getQuality()+"\"");//生产数量 + mainObject.append(",\"FXDD\":"+"\""+task.getCheckLoc()+"\"");//发现地点 mainObject.append(",\"FXRQ\":"+"\""+DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",detailInfo.getCheckTime())+"\"");//发现日期 mainObject.append(",\"BH\":"+"\""+detailInfo.getCheckNo()+"\"");//编号:流水号 年月日+四位流水号 - mainObject.append(",\"YCFW\":"+"\"1\"");//*异常范围:下拉框榄菊所有工厂 1代表小榄工厂 + mainObject.append(",\"YCFW\":"+task.getOaFactoryF()+"\"");//*异常范围:下拉框榄菊所有工厂 1代表小榄工厂 mainObject.append(",\"PZYCMS\":"+"\""+detailInfo.getRemark()+"\"");//品质异常描述 mainObject.append(",\"Notes\":"+"\"\"");//测试备注 - mainObject.append(",\"SFXYZG\":"+"\"0\"");//*是否需要主管审核 1否 0是 - mainObject.append(",\"PGZG\":"+"\"660\"");//QC主管:SFXYZG字段为"是",则此项选择QC主管信息 - mainObject.append(",\"PGZR\":"+"\"660\"");//质量主管 660:朱继新 - mainObject.append(",\"SFGYSWT\":"+"\"1\"");//*是否供应商问题 1非供应商问题 0是供应商问题 + mainObject.append(",\"SFXYZG\":"+"\""+task.getSfxyzg()+"\"");//*是否需要主管审核 1否 0是 + mainObject.append(",\"PGZG\":"+"\""+task.getPgzg()+"\"");//QC主管:SFXYZG字段为"是",则此项选择QC主管信息 + mainObject.append(",\"PGZR\":"+"\""+task.getPgzr()+"\"");//质量主管 660:朱继新 + mainObject.append(",\"SFGYSWT\":"+task.getSfgyswt()+"\"");//*是否供应商问题 1非供应商问题 0是供应商问题 mainObject.append("}"); diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml index b8ef8328..a02a26d8 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTaskIncomeMapper.xml @@ -573,6 +573,14 @@ from qc_sample_rule_aql where del_flag='0' and sample_code like concat(#{sampleCode},'%') + + diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml index 3472c515..f26e1a89 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml @@ -99,8 +99,8 @@ qcp.check_mode checkMode from qc_check_type_project qctp - left join qc_check_project qcp on qcp.id = qctp.project_id and qcp.del_flag = '0' - where qctp.del_flag = '0' and qctp.status = '1' + left join qc_check_project qcp on qcp.id = qctp.project_id + where qctp.del_flag = '0' and qctp.status = '1' and qcp.del_flag = '0' and qctp.material_code = #{materialCode} and qctp.type_id = #{typeId} order by qctp.sort