Commit f08dc569 authored by 李驰骋's avatar 李驰骋

Merge remote-tracking branch 'origin/master'

parents ad0b4425 be41ecb0
......@@ -55,6 +55,25 @@ public class ProProductQrcodeRecord extends BaseEntity {
@ApiModelProperty("产品描述")
private String itemDesc;
/**
* 模板ID
*/
private Long templateId;
/**
* 模板名称
*/
private String templateName;
/**
* 模板编码(ID)
*/
private String templateCode;
/**
* 模板类型
*/
private String templateType;
}
......@@ -58,7 +58,26 @@ public class ProProductQrcodeRule extends BaseEntity {
/** 当前流水 */
@ApiModelProperty("当前流水")
private Integer currentSerial;
/**
* 模板ID
*/
private Long templateId;
/**
* 模板名称
*/
private String templateName;
/**
* 模板编码(ID)
*/
private String templateCode;
/**
* 模板类型
*/
private String templateType;
public String buildQrcode(){
String rst = this.getPrefix() +
......
......@@ -191,5 +191,16 @@ public class ProProductionSolution extends BaseEntity {
*/
private String sapUsageId;
/**
* 单价
*/
@ApiModelProperty("单价")
private BigDecimal unitPrice;
/**
* 单价
*/
@ApiModelProperty("超报")
private Boolean surpassState;
}
......@@ -315,6 +315,8 @@ public class ProTask extends BaseEntity {
private String isExistTool = IS_EXIST_TOOL_NO;
@ApiModelProperty("超报标识")
private Boolean surpassState;
public String getStatusName() {
return TaskStatusEnum.getStatusCn(this.getStatus());
}
......
......@@ -212,6 +212,11 @@ public class ProProductionSolutionVo implements Serializable {
@ApiModelProperty("SAP用途")
private String sapUsageId;
/**
* 规格书
*/
@ApiModelProperty("单价")
private BigDecimal unitPrice;
/**
* BOM头信息
*/
......@@ -230,4 +235,6 @@ public class ProProductionSolutionVo implements Serializable {
@ApiModelProperty("规格书")
private ProProductionSolutionSpecificationSheet specificationSheet;
}
......@@ -54,7 +54,26 @@ public class ProProductQrcodeRecordCreate {
/** 产品描述 */
@ApiModelProperty("产品描述")
private String itemDesc;
/**
* 模板ID
*/
private Long templateId;
/**
* 模板名称
*/
private String templateName;
/**
* 模板编码(ID)
*/
private String templateCode;
/**
* 模板类型
*/
private String templateType;
public void initByWorkorder(ProWorkorder workorder){
this.setItemId(workorder.getProductId());
this.setItemCode(workorder.getProductCode());
......
......@@ -79,6 +79,26 @@ public class ProProductQrcodeRecordDto {
@ApiModelProperty("更新时间")
private Date updateTime;
/**
* 模板ID
*/
private Long templateId;
/**
* 模板名称
*/
private String templateName;
/**
* 模板编码(ID)
*/
private String templateCode;
/**
* 模板类型
*/
private String templateType;
}
......@@ -53,6 +53,26 @@ public class ProProductQrcodeRuleCreate {
/** 当前流水 */
@ApiModelProperty("当前流水")
private Integer currentSerial;
/**
* 模板ID
*/
private Long templateId;
/**
* 模板名称
*/
private String templateName;
/**
* 模板编码(ID)
*/
private String templateCode;
/**
* 模板类型
*/
private String templateType;
......
......@@ -79,6 +79,25 @@ public class ProProductQrcodeRuleDto {
@ApiModelProperty("更新时间")
private Date updateTime;
/**
* 模板ID
*/
private Long templateId;
/**
* 模板名称
*/
private String templateName;
/**
* 模板编码(ID)
*/
private String templateCode;
/**
* 模板类型
*/
private String templateType;
}
......@@ -54,6 +54,26 @@ public class ProProductQrcodeRuleUpdate {
@ApiModelProperty("当前流水")
private Integer currentSerial;
/**
* 模板ID
*/
private Long templateId;
/**
* 模板名称
*/
private String templateName;
/**
* 模板编码(ID)
*/
private String templateCode;
/**
* 模板类型
*/
private String templateType;
}
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ximai.common.utils.data.StringUtils;
import com.ximai.mes.pro.domain.ProProductQrcodeRule;
import com.ximai.mes.pro.dto.ProProductQrcodeRecordCreate;
import com.ximai.mes.pro.dto.ProProductQrcodeRuleDto;
import com.ximai.mes.pro.schedule.impl.AlgorithmResultProcessImpl;
import com.ximai.mes.pro.service.IProMaterialRequestService;
import com.ximai.mes.pro.service.IProProductQrcodeRecordService;
......@@ -23,6 +24,8 @@ public class ProductQrcodeBuild implements ScheduleBusiProcess{
private IProProductQrcodeRecordService productQrcodeRecordService;
@Autowired
private IProProductQrcodeRuleService productQrcodeRuleService;
@Autowired
private IProProductQrcodeRuleService proProductQrcodeRuleService;
@Override
public void execute(List<JobResult> jobResults) {
jobResults.forEach(job->{
......@@ -31,12 +34,38 @@ public class ProductQrcodeBuild implements ScheduleBusiProcess{
if(rule ==null){
return;
}
//wzc修改 有客户优先按照产品+客户匹配序列号规则绑定的最新打印模板,如果没有匹配到 按照产品匹配序列号规则绑定的最新打印模板(客户字段为空的)
ProProductQrcodeRuleDto proProductQrcodeRuleDto= null;
List<ProProductQrcodeRuleDto> list = null;
if(StringUtils.isNotEmpty(workorder.getClientCode())){
QueryWrapper<ProProductQrcodeRule> query = new QueryWrapper<>();
query.eq("m.item_id", workorder.getProductId());
query.eq( "m.client_code", workorder.getClientCode());
query.orderByDesc("m.rule_id");
list = proProductQrcodeRuleService.selectProProductQrcodeRuleDtoList(query);
}else{
QueryWrapper<ProProductQrcodeRule> query = new QueryWrapper<>();
query.eq("m.item_id", workorder.getProductId());
query.isNull( "m.client_code");
query.orderByDesc("m.rule_id");
list = proProductQrcodeRuleService.selectProProductQrcodeRuleDtoList(query);
}
if(list != null && list.size() > 0){
proProductQrcodeRuleDto = list.get(0);
}else{
//后续再看是否需要报错
}
List<String> qrcodes = productQrcodeRuleService.buildQrcode(rule, job.getQuantity().intValue());
for(String qrcode : qrcodes){
ProProductQrcodeRecordCreate create = new ProProductQrcodeRecordCreate();
create.setQrcode(qrcode);
create.initByWorkorder(workorder);
create.setItemDesc(rule.getItemDesc());
//产品序列打印记录增加模板相关内容
create.setTemplateId(proProductQrcodeRuleDto != null ? proProductQrcodeRuleDto.getTemplateId() : null);
create.setTemplateCode(proProductQrcodeRuleDto != null ? proProductQrcodeRuleDto.getTemplateCode() : null);
create.setTemplateName(proProductQrcodeRuleDto != null ? proProductQrcodeRuleDto.getTemplateName() : null);
create.setTemplateType(proProductQrcodeRuleDto != null ? proProductQrcodeRuleDto.getTemplateType() : null);
productQrcodeRecordService.insertProProductQrcodeRecord(create);
}
});
......
......@@ -26,6 +26,7 @@ import com.ximai.mes.pro.domain.*;
import com.ximai.mes.pro.domain.proWorkOrder.ProWorkOrderProcess;
import com.ximai.mes.pro.domain.proWorkOrder.ProWorkOrderProcessTool;
import com.ximai.mes.pro.domain.proWorkOrder.ProWorkorder;
import com.ximai.mes.pro.domain.productionSolution.ProProductionSolution;
import com.ximai.mes.pro.domain.task.*;
import com.ximai.mes.pro.domain.vo.*;
import com.ximai.mes.pro.domain.vo.task.FeedbackValidateSerialNoParams;
......@@ -36,6 +37,7 @@ import com.ximai.mes.pro.mapper.ProRouteMapper;
import com.ximai.mes.pro.mapper.proWorkOrder.ProWorkOrderProcessMapper;
import com.ximai.mes.pro.mapper.proWorkOrder.ProWorkOrderProcessToolMapper;
import com.ximai.mes.pro.mapper.proWorkOrder.ProWorkorderMapper;
import com.ximai.mes.pro.mapper.productionSolution.ProProductionSolutionMapper;
import com.ximai.mes.pro.mapper.task.ProTaskAssistProcessMapper;
import com.ximai.mes.pro.mapper.task.ProTaskMapper;
import com.ximai.mes.pro.mapper.task.ProTaskWorkorderMapper;
......@@ -157,6 +159,8 @@ public class ProTaskServiceImpl implements IProTaskService {
@Resource
private IMdWorkunitService iMdWorkunitService;
@Autowired
ProProductionSolutionMapper proProductionSolutionMapper;
/**
* 查询生产任务
......@@ -799,6 +803,18 @@ public class ProTaskServiceImpl implements IProTaskService {
queryWrapper.notIn("t1.status", Arrays.asList(WorkorderStatusEnum.CLOSE.getValue(), WorkorderStatusEnum.CANCEL.getValue(), WorkorderStatusEnum.CANCELED.getValue()));
List<ProWorkorder> proWorkorders = proWorkorderService.selectListByQw(queryWrapper);
double maxWorkunitQuantityConst = taskWorkunit.getQuantity().doubleValue();
//检查该工单绑定的生产版本是否允许超报
if(proWorkorders.size() > 0 && proWorkorders.get(0).getProductionSolutionId() != null){
ProProductionSolution proProductionSolution
= proProductionSolutionMapper.selectProProductionSolutionByProductionSolutionId(proWorkorders.get(0).getProductionSolutionId());
if(proProductionSolution != null && proProductionSolution.getSurpassState() != null){
if(!proProductionSolution.getSurpassState()){
//不允许超报 可报工数目 - 合格数 不能小于 0
ExceptionUtil.checkTrueThrowException(
taskQuantityWaitConst.compareTo(feedbackQualifyConst) < 0, "工单关联的生产版本不允许超报行为");
}
}
}
if (workorderId != null && workorderId != 0) {
// 查看当前工单已报工数量
if (proWorkorders.size() == 1) {
......@@ -1331,6 +1347,7 @@ public class ProTaskServiceImpl implements IProTaskService {
@Override
@Transactional
public List<ProTask> getTaskList(ProTaskQuery proTask) {
ProTaskQuery proTaskQuery = new ProTaskQuery();
BeanUtils.copyProperties(proTask, proTaskQuery);
......@@ -1382,7 +1399,13 @@ public class ProTaskServiceImpl implements IProTaskService {
workorderQuery.setWorkorderCode(arrangeCode);
List<ProWorkorder> proWorkorders = proWorkorderService.selectProWorkorderList(workorderQuery);
task.setProWorkorderList(proWorkorders);
if(proWorkorders.size() > 0 && proWorkorders.get(0).getProductionSolutionId() != null){
ProProductionSolution proProductionSolution
= proProductionSolutionMapper.selectProProductionSolutionByProductionSolutionId(proWorkorders.get(0).getProductionSolutionId());
if(proProductionSolution != null){
task.setSurpassState(proProductionSolution.getSurpassState());
}
}
Double v = proFeedbackService.selectQuantityQualifySum(new ProFeedback(arrangeCode, null, null, task.getTaskWorkunitId()));
task.setArrangeFeedbackSum(v);
}
......
......@@ -76,14 +76,49 @@ public class QcAbnormalReportController extends BaseController {
return toAjax(qcAbnormalReportService.deleteQcAbnormalReportByAbnormalReportIds(abnormalReportIds));
}
/**
* 开始处理异常单
*/
@PreAuthorize("@ss.hasPermi('qc:report:remove')")
@PostMapping("/start/{abnormalReportId}")
public AjaxResult start(@PathVariable Long abnormalReportId) {
qcAbnormalReportService.start(abnormalReportId);
return AjaxResult.success("操作成功");
}
/**
* 完成按钮的功能实现
*/
@PreAuthorize("@ss.hasPermi('qc:report:remove')")
@Log(title = "车间异常单", businessType = BusinessType.DELETE)
@PutMapping("/complete/{abnormalReportIds}")
public AjaxResult putStatus(@PathVariable Long abnormalReportIds) {
qcAbnormalReportService.updateQcAbnormalReportAbmornalStatud(abnormalReportIds);
@PutMapping("/complete")
public AjaxResult putStatus(@RequestBody QcAbnormalReport qcAbnormalReport) {
qcAbnormalReport.setAbnormalStatus("FINISH");
qcAbnormalReportService.updateQcAbnormalReportAbmornalStatud(qcAbnormalReport);
return AjaxResult.success("");
}
/**
* 关闭按钮的功能实现
*/
@PreAuthorize("@ss.hasPermi('qc:report:remove')")
@Log(title = "车间异常单", businessType = BusinessType.DELETE)
@PutMapping("/close")
public AjaxResult close(@RequestBody QcAbnormalReport qcAbnormalReport) {
qcAbnormalReport.setAbnormalStatus("CLOSE");
qcAbnormalReportService.updateQcAbnormalReportAbmornalStatud(qcAbnormalReport);
return AjaxResult.success("");
}
/**
* 获取车间异常编号
*/
@PreAuthorize("@ss.hasPermi('qc:report:remove')")
@GetMapping("/getAbnormalNumber")
public AjaxResult getAbnormalNumber() {
String abnormalNumber = qcAbnormalReportService.getAbnormalNumber();
return AjaxResult.success("操作成功",abnormalNumber);
}
}
......@@ -27,6 +27,11 @@ QcAbnormalReport extends BaseEntity
@Excel(name = "编批单号")
private String batchNumber;
/** 编批单号 */
@Excel(name = "车间异常单单号 来源于编码规则:ABNORMAL_NUMBER")
private String abnormalNumber;
/** 工序ID */
@Excel(name = "工序ID")
private Long processId;
......@@ -83,4 +88,34 @@ QcAbnormalReport extends BaseEntity
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date endPurchaseDate;
/**
* 单据开始处理时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startTime;
/**
* 异常处理开始人
*/
private String startBy;
/**
* 处理结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
/**
* 处理结束人
*/
private String endBy;
/**
* 处理该异常的耗时
*/
private Long timeConsuming;
private String remarks;
}
......@@ -67,5 +67,9 @@ public interface IQcAbnormalReportService {
* @param abnormalReportIds 车间异常单主键
* @return 结果
*/
void updateQcAbnormalReportAbmornalStatud(Long abnormalReportIds);
void updateQcAbnormalReportAbmornalStatud(QcAbnormalReport qcAbnormalReport);
String getAbnormalNumber();
void start(Long abnormalReportIds);
}
package com.ximai.mes.qc.service.impl;
import com.ximai.common.constant.UserConstants;
import com.ximai.common.exception.ServiceException;
import com.ximai.common.utils.MessageUtils;
import com.ximai.common.utils.SecurityUtils;
import com.ximai.common.utils.data.DateUtils;
import com.ximai.common.utils.data.ExceptionUtil;
import com.ximai.common.utils.data.StringUtils;
......@@ -20,10 +22,12 @@ import com.ximai.mes.pro.service.task.IProTaskWorkunitService;
import com.ximai.mes.qc.domain.QcAbnormalReport;
import com.ximai.mes.qc.mapper.QcAbnormalReportMapper;
import com.ximai.mes.qc.service.IQcAbnormalReportService;
import com.ximai.system.strategy.AutoCodeUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
......@@ -56,6 +60,9 @@ public class QcAbnormalReportServiceImpl implements IQcAbnormalReportService {
@Autowired
private ProProcessMapper proProcessMapper;
@Autowired
private AutoCodeUtil autoCodeUtil;
/**
* 查询车间异常单
*
......@@ -158,20 +165,16 @@ public class QcAbnormalReportServiceImpl implements IQcAbnormalReportService {
}
/**
* 完成按钮的功能实现
* 完成或关闭按钮的功能实现
*
* @param abnormalReportIds 车间异常单主键
* @param
* @return 结果
*/
@Override
public void updateQcAbnormalReportAbmornalStatud(Long abnormalReportIds) {
QcAbnormalReport qcAbnormalReport = qcAbnormalReportMapper.selectQcAbnormalReportByAbnormalReportId(abnormalReportIds);
if (qcAbnormalReport.getAbnormalStatus().equals("SUBMIT")) {
throw new ServiceException(MessageUtils.message("qc.error.status.finished"));
}
if (qcAbnormalReport.getAbnormalStatus().equals("FINISH")) {
throw new ServiceException(MessageUtils.message("qc.error.status.finished"));
public void updateQcAbnormalReportAbmornalStatud(QcAbnormalReport qcAbnormalReportInput) {
QcAbnormalReport qcAbnormalReport = qcAbnormalReportMapper.selectQcAbnormalReportByAbnormalReportId(qcAbnormalReportInput.getAbnormalReportId());
if (!qcAbnormalReport.getAbnormalStatus().equals("SUBMIT")) {
throw new ServiceException(MessageUtils.message("车间异常单不处于处理中状态无法完成"));
}
//修改关联名称的工作单元的故障状态
MdWorkunitVo mdWorkunitVo = iMdWorkunitService.selectMdWorkunitByWorkunitId(qcAbnormalReport.getWorkstationId());
......@@ -181,7 +184,33 @@ public class QcAbnormalReportServiceImpl implements IQcAbnormalReportService {
BeanUtils.copyProperties(mdWorkunitVo, w);
iMdWorkunitService.updateMdWorkunit(w);
}
qcAbnormalReport.setAbnormalStatus("FINISH");
String endBy = SecurityUtils.getUsername();
qcAbnormalReport.setEndBy(endBy);
qcAbnormalReport.setEndTime(new Date());
if(qcAbnormalReport.getStartTime() != null)
qcAbnormalReport.setTimeConsuming(qcAbnormalReport.getStartTime().getTime() - qcAbnormalReport.getEndTime().getTime());
qcAbnormalReport.setRemarks(qcAbnormalReportInput.getRemarks());
qcAbnormalReport.setAbnormalStatus(qcAbnormalReportInput.getAbnormalStatus());
qcAbnormalReportMapper.updateQcAbnormalReport(qcAbnormalReport);
}
@Override
public String getAbnormalNumber() {
return autoCodeUtil.genSerialCode("ABNORMAL_NUMBER", null);
}
@Override
public void start(Long abnormalReportIds) {
QcAbnormalReport qcAbnormalReport = qcAbnormalReportMapper.selectQcAbnormalReportByAbnormalReportId(abnormalReportIds);
if(qcAbnormalReport == null)
throw new ServiceException(MessageUtils.message("没能根据单据ID找到车间异常单"));
if (!qcAbnormalReport.getAbnormalStatus().equals("NOT")) {
throw new ServiceException(MessageUtils.message("车间异常单不处于未提交状态无法开始"));
}
String startBy = SecurityUtils.getUsername();
qcAbnormalReport.setStartBy(startBy);
qcAbnormalReport.setStartTime(new Date());
qcAbnormalReport.setAbnormalStatus("SUBMIT");
qcAbnormalReportMapper.updateQcAbnormalReport(qcAbnormalReport);
}
......
......@@ -39,7 +39,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectProProductQrcodeRecordVo">
select record_id, item_id, item_code, work_order_id, work_order_no, print_time, qrcode, client_code, client_name, item_desc, create_by, create_time, update_by, update_time from pro_product_qrcode_record
select record_id, item_id, item_code, work_order_id, work_order_no,
print_time, qrcode, client_code, client_name, item_desc, create_by,
create_time, update_by, update_time ,template_id,template_type,
template_code,template_name
from pro_product_qrcode_record
</sql>
<select id="selectProProductQrcodeRecordList" parameterType="ProProductQrcodeRecord" resultMap="ProProductQrcodeRecordResult2">
......@@ -78,6 +82,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="templateId != null">
template_id,
</if>
<if test="templateCode != null">
template_code,
</if>
<if test="templateName != null">
template_name,
</if>
<if test="templateType != null">
template_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="itemId != null">#{itemId},</if>
......@@ -93,6 +109,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="templateId != null">
#{templateId,jdbcType=BIGINT},
</if>
<if test="templateCode != null">
#{templateCode,jdbcType=VARCHAR},
</if>
<if test="templateName != null">
#{templateName,jdbcType=VARCHAR},
</if>
<if test="templateType != null">
#{templateType,jdbcType=VARCHAR},
</if>
</trim>
</insert>
......
......@@ -78,6 +78,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="templateId != null">
template_id,
</if>
<if test="templateCode != null">
template_code,
</if>
<if test="templateName != null">
template_name,
</if>
<if test="templateType != null">
template_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="itemId != null">#{itemId},</if>
......@@ -93,6 +105,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="templateId != null">
#{templateId,jdbcType=BIGINT},
</if>
<if test="templateCode != null">
#{templateCode,jdbcType=VARCHAR},
</if>
<if test="templateName != null">
#{templateName,jdbcType=VARCHAR},
</if>
<if test="templateType != null">
#{templateType,jdbcType=VARCHAR},
</if>
</trim>
</insert>
......
......@@ -71,7 +71,9 @@
pps.min_lot,
pps.unit_of_measure,
pps.ecn_code,
pps.sap_usage_id
pps.sap_usage_id,
pps.unit_Price,
pps.surpass_state
from pro_production_solution pps
left join md_item mi on pps.item_id = mi.item_id
left join pro_route pr on pr.route_id = pps.route_id
......@@ -156,6 +158,9 @@
<if test="unitOfMeasure != null">unit_of_measure,</if>
<if test="sapUsageId != null">sap_usage_id,</if>
<if test="sapPrototypeMakeCode != null">sap_prototype_make_code,</if>
<if test="unitPrice != null">unit_price,</if>
<if test="surpassState != null">surpass_state,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productionSolutionCode != null">#{productionSolutionCode},</if>
......@@ -184,6 +189,8 @@
<if test="unitOfMeasure != null">#{unitOfMeasure},</if>
<if test="sapUsageId != null">#{sapUsageId},</if>
<if test="sapPrototypeMakeCode != null">#{sapPrototypeMakeCode},</if>
<if test="unitPrice != null">#{unitPrice},</if>
<if test="surpassState != null">#{surpassState},</if>
</trim>
</insert>
......@@ -216,6 +223,8 @@
<if test="unitOfMeasure != null">unit_of_measure = #{unitOfMeasure},</if>
<if test="sapUsageId != null">sap_usage_id = #{sapUsageId},</if>
<if test="sapPrototypeMakeCode != null">sap_prototype_make_code = #{sapPrototypeMakeCode},</if>
<if test="unitPrice != null">unit_price = #{unitPrice},</if>
<if test="surpassState != null">surpass_state = #{surpassState},</if>
</trim>
where production_solution_id = #{productionSolutionId}
</update>
......
......@@ -23,10 +23,19 @@
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result column="abnormal_number" jdbcType="INTEGER" property="abnormalNumber" />
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
<result column="start_by" jdbcType="VARCHAR" property="startBy" />
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
<result column="end_by" jdbcType="VARCHAR" property="endBy" />
<result column="time_consuming" jdbcType="BIGINT" property="timeConsuming" />
</resultMap>
<sql id="selectQcAbnormalReportVo">
select abnormal_report_id, batch_number, process_id, task_id, task_workunit_id, process_code, process_name, workstation_id, workstation_code, workstation_name, abnormal_type, abnormal_reason, abnormal_time, abnormal_status, create_by, create_time, update_by, update_time
select abnormal_report_id, batch_number, process_id, task_id, task_workunit_id, process_code,
process_name, workstation_id, workstation_code, workstation_name, abnormal_type,
abnormal_reason, abnormal_time, abnormal_status, create_by, create_time, update_by,
update_time, abnormal_number, start_time, start_by, end_time, end_by, time_consuming,remarks
from qc_abnormal_report
</sql>
......@@ -45,9 +54,11 @@
<if test="abnormalType != null and abnormalType != ''"> and abnormal_type = #{abnormalType}</if>
<if test="abnormalReason != null and abnormalReason != ''"> and abnormal_reason = #{abnormalReason}</if>
<if test="abnormalTime != null "> and abnormal_time = #{abnormalTime}</if>
<if test="beginPurchaseDate != null "> abnormal_time BETWEEN #{beginPurchaseDate} </if>
<if test="endPurchaseDate != null "> and #{endPurchaseDate} </if>
<if test="beginPurchaseDate != null and endPurchaseDate != null ">
and abnormal_time between #{beginPurchaseDate} and #{endPurchaseDate}
</if>
<if test="abnormalStatus != null and abnormalStatus != ''"> and abnormal_status = #{abnormalStatus}</if>
<if test="abnormalNumber != null">and abnormal_number = #{abnormalNumber}</if>
</where>
</select>
......@@ -76,6 +87,7 @@
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="abnormalNumber != null">abnormal_number,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="batchNumber != null">#{batchNumber},</if>
......@@ -95,6 +107,8 @@
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="abnormalNumber != null">#{abnormalNumber},</if>
</trim>
</insert>
......@@ -118,6 +132,25 @@
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="startTime != null">
start_time = #{startTime,jdbcType=TIMESTAMP},
</if>
<if test="startBy != null">
start_by = #{startBy,jdbcType=VARCHAR},
</if>
<if test="endTime != null">
end_time = #{endTime,jdbcType=TIMESTAMP},
</if>
<if test="endBy != null">
end_by = #{endBy,jdbcType=VARCHAR},
</if>
<if test="timeConsuming != null">
time_consuming = #{timeConsuming,jdbcType=BIGINT},
</if>
<if test="remarks != null">
remarks = #{remarks},
</if>
</trim>
where abnormal_report_id = #{abnormalReportId}
</update>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment