rev:入阻挡:1109特殊处理

This commit is contained in:
zhangzq
2025-01-20 17:29:52 +08:00
parent 17d03d6d35
commit 234380f834
6 changed files with 39 additions and 33 deletions

View File

@@ -142,9 +142,10 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
throw new BadRequestException("当前任务已完成"); throw new BadRequestException("当前任务已完成");
} }
if (param.getString("status").equals(StatusEnum.FORM_STATUS.code("完成"))) { 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("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())) { if (vehicleMater != null && !StringUtils.isEmpty(vehicleMater.getProc_inst_id())) {
FlowContinueEvent continueEvent = new FlowContinueEvent(vehicleMater.getProc_inst_id(), null, null); FlowContinueEvent continueEvent = new FlowContinueEvent(vehicleMater.getProc_inst_id(), null, null);
BussEventMulticaster.Publish(continueEvent); BussEventMulticaster.Publish(continueEvent);

View File

@@ -28,7 +28,7 @@ public interface IMdPbVehicleMaterService extends IService<MdPbVehicleMater> {
* @param vehicle_code * @param vehicle_code
* @return * @return
*/ */
Map<String, String> getVehicleCode2Id(String...vehicle_code); Map<String, String> getVehicleCode2Id(String material_id,String...vehicle_code);
} }

View File

@@ -43,10 +43,11 @@ public class MdPbVehicleMaterServiceImpl extends ServiceImpl<MdPbVehicleMaterMap
} }
@Override @Override
public Map<String, String> getVehicleCode2Id(String... vehicle_code) { public Map<String, String> getVehicleCode2Id(String material_id,String... vehicle_code) {
if (vehicle_code!=null){ if (vehicle_code!=null){
List<MdPbVehicleMater> list = this.list(new QueryWrapper<MdPbVehicleMater>() List<MdPbVehicleMater> list = this.list(new QueryWrapper<MdPbVehicleMater>()
.in("vehicle_code", vehicle_code) .in("vehicle_code", vehicle_code)
.eq("material_id", material_id)
.eq("is_delete", false)); .eq("is_delete", false));
Map<String, String> collect = list.stream().collect(HashMap::new, (map, vehicle) -> map.put(vehicle.getVehicle_code(), vehicle.getId()), HashMap::putAll); Map<String, String> collect = list.stream().collect(HashMap::new, (map, vehicle) -> map.put(vehicle.getVehicle_code(), vehicle.getId()), HashMap::putAll);
return collect; return collect;

View File

@@ -26,6 +26,7 @@ import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@@ -61,10 +62,10 @@ public class IOStorageController {
@Log("手持出库出库确认") @Log("手持出库出库确认")
public ResponseEntity<Object> outStorage(@RequestBody JSONObject form) { public ResponseEntity<Object> outStorage(@RequestBody JSONObject form) {
String vehicle_code = form.getString("vehicle_code"); 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("vehicle_code", vehicle_code)
.eq("is_delete", false)); .eq("is_delete", false));
if (one != null) { if (!CollectionUtils.isEmpty(ones)) {
//校验料箱是否还存在库存 //校验料箱是否还存在库存
RedissonUtils.lock(() -> { RedissonUtils.lock(() -> {
QueryWrapper<StIvtStructattr> query = new QueryWrapper<StIvtStructattr>() QueryWrapper<StIvtStructattr> query = new QueryWrapper<StIvtStructattr>()
@@ -77,35 +78,38 @@ public class IOStorageController {
} }
}, StatusEnum.STRATEGY_TYPE.code("出库") + vehicle_code, 5); }, StatusEnum.STRATEGY_TYPE.code("出库") + vehicle_code, 5);
//流程校验 //流程校验
String proc_inst_id = one.getProc_inst_id(); for (MdPbVehicleMater one : ones) {
if (!StringUtils.isEmpty(proc_inst_id)) { String proc_inst_id = one.getProc_inst_id();
String parent_id = iActRuExecutionService.getParentByChild(proc_inst_id); if (!StringUtils.isEmpty(proc_inst_id)) {
ActRuExecution ruExecution = iActRuExecutionService.getOne(new QueryWrapper<ActRuExecution>() String parent_id = iActRuExecutionService.getParentByChild(proc_inst_id);
.eq("proc_inst_id", parent_id) ActRuExecution ruExecution = iActRuExecutionService.getOne(new QueryWrapper<ActRuExecution>()
.lt("status", StatusEnum.FLOW_STATUS.code("完成"))); .eq("proc_inst_id", parent_id)
if (ruExecution != null) { .lt("status", StatusEnum.FLOW_STATUS.code("完成")));
throw new BadRequestException(String.format("当前载具%s业务流程%s未完成", vehicle_code, parent_id)); if (ruExecution != null) {
throw new BadRequestException(String.format("当前载具%s业务流程%s未完成", vehicle_code, parent_id));
}
} }
} //单据校验"针对托盘库做条件判断
//单据校验"针对托盘库做条件判断 if (vehicle_code.contains("T")){
if (vehicle_code.contains("T")){ if (one.getNeed_pick() && one.getQty().compareTo(BigDecimal.ZERO)>0){
if (one.getNeed_pick() && one.getQty().compareTo(BigDecimal.ZERO)>0){ throw new BadRequestException(one.getRemark());
throw new BadRequestException(one.getRemark()); }
} }
} iMdPbVehicleMaterService.update(new UpdateWrapper<MdPbVehicleMater>()
iMdPbVehicleMaterService.update(new UpdateWrapper<MdPbVehicleMater>() .set("is_delete",true)
.set("is_delete",true) .set("proc_inst_id",null)
.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("完成"))
.set("update_time", DateUtil.now()) .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); return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
} }

View File

@@ -280,7 +280,7 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvOutMapp
throw new BadRequestException("分配失败,当前出库分配无可用货位"); throw new BadRequestException("分配失败,当前出库分配无可用货位");
} }
String vehicle_code = map.get("vehicle_code"); 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"))){ if (!StringUtils.isEmpty(form.getString("id"))){
iStIvtIostorinvDtlService.update(new UpdateWrapper<StIvtIostorinvdtl>() iStIvtIostorinvDtlService.update(new UpdateWrapper<StIvtIostorinvdtl>()
.set("vehicle_code", vehicle_code) .set("vehicle_code", vehicle_code)

View File

@@ -98,7 +98,7 @@
</appender> </appender>
<!--开发环境:打印控制台--> <!--开发环境:打印控制台-->
<springProfile name="dev"> <springProfile name="dev3">
<root level="info"> <root level="info">
<appender-ref ref="asyncLuceneAppender"/> <appender-ref ref="asyncLuceneAppender"/>
<appender-ref ref="CONSOLE"/> <appender-ref ref="CONSOLE"/>