成品检验

master
zhaoxiaolin 8 months ago
parent c651a1212e
commit 9ba60dba19

@ -352,7 +352,7 @@
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}
where sng.notice_id = #{noticeId} and sng.del_flag = '0'
</select>
</mapper>

@ -92,7 +92,7 @@ public class OpenController extends BaseController {
}
/**
* ( )
* ()
*/
@PostMapping(value = "/createCheckProduceTask")
public AjaxResult createCheckProduceTask(@RequestBody QcCheckTaskProduceDTO qcCheckTaskProduce) {
@ -116,6 +116,34 @@ public class OpenController extends BaseController {
return toAjax(openService.insertQcCheckTaskProduce(qcCheckTaskProduce));
}
/**
*
*/
@PostMapping(value = "/createCheckProductTask")
public AjaxResult createCheckProductTask(@RequestBody QcCheckTaskProduceDTO qcCheckTaskProduce) {
if (StringUtils.isBlank(qcCheckTaskProduce.getOrderNo())) {
return error("[orderNo]不能为空");
}
if (StringUtils.isBlank(qcCheckTaskProduce.getIncomeBatchNo())) {
return error("[incomeBatchNo]不能为空");
}
if (StringUtils.isBlank(qcCheckTaskProduce.getMaterialName())) {
return error("[materialName]不能为空");
}
if (StringUtils.isBlank(qcCheckTaskProduce.getMaterialCode())) {
return error("[materialCode]不能为空");
}
if (StringUtils.isBlank(qcCheckTaskProduce.getCheckType())) {
return error("[checkType]不能为空");
}
if (StringUtils.isBlank(qcCheckTaskProduce.getFactoryCode())) {
return error("[factoryCode]不能为空");
}
//添加检测任务
return toAjax(openService.insertQcCheckTaskProduce(qcCheckTaskProduce));
}
/**
* ===============ZL0010- :"workflowId": 26235=============
* <p>

@ -91,5 +91,7 @@ public interface OpenMapper {
List<SysNoticeGroup> getNoticesGroup(SysNoticeGroup noticeQo);
EquEquipmentDTO selectEquipmentDetailByEquipmentCode(String equipmentCode);
List<SysNoticeGroup> getNotices(SysNoticeGroup noticeQo);
}

@ -75,8 +75,7 @@ public class OpenServiceImpl implements OpenService {
@Autowired
private OpenMapper openMapper;
@Autowired
private RemoteOpenService remoteOpenService;
private static Pattern p2= Pattern.compile("<[^>]+>");
/**
*
@ -373,7 +372,7 @@ public class OpenServiceImpl implements OpenService {
logger.info("上位机报修企业微信提醒请求:" + JSONObject.toJSONString(wecharts));
if (!CollectionUtils.isEmpty(wecharts)) {
new Thread(() -> {
AjaxResult wxresult = remoteOpenService.sendWeChartMessage(wecharts);
AjaxResult wxresult = this.sendWeChartMessage(wecharts);
logger.info("上位机报修企业微信提醒结果:" + JSONObject.toJSONString(wxresult));
}).start();
@ -391,7 +390,7 @@ public class OpenServiceImpl implements OpenService {
// 1分钟不允许存在两条
Date lastData = openMapper.getLastTask(qcCheckTaskProduce);
if(this.oneMinHas(lastData)){
logger.info("【重复创建首检任务】orderNo:"+qcCheckTaskProduce.getOrderNo()+";"+"incomeBatchNo:"+qcCheckTaskProduce.getIncomeBatchNo());
logger.info("【重复创建任务】orderNo:"+qcCheckTaskProduce.getOrderNo()+";"+"incomeBatchNo:"+qcCheckTaskProduce.getIncomeBatchNo());
return 0;
}
@ -491,6 +490,37 @@ public class OpenServiceImpl implements OpenService {
}
int n = openMapper.addBatch(items);
logger.info(qcCheckTaskProduce.getOrderNo()+":qc_check_task_detail新增" + n + "成功");
//发企业微信--------------------开始(跟班组有关)
SysNoticeGroup noticeQo = new SysNoticeGroup();
if(qcCheckTaskProduce.getCheckType().equals("checkTypeCPPC")){
noticeQo.setNoticeId(12L);//批次成品检验
}
List<SysNoticeGroup> notices = openMapper.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("${checkNo}", qcCheckTaskProduce.getCheckNo()+"\n");
Matcher matcher = p2.matcher(contentInfo);
contentInfo = matcher.replaceAll("");
wechart0.setText(contentInfo);
wecharts.add(wechart0);
}
logger.info("来料检验企业微信提醒请求:" + JSONObject.toJSONString(wecharts));
if (!CollectionUtils.isEmpty(wecharts)) {
new Thread(() -> {
AjaxResult wxresult = this.sendWeChartMessage(wecharts);
logger.info("来料检验企业微信提醒结果:" + JSONObject.toJSONString(wxresult));
}).start();
}
//发企业微信--------------------结束
}
return n;
}

@ -396,7 +396,7 @@
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}
where sng.notice_id = #{noticeId} and sng.del_flag = '0'
</select>
<select id="selectEquipmentDetailByEquipmentCode" parameterType="String" resultType="com.op.system.api.domain.device.EquEquipmentDTO">
@ -404,5 +404,13 @@
where equipment_code = #{equipmentCode}
and del_flag = '0'
</select>
<select id="getNotices" resultType="com.op.system.api.domain.SysNoticeGroup">
select
sn.notice_title noticeTitle,
sn.notice_type noticeType,
sn.notice_content noticeContent
from sys_notice sn
where sn.notice_id = #{noticeId}
</select>
</mapper>

@ -157,7 +157,7 @@ public class QcCheckTaskWarehousingController extends BaseController {
}
/**
*
*
**/
@PostMapping("/createCPBatchTask")
public R createCPBatchTask() {

@ -121,10 +121,9 @@ public class QcCheckTypeProjectController extends BaseController {
return toAjax(qcCheckTypeProjectService.submitProjects(typeProjects));
}
//获取方案下拉
//获取方案分页
@GetMapping("/getProjectOptions")
public List<QcProjectType> getProjectOptions(QcCheckProject qcCheckProject) {
startPage();
List<QcProjectType> list = qcCheckTypeProjectService.getProjectOptions(qcCheckProject);
return list;
}

@ -177,6 +177,23 @@ public class QcCheckTaskWarehousing extends BaseEntity {
private BigDecimal bNoOkquality;
private BigDecimal cNoOkquality;
private String workorderCode;
private String checkName;
public String getWorkorderCode() {
return workorderCode;
}
public void setWorkorderCode(String workorderCode) {
this.workorderCode = workorderCode;
}
public String getCheckName() {
return checkName;
}
public void setCheckName(String checkName) {
this.checkName = checkName;
}
public BigDecimal getaNoOkquality() {
return aNoOkquality;

@ -86,4 +86,6 @@ public interface QcCheckTaskProduceMapper {
public List<QcCheckTaskProduce> getOrderWorksW2(ProOrderWorkorderDTO qoWork);
public QcCheckTaskProduce getLastXJTask(QcCheckTaskProduce productTask);
public List<QcCheckTaskProduce> getOrderWorksW3(ProOrderWorkorderDTO qoWork);
}

@ -96,6 +96,8 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
@Autowired
private QcCheckTaskUserMapper qcCheckTaskUserMapper;
private static Pattern p2= Pattern.compile("<[^>]+>");
/**
*
*
@ -284,7 +286,7 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
noticeQo.setNoticeId(6L);
List<SysNoticeGroup> notices = qcCheckTaskIncomeMapper.getNotices(noticeQo);
if(!CollectionUtils.isEmpty(notices)) {
Pattern p0= Pattern.compile("<[^>]+>");
List<WechartDTO> wecharts = new ArrayList<>();
//去主库查微信id
DynamicDataSourceContextHolder.push("master");// 这是数据源的key
@ -297,7 +299,7 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
wechart0.setUserId(wxid);
String contentInfo = notices.get(0).getNoticeContent();
contentInfo = contentInfo.replace("${checkNo}", qcCheckTaskIncome.getCheckNo()+"\n");
Matcher m = p0.matcher(contentInfo);
Matcher m = p2.matcher(contentInfo);
contentInfo = m.replaceAll("");
wechart0.setText(contentInfo);
wecharts.add(wechart0);
@ -840,7 +842,6 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
noticeQo.setNoticeId(9L);
List<SysNoticeGroup> notices = qcCheckTaskIncomeMapper.getNoticesGroup(noticeQo);
if(!CollectionUtils.isEmpty(notices)) {
Pattern p= Pattern.compile("<[^>]+>");
List<WechartDTO> wecharts = new ArrayList<>();
for (SysNoticeGroup noticedto : notices) {
WechartDTO wechart0 = new WechartDTO();
@ -851,7 +852,7 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
.replace("${checkNo}", qcCheckTaskIncome.getCheckNo()+"\n")
.replace("${supplierName}", qcCheckTaskIncome.getSupplierName()+"\n")
.replace("${quality}", qcCheckTaskIncome.getQuality()+"\n");
Matcher m = p.matcher(contentInfo);
Matcher m = p2.matcher(contentInfo);
contentInfo = m.replaceAll("");
wechart0.setText(contentInfo);
wecharts.add(wechart0);

@ -10,10 +10,13 @@ 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 ch.qos.logback.core.net.SyslogOutputStream;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
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;
@ -27,8 +30,11 @@ import com.op.quality.domain.*;
import com.op.quality.mapper.*;
import com.op.quality.service.IQcCheckTaskDefectService;
import com.op.quality.service.IQcCheckTaskUserService;
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 com.op.system.api.domain.mes.ProOrderWorkorderDTO;
import com.op.system.api.domain.quality.QcUserMaterialDTO;
import org.slf4j.Logger;
@ -79,6 +85,10 @@ public class QcCheckTaskWarehousingServiceImpl implements IQcCheckTaskWarehousin
private RemoteUserService remoteUserService;
@Autowired
private QcCheckTaskProduceMapper qcCheckTaskProduceMapper;
@Autowired
private RemoteOpenService remoteOpenService;
private static Pattern p2= Pattern.compile("<[^>]+>");
/**
*
*
@ -241,6 +251,7 @@ public class QcCheckTaskWarehousingServiceImpl implements IQcCheckTaskWarehousin
qcCheckTaskWarehousing.setSampleQuality(new BigDecimal(sampNum));
}
/**qc_check_task**/
qcCheckTaskWarehousing.setIncomeTime(DateUtils.getNowDate());//检验任务日期
int n = qcCheckTaskWarehousingMapper.insertQcCheckTaskWarehousing(qcCheckTaskWarehousing);
logger.info("qc_check_task:"+n+"成功");
@ -255,9 +266,36 @@ public class QcCheckTaskWarehousingServiceImpl implements IQcCheckTaskWarehousin
}
int s = qcCheckTaskDetailMapper.addBatch(items);
// /**pro_order_workorder**/
// qcCheckTaskWarehousing.setStatus("w6");
// qcCheckTaskWarehousingMapper.updateWorkOrderStauts(qcCheckTaskWarehousing);
//发企业微信--------------------开始(跟班组有关)
SysNoticeGroup noticeQo = new SysNoticeGroup();
if(qcCheckTaskWarehousing.getCheckType().equals("checkTypeCP")){
noticeQo.setNoticeId(7L);//成品检验
}
List<SysNoticeGroup> notices = qcCheckTaskIncomeMapper.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("${checkNo}", qcCheckTaskWarehousing.getCheckNo() + "\n");
Matcher matcher = p2.matcher(contentInfo);
contentInfo = matcher.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();
}
//发企业微信--------------------结束
}
logger.info("qc_check_task_detail:"+s+"成功");
return 1;
}
@ -373,21 +411,15 @@ public class QcCheckTaskWarehousingServiceImpl implements IQcCheckTaskWarehousin
ProOrderWorkorderDTO qoWork = new ProOrderWorkorderDTO();
qoWork.setStatus("w3");
//报工的
List<QcCheckTaskProduce> w3works = qcCheckTaskProduceMapper.getOrderWorksW2(qoWork);
List<QcCheckTaskProduce> w3works = qcCheckTaskProduceMapper.getOrderWorksW3(qoWork);
for(QcCheckTaskProduce productTask:w3works){
QcCheckTaskWarehousing cpTask = new QcCheckTaskWarehousing();
productTask.setCheckType("checkTypeCP");//入库检验
productTask.setOrderNo(productTask.getWorkorderCode());
BeanUtils.copyProperties(productTask,cpTask);
//是否已经存在入库检验
QcCheckTaskProduce cpTask0 = qcCheckTaskProduceMapper.getLastXJTask(productTask);
if(cpTask0 != null){
logger.info("++++++++++++入库检验任务生成:已经存在++++++++++++++");
}else{
int m = insertQcCheckTaskWarehousing(cpTask);
logger.info("++++++++++++入库检验任务生成" + m + "++++++++++++++");
}
int m = insertQcCheckTaskWarehousing(cpTask);
logger.info("++++++++++++入库检验任务生成" + m + "++++++++++++++");
}
logger.info("++++++++++++" + poolName + "++++入库检验巡检结束++++++++++");
}

@ -496,7 +496,7 @@
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}
where sng.notice_id = #{noticeId} and sng.del_flag = '0'
</select>
<select id="getWxId" resultType="java.lang.String">
select wx_id from sys_user where del_flag = '0' and wx_id is not null

@ -436,8 +436,31 @@
left join base_equipment be on be.equipment_code = pow.workorder_name and be.equipment_type_code = 'equ_type_bzx'
where pow.del_flag = '0'
and pow.status = #{status} and pow.parent_order = '0'
<!---->and (pow.product_date = CONVERT(varchar(10),GETDATE(), 120)
or pow.product_date = CONVERT(varchar(10),DATEADD(DAY, -1, GETDATE()), 120))
and (pow.product_date = CONVERT(varchar(10),GETDATE(), 120)
or pow.product_date = CONVERT(varchar(10),DATEADD(DAY, -1, GETDATE()), 120))
</select>
<select id="getOrderWorksW3" resultType="com.op.quality.domain.QcCheckTaskProduce">
select
pow.factory_code factoryCode,
pow.workorder_code workorderCode,
pow.product_code materialCode,
pow.product_name materialName,
pow.quantity_split quality,
pow.unit,
be.workshop_code supplierCode,
be.workshop_name supplierName,
pow.product_date incomeTime,
pow.workorder_name checkLoc,
pow.prod_type productType,
qct.check_no
from pro_order_workorder pow
left join base_equipment be on be.equipment_code = pow.workorder_name and be.equipment_type_code = 'equ_type_bzx'
left join qc_check_task qct on qct.order_no = pow.workorder_code and qct.check_type='checkTypeCP' and qct.del_flag = '0'
where pow.del_flag = '0'
and pow.status = #{status} and pow.parent_order = '0'
and (pow.product_date = CONVERT(varchar(10),GETDATE(), 120)
or pow.product_date = CONVERT(varchar(10),DATEADD(DAY, -1, GETDATE()), 120))
and qct.check_no is null
</select>
<select id="getLastXJTask" resultType="com.op.quality.domain.QcCheckTaskProduce">
select top 1

@ -35,6 +35,8 @@
<result property="delFlag" column="del_flag"/>
<result property="checkType" column="check_type"/>
<result property="sampleQuality" column="sample_quality"/>
<result property="checkName" column="checkName"/>
</resultMap>
<sql id="selectQcCheckTaskWarehousingVo">
@ -53,7 +55,7 @@
qct.supplier_code, qct.supplier_name, qct.income_time, qct.check_loc, qct.check_status,
qct.check_man_code, qct.check_man_name,qct.check_time, qct.check_result, qct.status,
qct.create_by,qct.create_time, qct.update_by, qct.update_time,qct.check_type, qct.sample_quality,
qct.noOk_quality, q.type_code
qct.noOk_quality, q.type_code ,q.check_name checkName
from qc_check_task qct
left join qc_check_type q on q.id = qct.check_type
<where>

@ -116,9 +116,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
quantity_split quality,
unit,
product_date incomeTime,
status
status,
workorder_name checkLocName
from pro_order_workorder
where status != 'w5' and parent_order = '0' and workorder_code_sap is not null
where status != 'w6' and parent_order = '0' and workorder_code_sap is not null
and workorder_name is not null
<if test="orderNo != null">and workorder_code_sap like concat ('%',#{orderNo},'%')</if>
order by product_date desc
</select>
@ -135,7 +137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from wms_product_put wpp
left join mes_report_work mrw on wpp.work_order = mrw.report_code
where 1=1
<if test="orderNo != null">and wpp.work_order like concat like ('%',#{orderNo})</if>
<if test="orderNo != null">and wpp.work_order like concat ('%',#{orderNo})</if>
order by wpp.create_time desc
</select>
<select id="getDefectListPDA" resultType="com.op.quality.domain.QcDefectType">

Loading…
Cancel
Save