质检相关功能修复

This commit is contained in:
yinjinlu-pc\尹金路
2024-12-11 00:30:29 +08:00
parent 16fa600703
commit b9fae61a0f
13 changed files with 127 additions and 40 deletions

View File

@@ -1,6 +1,7 @@
package com.ktg.mes.md.controller.mobile;
import com.ktg.common.core.controller.BaseController;
import com.ktg.common.core.domain.AjaxResult;
import com.ktg.common.core.page.TableDataInfo;
import com.ktg.mes.md.domain.MdProductSip;
import com.ktg.mes.md.service.IMdProductSipService;
@@ -27,10 +28,9 @@ public class MdProductSIPMobController extends BaseController {
* 查询产品SIP列表
*/
@GetMapping("/list")
public TableDataInfo list(MdProductSip mdProductSip)
public AjaxResult list(MdProductSip mdProductSip)
{
startPage();
List<MdProductSip> list = mdProductSipService.selectMdProductSipList(mdProductSip);
return getDataTable(list);
return AjaxResult.success(list);
}
}

View File

@@ -7,8 +7,10 @@ import com.ktg.common.enums.BusinessType;
import com.ktg.common.utils.StringUtils;
import com.ktg.mes.md.domain.MdWorkstation;
import com.ktg.mes.md.service.IMdWorkstationService;
import com.ktg.mes.pro.domain.ProSnProcess;
import com.ktg.mes.pro.domain.*;
import com.ktg.mes.pro.service.IProSnProcessService;
import com.ktg.mes.pro.service.IProTaskService;
import com.ktg.mes.pro.service.IProWorkorderService;
import com.ktg.mes.wm.domain.WmSn;
import com.ktg.mes.wm.service.IWmSnService;
import io.swagger.annotations.Api;
@@ -43,6 +45,12 @@ public class ProSnProcessMobController extends BaseController {
@Autowired
private IMdWorkstationService mdWorkstationService;
@Autowired
private IProWorkorderService proWorkorderService;
@Autowired
private IProTaskService proTaskService;
/**
* 新增SN流转-工序信息
*/
@@ -90,4 +98,47 @@ public class ProSnProcessMobController extends BaseController {
return AjaxResult.success(proSnProcess);
}
/**
* 根据扫描到的SN编号查询此工作站分配的生产任务
* @param snProcess
* @return
*/
@ApiOperation("根据流转卡号和工作站查询所有的生产任务")
@PreAuthorize("@ss.hasPermi('mes:pro:procard:list')")
@GetMapping("/getSnProTask")
public AjaxResult getCardProTask(ProSnProcess snProcess){
WmSn param = new WmSn();
param.setSnCode(snProcess.getSnCode());
List<WmSn> snList = wmSnService.selectWmSnList(param);
WmSn sn = null;
if(CollectionUtils.isEmpty(snList)){
return AjaxResult.error("SN编码无效!");
}else {
sn = snList.get(0);
}
if(!StringUtils.isNotNull(snProcess.getWorkstationId())){
return AjaxResult.error("请传递工作站参数!");
}
ProWorkorder workorder = proWorkorderService.selectProWorkorderByWorkorderId(sn.getWorkorderId());
if(StringUtils.isNotNull(workorder)){
ProTask p = new ProTask();
p.setWorkorderId(workorder.getWorkorderId());
p.setWorkstationId(snProcess.getWorkstationId());
List<ProTask> tasks = proTaskService.selectProTaskList(p);
if(CollectionUtils.isEmpty(tasks)){
return AjaxResult.error("此工作站未被分配当前SN对应的生产任务!");
}
return AjaxResult.success(tasks);
}else{
return AjaxResult.error("SN对应的生产工单无效");
}
}
}

View File

@@ -11,6 +11,7 @@ import com.ktg.common.utils.StringUtils;
import com.ktg.common.utils.poi.ExcelUtil;
import com.ktg.mes.wm.domain.WmSn;
import com.ktg.mes.wm.service.IWmSnService;
import com.ktg.mes.wm.utils.WmBarCodeUtil;
import com.ktg.system.strategy.AutoCodeUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -33,6 +34,9 @@ public class WmSnMobController extends BaseController {
@Autowired
private AutoCodeUtil autoCodeUtil;
@Autowired
private WmBarCodeUtil wmBarCodeUtil;
/**
* 查询SN码列表
*/
@@ -58,11 +62,11 @@ public class WmSnMobController extends BaseController {
@ApiOperation("根据生产工单和工作站查询所有SN流转记录")
@GetMapping("/getStationList")
public AjaxResult getStationList(WmSn sn){
if(StringUtils.isNotNull(sn.getWorkorderId())){
if(!StringUtils.isNotNull(sn.getWorkorderId())){
return AjaxResult.error("请输入生产工单ID参数");
}
if(StringUtils.isNotNull(sn.getWorkstationId())){
if(!StringUtils.isNotNull(sn.getWorkstationId())){
return AjaxResult.error("请输入工作站ID参数");
}
@@ -113,9 +117,10 @@ public class WmSnMobController extends BaseController {
SNCode = autoCodeUtil.genSerialCode(UserConstants.SN_CODE,wmSn.getItemCode());
wmSn.setSnCode(SNCode);
wmSnService.insertWmSn(wmSn);
wmBarCodeUtil.generateBarCode(UserConstants.BARCODE_TYPE_SN,wmSn.getSnId(),wmSn.getSnCode(),"");
}
}
return AjaxResult.success();
return AjaxResult.success(wmSn);
}
/**

View File

@@ -52,6 +52,8 @@ public class WmSn extends BaseEntity
private Long workorderId;
private String workorderCode;
private Date inputTime;
private Long workstationId;
@@ -155,6 +157,14 @@ public class WmSn extends BaseEntity
this.attr1 = attr1;
}
public String getWorkorderCode() {
return workorderCode;
}
public void setWorkorderCode(String workorderCode) {
this.workorderCode = workorderCode;
}
public Integer getSnNum() {
return snNum;
}
@@ -211,12 +221,14 @@ public class WmSn extends BaseEntity
this.inputTime = inputTime;
}
public Long getWorkorderId() {
return workorderId;
public void setWorkorderId(Long workorderId)
{
this.workorderId = workorderId;
}
public void setWorkorderId(Long workorderId) {
this.workorderId = workorderId;
public Long getWorkorderId()
{
return workorderId;
}
public Long getWorkstationId() {

View File

@@ -100,6 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inspectDate != null "> and inspect_date = #{inspectDate}</if>
<if test="inspector != null and inspector != ''"> and inspector = #{inspector}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
</where>
order by create_time desc
</select>

View File

@@ -93,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inspectDate != null "> and inspect_date = #{inspectDate}</if>
<if test="inspector != null and inspector != ''"> and inspector = #{inspector}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="createBy != null and createBy != '' "> and create_by = #{createBy}</if>
</where>
order by create_time desc
</select>

View File

@@ -90,6 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inspectDate != null "> and inspect_date = #{inspectDate}</if>
<if test="inspector != null and inspector != ''"> and inspector = #{inspector}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
</where>
order by create_time desc
</select>

View File

@@ -40,29 +40,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectQcResultDetailList" parameterType="QcResultDetail" resultMap="QcResultDetailResult">
<include refid="selectQcResultDetailVo"/>
select qd.detail_id, qd.result_id, qd.index_id, qi.index_code, qi.index_name, qd.index_type, qd.qc_tool, qd.check_method, qd.stander_val, qd.unit_of_measure, qd.threshold_max, qd.threshold_min, qd.qc_result_type, qd.qc_result_spc, qd.qc_val_float, qd.qc_val_integer, qd.qc_val_text, qd.qc_val_dict, qd.qc_val_file, qd.remark, qd.attr1, qd.attr2, qd.attr3, qd.attr4, qd.create_by, qd.create_time, qd.update_by, qd.update_time
from qc_result_detail qd
left join qc_index qi on qi.index_id = qd.index_id
<where>
<if test="resultId != null "> and result_id = #{resultId}</if>
<if test="indexId != null "> and index_id = #{indexId}</if>
<if test="indexType != null and indexType != ''"> and index_type = #{indexType}</if>
<if test="qcTool != null and qcTool != ''"> and qc_tool = #{qcTool}</if>
<if test="checkMethod != null and checkMethod != ''"> and check_method = #{checkMethod}</if>
<if test="standerVal != null "> and stander_val = #{standerVal}</if>
<if test="unitOfMeasure != null and unitOfMeasure != ''"> and unit_of_measure = #{unitOfMeasure}</if>
<if test="thresholdMax != null "> and threshold_max = #{thresholdMax}</if>
<if test="thresholdMin != null "> and threshold_min = #{thresholdMin}</if>
<if test="qcResultType != null and qcResultType != ''"> and qc_result_type = #{qcResultType}</if>
<if test="qcResultSpc != null and qcResultSpc != ''"> and qc_result_spc = #{qcResultSpc}</if>
<if test="qcValFloat != null "> and qc_val_float = #{qcValFloat}</if>
<if test="qcValInteger != null "> and qc_val_integer = #{qcValInteger}</if>
<if test="qcValText != null and qcValText != ''"> and qc_val_text = #{qcValText}</if>
<if test="qcValDict != null and qcValDict != ''"> and qc_val_dict = #{qcValDict}</if>
<if test="qcValFile != null and qcValFile != ''"> and qc_val_file = #{qcValFile}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null "> and attr3 = #{attr3}</if>
<if test="attr4 != null "> and attr4 = #{attr4}</if>
<if test="resultId != null "> and qd.result_id = #{resultId}</if>
<if test="indexId != null "> and qd.index_id = #{indexId}</if>
<if test="indexType != null and indexType != ''"> and qd.index_type = #{indexType}</if>
<if test="qcTool != null and qcTool != ''"> and qd.qc_tool = #{qcTool}</if>
<if test="checkMethod != null and checkMethod != ''"> and qd.check_method = #{checkMethod}</if>
<if test="standerVal != null "> and qd.stander_val = #{standerVal}</if>
<if test="unitOfMeasure != null and unitOfMeasure != ''"> and qd.unit_of_measure = #{unitOfMeasure}</if>
<if test="thresholdMax != null "> and qd.threshold_max = #{thresholdMax}</if>
<if test="thresholdMin != null "> and qd.threshold_min = #{thresholdMin}</if>
<if test="qcResultType != null and qcResultType != ''"> and qd.qc_result_type = #{qcResultType}</if>
<if test="qcResultSpc != null and qcResultSpc != ''"> and qd.qc_result_spc = #{qcResultSpc}</if>
<if test="qcValFloat != null "> and qd.qc_val_float = #{qcValFloat}</if>
<if test="qcValInteger != null "> and qd.qc_val_integer = #{qcValInteger}</if>
<if test="qcValText != null and qcValText != ''"> and qd.qc_val_text = #{qcValText}</if>
<if test="qcValDict != null and qcValDict != ''"> and qd.qc_val_dict = #{qcValDict}</if>
<if test="qcValFile != null and qcValFile != ''"> and qd.qc_val_file = #{qcValFile}</if>
</where>
order by qd.index_id asc
</select>
<select id="selectQcResultDetailByResultIdAndIQCId" parameterType="QcResultDetail" resultMap="QcResultDetailResult">

View File

@@ -47,6 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="arrivalDate != null "> and arrival_date = #{arrivalDate}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
order by create_time desc
</select>
<select id="selectWmArrivalNoticeByNoticeId" parameterType="Long" resultMap="WmArrivalNoticeResult">

View File

@@ -15,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="batchCode" column="batch_code" />
<result property="snNum" column="snNum"></result>
<result property="workorderId" column="workorder_id"></result>
<result property="workorderCode" column="workorder_code"></result>
<result property="inputTime" column="input_time"></result>
<result property="genDate" column="gen_date"></result>
<result property="remark" column="remark" />
@@ -42,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="specification != null and specification != ''"> and specification = #{specification}</if>
<if test="unitOfMeasure != null and unitOfMeasure != ''"> and unit_of_measure = #{unitOfMeasure}</if>
<if test="batchCode != null and batchCode != ''"> and batch_code = #{batchCode}</if>
<if test="workoderId != null and workorderId != ''"> and workorder_id = #{workorderId}</if>
<if test="workorderId != null and workorderId != ''"> and workorder_id = #{workorderId}</if>
</where>
</select>
@@ -68,10 +69,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="getStationList" parameterType="WmSn" resultMap="WmSnResult">
select sn.sn_id,sn.sn_code,sn.item_id,sn.item_code,sn.item_name,sn.specification,sn.unit_of_measure,ps.input_time
select sn.sn_id,sn.sn_code,sn.workorder_id,wo.workorder_code, sn.item_id,sn.item_code,sn.item_name,sn.specification,sn.unit_of_measure,ps.input_time
from wm_sn sn
left join pro_sn_process ps
on sn.sn_id = ps.sn_id
left join pro_workorder wo
on sn.workorder_id = wo.workorder_id
where sn.workorder_id =#{workorderId}
and ps.workstation_id = #{workstationId}
order by ps.input_time desc
@@ -88,7 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="specification != null">specification,</if>
<if test="unitOfMeasure != null">unit_of_measure,</if>
<if test="batchCode != null">batch_code,</if>
<if test="workoderId != null">workorder_id,</if>
<if test="workorderId != null">workorder_id,</if>
<if test="genDate !=null">gen_date,</if>
<if test="remark != null">remark,</if>
<if test="attr1 != null">attr1,</if>
@@ -108,7 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="specification != null">#{specification},</if>
<if test="unitOfMeasure != null">#{unitOfMeasure},</if>
<if test="batchCode != null">#{batchCode},</if>
<if test="workoderId != null">#{workorderId},</if>
<if test="workorderId != null">#{workorderId},</if>
<if test="genDate !=null">#{genDate},</if>
<if test="remark != null">#{remark},</if>
<if test="attr1 != null">#{attr1},</if>
@@ -132,7 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="specification != null">specification = #{specification},</if>
<if test="unitOfMeasure != null">unit_of_measure = #{unitOfMeasure},</if>
<if test="batchCode != null">batch_code = #{batchCode},</if>
<if test="workoderId != null">workorder_id = #{workorderId},</if>
<if test="workorderId != null">workorder_id = #{workorderId},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>