rev:入阻挡:1109特殊处理
This commit is contained in:
@@ -142,9 +142,10 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
throw new BadRequestException("当前任务已完成");
|
||||
}
|
||||
if (param.getString("status").equals(StatusEnum.FORM_STATUS.code("完成"))) {
|
||||
MdPbVehicleMater vehicleMater = iMdPbVehicleMaterService.getOne(new QueryWrapper<MdPbVehicleMater>()
|
||||
List<MdPbVehicleMater> list = iMdPbVehicleMaterService.list(new QueryWrapper<MdPbVehicleMater>()
|
||||
.eq("vehicle_code", task.getVehicle_code())
|
||||
.eq("is_delete",false));
|
||||
.eq("is_delete", false));
|
||||
list.get(0)
|
||||
if (vehicleMater != null && !StringUtils.isEmpty(vehicleMater.getProc_inst_id())) {
|
||||
FlowContinueEvent continueEvent = new FlowContinueEvent(vehicleMater.getProc_inst_id(), null, null);
|
||||
BussEventMulticaster.Publish(continueEvent);
|
||||
|
||||
@@ -28,7 +28,7 @@ public interface IMdPbVehicleMaterService extends IService<MdPbVehicleMater> {
|
||||
* @param vehicle_code
|
||||
* @return
|
||||
*/
|
||||
Map<String, String> getVehicleCode2Id(String...vehicle_code);
|
||||
Map<String, String> getVehicleCode2Id(String material_id,String...vehicle_code);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -43,10 +43,11 @@ public class MdPbVehicleMaterServiceImpl extends ServiceImpl<MdPbVehicleMaterMap
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getVehicleCode2Id(String... vehicle_code) {
|
||||
public Map<String, String> getVehicleCode2Id(String material_id,String... vehicle_code) {
|
||||
if (vehicle_code!=null){
|
||||
List<MdPbVehicleMater> list = this.list(new QueryWrapper<MdPbVehicleMater>()
|
||||
.in("vehicle_code", vehicle_code)
|
||||
.eq("material_id", material_id)
|
||||
.eq("is_delete", false));
|
||||
Map<String, String> collect = list.stream().collect(HashMap::new, (map, vehicle) -> map.put(vehicle.getVehicle_code(), vehicle.getId()), HashMap::putAll);
|
||||
return collect;
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -61,10 +62,10 @@ public class IOStorageController {
|
||||
@Log("手持出库出库确认")
|
||||
public ResponseEntity<Object> outStorage(@RequestBody JSONObject form) {
|
||||
String vehicle_code = form.getString("vehicle_code");
|
||||
MdPbVehicleMater one = iMdPbVehicleMaterService.getOne(new QueryWrapper<MdPbVehicleMater>()
|
||||
List<MdPbVehicleMater> ones = iMdPbVehicleMaterService.list(new QueryWrapper<MdPbVehicleMater>()
|
||||
.eq("vehicle_code", vehicle_code)
|
||||
.eq("is_delete", false));
|
||||
if (one != null) {
|
||||
if (!CollectionUtils.isEmpty(ones)) {
|
||||
//校验料箱是否还存在库存
|
||||
RedissonUtils.lock(() -> {
|
||||
QueryWrapper<StIvtStructattr> query = new QueryWrapper<StIvtStructattr>()
|
||||
@@ -77,35 +78,38 @@ public class IOStorageController {
|
||||
}
|
||||
}, StatusEnum.STRATEGY_TYPE.code("出库") + vehicle_code, 5);
|
||||
//流程校验
|
||||
String proc_inst_id = one.getProc_inst_id();
|
||||
if (!StringUtils.isEmpty(proc_inst_id)) {
|
||||
String parent_id = iActRuExecutionService.getParentByChild(proc_inst_id);
|
||||
ActRuExecution ruExecution = iActRuExecutionService.getOne(new QueryWrapper<ActRuExecution>()
|
||||
.eq("proc_inst_id", parent_id)
|
||||
.lt("status", StatusEnum.FLOW_STATUS.code("完成")));
|
||||
if (ruExecution != null) {
|
||||
throw new BadRequestException(String.format("当前载具%s业务流程%s未完成", vehicle_code, parent_id));
|
||||
for (MdPbVehicleMater one : ones) {
|
||||
String proc_inst_id = one.getProc_inst_id();
|
||||
if (!StringUtils.isEmpty(proc_inst_id)) {
|
||||
String parent_id = iActRuExecutionService.getParentByChild(proc_inst_id);
|
||||
ActRuExecution ruExecution = iActRuExecutionService.getOne(new QueryWrapper<ActRuExecution>()
|
||||
.eq("proc_inst_id", parent_id)
|
||||
.lt("status", StatusEnum.FLOW_STATUS.code("完成")));
|
||||
if (ruExecution != null) {
|
||||
throw new BadRequestException(String.format("当前载具%s业务流程%s未完成", vehicle_code, parent_id));
|
||||
}
|
||||
}
|
||||
}
|
||||
//单据校验"针对托盘库做条件判断
|
||||
if (vehicle_code.contains("T")){
|
||||
if (one.getNeed_pick() && one.getQty().compareTo(BigDecimal.ZERO)>0){
|
||||
throw new BadRequestException(one.getRemark());
|
||||
//单据校验"针对托盘库做条件判断
|
||||
if (vehicle_code.contains("T")){
|
||||
if (one.getNeed_pick() && one.getQty().compareTo(BigDecimal.ZERO)>0){
|
||||
throw new BadRequestException(one.getRemark());
|
||||
}
|
||||
}
|
||||
}
|
||||
iMdPbVehicleMaterService.update(new UpdateWrapper<MdPbVehicleMater>()
|
||||
.set("is_delete",true)
|
||||
.set("proc_inst_id",null)
|
||||
.set("update_time", DateUtil.now())
|
||||
.set("update_name", SecurityUtils.getCurrentNickName())
|
||||
.eq("id",one.getId()));
|
||||
if (StringUtils.isNotEmpty(one.getGroup_id())){
|
||||
iMdGruopDickService.update(new UpdateWrapper<MdGruopDick>()
|
||||
.set("status", StatusEnum.FORM_STATUS.code("完成"))
|
||||
iMdPbVehicleMaterService.update(new UpdateWrapper<MdPbVehicleMater>()
|
||||
.set("is_delete",true)
|
||||
.set("proc_inst_id",null)
|
||||
.set("update_time", DateUtil.now())
|
||||
.eq("id", one.getGroup_id())
|
||||
);
|
||||
.set("update_name", SecurityUtils.getCurrentNickName())
|
||||
.eq("id",one.getId()));
|
||||
if (StringUtils.isNotEmpty(one.getGroup_id())){
|
||||
iMdGruopDickService.update(new UpdateWrapper<MdGruopDick>()
|
||||
.set("status", StatusEnum.FORM_STATUS.code("完成"))
|
||||
.set("update_time", DateUtil.now())
|
||||
.eq("id", one.getGroup_id())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvOutMapp
|
||||
throw new BadRequestException("分配失败,当前出库分配无可用货位");
|
||||
}
|
||||
String vehicle_code = map.get("vehicle_code");
|
||||
Map<String, String> stringMap = iMdPbVehicleMaterService.getVehicleCode2Id(vehicle_code.split(","));
|
||||
Map<String, String> stringMap = iMdPbVehicleMaterService.getVehicleCode2Id(form.getString("material_id"),vehicle_code.split(","));
|
||||
if (!StringUtils.isEmpty(form.getString("id"))){
|
||||
iStIvtIostorinvDtlService.update(new UpdateWrapper<StIvtIostorinvdtl>()
|
||||
.set("vehicle_code", vehicle_code)
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
</appender>
|
||||
|
||||
<!--开发环境:打印控制台-->
|
||||
<springProfile name="dev">
|
||||
<springProfile name="dev3">
|
||||
<root level="info">
|
||||
<appender-ref ref="asyncLuceneAppender"/>
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
|
||||
Reference in New Issue
Block a user