add:c出入库单参数非空校验
This commit is contained in:
@@ -30,7 +30,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@ServletComponentScan
|
||||
@EnableTransactionManagement
|
||||
@MapperScan("org.nl.**.mapper")
|
||||
//@EnableDynamicTp
|
||||
@EnableDynamicTp
|
||||
public class AppRun implements CommandLineRunner {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AppRun.class, args);
|
||||
|
||||
@@ -82,7 +82,7 @@ public class SecurityUtils {
|
||||
* @return 权限列表
|
||||
*/
|
||||
public static List<String> getCurrentUserPermissions() {
|
||||
JSONObject json = (JSONObject) StpUtil.getExtra("loginInfo");
|
||||
JSONObject json =JSONObject.parseObject(String.valueOf(StpUtil.getExtra("loginInfo")));
|
||||
JSONArray permissions = json.getJSONArray("permissions");
|
||||
if (permissions.size() > 0) {
|
||||
return permissions.toJavaList(String.class);
|
||||
|
||||
@@ -71,6 +71,12 @@ public class GroupDickInStorageTask extends AbstractTask {
|
||||
if (CollectionUtils.isEmpty(item)){
|
||||
throw new BadRequestException("申请任务失败:载具"+vehicle_code+"组盘信息不存在");
|
||||
}
|
||||
SchBaseTask schBaseTask = iSchBaseTaskService.getOne(new QueryWrapper<SchBaseTask>()
|
||||
.eq("vehicle_code", vehicle_code).select("task_code")
|
||||
.lt("status",StatusEnum.FORM_STATUS.code("完成")));
|
||||
if (schBaseTask!=null){
|
||||
throw new BadRequestException("申请任务失败:载具"+vehicle_code+"已经存任务"+schBaseTask.getTask_code());
|
||||
}
|
||||
JSONObject mstJ = (JSONObject) JSONObject.toJSON(mst);
|
||||
MdPbVehicleMaterVo vehicleMater = item.get(0);
|
||||
mstJ.put("stor_code", vehicleMater.getStor_code());
|
||||
|
||||
@@ -44,17 +44,20 @@ public class StIvtIostorinvOutController {
|
||||
return new ResponseEntity<>(TableDataInfo.build(result), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("delete")
|
||||
@Log("删除出库单")
|
||||
public ResponseEntity<Object> delete(@RequestBody List<String> ids) {
|
||||
iStIvtIostorinvService.removeByIds(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
@PostMapping
|
||||
@Log("创建出库单")
|
||||
public ResponseEntity<Object> save(@RequestBody JSONObject form) {
|
||||
iStIvtIostorinvService.save(form);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@Log("更新出库单")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject form) {
|
||||
iStIvtIostorinvService.update(form);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
@@ -72,6 +75,7 @@ public class StIvtIostorinvOutController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/outDecision")
|
||||
@Log("出库单明细分配")
|
||||
public ResponseEntity<Object> outDecision(@RequestBody JSONObject dtl) {
|
||||
String vechicle_codes = iStIvtIostorinvService.outDispense(dtl);
|
||||
return new ResponseEntity<>(vechicle_codes,HttpStatus.OK);
|
||||
@@ -83,6 +87,7 @@ public class StIvtIostorinvOutController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/cancelDecision")
|
||||
@Log("出库单取消分配")
|
||||
public ResponseEntity<Object> cancelDecision(@RequestBody JSONObject dtl) {
|
||||
iStIvtIostorinvService.canceldispense(dtl);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
@@ -95,6 +100,7 @@ public class StIvtIostorinvOutController {
|
||||
}
|
||||
|
||||
@PostMapping("/taskOpen")
|
||||
@Log("出库单作业下发")
|
||||
public ResponseEntity<Object> taskOpen(@RequestBody JSONObject dtl) {
|
||||
iStIvtIostorinvService.taskOpen(dtl);
|
||||
return new ResponseEntity<>(TableDataInfo.build(),HttpStatus.OK);
|
||||
|
||||
@@ -283,8 +283,6 @@ export default {
|
||||
measureunit.getSelect().then(res => {
|
||||
this.unitDict = res.content
|
||||
})
|
||||
console.log(this.id)
|
||||
console.log(2222222)
|
||||
if (this.id !== '' && this.id !== null && this.id !== undefined) {
|
||||
crudProductIn.getIosInvDtl(this.id).then(res => {
|
||||
this.tableData = res
|
||||
@@ -319,6 +317,25 @@ export default {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
let itemDtl = this.tableData[i];
|
||||
if (!itemDtl.unit_id) {
|
||||
this.crud.notify('单位不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!itemDtl.stor_code) {
|
||||
this.crud.notify('仓库不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!itemDtl.pcsn) {
|
||||
this.crud.notify('物料批次不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!itemDtl.qty) {
|
||||
this.crud.notify('物料出库数量不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
}
|
||||
this.form.item = this.tableData
|
||||
},
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
placeholder="车间"
|
||||
class="filter-item"
|
||||
style="width: 120px"
|
||||
@change="areaChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in statusEnum.PRODUCT_AREA"
|
||||
@@ -330,6 +331,15 @@ export default {
|
||||
this.nowrow = row
|
||||
this.materShow = true
|
||||
},
|
||||
|
||||
areaChange(val){
|
||||
if (this.tableData.length>0) {
|
||||
this.tableData.forEach(a=>{
|
||||
this.$set(a.form_data, 'product_area', val)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
// 提交前校验
|
||||
if (this.tableData.length === 0) {
|
||||
@@ -344,6 +354,25 @@ export default {
|
||||
this.crud.notify('车间不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
for (let i = 0; i < this.tableData.length; i++) {
|
||||
let itemDtl = this.tableData[i];
|
||||
if (!itemDtl.unit_id) {
|
||||
this.crud.notify('单位不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!itemDtl.stor_code) {
|
||||
this.crud.notify('仓库不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!itemDtl.pcsn) {
|
||||
this.crud.notify('物料批次不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!itemDtl.qty) {
|
||||
this.crud.notify('物料出库数量不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
}
|
||||
this.form.item = this.tableData
|
||||
},
|
||||
|
||||
@@ -370,6 +399,7 @@ export default {
|
||||
}
|
||||
this.$set(data.form_data,a.value,item)
|
||||
})
|
||||
this.$set(data.form_data,'product_area',this.form.form_data.product_area)
|
||||
this.tableData.splice(-1, 0, data)
|
||||
})
|
||||
},
|
||||
|
||||
@@ -219,7 +219,7 @@ export default {
|
||||
sort: 'id,desc',
|
||||
crudMethod: {...crudFormData},
|
||||
optShow: {
|
||||
add: true,
|
||||
add: false,
|
||||
reset: true
|
||||
},
|
||||
query: {
|
||||
@@ -291,14 +291,22 @@ export default {
|
||||
}
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length === 1) {
|
||||
this.task_flag = false
|
||||
this.dis_flag = false
|
||||
this.currentRow = row
|
||||
} else {
|
||||
if (val.length > 1) {
|
||||
this.task_flag = true
|
||||
this.dis_flag = true
|
||||
this.currentRow = null
|
||||
} else {
|
||||
this.currentRow = val[0]
|
||||
if (this.currentRow.status == '10' || this.currentRow.status == '13'){
|
||||
this.dis_flag = false
|
||||
}else {
|
||||
this.dis_flag = true
|
||||
}
|
||||
if (this.currentRow.status == '13'){
|
||||
this.task_flag = false
|
||||
}else {
|
||||
this.task_flag = true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user