This commit is contained in:
2022-11-14 11:24:50 +08:00
parent 17853ca15e
commit e2ef7b21e8
6 changed files with 17 additions and 182 deletions

View File

@@ -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("变更任务")

View File

@@ -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);
}

View File

@@ -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) {
/*

View File

@@ -56,7 +56,7 @@
@change="hand"
>
<el-option
v-for="item in dict.product_status"
v-for="item in dict.cut_product_status"
:label="item.label"
:value="item.value"
/>
@@ -303,7 +303,7 @@ const defaultForm = {
}
export default {
name: 'Slittingproductionplan',
dicts: ['product_area', 'order_type', 'product_status', 'IS_OR_NOT', 'ware_house', 'paper_tube_or_frp'],
dicts: ['product_area', 'order_type', 'cut_product_status', 'IS_OR_NOT', 'ware_house', 'paper_tube_or_frp'],
components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
@@ -393,7 +393,7 @@ export default {
})
},
formatStatusName(row) {
return this.dict.label.product_status[row.status]
return this.dict.label.cut_product_status[row.status]
},
formatTypeName(row) {
return this.dict.label.order_type[row.order_type]

View File

@@ -55,10 +55,10 @@
@change="billTypeChange"
>
<el-option
v-for="item in billtypelist"
:key="item.code"
:label="item.name"
:value="item.code"
v-for="item in dict.ST_INV_IN_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
@@ -200,9 +200,9 @@ const defaultForm = {
export default {
name: 'AddDialog',
components: { crudOperation, AddDtl, MaterDtl },
components: { AddDtl, MaterDtl },
mixins: [crud(), form(defaultForm)],
dicts: ['io_bill_status', 'ST_QUALITY_SCODE', 'ST_IVT_LEVEL', 'is_used'],
dicts: ['io_bill_status', 'ST_QUALITY_SCODE', 'ST_INV_IN_TYPE'],
props: {
dialogShow: {
type: Boolean,
@@ -252,23 +252,11 @@ export default {
crudStorattr.getStor({ 'is_productstore': '1' }).then(res => {
this.storlist = res.content
})
/* // 获取单据类型
crudRawAssist.getType({ 'io_code': '0001', 'io_flag': '00' }).then(res => {
this.billtypelist = res
})*/
},
close() {
this.$emit('AddChanged')
},
[CRUD.HOOK.afterToEdit]() {
// 编辑时,给按钮的状态赋值
if (this.form.bill_type === '000101') {
this.bill_btn = false
this.mater_btn = true
} else if (this.form.bill_type === '000102') {
this.bill_btn = true
this.mater_btn = false
}
// 获取入库单明细
crudRawAssist.getIODtl({ 'bill_code': this.form.bill_code }).then(res => {
this.form.tableData = res

View File

@@ -96,10 +96,10 @@
@change="crud.toQuery"
>
<el-option
v-for="item in billtypelist"
:key="item.code"
:label="item.name"
:value="item.code"
v-for="item in dict.ST_INV_IN_TYPE"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
@@ -241,7 +241,7 @@ export default {
return CRUD({
title: '',
optShow: { add: true, reset: true },
query: { buss_type: '0001' },
query: { bill_type: '0001' },
idField: 'iostorinv_id',
url: '/api/in/rawAssist',
crudMethod: { ...rawAssist }
@@ -249,7 +249,7 @@ export default {
},
mixins: [presenter(), header(), crud()],
// 数据字典
dicts: ['io_bill_status', 'ST_CREATE_MODE'],
dicts: ['io_bill_status', 'ST_CREATE_MODE','ST_INV_IN_TYPE'],
data() {
return {
height: document.documentElement.clientHeight - 180 + 'px;',
@@ -271,7 +271,6 @@ export default {
bussConfig: null,
currentRow: null,
storlist: [],
billtypelist: [],
createtypelist: [],
statuslist: []
}
@@ -291,9 +290,6 @@ export default {
crudStorattr.getStor({ 'is_materialstore': '1' }).then(res => {
this.storlist = res.content
})
crudRawAssist.getType({ 'io_code': '0001', 'io_flag': '00' }).then(res => {
this.billtypelist = res
})
},
methods: {
fun(val) {
@@ -340,11 +336,7 @@ export default {
}
},
bill_typeFormat(row, column) {
for (const item of this.billtypelist) {
if (item.code == row.bill_type) {
return item.name
}
}
return this.dict.label.ST_INV_IN_TYPE[row.bill_type]
},
toView(index, row) {
this.mstrow = row