生产准备记录表新增加工单元字段,台账出库明细表新增是否对刀字段

This commit is contained in:
Stang 2024-11-20 11:18:45 +08:00
parent 9f3cc12a53
commit 8c4b8940f4
9 changed files with 98 additions and 33 deletions

View File

@ -310,25 +310,24 @@ public class BaseKnifeController extends BaseController {
} }
@PostMapping("/open/productionArrangements/{planSheet}") @PostMapping("/open/productionArrangements")
@ResponseBody @ResponseBody
@Transactional @Transactional
public AjaxResult productionArrangements(@PathVariable String planSheet, @RequestBody List<String> processCodeList) { public AjaxResult productionArrangements(@RequestBody ProductionArrangements productionArrangements) {
// 检查计划单是否已存在 // 检查计划单是否已存在
BaseKnife baseKnifePlan = new BaseKnife(); BaseKnife baseKnifePlan = new BaseKnife();
baseKnifePlan.setPlanSheet(planSheet); baseKnifePlan.setPlanSheet(productionArrangements.getPlanSheet());
if (!baseKnifeService.selectBaseKnifeList(baseKnifePlan).isEmpty()) if (!baseKnifeService.selectBaseKnifeList(baseKnifePlan).isEmpty())
return AjaxResult.error("该计划单已存在,请更换重试"); return AjaxResult.error("该计划单已存在,请更换重试");
// 齐套性检查 // 齐套性检查
AjaxResult ajaxResult = this.checkForAlignment(processCodeList); AjaxResult ajaxResult = this.checkForAlignment(productionArrangements.getProcessCodeList());
if (Integer.parseInt(String.valueOf(ajaxResult.get("code"))) != 200) { if (Integer.parseInt(String.valueOf(ajaxResult.get("code"))) != 200) {
return AjaxResult.error(ajaxResult.get("msg").toString(), ajaxResult.get("data")); return AjaxResult.error(ajaxResult.get("msg").toString(), ajaxResult.get("data"));
} }
// 验证bom工艺 // 验证bom工艺
List<BaseTechnologyBom> technologyBomList = baseTechnologyBomService.selectBaseTechnologyBomListByProcessCodeList(processCodeList); List<BaseTechnologyBom> technologyBomList = baseTechnologyBomService.selectBaseTechnologyBomListByProcessCodeList(productionArrangements.getProcessCodeList());
if (technologyBomList.isEmpty() || technologyBomList.size() == 1 && technologyBomList.get(0).getKnifeCode() == null) if (technologyBomList.isEmpty() || technologyBomList.size() == 1 && technologyBomList.get(0).getKnifeCode() == null)
return AjaxResult.error("未检测到工艺bom项"); return AjaxResult.error("未检测到工艺bom项");
@ -337,8 +336,9 @@ public class BaseKnifeController extends BaseController {
// 参数列表 // 参数列表
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("planCode", planSheet); params.put("planCode", productionArrangements.getPlanSheet());
params.put("processCodeList", processCodeList); params.put("processCodeList", productionArrangements.getProcessCodeList());
params.put("processUnit", productionArrangements.getProcessUnit());
// 构建日志 // 构建日志
SysOperLog operLog = new SysOperLog(); SysOperLog operLog = new SysOperLog();
@ -453,7 +453,7 @@ public class BaseKnifeController extends BaseController {
countMap.put(item.getKnifeCode(), countMap.get(item.getKnifeCode()) + 1); countMap.put(item.getKnifeCode(), countMap.get(item.getKnifeCode()) + 1);
// 记录源数据然后锁定 // 记录源数据然后锁定
baseKnifeOriginList.add(item); baseKnifeOriginList.add(item);
item.setPlanSheet(planSheet); item.setPlanSheet(productionArrangements.getPlanSheet());
item.setIsLocked(1); item.setIsLocked(1);
item.setLockedStartTime(techBom.getLockedStartTime()); item.setLockedStartTime(techBom.getLockedStartTime());
item.setLockedEndTime(techBom.getLockedEndTime()); item.setLockedEndTime(techBom.getLockedEndTime());
@ -561,7 +561,7 @@ public class BaseKnifeController extends BaseController {
// 生成组装任务 // 生成组装任务
WmsZdTask wmsZdTask = new WmsZdTask(); WmsZdTask wmsZdTask = new WmsZdTask();
wmsZdTask.setmProductId(mdItem.getItemId()); wmsZdTask.setmProductId(mdItem.getItemId());
wmsZdTask.setPlanSheet(planSheet); wmsZdTask.setPlanSheet(productionArrangements.getPlanSheet());
wmsZdTask.setCode(generateTaskCode(techBom.getProcessCode())); wmsZdTask.setCode(generateTaskCode(techBom.getProcessCode()));
wmsZdTask.setName(techBom.getProcessName()); wmsZdTask.setName(techBom.getProcessName());
wmsZdTask.setProductIdQty(count); wmsZdTask.setProductIdQty(count);
@ -579,16 +579,16 @@ public class BaseKnifeController extends BaseController {
} }
// 添加生产准备记录 // 添加生产准备记录
ProductionArrangements productionArrangements = new ProductionArrangements(); productionArrangements.setProcessCode(productionArrangements.getProcessCodeList().toString());
productionArrangements.setPlanSheet(planSheet); productionArrangements.setProcessUnit(productionArrangements.getProcessUnit());
productionArrangements.setProcessCode(processCodeList.toString());
productionArrangements.setStatus(0); productionArrangements.setStatus(0);
productionArrangements.setCreateTime(DateUtils.getNowDate());
productionArrangementsMapper.insertProductionArrangements(productionArrangements); productionArrangementsMapper.insertProductionArrangements(productionArrangements);
if (!msg.contains("缺少物料已生成组装任务!")){ if (!msg.contains("缺少物料已生成组装任务!")){
// 生成出库计划单 // 生成出库计划单
WmsOutPlan outPlan = new WmsOutPlan(); WmsOutPlan outPlan = new WmsOutPlan();
outPlan.setPlanCode(planSheet); outPlan.setPlanCode(productionArrangements.getPlanSheet());
outPlan.setWmsBusinessTypeId(16L); outPlan.setWmsBusinessTypeId(16L);
outPlan.setPlanState("1"); outPlan.setPlanState("1");
outPlan.setPlanType("ZDCK"); outPlan.setPlanType("ZDCK");

View File

@ -6,8 +6,10 @@ import com.ktg.common.core.domain.AjaxResult;
import com.ktg.common.core.page.TableDataInfo; import com.ktg.common.core.page.TableDataInfo;
import com.ktg.common.enums.BusinessType; import com.ktg.common.enums.BusinessType;
import com.ktg.common.utils.poi.ExcelUtil; import com.ktg.common.utils.poi.ExcelUtil;
import com.ktg.mes.md.domain.WmsOutPlan;
import com.ktg.mes.md.domain.WmsOutTask; import com.ktg.mes.md.domain.WmsOutTask;
import com.ktg.mes.md.service.IWmsOutTaskService; import com.ktg.mes.md.service.IWmsOutTaskService;
import com.ktg.mes.wm.domain.WmsInPlan;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -31,11 +33,10 @@ public class WmsOutTaskController extends BaseController {
/** /**
* 查询出库任务列表 * 查询出库任务列表
*/ */
@GetMapping("/open/incompleteList") @GetMapping("/open/incompleteList/{planSheet}")
public TableDataInfo openList(WmsOutTask wmsOutTask) { public TableDataInfo openList(@PathVariable String planSheet) {
startPage(); startPage();
wmsOutTask.setTaskState("0"); List<WmsOutTask> list = wmsOutTaskService.selectWmsOutTaskIncompleteList(planSheet);
List<WmsOutTask> list = wmsOutTaskService.selectWmsOutTaskList(wmsOutTask);
return getDataTable(list); return getDataTable(list);
} }

View File

@ -111,6 +111,12 @@ public class WmsOutPlanDetailEntity extends BaseEntity {
@Excel(name = "标准数量") @Excel(name = "标准数量")
private String standardQuantity; private String standardQuantity;
/**
* 是否对刀
*/
@Excel(name = "是否对刀")
private Integer isToolSetting;
public void setWmsOutPlanDetailEntityId(Long wmsOutPlanDetailEntityId) { public void setWmsOutPlanDetailEntityId(Long wmsOutPlanDetailEntityId) {
this.wmsOutPlanDetailEntityId = wmsOutPlanDetailEntityId; this.wmsOutPlanDetailEntityId = wmsOutPlanDetailEntityId;
} }
@ -247,6 +253,14 @@ public class WmsOutPlanDetailEntity extends BaseEntity {
return standardQuantity; return standardQuantity;
} }
public Integer getIsToolSetting() {
return isToolSetting;
}
public void setIsToolSetting(Integer isToolSetting) {
this.isToolSetting = isToolSetting;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

View File

@ -62,4 +62,6 @@ public interface IWmsOutTaskService {
boolean runWmsOutTask(Long[] wmsOutTaskIds); boolean runWmsOutTask(Long[] wmsOutTaskIds);
boolean autoRunWmsOutTask(Long[] wmsOutTaskIds); boolean autoRunWmsOutTask(Long[] wmsOutTaskIds);
List<WmsOutTask> selectWmsOutTaskIncompleteList(String planSheet);
} }

View File

@ -110,6 +110,7 @@ public class BaseKnifeServiceImpl implements IBaseKnifeService {
hashMap.put("wmStorageAreaCode", wmsOutPlanDetail.getWmStorageAreaCode()); // 库位编码 hashMap.put("wmStorageAreaCode", wmsOutPlanDetail.getWmStorageAreaCode()); // 库位编码
hashMap.put("wmStorageAreaName", wmsOutPlanDetail.getWmStorageAreaName()); // 库位名称 hashMap.put("wmStorageAreaName", wmsOutPlanDetail.getWmStorageAreaName()); // 库位名称
hashMap.put("detailStatus", wmsOutPlanDetail.getDetailState()); // 明细状态 hashMap.put("detailStatus", wmsOutPlanDetail.getDetailState()); // 明细状态
hashMap.put("isToolSetting", nowWmsOutPlanDetailEntity.getIsToolSetting()); // 明细状态
/* 实体 */ /* 实体 */
String outTime = null; String outTime = null;
if (nowWmsOutPlanDetailEntity.getCreateTime() != null) if (nowWmsOutPlanDetailEntity.getCreateTime() != null)

View File

@ -10,6 +10,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -207,4 +208,18 @@ public class WmsOutTaskServiceImpl implements IWmsOutTaskService {
System.out.println("WCS下发任务 TODO"); System.out.println("WCS下发任务 TODO");
return false; return false;
} }
@Override
public List<WmsOutTask> selectWmsOutTaskIncompleteList(String planSheet) {
WmsOutPlan wmsOutPlan = wmsOutPlanMapper.selectWmsOutPlanByPlanCode(planSheet);
List<WmsOutTask> wmsOutTaskList = new ArrayList<>();
if (wmsOutPlan != null){
WmsOutTask wmsOutTask = new WmsOutTask();
wmsOutTask.setWmsOutPlanId(wmsOutPlan.getWmsOutPlanId());
wmsOutTask.setTaskState("0");
wmsOutTaskList = wmsOutTaskMapper.selectWmsOutTaskList(wmsOutTask);
}
return wmsOutTaskList;
}
} }

View File

@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import com.ktg.common.annotation.Excel; import com.ktg.common.annotation.Excel;
import com.ktg.common.core.domain.BaseEntity; import com.ktg.common.core.domain.BaseEntity;
import java.util.List;
/** /**
* 生产准备记录对象 PRODUCTION_ARRANGEMENTS * 生产准备记录对象 PRODUCTION_ARRANGEMENTS
* *
@ -26,6 +28,12 @@ public class ProductionArrangements extends BaseEntity
@Excel(name = "工序号") @Excel(name = "工序号")
private String processCode; private String processCode;
@Excel(name = "工序号")
private List<String> processCodeList;
@Excel(name = "工序号")
private String processUnit;
/** 状态 */ /** 状态 */
@Excel(name = "状态") @Excel(name = "状态")
private Integer status; private Integer status;
@ -78,6 +86,22 @@ public class ProductionArrangements extends BaseEntity
this.status = status; this.status = status;
} }
public String getProcessUnit() {
return processUnit;
}
public void setProcessUnit(String processUnit) {
this.processUnit = processUnit;
}
public List<String> getProcessCodeList() {
return processCodeList;
}
public void setProcessCodeList(List<String> processCodeList) {
this.processCodeList = processCodeList;
}
public Integer getStatus() public Integer getStatus()
{ {
return status; return status;
@ -121,19 +145,17 @@ public class ProductionArrangements extends BaseEntity
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return "ProductionArrangements{" +
.append("productionArrangementsId", getProductionArrangementsId()) "productionArrangementsId='" + productionArrangementsId + '\'' +
.append("planSheet", getPlanSheet()) ", planSheet='" + planSheet + '\'' +
.append("processCode", getProcessCode()) ", processCode='" + processCode + '\'' +
.append("status", getStatus()) ", processCodeList=" + processCodeList +
.append("attr1", getAttr1()) ", processUnit='" + processUnit + '\'' +
.append("attr2", getAttr2()) ", status=" + status +
.append("attr3", getAttr3()) ", attr1='" + attr1 + '\'' +
.append("attr4", getAttr4()) ", attr2='" + attr2 + '\'' +
.append("createBy", getCreateBy()) ", attr3='" + attr3 + '\'' +
.append("createTime", getCreateTime()) ", attr4='" + attr4 + '\'' +
.append("updateBy", getUpdateBy()) '}';
.append("updateTime", getUpdateTime())
.toString();
} }
} }

View File

@ -27,6 +27,7 @@
<result property="knifeUnit" column="KNIFE_UNIT"/> <result property="knifeUnit" column="KNIFE_UNIT"/>
<result property="safeStock" column="SAFE_STOCK"/> <result property="safeStock" column="SAFE_STOCK"/>
<result property="standardQuantity" column="STANDARD_QUANTITY"/> <result property="standardQuantity" column="STANDARD_QUANTITY"/>
<result property="isToolSetting" column="IS_TOOL_SETTING"/>
</resultMap> </resultMap>
<sql id="selectWmsOutPlanDetailEntityVo"> <sql id="selectWmsOutPlanDetailEntityVo">
@ -51,7 +52,8 @@
RESET_COUNT, RESET_COUNT,
KNIFE_UNIT, KNIFE_UNIT,
SAFE_STOCK, SAFE_STOCK,
STANDARD_QUANTITY STANDARD_QUANTITY,
IS_TOOL_SETTING
from WMS_OUT_PLAN_DETAIL_ENTITY from WMS_OUT_PLAN_DETAIL_ENTITY
</sql> </sql>
@ -78,6 +80,9 @@
<if test="standardQuantity != null and standardQuantity != ''">and STANDARD_QUANTITY = <if test="standardQuantity != null and standardQuantity != ''">and STANDARD_QUANTITY =
#{standardQuantity} #{standardQuantity}
</if> </if>
<if test="isToolSetting != null and isToolSetting != ''">and IS_TOOL_SETTING =
#{isToolSetting}
</if>
</where> </where>
ORDER BY WMS_OUT_PLAN_DETAIL_ID DESC, CREATE_TIME DESC ORDER BY WMS_OUT_PLAN_DETAIL_ID DESC, CREATE_TIME DESC
</select> </select>
@ -113,6 +118,7 @@
<if test="knifeUnit != null">KNIFE_UNIT,</if> <if test="knifeUnit != null">KNIFE_UNIT,</if>
<if test="safeStock != null">SAFE_STOCK,</if> <if test="safeStock != null">SAFE_STOCK,</if>
<if test="standardQuantity != null">STANDARD_QUANTITY,</if> <if test="standardQuantity != null">STANDARD_QUANTITY,</if>
<if test="isToolSetting != null">IS_TOOL_SETTING,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="wmsOutPlanDetailId != null">#{wmsOutPlanDetailId},</if> <if test="wmsOutPlanDetailId != null">#{wmsOutPlanDetailId},</if>
@ -136,6 +142,7 @@
<if test="knifeUnit != null">#{knifeUnit},</if> <if test="knifeUnit != null">#{knifeUnit},</if>
<if test="safeStock != null">#{safeStock},</if> <if test="safeStock != null">#{safeStock},</if>
<if test="standardQuantity != null">#{standardQuantity},</if> <if test="standardQuantity != null">#{standardQuantity},</if>
<if test="isToolSetting != null">#{isToolSetting},</if>
</trim> </trim>
</insert> </insert>
@ -163,6 +170,7 @@
<if test="knifeUnit != null">KNIFE_UNIT = #{knifeUnit},</if> <if test="knifeUnit != null">KNIFE_UNIT = #{knifeUnit},</if>
<if test="safeStock != null">SAFE_STOCK = #{safeStock},</if> <if test="safeStock != null">SAFE_STOCK = #{safeStock},</if>
<if test="standardQuantity != null">STANDARD_QUANTITY = #{standardQuantity},</if> <if test="standardQuantity != null">STANDARD_QUANTITY = #{standardQuantity},</if>
<if test="isToolSetting != null">IS_TOOL_SETTING = #{isToolSetting},</if>
</trim> </trim>
where WMS_OUT_PLAN_DETAIL_ENTITY_ID = #{wmsOutPlanDetailEntityId} where WMS_OUT_PLAN_DETAIL_ENTITY_ID = #{wmsOutPlanDetailEntityId}
</update> </update>

View File

@ -56,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="planSheet != null">PLAN_SHEET,</if> <if test="planSheet != null">PLAN_SHEET,</if>
<if test="processCode != null">PROCESS_CODE,</if> <if test="processCode != null">PROCESS_CODE,</if>
<if test="status != null">STATUS,</if> <if test="status != null">STATUS,</if>
<if test="processUnit != null">PROCESS_UNIT,</if>
<if test="attr1 != null">ATTR1,</if> <if test="attr1 != null">ATTR1,</if>
<if test="attr2 != null">ATTR2,</if> <if test="attr2 != null">ATTR2,</if>
<if test="attr3 != null">ATTR3,</if> <if test="attr3 != null">ATTR3,</if>
@ -69,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="planSheet != null">#{planSheet},</if> <if test="planSheet != null">#{planSheet},</if>
<if test="processCode != null">#{processCode},</if> <if test="processCode != null">#{processCode},</if>
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="processUnit != null">#{processUnit},</if>
<if test="attr1 != null">#{attr1},</if> <if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if> <if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if> <if test="attr3 != null">#{attr3},</if>