巡检触发逻辑变更

master
zhaoxiaolin 1 year ago
parent f9cb4a5c1d
commit 52f2be01fd

@ -88,9 +88,7 @@ public class OpenController extends BaseController {
/**创建生产过程(烘房 首检)检验*/ /**创建生产过程(烘房 首检)检验*/
@PostMapping(value = "/createCheckProduceTask") @PostMapping(value = "/createCheckProduceTask")
public AjaxResult createCheckProduceTask(@RequestBody QcCheckTaskProduceDTO qcCheckTaskProduce) { public AjaxResult createCheckProduceTask(@RequestBody QcCheckTaskProduceDTO qcCheckTaskProduce) {
if(StringUtils.isBlank(qcCheckTaskProduce.getIncomeBatchNo())){
return error("[IncomeBatchNo]不能为空");
}
if(StringUtils.isBlank(qcCheckTaskProduce.getOrderNo())){ if(StringUtils.isBlank(qcCheckTaskProduce.getOrderNo())){
return error("[orderNo]不能为空"); return error("[orderNo]不能为空");
@ -105,7 +103,7 @@ public class OpenController extends BaseController {
} }
if(StringUtils.isBlank(qcCheckTaskProduce.getCheckType())){ if(StringUtils.isBlank(qcCheckTaskProduce.getCheckType())){
return error("[checkType:produce]不能为空"); return error("[checkType]不能为空");
} }
if(StringUtils.isBlank(qcCheckTaskProduce.getFactoryCode())){ if(StringUtils.isBlank(qcCheckTaskProduce.getFactoryCode())){
@ -116,7 +114,6 @@ public class OpenController extends BaseController {
return success(openService.insertQcCheckTaskProduce(qcCheckTaskProduce)); return success(openService.insertQcCheckTaskProduce(qcCheckTaskProduce));
} }
/** /**
* ZL0010- * ZL0010-
* CQ OEMCM LLLB 01MATNR MAKTX suppliernum * CQ OEMCM LLLB 01MATNR MAKTX suppliernum

@ -108,9 +108,7 @@ public class QcCheckTaskIncomeServiceImpl implements IQcCheckTaskIncomeService {
String createBy = SecurityUtils.getUsername(); String createBy = SecurityUtils.getUsername();
Date nowDate= DateUtils.getNowDate(); Date nowDate= DateUtils.getNowDate();
//获取当前所选工厂 //获取当前所选工厂
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); String factoryCode = qcCheckTaskIncome.getFactoryCode();
String key = "#header.poolName";
String factoryCode = request.getHeader(key.substring(8)).replace("ds_","");
qcCheckTaskIncome.setCheckNo(bpDD+liushuiStr); qcCheckTaskIncome.setCheckNo(bpDD+liushuiStr);

@ -215,7 +215,7 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService
int m=qcCheckTaskIncomeMapper.addCheckUsers(users); int m=qcCheckTaskIncomeMapper.addCheckUsers(users);
logger.info("检查人新增"+m+"成功"); logger.info("检查人新增"+m+"成功");
} }
/**qc_check_task**/
qcCheckTaskProduceMapper.insertQcCheckTaskProduce(qcCheckTaskProduce); qcCheckTaskProduceMapper.insertQcCheckTaskProduce(qcCheckTaskProduce);
/**qc_check_task_detail**/ /**qc_check_task_detail**/
@ -343,6 +343,7 @@ public class QcCheckTaskProduceServiceImpl implements IQcCheckTaskProduceService
List<QcCheckTaskProduce> works = qcCheckTaskProduceMapper.getOrderWorks(qoWork); List<QcCheckTaskProduce> works = qcCheckTaskProduceMapper.getOrderWorks(qoWork);
for(QcCheckTaskProduce productTask:works){ for(QcCheckTaskProduce productTask:works){
productTask.setCheckType("checkTypeSCXJ");//过程检验-巡检 productTask.setCheckType("checkTypeSCXJ");//过程检验-巡检
productTask.setOrderNo(productTask.getWorkorderCode());
Date nowTime = DateUtils.getNowDate(); Date nowTime = DateUtils.getNowDate();
Date startTime = productTask.getCreateTime(); Date startTime = productTask.getCreateTime();

@ -110,33 +110,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where type_code = #{typeCode} and del_flag='0' where type_code = #{typeCode} and del_flag='0'
</select> </select>
<select id="getOrderWorks" resultType="com.op.quality.domain.QcCheckTaskProduce"> <select id="getOrderWorks" resultType="com.op.quality.domain.QcCheckTaskProduce">
select pow.factory_code factoryCode, select qct.factory_code factoryCode,
powb.batch_code incomeBatchNo, qct.order_no workorderCode,
powb.qc_status, qct.material_code materialCode,
pow.workorder_code workorderCode, qct.material_name materialName,
pow.product_code materialCode, qct.quality,
pow.product_name materialName, qct.unit,
pow.quantity_split quality, qct.supplier_code supplierCode,
pow.unit, qct.supplier_name supplierName,
e.workshop_code supplierCode, qct.income_time incomeTime,
e.workshop_name supplierName, max(qct.create_time) createTime,
pow.product_date incomeTime, qct.check_loc checkLoc
task.createTime, from qc_check_task qct
task.order_no orderNo, left join pro_order_workorder pow on qct.order_no = pow.workorder_code
task.check_loc checkLoc where check_type = 'checkTypeSCXJ'
from pro_order_workorder pow
left join pro_order_workorder_batch powb on powb.workorder_id = pow.workorder_id
left join base_equipment e on e.equipment_code = pow.workorder_name
left join (
select max(create_time) createTime,income_batch_no,order_no,check_loc
from qc_check_task
where type_code = 'produce'
and CONVERT(varchar(10),income_time, 120) = CONVERT(varchar(10),GETDATE(), 120) and CONVERT(varchar(10),income_time, 120) = CONVERT(varchar(10),GETDATE(), 120)
GROUP BY income_batch_no,order_no,check_loc and pow.status = 'w2'
) task on task.income_batch_no = powb.batch_code group by qct.factory_code,
where pow.status = 'w2' and pow.parent_order = '0' and pow.del_flag ='0' qct.order_no,qct.material_code,qct.material_name,
and powb.del_flag = '0' and pow.product_date >= '2023-12-22' qct.quality,qct.unit,qct.supplier_code,qct.supplier_name,
and task.createTime is not null qct.income_time,qct.check_loc
</select> </select>
<insert id="insertQcCheckTaskProduce" parameterType="QcCheckTaskProduce"> <insert id="insertQcCheckTaskProduce" parameterType="QcCheckTaskProduce">

Loading…
Cancel
Save