优化
This commit is contained in:
@@ -65,6 +65,14 @@
|
|||||||
WHERE
|
WHERE
|
||||||
1 = 1
|
1 = 1
|
||||||
AND workorder.is_out = '1'
|
AND workorder.is_out = '1'
|
||||||
|
AND workorder.workorder_id IN (
|
||||||
|
SELECT DISTINCT
|
||||||
|
( procedureoffline.workorder_id )
|
||||||
|
FROM
|
||||||
|
pdm_bi_procedureoffline procedureoffline
|
||||||
|
WHERE
|
||||||
|
1 = 1
|
||||||
|
AND procedureoffline.is_send='0')
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDPAGEQUERY
|
ENDPAGEQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|||||||
@@ -37,32 +37,41 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
|||||||
public Map<String, Object> sendOutQuery(Map whereJson, Pageable page) {
|
public Map<String, Object> sendOutQuery(Map whereJson, Pageable page) {
|
||||||
HashMap<String, String> map = new HashMap<>(whereJson);
|
HashMap<String, String> map = new HashMap<>(whereJson);
|
||||||
|
|
||||||
String begin_time = MapUtil.getStr(whereJson, "begin_time");
|
String begin_time = map.get("begin_time");
|
||||||
if (StrUtil.isNotEmpty(begin_time)) {
|
if (StrUtil.isNotEmpty(begin_time)) {
|
||||||
map.put("begin_time", begin_time.substring(0,10));
|
map.put("begin_time", begin_time.substring(0,10));
|
||||||
}
|
}
|
||||||
String end_time = MapUtil.getStr(whereJson, "end_time");
|
String end_time = map.get("end_time");
|
||||||
if (StrUtil.isNotEmpty(end_time)) {
|
if (StrUtil.isNotEmpty(end_time)) {
|
||||||
map.put("end_time", end_time.substring(0,10));
|
map.put("end_time", end_time.substring(0,10));
|
||||||
}
|
}
|
||||||
String pcsn = MapUtil.getStr(whereJson, "pcsn");
|
String pcsn = map.get("pcsn");
|
||||||
if (!StrUtil.isEmpty(pcsn)) {
|
if (StrUtil.isNotEmpty(pcsn)) {
|
||||||
map.put("pcsn", "%" + pcsn + "%");
|
map.put("pcsn", "%" + pcsn + "%");
|
||||||
}
|
}
|
||||||
String material_code = MapUtil.getStr(whereJson, "material_code");
|
String material_code = map.get("material_code");
|
||||||
if (!StrUtil.isEmpty(material_code)) {
|
if (StrUtil.isNotEmpty(material_code)) {
|
||||||
map.put("material_code", "%" + material_code + "%");
|
map.put("material_code", "%" + material_code + "%");
|
||||||
}
|
}
|
||||||
String workorder_code = MapUtil.getStr(whereJson, "workorder_code");
|
String workorder_code = map.get("workorder_code");
|
||||||
if (!StrUtil.isEmpty(workorder_code)) {
|
if (StrUtil.isNotEmpty(workorder_code)) {
|
||||||
map.put("workorder_code", "%" + workorder_code + "%");
|
map.put("workorder_code", "%" + workorder_code + "%");
|
||||||
}
|
}
|
||||||
|
String send_name = map.get("send_name");
|
||||||
String send_name = MapUtil.getStr(whereJson, "send_name");
|
if (StrUtil.isNotEmpty(send_name)) {
|
||||||
if (!StrUtil.isEmpty(send_name)) {
|
|
||||||
map.put("send_name", "%" + send_name + "%");
|
map.put("send_name", "%" + send_name + "%");
|
||||||
}
|
}
|
||||||
|
String is_send = map.get("is_send");
|
||||||
|
if (StrUtil.isNotEmpty(is_send)) {
|
||||||
|
if ("1,2".contains(is_send)) {
|
||||||
|
map.put("is_send12", is_send);
|
||||||
|
}
|
||||||
|
if ("0".equals(is_send)) {
|
||||||
|
map.put("is_send0", "0");
|
||||||
|
}
|
||||||
|
}else if (StrUtil.isEmpty(is_send)) {
|
||||||
|
map.put("is_send0", "0");
|
||||||
|
}
|
||||||
map.put("flag", "5");
|
map.put("flag", "5");
|
||||||
JSONObject jo = WQL.getWO("statistical_report_query_02").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "send_date desc,material_code,pcsn");
|
JSONObject jo = WQL.getWO("statistical_report_query_02").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "send_date desc,material_code,pcsn");
|
||||||
return jo;
|
return jo;
|
||||||
@@ -564,24 +573,24 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
|||||||
JSONObject jsonObject = (JSONObject)JSON.toJSON(raw);
|
JSONObject jsonObject = (JSONObject)JSON.toJSON(raw);
|
||||||
String storagevehicle_code = (String) jsonObject.get("storagevehicle_code");
|
String storagevehicle_code = (String) jsonObject.get("storagevehicle_code");
|
||||||
if (StrUtil.isEmpty(storagevehicle_code)) {
|
if (StrUtil.isEmpty(storagevehicle_code)) {
|
||||||
throw new PdaRequestException("载具不能为空!");
|
throw new BadRequestException("载具不能为空!");
|
||||||
}
|
}
|
||||||
if (StrUtil.isEmpty(jsonObject.getString("diskrecord_id"))) {
|
if (StrUtil.isEmpty(jsonObject.getString("diskrecord_id"))) {
|
||||||
throw new PdaRequestException("组盘记录不能为空");
|
throw new BadRequestException("组盘记录不能为空");
|
||||||
}
|
}
|
||||||
// 仓位属性表【ST_IVT_StructAttr】
|
// 仓位属性表【ST_IVT_StructAttr】
|
||||||
WQLObject PDM_BI_ProcedureOffline = WQLObject.getWQLObject("PDM_BI_ProcedureOffline");
|
WQLObject PDM_BI_ProcedureOffline = WQLObject.getWQLObject("PDM_BI_ProcedureOffline");
|
||||||
|
|
||||||
JSONObject jo = PDM_BI_ProcedureOffline.query("storagevehicle_code='"+storagevehicle_code+"'").uniqueResult(0);
|
JSONObject jo = PDM_BI_ProcedureOffline.query("storagevehicle_code='"+storagevehicle_code+"'").uniqueResult(0);
|
||||||
if(jo==null){
|
if(jo==null){
|
||||||
throw new PdaRequestException("该载具"+storagevehicle_code+"无组盘记录!");
|
throw new BadRequestException("该载具"+storagevehicle_code+"无组盘记录!");
|
||||||
}
|
}
|
||||||
if (!jo.getString("diskrecord_id").equals(jsonObject.getString("diskrecord_id"))){
|
if (!jo.getString("diskrecord_id").equals(jsonObject.getString("diskrecord_id"))){
|
||||||
throw new PdaRequestException("该载具"+storagevehicle_code+"对应编号不一致!");
|
throw new BadRequestException("该载具"+storagevehicle_code+"对应编号不一致!");
|
||||||
}
|
}
|
||||||
String is_send = jo.getString("is_send");
|
String is_send = jo.getString("is_send");
|
||||||
if(!"1".equals(is_send)){
|
if(!"1".equals(is_send)){
|
||||||
throw new PdaRequestException("该载具"+storagevehicle_code+"状态不是已出库状态,不允许发货!");
|
throw new BadRequestException("该载具"+storagevehicle_code+"状态不是已出库状态,不允许发货!");
|
||||||
}
|
}
|
||||||
String diskrecord_id = jsonObject.getString("diskrecord_id");
|
String diskrecord_id = jsonObject.getString("diskrecord_id");
|
||||||
HashMap<String,String> map = new HashMap<String,String>();
|
HashMap<String,String> map = new HashMap<String,String>();
|
||||||
|
|||||||
@@ -32,7 +32,8 @@
|
|||||||
输入.org_id TYPEAS s_string
|
输入.org_id TYPEAS s_string
|
||||||
输入.workorder_code TYPEAS s_string
|
输入.workorder_code TYPEAS s_string
|
||||||
输入.send_name TYPEAS s_string
|
输入.send_name TYPEAS s_string
|
||||||
输入.is_send TYPEAS s_string
|
输入.is_send0 TYPEAS s_string
|
||||||
|
输入.is_send12 TYPEAS s_string
|
||||||
|
|
||||||
|
|
||||||
[临时表]
|
[临时表]
|
||||||
@@ -235,7 +236,7 @@
|
|||||||
workorder.send_date <= 输入.end_time
|
workorder.send_date <= 输入.end_time
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
OPTION 输入.pcsn <> ""
|
OPTION 输入.pcsn <> ""
|
||||||
procedureoffline.pcsn like 输入.pcsn
|
workorder.pcsn like 输入.pcsn
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
OPTION 输入.material_code <> ""
|
OPTION 输入.material_code <> ""
|
||||||
(mb.material_code like 输入.material_code or mb.material_name like 输入.material_code)
|
(mb.material_code like 输入.material_code or mb.material_name like 输入.material_code)
|
||||||
@@ -249,8 +250,11 @@
|
|||||||
OPTION 输入.org_id <> ""
|
OPTION 输入.org_id <> ""
|
||||||
workorder.org_id = 输入.org_id
|
workorder.org_id = 输入.org_id
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
OPTION 输入.is_send <> ""
|
OPTION 输入.is_send0 <> ""
|
||||||
procedureoffline.is_send = 输入.is_send
|
(procedureoffline.is_send = 输入.is_send0 or procedureoffline.is_send is null)
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.is_send12 <> ""
|
||||||
|
(procedureoffline.is_send = 输入.is_send12)
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDPAGEQUERY
|
ENDPAGEQUERY
|
||||||
|
|||||||
@@ -97,7 +97,6 @@
|
|||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
style="width: 210px;"
|
style="width: 210px;"
|
||||||
@change="hand"
|
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in passList"
|
v-for="item in passList"
|
||||||
@@ -163,12 +162,7 @@ import crudInspectionsheetmst from '@/api/wms/ql/inspectionsheetmst'
|
|||||||
import CRUD, { presenter, header, crud } from '@crud/crud'
|
import CRUD, { presenter, header, crud } from '@crud/crud'
|
||||||
import rrOperation from '@crud/RR.operation'
|
import rrOperation from '@crud/RR.operation'
|
||||||
import crudOperation from '@crud/CRUD.operation'
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
import udOperation from '@crud/UD.operation'
|
|
||||||
import pagination from '@crud/Pagination'
|
import pagination from '@crud/Pagination'
|
||||||
import DateRangePicker from '@/components/DateRangePicker'
|
|
||||||
import AddDialog from '@/views/wms/ql/inspectionsheet/AddDialog'
|
|
||||||
import ResultPutDialog from '@/views/wms/ql/inspectionsheet/ResultPutDialog'
|
|
||||||
import Date from '@/utils/datetime'
|
|
||||||
import report from '@/api/wms/statistics/report'
|
import report from '@/api/wms/statistics/report'
|
||||||
import workorder from '@/api/wms/pdm/workorder'
|
import workorder from '@/api/wms/pdm/workorder'
|
||||||
|
|
||||||
@@ -187,7 +181,7 @@ export default {
|
|||||||
// 每页数据条数
|
// 每页数据条数
|
||||||
size: 20
|
size: 20
|
||||||
},
|
},
|
||||||
query: { is_send: '0' },
|
query: { is_send: '1' },
|
||||||
crudMethod: { ...crudInspectionsheetmst },
|
crudMethod: { ...crudInspectionsheetmst },
|
||||||
optShow: {
|
optShow: {
|
||||||
add: false,
|
add: false,
|
||||||
@@ -235,31 +229,10 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
report.confirmOutStore(this.checkrows).then(res => {
|
report.confirmOutStore(this.checkrows).then(res => {
|
||||||
if (res.code === '0') {
|
this.crud.notify('操作成功!')
|
||||||
this.crud.notify(res.desc, CRUD.NOTIFICATION_TYPE.ERROR)
|
|
||||||
} else {
|
|
||||||
this.crud.notify('操作完成', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
|
||||||
[CRUD.HOOK.beforeRefresh]() {
|
|
||||||
},
|
|
||||||
handleSelectionChange(val, row) {
|
|
||||||
if (val.length > 1) {
|
|
||||||
this.$refs.table.clearSelection()
|
|
||||||
this.$refs.table.toggleRowSelection(val.pop())
|
|
||||||
this.buttonChange(row)
|
|
||||||
} else if (val.length === 1) {
|
|
||||||
this.buttonChange(row)
|
|
||||||
} else {
|
|
||||||
this.handleCurrentChange(null)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onSelectAll() {
|
|
||||||
this.$refs.table.clearSelection()
|
|
||||||
},
|
|
||||||
orgFormat(row) {
|
orgFormat(row) {
|
||||||
for (const item of this.Depts) {
|
for (const item of this.Depts) {
|
||||||
if (item.id === row.org_id) {
|
if (item.id === row.org_id) {
|
||||||
@@ -267,14 +240,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
hand(value) {
|
|
||||||
this.crud.toQuery()
|
|
||||||
},
|
|
||||||
buttonChange(current) {
|
|
||||||
if (current !== null) {
|
|
||||||
this.currentRow = current
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onInput() {
|
onInput() {
|
||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
},
|
},
|
||||||
@@ -288,11 +253,6 @@ export default {
|
|||||||
}
|
}
|
||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
},
|
},
|
||||||
handleCurrentChange(current) {
|
|
||||||
if (current === null) {
|
|
||||||
this.currentRow = {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
formatStatus(row, column) {
|
formatStatus(row, column) {
|
||||||
for (const item of this.statusList) {
|
for (const item of this.statusList) {
|
||||||
if (item.value === row.bill_status) {
|
if (item.value === row.bill_status) {
|
||||||
@@ -305,17 +265,14 @@ export default {
|
|||||||
return '已发货'
|
return '已发货'
|
||||||
} else if (row.is_send === '1') {
|
} else if (row.is_send === '1') {
|
||||||
return '已出库'
|
return '已出库'
|
||||||
} else {
|
} else if (row.is_send === '0') {
|
||||||
return '未出库'
|
return '未出库'
|
||||||
|
} else{
|
||||||
|
return ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
stateFormat(row) {
|
stateFormat(row) {
|
||||||
return this.dict.label.workorder_status[row.workorder_status]
|
return this.dict.label.workorder_status[row.workorder_status]
|
||||||
},
|
|
||||||
querytable() {
|
|
||||||
this.onSelectAll()
|
|
||||||
this.crud.toQuery()
|
|
||||||
this.handleCurrentChange(null)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user