Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
9592daa5fc
@ -84,25 +84,26 @@ public class BaseKnifeController extends BaseController
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/open/selectBaseKnife")
|
||||
public List<Map<String, String>> openList() {
|
||||
public List<Map<String, Object>> openList() {
|
||||
BaseKnife baseKnife = new BaseKnife();
|
||||
List<BaseKnife> list = baseKnifeService.selectBaseKnifeList(null);
|
||||
List<Map<String, String>> result = new ArrayList<>();
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
list.forEach(item -> {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("gid", item.getBaseKnifeId().toString());
|
||||
map.put("code", item.getKnifeCode());
|
||||
map.put("name", item.getKnifeName());
|
||||
map.put("pmbbMeasure", item.getKnifeUnit());
|
||||
map.put("mbbMrlClass", item.getKnifeType());
|
||||
map.put("wmsAreaCode", item.getAreaCode());
|
||||
map.put("itemCode", item.getKnifeCode());
|
||||
map.put("itemName", item.getKnifeName());
|
||||
map.put("itemUnit", item.getKnifeUnit());
|
||||
map.put("itemType", item.getKnifeType());
|
||||
map.put("areaCode", item.getAreaCode());
|
||||
map.put("knifeLife", "100");
|
||||
map.put("knifeLifeUser", item.getKnifeLife() == 0 ? null : String.valueOf(100 - item.getKnifeLife()));
|
||||
map.put("knifeLifeUsed", item.getKnifeLife() == 0 ? null : String.valueOf(100 - item.getKnifeLife()));
|
||||
map.put("knifeLifeLeave", item.getKnifeLife() == 0 ? null : String.valueOf(item.getKnifeLife()));
|
||||
map.put("isLocked", item.getIsLocked().toString());
|
||||
map.put("lockedStartTime", item.getLockedStartTime() == null ? null : item.getLockedStartTime().toString());
|
||||
map.put("lockedEndTime",item.getLockedEndTime() == null ? null : item.getLockedEndTime().toString());
|
||||
map.put("isLocked", item.getIsLocked());
|
||||
map.put("lockedStartTime", item.getLockedStartTime() == null ? null : item.getLockedStartTime());
|
||||
map.put("lockedEndTime",item.getLockedEndTime() == null ? null : item.getLockedEndTime());
|
||||
map.put("planSheet",item.getPlanSheet() == null ? null : item.getPlanSheet());
|
||||
map.put("outInfoList", item.getOutInfoList() );
|
||||
result.add(map);
|
||||
});
|
||||
|
||||
@ -302,12 +303,12 @@ public class BaseKnifeController extends BaseController
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/open/productionArrangements/{planCode}")
|
||||
@PostMapping("/open/productionArrangements/{planSheet}")
|
||||
@ResponseBody
|
||||
public AjaxResult productionArrangements(@PathVariable String planCode, @RequestBody List<String> processCodeList) {
|
||||
public AjaxResult productionArrangements(@PathVariable String planSheet, @RequestBody List<String> processCodeList) {
|
||||
// 检查计划单是否已存在
|
||||
BaseKnife baseKnifePlan = new BaseKnife();
|
||||
baseKnifePlan.setPlanSheet(planCode);
|
||||
baseKnifePlan.setPlanSheet(planSheet);
|
||||
if (!baseKnifeService.selectBaseKnifeList(baseKnifePlan).isEmpty())
|
||||
return AjaxResult.error("该计划单已存在,请更换重试");
|
||||
|
||||
@ -321,7 +322,7 @@ public class BaseKnifeController extends BaseController
|
||||
|
||||
// 参数列表
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("planCode", planCode);
|
||||
params.put("planCode", planSheet);
|
||||
params.put("processCodeList", processCodeList);
|
||||
|
||||
// 构建日志
|
||||
@ -437,7 +438,7 @@ public class BaseKnifeController extends BaseController
|
||||
countMap.put(item.getKnifeCode(), countMap.get(item.getKnifeCode()) + 1);
|
||||
// 记录源数据然后锁定
|
||||
baseKnifeOriginList.add(item);
|
||||
item.setPlanSheet(planCode);
|
||||
item.setPlanSheet(planSheet);
|
||||
item.setIsLocked(1);
|
||||
item.setLockedStartTime(techBom.getLockedStartTime());
|
||||
item.setLockedEndTime(techBom.getLockedEndTime());
|
||||
@ -546,7 +547,7 @@ public class BaseKnifeController extends BaseController
|
||||
// 生成组装任务
|
||||
WmsZdTask wmsZdTask = new WmsZdTask();
|
||||
wmsZdTask.setmProductId(mdItem.getItemId());
|
||||
wmsZdTask.setAttr4(planCode);
|
||||
wmsZdTask.setAttr4(planSheet);
|
||||
wmsZdTask.setCode(techBom.getProcessCode());
|
||||
wmsZdTask.setName(techBom.getProcessName());
|
||||
wmsZdTask.setProductIdQty(count);
|
||||
@ -584,12 +585,15 @@ public class BaseKnifeController extends BaseController
|
||||
BomRoute bomRoute = bomRouteService.selectBomRouteByBomRouteId(zdTask.getAttr1());
|
||||
BaseKnife baseKnifeWrapper = new BaseKnife();
|
||||
List<BaseKnife> baseKnifeList = new ArrayList<>();
|
||||
|
||||
// 遍历组装整刀需要的bom物料
|
||||
for (MbbProduBom mbbProduBom : bomRoute.getMbbProduBomList()) {
|
||||
// 查找未锁定的物料
|
||||
baseKnifeWrapper.setMbbBdMrlId(mbbProduBom.getMdItemId());
|
||||
baseKnifeWrapper.setIsLocked(0);
|
||||
baseKnifeList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
|
||||
|
||||
// 如果未锁定的物料不足所需数量
|
||||
if (baseKnifeList.size() < mbbProduBom.getStandardDosage() * zdTask.getProductIdQty())
|
||||
return AjaxResult.error("bom物料不足进行组装:" + mbbProduBom.getMdItemCode());
|
||||
}
|
||||
@ -608,6 +612,7 @@ public class BaseKnifeController extends BaseController
|
||||
// 出库基础物料, 根据图号查询出库计划,如果不存在生成计划,存在则往计划中添加任务
|
||||
WmsOutPlan outPlan = wmsOutPlanMapper.selectWmsOutPlanByPlanCode(zdTask.getAttr4());
|
||||
if (outPlan == null){
|
||||
// 构建新的出库计划
|
||||
WmsOutPlan outPlanTemp = new WmsOutPlan();
|
||||
outPlanTemp.setPlanCode(zdTask.getAttr4() == null ? zdTask.getCode() : zdTask.getAttr4());
|
||||
outPlanTemp.setWmsBusinessTypeId(12L);
|
||||
@ -630,6 +635,7 @@ public class BaseKnifeController extends BaseController
|
||||
baseKnife.setKnifeName(mdItem.getItemName());
|
||||
baseKnife.setKnifeUnit(mdItem.getUnitName());
|
||||
baseKnife.setKnifeType(mdItem.getItemTypeName());
|
||||
// attr3 库位编码
|
||||
baseKnife.setAreaCode(zdTask.getAttr3());
|
||||
baseKnife.setSafeStock(mdItem.getMinStock());
|
||||
baseKnife.setStandardQuantity("1");
|
||||
@ -643,6 +649,7 @@ public class BaseKnifeController extends BaseController
|
||||
} else {
|
||||
baseKnife.setIsLocked(0);
|
||||
}
|
||||
// attr4 计划编码, 整刀
|
||||
baseKnife.setPlanSheet(zdTask.getAttr4());
|
||||
baseKnife.setItemOrProduct("PRODUCT");
|
||||
baseKnife.setCreateBy(getUsername());
|
||||
@ -652,12 +659,13 @@ public class BaseKnifeController extends BaseController
|
||||
// 锁定物料
|
||||
int resetCount = 0;
|
||||
for (MbbProduBom mbbProduBom : bomRoute.getMbbProduBomList()) {
|
||||
// 查询未锁定的物料
|
||||
baseKnifeWrapper.setMbbBdMrlId(mbbProduBom.getMdItemId());
|
||||
baseKnifeWrapper.setIsLocked(0);
|
||||
baseKnifeList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper);
|
||||
|
||||
if (outPlanFlag) {
|
||||
// 出库任务
|
||||
// 出库任务,进行基础物料的出库
|
||||
MdItem mdItemOutPlan = mdItemService.selectMdItemById(mbbProduBom.getMdItemId());
|
||||
WmsOutPlanDetail outPlanDetail = new WmsOutPlanDetail();
|
||||
outPlanDetail.setWmsOutPlanId(outPlan.getWmsOutPlanId());
|
||||
@ -668,6 +676,7 @@ public class BaseKnifeController extends BaseController
|
||||
outPlanDetail.setPlannedQuantity(mbbProduBom.getStandardDosage() * zdTask.getProductIdQty());
|
||||
outPlanDetail.setRealQuantity(mbbProduBom.getStandardDosage() * zdTask.getProductIdQty());
|
||||
outPlanDetail.setDetailBatchNum(batchNum);
|
||||
// 查询库位信息
|
||||
WmStorageArea wmStorageArea = wmStorageAreaService.selectWmStorageAreaByAreaCode(zdTask.getAttr3());
|
||||
outPlanDetail.setWmStorageAreaId(wmStorageArea.getAreaId());
|
||||
outPlanDetail.setWmStorageAreaCode(wmStorageArea.getAreaCode());
|
||||
@ -706,7 +715,7 @@ public class BaseKnifeController extends BaseController
|
||||
for (WmsOutPlanDetail outPlanDetail : wmsOutPlanDetailList){
|
||||
wmsOutPlanMapper.insertWmsOutPlanDetail(outPlanDetail);
|
||||
|
||||
// 出库计划明细
|
||||
// 出库计划明细,绑定实体
|
||||
for (int j = 0; j < outPlanDetail.getPlannedQuantity(); j++) {
|
||||
WmsOutPlanDetailEntity wmsOutPlanDetailEntity = new WmsOutPlanDetailEntity();
|
||||
wmsOutPlanDetailEntity.setBaseKnifeId(baseKnifeListOutPlan.get(i).getBaseKnifeId());
|
||||
@ -729,11 +738,11 @@ public class BaseKnifeController extends BaseController
|
||||
// 生成出库任务
|
||||
WmsOutTask wmsOutTask = new WmsOutTask();
|
||||
wmsOutTask.setWmsOutPlanId(outPlan.getWmsOutPlanId());
|
||||
wmsOutTask.setWmsOutPlanCode(generateTaskCode(outPlan.getPlanCode()));
|
||||
wmsOutTask.setWmsOutPlanCode(outPlan.getPlanCode());
|
||||
wmsOutTask.setWmsOutPlanDetailId(outPlanDetail.getWmsOutPlanDetailId());
|
||||
// 出库类型 12组刀出库
|
||||
wmsOutTask.setWmsBusinessTypeId(12L);
|
||||
wmsOutTask.setTaskCode(outPlan.getPlanCode());
|
||||
wmsOutTask.setTaskCode(generateTaskCode(outPlan.getPlanCode()));
|
||||
wmsOutTask.setTaskNumber(outPlanDetail.getPlannedQuantity());
|
||||
wmsOutTask.setOutNumber(outPlanDetail.getRealQuantity());
|
||||
wmsOutTask.setWmStorageAreaId(outPlanDetail.getWmStorageAreaId());
|
||||
|
@ -27,6 +27,18 @@ public class WmsOutTaskController extends BaseController {
|
||||
@Autowired
|
||||
private IWmsOutTaskService wmsOutTaskService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询出库任务列表
|
||||
*/
|
||||
@GetMapping("/open/list")
|
||||
public TableDataInfo openList(WmsOutTask wmsOutTask) {
|
||||
startPage();
|
||||
wmsOutTask.setTaskState("0");
|
||||
List<WmsOutTask> list = wmsOutTaskService.selectWmsOutTaskList(wmsOutTask);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询出库任务列表
|
||||
*/
|
||||
|
@ -40,7 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<include refid="selectWmsOutTaskVo"/>
|
||||
<where>
|
||||
<if test="wmsOutPlanId != null "> and WMS_OUT_PLAN_ID = #{wmsOutPlanId}</if>
|
||||
<if test="wmsOutPlanCode != null and wmsOutPlanCode != ''"> and WMS_OUT_PLAN_CODE like concat('%', #{wmsOutPlanCode}, '%')</if>
|
||||
<if test="wmsOutPlanCode != null and wmsOutPlanCode != ''"> and WMS_OUT_PLAN_CODE = #{wmsOutPlanCode} </if>
|
||||
<if test="wmsOutPlanDetailId != null "> and WMS_OUT_PLAN_DETAIL_ID = #{wmsOutPlanDetailId}</if>
|
||||
<if test="wmsBusinessTypeId != null "> and WMS_BUSINESS_TYPE_ID = #{wmsBusinessTypeId}</if>
|
||||
<if test="taskCode != null and taskCode != ''"> and TASK_CODE like concat('%', #{taskCode}, '%')</if>
|
||||
|
Loading…
Reference in New Issue
Block a user