组装任务基础物料出库流程拆分
This commit is contained in:
parent
9ac0574f20
commit
467b1e1548
@ -51,9 +51,9 @@ public class WmsOutPlanController extends BaseController {
|
||||
@PreAuthorize("@ss.hasPermi('md:PLAN:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(WmsOutPlan wmsOutPlan) {
|
||||
System.out.println("===================================================");
|
||||
System.out.println(JSON.toJSONString(this.aP0AEService.selectAllAP0AE()));
|
||||
System.out.println("===================================================");
|
||||
// System.out.println("===================================================");
|
||||
// System.out.println(JSON.toJSONString(this.aP0AEService.selectAllAP0AE()));
|
||||
// System.out.println("===================================================");
|
||||
|
||||
startPage();
|
||||
List<WmsOutPlan> list = wmsOutPlanService.selectWmsOutPlanList(wmsOutPlan);
|
||||
|
@ -5,7 +5,9 @@ import com.ktg.mes.md.domain.*;
|
||||
import com.ktg.mes.md.mapper.*;
|
||||
import com.ktg.mes.md.service.IWmsOutTaskService;
|
||||
import com.ktg.mes.wm.domain.WmStorageArea;
|
||||
import com.ktg.mes.wm.domain.WmsZdTask;
|
||||
import com.ktg.mes.wm.mapper.WmStorageAreaMapper;
|
||||
import com.ktg.mes.wm.mapper.WmsZdTaskMapper;
|
||||
import com.ktg.mes.wm.service.IWmStorageAreaService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -47,6 +49,9 @@ public class WmsOutTaskServiceImpl implements IWmsOutTaskService {
|
||||
@Autowired
|
||||
private WmStorageAreaMapper wmStorageAreaMapper;
|
||||
|
||||
@Autowired
|
||||
private WmsZdTaskMapper wmsZdTaskMapper;
|
||||
|
||||
@Autowired
|
||||
private MyConfig myConfig;
|
||||
|
||||
@ -217,16 +222,57 @@ public class WmsOutTaskServiceImpl implements IWmsOutTaskService {
|
||||
1
|
||||
);
|
||||
|
||||
this.toolSetting(wmsOutPlanDetailEntity);
|
||||
// this.toolSetting(wmsOutPlanDetailEntity);
|
||||
}
|
||||
|
||||
// 更新出库任务状态
|
||||
wmsOutTask.setTaskState("1");
|
||||
wmsOutTaskMapper.updateWmsOutTask(wmsOutTask);
|
||||
|
||||
// 完成标识
|
||||
boolean flag = true;
|
||||
|
||||
// 判断是否来自组装任务
|
||||
WmsZdTask wmsZdTaskWrapper = new WmsZdTask();
|
||||
wmsZdTaskWrapper.setCode(wmsOutTask.getWmsOutPlanCode());
|
||||
List<WmsZdTask> wmsZdTaskList = wmsZdTaskMapper.selectWmsZdTaskList(wmsZdTaskWrapper);
|
||||
if (!wmsZdTaskList.isEmpty()){
|
||||
// 获取组装任务
|
||||
WmsZdTask wmsZdTask = wmsZdTaskList.get(0);
|
||||
|
||||
// 检测是否完成
|
||||
WmsOutTask wmsOutTaskWrapper = new WmsOutTask();
|
||||
wmsOutTaskWrapper.setWmsOutPlanCode(wmsZdTask.getCode());
|
||||
List<WmsOutTask> wmsOutTaskList = wmsOutTaskMapper.selectWmsOutTaskList(wmsOutTaskWrapper);
|
||||
|
||||
// 遍历状态
|
||||
for (WmsOutTask item: wmsOutTaskList){
|
||||
if (Objects.equals("0", item.getTaskState())) {
|
||||
flag = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flag) { this.wmsZdTaskFinish(wmsOutTask.getWmsOutPlanCode()); }
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void wmsZdTaskFinish(String planCode){
|
||||
WmsZdTask wmsZdTaskWrapper = new WmsZdTask();
|
||||
wmsZdTaskWrapper.setCode(planCode);
|
||||
List<WmsZdTask> wmsZdTaskList = wmsZdTaskMapper.selectWmsZdTaskList(wmsZdTaskWrapper);
|
||||
|
||||
if (!wmsZdTaskList.isEmpty()) {
|
||||
// 获取组装任务 更新状态
|
||||
WmsZdTask wmsZdTask = wmsZdTaskList.get(0);
|
||||
wmsZdTask.setStatus("1");
|
||||
wmsZdTaskMapper.updateWmsZdTask(wmsZdTask);
|
||||
}
|
||||
}
|
||||
|
||||
public void toolSetting(WmsOutPlanDetailEntity wmsOutPlanDetailEntity) throws JAXBException {
|
||||
// 读取xml配置文件
|
||||
File xmlFile = new File(myConfig.getToolSettingXmlPath());
|
||||
|
@ -254,7 +254,6 @@ public class WmsZdTaskServiceImpl implements IWmsZdTaskService
|
||||
if ("ITEM".equals(wmsBaseKnife.getItemOrProduct())) rfid = wmsBaseKnife.getRfid();
|
||||
wmsBaseKnife.setZdTaskId(zdTask.getWmsZdTaskId());
|
||||
wmsBaseKnife.setIsLocked(1);
|
||||
wmsBaseKnife.setKnifeFineState(2);
|
||||
wmsBaseKnife.setLockedStartTime(technologyBom.getLockedStartTime());
|
||||
wmsBaseKnife.setLockedEndTime(technologyBom.getLockedEndTime());
|
||||
wmsBaseKnife.setParentId(baseKnife.getBaseKnifeId());
|
||||
@ -353,7 +352,7 @@ public class WmsZdTaskServiceImpl implements IWmsZdTaskService
|
||||
wmsOutTask.setMdItemCode(outPlanDetail.getMdItemCode());
|
||||
wmsOutTask.setMdItemName(outPlanDetail.getMdItemName());
|
||||
wmsOutTask.setMdItemUnit(outPlanDetail.getMdItemUnit());
|
||||
wmsOutTask.setTaskState("1");
|
||||
wmsOutTask.setTaskState("0");
|
||||
wmsOutTask.setRecipientUsername("");
|
||||
wmsOutTask.setCreateBy(getUsername());
|
||||
wmsOutTask.setCreateTime(DateUtils.getNowDate());
|
||||
@ -362,7 +361,7 @@ public class WmsZdTaskServiceImpl implements IWmsZdTaskService
|
||||
});
|
||||
|
||||
// 更新组装任务
|
||||
zdTask.setStatus("1");
|
||||
zdTask.setStatus("3");
|
||||
wmsZdTaskMapper.updateWmsZdTask(zdTask);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user