rev:兼容vehicle_id;载具物料表支持载具历史记录:is_delete
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
* 统一返回
|
||||
*/
|
||||
|
||||
@@ -37,7 +37,6 @@ public class RedissonUtils {
|
||||
throw new BadRequestException("当前业务:"+key+"正在执行请稍后再试");
|
||||
}
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
throw ex;
|
||||
}finally {
|
||||
if (lock.isHeldByCurrentThread() && lock.isLocked()){
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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+"组盘信息不存在");
|
||||
}
|
||||
|
||||
@@ -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())));
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(",")));
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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"));
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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(",")));
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -28,6 +28,23 @@
|
||||
<el-form-item label="单据状态" prop="status">
|
||||
<el-input v-model="form.status" disabled placeholder="生成" clearable style="width: 150px" />
|
||||
</el-form-item>
|
||||
<el-form-item show-overflow-tooltip prop="stor_code" label="仓库" width="160" align="center">
|
||||
<template scope="scope">
|
||||
<el-select
|
||||
v-model="form.stor_code"
|
||||
clearable
|
||||
class="filter-item"
|
||||
placeholder="所属仓库"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in tableEnum.st_ivt_bsrealstorattr"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-form-item>
|
||||
<el-form-item label="源单类型" prop="source_form_type">
|
||||
<el-input v-model="form.source_form_type" clearable style="width: 150px" />
|
||||
</el-form-item>
|
||||
@@ -86,7 +103,7 @@
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="stor_code" label="仓库" width="160" align="center">
|
||||
<template scope="scope">
|
||||
<el-select
|
||||
<el-select disabled
|
||||
v-model="tableData[scope.$index].stor_code"
|
||||
clearable
|
||||
class="filter-item"
|
||||
@@ -273,6 +290,14 @@ export default {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
let item = this.tableData[i];
|
||||
if (!item.stor_code || !item.vehicle_code || !item.pcsn || !item.qty) {
|
||||
this.crud.notify('明细参数:仓库,载具,批次,数量不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
this.form.item = this.tableData
|
||||
},
|
||||
deleteRow(index, rows) {
|
||||
@@ -286,6 +311,7 @@ export default {
|
||||
data.material_id = row.material_id
|
||||
data.material_spec = row.material_spec
|
||||
data.single_weight = row.single_weight
|
||||
data.stor_code = this.form.stor_code
|
||||
data.form_data = {}
|
||||
this.dtlCols.forEach(a=>{
|
||||
let item = ''
|
||||
@@ -323,7 +349,7 @@ export default {
|
||||
data.material_code = row.material_code
|
||||
data.material_id = row.material_id
|
||||
data.material_spec = row.material_spec
|
||||
data.stor_code = row.stor_code
|
||||
data.stor_code = this.form.stor_code
|
||||
data.source_form_type = row.form_type
|
||||
data.source_form_id = row.id
|
||||
data.unit_id = row.unit_id
|
||||
@@ -342,9 +368,17 @@ export default {
|
||||
})
|
||||
},
|
||||
insertEvent(row) {
|
||||
if (!this.form.stor_code){
|
||||
this.crud.notify('请先选择仓库!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.materShow = true
|
||||
},
|
||||
insertForm(row) {
|
||||
if (!this.form.stor_code){
|
||||
this.crud.notify('请先选择仓库!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.formShow = true
|
||||
},
|
||||
queryMater(index, row) {
|
||||
|
||||
Reference in New Issue
Block a user