工艺路线中的关键工序
This commit is contained in:
parent
2d54e31e32
commit
6559979ca8
@ -66,8 +66,8 @@ public class ProRouteProcess extends BaseEntity
|
||||
@Excel(name = "甘特图显示颜色")
|
||||
private String colorCode;
|
||||
|
||||
/** 是否更新生产工单进度 */
|
||||
private String updateFlag;
|
||||
/** 是否关键工序 */
|
||||
private String keyFlag;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
@ -185,6 +185,14 @@ public class ProRouteProcess extends BaseEntity
|
||||
this.defaultSufTime = defaultSufTime;
|
||||
}
|
||||
|
||||
public String getKeyFlag() {
|
||||
return keyFlag;
|
||||
}
|
||||
|
||||
public void setKeyFlag(String keyFlag) {
|
||||
this.keyFlag = keyFlag;
|
||||
}
|
||||
|
||||
public Long getDefaultSufTime()
|
||||
{
|
||||
return defaultSufTime;
|
||||
@ -213,13 +221,7 @@ public class ProRouteProcess extends BaseEntity
|
||||
this.attr2 = attr2;
|
||||
}
|
||||
|
||||
public String getUpdateFlag() {
|
||||
return updateFlag;
|
||||
}
|
||||
|
||||
public void setUpdateFlag(String updateFlag) {
|
||||
this.updateFlag = updateFlag;
|
||||
}
|
||||
|
||||
public String getAttr2()
|
||||
{
|
||||
@ -260,7 +262,7 @@ public class ProRouteProcess extends BaseEntity
|
||||
", defaultPreTime=" + defaultPreTime +
|
||||
", defaultSufTime=" + defaultSufTime +
|
||||
", colorCode='" + colorCode + '\'' +
|
||||
", updateFlag='" + updateFlag + '\'' +
|
||||
", keyFlag='" + keyFlag + '\'' +
|
||||
", attr1='" + attr1 + '\'' +
|
||||
", attr2='" + attr2 + '\'' +
|
||||
", attr3=" + attr3 +
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.ktg.mes.pro.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ktg.mes.pro.domain.ProFeedback;
|
||||
import com.ktg.mes.pro.domain.ProRouteProcess;
|
||||
|
||||
/**
|
||||
@ -48,6 +50,13 @@ public interface IProRouteProcessService
|
||||
*/
|
||||
public String checkUpdateFlagUnique(ProRouteProcess proRouteProcess);
|
||||
|
||||
/**
|
||||
* 检查某个报工单对应的工序是否是关键工序
|
||||
* @param feedback
|
||||
* @return
|
||||
*/
|
||||
public boolean checkKeyProcess(ProFeedback feedback);
|
||||
|
||||
/**
|
||||
* 查找上一个工序
|
||||
* @param proRouteProcess
|
||||
|
@ -1,14 +1,21 @@
|
||||
package com.ktg.mes.pro.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import com.ktg.mes.md.domain.MdWorkstation;
|
||||
import com.ktg.mes.md.mapper.MdWorkstationMapper;
|
||||
import com.ktg.mes.pro.domain.*;
|
||||
import com.ktg.mes.pro.mapper.ProRouteMapper;
|
||||
import com.ktg.mes.pro.mapper.ProRouteProductMapper;
|
||||
import com.ktg.mes.pro.mapper.ProWorkorderMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.pro.mapper.ProRouteProcessMapper;
|
||||
import com.ktg.mes.pro.domain.ProRouteProcess;
|
||||
import com.ktg.mes.pro.service.IProRouteProcessService;
|
||||
|
||||
/**
|
||||
@ -20,9 +27,19 @@ import com.ktg.mes.pro.service.IProRouteProcessService;
|
||||
@Service
|
||||
public class ProRouteProcessServiceImpl implements IProRouteProcessService
|
||||
{
|
||||
@Autowired
|
||||
private ProRouteMapper proRouteMapper;
|
||||
|
||||
@Autowired
|
||||
private ProRouteProcessMapper proRouteProcessMapper;
|
||||
|
||||
|
||||
@Autowired
|
||||
private ProRouteProductMapper proRouteProductMapper;
|
||||
|
||||
@Autowired
|
||||
private MdWorkstationMapper mdWorkstationMapper;
|
||||
|
||||
/**
|
||||
* 查询工艺组成
|
||||
*
|
||||
@ -77,6 +94,36 @@ public class ProRouteProcessServiceImpl implements IProRouteProcessService
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkKeyProcess(ProFeedback feedback) {
|
||||
//根据当前生产的产品获取对应的工艺路线
|
||||
Long routeId =-1L,processId = -1L;
|
||||
ProRouteProduct param = new ProRouteProduct();
|
||||
param.setItemId(feedback.getItemId());
|
||||
List<ProRouteProduct> products = proRouteProductMapper.selectProRouteProductList(param);
|
||||
if(!CollectionUtil.isNotEmpty(products)){
|
||||
products = products.stream().filter(item -> proRouteMapper.selectProRouteByRouteId(item.getRouteId()).getEnableFlag()==UserConstants.YES).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(products)){
|
||||
routeId = products.get(0).getRouteId();
|
||||
}
|
||||
}
|
||||
|
||||
//根据工作站获取工序
|
||||
MdWorkstation workstation = mdWorkstationMapper.selectMdWorkstationByWorkstationId(feedback.getWorkstationId());
|
||||
processId = workstation.getProcessId();
|
||||
|
||||
//再判断当前的工序在此工艺路线中是否是关键工序
|
||||
ProRouteProcess param2 = new ProRouteProcess();
|
||||
param2.setRouteId(routeId);
|
||||
param2.setProcessId(processId);
|
||||
param2.setKeyFlag(UserConstants.YES);
|
||||
List<ProRouteProcess> processes = proRouteProcessMapper.selectProRouteProcessList(param2);
|
||||
if(CollectionUtil.isNotEmpty(processes)){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProRouteProcess findPreProcess(ProRouteProcess proRouteProcess) {
|
||||
return proRouteProcessMapper.findPreProcess(proRouteProcess);
|
||||
|
@ -18,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="defaultPreTime" column="default_pre_time" />
|
||||
<result property="defaultSufTime" column="default_suf_time" />
|
||||
<result property="colorCode" column="color_code" />
|
||||
<result property="updateFlag" column="update_flag" ></result>
|
||||
<result property="keyFlag" column="key_flag" ></result>
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
@ -31,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProRouteProcessVo">
|
||||
select record_id, route_id, process_id, process_code, process_name, order_num, next_process_id, next_process_code, next_process_name, link_type, default_pre_time, default_suf_time, color_code,update_flag, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_route_process
|
||||
select record_id, route_id, process_id, process_code, process_name, order_num, next_process_id, next_process_code, next_process_name, link_type, default_pre_time, default_suf_time, color_code,key_flag, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from pro_route_process
|
||||
</sql>
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="defaultPreTime != null "> and default_pre_time = #{defaultPreTime}</if>
|
||||
<if test="defaultSufTime != null "> and default_suf_time = #{defaultSufTime}</if>
|
||||
<if test="colorCode != null and colorCode != ''"> and color_code = #{colorCode}</if>
|
||||
<if test="updateFlag !=null and updateFlag !=''"> and update_flag = #{updateFlag}</if>
|
||||
<if test="keyFlag !=null and keyFlag !=''"> and key_flag = #{keyFlag}</if>
|
||||
</where>
|
||||
order by order_num asc
|
||||
</select>
|
||||
@ -72,7 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="checkUpdateFlagUnique" parameterType="ProRouteProcess" resultMap="ProRouteProcessResult">
|
||||
<include refid="selectProRouteProcessVo"/>
|
||||
where route_id = #{routeId} and update_flag = 'Y' limit 1
|
||||
where route_id = #{routeId} and key_flag = 'Y' limit 1
|
||||
</select>
|
||||
|
||||
<select id="findPreProcess" parameterType="ProRouteProcess" resultMap="ProRouteProcessResult">
|
||||
@ -122,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="defaultPreTime != null">default_pre_time,</if>
|
||||
<if test="defaultSufTime != null">default_suf_time,</if>
|
||||
<if test="colorCode != null">color_code,</if>
|
||||
<if test="updateFlag !=null">update_flag,</if>
|
||||
<if test="keyFlag !=null">key_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
@ -146,7 +146,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="defaultPreTime != null">#{defaultPreTime},</if>
|
||||
<if test="defaultSufTime != null">#{defaultSufTime},</if>
|
||||
<if test="colorCode != null">#{colorCode},</if>
|
||||
<if test="updateFlag !=null">#{updateFlag},</if>
|
||||
<if test="keyFlag !=null">#{keyFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
@ -173,7 +173,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="linkType != null">link_type = #{linkType},</if>
|
||||
<if test="defaultPreTime != null">default_pre_time = #{defaultPreTime},</if>
|
||||
<if test="defaultSufTime != null">default_suf_time = #{defaultSufTime},</if>
|
||||
<if test="updateFlag !=null">update_flag = #{updateFlag},</if>
|
||||
<if test="keyFlag !=null">key_flag = #{keyFlag},</if>
|
||||
<if test="colorCode != null">color_code = #{colorCode},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
|
Loading…
Reference in New Issue
Block a user