Browse Source

opt:整理出入库单代码,去除弃用代码

master
zds 3 weeks ago
parent
commit
71fc99ad9f
  1. 4
      lms/nladmin-system/src/main/java/org/nl/b_lms/sch/point/service/impl/BstIvtPackageinfoivtServiceImpl.java
  2. 1
      lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  3. 70
      lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/rest/RawAssistIStorController.java
  4. 51
      lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/CheckOutBillService.java
  5. 8
      lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/RawAssistIStorService.java
  6. 186
      lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/impl/RawAssistIStorServiceImpl.java
  7. 25
      lms/nladmin-system/src/main/java/org/nl/wms/st/instor/movestor/service/impl/HandMoveStorServiceImpl.java
  8. 138
      lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/rest/CheckOutBillController.java
  9. 609
      lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java
  10. 10
      lms/nladmin-ui/src/views/wms/st/inAndOutReturn/inandoutreturn.js
  11. 268
      lms/nladmin-ui/src/views/wms/st/inbill/StructUpdateDialog.vue
  12. 69
      lms/nladmin-ui/src/views/wms/st/inbill/TaskDialog.vue
  13. 36
      lms/nladmin-ui/src/views/wms/st/inbill/rawassist.js
  14. 8
      lms/nladmin-ui/src/views/wms/st/outbill/AddDialog.vue
  15. 31
      lms/nladmin-ui/src/views/wms/st/outbill/DivDialog.vue
  16. 22
      lms/nladmin-ui/src/views/wms/st/outbill/TaskDialog.vue
  17. 50
      lms/nladmin-ui/src/views/wms/st/outbill/checkoutbill.js
  18. 9
      lms/nladmin-ui/src/views/wms/st/outbill/index.vue

4
lms/nladmin-system/src/main/java/org/nl/b_lms/sch/point/service/impl/BstIvtPackageinfoivtServiceImpl.java

@ -274,10 +274,6 @@ public class BstIvtPackageinfoivtServiceImpl extends ServiceImpl<BstIvtPackagein
List<BstIvtPackageinfoivt> ivtList = packageinfoivtList.stream().filter(r -> r.getIvt_status().equals(PackageInfoIvtEnum.IVT_STATUS.code("空载具"))).sorted(Comparator.comparing(BstIvtPackageinfoivt::getSort_seq)).collect(Collectors.toList());
//有空载具
if (CollectionUtils.isNotEmpty(ivtList)) {
// BstIvtPackageinfoivt bstIvtPackageinfoivt = new BstIvtPackageinfoivt();
// bstIvtPackageinfoivt.setPoint_code(ivtList.get(0).getPoint_code());
// returList.add(bstIvtPackageinfoivt);
// return returList;
BstIvtPackageinfoivt bstIvtPackageinfoivt = new BstIvtPackageinfoivt();
bstIvtPackageinfoivt.setPoint_code(ivtList.get(0).getPoint_code());
bstIvtPackageinfoivt.setSort_seq(ivtList.get(0).getSort_seq());

1
lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java

@ -1102,7 +1102,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
String vehicle_code = whereJson.getString("vehicle_code");
String ext_task_id = whereJson.getString("ext_task_id");
String srcLocation = whereJson.getString("srcLocation");
String dtl_type = whereJson.getString("dtl_type");
log.info("ACS提示原货位:" + srcLocation + "被占用,需要重新分配货位!");
//锁定原货位

70
lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/rest/RawAssistIStorController.java

@ -37,15 +37,11 @@ public class RawAssistIStorController {
@GetMapping
@Log("查询入库单据")
//@PreAuthorize("@el.check('checkoutbill:list')")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(rawAssistIStorService.pageQuery(whereJson, page), HttpStatus.OK);
}
@Log("删除出入库单")
//@PreAuthorize("@el.check('sectattr:del')")
@DeleteMapping
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
// rawAssistIStorService.deleteAll(ids);
@ -55,16 +51,12 @@ public class RawAssistIStorController {
@GetMapping("/getBillDtl")
@Log("查询入库单来源")
//@PreAuthorize("@el.check('materialtype:list')")
public ResponseEntity<Object> getBillDtl(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(rawAssistIStorService.getBillDtl(whereJson, page), HttpStatus.OK);
}
@PostMapping()
@Log("新增入库单")
//@PreAuthorize("@el.check('structrelamaterial:edit')")
public ResponseEntity<Object> insertDtl(@RequestBody Map whereJson) {
// 校验仓库
if (whereJson.get("stor_id").toString().equals(IOSEnum.STOR_ID.code("二期"))) {
@ -77,8 +69,6 @@ public class RawAssistIStorController {
@PutMapping
@Log("修改入库单")
//@PreAuthorize("@el.check('sectattr:edit')")
public ResponseEntity<Object> update(@RequestBody Map whereJson) {
if (whereJson.get("stor_id").toString().equals(IOSEnum.STOR_ID.code("二期"))) {
iStIvtIostorinvService.update(whereJson);
@ -90,8 +80,6 @@ public class RawAssistIStorController {
@GetMapping("/getIODtl")
@Log("查询出入库单明细")
//@PreAuthorize("@el.check('materialtype:list')")
public ResponseEntity<Object> getIODtl(@RequestParam Map whereJson) {
return new ResponseEntity<>(rawAssistIStorService.getIODtl(whereJson), HttpStatus.OK);
}
@ -130,7 +118,6 @@ public class RawAssistIStorController {
@PostMapping("/unDivStruct")
@Log("取消分配货位")
public ResponseEntity<Object> unDivStruct(@RequestBody Map whereJson) {
if (whereJson.get("stor_id").toString().equals(IOSEnum.STOR_ID.code("二期"))) {
iStIvtIostorinvService.unDivStruct(whereJson);
@ -142,7 +129,6 @@ public class RawAssistIStorController {
@PostMapping("/divPoint")
@Log("设置起点")
public ResponseEntity<Object> divPoint(@RequestBody Map whereJson) {
if (whereJson.get("stor_id").toString().equals(IOSEnum.STOR_ID.code("二期"))) {
iStIvtIostorinvService.setPoint(whereJson);
@ -154,39 +140,16 @@ public class RawAssistIStorController {
@PostMapping("/queryTask")
@Log("查询任务")
//@PreAuthorize("@el.check('materialtype:list')")
public ResponseEntity<Object> queryTask(@RequestBody Map whereJson) {
return new ResponseEntity<>(rawAssistIStorService.queryTask(whereJson), HttpStatus.OK);
}
@PostMapping("/delDis")
@Log("删除分配")
//@PreAuthorize("@el.check('materialtype:list')")
public ResponseEntity<Object> delDis(@RequestBody JSONObject whereJson) {
rawAssistIStorService.delDis(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/queryBoxMater")
@Log("查询箱内子卷")
//@PreAuthorize("@el.check('materialtype:list')")
public ResponseEntity<Object> queryBoxMater(@RequestBody JSONArray whereJson) {
return new ResponseEntity<>(rawAssistIStorService.queryBoxMater(whereJson), HttpStatus.OK);
}
@PostMapping("/updateTask")
@Log("变更任务")
//@PreAuthorize("@el.check('materialtype:list')")
public ResponseEntity<Object> updateTask(@RequestBody Map whereJson) {
rawAssistIStorService.updateTask(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/delTask")
@Log("删除任务")
public ResponseEntity<Object> delTask(@RequestBody Map whereJson) {
@ -200,8 +163,6 @@ public class RawAssistIStorController {
@PostMapping("/reIssueTask")
@Log("下发")
//@PreAuthorize("@el.check('materialtype:list')")
public ResponseEntity<Object> reIssueTask(@RequestBody Map whereJson) {
if (whereJson.get("stor_id").toString().equals(IOSEnum.STOR_ID.code("二期"))) {
iStIvtIostorinvService.reIssueTask(whereJson);
@ -213,8 +174,6 @@ public class RawAssistIStorController {
@PostMapping("/confirmTask")
@Log("完成任务")
//@PreAuthorize("@el.check('materialtype:list')")
public ResponseEntity<Object> confirmTask(@RequestBody Map whereJson) {
if (whereJson.get("stor_id").toString().equals(IOSEnum.STOR_ID.code("二期"))) {
iStIvtIostorinvService.confirmTask(whereJson);
@ -225,19 +184,8 @@ public class RawAssistIStorController {
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/cancelTask")
@Log("取消完成任务")
//@PreAuthorize("@el.check('materialtype:list')")
public ResponseEntity<Object> cancelTask(@RequestBody Map whereJson) {
rawAssistIStorService.cancelTask(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/confirm")
@Log("完成单据")
//@PreAuthorize("@el.check('materialtype:list')")
public ResponseEntity<Object> confirm(@RequestBody Map whereJson) {
if (whereJson.get("stor_id").toString().equals(IOSEnum.STOR_ID.code("二期"))) {
iStIvtIostorinvService.confirm(whereJson);
@ -247,22 +195,4 @@ public class RawAssistIStorController {
}
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/backConfirm")
@Log("完成入库负单")
//@PreAuthorize("@el.check('materialtype:list')")
public ResponseEntity<Object> backConfirm(@RequestBody Map whereJson) {
rawAssistIStorService.backConfirm(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/autoDis")
@Log("自动分配")
//@PreAuthorize("@el.check('materialtype:list')")
public ResponseEntity<Object> autoDis(@RequestBody JSONObject whereJson) {
rawAssistIStorService.autoDis(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
}

51
lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/CheckOutBillService.java

@ -62,15 +62,6 @@ public interface CheckOutBillService {
*/
String insertDtl2(JSONObject whereJson);
/**
* 新增出库单
*
* @param whereJson 参数举例
* {bill_code=, stor_id=1473161852946092032, stor_code=01, stor_name=原材料库, bill_status=10, total_qty=2, detail_count=1, bill_type=010201, remark=, biz_date=2022-01-08, create_mode=, tableData=[{material_id=1309, material_code=090301010001, bill_status=10, material_name=碳化钨粉 02, pcsn=, quality_scode=02, ivt_level=01, is_active=1, plan_qty=2, qty_unit_name=千克\公斤, qty_unit_id=1, remark=, edit=true}]}
* /
*/
void insertDtlByJson(JSONObject whereJson);
/**
* 查询出库单明细
*
@ -147,13 +138,6 @@ public interface CheckOutBillService {
*/
void oneCancel(JSONObject whereJson);
/**
* 设置检验站点
*
* @param whereJson /
*/
void setPoint(JSONObject whereJson);
/**
* 设置一个站点
*
@ -211,13 +195,6 @@ public interface CheckOutBillService {
*/
void finishTask(JSONObject whereJson);
/**
* 出库任务手动取消完成
*
* @param whereJson /
*/
void cancleTaskfinish(JSONObject whereJson);
/**
* 查询单据字段
*
@ -225,34 +202,6 @@ public interface CheckOutBillService {
*/
JSONArray getInvTypes();
/**
* 查询出库单物料是否限制参数
*
* @param form
* @return
*/
JSONObject getParamByCodeType(JSONObject form);
/**
* 查询点位区域类型
*
* @param form
* @return
*/
JSONArray schAreaType(JSONObject form);
/**
* 出库单强制确认
*
* @param whereJson /
*/
void backConfirm(JSONObject whereJson);
/**
* 获取全部出入库业务类型
*/
JSONArray getType();
/**
* 发货信息保存
*/

8
lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/RawAssistIStorService.java

@ -22,8 +22,6 @@ public interface RawAssistIStorService {
void deleteAll(Long[] ids);
void delDis(JSONObject whereJson);
JSONArray queryBoxMater(JSONArray rows);
void update(Map whereJson);
@ -40,20 +38,14 @@ public interface RawAssistIStorService {
void divPoint(Map whereJson);
void updateTask(Map whereJson);
void delTask(Map whereJson);
void reIssueTask(Map whereJson);
void confirmTask(Map whereJson);
void cancelTask(Map whereJson);
void confirm(Map whereJson);
void backConfirm(Map whereJson);
JSONArray getDisDtl(Map whereJson);
JSONArray queryTask(Map whereJson);

186
lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/impl/RawAssistIStorServiceImpl.java

@ -358,15 +358,6 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
}
}
@Override
public void delDis(JSONObject whereJson) {
String box_no = whereJson.getString("package_box_sn");
//将状态为包装的改为生成
HashMap<String, String> map = new HashMap<>();
map.put("status", "0");
WQLObject.getWQLObject("PDM_BI_SubPackageRelation").update(map, "package_box_SN = '" + box_no + "' AND status = '1'");
}
@Override
public JSONArray queryBoxMater(JSONArray rows) {
JSONArray total_rows = new JSONArray();
@ -2157,7 +2148,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
if (ObjectUtil.isEmpty(struct_jo)) {
// 主存区类型更改成中转区类型:找一排主存区的更改中转区、把一排中转区的更改成主存区(只允许调用一次)
SpringContextHolder.getBean(RawAssistIStorServiceImpl.class).updateStructSect(col_num);
this.updateStructSect(col_num);
struct_jo = autoDisMove2(whereJson);
}
return struct_jo;
@ -2544,96 +2535,6 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
return struct_jo;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateTask(Map whereJson) {
WQLObject dis_wql = WQLObject.getWQLObject("ST_IVT_IOStorInvDis");
WQLObject task_wql = WQLObject.getWQLObject("SCH_BASE_Task");
WQLObject point_table = WQLObject.getWQLObject("SCH_BASE_Point");
//判断入库点是否修改
if (!whereJson.get("point_code").equals(whereJson.get("new_point_code"))) {
HashMap<String, String> dis_map = new HashMap<>();
HashMap<String, String> task_map = new HashMap<>();
PointDto pointDto = pointService.findByCode((String) whereJson.get("new_point_code"));
dis_map.put("point_code", pointDto.getPoint_code());
dis_map.put("point_id", pointDto.getPoint_id() + "");
dis_map.put("point_name", pointDto.getPoint_name());
task_map.put("start_point_code", (String) whereJson.get("new_point_code"));
//修改分配表起点,任务表起点
dis_wql.update(dis_map, "task_id = '" + whereJson.get("task_id") + "'");
task_wql.update(task_map, "taskdtl_id = '" + whereJson.get("task_id") + "'");
}
//判断目标货位是否修改
if (!whereJson.get("struct_code").equals(whereJson.get("new_struct_code"))) {
//修改任务表终点
HashMap<String, String> task_map = new HashMap<>();
task_map.put("next_point_code", (String) whereJson.get("new_struct_code"));
task_wql.update(task_map, "taskdtl_id = '" + whereJson.get("task_id") + "'");
//更新分配表的目的仓位
Structattr structattrDto = structattrService.findByCode((String) whereJson.get("new_struct_code"));
HashMap str_map = new HashMap<>();
str_map.put("sect_id", structattrDto.getSect_id());
str_map.put("sect_code", structattrDto.getSect_code());
str_map.put("sect_name", structattrDto.getSect_name());
str_map.put("struct_id", structattrDto.getStruct_id());
str_map.put("struct_code", structattrDto.getStruct_code());
str_map.put("struct_name", structattrDto.getStruct_name());
dis_wql.update(str_map, "task_id = '" + whereJson.get("task_id") + "'");
//原货位解锁,新货位加锁
HashMap unlock_map = new HashMap();
unlock_map.put("lock_type", "1");
point_table.update(unlock_map, "point_code = '" + whereJson.get("struct_code") + "'");
LambdaUpdateWrapper<Structattr> queryWrapper = new LambdaUpdateWrapper();
queryWrapper.set(Structattr::getLock_type,"1");
queryWrapper.eq(Structattr::getStruct_code,whereJson.get("struct_code"));
structattrMapper.update(null,queryWrapper);
HashMap lock_map = new HashMap();
lock_map.put("lock_type", "2");
point_table.update(lock_map, "point_code = '" + whereJson.get("new_struct_code") + "'");
LambdaUpdateWrapper<Structattr> queryWrapper2 = new LambdaUpdateWrapper();
queryWrapper2.set(Structattr::getLock_type,"2");
queryWrapper2.eq(Structattr::getStruct_code,whereJson.get("new_struct_code"));
structattrMapper.update(null,queryWrapper2);
//减去原库位待入数,加上新货位待入数
//查询为该任务id的入库分配表,进行循环物料修改库存
JSONArray dis_rows = dis_wql.query("task_id = '" + whereJson.get("task_id") + "'").getResultJSONArray(0);
if (dis_rows.size() <= 0) {
throw new BadRequestException("数据参数有误!");
}
Structattr old_struct = structattrService.findByCode((String) whereJson.get("struct_code"));
JSONObject mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + dis_rows.getJSONObject(0).getString("iostorinv_id") + "'").uniqueResult(0);
for (int i = 0; i < dis_rows.size(); i++) {
JSONObject i_form = new JSONObject();
JSONObject dis_row = dis_rows.getJSONObject(i);
i_form.put("struct_id", old_struct.getStruct_id());
i_form.put("material_id", dis_row.getString("material_id"));
i_form.put("quality_scode", dis_row.getString("quality_scode"));
i_form.put("pcsn", dis_row.getString("pcsn"));
i_form.put("ivt_level", dis_row.getString("ivt_level"));
i_form.put("change_qty", dis_row.getString("plan_qty"));
i_form.put("bill_type_scode", mst_jo.getString("bill_type"));
i_form.put("inv_id", mst_jo.getString("iostorinv_id"));
i_form.put("bill_code", mst_jo.getString("bill_code"));
i_form.put("bill_table", "ST_IVT_IOStorInv");
i_form.put("qty_unit_id", dis_row.getString("qty_unit_id"));
i_form.put("qty_unit_name", dis_row.getString("qty_unit_name"));
storPublicService.IOStor(i_form, "32");
i_form.put("struct_id", structattrDto.getStruct_id());
storPublicService.IOStor(i_form, "31");
}
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delTask(Map whereJson) {
@ -2771,39 +2672,6 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
task.updateTaskStatus(task_jo, TaskStatusEnum.FINISHED.getCode());
}
@Override
public void cancelTask(Map whereJson) {
WQLObject dis_wql = WQLObject.getWQLObject("ST_IVT_IOStorInvDis");
WQLObject task_wql = WQLObject.getWQLObject("SCH_BASE_Task");
WQLObject dtl_wql = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl");
JSONObject mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + whereJson.get("iostorinv_id") + "'").uniqueResult(0);
if ("99".equals(mst_jo.getString("bill_status"))) {
throw new BadRequestException("单据已完成,无法进行取消任务操作!");
}
//变更任务状态
HashMap task_map = new HashMap();
task_map.put("task_status", "01");
task_wql.update(task_map, "taskdtl_id = '" + whereJson.get("task_id") + "'");
//更新实际数量
JSONArray dis_rows = dis_wql.query("task_id = '" + whereJson.get("task_id") + "'").getResultJSONArray(0);
for (int i = 0; i < dis_rows.size(); i++) {
JSONObject dis_row = dis_rows.getJSONObject(i);
double real_qty = dis_row.getDoubleValue("real_qty");
dis_row.put("real_qty", "0");
dis_row.put("work_status", "01");
dis_wql.update(dis_row);
//更新明细实际数量
JSONObject dtl_jo = dtl_wql.query("iostorinvdtl_id = '" + dis_row.getString("iostorinvdtl_id") + "'").uniqueResult(0);
double old_real_qty = dtl_jo.getDoubleValue("real_qty");
dtl_jo.put("real_qty", NumberUtil.sub(old_real_qty, real_qty));
dtl_wql.update(dtl_jo);
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void confirm(Map whereJson) {
@ -2831,58 +2699,6 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
inbillService.confirmMst(JSONObject.parseObject(JSON.toJSONString(whereJson)));
}
@Override
@Transactional(rollbackFor = Exception.class)
public void backConfirm(Map whereJson) {
WQLObject dtl_wql = WQLObject.getWQLObject("st_ivt_iostorinvdtl");
WQLObject mst_wql = WQLObject.getWQLObject("ST_IVT_IOStorInv");
//校验主表状态为生成
JSONObject mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + whereJson.get("iostorinv_id") + "'").uniqueResult(0);
if (!"10".equals(mst_jo.getString("bill_status"))) {
throw new BadRequestException("主表状态必须为生成!");
}
JSONObject mst_row = mst_wql.query("iostorinv_id = '" + whereJson.get("iostorinv_id") + "'").uniqueResult(0);
JSONArray dtl_rows = dtl_wql.query("iostorinv_id = '" + whereJson.get("iostorinv_id") + "'").getResultJSONArray(0);
//生成手工出库单
String iostorinv_id = IdUtil.getSnowflake(1, 1).nextId() + "";
String bill_code = CodeUtil.getNewCode("IO_CODE");
whereJson.put("iostorinv_id", iostorinv_id);
whereJson.put("bill_code", bill_code);
whereJson.put("io_type", "1");
whereJson.put("bill_type", "010601");
whereJson.put("buss_type", ((String) whereJson.get("bill_type")).substring(0, 4));
mst_wql.insert(whereJson);
for (int i = 0; i < dtl_rows.size(); i++) {
JSONObject dtl_row = dtl_rows.getJSONObject(i);
dtl_row.put("source_billdtl_id", dtl_row.getString("iostorinvdtl_id"));
dtl_row.put("source_bill_type", mst_row.getString("bill_type"));
dtl_row.put("source_bill_code", mst_row.getString("bill_code"));
dtl_row.put("source_bill_table", "ST_IVT_IOStorInvDtl");
dtl_row.put("iostorinvdtl_id", IdUtil.getSnowflake(1, 1).nextId());
dtl_row.put("iostorinv_id", iostorinv_id);
dtl_row.put("bill_status", "10");
dtl_wql.insert(dtl_row);
}
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
mst_row.put("bill_status", "99");
mst_row.put("confirm_optid", currentUserId);
mst_row.put("confirm_optname", nickName);
mst_row.put("confirm_time", now);
//更新主表状态为99
mst_wql.update(mst_row);
HashMap<String, String> map = new HashMap<>();
map.put("bill_status", "99");
dtl_wql.update(map, "iostorinv_id = '" + mst_row.get("iostorinv_id") + "'");
}
/**
* 新开事务把当前事务挂起新开事务不回滚
*/

25
lms/nladmin-system/src/main/java/org/nl/wms/st/instor/movestor/service/impl/HandMoveStorServiceImpl.java

@ -448,7 +448,6 @@ public class HandMoveStorServiceImpl extends ServiceImpl<MoveStorMapper, MoveSto
if(boxArr.size()>0){
struct_bean = boxArr.get(0);
}
//struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq desc").uniqueResult(0);
break;
} else if ("02".equals(placement_type)) {
// 左通
@ -458,7 +457,6 @@ public class HandMoveStorServiceImpl extends ServiceImpl<MoveStorMapper, MoveSto
if(boxArr.size()>0){
struct_bean = boxArr.get(0);
}
//struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq").uniqueResult(0);
break;
} else {
@ -469,7 +467,6 @@ public class HandMoveStorServiceImpl extends ServiceImpl<MoveStorMapper, MoveSto
// 先倒序找到第一个托盘、判断上一个是否有货位
List<Structattr> jsonDescStructs = new ArrayList<>();
List<Structattr> jsonDescBoxs = structattrMapper.selectList(queryWrapper);
//JSONObject jsonDescBox = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') <> '' order by out_order_seq DESC").uniqueResult(0);
LambdaQueryWrapper<Structattr> queryWrapper2 = new LambdaQueryWrapper<Structattr>();
queryWrapper2.eq(ObjectUtil.isNotEmpty(block_num), Structattr::getBlock_num, block_num)
@ -480,25 +477,24 @@ public class HandMoveStorServiceImpl extends ServiceImpl<MoveStorMapper, MoveSto
.eq(Structattr::getIs_delete, "0");
if (jsonDescBoxs.size()>0) {
String out_order_seq = jsonDescBoxs.get(0).getOut_order_seq();
queryWrapper2.and(la -> la.eq(Structattr::getStoragevehicle_code,"")
LambdaQueryWrapper<Structattr> queryWrapper3 = new LambdaQueryWrapper(queryWrapper2);
queryWrapper3.and(la -> la.eq(Structattr::getStoragevehicle_code,"")
.or()
.isNull(Structattr::getStoragevehicle_code))
.gt(Structattr::getOut_order_seq,out_order_seq)
.orderByAsc(Structattr::getOut_order_seq);
// 上一个货位顺序号
//jsonDescStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq > '" + out_order_seq + "' order by out_order_seq ASC").uniqueResult(0);
jsonDescStructs = structattrMapper.selectList(queryWrapper2);
jsonDescStructs = structattrMapper.selectList(queryWrapper3);
} else {
queryWrapper2.and(la -> la.eq(Structattr::getStoragevehicle_code,"")
LambdaQueryWrapper<Structattr> queryWrapper3 = new LambdaQueryWrapper(queryWrapper2);
queryWrapper3.and(la -> la.eq(Structattr::getStoragevehicle_code,"")
.or()
.isNull(Structattr::getStoragevehicle_code))
.orderByDesc(Structattr::getOut_order_seq);
// 倒序找到第一个空位
//jsonDescStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq DESC").uniqueResult(0);
jsonDescStructs = structattrMapper.selectList(queryWrapper2);
jsonDescStructs = structattrMapper.selectList(queryWrapper3);
}
if (jsonDescStructs.size()>0) {
@ -506,15 +502,14 @@ public class HandMoveStorServiceImpl extends ServiceImpl<MoveStorMapper, MoveSto
break;
} else {
queryWrapper2.ne(Structattr::getStoragevehicle_code,"")
LambdaQueryWrapper<Structattr> queryWrapper22 = new LambdaQueryWrapper(queryWrapper2);
queryWrapper22.ne(Structattr::getStoragevehicle_code,"")
.isNotNull(Structattr::getStoragevehicle_code)
.orderByAsc(Structattr::getOut_order_seq);
// 没有就正序找到第一个托盘、判断上一个是否有货位
List<Structattr> jsonAscStructs = new ArrayList<>();
List<Structattr> jsonAscBoxs = structattrMapper.selectList(queryWrapper2);
//JSONObject jsonAscBox = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') <> '' order by out_order_seq ASC").uniqueResult(0);
List<Structattr> jsonAscBoxs = structattrMapper.selectList(queryWrapper22);
LambdaQueryWrapper<Structattr> queryWrapper3 = new LambdaQueryWrapper<Structattr>();
queryWrapper3.eq(ObjectUtil.isNotEmpty(block_num), Structattr::getBlock_num, block_num)
@ -534,11 +529,9 @@ public class HandMoveStorServiceImpl extends ServiceImpl<MoveStorMapper, MoveSto
queryWrapper3.lt(Structattr::getOut_order_seq,out_order_seq2)
.orderByDesc(Structattr::getOut_order_seq);
// 上一个货位顺序号
//jsonAscStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq < '" + out_order_seq2 + "' order by out_order_seq DESC").uniqueResult(0);
jsonAscStructs = structattrMapper.selectList(queryWrapper3);
} else {
queryWrapper3.orderByAsc(Structattr::getOut_order_seq);
//jsonAscStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq ASC").uniqueResult(0);
jsonAscStructs = structattrMapper.selectList(queryWrapper3);
}
if (jsonAscStructs.size()>0) {

138
lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/rest/CheckOutBillController.java

@ -11,7 +11,6 @@ import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.InBussMana
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.LashManageService;
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.OutBoxManageService;
import org.nl.modules.logging.annotation.Log;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.wms.st.inbill.service.CheckOutBillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
@ -53,38 +52,29 @@ public class CheckOutBillController {
@GetMapping
@Log("查询出库单")
//@PreAuthorize("@el.check('checkoutbill:list')")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page, String[] stor_id, String[] bill_status, String[] bill_type) {
return new ResponseEntity<>(checkOutBillService.pageQuery(whereJson, page, stor_id, bill_status, bill_type), HttpStatus.OK);
}
@GetMapping("/addDtl")
@Log("查询库存")
//@PreAuthorize("@el.check('checkoutbill:list')")
public ResponseEntity<Object> queryAddDtl(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(checkOutBillService.queryAddDtl(whereJson, page), HttpStatus.OK);
}
@GetMapping("/queryDtl")
@Log("查询库存")
//@PreAuthorize("@el.check('checkoutbill:list')")
public ResponseEntity<Object> queryDtl(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(checkOutBillService.queryDtl(whereJson, page), HttpStatus.OK);
}
@GetMapping("/getOutBillDtl")
@Log("查询明细")
public ResponseEntity<Object> getOutBillDtl(@RequestParam Map whereJson) {
return new ResponseEntity<>(checkOutBillService.getOutBillDtl(whereJson), HttpStatus.OK);
}
@Log("删除出库单")
//@PreAuthorize("@el.check('checkoutbill:del')")
@DeleteMapping
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
iStIvtIostorinvOutService.deleteAll(ids);
@ -94,7 +84,6 @@ public class CheckOutBillController {
@PutMapping
@Log("修改出库单")
public ResponseEntity<Object> update(@RequestBody JSONObject whereJson) {
iStIvtIostorinvOutService.update(whereJson);
// checkOutBillService.update(whereJson);
@ -103,7 +92,6 @@ public class CheckOutBillController {
@PostMapping()
@Log("新增出库单")
public ResponseEntity<Object> insertDtl(@RequestBody JSONObject whereJson) {
iStIvtIostorinvOutService.insertMst(whereJson);
// checkOutBillService.insertDtl(whereJson);
@ -112,7 +100,6 @@ public class CheckOutBillController {
@PostMapping("/allDiv")
@Log("出库单全部分配")
public ResponseEntity<Object> allDiv(@RequestBody JSONObject whereJson) {
if (whereJson.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
iStIvtIostorinvOutService.allDiv(whereJson);
@ -124,7 +111,6 @@ public class CheckOutBillController {
@PostMapping("/allDivOne")
@Log("出库单自动分配")
public ResponseEntity<Object> allDivOne(@RequestBody JSONObject whereJson) {
if (whereJson.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
iStIvtIostorinvOutService.allDiv(whereJson);
@ -137,7 +123,6 @@ public class CheckOutBillController {
@PostMapping("/allCancel")
@Log("出库单全部取消")
public ResponseEntity<Object> allCancel(@RequestBody JSONObject whereJson) {
if (whereJson.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
iStIvtIostorinvOutService.cancelDiv(whereJson);
@ -149,7 +134,6 @@ public class CheckOutBillController {
@PostMapping("/cancelTask")
@Log("删除任务")
public ResponseEntity<Object> cancelTask(@RequestBody JSONObject whereJson) {
checkOutBillService.cancelTask(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
@ -157,7 +141,6 @@ public class CheckOutBillController {
@PostMapping("/oneCancel")
@Log("出库单全部取消")
public ResponseEntity<Object> oneCancel(@RequestBody JSONObject whereJson) {
if (whereJson.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
iStIvtIostorinvOutService.cancelDiv(whereJson);
@ -170,36 +153,24 @@ public class CheckOutBillController {
@GetMapping("/getOutBillDis")
@Log("查询已出库单分配")
public ResponseEntity<Object> getOutBillDis(@RequestParam Map whereJson) {
return new ResponseEntity<>(checkOutBillService.getOutBillDis(whereJson), HttpStatus.OK);
}
@GetMapping("/getOutBillDis2")
@Log("查询未出库单分配")
public ResponseEntity<Object> getOutBillDis2(@RequestParam Map whereJson) {
return new ResponseEntity<>(checkOutBillService.getOutBillDis2(whereJson), HttpStatus.OK);
}
@GetMapping("/getOutBillDisDtl")
@Log("查询出库单分配")
public ResponseEntity<Object> getOutBillDisDtl(@RequestParam Map whereJson) {
return new ResponseEntity<>(checkOutBillService.getOutBillDisDtl(whereJson), HttpStatus.OK);
}
@PostMapping("/setPoint")
@Log("设置检验站点")
public ResponseEntity<Object> setPoint(@RequestBody JSONObject whereJson) {
checkOutBillService.setPoint(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/oneSetPoint2")
@Log("设置一个站点")
public ResponseEntity<Object> oneSetPoint2(@RequestBody JSONObject whereJson) {
checkOutBillService.oneSetPoint2(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
@ -207,7 +178,6 @@ public class CheckOutBillController {
@PostMapping("/allSetPoint")
@Log("一键设置")
public ResponseEntity<Object> allSetPoint(@RequestBody JSONObject whereJson) {
if (whereJson.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
iStIvtIostorinvOutService.allSetPoint(whereJson);
@ -219,41 +189,35 @@ public class CheckOutBillController {
@GetMapping("/getOutBillTask")
@Log("查询出库单分配任务")
public ResponseEntity<Object> getOutBillTask(@RequestParam Map whereJson) {
return new ResponseEntity<>(checkOutBillService.getOutBillTask(whereJson), HttpStatus.OK);
}
@PostMapping("/getOutBillTask2")
@Log("详情查询出库单分配任务2")
public ResponseEntity<Object> getOutBillTask2(@RequestBody Map whereJson) {
return new ResponseEntity<>(checkOutBillService.getOutBillTask2(whereJson), HttpStatus.OK);
}
@GetMapping("/getStructIvt")
@Log("查询可分配库存")
public ResponseEntity<Object> getStructIvt(@RequestParam Map whereJson) {
return new ResponseEntity<>(checkOutBillService.getStructIvt(whereJson), HttpStatus.OK);
}
@PostMapping("/manualDiv")
@Log("出库单手动分配")
public ResponseEntity<Object> manualDiv(@RequestBody JSONObject whereJson) {
if (whereJson.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
iStIvtIostorinvOutService.manualDiv(whereJson);
} else {
checkOutBillService.manualDiv(whereJson);
}
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/confirm")
@Log("出库单强制确认")
public ResponseEntity<Object> confirm(@RequestBody JSONObject whereJson) {
if (whereJson.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
iStIvtIostorinvOutService.confirm(whereJson);
@ -265,7 +229,6 @@ public class CheckOutBillController {
@PostMapping("/issueTask")
@Log("出库任务下发")
public ResponseEntity<Object> issueTask(@RequestBody JSONObject whereJson) {
checkOutBillService.issueTask(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
@ -273,66 +236,25 @@ public class CheckOutBillController {
@PostMapping("/finishTask")
@Log("出库任务手动完成")
public ResponseEntity<Object> finishTask(@RequestBody JSONObject whereJson) {
checkOutBillService.finishTask(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/cancleTaskfinish")
@Log("出库任务手动取消完成")
public ResponseEntity<Object> cancleTaskfinish(@RequestBody JSONObject whereJson) {
checkOutBillService.cancleTaskfinish(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@GetMapping("/getInvTypes")
@Log("查询单据字段")
public ResponseEntity<Object> getInvTypes() {
return new ResponseEntity<>(checkOutBillService.getInvTypes(), HttpStatus.OK);
}
@PostMapping("/paramByCodeType")
@Log("查询出库单物料是否限制参数")
public ResponseEntity<Object> paramByCodeType(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(checkOutBillService.getParamByCodeType(whereJson), HttpStatus.OK);
}
@PostMapping("/schAreaType")
@Log("查询点位区域类型")
public ResponseEntity<Object> schAreaType(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(checkOutBillService.schAreaType(whereJson), HttpStatus.OK);
}
@PostMapping("/backConfirm")
@Log("出库单强制确认")
public ResponseEntity<Object> backConfirm(@RequestBody JSONObject whereJson) {
checkOutBillService.backConfirm(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@GetMapping("/getType")
@Log("获取全部出入库业务类型")
public ResponseEntity<Object> getType() {
return new ResponseEntity<>(checkOutBillService.getType(), HttpStatus.OK);
}
@PostMapping("/moneySubmit")
@Log("发货信息保存")
public ResponseEntity<Object> moneySubmit(@RequestBody JSONObject whereJson) {
checkOutBillService.moneySubmit(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@Log("下载发货单Excel")
@GetMapping(value = "/downloadExcel")
public ResponseEntity<Object> downloadExcel(HttpServletResponse response, @RequestParam Map whereJson) throws IOException {
checkOutBillService.downloadExcel(response, whereJson);
@ -341,28 +263,24 @@ public class CheckOutBillController {
@PostMapping("/getDisNum")
@Log("获取分配明细条数")
public ResponseEntity<Object> getDisNum(@RequestBody Map whereJson) {
return new ResponseEntity<>(checkOutBillService.getDisNum(whereJson), HttpStatus.OK);
}
@PostMapping("/queryBox")
@Log("新增物料库存条件过滤")
public ResponseEntity<Object> queryBox(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(checkOutBillService.queryBox(whereJson), HttpStatus.OK);
}
@PostMapping("/outReturn")
@Log("销售出库回传mes")
public ResponseEntity<Object> outReturn(@RequestBody JSONObject whereJson) {
checkOutBillService.outReturn(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@Log("导出数据")
@GetMapping(value = "/download")
public void download(@RequestParam Map map, HttpServletResponse response, String[] stor_id, String[] bill_status, String[] bill_type) throws IOException {
checkOutBillService.download(map, response, stor_id, bill_status, bill_type);
@ -388,60 +306,4 @@ public class CheckOutBillController {
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/testInEmp")
@Log("空载具入库测试")
@SaIgnore
public ResponseEntity<Object> testInEmp(@RequestBody JSONObject whereJson) {
new InVehicleManageServiceImpl().inVehicle(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/testOutEmp")
@Log("空载具出库测试")
@SaIgnore
public ResponseEntity<Object> testOutEmp(@RequestBody JSONObject whereJson) {
new OutVehicleManageServiceImpl().outVehicle(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/testInBox")
@Log("木箱入库测试")
@SaIgnore
public ResponseEntity<Object> testInBox(@RequestBody JSONObject whereJson) {
InBoxManageServiceImpl bean = SpringContextHolder.getBean(InBoxManageServiceImpl.class);
bean.inBox(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/testOutBox")
@Log("木箱出库测试")
@SaIgnore
public ResponseEntity<Object> testOutBox(@RequestBody JSONObject whereJson) {
outBoxManageService.outBox(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/testBoxLash")
@Log("木箱捆扎测试")
@SaIgnore
public ResponseEntity<Object> testBoxLash(@RequestBody JSONObject whereJson) {
lashManageService.createLashTask(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/testSendOut")
@Log("发货区测试")
public ResponseEntity<Object> testSendOut(@RequestBody JSONObject whereJson) {
sendOutManageService.createSendOutTask(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/testIn")
@Log("申请入库")
public ResponseEntity<Object> testIn(@RequestBody JSONObject whereJson) {
inBussManageService.inTask(whereJson);
return new ResponseEntity<>(HttpStatus.OK);
}
}

609
lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java

@ -374,48 +374,6 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void insertDtlByJson(JSONObject map) {
//明细另一种写法
JSONArray rows = map.getJSONArray("tableData");
map.remove("tableData");
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
String iostorinv_id = IdUtil.getSnowflake(1, 1).nextId() + "";
String bill_code = CodeUtil.getNewCode("IO_CODE");
map.put("iostorinv_id", iostorinv_id);
map.put("bill_code", bill_code);
String bill_type = map.getString("bill_type");
map.put("buss_type", bill_type.substring(0, 4));
map.put("io_type", "1");
map.put("detail_count", rows.size() + "");
map.put("create_mode", "01");
map.put("input_optid", currentUserId + "");
map.put("input_optname", nickName);
map.put("input_time", now);
map.put("update_optid", currentUserId + "");
map.put("update_optname", nickName);
map.put("update_time", now);
map.put("is_delete", "0");
map.put("is_upload", "0");
Long deptId = SecurityUtils.getDeptId();
map.put("sysdeptid", deptId);
map.put("syscompanyid", deptId);
for (int i = 0; i < rows.size(); i++) {
JSONObject row = rows.getJSONObject(i);
row.put("iostorinvdtl_id", IdUtil.getSnowflake(1, 1).nextId() + "");
row.put("iostorinv_id", iostorinv_id);
row.put("seq_no", (i + 1) + "");
row.put("assign_qty", "0");
row.put("unassign_qty", row.get("plan_qty"));
WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").insert(row);
}
WQLObject.getWQLObject("ST_IVT_IOStorInv").insert(map);
}
@Override
@Transactional(rollbackFor = Exception.class)
public String insertDtl(JSONObject map) {
@ -2526,13 +2484,6 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
from_end.put("lock_type", "1");
storPublicService.updateStructAndPoint2(from_end);
}
} else {//仓位载具扔有冻结数,需改任务类型为拣选出库
//任务号不为空
/* if (ObjectUtil.isNotEmpty(dis.getString("task_id"))) {
//更新对应任务为拣选出库
map.put("taskdtl_type", "05");
wo_Task.update(map, "task_id='" + dis.getString("task_id") + "'");
}*/
}
}
@ -2654,390 +2605,11 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
}
}
} else {//仓位载具扔有冻结数,需改任务类型为拣选出库
//任务号不为空
/* if (ObjectUtil.isNotEmpty(dis.getString("task_id"))) {
//更新对应任务为拣选出库
map.put("taskdtl_type", "05");
wo_Task.update(map, "task_id='" + dis.getString("task_id") + "'");
}*/
}
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void setPoint(JSONObject whereJson) {
//出库分配表
WQLObject wo_dis = WQLObject.getWQLObject("ST_IVT_IOStorInvDis");
//点位表
WQLObject wo_Point = WQLObject.getWQLObject("SCH_BASE_Point");
//任务表
WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task");
//出库主表
WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_IOStorInv");
//仓位表
WQLObject attrTab = WQLObject.getWQLObject("ST_IVT_StructAttr");
// 库存表
WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_StructIvt");
String struct_id = whereJson.getString("struct_id");
String point_code = whereJson.getString("point_code"); // 终点
String iostorinv_id = whereJson.getString("iostorinv_id");
//查询主表信息
JSONObject jo_mst = wo_mst.query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jo_mst)) {
throw new BadRequestException("未查到相关出库单");
}
JSONObject jsonPoint2 = wo_Point.query("lock_type='1' and (vehicle_code='' or vehicle_code IS NULL) and point_code='" + point_code + "'").uniqueResult(0);
//如果终点站点被锁定或者有载具号,则不允许设置点位
if (ObjectUtil.isEmpty(jsonPoint2)) {
throw new BadRequestException("该站点被锁定或者有载具号,不允许设置!");
}
// 查询未生成和生成未下发的分配记录
JSONObject dis = WQL.getWO("QST_IVT_CHECKOUTBILL")
.addParam("flag", "5")
.addParam("iostorinvdtl_id", whereJson.getString("iostorinvdtl_id"))
.addParam("iostorinvdis_id", whereJson.getString("iostorinvdis_id"))
.addParam("struct_id", struct_id)
.addParam("iostorinv_id", iostorinv_id)
.addParam("bill_status", "01")
.addParam("is_issued", "0")
.process()
.uniqueResult(0);
if (ObjectUtil.isEmpty(dis)) {
throw new BadRequestException("分配明细不存在或已执行、完成、!");
}
String task_status = dis.getString("task_status");
String task_id = dis.getString("task_id");
if (StrUtil.isNotEmpty(task_status) && "05,06,07".contains(task_status)) {
throw new BadRequestException("该任务已执行,不可重新设置站点!");
}
if (ObjectUtil.isNotEmpty(task_id)) {
//若任务不为空,则为变更出库目的站点
JSONObject task = wo_Task.query("task_id='" + task_id + "'").uniqueResult(0);
//更新任务
task.put("point_code2", jsonPoint2.getString("point_code"));
wo_Task.update(task);
} else {
/*
* 生成任务
* 1.判断此条分配明细的 仓位在此主表下的分配明细是否有相同的 仓位
* a.如果有有则合并只生成一条任务
* b.没有则正常生成
* 2.判断此货位是否被挡住
* a.挡住判断哪边的货位比较少 生成移库单
* b.没挡住正常生成
*/
JSONObject jsonPoint1 = wo_Point.query("source_id = '" + dis.getString("struct_id") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonPoint1)) {
throw new BadRequestException("起点点位不存在");
}
// 创建任务
JSONObject param = new JSONObject();
param.put("task_type", "010503");
param.put("vehicle_code", dis.getString("box_no"));
param.put("task_name", "task_name");
param.put("point_code1", jsonPoint1.getString("point_code"));
param.put("point_code2", jsonPoint2.getString("point_code"));
param.put("material_id", dis.getString("material_id"));
param.put("task_group_id", ""); // 任务组
param.put("sort_seq", ""); // 任务组顺序号
String create_task_id = outTask.createTask(param);
// 更新分配状态、任务标识、出库点位
JSONObject jsonTask = wo_Task.query("task_id = '" + create_task_id + "'").uniqueResult(0);
JSONObject jsonUpdateMap = new JSONObject();
jsonUpdateMap.put("work_status", "01");
jsonUpdateMap.put("task_id", jsonTask.getLong("task_id"));
jsonUpdateMap.put("point_id", jsonPoint2.getLong("point_id"));
wo_dis.update(jsonUpdateMap, "iostorinvdis_id = '" + dis.getString("iostorinvdis_id") + "'");
// 1.判断此条分配明细的 ‘仓位’在此主表下的分配明细是否有相同的 ‘仓位’
JSONArray disArr = wo_dis.query("struct_id = '" + dis.getString("struct_id") +
"' and iostorinv_id = '" + dis.getString("iostorinv_id") +
"' and iostorinvdis_id <> '" + dis.getString("iostorinvdis_id") +
"' and work_status = '00'").getResultJSONArray(0);
// 依次更新相同仓位的分配明细状态、任务标识、出库点位
for (int i = 0; i < disArr.size(); i++) {
JSONObject jsonObject = disArr.getJSONObject(i);
jsonObject.put("work_status", "01");
jsonObject.put("task_id", jsonTask.getLong("task_id"));
jsonObject.put("point_id", jsonPoint2.getLong("point_id"));
wo_dis.update(jsonObject);
}
// 2.判断此货位是否被挡住
JSONObject jsonAttr = attrTab.query("struct_id = '" + dis.getString("struct_id") + "'").uniqueResult(0);
// 判断此仓位是‘双通’还是’单通‘
if (StrUtil.equals(jsonAttr.getString("placement_type"), "01")) {
JSONObject map = new JSONObject();
map.put("flag", "2");
map.put("struct_code", jsonAttr.getString("struct_code"));
map.put("sect_id", jsonAttr.getString("sect_id"));
// 判断左边是否被挡住
JSONObject jsonIsBlockL = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().uniqueResult(0);
// 判断右边是否被挡住
map.put("flag", "1");
JSONObject jsonIsBlockR = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonIsBlockL) && ObjectUtil.isNotEmpty(jsonIsBlockR)) {
// 都被挡住判断哪边被挡住的货位少
map.put("flag", "3");
map.put("out_order_seq", jsonAttr.getString("out_order_seq"));
JSONArray jsonIsBlockAll = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().getResultJSONArray(0);
int blockLeft = 0; // 左边个数
int blockRigth = 0; // 右边个数
for (int i = 0; i < jsonIsBlockAll.size(); i++) {
JSONObject json = jsonIsBlockAll.getJSONObject(i);
if (i == 0) {
blockRigth = json.getIntValue("num");
}
if (i == 1) {
blockRigth = json.getIntValue("num");
}
}
// 更新第一个任务 任务组、任务顺序号
jsonTask.put("task_group_id", IdUtil.getSnowflake(1, 1).nextId());
jsonTask.put("sort_seq", 1);
wo_Task.update(jsonTask);
JSONArray jsonAllBlockPoint = new JSONArray();
if (blockLeft > blockRigth) {
// 从右边生成移库单
map.put("flag", "4");
map.put("block_num", jsonAttr.getString("block_num"));
map.put("row_num", jsonAttr.getString("row_num"));
jsonAllBlockPoint = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().getResultJSONArray(0);
} else {
// 从左边生成移库单
map.put("flag", "5");
map.put("block_num", jsonAttr.getString("block_num"));
map.put("row_num", jsonAttr.getString("row_num"));
jsonAllBlockPoint = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().getResultJSONArray(0);
}
for (int i = 0; i < jsonAllBlockPoint.size(); i++) {
JSONObject json = jsonAllBlockPoint.getJSONObject(i);
JSONObject mapParam = new JSONObject();// 生成移库单传入参数
JSONArray table = new JSONArray(); // 明细参数
mapParam.put("bill_status", "10");
mapParam.put("bill_type", "21");
mapParam.put("buss_type", "21");
mapParam.put("biz_date", DateUtil.today());
mapParam.put("stor_code", "CP01");
mapParam.put("stor_id", "1582991156504039424");
mapParam.put("stor_name", "成品仓库");
mapParam.put("is_task", "1");
// 查询移入货位
JSONObject moveParam = new JSONObject();
moveParam.put("box_no", json.getString("storagevehicle_code"));
moveParam.put("sect_id", RegionTypeEnum.ZZ01.getId());
JSONObject jsonMove = rawAssistIStorService.autoDis(moveParam);
// 查询移出货位的库存物料
JSONObject jsonMoveIvt = WQL.getWO("ST_OUTIVT03")
.addParam("flag", "6")
.addParam("struct_id", json.getString("struct_id"))
.process().uniqueResult(0);
// 移库单明细
JSONObject jsonMoveDtl = new JSONObject();
jsonMoveDtl.put("is_task", "2");
jsonMoveDtl.put("turnout_sect_id", json.getLongValue("sect_id"));
jsonMoveDtl.put("turnout_sect_code", json.getString("sect_code"));
jsonMoveDtl.put("turnout_sect_name", json.getString("sect_name"));
jsonMoveDtl.put("turnout_struct_id", json.getLongValue("struct_id"));
jsonMoveDtl.put("turnout_struct_code", json.getString("struct_code"));
jsonMoveDtl.put("turnout_struct_name", json.getString("struct_name"));
jsonMoveDtl.put("material_id", jsonMoveIvt.getLongValue("material_id"));
jsonMoveDtl.put("pcsn", jsonMoveIvt.getString("pcsn"));
jsonMoveDtl.put("quality_scode", "01");
jsonMoveDtl.put("qty_unit_id", jsonMoveIvt.getLongValue("qty_unit_id"));
jsonMoveDtl.put("qty_unit_name", jsonMoveIvt.getString("unit_name"));
jsonMoveDtl.put("qty", jsonMoveIvt.getDoubleValue("canuse_qty"));
jsonMoveDtl.put("storagevehicle_code", json.getString("storagevehicle_code"));
jsonMoveDtl.put("turnin_sect_id", jsonMove.getLongValue("sect_id"));
jsonMoveDtl.put("turnin_sect_code", jsonMove.getString("sect_code"));
jsonMoveDtl.put("turnin_sect_name", jsonMove.getString("sect_name"));
jsonMoveDtl.put("turnin_struct_id", jsonMove.getLongValue("struct_id"));
jsonMoveDtl.put("turnin_struct_code", jsonMove.getString("struct_code"));
jsonMoveDtl.put("turnin_struct_name", jsonMove.getString("struct_name"));
jsonMoveDtl.put("source_billdtl_id", dis.getLongValue("iostorinvdis_id"));
// 生成任务
JSONObject param2 = new JSONObject();
param2.put("task_type", "010503");
param2.put("vehicle_code", json.getString("storagevehicle_code"));
param2.put("task_name", "task_name");
param2.put("point_code1", json.getString("point_code"));
param2.put("point_code2", jsonMove.getString("struct_code"));
param2.put("task_group_id", jsonTask.getLongValue("task_group_id")); // 任务组
param2.put("sort_seq", jsonTask.getIntValue("sort_seq") + i + 1); // 任务组顺序号
String move_task_id = outTask.createTask(param2);
// 回显移库明细任务id
jsonMoveDtl.put("task_id", move_task_id);
table.add(jsonMoveDtl);
// 更新任务处理类
JSONObject jsonTaskMove = wo_Task.query("task_id = '" + move_task_id + "'").uniqueResult(0);
jsonTaskMove.put("task_type", "010505");
jsonTaskMove.put("handle_class", HandMoveStorAcsTask.class.getName());
wo_Task.update(jsonTaskMove);
mapParam.put("tableData", table);
// 调用移库单新增方法
if (ObjectUtil.isNotEmpty(jsonAllBlockPoint)) {
handMoveStorService.insertDtl2(mapParam);
}
}
}
} else {
JSONObject map = new JSONObject();
map.put("struct_code", jsonAttr.getString("struct_code"));
map.put("sect_id", jsonAttr.getString("sect_id"));
map.put("out_order_seq", jsonAttr.getString("out_order_seq"));
map.put("block_num", jsonAttr.getString("block_num"));
map.put("row_num", jsonAttr.getString("row_num"));
JSONArray jsonAllBlockPoint = new JSONArray();
if (StrUtil.equals(jsonAttr.getString("placement_type"), "02")) {
// 02-左通
map.put("flag", "2");
// 判断左边是否被挡住
JSONObject jsonIsBlockL = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonIsBlockL)) {
// 更新第一个任务 任务组、任务顺序号
jsonTask.put("task_group_id", IdUtil.getSnowflake(1, 1).nextId());
jsonTask.put("sort_seq", 1);
wo_Task.update(jsonTask);
// 从左边生成移库单
map.put("flag", "5");
jsonAllBlockPoint = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().getResultJSONArray(0);
}
}
if (StrUtil.equals(jsonAttr.getString("placement_type"), "03")) {
// 03-右通
map.put("flag", "1");
JSONObject jsonIsBlockR = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().uniqueResult(0);
// 判断左边是否被挡住
if (ObjectUtil.isNotEmpty(jsonIsBlockR)) {
// 更新第一个任务 任务组、任务顺序号
jsonTask.put("task_group_id", IdUtil.getSnowflake(1, 1).nextId());
jsonTask.put("sort_seq", 1);
wo_Task.update(jsonTask);
// 从右边生成移库单
map.put("flag", "4");
jsonAllBlockPoint = WQL.getWO("ST_OUTIVT03").addParamMap(map).process().getResultJSONArray(0);
}
}
for (int i = 0; i < jsonAllBlockPoint.size(); i++) {
JSONObject json = jsonAllBlockPoint.getJSONObject(i);
JSONObject mapParam = new JSONObject();// 生成移库单传入参数
JSONArray table = new JSONArray(); // 明细参数
mapParam.put("bill_status", "10");
mapParam.put("bill_type", "21");
mapParam.put("buss_type", "21");
mapParam.put("biz_date", DateUtil.today());
mapParam.put("stor_code", "CP01");
mapParam.put("stor_id", "1582991156504039424");
mapParam.put("stor_name", "成品仓库");
mapParam.put("is_task", "1");
// 查询移入货位
JSONObject moveParam = new JSONObject();
moveParam.put("box_no", json.getString("storagevehicle_code"));
moveParam.put("sect_id", RegionTypeEnum.ZZ01.getId());
JSONObject jsonMove = rawAssistIStorService.autoDis(moveParam);
// 查询移出货位的库存物料
JSONObject jsonMoveIvt = WQL.getWO("ST_OUTIVT03")
.addParam("flag", "6")
.addParam("struct_id", json.getString("struct_id"))
.process().uniqueResult(0);
// 移库单明细
JSONObject jsonMoveDtl = new JSONObject();
jsonMoveDtl.put("is_task", "2");
jsonMoveDtl.put("turnout_sect_id", json.getLongValue("sect_id"));
jsonMoveDtl.put("turnout_sect_code", json.getString("sect_code"));
jsonMoveDtl.put("turnout_sect_name", json.getString("sect_name"));
jsonMoveDtl.put("turnout_struct_id", json.getLongValue("struct_id"));
jsonMoveDtl.put("turnout_struct_code", json.getString("struct_code"));
jsonMoveDtl.put("turnout_struct_name", json.getString("struct_name"));
jsonMoveDtl.put("material_id", jsonMoveIvt.getLongValue("material_id"));
jsonMoveDtl.put("pcsn", jsonMoveIvt.getString("pcsn"));
jsonMoveDtl.put("quality_scode", "01");
jsonMoveDtl.put("qty_unit_id", jsonMoveIvt.getLongValue("qty_unit_id"));
jsonMoveDtl.put("qty_unit_name", jsonMoveIvt.getString("unit_name"));
jsonMoveDtl.put("qty", jsonMoveIvt.getDoubleValue("canuse_qty"));
jsonMoveDtl.put("storagevehicle_code", json.getString("storagevehicle_code"));
jsonMoveDtl.put("turnin_sect_id", jsonMove.getLongValue("sect_id"));
jsonMoveDtl.put("turnin_sect_code", jsonMove.getString("sect_code"));
jsonMoveDtl.put("turnin_sect_name", jsonMove.getString("sect_name"));
jsonMoveDtl.put("turnin_struct_id", jsonMove.getLongValue("struct_id"));
jsonMoveDtl.put("turnin_struct_code", jsonMove.getString("struct_code"));
jsonMoveDtl.put("turnin_struct_name", jsonMove.getString("struct_name"));
jsonMoveDtl.put("source_billdtl_id", dis.getLongValue("iostorinvdis_id"));
// 生成任务
JSONObject param2 = new JSONObject();
param2.put("task_type", "010503");
param2.put("vehicle_code", json.getString("storagevehicle_code"));
param2.put("task_name", "task_name");
param2.put("point_code1", json.getString("point_code"));
param2.put("point_code2", jsonMove.getString("struct_code"));
param2.put("task_group_id", jsonTask.getLongValue("task_group_id")); // 任务组
param2.put("sort_seq", jsonTask.getIntValue("sort_seq") + i + 1); // 任务组顺序号
String move_task_id = outTask.createTask(param2);
// 回显移库明细任务id
jsonMoveDtl.put("task_id", move_task_id);
table.add(jsonMoveDtl);
// 更新任务处理类
JSONObject jsonTaskMove = wo_Task.query("task_id = '" + move_task_id + "'").uniqueResult(0);
jsonTaskMove.put("task_type", "010505");
jsonTaskMove.put("handle_class", HandMoveStorAcsTask.class.getName());
wo_Task.update(jsonTaskMove);
mapParam.put("tableData", table);
// 调用移库单新增方法
if (ObjectUtil.isNotEmpty(jsonAllBlockPoint)) {
handMoveStorService.insertDtl2(mapParam);
}
}
}
// 下发
outTask.immediateNotifyAcs(null);
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void allSetPoint(JSONObject whereJson) {
@ -5775,59 +5347,6 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void cancleTaskfinish(JSONObject whereJson) {
//出库明细表
WQLObject wo_dtl = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl");
//出库分配表
WQLObject wo_dis = WQLObject.getWQLObject("ST_IVT_IOStorInvDis");
//任务表
WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task");
//出库主表
WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_IOStorInv");
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
String iostorinv_id = whereJson.getString("iostorinv_id");
String task_id = whereJson.getString("task_id");
// 更新任务状态
JSONObject jsonTask = wo_Task.query("task_id ='" + task_id + "'").uniqueResult(0);
jsonTask.put("task_status", TaskStatusEnum.ISSUE.getCode());
jsonTask.put("update_optid", currentUserId);
jsonTask.put("update_optname", nickName);
jsonTask.put("update_time", now);
wo_Task.update(jsonTask);
//查询主表信息
JSONObject jo_mst = wo_mst.query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jo_mst)) {
throw new BadRequestException("未查到相关出库单");
}
if ("99".equals(jo_mst.getString("bill_status"))) {
throw new BadRequestException("已完成单据不允许取消完成!");
}
// 查询此任务下的所有分配明细
JSONArray disArr = wo_dis.query("task_id ='" + task_id + "'").getResultJSONArray(0);
for (int i = 0; i < disArr.size(); i++) {
JSONObject jsonDis = disArr.getJSONObject(i);
// 更新分配明细状态
jsonDis.put("work_status", "01");
wo_dis.update(jsonDis);
// 更新明细状态
JSONObject jsonDtl = wo_dtl.query("iostorinvdtl_id = '" + jsonDis.getString("iostorinvdtl_id") + "'").uniqueResult(0);
jsonDtl.put("bill_status", "40");
}
}
@Override
public JSONArray getInvTypes() {
//查询单据字段类型
@ -5838,107 +5357,6 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
return ja;
}
@Override
public JSONObject getParamByCodeType(JSONObject form) {
String bill_type = form.getString("bill_type");
if (StrUtil.isEmpty(bill_type)) {
throw new BadRequestException("出库单类型不能为空!");
}
Map whereJson = new HashMap<String, String>();
String io_flag = form.getString("io_flag");
whereJson.put("io_code", bill_type.substring(0, 4));
whereJson.put("io_flag", "01");
if (StrUtil.isNotEmpty(bill_type)) {
whereJson.put("io_flag", io_flag);
}
JSONArray ja = null;
JSONObject ret = new JSONObject();
if (ja.size() != 0) {
for (int i = 0; i < ja.size(); i++) {
JSONObject jo = ja.getJSONObject(i);
if (bill_type.equals(jo.getString("code"))) {
ret = jo;
break;
}
}
} else {
throw new BadRequestException("出库类型系统参数查询失败!");
}
return ret;
}
@Override
public JSONArray schAreaType(JSONObject form) {
String ids = form.getString("ids");
//查询单据字段类型
JSONArray ja = WQL.getWO("ST_PUB_QUERY_01")
.addParam("flag", "5")
.addParam("ids", ids)
.process()
.getResultJSONArray(0);
return ja;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void backConfirm(JSONObject whereJson) {
WQLObject dtl_wql = WQLObject.getWQLObject("st_ivt_iostorinvdtl");
WQLObject mst_wql = WQLObject.getWQLObject("ST_IVT_IOStorInv");
JSONObject mst_row = mst_wql.query("iostorinv_id = '" + whereJson.get("iostorinv_id") + "'").uniqueResult(0);
//校验主表状态为生成
String bill_status = mst_row.getString("bill_status");
if (!"10".equals(bill_status)) {
throw new BadRequestException("主表状态必须为生成状态!");
}
JSONArray dtl_rows = dtl_wql.query("iostorinv_id = '" + whereJson.get("iostorinv_id") + "'").getResultJSONArray(0);
//生成手工入库库单
String iostorinv_id = IdUtil.getSnowflake(1, 1).nextId() + "";
String bill_code = CodeUtil.getNewCode("IO_CODE");
for (int i = 0; i < dtl_rows.size(); i++) {
JSONObject dtl_row = dtl_rows.getJSONObject(i);
dtl_row.put("source_billdtl_id", dtl_row.getString("iostorinvdtl_id"));
dtl_row.put("source_bill_type", mst_row.getString("bill_type"));
dtl_row.put("source_bill_code", mst_row.getString("bill_code"));
dtl_row.put("source_bill_table", "ST_IVT_IOStorInvDtl");
dtl_row.put("iostorinvdtl_id", IdUtil.getSnowflake(1, 1).nextId());
dtl_row.put("iostorinv_id", iostorinv_id);
dtl_wql.insert(dtl_row);
}
mst_row.put("iostorinv_id", iostorinv_id);
mst_row.put("bill_code", bill_code);
mst_row.put("io_type", "0");
mst_row.put("bill_type", "000401");
mst_row.put("buss_type", ((String) mst_row.get("bill_type")).substring(0, 4));
mst_wql.insert(mst_row);
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
JSONObject mst_row2 = mst_wql.query("iostorinv_id = '" + whereJson.get("iostorinv_id") + "'").uniqueResult(0);
mst_row2.put("bill_status", "99");
mst_row2.put("confirm_optid", currentUserId);
mst_row2.put("confirm_optname", nickName);
mst_row2.put("confirm_time", now);
//更新主表状态为99
mst_wql.update(mst_row2);
HashMap<String, String> map = new HashMap<>();
map.put("bill_status", "99");
dtl_wql.update(map, "iostorinv_id = '" + whereJson.get("iostorinv_id") + "'");
}
@Override
@Transactional(rollbackFor = Exception.class)
public JSONArray getType() {
JSONArray jsonArr = WQL.getWO("QST_IVT_CHECKOUTBILL").addParam("flag", "11").process().getResultJSONArray(0);
return jsonArr;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void moneySubmit(JSONObject whereJson) {
@ -6303,31 +5721,4 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
}
wo_mst.update(jo_mst);
}
/**
* 判断仓位上可用数是否为00返回true非0返回false
*
* @param code 载具编码或者仓位编码
*/
boolean canuse_is_zero(String code) {
//仓位库存表
WQLObject wo_StructIvt = WQLObject.getWQLObject("ST_IVT_StructIvt");
//仓位表
WQLObject wo_Struct = WQLObject.getWQLObject("ST_IVT_StructAttr");
if (StrUtil.isEmpty(code)) {
throw new BadRequestException("仓位编码不能为空!");
}
//查询仓位信息
JSONObject jo_mst = wo_Struct.query("struct_code = '" + code + "'").uniqueResult(0);
if (jo_mst != null) {
//查询可用数大于0的记录数
JSONArray ja = wo_StructIvt.query("canuse_qty>0 and struct_code = '" + code + "'").getResultJSONArray(0);
if (ja.size() != 0) {
return false;
}
} else {
throw new BadRequestException("查询不到相关仓位!");
}
return true;
}
}

10
lms/nladmin-ui/src/views/wms/st/inAndOutReturn/inandoutreturn.js

@ -56,12 +56,4 @@ export function disupload(data) {
})
}
export function getType(data) {
return request({
url: '/api/inandoutreturn/getType',
method: 'post',
data
})
}
export default { add, edit, del, upload, uploadMES, uploadSAP, disupload, getType }
export default { add, edit, del, upload, uploadMES, uploadSAP, disupload }

268
lms/nladmin-ui/src/views/wms/st/inbill/StructUpdateDialog.vue

@ -1,268 +0,0 @@
<template>
<el-dialog
title="任务修改"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
fullscreen
width="1000px"
@close="close"
@open="open"
>
<el-row :gutter="20">
<el-col :span="20" style="border: 1px solid white">
<span />
</el-col>
<el-col :span="4">
<span>
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="submit">确定</el-button>
<el-button icon="el-icon-close" size="mini" type="info" @click="dialogVisible = false">关闭</el-button>
</span>
</el-col>
</el-row>
<el-form ref="taskForm" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" size="mini" label-width="85px" label-suffix=":">
<el-form-item label="任务号" prop="task_code">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.task_code" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="存储载具" prop="storagevehicle_code">
<el-input v-model="form.storagevehicle_code" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="原入库点" prop="point_code">
<el-input v-model="form.point_code" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="入库点" prop="new_point_code">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-select
v-model="form.new_point_code"
clearable
placeholder="请选择"
class="filter-item"
style="width: 210px"
>
<el-option
v-for="item in pointlist"
:key="item.point_code"
:label="item.point_code"
:value="item.point_code"
/>
</el-select>
</el-form-item>
<el-form-item label="原货位" prop="struct_code">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.struct_code" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="新货位" prop="new_struct_code">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.new_struct_code" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="所属库区" prop="new_struct_code">
<el-cascader
v-model="query.sect"
style="width: 210px"
placeholder="所属库区"
:options="sects"
:props="{ checkStrictly: true }"
clearable
@change="sectQueryChange"
/>
</el-form-item>
<el-form-item label="模糊查询" prop="struct_code">
<el-input
v-model="query.search"
clearable
style="width: 200px"
size="mini"
placeholder="输入货位编码、名称"
prefix-icon="el-icon-search"
class="filter-item"
/>
</el-form-item>
<rrOperation />
</el-form>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%"
:row-class-name="tableRowClassName"
highlight-current-row
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@row-click="clcikRow"
@select="handleSelectionChange"
@select-all="onSelectAll"
>
<el-table-column prop="struct_code" label="货位编码" />
<el-table-column prop="struct_name" label="货位名称" />
<el-table-column prop="material_height_type_name" label="高度类型" />
<el-table-column prop="sect_name" label="库区名称" />
</el-table>
<!--分页组件-->
<pagination />
</el-dialog>
</template>
<script>
import CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import crudStructattr from '@/views/wms/basedata/st/struct/structattr'
import crudSectattr from '@/views/wms/basedata/st/sect/sectattr'
import crudRawAssist from '@/views/wms/st/inbill/rawassist'
import crudPoint from '@/views/wms/sch/point'
export default {
name: 'StructDiv',
components: { crudOperation, rrOperation, pagination },
cruds() {
return CRUD({
title: '仓位',
optShow: {},
url: 'api/structattr',
idField: 'struct_id',
sort: 'struct_id,desc',
crudMethod: { ...crudStructattr }
})
},
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
},
sectProp: {
type: Object,
default: null
},
bucketForm: {
type: Object,
default: null
}
},
data() {
return {
sects: [],
classes: [],
pointlist: [],
dialogVisible: false,
sectProp: null,
checkrow: {},
form: {
task_id: '',
task_code: '',
storagevehicle_code: '',
point_code: '',
new_point_code: '',
struct_code: '',
new_struct_code: ''
},
rows: []
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
},
sectProp: {
handler(newValue, oldValue) {
this.sectProp = newValue
}
},
bucketForm: {
handler(newValue, oldValue) {
this.form = newValue
}
}
},
methods: {
[CRUD.HOOK.beforeRefresh]() {
this.crud.query.lock_type = '1'
},
open() {
crudSectattr.getSect({ 'is_materialstore': '1', 'sect_type_attr': '00' }).then(res => {
this.sects = res.content
})
crudPoint.getPoint({ 'area_type': '21' }).then(res => {
this.pointlist = res
})
if (this.sectProp) {
this.query.sect = this.sectProp
if (this.sectProp.length === 1) {
this.query.stor_id = this.sectProp[0]
this.query.sect_id = ''
}
if (this.sectProp.length === 0) {
this.query.sect_id = ''
this.query.stor_id = ''
}
if (this.sectProp.length === 2) {
this.query.stor_id = this.sectProp[0]
this.query.sect_id = this.sectProp[1]
}
}
this.crud.toQuery()
},
clcikRow(row, column, event) {
this.form.new_struct_code = row.struct_code
},
tableRowClassName({ row, rowIndex }) {
row.index = rowIndex
},
sectQueryChange(val) {
if (val.length === 1) {
this.query.stor_id = val[0]
this.query.sect_id = ''
}
if (val.length === 0) {
this.query.sect_id = ''
this.query.stor_id = ''
}
if (val.length === 2) {
this.query.stor_id = val[0]
this.query.sect_id = val[1]
}
},
handleSelectionChange(val, row) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
} else {
this.checkrow = row
}
},
onSelectAll() {
this.$refs.table.clearSelection()
},
close() {
this.crud.resetQuery()
this.query.sect = null
this.$emit('update:dialogShow', false)
},
submit() {
this.crud.resetQuery()
crudRawAssist.updateTask(this.form).then(res => {
this.$emit('update:dialogShow', false)
this.$emit('updateCommit', this.checkrow)
})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 0px;
}
</style>

69
lms/nladmin-ui/src/views/wms/st/inbill/TaskDialog.vue

@ -64,16 +64,6 @@
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<!-- <el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="updateTask()"
>
修改
</el-button>-->
<el-button
slot="left"
class="filter-item"
@ -104,16 +94,6 @@
>
标识完成
</el-button>
<!-- <el-button
slot="left"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
@click="cancelTask()"
>
取消完成
</el-button>-->
</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
@ -144,19 +124,16 @@
</el-table>
</el-card>
<StructUpdateDiv :dialog-show.sync="structShow" :sect-prop="sectProp" :bucket-form="bucketForm" @updateCommit="updateCommit" />
</el-dialog>
</template>
<script>
import CRUD, { crud } from '@crud/crud'
import StructUpdateDiv from '@/views/wms/st/inbill/StructUpdateDialog'
import crudRawAssist from '@/views/wms/st/inbill/rawassist'
export default {
name: 'TaskDialog',
components: { StructUpdateDiv },
components: {},
mixins: [crud()],
dicts: ['io_bill_status', 'task_status'],
props: {
@ -182,13 +159,10 @@ export default {
tableDtl: [],
stor_id: '',
sect_id: '',
sectProp: null,
structShow: false,
sects: [],
dis_row: null,
fullscreenLoading: false,
bucketParam: null,
bucketForm: null,
bucketDtlShow: false,
form: {
tableMater: [],
@ -270,28 +244,6 @@ export default {
this.fullscreenLoading = false
})
},
cancelTask() {
if (!this.dis_row) {
this.crud.notify('请选择一条任务项', CRUD.NOTIFICATION_TYPE.INFO)
return
}
if (this.dis_row.work_status !== '99') {
this.crud.notify('只能对状态为完成的任务进行取消!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.fullscreenLoading = true
crudRawAssist.cancelTask(this.dis_row).then(res => {
this.fullscreenLoading = false
crudRawAssist.queryTask(this.form.dtl_row).then(res2 => {
this.form.tableMater = res2
this.crud.notify('取消确认任务成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(() => {
this.fullscreenLoading = false
})
}).catch(() => {
this.fullscreenLoading = false
})
},
reIssueTask() {
if (!this.dis_row) {
this.crud.notify('请选择一条任务项', CRUD.NOTIFICATION_TYPE.INFO)
@ -316,25 +268,6 @@ export default {
this.form.tableMater = res
})
},
updateTask() {
if (!this.dis_row) {
this.crud.notify('请选择一条任务项', CRUD.NOTIFICATION_TYPE.INFO)
return
}
debugger
if (this.dis_row.work_status !== '01') {
this.crud.notify('只能对状态为生成的任务进行修改!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.structShow = true
this.bucketForm = this.dis_row
},
updateCommit() {
crudRawAssist.queryTask(this.form.dtl_row).then(res => {
this.form.tableMater = res
this.crud.notify('修改任务成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
},
checkedChange(val) {
this.form.dtl_row.checked = this.form.checked
crudRawAssist.queryTask(this.form.dtl_row).then(res => {

36
lms/nladmin-ui/src/views/wms/st/inbill/rawassist.js

@ -128,14 +128,6 @@ export function bucketDtl(data) {
})
}
export function updateTask(data) {
return request({
url: '/api/in/rawAssist/updateTask',
method: 'post',
data
})
}
export function delTask(data) {
return request({
url: '/api/in/rawAssist/delTask',
@ -160,14 +152,6 @@ export function confirmTask(data) {
})
}
export function cancelTask(data) {
return request({
url: '/api/in/rawAssist/cancelTask',
method: 'post',
data
})
}
export function confirm(data) {
return request({
url: '/api/in/rawAssist/confirm',
@ -176,22 +160,6 @@ export function confirm(data) {
})
}
export function backConfirm(data) {
return request({
url: '/api/in/rawAssist/backConfirm',
method: 'post',
data
})
}
export function delDis(data) {
return request({
url: '/api/in/rawAssist/delDis',
method: 'post',
data
})
}
export function queryBoxMater(data) {
return request({
url: '/api/in/rawAssist/queryBoxMater',
@ -201,5 +169,5 @@ export function queryBoxMater(data) {
}
export default { add, edit, del, insertDtl, getIODtl, commit, checkVehicle,
deleteDisDtl, getDisDtl, divStruct, allDivStruct, unDivStruct, divPoint, delDis, queryBoxMater,
queryTask, bucketDtl, updateTask, delTask, reIssueTask, confirmTask, cancelTask, confirm, backConfirm }
deleteDisDtl, getDisDtl, divStruct, allDivStruct, unDivStruct, divPoint, queryBoxMater,
queryTask, bucketDtl, delTask, reIssueTask, confirmTask, confirm }

8
lms/nladmin-ui/src/views/wms/st/outbill/AddDialog.vue

@ -389,11 +389,6 @@ export default {
this.materShow = true
this.nowindex = index
this.nowrow = row
/* checkoutbill.paramByCodeType({ 'bill_type': this.form.bill_type }).then(res => {
this.materType = res.materType
this.nowindex = index
this.nowrow = row
})*/
},
queryDtl(index, row) {
if (this.form.bill_type === '') {
@ -406,9 +401,6 @@ export default {
}
this.storId = this.form.stor_id
this.dtlShow = true
/* checkoutbill.paramByCodeType({ 'bill_type': this.form.bill_type }).then(res => {
this.materType = res.materType
})*/
},
tableChanged(rows) {
rows.forEach((item) => {

31
lms/nladmin-ui/src/views/wms/st/outbill/DivDialog.vue

@ -201,17 +201,6 @@
<span v-if="mstrow.stor_id !== '1582991156504039455'" class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<!-- <el-button
slot="left"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
:disabled="button4"
@click="setPoint()"
>
设置站点
</el-button>-->
<el-button
v-if="this.mstrow.bill_type !== '1011'"
slot="left"
@ -617,26 +606,6 @@ export default {
})
}
},
setPoint() {
if (this.form2.point_code === '') {
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
if (this.currentDis.point_code) {
this.crud.notify('站点已设置!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
if (this.currentDis.work_status !== '00') {
this.crud.notify('任务已生成!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
if (this.currentDis.iostorinvdis_id !== null) {
this.currentDis.point_code = this.form2.point_code
checkoutbill.setPoint(this.currentDis).then(res => {
this.queryTableDdis(this.currentDis.iostorinvdtl_id)
})
}
},
oneSetPoint2() {
if (this.form2.point_code === '') {
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)

22
lms/nladmin-ui/src/views/wms/st/outbill/TaskDialog.vue

@ -82,17 +82,6 @@
>
标示完成
</el-button>
<!-- <el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-close"
size="mini"
:disabled="button3"
@click="cancleTaskfinish"
>
取消完成
</el-button>-->
</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
@ -242,17 +231,6 @@ export default {
})
}
},
cancleTaskfinish() {
if (this.currentDis != null) {
this.fullscreenLoading = true
checkoutbill.cancleTaskfinish(this.currentDis).then(res => {
this.queryTableDdis()
this.fullscreenLoading = false
}).catch(() => {
this.fullscreenLoading = false
})
}
},
handleDtlCurrentChange(current) {
if (current !== null) {
this.tabledis = []

50
lms/nladmin-ui/src/views/wms/st/outbill/checkoutbill.js

@ -102,20 +102,6 @@ export function oneCancel(data) {
data
})
}
export function setPoint(data) {
return request({
url: '/api/checkoutbill/setPoint',
method: 'post',
data
})
}
export function oneSetPoint(data) {
return request({
url: '/api/checkoutbill/oneSetPoint',
method: 'post',
data
})
}
export function getStructIvt(params) {
return request({
url: '/api/checkoutbill/getStructIvt',
@ -151,40 +137,6 @@ export function finishTask(data) {
data
})
}
export function cancleTaskfinish(data) {
return request({
url: '/api/checkoutbill/cancleTaskfinish',
method: 'post',
data
})
}
export function paramByCodeType(data) {
return request({
url: '/api/checkoutbill/paramByCodeType',
method: 'post',
data
})
}
export function schAreaType(data) {
return request({
url: '/api/checkoutbill/schAreaType',
method: 'post',
data
})
}
export function backConfirm(data) {
return request({
url: '/api/checkoutbill/backConfirm',
method: 'post',
data
})
}
export function getType() {
return request({
url: '/api/checkoutbill/getType',
method: 'get'
})
}
export function moneySubmit(data) {
return request({
url: '/api/checkoutbill/moneySubmit',
@ -262,4 +214,4 @@ export function saveUpdate(data) {
data
})
}
export default { add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, getOutBillDis2, setPoint, oneSetPoint, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, cancleTaskfinish, getInvTypes, paramByCodeType, schAreaType, backConfirm, getOutBillDisDtl, getType, allDivOne, moneySubmit, getDisNum, queryBox, getOutBillTask2, oneCancel, cancelTask, allSetPoint, oneSetPoint2, outReturn, updataIsOverdue, excelImport, saveUpdate }
export default { add, edit, del, allDiv, allCancel, getOutBillDtl, getOutBillDis, getOutBillDis2, getOutBillTask, getStructIvt, manualDiv, confirm, issueTask, finishTask, getInvTypes, getOutBillDisDtl, allDivOne, moneySubmit, getDisNum, queryBox, getOutBillTask2, oneCancel, cancelTask, allSetPoint, oneSetPoint2, outReturn, updataIsOverdue, excelImport, saveUpdate }

9
lms/nladmin-ui/src/views/wms/st/outbill/index.vue

@ -589,15 +589,6 @@ export default {
}
},
printExcel(jo) {
/*if (jo.bill_type !== '1004' && jo.bill_type !== '1009') {
if (jo.shd_dtl_num === '') {
return this.crud.notify('客户为空!', CRUD.NOTIFICATION_TYPE.INFO)
}
}*/
/* if (jo.bill_type === '1004' || jo.bill_type === '1009') {
jo.shd_dtl_num = 44
}*/
jo.shd_dtl_num = 44
checkoutbill.getDisNum({ 'iostorinv_id': jo.iostorinv_id }).then(res => {
const j = Math.ceil(res.num / jo.shd_dtl_num)

Loading…
Cancel
Save