修改
This commit is contained in:
@@ -32,15 +32,7 @@ public class RawAssistIStorController {
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
|
||||
return new ResponseEntity<>(rawAssistIStorService.pageQuery(whereJson,page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getType")
|
||||
@Log("查询单据类型下拉框")
|
||||
@ApiOperation("查询单据类型下拉框")
|
||||
//@PreAuthorize("@el.check('materialtype:list')")
|
||||
public ResponseEntity<Object> getType(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(rawAssistIStorService.getType(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@Log("删除出入库单")
|
||||
@ApiOperation("删除出入库单")
|
||||
//@PreAuthorize("@el.check('sectattr:del')")
|
||||
@@ -92,15 +84,6 @@ public class RawAssistIStorController {
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/deleteDisDtl")
|
||||
@Log("删除一行")
|
||||
@ApiOperation("删除一行")
|
||||
//@PreAuthorize("@el.check('materialtype:list')")
|
||||
public ResponseEntity<Object> deleteDisDtl(@RequestBody Map whereJson) {
|
||||
rawAssistIStorService.deleteDisDtl(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/getDisDtl")
|
||||
@Log("查询入库分配载具明细")
|
||||
@ApiOperation("查询入库分配载具明细")
|
||||
@@ -144,14 +127,6 @@ public class RawAssistIStorController {
|
||||
return new ResponseEntity<>(rawAssistIStorService.queryTask(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/bucketDtl")
|
||||
@Log("查询托盘桶明细")
|
||||
@ApiOperation("查询托盘桶明细")
|
||||
//@PreAuthorize("@el.check('materialtype:list')")
|
||||
public ResponseEntity<Object> bucketDtl(@RequestBody Map whereJson) {
|
||||
return new ResponseEntity<>(rawAssistIStorService.bucketDtl(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/updateTask")
|
||||
@Log("变更任务")
|
||||
@ApiOperation("变更任务")
|
||||
|
||||
@@ -15,9 +15,6 @@ public interface RawAssistIStorService {
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> pageQuery(Map whereJson, Pageable page);
|
||||
|
||||
|
||||
JSONArray getType(Map whereJson);
|
||||
|
||||
Map<String, Object> getBillDtl(Map whereJson,Pageable page);
|
||||
|
||||
@@ -31,8 +28,6 @@ public interface RawAssistIStorService {
|
||||
|
||||
JSONArray getIODtl(Map whereJson);
|
||||
|
||||
void deleteDisDtl(Map whereJson);
|
||||
|
||||
void divStruct(Map whereJson);
|
||||
|
||||
void unDivStruct(Map whereJson);
|
||||
@@ -57,8 +52,6 @@ public interface RawAssistIStorService {
|
||||
|
||||
JSONArray queryTask(Map whereJson);
|
||||
|
||||
JSONArray bucketDtl(Map whereJson);
|
||||
|
||||
JSONObject autoDis(JSONObject whereJson);
|
||||
|
||||
}
|
||||
|
||||
@@ -57,8 +57,6 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
|
||||
private final StructattrService structattrService;
|
||||
|
||||
private final TaskService taskService;
|
||||
|
||||
private final PointService pointService;
|
||||
|
||||
|
||||
@@ -89,11 +87,6 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getType(Map whereJson) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getBillDtl(Map whereJson, Pageable page) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
@@ -306,102 +299,6 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
return ja;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteDisDtl(Map row) {
|
||||
WQLObject change = WQLObject.getWQLObject("MD_PB_BucketChangeFlow");
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
WQLObject dis_dtl = WQLObject.getWQLObject("ST_IVT_IOStorInvDisDtl");
|
||||
JSONObject dis = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinvdis_id ='" + row.get("iostorinvdis_id") + "'").uniqueResult(0);
|
||||
if (StrUtil.isNotEmpty(dis.getString("struct_id"))) {
|
||||
throw new BadRequestException("该桶已经分配货位,请先取消分配再删除桶!");
|
||||
}
|
||||
dis_dtl.delete("iostorinvdisdtl_id = '" + (String) row.get("iostorinvdisdtl_id") + "'");
|
||||
JSONObject mst = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id ='" + row.get("iostorinv_id") + "'").uniqueResult(0);
|
||||
//更新桶记录表
|
||||
HashMap<String, String> bucket_map = new HashMap<>();
|
||||
bucket_map.put("status", "01");
|
||||
bucket_map.put("makeup_optid", "");
|
||||
bucket_map.put("makeup_optname", "");
|
||||
bucket_map.put("makeup_time", "");
|
||||
bucket_map.put("storagevehicle_id", "");
|
||||
bucket_map.put("storagevehicle_code", "");
|
||||
if (mst.getString("bill_type").equals("000302")) {
|
||||
bucket_map.put("quality_scode", "01");
|
||||
}
|
||||
WQLObject.getWQLObject("MD_PB_BucketRecord").update(bucket_map, "bucketunique = '" + row.get("bucketunique") + "' AND status = '02'");
|
||||
|
||||
JSONObject bucket_now = WQLObject.getWQLObject("MD_PB_BucketRecord").query("bucketunique = '" + row.get("bucketunique") + "' AND status = '01'").uniqueResult(0);
|
||||
if (mst.getString("bill_type").equals("000302")) {
|
||||
//插入桶物料变动记录表,加待检
|
||||
JSONObject change_jo = new JSONObject();
|
||||
change_jo.put("change_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
change_jo.put("bucket_code", bucket_now.get("bucketunique"));
|
||||
change_jo.put("material_id", bucket_now.get("material_id"));
|
||||
change_jo.put("pcsn", bucket_now.get("pcsn"));
|
||||
change_jo.put("ivt_level", bucket_now.get("ivt_level"));
|
||||
change_jo.put("quality_scode", "01");
|
||||
change_jo.put("qty_unit_id", bucket_now.get("qty_unit_id"));
|
||||
change_jo.put("qty_unit_name", bucket_now.get("qty_unit_name"));
|
||||
change_jo.put("change_type_scode", "01");
|
||||
change_jo.put("change_time", now);
|
||||
change_jo.put("rec_person", currentUserId);
|
||||
change_jo.put("change_qty", bucket_now.get("storage_qty"));
|
||||
change_jo.put("result_qty", bucket_now.get("storage_qty"));
|
||||
change.insert(change_jo);
|
||||
|
||||
//插入桶物料变动记录表,减不良
|
||||
JSONObject change_jo2 = new JSONObject();
|
||||
change_jo2.put("change_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
change_jo2.put("bucket_code", bucket_now.get("bucketunique"));
|
||||
change_jo2.put("material_id", bucket_now.get("material_id"));
|
||||
change_jo2.put("pcsn", bucket_now.get("pcsn"));
|
||||
change_jo2.put("quality_scode", "01");
|
||||
change_jo2.put("qty_unit_id", bucket_now.get("qty_unit_id"));
|
||||
change_jo2.put("qty_unit_name", bucket_now.get("qty_unit_name"));
|
||||
change_jo2.put("change_type_scode", "02");
|
||||
change_jo2.put("change_time", now);
|
||||
change_jo2.put("rec_person", currentUserId);
|
||||
change_jo2.put("change_qty", bucket_now.get("storage_qty"));
|
||||
change_jo2.put("result_qty", "0");
|
||||
change.insert(change_jo2);
|
||||
}
|
||||
//回写分配表数量
|
||||
double real_qty = -Double.parseDouble((String) row.get("real_qty"));
|
||||
if (NumberUtil.add(real_qty, dis.getDoubleValue("plan_qty")) <= 0) {
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDis").delete(dis);
|
||||
} else {
|
||||
dis.put("plan_qty", (dis.getDoubleValue("plan_qty") + real_qty) + "");
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDis").update(dis);
|
||||
}
|
||||
//回写明细表数量
|
||||
JSONObject dtl = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").query("iostorinvdtl_id ='" + row.get("iostorinvdtl_id") + "'").uniqueResult(0);
|
||||
double assign_qty = NumberUtil.add(dtl.getDoubleValue("assign_qty"), real_qty);
|
||||
dtl.put("assign_qty", assign_qty);
|
||||
double unassign_qty = dtl.getDoubleValue("plan_qty") - assign_qty;
|
||||
if (unassign_qty < 0) {
|
||||
unassign_qty = 0;
|
||||
}
|
||||
dtl.put("unassign_qty", unassign_qty + "");
|
||||
if (assign_qty > 0) {
|
||||
dtl.put("bill_status", "30");
|
||||
} else {
|
||||
dtl.put("bill_status", "10");
|
||||
}
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").update(dtl);
|
||||
|
||||
//更新主表状态
|
||||
JSONArray dtl_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").query("iostorinv_id = '" + row.get("iostorinv_id") + "' AND bill_status IN ('20','30')").getResultJSONArray(0);
|
||||
if (dtl_rows.size() > 0) {
|
||||
mst.put("bill_status", "30");
|
||||
} else {
|
||||
mst.put("bill_status", "10");
|
||||
}
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(mst);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getDisDtl(Map whereJson) {
|
||||
//查询该明细下的所有入库分配载具明细
|
||||
@@ -767,16 +664,6 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
return rows;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray bucketDtl(Map whereJson) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "6");
|
||||
map.put("storagevehicle_code", (String) whereJson.get("storagevehicle_code"));
|
||||
map.put("iostorinv_id", (String) whereJson.get("iostorinv_id"));
|
||||
JSONArray rows = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(map).process().getResultJSONArray(0);
|
||||
return rows;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject autoDis(JSONObject whereJson) {
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user