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

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
@Transactional
public AjaxResult productionArrangements(@PathVariable String planSheet, @RequestBody List<String> processCodeList) {
public AjaxResult productionArrangements(@RequestBody ProductionArrangements productionArrangements) {
// 检查计划单是否已存在
BaseKnife baseKnifePlan = new BaseKnife();
baseKnifePlan.setPlanSheet(planSheet);
baseKnifePlan.setPlanSheet(productionArrangements.getPlanSheet());
if (!baseKnifeService.selectBaseKnifeList(baseKnifePlan).isEmpty())
return AjaxResult.error("该计划单已存在,请更换重试");
// 齐套性检查
AjaxResult ajaxResult = this.checkForAlignment(processCodeList);
AjaxResult ajaxResult = this.checkForAlignment(productionArrangements.getProcessCodeList());
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(processCodeList);
List<BaseTechnologyBom> technologyBomList = baseTechnologyBomService.selectBaseTechnologyBomListByProcessCodeList(productionArrangements.getProcessCodeList());
if (technologyBomList.isEmpty() || technologyBomList.size() == 1 && technologyBomList.get(0).getKnifeCode() == null)
return AjaxResult.error("未检测到工艺bom项");
@ -337,8 +336,9 @@ public class BaseKnifeController extends BaseController {
// 参数列表
Map<String, Object> params = new HashMap<>();
params.put("planCode", planSheet);
params.put("processCodeList", processCodeList);
params.put("planCode", productionArrangements.getPlanSheet());
params.put("processCodeList", productionArrangements.getProcessCodeList());
params.put("processUnit", productionArrangements.getProcessUnit());
// 构建日志
SysOperLog operLog = new SysOperLog();
@ -453,7 +453,7 @@ public class BaseKnifeController extends BaseController {
countMap.put(item.getKnifeCode(), countMap.get(item.getKnifeCode()) + 1);
// 记录源数据然后锁定
baseKnifeOriginList.add(item);
item.setPlanSheet(planSheet);
item.setPlanSheet(productionArrangements.getPlanSheet());
item.setIsLocked(1);
item.setLockedStartTime(techBom.getLockedStartTime());
item.setLockedEndTime(techBom.getLockedEndTime());
@ -561,7 +561,7 @@ public class BaseKnifeController extends BaseController {
// 生成组装任务
WmsZdTask wmsZdTask = new WmsZdTask();
wmsZdTask.setmProductId(mdItem.getItemId());
wmsZdTask.setPlanSheet(planSheet);
wmsZdTask.setPlanSheet(productionArrangements.getPlanSheet());
wmsZdTask.setCode(generateTaskCode(techBom.getProcessCode()));
wmsZdTask.setName(techBom.getProcessName());
wmsZdTask.setProductIdQty(count);
@ -579,16 +579,16 @@ public class BaseKnifeController extends BaseController {
}
// 添加生产准备记录
ProductionArrangements productionArrangements = new ProductionArrangements();
productionArrangements.setPlanSheet(planSheet);
productionArrangements.setProcessCode(processCodeList.toString());
productionArrangements.setProcessCode(productionArrangements.getProcessCodeList().toString());
productionArrangements.setProcessUnit(productionArrangements.getProcessUnit());
productionArrangements.setStatus(0);
productionArrangements.setCreateTime(DateUtils.getNowDate());
productionArrangementsMapper.insertProductionArrangements(productionArrangements);
if (!msg.contains("缺少物料已生成组装任务!")){
// 生成出库计划单
WmsOutPlan outPlan = new WmsOutPlan();
outPlan.setPlanCode(planSheet);
outPlan.setPlanCode(productionArrangements.getPlanSheet());
outPlan.setWmsBusinessTypeId(16L);
outPlan.setPlanState("1");
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.enums.BusinessType;
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.service.IWmsOutTaskService;
import com.ktg.mes.wm.domain.WmsInPlan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -31,11 +33,10 @@ public class WmsOutTaskController extends BaseController {
/**
* 查询出库任务列表
*/
@GetMapping("/open/incompleteList")
public TableDataInfo openList(WmsOutTask wmsOutTask) {
@GetMapping("/open/incompleteList/{planSheet}")
public TableDataInfo openList(@PathVariable String planSheet) {
startPage();
wmsOutTask.setTaskState("0");
List<WmsOutTask> list = wmsOutTaskService.selectWmsOutTaskList(wmsOutTask);
List<WmsOutTask> list = wmsOutTaskService.selectWmsOutTaskIncompleteList(planSheet);
return getDataTable(list);
}

View File

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

View File

@ -62,4 +62,6 @@ public interface IWmsOutTaskService {
boolean runWmsOutTask(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("wmStorageAreaName", wmsOutPlanDetail.getWmStorageAreaName()); // 库位名称
hashMap.put("detailStatus", wmsOutPlanDetail.getDetailState()); // 明细状态
hashMap.put("isToolSetting", nowWmsOutPlanDetailEntity.getIsToolSetting()); // 明细状态
/* 实体 */
String outTime = null;
if (nowWmsOutPlanDetailEntity.getCreateTime() != null)

View File

@ -10,6 +10,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@ -207,4 +208,18 @@ public class WmsOutTaskServiceImpl implements IWmsOutTaskService {
System.out.println("WCS下发任务 TODO");
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.core.domain.BaseEntity;
import java.util.List;
/**
* 生产准备记录对象 PRODUCTION_ARRANGEMENTS
*
@ -26,6 +28,12 @@ public class ProductionArrangements extends BaseEntity
@Excel(name = "工序号")
private String processCode;
@Excel(name = "工序号")
private List<String> processCodeList;
@Excel(name = "工序号")
private String processUnit;
/** 状态 */
@Excel(name = "状态")
private Integer status;
@ -78,6 +86,22 @@ public class ProductionArrangements extends BaseEntity
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()
{
return status;
@ -121,19 +145,17 @@ public class ProductionArrangements extends BaseEntity
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("productionArrangementsId", getProductionArrangementsId())
.append("planSheet", getPlanSheet())
.append("processCode", getProcessCode())
.append("status", getStatus())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
return "ProductionArrangements{" +
"productionArrangementsId='" + productionArrangementsId + '\'' +
", planSheet='" + planSheet + '\'' +
", processCode='" + processCode + '\'' +
", processCodeList=" + processCodeList +
", processUnit='" + processUnit + '\'' +
", status=" + status +
", attr1='" + attr1 + '\'' +
", attr2='" + attr2 + '\'' +
", attr3='" + attr3 + '\'' +
", attr4='" + attr4 + '\'' +
'}';
}
}

View File

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

View File

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