优化
This commit is contained in:
@@ -65,6 +65,14 @@
|
||||
WHERE
|
||||
1 = 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
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
@@ -37,32 +37,41 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
||||
public Map<String, Object> sendOutQuery(Map whereJson, Pageable page) {
|
||||
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)) {
|
||||
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)) {
|
||||
map.put("end_time", end_time.substring(0,10));
|
||||
}
|
||||
String pcsn = MapUtil.getStr(whereJson, "pcsn");
|
||||
if (!StrUtil.isEmpty(pcsn)) {
|
||||
String pcsn = map.get("pcsn");
|
||||
if (StrUtil.isNotEmpty(pcsn)) {
|
||||
map.put("pcsn", "%" + pcsn + "%");
|
||||
}
|
||||
String material_code = MapUtil.getStr(whereJson, "material_code");
|
||||
if (!StrUtil.isEmpty(material_code)) {
|
||||
String material_code = map.get("material_code");
|
||||
if (StrUtil.isNotEmpty(material_code)) {
|
||||
map.put("material_code", "%" + material_code + "%");
|
||||
}
|
||||
String workorder_code = MapUtil.getStr(whereJson, "workorder_code");
|
||||
if (!StrUtil.isEmpty(workorder_code)) {
|
||||
String workorder_code = map.get("workorder_code");
|
||||
if (StrUtil.isNotEmpty(workorder_code)) {
|
||||
map.put("workorder_code", "%" + workorder_code + "%");
|
||||
}
|
||||
|
||||
String send_name = MapUtil.getStr(whereJson, "send_name");
|
||||
if (!StrUtil.isEmpty(send_name)) {
|
||||
String send_name = map.get("send_name");
|
||||
if (StrUtil.isNotEmpty(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");
|
||||
JSONObject jo = WQL.getWO("statistical_report_query_02").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "send_date desc,material_code,pcsn");
|
||||
return jo;
|
||||
@@ -564,24 +573,24 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
||||
JSONObject jsonObject = (JSONObject)JSON.toJSON(raw);
|
||||
String storagevehicle_code = (String) jsonObject.get("storagevehicle_code");
|
||||
if (StrUtil.isEmpty(storagevehicle_code)) {
|
||||
throw new PdaRequestException("载具不能为空!");
|
||||
throw new BadRequestException("载具不能为空!");
|
||||
}
|
||||
if (StrUtil.isEmpty(jsonObject.getString("diskrecord_id"))) {
|
||||
throw new PdaRequestException("组盘记录不能为空");
|
||||
throw new BadRequestException("组盘记录不能为空");
|
||||
}
|
||||
// 仓位属性表【ST_IVT_StructAttr】
|
||||
WQLObject PDM_BI_ProcedureOffline = WQLObject.getWQLObject("PDM_BI_ProcedureOffline");
|
||||
|
||||
JSONObject jo = PDM_BI_ProcedureOffline.query("storagevehicle_code='"+storagevehicle_code+"'").uniqueResult(0);
|
||||
if(jo==null){
|
||||
throw new PdaRequestException("该载具"+storagevehicle_code+"无组盘记录!");
|
||||
throw new BadRequestException("该载具"+storagevehicle_code+"无组盘记录!");
|
||||
}
|
||||
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");
|
||||
if(!"1".equals(is_send)){
|
||||
throw new PdaRequestException("该载具"+storagevehicle_code+"状态不是已出库状态,不允许发货!");
|
||||
throw new BadRequestException("该载具"+storagevehicle_code+"状态不是已出库状态,不允许发货!");
|
||||
}
|
||||
String diskrecord_id = jsonObject.getString("diskrecord_id");
|
||||
HashMap<String,String> map = new HashMap<String,String>();
|
||||
|
||||
@@ -32,7 +32,8 @@
|
||||
输入.org_id TYPEAS s_string
|
||||
输入.workorder_code 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
|
||||
ENDOPTION
|
||||
OPTION 输入.pcsn <> ""
|
||||
procedureoffline.pcsn like 输入.pcsn
|
||||
workorder.pcsn like 输入.pcsn
|
||||
ENDOPTION
|
||||
OPTION 输入.material_code <> ""
|
||||
(mb.material_code like 输入.material_code or mb.material_name like 输入.material_code)
|
||||
@@ -249,8 +250,11 @@
|
||||
OPTION 输入.org_id <> ""
|
||||
workorder.org_id = 输入.org_id
|
||||
ENDOPTION
|
||||
OPTION 输入.is_send <> ""
|
||||
procedureoffline.is_send = 输入.is_send
|
||||
OPTION 输入.is_send0 <> ""
|
||||
(procedureoffline.is_send = 输入.is_send0 or procedureoffline.is_send is null)
|
||||
ENDOPTION
|
||||
OPTION 输入.is_send12 <> ""
|
||||
(procedureoffline.is_send = 输入.is_send12)
|
||||
ENDOPTION
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
|
||||
Reference in New Issue
Block a user