Commit 3677e37d authored by 温志超's avatar 温志超

车间异常单增加车间异常单编号

parent 1f8007b8
......@@ -86,4 +86,16 @@ public class QcAbnormalReportController extends BaseController {
qcAbnormalReportService.updateQcAbnormalReportAbmornalStatud(abnormalReportIds);
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;
......
......@@ -68,4 +68,6 @@ public interface IQcAbnormalReportService {
* @return 结果
*/
void updateQcAbnormalReportAbmornalStatud(Long abnormalReportIds);
String getAbnormalNumber();
}
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.data.DateUtils;
......@@ -20,6 +21,7 @@ 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;
......@@ -56,6 +58,9 @@ public class QcAbnormalReportServiceImpl implements IQcAbnormalReportService {
@Autowired
private ProProcessMapper proProcessMapper;
@Autowired
private AutoCodeUtil autoCodeUtil;
/**
* 查询车间异常单
*
......@@ -185,4 +190,9 @@ public class QcAbnormalReportServiceImpl implements IQcAbnormalReportService {
qcAbnormalReportMapper.updateQcAbnormalReport(qcAbnormalReport);
}
@Override
public String getAbnormalNumber() {
return autoCodeUtil.genSerialCode("ABNORMAL_NUMBER", null);
}
}
......@@ -27,6 +27,7 @@
<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
,abnormal_number
from qc_abnormal_report
</sql>
......@@ -48,6 +49,7 @@
<if test="beginPurchaseDate != null "> abnormal_time BETWEEN #{beginPurchaseDate} </if>
<if test="endPurchaseDate != null "> 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 +78,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 +98,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>
......
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