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,6 +78,7 @@ public class IOStorageController {
} }
}, StatusEnum.STRATEGY_TYPE.code("出库") + vehicle_code, 5); }, StatusEnum.STRATEGY_TYPE.code("出库") + vehicle_code, 5);
//流程校验 //流程校验
for (MdPbVehicleMater one : ones) {
String proc_inst_id = one.getProc_inst_id(); String proc_inst_id = one.getProc_inst_id();
if (!StringUtils.isEmpty(proc_inst_id)) { if (!StringUtils.isEmpty(proc_inst_id)) {
String parent_id = iActRuExecutionService.getParentByChild(proc_inst_id); String parent_id = iActRuExecutionService.getParentByChild(proc_inst_id);
@@ -107,6 +109,8 @@ public class IOStorageController {
); );
} }
} }
}
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"/>