From 9074446d161eec489dc62a7eb35a6c875806d13f Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Sat, 31 Aug 2024 23:54:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/op/system/api/RemoteMesService.java | 3 + .../api/factory/RemoteMesFallbackFactory.java | 5 + .../src/main/java/com/op/job/task/RyTask.java | 9 +- .../controller/MesReportWorksController.java | 10 ++ .../op/mes/mapper/MesReportWorkMapper.java | 3 + .../mes/service/IMesReportWorksService.java | 2 + .../impl/MesReportWorksServiceImpl.java | 111 +++++++++++++++++- .../mapper/mes/MesReportWorkMapper.xml | 14 ++- .../plan/mapper/ProOrderWorkorderMapper.java | 3 + .../impl/ProOrderWorkorderServiceImpl.java | 98 +++++++++------- .../mapper/plan/ProOrderWorkorderMapper.xml | 23 +++- .../QcCheckTaskIncomeController.java | 14 +++ .../QcCheckUnqualifiedController.java | 41 +++++++ .../mapper/QcCheckTaskIncomeMapper.java | 14 +++ .../service/IQcCheckTaskIncomeService.java | 2 + .../impl/QcCheckTaskIncomeServiceImpl.java | 43 +++++++ .../quality/QcCheckTaskIncomeMapper.xml | 46 ++++++++ .../quality/QcCheckUnqualifiedMapper.xml | 5 +- .../mapper/quality/QcProCheckMapper.xml | 1 + 19 files changed, 397 insertions(+), 50 deletions(-) diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteMesService.java b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteMesService.java index 58d79c41..5ed24dd2 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteMesService.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteMesService.java @@ -48,4 +48,7 @@ public interface RemoteMesService { @PostMapping("/wcsInterface/changeTransferResultTask") public R changeTransferResultTask(); + + @PostMapping("/reportWorks/mesProTask") + public R mesProTask(); } diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteMesFallbackFactory.java b/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteMesFallbackFactory.java index 1e9bdad8..ae3ccffd 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteMesFallbackFactory.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteMesFallbackFactory.java @@ -72,6 +72,11 @@ public class RemoteMesFallbackFactory implements FallbackFactory getNoticesGroup(SysNoticeGroup noticeQo); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorksService.java b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorksService.java index bf009551..942509ef 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorksService.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorksService.java @@ -1,5 +1,6 @@ package com.op.mes.service; +import com.op.common.core.domain.R; import com.op.mes.domain.MesReportWork; import java.util.List; @@ -8,4 +9,5 @@ public interface IMesReportWorksService { List getReportWorksList(MesReportWork mesReportWork); + R mesProTask(); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorksServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorksServiceImpl.java index fac8fdc2..fedfcb79 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorksServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorksServiceImpl.java @@ -1,24 +1,131 @@ package com.op.mes.service.impl; +import com.alibaba.fastjson2.JSONObject; import com.baomidou.dynamic.datasource.annotation.DS; +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.utils.bean.BeanUtils; +import com.op.common.core.web.domain.AjaxResult; import com.op.mes.domain.MesReportWork; +import com.op.mes.domain.ProOrderWorkorder; +import com.op.mes.mapper.MesReportWorkMapper; import com.op.mes.mapper.MesReportWorksMapper; import com.op.mes.service.IMesReportWorksService; +import com.op.system.api.RemoteOpenService; +import com.op.system.api.RemoteUserService; +import com.op.system.api.domain.SysNoticeGroup; +import com.op.system.api.domain.SysUser; +import com.op.system.api.domain.dto.WechartDTO; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static com.op.common.core.web.domain.AjaxResult.error; +import static com.op.common.core.web.domain.AjaxResult.success; @Service public class MesReportWorksServiceImpl implements IMesReportWorksService { - + protected Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private MesReportWorkMapper mesReportWorkMapper; + @Autowired + private RemoteOpenService remoteOpenService; @Autowired - private MesReportWorksMapper mesReportWorksMapper; + private RemoteUserService remoteUserService; + private static Pattern p2= Pattern.compile("<[^>]+>"); @Override @DS("#header.poolName") public List getReportWorksList(MesReportWork mesReportWork) { return null;//mesReportWorksMapper.getReportWorkList(mesReportWork); } + + @Override + public R mesProTask() { + // 加载sf-cloud库的sys_datasource + SysUser sysUser = new SysUser(); + sysUser.setUserId(1L); + R>> dateSources0 = remoteUserService.getPoolNameList(sysUser); + List> dateSources = dateSources0.getData(); + ExecutorService executorService = new ThreadPoolExecutor( + dateSources.size(), + dateSources.size(), + 0L, TimeUnit.MILLISECONDS, + new LinkedBlockingQueue()); + try { + dateSources.forEach(dateSource -> { + if("ds_1000".equals(dateSource.get("poolName"))){ + logger.info("++++++++++++" + dateSource.get("poolName") + "++++车间生产情况企业微信提醒开始++++++++++"); + Runnable run = () -> setMesProInfoFunc(dateSource.get("poolName")); + executorService.execute(run); + } + }); + } catch (Exception e) { + logger.error("service == mesProTask == exception", e); + return R.fail("service == mesProTask == exception"); + } finally { + executorService.shutdown(); + } + return R.ok(); + } + public void setMesProInfoFunc(String poolName){ + DynamicDataSourceContextHolder.push(poolName);// 这是数据源的key + //工厂名称 + + //车间名称 + + //发送企业微信 + ProOrderWorkorder prowork = new ProOrderWorkorder(); + prowork.setFactoryCode("小榄工厂"); + prowork.setWorkorderName("黑蚊香生产车间"); + this.sendWX(prowork); + } + protected void sendWX(ProOrderWorkorder prowork){ + //发企业微信--------------------开始(跟班组有关) + SysNoticeGroup noticeQo = new SysNoticeGroup(); + //取模板 + noticeQo.setNoticeId(23L); + + List notices = mesReportWorkMapper.getNoticesGroup(noticeQo); + if(!CollectionUtils.isEmpty(notices)) { + List wecharts = new ArrayList<>(); + for (SysNoticeGroup noticedto : notices) { + WechartDTO wechart0 = new WechartDTO(); + wechart0.setUserId(noticedto.getWxId()); + String contentInfo = noticedto.getNoticeContent(); + contentInfo = contentInfo.replace("${ymd}", DateUtils.getDate()) + .replace("${factory}", prowork.getFactoryCode()) + .replace("${carName}", prowork.getWorkorderName()); + + Matcher m = p2.matcher(contentInfo); + contentInfo = m.replaceAll(""); + wechart0.setText(contentInfo); + wecharts.add(wechart0); + } + logger.info("检验企业微信提醒请求:" + JSONObject.toJSONString(wecharts)); + if (!CollectionUtils.isEmpty(wecharts)) { + new Thread(() -> { + AjaxResult wxresult = remoteOpenService.sendWeChartMessage(wecharts); + logger.info("检验企业微信提醒结果:" + JSONObject.toJSONString(wxresult)); + + }).start(); + } + //发企业微信--------------------结束 + } + } } diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml index ba186b9d..916dcf51 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml @@ -964,8 +964,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - + insert into mes_report_work id, diff --git a/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderMapper.java b/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderMapper.java index 48041c6c..a0244f0b 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderMapper.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderMapper.java @@ -248,5 +248,8 @@ public interface ProOrderWorkorderMapper { void cleanCard(ProOrderWorkorder proOrderWorkorder); + ProOrderWorkorder getOldVersionUsedInfo(ProOrderWorkorder proOrderWorkorder); + + List getPreIdCardListNow(ProOrderWorkorder proOrderWorkorder); } diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java index 8de4d91c..a1aa6eb2 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java @@ -1269,58 +1269,68 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService { @DS("#header.poolName") public List getIdCardList(ProOrderWorkorder proOrderWorkorder) { List dtos = new ArrayList<>(); + //如果标识卡之前版本已经被用(attr1->1),则不生成新的 + ProOrderWorkorder oldVersion = proOrderWorkorderMapper.getOldVersionUsedInfo(proOrderWorkorder); //清除之前的非补打的 List dtos0 = null; - if(proOrderWorkorder.getPalletNo()==null&&proOrderWorkorder.getAddFlag().equals("0")) {//不是增打和补打 + if(proOrderWorkorder.getPalletNo()==null&&proOrderWorkorder.getAddFlag().equals("0")&&oldVersion==null) { + //不是增打和补打且还没用于入库 proOrderWorkorderMapper.cleanCard(proOrderWorkorder); } if(proOrderWorkorder.getAddFlag().equals("0")&&proOrderWorkorder.getPalletNo()==null){//非增打标志0 - dtos0 = proOrderWorkorderMapper.getPreIdCardList(proOrderWorkorder); - ProOrderWorkorder pw = null; - int i = 1; - Date nowDate = DateUtils.getNowDate(); - for(ProOrderWorkorder pow:dtos0){ - if(pow.getPalletNum()!=null){ - - BigDecimal pall = pow.getBatchQuantity(); - BigDecimal pn = pow.getPalletNum(); - - while(pall.compareTo(BigDecimal.ZERO)>0){ - pw = new ProOrderWorkorder(); - pw.setProductName(pow.getProductName()); - pw.setWorkorderCode(pow.getWorkorderCode()); - pw.setBatchCode(pow.getBatchCode()); - pw.setProductDateStr(pow.getProductDateStr()); - pw.setRecordId(IdUtils.fastSimpleUUID()); - if(pall.compareTo(pn)<0) {//最后一托盘 - pw.setBatchQuantity(pall); - }else{ - pw.setBatchQuantity(pn); + if(oldVersion != null){ + dtos = proOrderWorkorderMapper.getPreIdCardListNow(proOrderWorkorder); + for(ProOrderWorkorder pow:dtos){ + pow.setUmrez(pow.getBatchQuantity().multiply(pow.getUmrez()));//子单数量 + } + }else{ + dtos0 = proOrderWorkorderMapper.getPreIdCardList(proOrderWorkorder); + ProOrderWorkorder pw = null; + int i = 1; + Date nowDate = DateUtils.getNowDate(); + for(ProOrderWorkorder pow:dtos0){ + if(pow.getPalletNum()!=null){ + + BigDecimal pall = pow.getBatchQuantity(); + BigDecimal pn = pow.getPalletNum(); + + while(pall.compareTo(BigDecimal.ZERO)>0){ + pw = new ProOrderWorkorder(); + pw.setProductName(pow.getProductName()); + pw.setWorkorderCode(pow.getWorkorderCode()); + pw.setBatchCode(pow.getBatchCode()); + pw.setProductDateStr(pow.getProductDateStr()); + pw.setRecordId(IdUtils.fastSimpleUUID()); + if(pall.compareTo(pn)<0) {//最后一托盘 + pw.setBatchQuantity(pall); + }else{ + pw.setBatchQuantity(pn); + } + pw.setUnit(pow.getUnit()); + pw.setUmrez(pw.getBatchQuantity().multiply(pow.getUmrez()));//子单数量 + pw.setPalletNo(i++); + //批次+板号+物料+工单号 + pw.setPalletCode( + pow.getBatchCode() + "-" + + pw.getPalletNo() + "-" + + pow.getProductCode().replace("0000000","") + "-" + + pow.getWorkorderCode().replace("000","") + );//workorderCode 实际上是订单号 + pw.setCreateTime(nowDate); + pw.setCreateBy(SecurityUtils.getUsername()); + pw.setAddFlag("0");//增打标志 + dtos.add(pw); + pall = pall.subtract(pn); } - pw.setUnit(pow.getUnit()); - pw.setUmrez(pw.getBatchQuantity().multiply(pow.getUmrez()));//子单数量 - pw.setPalletNo(i++); - //批次+板号+物料+工单号 - pw.setPalletCode( - pow.getBatchCode() + "-" - + pw.getPalletNo() + "-" - + pow.getProductCode().replace("0000000","") + "-" - + pow.getWorkorderCode().replace("000","") - );//workorderCode 实际上是订单号 - pw.setCreateTime(nowDate); - pw.setCreateBy(SecurityUtils.getUsername()); - pw.setAddFlag("0");//增打标志 - dtos.add(pw); - pall = pall.subtract(pn); } } - } - if(!CollectionUtils.isEmpty(dtos)) {//不是增打和补打 - proOrderWorkorderMapper.addBatchPallet(dtos); - proOrderWorkorder.setProdType("1");//补打标识临时借用 - List dtosZ = proOrderWorkorderMapper.getPreIdCardListB(proOrderWorkorder);//增打 - if(!CollectionUtils.isEmpty(dtosZ)){ - dtos.addAll(dtosZ); + if(!CollectionUtils.isEmpty(dtos)) {//不是增打和补打 + proOrderWorkorderMapper.addBatchPallet(dtos); + proOrderWorkorder.setProdType("1");//补打标识临时借用 + List dtosZ = proOrderWorkorderMapper.getPreIdCardListB(proOrderWorkorder);//增打 + if(!CollectionUtils.isEmpty(dtosZ)){ + dtos.addAll(dtosZ); + } } } }else if(proOrderWorkorder.getAddFlag().equals("1")){//增打 diff --git a/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml b/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml index 68438b1e..288edfc7 100644 --- a/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml +++ b/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml @@ -867,6 +867,27 @@ and pow.del_flag = '0' and pow.workorder_id = #{workorderId} + + INSERT INTO pro_order_workorder_batch_pallet ( @@ -1008,7 +1029,7 @@ delete from pro_order_workorder_batch_pallet where workorder_code in( select workorder_code_sap from pro_order_workorder where workorder_code = #{workorderCode} - ) and add_flag = '0' + ) and add_flag = '0' and attr1 != '1' update qc_check_task set income_batch_no = #{newIncomeBatchNo} diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTaskIncomeController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTaskIncomeController.java index 411b51c1..93435c3c 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTaskIncomeController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckTaskIncomeController.java @@ -495,4 +495,18 @@ public class QcCheckTaskIncomeController extends BaseController { return success(qcCheckTaskIncomeService.getWeightValue(id)); } + /** + * 合并检验任务 + */ + @PostMapping(value = "/togetherTask") + public AjaxResult togetherTask(@RequestBody QcCheckTaskIncome income) { + int m = qcCheckTaskIncomeService.togetherTask(income); + if(m == 2){ + return error("任务已经检验无法合并"); + } + if(m == 3){ + return error("供应商、物料、送货日期不一致,不能合并"); + } + return success(); + } } diff --git a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckUnqualifiedController.java b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckUnqualifiedController.java index 489fa721..f2cb339b 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckUnqualifiedController.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/controller/QcCheckUnqualifiedController.java @@ -1,9 +1,16 @@ package com.op.quality.controller; import java.util.List; +import java.util.Map; import javax.servlet.http.HttpServletResponse; +import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; +import com.op.quality.domain.QcCheckTaskIncome; +import com.op.quality.domain.QcCheckTypeProject; +import com.op.quality.mapper.QcCheckTypeProjectMapper; +import com.op.system.api.domain.SysDictData; import com.op.system.api.domain.quality.OAInfo; +import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -35,6 +42,9 @@ public class QcCheckUnqualifiedController extends BaseController { @Autowired private IQcCheckUnqualifiedService qcCheckUnqualifiedService; + @Autowired + private QcCheckTypeProjectMapper qcCheckTypeProjectMapper; + /** * 查询不合格处理列表 */ @@ -127,4 +137,35 @@ public class QcCheckUnqualifiedController extends BaseController { List list = qcCheckUnqualifiedService.getOAInfoList(qcCheckUnqualified); return list; } + + /** + * 查询oa审批列表 + */ + @GetMapping(value = "/getUnqualifiedListMobile") + public List getUnqualifiedListMobile(QcCheckUnqualified qcCheckUnqualified) { + qcCheckUnqualified.setDelFlag("0"); + DynamicDataSourceContextHolder.push(qcCheckUnqualified.getFactoryCode()); + List list = qcCheckUnqualifiedService.selectQcCheckUnqualifiedList(qcCheckUnqualified); + return list; + } + /** + * 查询oa审批详情 + */ + @GetMapping("/getOAInfoListMobile") + public List getOAInfoListMobile(QcCheckUnqualified qcCheckUnqualified) { + List list = qcCheckUnqualifiedService.getOAInfoList(qcCheckUnqualified); + DynamicDataSourceContextHolder.push("master"); + SysDictData sData = new SysDictData(); + sData.setDictType("logtype"); + Map dictMap = qcCheckTypeProjectMapper.getDictMap(sData); + if (dictMap != null) { + for (OAInfo dto : list) { + if (StringUtils.isNotBlank(dto.getLOGTYPE())) { + dto.setLOGTYPE(dictMap.get(dto.getLOGTYPE()).getDictLabel()); + } + + } + } + return list; + } } 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 4078474e..c58ce192 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 @@ -145,4 +145,18 @@ public interface QcCheckTaskIncomeMapper { List getUserIdList(SysUser getUserIdList); SysUser getOaUserId(SysUser getUserIdList); + + int checkedTask(String ids); + + List checkedTaskInfo(String ids); + + List getTaskList(String ids); + + void updateLastTask(QcCheckTaskIncome lastTask); + + void deleteTask(String deleteIds); + + void deleteTaskDetail(String deleteIds); + + void deleteTaskUser(String deleteIds); } 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 c121d5b5..1502f8f0 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 @@ -111,4 +111,6 @@ public interface IQcCheckTaskIncomeService { SysUser getOaUserId(SysUser sysUser); int commitCheckResultsCg(QcCheckTaskIncome qcCheckTaskIncome); + + int togetherTask(QcCheckTaskIncome income); } 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 a96164b9..3cbb1174 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 @@ -826,6 +826,49 @@ public class QcCheckTaskIncomeServiceImpl implements return 1 ; } + @Override + @DS("#header.poolName") + public int togetherTask(QcCheckTaskIncome income) { + if(StringUtils.isNotBlank(income.getFactoryCode())){ + DynamicDataSourceContextHolder.push(income.getFactoryCode()); + } + String recordIds = income.getRecordId(); + int m = 1; + //检测是否有已经检验的任务 + int checkedNum = qcCheckTaskIncomeMapper.checkedTask("'"+recordIds.replace(",","','")+"'"); + if(checkedNum>0){ + return 2; + } + //供应商、物料、送货日期是否一致 + List checkedInfo = qcCheckTaskIncomeMapper.checkedTaskInfo("'"+recordIds.replace(",","','")+"'"); + if(!CollectionUtils.isEmpty(checkedInfo) && checkedInfo.size()>1){ + return 3; + } + //合并任务,向最新任务合并 + List taskLists = qcCheckTaskIncomeMapper.getTaskList("'"+recordIds.replace(",","','")+"'"); + BigDecimal qua = BigDecimal.ZERO; + String deleteIds = ""; + for(int n=0;n delete from qc_check_task_defect where belong_to = #{belongId} + + update qc_check_task + set del_flag = '1', + together_flag = '2' + where record_id in(${deleteIds}) + + + update qc_check_task_detail + set del_flag = '1' + where belong_to in(${deleteIds}) + + + update qc_check_task_user + set del_flag = '1' + where belong_to in(${deleteIds}) + select oa_user_id userId from sys_user WHERE user_name = #{userCode} and del_flag='0' + + + @@ -831,6 +871,12 @@ record_id = #{item} + + update qc_check_task + set quality = #{quality}, + together_flag = '1' + where record_id = #{recordId} + diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckUnqualifiedMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckUnqualifiedMapper.xml index 6936bfcf..d2c0274a 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckUnqualifiedMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckUnqualifiedMapper.xml @@ -48,9 +48,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and next_node_name like concat('%', #{nextNodeName}, '%') and qct.material_code like concat('%', #{materialCode}, '%') and qct.material_name like concat('%', #{materialName}, '%') - and qcu.del_flag = '0' + and qct.check_man_code = #{createBy} + + and qcu.del_flag = '0' and qcu.requestid is not null and CONVERT(varchar(30),qct.check_time, 120) >= #{checkTimeStart} and #{checkTimeEnd} > CONVERT(varchar(30),qct.check_time, 120) + and #{checkTime} = CONVERT(varchar(10),qct.check_time, 120) and qct.type_code = #{typeCode} and qct.check_type = #{checkType} diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcProCheckMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcProCheckMapper.xml index f3232d93..841240a6 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcProCheckMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcProCheckMapper.xml @@ -273,6 +273,7 @@ and qct.check_loc = #{checkLoc} and qct.check_type = #{checkType} + and CONVERT(varchar(10),qct.check_time, 120) = #{checkTimeStart} and qctu.check_man_code = #{checkManCode} and qct.check_status in (${checkStatus}) and (