新增留样复检功能
parent
35d1881a1b
commit
300aabfa53
@ -0,0 +1,77 @@
|
|||||||
|
package com.op.quality.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.op.common.core.utils.poi.ExcelUtil;
|
||||||
|
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.log.annotation.Log;
|
||||||
|
import com.op.common.log.enums.BusinessType;
|
||||||
|
import com.op.quality.domain.QcCheckSampleTask;
|
||||||
|
import com.op.quality.domain.query.QcCheckSampleTaskQuery;
|
||||||
|
import com.op.quality.service.IQcCheckSampleTaskService;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 留样检验
|
||||||
|
*
|
||||||
|
* @author 019117
|
||||||
|
* @date 2023/10/12
|
||||||
|
*/
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/qc-check-sample-task")
|
||||||
|
public class QcCheckSampleTaskController extends BaseController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IQcCheckSampleTaskService qcCheckSampleTaskService;
|
||||||
|
|
||||||
|
|
||||||
|
/** 获取留样列表 **/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(QcCheckSampleTaskQuery query) {
|
||||||
|
startPage();
|
||||||
|
List<QcCheckSampleTask> list = qcCheckSampleTaskService.selectQcCheckSampleTaskList(query);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** 获取待复检样品列表 **/
|
||||||
|
@GetMapping("/wait-list")
|
||||||
|
public TableDataInfo waitList(QcCheckSampleTaskQuery query) {
|
||||||
|
startPage();
|
||||||
|
List<QcCheckSampleTask> list = qcCheckSampleTaskService.selectQcWaitCheckSampleTaskList(query);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** 更新留样信息 **/
|
||||||
|
@PutMapping()
|
||||||
|
public AjaxResult updateQcCheckSampleTask(@RequestBody QcCheckSampleTask qcCheckSampleTask) {
|
||||||
|
qcCheckSampleTaskService.updateQcCheckSampleTask(qcCheckSampleTask);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出留样观察与复检记录表 **/
|
||||||
|
@Log(title = "留样观察与复检记录表", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void exportQcCheckSampleTask(HttpServletResponse response, QcCheckSampleTaskQuery query) {
|
||||||
|
List<QcCheckSampleTask> list = qcCheckSampleTaskService.selectQcCheckSampleTaskList(query);
|
||||||
|
ExcelUtil<QcCheckSampleTask> util = new ExcelUtil<QcCheckSampleTask>(QcCheckSampleTask.class);
|
||||||
|
util.exportExcel(response, list, "留样观察与复检记录表");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同步留样检验任务
|
||||||
|
* **/
|
||||||
|
@PostMapping("createTask")
|
||||||
|
public AjaxResult createCheckSampleTask() {
|
||||||
|
return qcCheckSampleTaskService.createCheckSampleTask();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,245 @@
|
|||||||
|
package com.op.quality.domain;
|
||||||
|
|
||||||
|
import com.op.common.core.annotation.Excel;
|
||||||
|
import com.op.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 留样检验-实体类
|
||||||
|
* @author 019117
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class QcCheckSampleTask extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** id **/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/** 物料名称 **/
|
||||||
|
@Excel(name = "物料名称")
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
/** 来料批次号 **/
|
||||||
|
@Excel(name = "来料批次号")
|
||||||
|
private String incomeBatchNo;
|
||||||
|
|
||||||
|
/** 订单号 **/
|
||||||
|
@Excel(name = "订单号")
|
||||||
|
private String workOrderCodeSap;
|
||||||
|
|
||||||
|
/** 留样时间 **/
|
||||||
|
@Excel(name = "留样时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date sampleTime;
|
||||||
|
|
||||||
|
|
||||||
|
/** 留样数量 **/
|
||||||
|
@Excel(name = "留样数量")
|
||||||
|
private String sampleNum;
|
||||||
|
|
||||||
|
|
||||||
|
/** 留样存放位置 **/
|
||||||
|
@Excel(name = "留样存放位置")
|
||||||
|
private String sampleAddress;
|
||||||
|
|
||||||
|
/** 第一次检验人工号 **/
|
||||||
|
private String firstCheckUserCode;
|
||||||
|
|
||||||
|
/** 第一次检验人姓名 **/
|
||||||
|
@Excel(name = "第一次检验人姓名")
|
||||||
|
private String firstCheckUserName;
|
||||||
|
|
||||||
|
/** 第一次检验结果 **/
|
||||||
|
@Excel(name = "第一次检验结果")
|
||||||
|
private String firstCheckResult;
|
||||||
|
|
||||||
|
/** 第一次检验时间 **/
|
||||||
|
@Excel(name = "第一次检验时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private String firstCheckTime;
|
||||||
|
|
||||||
|
/** 第二次检验人工号 **/
|
||||||
|
private String secondCheckUserCode;
|
||||||
|
|
||||||
|
/** 第二次检验人姓名 **/
|
||||||
|
@Excel(name = "第二次检验人姓名")
|
||||||
|
private String secondCheckUserName;
|
||||||
|
|
||||||
|
/** 第二次检验结果 **/
|
||||||
|
@Excel(name = "第二次检验结果")
|
||||||
|
private String secondCheckResult;
|
||||||
|
|
||||||
|
/** 第二次检验时间 **/
|
||||||
|
@Excel(name = "第二次检验时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private String secondCheckTime;
|
||||||
|
|
||||||
|
/** 第三次检验人工号 **/
|
||||||
|
private String thirdCheckUserCode;
|
||||||
|
|
||||||
|
/** 第三次检验人姓名 **/
|
||||||
|
@Excel(name = "第三次检验人姓名")
|
||||||
|
private String thirdCheckUserName;
|
||||||
|
|
||||||
|
/** 第三次检验结果 **/
|
||||||
|
@Excel(name = "第三次检验结果")
|
||||||
|
private String thirdCheckResult;
|
||||||
|
|
||||||
|
/** 第三次检验时间 **/
|
||||||
|
@Excel(name = "第三次检验时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private String thirdCheckTime;
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMaterialName() {
|
||||||
|
return materialName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaterialName(String materialName) {
|
||||||
|
this.materialName = materialName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIncomeBatchNo() {
|
||||||
|
return incomeBatchNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIncomeBatchNo(String incomeBatchNo) {
|
||||||
|
this.incomeBatchNo = incomeBatchNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWorkOrderCodeSap() {
|
||||||
|
return workOrderCodeSap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWorkOrderCodeSap(String workOrderCodeSap) {
|
||||||
|
this.workOrderCodeSap = workOrderCodeSap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getSampleTime() {
|
||||||
|
return sampleTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSampleTime(Date sampleTime) {
|
||||||
|
this.sampleTime = sampleTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSampleNum() {
|
||||||
|
return sampleNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSampleNum(String sampleNum) {
|
||||||
|
this.sampleNum = sampleNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSampleAddress() {
|
||||||
|
return sampleAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSampleAddress(String sampleAddress) {
|
||||||
|
this.sampleAddress = sampleAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFirstCheckUserCode() {
|
||||||
|
return firstCheckUserCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFirstCheckUserCode(String firstCheckUserCode) {
|
||||||
|
this.firstCheckUserCode = firstCheckUserCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFirstCheckUserName() {
|
||||||
|
return firstCheckUserName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFirstCheckUserName(String firstCheckUserName) {
|
||||||
|
this.firstCheckUserName = firstCheckUserName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFirstCheckResult() {
|
||||||
|
return firstCheckResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFirstCheckResult(String firstCheckResult) {
|
||||||
|
this.firstCheckResult = firstCheckResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFirstCheckTime() {
|
||||||
|
return firstCheckTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFirstCheckTime(String firstCheckTime) {
|
||||||
|
this.firstCheckTime = firstCheckTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSecondCheckUserCode() {
|
||||||
|
return secondCheckUserCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSecondCheckUserCode(String secondCheckUserCode) {
|
||||||
|
this.secondCheckUserCode = secondCheckUserCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSecondCheckUserName() {
|
||||||
|
return secondCheckUserName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSecondCheckUserName(String secondCheckUserName) {
|
||||||
|
this.secondCheckUserName = secondCheckUserName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSecondCheckResult() {
|
||||||
|
return secondCheckResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSecondCheckResult(String secondCheckResult) {
|
||||||
|
this.secondCheckResult = secondCheckResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSecondCheckTime() {
|
||||||
|
return secondCheckTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSecondCheckTime(String secondCheckTime) {
|
||||||
|
this.secondCheckTime = secondCheckTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getThirdCheckUserCode() {
|
||||||
|
return thirdCheckUserCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setThirdCheckUserCode(String thirdCheckUserCode) {
|
||||||
|
this.thirdCheckUserCode = thirdCheckUserCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getThirdCheckUserName() {
|
||||||
|
return thirdCheckUserName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setThirdCheckUserName(String thirdCheckUserName) {
|
||||||
|
this.thirdCheckUserName = thirdCheckUserName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getThirdCheckResult() {
|
||||||
|
return thirdCheckResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setThirdCheckResult(String thirdCheckResult) {
|
||||||
|
this.thirdCheckResult = thirdCheckResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getThirdCheckTime() {
|
||||||
|
return thirdCheckTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setThirdCheckTime(String thirdCheckTime) {
|
||||||
|
this.thirdCheckTime = thirdCheckTime;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,97 @@
|
|||||||
|
package com.op.quality.domain.query;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 留样检验查询实体类
|
||||||
|
*
|
||||||
|
* @author 019117
|
||||||
|
* @date 2025/3/25 10:50
|
||||||
|
*/
|
||||||
|
public class QcCheckSampleTaskQuery {
|
||||||
|
|
||||||
|
/** 时间查询条件 **/
|
||||||
|
private String queryDate;
|
||||||
|
|
||||||
|
/** 留样起始时间 **/
|
||||||
|
private String startSampleDate;
|
||||||
|
|
||||||
|
/** 留样结束时间 **/
|
||||||
|
private String endSampleDate;
|
||||||
|
|
||||||
|
/** 物料名称 **/
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
/** 订单号 **/
|
||||||
|
private String workOrderCodeSap;
|
||||||
|
|
||||||
|
private String firstDate;
|
||||||
|
|
||||||
|
private String secondDate;
|
||||||
|
|
||||||
|
private String thirdDate;
|
||||||
|
|
||||||
|
|
||||||
|
public String getQueryDate() {
|
||||||
|
return queryDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQueryDate(String queryDate) {
|
||||||
|
this.queryDate = queryDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStartSampleDate() {
|
||||||
|
return startSampleDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartSampleDate(String startSampleDate) {
|
||||||
|
this.startSampleDate = startSampleDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEndSampleDate() {
|
||||||
|
return endSampleDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndSampleDate(String endSampleDate) {
|
||||||
|
this.endSampleDate = endSampleDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMaterialName() {
|
||||||
|
return materialName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaterialName(String materialName) {
|
||||||
|
this.materialName = materialName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWorkOrderCodeSap() {
|
||||||
|
return workOrderCodeSap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWorkOrderCodeSap(String workOrderCodeSap) {
|
||||||
|
this.workOrderCodeSap = workOrderCodeSap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFirstDate() {
|
||||||
|
return firstDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFirstDate(String firstDate) {
|
||||||
|
this.firstDate = firstDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSecondDate() {
|
||||||
|
return secondDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSecondDate(String secondDate) {
|
||||||
|
this.secondDate = secondDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getThirdDate() {
|
||||||
|
return thirdDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setThirdDate(String thirdDate) {
|
||||||
|
this.thirdDate = thirdDate;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
package com.op.quality.mapper;
|
||||||
|
|
||||||
|
import com.op.quality.domain.QcCheckSampleTask;
|
||||||
|
import com.op.quality.domain.query.QcCheckSampleTaskQuery;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* reason
|
||||||
|
*
|
||||||
|
* @author 019117
|
||||||
|
* @date 2025/3/25
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface QcCheckSampleTaskMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 留样检验任务列表
|
||||||
|
* **/
|
||||||
|
List<QcCheckSampleTask> selectQcCheckSampleTaskList(QcCheckSampleTaskQuery query);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取待复检样品列表
|
||||||
|
* **/
|
||||||
|
List<QcCheckSampleTask> selectQcWaitCheckSampleTaskList(QcCheckSampleTaskQuery query);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新留样信息
|
||||||
|
*
|
||||||
|
* @param qcCheckSampleTask 成品留样实体类
|
||||||
|
**/
|
||||||
|
void updateQcCheckSampleTask(QcCheckSampleTask qcCheckSampleTask);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取每天首检任务的各物料的第一条数据
|
||||||
|
* **/
|
||||||
|
List<QcCheckSampleTask> selectScTaskListByDay();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入留样检验列表
|
||||||
|
* **/
|
||||||
|
|
||||||
|
int batchInsertQcCheckSampleTask(List<QcCheckSampleTask> list);
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
package com.op.quality.service;
|
||||||
|
|
||||||
|
import com.op.common.core.web.domain.AjaxResult;
|
||||||
|
import com.op.quality.domain.QcCheckSampleTask;
|
||||||
|
import com.op.quality.domain.query.QcCheckSampleTaskQuery;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author 019117
|
||||||
|
* @date 2025/3/25
|
||||||
|
*/
|
||||||
|
public interface IQcCheckSampleTaskService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 留样检验任务列表
|
||||||
|
* **/
|
||||||
|
List<QcCheckSampleTask> selectQcCheckSampleTaskList(QcCheckSampleTaskQuery query);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取待复检样品列表
|
||||||
|
* **/
|
||||||
|
List<QcCheckSampleTask> selectQcWaitCheckSampleTaskList(QcCheckSampleTaskQuery query);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新留样信息
|
||||||
|
* **/
|
||||||
|
void updateQcCheckSampleTask(QcCheckSampleTask qcCheckSampleTask);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同步留样检验任务
|
||||||
|
* **/
|
||||||
|
AjaxResult createCheckSampleTask();
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,88 @@
|
|||||||
|
package com.op.quality.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.client.naming.utils.CollectionUtils;
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
||||||
|
import com.op.common.core.utils.uuid.IdUtils;
|
||||||
|
import com.op.common.core.web.domain.AjaxResult;
|
||||||
|
import com.op.quality.domain.QcCheckSampleTask;
|
||||||
|
import com.op.quality.domain.query.QcCheckSampleTaskQuery;
|
||||||
|
import com.op.quality.mapper.QcCheckSampleTaskMapper;
|
||||||
|
import com.op.quality.service.IQcCheckSampleTaskService;
|
||||||
|
import com.op.system.api.RemoteUserService;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.op.common.core.web.domain.AjaxResult.success;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author 019117
|
||||||
|
* @date 2025/3/25
|
||||||
|
*/
|
||||||
|
@Service()
|
||||||
|
public class QcCheckSampleTaskServiceImpl implements IQcCheckSampleTaskService {
|
||||||
|
|
||||||
|
protected Logger logger = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private QcCheckSampleTaskMapper qcCheckSampleTaskMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RemoteUserService remoteUserService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 留样检验任务列表
|
||||||
|
* **/
|
||||||
|
@Override
|
||||||
|
@DS("#header.poolName")
|
||||||
|
public List<QcCheckSampleTask> selectQcCheckSampleTaskList(QcCheckSampleTaskQuery query) {
|
||||||
|
return qcCheckSampleTaskMapper.selectQcCheckSampleTaskList(query);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取待复检样品列表
|
||||||
|
*
|
||||||
|
* @param query
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
@DS("#header.poolName")
|
||||||
|
public List<QcCheckSampleTask> selectQcWaitCheckSampleTaskList(QcCheckSampleTaskQuery query) {
|
||||||
|
return qcCheckSampleTaskMapper.selectQcWaitCheckSampleTaskList(query);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新留样信息
|
||||||
|
*
|
||||||
|
* @param qcCheckSampleTask 成品留样实体类
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
@DS("#header.poolName")
|
||||||
|
public void updateQcCheckSampleTask(QcCheckSampleTask qcCheckSampleTask) {
|
||||||
|
qcCheckSampleTaskMapper.updateQcCheckSampleTask(qcCheckSampleTask);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同步留样检验任务操作
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public AjaxResult createCheckSampleTask() {
|
||||||
|
// 这是数据源的key
|
||||||
|
DynamicDataSourceContextHolder.push("ds_1000");
|
||||||
|
List<QcCheckSampleTask> list = qcCheckSampleTaskMapper.selectScTaskListByDay();
|
||||||
|
if (!CollectionUtils.isEmpty(list)) {
|
||||||
|
for (QcCheckSampleTask item : list) {
|
||||||
|
item.setId(IdUtils.fastSimpleUUID());
|
||||||
|
}
|
||||||
|
qcCheckSampleTaskMapper.batchInsertQcCheckSampleTask(list);
|
||||||
|
}
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,234 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.op.quality.mapper.QcCheckSampleTaskMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.op.quality.domain.QcCheckSampleTask" id="QcCheckSampleDefectResult">
|
||||||
|
<result property="materialName" column="material_name"/>
|
||||||
|
<result property="incomeBatchNo" column="income_batch_no"/>
|
||||||
|
<result property="workOrderCodeSap" column="work_order_code_sap"/>
|
||||||
|
<result property="sampleTime" column="sample_time"/>
|
||||||
|
<result property="sampleNum" column="sample_Num"/>
|
||||||
|
<result property="sampleAddress" column="sample_address"/>
|
||||||
|
<result property="firstCheckUserCode" column="first_check_user_code"/>
|
||||||
|
<result property="firstCheckUserName" column="first_check_user_name"/>
|
||||||
|
<result property="firstCheckResult" column="first_check_result"/>
|
||||||
|
<result property="firstCheckTime" column="first_check_time"/>
|
||||||
|
<result property="secondCheckUserCode" column="second_check_user_code"/>
|
||||||
|
<result property="secondCheckUserName" column="second_check_user_name"/>
|
||||||
|
<result property="secondCheckResult" column="second_check_result"/>
|
||||||
|
<result property="secondCheckTime" column="second_check_time"/>
|
||||||
|
<result property="thirdCheckUserCode" column="third_check_user_code"/>
|
||||||
|
<result property="thirdCheckUserName" column="third_check_user_name"/>
|
||||||
|
<result property="thirdCheckResult" column="third_check_result"/>
|
||||||
|
<result property="thirdCheckTime" column="third_check_time"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectQcCheckSampleTaskList" parameterType="com.op.quality.domain.query.QcCheckSampleTaskQuery"
|
||||||
|
resultMap="QcCheckSampleDefectResult">
|
||||||
|
select
|
||||||
|
id,
|
||||||
|
material_name,
|
||||||
|
income_batch_no,
|
||||||
|
work_order_code_sap,
|
||||||
|
sample_time,
|
||||||
|
sample_num,
|
||||||
|
sample_address,
|
||||||
|
first_check_user_code,
|
||||||
|
first_check_user_name,
|
||||||
|
first_check_result,
|
||||||
|
first_check_time,
|
||||||
|
second_check_user_code,
|
||||||
|
second_check_user_name,
|
||||||
|
second_check_result,
|
||||||
|
second_check_time,
|
||||||
|
third_check_user_code,
|
||||||
|
third_check_user_name,
|
||||||
|
third_check_result,
|
||||||
|
third_check_time
|
||||||
|
from qc_check_sample_task
|
||||||
|
<where>
|
||||||
|
<if test="queryDate != null and queryDate != ''">
|
||||||
|
and CONVERT(VARCHAR(10), create_time ,23) <![CDATA[ = ]]> #{queryDate}
|
||||||
|
</if>
|
||||||
|
<if test="startSampleDate != null and startSampleDate != ''">
|
||||||
|
and CONVERT(VARCHAR(10), sample_time ,23) <![CDATA[ >= ]]> #{startSampleDate}
|
||||||
|
</if>
|
||||||
|
<if test="endSampleDate != null and endSampleDate != ''">
|
||||||
|
and CONVERT(VARCHAR(10), sample_time ,23) <![CDATA[ <= ]]> #{endSampleDate}
|
||||||
|
</if>
|
||||||
|
<if test="materialName != null and materialName != ''">
|
||||||
|
and material_name like concat('%', #{materialName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="workOrderCodeSap != null and workOrderCodeSap != ''">
|
||||||
|
and work_order_code_sap <![CDATA[ = ]]> #{workOrderCodeSap}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by sample_time desc,create_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectQcWaitCheckSampleTaskList" parameterType="com.op.quality.domain.query.QcCheckSampleTaskQuery"
|
||||||
|
resultMap="QcCheckSampleDefectResult">
|
||||||
|
select
|
||||||
|
id, material_name, income_batch_no, work_order_code_sap, sample_time,
|
||||||
|
first_check_user_code, first_check_user_name, first_check_result, first_check_time,
|
||||||
|
second_check_user_code, second_check_user_name, second_check_result, second_check_time,
|
||||||
|
third_check_user_code, third_check_user_name, third_check_result, third_check_time
|
||||||
|
from qc_check_sample_task
|
||||||
|
<where>
|
||||||
|
<if test="firstDate != null and firstDate != ''">
|
||||||
|
and CONVERT(VARCHAR(10), sample_time ,23) <![CDATA[ <= ]]> #{firstDate}
|
||||||
|
and first_check_result is null
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
UNION
|
||||||
|
|
||||||
|
select
|
||||||
|
id, material_name, income_batch_no, work_order_code_sap, sample_time,
|
||||||
|
first_check_user_code, first_check_user_name, first_check_result, first_check_time,
|
||||||
|
second_check_user_code, second_check_user_name, second_check_result, second_check_time,
|
||||||
|
third_check_user_code, third_check_user_name, third_check_result, third_check_time
|
||||||
|
from qc_check_sample_task
|
||||||
|
<where>
|
||||||
|
<if test="secondDate != null and secondDate != ''">
|
||||||
|
and CONVERT(VARCHAR(10), sample_time ,23) <![CDATA[ <= ]]> #{secondDate}
|
||||||
|
and second_check_result is null
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
UNION
|
||||||
|
select
|
||||||
|
id, material_name, income_batch_no, work_order_code_sap, sample_time,
|
||||||
|
first_check_user_code, first_check_user_name, first_check_result, first_check_time,
|
||||||
|
second_check_user_code, second_check_user_name, second_check_result, second_check_time,
|
||||||
|
third_check_user_code, third_check_user_name, third_check_result, third_check_time
|
||||||
|
from qc_check_sample_task
|
||||||
|
<where>
|
||||||
|
<if test="thirdDate != null and thirdDate != ''">
|
||||||
|
and CONVERT(VARCHAR(10), sample_time ,23) <![CDATA[ <= ]]> #{thirdDate}
|
||||||
|
and third_check_result is null
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<update id="updateQcCheckSampleTask" parameterType="com.op.quality.domain.QcCheckSampleTask">
|
||||||
|
update qc_check_sample_task
|
||||||
|
<set>
|
||||||
|
<if test="sampleTime != null">
|
||||||
|
sample_time = #{sampleTime},
|
||||||
|
</if>
|
||||||
|
<if test="sampleNum != null">
|
||||||
|
sample_Num = #{sampleNum},
|
||||||
|
</if>
|
||||||
|
<if test="sampleAddress != null">
|
||||||
|
sample_Address = #{sampleAddress},
|
||||||
|
</if>
|
||||||
|
<if test="firstCheckUserCode != null and firstCheckUserCode != ''">
|
||||||
|
first_check_user_code = #{firstCheckUserCode},
|
||||||
|
</if>
|
||||||
|
<if test="firstCheckUserName != null and firstCheckUserName != ''">
|
||||||
|
first_check_user_name = #{firstCheckUserName},
|
||||||
|
</if>
|
||||||
|
<if test="firstCheckResult != null and firstCheckResult != ''">
|
||||||
|
first_check_result = #{firstCheckResult},
|
||||||
|
</if>
|
||||||
|
<if test="firstCheckTime != null and firstCheckTime != ''">
|
||||||
|
first_check_time = #{firstCheckTime},
|
||||||
|
</if>
|
||||||
|
<if test="secondCheckUserCode != null and secondCheckUserCode != ''">
|
||||||
|
second_check_user_code = #{secondCheckUserCode},
|
||||||
|
</if>
|
||||||
|
<if test="secondCheckUserName != null and secondCheckUserName != ''">
|
||||||
|
second_check_user_name = #{secondCheckUserName},
|
||||||
|
</if>
|
||||||
|
<if test="secondCheckResult != null and secondCheckResult != ''">
|
||||||
|
second_check_result = #{secondCheckResult},
|
||||||
|
</if>
|
||||||
|
<if test="secondCheckTime != null and secondCheckTime != ''">
|
||||||
|
second_check_time = #{secondCheckTime},
|
||||||
|
</if>
|
||||||
|
<if test="thirdCheckUserCode != null and thirdCheckUserCode != ''">
|
||||||
|
third_check_user_code = #{thirdCheckUserCode},
|
||||||
|
</if>
|
||||||
|
<if test="thirdCheckUserName != null and thirdCheckUserName != ''">
|
||||||
|
third_check_user_name = #{thirdCheckUserName},
|
||||||
|
</if>
|
||||||
|
<if test="thirdCheckResult != null and thirdCheckResult != ''">
|
||||||
|
third_check_result = #{thirdCheckResult},
|
||||||
|
</if>
|
||||||
|
<if test="thirdCheckTime != null and thirdCheckTime != ''">
|
||||||
|
third_check_time = #{thirdCheckTime},
|
||||||
|
</if>
|
||||||
|
update_time = getDate()
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="selectScTaskListByDay" resultMap="QcCheckSampleDefectResult">
|
||||||
|
SELECT
|
||||||
|
t.material_name AS material_name,
|
||||||
|
CASE
|
||||||
|
WHEN
|
||||||
|
LEN( income_batch_no ) = 24
|
||||||
|
THEN
|
||||||
|
SUBSTRING ( t.income_batch_no, 9, 24 )
|
||||||
|
WHEN
|
||||||
|
LEN( income_batch_no ) <![CDATA[ <= ]]> 24
|
||||||
|
THEN
|
||||||
|
CONVERT ( VARCHAR ( 8 ), create_time, 112 )
|
||||||
|
WHEN
|
||||||
|
LEN( income_batch_no ) > 24
|
||||||
|
THEN income_batch_no
|
||||||
|
ELSE ''
|
||||||
|
END AS income_batch_no,
|
||||||
|
t.create_time AS create_time,
|
||||||
|
t.workorderCodeSap AS workOrderCodeSap
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
qct.income_batch_no,
|
||||||
|
qct.material_name,
|
||||||
|
qct.create_time,
|
||||||
|
SUBSTRING ( pow.workorder_code_sap, 4, 12 ) AS workorderCodeSap,
|
||||||
|
ROW_NUMBER ( ) OVER ( PARTITION BY qct.material_name, SUBSTRING ( pow.workorder_code_sap, 4, 12 ) ORDER BY qct.create_time ASC ) AS RowNum
|
||||||
|
FROM
|
||||||
|
qc_check_task qct
|
||||||
|
LEFT JOIN pro_order_workorder pow ON pow.workorder_code = qct.order_no
|
||||||
|
WHERE
|
||||||
|
pow.workorder_code_sap IS NOT NULL
|
||||||
|
AND qct.income_batch_no IS NOT NULL
|
||||||
|
AND qct.check_type = 'checkTypeSC'
|
||||||
|
) t
|
||||||
|
WHERE t.RowNum = 1 AND CONVERT(VARCHAR(10), t.create_time ,23) >= CONVERT(VARCHAR(10), getDate() ,23)
|
||||||
|
ORDER BY t.create_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="batchInsertQcCheckSampleTask" parameterType="com.op.quality.domain.QcCheckSampleTask">
|
||||||
|
INSERT INTO qc_check_sample_task (
|
||||||
|
id,
|
||||||
|
material_name,
|
||||||
|
income_batch_no,
|
||||||
|
work_order_code_sap,
|
||||||
|
create_time
|
||||||
|
)
|
||||||
|
VALUES
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(
|
||||||
|
#{item.id},
|
||||||
|
#{item.materialName},
|
||||||
|
#{item.incomeBatchNo},
|
||||||
|
#{item.workOrderCodeSap},
|
||||||
|
#{item.createTime}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue