维护工艺数据

This commit is contained in:
Stang 2024-11-22 15:07:01 +08:00
parent 8641de0a3f
commit ae2f8206de
8 changed files with 98 additions and 66 deletions

View File

@ -133,11 +133,14 @@ public class BaseKnifeController extends BaseController {
return getDataTable(list);
}
@PostMapping("/open/checkForAlignment")
@PostMapping("/open/checkForAlignment/{technologyCode}")
@ResponseBody
public AjaxResult checkForAlignment(@RequestBody List<String> processCodeList) {
// 获取工艺bom
List<BaseTechnologyBom> technologyBomList = baseTechnologyBomService.selectBaseTechnologyBomListByProcessCodeList(processCodeList);
public AjaxResult checkForAlignment(@PathVariable String technologyCode) {
// 验证bom工艺
BaseTechnologyBom baseTechnologyBomWrapper = new BaseTechnologyBom();
baseTechnologyBomWrapper.setTechnologyCode(technologyCode);
// List<BaseTechnologyBom> technologyBomList = baseTechnologyBomService.selectBaseTechnologyBomListByProcessCodeList(productionArrangements.getProcessCodes());
List<BaseTechnologyBom> technologyBomList = baseTechnologyBomService.selectBaseTechnologyBomList(baseTechnologyBomWrapper);
if (technologyBomList.isEmpty() || technologyBomList.size() == 1 && technologyBomList.get(0).getKnifeCode() == null)
return AjaxResult.error("未检测到工艺bom项");
@ -151,7 +154,7 @@ public class BaseKnifeController extends BaseController {
operLog.setOperLocation("上游系统");
operLog.setOperUrl("/mes/md/baseKnife/open/checkForAlignment");
operLog.setMethod("com.ktg.mes.md.controller.BaseKnifeController.checkForAlignment()");
operLog.setOperParam(JSON.toJSONString(processCodeList));
operLog.setOperParam(JSON.toJSONString(technologyCode));
operLog.setStatus(1);
operLog.setOperTime(new Date());
@ -319,15 +322,22 @@ public class BaseKnifeController extends BaseController {
baseKnifePlan.setPlanSheet(productionArrangements.getPlanSheet());
if (!baseKnifeService.selectBaseKnifeList(baseKnifePlan).isEmpty())
return AjaxResult.error("该计划单已存在,请更换重试");
WmsZdTask wmsZdTaskValid = new WmsZdTask();
wmsZdTaskValid.setPlanSheet(productionArrangements.getPlanSheet());
if (!zdTaskService.selectWmsZdTaskList(wmsZdTaskValid).isEmpty())
return AjaxResult.error("该计划单已存在,请更换重试");
// 齐套性检查
AjaxResult ajaxResult = this.checkForAlignment(productionArrangements.getProcessCodes());
AjaxResult ajaxResult = this.checkForAlignment(productionArrangements.getTechnologyCode());
if (Integer.parseInt(String.valueOf(ajaxResult.get("code"))) != 200) {
return AjaxResult.error(ajaxResult.get("msg").toString(), ajaxResult.get("data"));
}
// 验证bom工艺
List<BaseTechnologyBom> technologyBomList = baseTechnologyBomService.selectBaseTechnologyBomListByProcessCodeList(productionArrangements.getProcessCodes());
BaseTechnologyBom baseTechnologyBomWrapper = new BaseTechnologyBom();
baseTechnologyBomWrapper.setTechnologyCode(productionArrangements.getTechnologyCode());
// List<BaseTechnologyBom> technologyBomList = baseTechnologyBomService.selectBaseTechnologyBomListByProcessCodeList(productionArrangements.getProcessCodes());
List<BaseTechnologyBom> technologyBomList = baseTechnologyBomService.selectBaseTechnologyBomList(baseTechnologyBomWrapper);
if (technologyBomList.isEmpty() || technologyBomList.size() == 1 && technologyBomList.get(0).getKnifeCode() == null)
return AjaxResult.error("未检测到工艺bom项");
@ -337,7 +347,7 @@ public class BaseKnifeController extends BaseController {
// 参数列表
Map<String, Object> params = new HashMap<>();
params.put("planCode", productionArrangements.getPlanSheet());
params.put("processCodeList", productionArrangements.getProcessCodes());
params.put("processCode", productionArrangements.getTechnologyCode());
params.put("processUnit", productionArrangements.getProcessUnit());
// 构建日志
@ -579,7 +589,8 @@ public class BaseKnifeController extends BaseController {
}
// 添加生产准备记录
productionArrangements.setProcessCode(productionArrangements.getProcessCodes().toString());
// productionArrangements.setProcessCode(productionArrangements.getProcessCodes().toString());
productionArrangements.setTechnologyCode(productionArrangements.getTechnologyCode());
productionArrangements.setProcessUnit(productionArrangements.getProcessUnit());
productionArrangements.setStatus(0);
productionArrangements.setCreateTime(DateUtils.getNowDate());

View File

@ -72,6 +72,14 @@ public class BaseTechnologyBom extends BaseEntity
@Excel(name = "预留字段4")
private String attr4;
/** 预留字段4 */
@Excel(name = "工艺编码")
private String technologyCode;
/** 预留字段4 */
@Excel(name = "工艺名称")
private String technologyName;
public void setTechnologyBomId(String technologyBomId)
{
this.technologyBomId = technologyBomId;
@ -199,6 +207,14 @@ public class BaseTechnologyBom extends BaseEntity
return attr4;
}
public String getTechnologyCode() {
return technologyCode;
}
public void setTechnologyCode(String technologyCode) {
this.technologyCode = technologyCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -189,10 +189,10 @@ public class InventoryBatchServiceImpl implements IInventoryBatchService {
// 获取当期入库明细数据
List<HashMap<String, Object>> hashMapList = new ArrayList<>();
WmsInPlanDetailEntity entityQuery = new WmsInPlanDetailEntity();
entityQuery.setPlanDetailsId(inTask.getDetailInId());
entityQuery.setPlanId(Long.parseLong(inTask.getPlanInId()));
entityQuery.setKnifeId(Long.parseLong(inTask.getPlanInId()));
List<WmsInPlanDetailEntity> wmsInPlanDetailEntityList = wmsInPlanDetailEntityMapper.selectWmsInPlanDetailEntityList(entityQuery);
wmsInPlanDetailEntityList.forEach(inPlanDetailEntity -> {
// 根据出库计划获得出库类型
WmsBusinessType wmsBusinessType = this.wmsBusinessTypeMapper.selectWmsBusinessTypeByTypeId(inTask.getPlanTypeId());

View File

@ -25,13 +25,13 @@ public class ProductionArrangements extends BaseEntity
private String planSheet;
/** 工序号 */
@Excel(name = "序号")
private String processCode;
@Excel(name = "艺编码")
private String technologyCode;
@Excel(name = "工序号")
private List<String> processCodes;
// @Excel(name = "工序号")
// private List<String> processCodes;
@Excel(name = "工序号")
@Excel(name = "加工单元")
private String processUnit;
/** 状态 */
@ -72,15 +72,15 @@ public class ProductionArrangements extends BaseEntity
{
return planSheet;
}
public void setProcessCode(String processCode)
{
this.processCode = processCode;
public String getTechnologyCode() {
return technologyCode;
}
public String getProcessCode()
{
return processCode;
public void setTechnologyCode(String technologyCode) {
this.technologyCode = technologyCode;
}
public void setStatus(Integer status)
{
this.status = status;
@ -94,13 +94,13 @@ public class ProductionArrangements extends BaseEntity
this.processUnit = processUnit;
}
public List<String> getProcessCodes() {
return processCodes;
}
public void setProcessCodes(List<String> processCodes) {
this.processCodes = processCodes;
}
// public List<String> getProcessCodes() {
// return processCodes;
// }
//
// public void setProcessCodes(List<String> processCodes) {
// this.processCodes = processCodes;
// }
public Integer getStatus()
{
@ -148,8 +148,6 @@ public class ProductionArrangements extends BaseEntity
return "ProductionArrangements{" +
"productionArrangementsId='" + productionArrangementsId + '\'' +
", planSheet='" + planSheet + '\'' +
", processCode='" + processCode + '\'' +
", processCodes=" + processCodes +
", processUnit='" + processUnit + '\'' +
", status=" + status +
", attr1='" + attr1 + '\'' +

View File

@ -478,20 +478,17 @@ public class WmsZdTaskServiceImpl implements IWmsZdTaskService
public Boolean checkFinal(String planSheet){
// 获取订单记录
ProductionArrangements productionArrangements = productionArrangementsMapper.selectProductionArrangementsByPlanSheet(planSheet);
String[] processCodes = productionArrangements.getProcessCode().substring(1, productionArrangements.getProcessCode().length() - 1).split(",");
for (String processCode : processCodes) {
// 遍历工序
List<BaseTechnologyBom> baseTechnologyBomList = baseTechnologyBomMapper.selectBaseTechnologyBomListByProcessCode(processCode.trim());
if (baseTechnologyBomList != null && baseTechnologyBomList.size() > 0) {
// 判断订单锁定的物料是否足够
for (BaseTechnologyBom technologyBom : baseTechnologyBomList) {
BaseKnife baseKnifeWrapper = new BaseKnife();
baseKnifeWrapper.setPlanSheet(planSheet);
baseKnifeWrapper.setKnifeCode(technologyBom.getKnifeCode());
List<BaseKnife> baseKnifePlanSheetList = baseKnifeMapper.selectBaseKnifeList(baseKnifeWrapper);
if (baseKnifePlanSheetList.size() < technologyBom.getKnifeCount()) return false;
}
}
BaseTechnologyBom baseTechnologyBomWrapper = new BaseTechnologyBom();
baseTechnologyBomWrapper.setTechnologyCode(productionArrangements.getTechnologyCode());
List<BaseTechnologyBom> baseTechnologyBomList = baseTechnologyBomMapper.selectBaseTechnologyBomList(baseTechnologyBomWrapper);
// 判断订单锁定的物料是否足够
for (BaseTechnologyBom technologyBom : baseTechnologyBomList) {
BaseKnife baseKnifeWrapper = new BaseKnife();
baseKnifeWrapper.setPlanSheet(planSheet);
baseKnifeWrapper.setKnifeCode(technologyBom.getKnifeCode());
List<BaseKnife> baseKnifePlanSheetList = baseKnifeMapper.selectBaseKnifeList(baseKnifeWrapper);
if (baseKnifePlanSheetList.size() < technologyBom.getKnifeCount()) return false;
}
return true;
@ -515,20 +512,17 @@ public class WmsZdTaskServiceImpl implements IWmsZdTaskService
// 获取订单记录
ProductionArrangements productionArrangements = productionArrangementsMapper.selectProductionArrangementsByPlanSheet(planSheet);
String[] processCodes = productionArrangements.getProcessCode().substring(1, productionArrangements.getProcessCode().length() - 1).split(",");
for (String processCode : processCodes) {
// 遍历工序
List<BaseTechnologyBom> baseTechnologyBomList = baseTechnologyBomMapper.selectBaseTechnologyBomListByProcessCode(processCode.trim());
if (baseTechnologyBomList != null && baseTechnologyBomList.size() > 0) {
// 判断订单锁定的物料是否足够
for (BaseTechnologyBom technologyBom : baseTechnologyBomList) {
BaseKnife baseKnifeWrapper = new BaseKnife();
baseKnifeWrapper.setPlanSheet(planSheet);
baseKnifeWrapper.setKnifeCode(technologyBom.getKnifeCode());
List<BaseKnife> baseKnifeLockedList = baseKnifeMapper.selectBaseKnifeList(baseKnifeWrapper);
if (baseKnifeLockedList.size() == technologyBom.getKnifeCount()) baseKnifeResultList.addAll(baseKnifeLockedList);
}
}
BaseTechnologyBom baseTechnologyBomWrapper = new BaseTechnologyBom();
baseTechnologyBomWrapper.setTechnologyCode(productionArrangements.getTechnologyCode());
List<BaseTechnologyBom> baseTechnologyBomList = baseTechnologyBomMapper.selectBaseTechnologyBomList(baseTechnologyBomWrapper);
// 判断订单锁定的物料是否足够
for (BaseTechnologyBom technologyBom : baseTechnologyBomList) {
BaseKnife baseKnifeWrapper = new BaseKnife();
baseKnifeWrapper.setPlanSheet(planSheet);
baseKnifeWrapper.setKnifeCode(technologyBom.getKnifeCode());
List<BaseKnife> baseKnifeLockedList = baseKnifeMapper.selectBaseKnifeList(baseKnifeWrapper);
if (baseKnifeLockedList.size() == technologyBom.getKnifeCount()) baseKnifeResultList.addAll(baseKnifeLockedList);
}
String batchNum = "SCZBPC01";

View File

@ -15,6 +15,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="expendLife" column="EXPEND_LIFE" />
<result property="lockedStartTime" column="LOCKED_START_TIME" />
<result property="lockedEndTime" column="LOCKED_END_TIME" />
<result property="technologyCode" column="TECHNOLOGY_CODE" />
<result property="technologyName" column="TECHNOLOGY_NAME" />
<result property="remark" column="REMARK" />
<result property="attr1" column="ATTR1" />
<result property="attr2" column="ATTR2" />
@ -27,7 +29,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectBaseTechnologyBomVo">
select TECHNOLOGY_BOM_ID, FIGURE_CODE, PROCESS_CODE, PROCESS_NAME, KNIFE_CODE, KNIFE_SORT, KNIFE_COUNT, EXPEND_LIFE, LOCKED_START_TIME, LOCKED_END_TIME, REMARK, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME from BASE_TECHNOLOGY_BOM
select TECHNOLOGY_BOM_ID, FIGURE_CODE, PROCESS_CODE, PROCESS_NAME, KNIFE_CODE,
KNIFE_SORT, KNIFE_COUNT, EXPEND_LIFE, LOCKED_START_TIME, LOCKED_END_TIME,
TECHNOLOGY_CODE, TECHNOLOGY_NAME,
REMARK, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME
from BASE_TECHNOLOGY_BOM
</sql>
<select id="selectBaseTechnologyBomList" parameterType="BaseTechnologyBom" resultMap="BaseTechnologyBomResult">
@ -42,6 +48,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="expendLife != null and expendLife != ''"> and EXPEND_LIFE = #{expendLife}</if>
<if test="lockedStartTime != null and lockedStartTime != ''"> and LOCKED_START_TIME = #{lockedStartTime}</if>
<if test="lockedEndTime != null and lockedEndTime != ''"> and LOCKED_END_TIME = #{lockedEndTime}</if>
<if test="technologyCode != null and technologyCode != ''"> and TECHNOLOGY_CODE = #{technologyCode}</if>
<if test="technologyName != null and technologyName != ''"> and TECHNOLOGY_NAME = #{technologyName}</if>
<if test="remark != null and remark != ''"> and REMARK = #{remark}</if>
<if test="attr1 != null and attr1 != ''"> and ATTR1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and ATTR2 = #{attr2}</if>
@ -71,6 +79,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="expendLife != null">EXPEND_LIFE,</if>
<if test="lockedStartTime != null">LOCKED_START_TIME,</if>
<if test="lockedEndTime != null">LOCKED_END_TIME,</if>
<if test="technologyCode != null">TECHNOLOGY_CODE,</if>
<if test="technologyName != null">TECHNOLOGY_NAME,</if>
<if test="remark != null">REMARK,</if>
<if test="attr1 != null">ATTR1,</if>
<if test="attr2 != null">ATTR2,</if>
@ -91,6 +101,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="expendLife != null">#{expendLife},</if>
<if test="lockedStartTime != null">#{lockedStartTime},</if>
<if test="lockedEndTime != null">#{lockedEndTime},</if>
<if test="technologyCode != null">#{technologyCode},</if>
<if test="technologyName != null">#{technologyName},</if>
<if test="remark != null">#{remark},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>

View File

@ -7,7 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="ProductionArrangements" id="ProductionArrangementsResult">
<result property="productionArrangementsId" column="PRODUCTION_ARRANGEMENTS_ID" />
<result property="planSheet" column="PLAN_SHEET" />
<result property="processCode" column="PROCESS_CODE" />
<result property="technologyCode" column="TECHNOLOGY_CODE" />
<result property="status" column="STATUS" />
<result property="attr1" column="ATTR1" />
<result property="attr2" column="ATTR2" />
@ -20,14 +20,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectProductionArrangementsVo">
select PRODUCTION_ARRANGEMENTS_ID, PLAN_SHEET, PROCESS_CODE, STATUS, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME from PRODUCTION_ARRANGEMENTS
select PRODUCTION_ARRANGEMENTS_ID, PLAN_SHEET, TECHNOLOGY_CODE, STATUS, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME from PRODUCTION_ARRANGEMENTS
</sql>
<select id="selectProductionArrangementsList" parameterType="ProductionArrangements" resultMap="ProductionArrangementsResult">
<include refid="selectProductionArrangementsVo"/>
<where>
<if test="planSheet != null and planSheet != ''"> and PLAN_SHEET = #{planSheet}</if>
<if test="processCode != null and processCode != ''"> and PROCESS_CODE = #{processCode}</if>
<if test="technologyCode != null and technologyCode != ''"> and TECHNOLOGY_CODE = #{technologyCode}</if>
<if test="status != null and status != ''"> and STATUS = #{status}</if>
<if test="attr1 != null and attr1 != ''"> and ATTR1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and ATTR2 = #{attr2}</if>
@ -54,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into PRODUCTION_ARRANGEMENTS
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="planSheet != null">PLAN_SHEET,</if>
<if test="processCode != null">PROCESS_CODE,</if>
<if test="technologyCode != null">TECHNOLOGY_CODE,</if>
<if test="status != null">STATUS,</if>
<if test="processUnit != null">PROCESS_UNIT,</if>
<if test="attr1 != null">ATTR1,</if>
@ -68,7 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="planSheet != null">#{planSheet},</if>
<if test="processCode != null">#{processCode},</if>
<if test="technologyCode != null">#{technologyCode},</if>
<if test="status != null">#{status},</if>
<if test="processUnit != null">#{processUnit},</if>
<if test="attr1 != null">#{attr1},</if>
@ -86,7 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update PRODUCTION_ARRANGEMENTS
<trim prefix="SET" suffixOverrides=",">
<if test="planSheet != null">PLAN_SHEET = #{planSheet},</if>
<if test="processCode != null">PROCESS_CODE = #{processCode},</if>
<if test="technologyCode != null">TECHNOLOGY_CODE = #{technologyCode},</if>
<if test="status != null">STATUS = #{status},</if>
<if test="attr1 != null">ATTR1 = #{attr1},</if>
<if test="attr2 != null">ATTR2 = #{attr2},</if>

View File

@ -54,6 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="planOutId != null and planOutId != ''"> and PLAN_OUT_ID = #{planOutId}</if>
<if test="planOutType != null and planOutType != ''"> and PLAN_OUT_TYPE = #{planOutType}</if>
<if test="technologyBomId != null and technologyBomId != ''"> and technology_bom_id = #{technologyBomId}</if>
<if test="planSheet != null and planSheet != ''"> and plan_sheet = #{planSheet}</if>
<if test="qtyOk != null and qtyOk != ''"> and QTY_OK = #{qtyOk}</if>
<if test="remark != null and remark != ''"> and REMARK = #{remark}</if>
<if test="attr1 != null and attr1 != ''"> and ATTR1 = #{attr1}</if>