细节优化

master
zhaoxiaolin 7 months ago
parent bb82554e6f
commit 9074446d16

@ -48,4 +48,7 @@ public interface RemoteMesService {
@PostMapping("/wcsInterface/changeTransferResultTask")
public R changeTransferResultTask();
@PostMapping("/reportWorks/mesProTask")
public R mesProTask();
}

@ -72,6 +72,11 @@ public class RemoteMesFallbackFactory implements FallbackFactory<RemoteMesServic
return R.fail("交接班修改信息失败:" + throwable.getMessage());
}
@Override
public R mesProTask() {
return R.fail("+生产情况企业微信提醒失败:" + throwable.getMessage());
}
};
}

@ -49,7 +49,7 @@ public class RyTask {
public void ryNoParams() {
System.out.println("执行无参方法");
}
/*************MES定时任务开始*******************/
public void shopOrderSync(){
SapShopOrderQuery sapProOrder = new SapShopOrderQuery();
//sapProOrder.setCreateTime(DateUtils.getNowDate());//TODO;
@ -131,6 +131,13 @@ public class RyTask {
remoteMesService.dataBKTask();
}
/**每天10点一次**/
public void mesProTask(){
logger.info("++生产情况企业微信提醒+开始++mesProTask+++++");
remoteMesService.mesProTask();
}
/*************MES定时任务结束*******************/
/**点检计划生成**/
public void createSpotCheckPlanTask(){
logger.info("++点检计划+开始++createSpotCheckPlanTask+++++");

@ -1,5 +1,6 @@
package com.op.mes.controller;
import com.op.common.core.domain.R;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.page.TableDataInfo;
import com.op.common.security.annotation.RequiresPermissions;
@ -7,6 +8,7 @@ import com.op.mes.domain.MesReportWork;
import com.op.mes.service.IMesReportWorksService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -31,4 +33,12 @@ public class MesReportWorksController extends BaseController {
// return getDataTable(hzlist);
return null;
}
/**
*
**/
@PostMapping("/mesProTask")
public R mesProTask() {
return mesReportWorksService.mesProTask();
}
}

@ -10,6 +10,7 @@ import com.op.mes.domain.dto.QuantityDto;
import com.op.mes.domain.dto.SysFactoryDto;
import com.op.mes.domain.vo.MesDailyReportVo;
import com.op.mes.domain.vo.MesMonthReportVo;
import com.op.system.api.domain.SysNoticeGroup;
import com.op.system.api.domain.SysUser;
import com.op.system.api.domain.device.EquEquipmentDTO;
import com.op.system.api.domain.mes.ProOrderWorkorderDTO;
@ -192,4 +193,6 @@ public interface MesReportWorkMapper {
String getProductReason(QuantityDto quantityDto);
String getTypeName(String productCode);
List<SysNoticeGroup> getNoticesGroup(SysNoticeGroup noticeQo);
}

@ -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<MesReportWork> getReportWorksList(MesReportWork mesReportWork);
R mesProTask();
}

@ -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<MesReportWork> getReportWorksList(MesReportWork mesReportWork) {
return null;//mesReportWorksMapper.getReportWorkList(mesReportWork);
}
@Override
public R mesProTask() {
// 加载sf-cloud库的sys_datasource
SysUser sysUser = new SysUser();
sysUser.setUserId(1L);
R<List<Map<String, String>>> dateSources0 = remoteUserService.getPoolNameList(sysUser);
List<Map<String, String>> dateSources = dateSources0.getData();
ExecutorService executorService = new ThreadPoolExecutor(
dateSources.size(),
dateSources.size(),
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>());
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<SysNoticeGroup> notices = mesReportWorkMapper.getNoticesGroup(noticeQo);
if(!CollectionUtils.isEmpty(notices)) {
List<WechartDTO> 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();
}
//发企业微信--------------------结束
}
}
}

@ -964,8 +964,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getTypeName" resultType="java.lang.String">
select top 1 category from base_product_attached where product_code = #{productCode}
</select>
<select id="getNoticesGroup" resultType="com.op.system.api.domain.SysNoticeGroup">
select sng.notice_id noticeId,
sn.notice_title noticeTitle,
sn.notice_type noticeType,
sn.notice_content noticeContent,
btu.user_name userCode,
case when btu.wx_id is null then btu.user_name else btu.wx_id end wxId
from sys_notice_group sng
left join sys_notice sn on sng.notice_id = sn.notice_id
left join base_team_user btu on sng.group_code = btu.team_code
where sng.notice_id = #{noticeId} and sng.del_flag = '0'
</select>
<insert id="insertMesReportWork" parameterType="MesReportWork">
<insert id="insertMesReportWork" parameterType="MesReportWork">
insert into mes_report_work
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>

@ -248,5 +248,8 @@ public interface ProOrderWorkorderMapper {
void cleanCard(ProOrderWorkorder proOrderWorkorder);
ProOrderWorkorder getOldVersionUsedInfo(ProOrderWorkorder proOrderWorkorder);
List<ProOrderWorkorder> getPreIdCardListNow(ProOrderWorkorder proOrderWorkorder);
}

@ -1269,58 +1269,68 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
@DS("#header.poolName")
public List<ProOrderWorkorder> getIdCardList(ProOrderWorkorder proOrderWorkorder) {
List<ProOrderWorkorder> dtos = new ArrayList<>();
//如果标识卡之前版本已经被用(attr1->1),则不生成新的
ProOrderWorkorder oldVersion = proOrderWorkorderMapper.getOldVersionUsedInfo(proOrderWorkorder);
//清除之前的非补打的
List<ProOrderWorkorder> 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<ProOrderWorkorder> dtosZ = proOrderWorkorderMapper.getPreIdCardListB(proOrderWorkorder);//增打
if(!CollectionUtils.isEmpty(dtosZ)){
dtos.addAll(dtosZ);
if(!CollectionUtils.isEmpty(dtos)) {//不是增打和补打
proOrderWorkorderMapper.addBatchPallet(dtos);
proOrderWorkorder.setProdType("1");//补打标识临时借用
List<ProOrderWorkorder> dtosZ = proOrderWorkorderMapper.getPreIdCardListB(proOrderWorkorder);//增打
if(!CollectionUtils.isEmpty(dtosZ)){
dtos.addAll(dtosZ);
}
}
}
}else if(proOrderWorkorder.getAddFlag().equals("1")){//增打

@ -867,6 +867,27 @@
and pow.del_flag = '0'
and pow.workorder_id = #{workorderId}
</select>
<select id="getOldVersionUsedInfo" resultType="com.op.plan.domain.ProOrderWorkorder">
select top 1 attr1 from pro_order_workorder_batch_pallet where workorder_code in(
select workorder_code_sap from pro_order_workorder where workorder_code = #{workorderCode}
) and attr1 = '1'
</select>
<select id="getPreIdCardListNow" resultType="com.op.plan.domain.ProOrderWorkorder">
select pow.product_name productName,
pow.product_code productCode,
pow.product_date productDateStr,
pow.workorder_code_sap workorderCode,
powbp.batch_code batchCode,
powbp.quantity batchQuantity,pow.unit,
powbp.pallet_num palletNo,
bp.umrez,
powbp.pallet_code palletCode
from pro_order_workorder_batch_pallet powbp
left join pro_order_workorder pow on powbp.workorder_code = pow.workorder_code_sap
left join base_product bp on bp.product_code = pow.product_code
where pow.workorder_code = #{workorderCode} and pow.del_flag = '0'
order by CAST(powbp.pallet_num AS INT)
</select>
<insert id="addBatchPallet">
INSERT INTO pro_order_workorder_batch_pallet (
@ -1008,7 +1029,7 @@
<delete id="cleanCard">
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'
</delete>
<update id="updateCheckTaskBatch" parameterType="com.op.plan.domain.dto.CheckTaskBatchDTO">
update qc_check_task set income_batch_no = #{newIncomeBatchNo}

@ -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();
}
}

@ -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<OAInfo> list = qcCheckUnqualifiedService.getOAInfoList(qcCheckUnqualified);
return list;
}
/**
* oa
*/
@GetMapping(value = "/getUnqualifiedListMobile")
public List<QcCheckUnqualified> getUnqualifiedListMobile(QcCheckUnqualified qcCheckUnqualified) {
qcCheckUnqualified.setDelFlag("0");
DynamicDataSourceContextHolder.push(qcCheckUnqualified.getFactoryCode());
List<QcCheckUnqualified> list = qcCheckUnqualifiedService.selectQcCheckUnqualifiedList(qcCheckUnqualified);
return list;
}
/**
* oa
*/
@GetMapping("/getOAInfoListMobile")
public List<OAInfo> getOAInfoListMobile(QcCheckUnqualified qcCheckUnqualified) {
List<OAInfo> list = qcCheckUnqualifiedService.getOAInfoList(qcCheckUnqualified);
DynamicDataSourceContextHolder.push("master");
SysDictData sData = new SysDictData();
sData.setDictType("logtype");
Map<String, SysDictData> 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;
}
}

@ -145,4 +145,18 @@ public interface QcCheckTaskIncomeMapper {
List<SysUser> getUserIdList(SysUser getUserIdList);
SysUser getOaUserId(SysUser getUserIdList);
int checkedTask(String ids);
List<QcCheckTaskIncome> checkedTaskInfo(String ids);
List<QcCheckTaskIncome> getTaskList(String ids);
void updateLastTask(QcCheckTaskIncome lastTask);
void deleteTask(String deleteIds);
void deleteTaskDetail(String deleteIds);
void deleteTaskUser(String deleteIds);
}

@ -111,4 +111,6 @@ public interface IQcCheckTaskIncomeService {
SysUser getOaUserId(SysUser sysUser);
int commitCheckResultsCg(QcCheckTaskIncome qcCheckTaskIncome);
int togetherTask(QcCheckTaskIncome income);
}

@ -826,6 +826,49 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> 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<QcCheckTaskIncome> checkedInfo = qcCheckTaskIncomeMapper.checkedTaskInfo("'"+recordIds.replace(",","','")+"'");
if(!CollectionUtils.isEmpty(checkedInfo) && checkedInfo.size()>1){
return 3;
}
//合并任务,向最新任务合并
List<QcCheckTaskIncome> taskLists = qcCheckTaskIncomeMapper.getTaskList("'"+recordIds.replace(",","','")+"'");
BigDecimal qua = BigDecimal.ZERO;
String deleteIds = "";
for(int n=0;n<taskLists.size();n++){
QcCheckTaskIncome task = taskLists.get(n);
qua = qua.add(task.getQuality());
if(n!=0){
deleteIds+= task.getRecordId()+",";
}
}
QcCheckTaskIncome lastTask = taskLists.get(0);
lastTask.setQuality(qua);
qcCheckTaskIncomeMapper.updateLastTask(lastTask);
//删除其它任务
deleteIds = "'"+
deleteIds.replace(",","','")
+"'";
qcCheckTaskIncomeMapper.deleteTask(deleteIds);
qcCheckTaskIncomeMapper.deleteTaskDetail(deleteIds);
qcCheckTaskIncomeMapper.deleteTaskUser(deleteIds);
return m;
}
@Override
//@Transactional(rollbackFor = Exception.class)
public int commitCheckResults(QcCheckTaskIncome qcCheckTaskIncome) {

@ -536,6 +536,22 @@
<delete id="deleteQcCheckTaskDefects">
delete from qc_check_task_defect where belong_to = #{belongId}
</delete>
<update id="deleteTask">
update qc_check_task
set del_flag = '1',
together_flag = '2'
where record_id in(${deleteIds})
</update>
<update id="deleteTaskDetail">
update qc_check_task_detail
set del_flag = '1'
where belong_to in(${deleteIds})
</update>
<update id="deleteTaskUser">
update qc_check_task_user
set del_flag = '1'
where belong_to in(${deleteIds})
</update>
<select id="selectQcCheckTaskCheckNoByRecordIds" parameterType="String" resultMap="QcCheckTaskIncomeResult">
select check_no from qc_check_task where record_id in
@ -819,6 +835,30 @@
<select id="getOaUserId" resultType="com.op.system.api.domain.SysUser">
select oa_user_id userId from sys_user WHERE user_name = #{userCode} and del_flag='0'
</select>
<select id="checkedTask" resultType="java.lang.Integer">
select count(0) from qc_check_task
where del_flag = '0' and record_id in(${ids}) and check_status = '2'
</select>
<select id="checkedTaskInfo" resultType="com.op.quality.domain.QcCheckTaskIncome">
select count(0),
qct.supplier_code supplierCode,
qct.material_code materialCode,
CONVERT(varchar(10),qct.income_time, 120)
from qc_check_task qct
where qct.del_flag = '0' and qct.record_id in(${ids})
group by qct.supplier_code,
qct.material_code
,CONVERT(varchar(10),qct.income_time, 120)
</select>
<select id="getTaskList" resultType="com.op.quality.domain.QcCheckTaskIncome">
select
qct.record_id recordId,
qct.check_no checkNo,
qct.quality
from qc_check_task qct
where qct.record_id in(${ids})
order by qct.check_no desc
</select>
<!--批量更新原始表-->
<update id="updateIncomeBatchList">
@ -831,6 +871,12 @@
record_id = #{item}
</foreach>
</update>
<update id="updateLastTask">
update qc_check_task
set quality = #{quality},
together_flag = '1'
where record_id = #{recordId}
</update>
</mapper>

@ -48,9 +48,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="nextNodeName != null and nextNodeName != ''"> and next_node_name like concat('%', #{nextNodeName}, '%')</if>
<if test="materialCode != null and materialCode != ''"> and qct.material_code like concat('%', #{materialCode}, '%')</if>
<if test="materialName != null and materialName != ''"> and qct.material_name like concat('%', #{materialName}, '%')</if>
and qcu.del_flag = '0'
<if test="createBy != null and createBy != ''"> and qct.check_man_code = #{createBy} </if>
and qcu.del_flag = '0' and qcu.requestid is not null
<if test="checkTimeStart != null "> and CONVERT(varchar(30),qct.check_time, 120) >= #{checkTimeStart}</if>
<if test="checkTimeEnd != null "> and #{checkTimeEnd} > CONVERT(varchar(30),qct.check_time, 120)</if>
<if test="checkTime != null "> and #{checkTime} = CONVERT(varchar(10),qct.check_time, 120)</if>
<if test="typeCode != null and typeCode != ''"> and qct.type_code = #{typeCode}</if>
<if test="checkType != null and checkType != ''"> and qct.check_type = #{checkType}</if>
</where>

@ -273,6 +273,7 @@
</if>
<if test="checkLoc != null and checkLoc != ''">and qct.check_loc = #{checkLoc}</if>
<if test="checkType != null and checkType != ''">and qct.check_type = #{checkType}</if>
<if test="checkTimeStart != null and checkTimeStart != ''">and CONVERT(varchar(10),qct.check_time, 120) = #{checkTimeStart}</if>
<if test="checkManCode != null and checkManCode != ''">and qctu.check_man_code = #{checkManCode}</if>
<if test="checkStatus != null and checkStatus != ''">and qct.check_status in (${checkStatus})</if>
and (

Loading…
Cancel
Save