rev:兼容vehicle_id;载具物料表支持载具历史记录:is_delete

This commit is contained in:
zhangzq
2024-07-19 09:49:19 +08:00
parent b508821c34
commit 7a5f0dfdc3
14 changed files with 67 additions and 39 deletions

View File

@@ -79,6 +79,7 @@ public class LogAspect {
// logService.save(getUsername(), StringUtils.getBrowser(request), requestIp, joinPoint, log);
// }
}catch (Exception ex){
StringBuffer errorStack = new StringBuffer();
errorStack.append("<br/>【异常堆栈:");
String errorMsg = ex.getMessage();

View File

@@ -65,22 +65,6 @@ public class GlobalExceptionHandler {
return buildResponseEntity(ApiError.error(e.getStatus(),e.getMessage()));
}
/**
* 处理所有接口数据验证异常
*/
@ExceptionHandler(MethodArgumentNotValidException.class)
public ResponseEntity<ApiError> handleMethodArgumentNotValidException(MethodArgumentNotValidException e){
// 打印堆栈信息
log.error(ApiError.getStackTrace(e));
String[] str = Objects.requireNonNull(e.getBindingResult().getAllErrors().get(0).getCodes())[1].split("\\.");
String message = e.getBindingResult().getAllErrors().get(0).getDefaultMessage();
String msg = "不能为空";
if(msg.equals(message)){
message = str[1] + ":" + message;
}
return buildResponseEntity(ApiError.error(message));
}
/**
* 统一返回
*/

View File

@@ -37,7 +37,6 @@ public class RedissonUtils {
throw new BadRequestException("当前业务:"+key+"正在执行请稍后再试");
}
}catch (Exception ex){
ex.printStackTrace();
throw ex;
}finally {
if (lock.isHeldByCurrentThread() && lock.isLocked()){

View File

@@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -43,10 +44,8 @@ public class SchBaseTaskController {
@PostMapping("getVehicleTask")
public ResponseEntity<Object> getVehicleTask(@RequestBody JSONObject param) {
if (CollectionUtils.isEmpty(param)){
throw new BadRequestException("参数不能为空");
}
return new ResponseEntity<>(iSchBaseTaskService.getByVehicle(param.getString("vehicle_code")), HttpStatus.OK);
Assert.noNullElements(new Object[]{param,param.getString("vehicle_id")},"请求参数不能为空");
return new ResponseEntity<>(iSchBaseTaskService.getByVehicle(param.getString("vehicle_id")), HttpStatus.OK);
}

View File

@@ -61,7 +61,9 @@ public class GroupDickInStorageTask extends AbstractTask {
if (StringUtils.isEmpty(point_code1)){
throw new BadRequestException("申请任务失败:请求参数数据异常");
}
MdGruopDick mst = iMdGruopDickService.getOne(new QueryWrapper<MdGruopDick>().eq("vehicle_code", vehicle_code).le("status", StatusEnum.FORM_STATUS.code("完成")));
MdGruopDick mst = iMdGruopDickService
.getOne(new QueryWrapper<MdGruopDick>().eq("vehicle_code", vehicle_code)
.lt("status", StatusEnum.FORM_STATUS.code("完成")));
if (mst == null){
throw new BadRequestException("申请任务失败:载具"+vehicle_code+"组盘信息不存在");
}

View File

@@ -138,7 +138,8 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
}
if (param.getString("status").equals(StatusEnum.FORM_STATUS.code("完成"))) {
MdPbVehicleMater vehicleMater = iMdPbVehicleMaterService.getOne(new QueryWrapper<MdPbVehicleMater>()
.eq("vehicle_code", task.getVehicle_code()));
.eq("vehicle_code", task.getVehicle_code())
.eq("is_delete",false));
if (vehicleMater != null && !StringUtils.isEmpty(vehicleMater.getProc_inst_id())) {
FlowContinueEvent continueEvent = new FlowContinueEvent(vehicleMater.getProc_inst_id(), null, null);
BussEventMulticaster.Publish(continueEvent);
@@ -253,7 +254,9 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
private JSONObject dicisionStruct(String struct_code, StIvtStructattr stIvtStructattr, SchBaseTask task) {
String task_code = task.getTask_code();
MdPbVehicleMater vehicleCode = iMdPbVehicleMaterService.getOne(new QueryWrapper<MdPbVehicleMater>().eq("vehicle_code", task.getVehicle_code()));
MdPbVehicleMater vehicleCode = iMdPbVehicleMaterService
.getOne(new QueryWrapper<MdPbVehicleMater>()
.eq("vehicle_code", task.getVehicle_code()));
//查询分配规则
Map map = SpringContextHolder.getBean(DecisionHandler.class)
.dispenseTransa(ListOf.of("nearby"), new JSONObject(MapOf.of("stor_code", stIvtStructattr.getStor_code())));

View File

@@ -34,10 +34,6 @@ public class AcsToWmsController {
@SaIgnore
@Log("acs请求wms")
public ResponseEntity<Object> apply(@RequestBody InteracteDto form) {
try {
return new ResponseEntity<>(TableDataInfo.buildJson(gateWayService.apply(form)),HttpStatus.OK);
}catch (Exception ex){
return new ResponseEntity<>(ApiError.error(ex.getMessage()),HttpStatus.BAD_REQUEST);
}
return new ResponseEntity<>(TableDataInfo.buildJson(gateWayService.apply(form)),HttpStatus.OK);
}
}

View File

@@ -128,7 +128,9 @@ public class MdGruopDickServiceImpl extends ServiceImpl<MdGruopDickMapper, MdGru
if (tmpCount<map.size()){
throw new BadRequestException("组盘失败:载具编号不存在");
}
List<MdPbVehicleMater> tmpCount1 = iMdPbVehicleMaterService.list(new QueryWrapper<MdPbVehicleMater>().in("vehicle_code", map.keySet()));
List<MdPbVehicleMater> tmpCount1 = iMdPbVehicleMaterService.list(new QueryWrapper<MdPbVehicleMater>()
.eq("is_delete",false)
.in("vehicle_code", map.keySet()));
if (tmpCount1.size()>0){
throw new BadRequestException("组盘失败:载具已经存在组盘信息"+tmpCount1.stream().map(MdPbVehicleMater::getVehicle_code).collect(Collectors.joining(",")));
}

View File

@@ -47,7 +47,8 @@ public class IOStorageController {
public ResponseEntity<Object> outStorage(@RequestBody JSONObject form) {
String vehicle_code = form.getString("vehicle_code");
MdPbVehicleMater one = iMdPbVehicleMaterService.getOne(new QueryWrapper<MdPbVehicleMater>()
.eq("vehicle_code", vehicle_code).eq("is_delete", false));
.eq("vehicle_code", vehicle_code)
.eq("is_delete", false));
String proc_inst_id = one.getProc_inst_id();
if (!StringUtils.isEmpty(proc_inst_id)){
String parent_id = iActRuExecutionService.getParentByChild(proc_inst_id);

View File

@@ -42,7 +42,9 @@ public class PalletIostorinvService {
Assert.notNull(form, "参数不能为空");
String vehicle_code = form.getString("vehicle_code");
String material_id = form.getString("material_id");
int count = iMdPbVehicleMaterService.count(new QueryWrapper<MdPbVehicleMater>().eq("vehicle_code", vehicle_code));
int count = iMdPbVehicleMaterService.count(new QueryWrapper<MdPbVehicleMater>()
.eq("vehicle_code", vehicle_code)
.eq("is_delete",false));
if (count>0){
throw new BadRequestException("入库失败:当前载具信息已经存在");
}
@@ -81,12 +83,12 @@ public class PalletIostorinvService {
};
public void outStorage(JSONObject form){
Assert.noNullElements(new Object[]{form,form.getString("material_id"),form.getInteger("qty"),form.getString("target_point")}, "参数不能为空");
Assert.noNullElements(new Object[]{form,form.getString("pcsn"),form.getString("material_id"),form.getInteger("qty"),form.getString("target_point")}, "参数不能为空");
//触发流程
JSONObject flowData = new JSONObject();
flowData.put("material_id",form.getString("material_id"));
flowData.put("qty",form.getInteger("qty"));
flowData.put("pcsn","1");
flowData.put("pcsn",form.getString("pcsn"));
flowData.put("stor_code",STOR_CODE);
JSONObject auxParam = new JSONObject();
auxParam.put("target_point",form.getString("target_point"));

View File

@@ -160,6 +160,7 @@ public class CheckStorageService {
Map<String, String> vehicleMap = iMdPbVehicleMaterService.list(new QueryWrapper<MdPbVehicleMater>()
.select("vehicle_code", "proc_inst_id")
.in("vehicle_code", tmpCollect)
.eq("is_delete",false)
.last("group by vehicle_code")).stream().collect(HashMap::new, (formMap, o) -> {
formMap.put(o.getVehicle_code(), o.getProc_inst_id());
}, HashMap::putAll);

View File

@@ -166,7 +166,7 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvOutMapp
if (tmpCount < vehicleMaters.size()) {
throw new BadRequestException("组盘失败:载具编号不存在");
}
List<MdPbVehicleMater> tmpCount1 = iMdPbVehicleMaterService.list(new QueryWrapper<MdPbVehicleMater>().in("vehicle_code", collect));
List<MdPbVehicleMater> tmpCount1 = iMdPbVehicleMaterService.list(new QueryWrapper<MdPbVehicleMater>() .eq("is_delete",false).in("vehicle_code", collect));
if (tmpCount1.size() > 0) {
throw new BadRequestException("组盘失败:载具已经存在组盘信息" + tmpCount1.stream().map(MdPbVehicleMater::getVehicle_code).distinct().collect(Collectors.joining(",")));
}

View File

@@ -78,7 +78,9 @@ public class PickingService {
}
PmFormData dtl = iFormDataService.getById((String) ((Map) params.get(0)).get("parent_id"));
MdPbVehicleMater one = iMdPbVehicleMaterService.getOne(new QueryWrapper<MdPbVehicleMater>()
.eq("vehicle_code", dtl.getVehicle_code()).eq("material_id", dtl.getMaterial_id()));
.eq("vehicle_code", dtl.getVehicle_code())
.eq("is_delete",false)
.eq("material_id", dtl.getMaterial_id()));
if (one == null) {
throw new BadRequestException("拣选明细载具物料信息不存在");
}
@@ -196,7 +198,9 @@ public class PickingService {
for (PmFormData dtl : dtls) {
//载具物料信息
MdPbVehicleMater one = iMdPbVehicleMaterService.getOne(new QueryWrapper<MdPbVehicleMater>()
.eq("vehicle_code", dtl.getVehicle_code()).eq("material_id", dtl.getMaterial_id()));
.eq("vehicle_code", dtl.getVehicle_code())
.eq("is_delete",false)
.eq("material_id", dtl.getMaterial_id()));
List<PmFormData> dis = iFormDataService.getByParentId(dtl.getId());
for (PmFormData data : dis) {
String vehicle_code = data.getVehicle_code();