代码更新
This commit is contained in:
@@ -162,77 +162,9 @@ public class BigScreenServiceImpl implements BigScreenService {
|
||||
}
|
||||
|
||||
public JSONArray queryShivtquantity(Map<String, String> jsonObject) {
|
||||
//查询熟化区的入库转储任务
|
||||
JSONObject jo = new JSONObject();
|
||||
|
||||
//静止中
|
||||
JSONArray allrows = WQL.getWO("QST_BIG_SCREEN").addParam("flag", "11").process()
|
||||
JSONArray rows = WQL.getWO("QST_BIG_SCREEN").addParam("flag", "11").process()
|
||||
.getResultJSONArray(0);
|
||||
|
||||
//静止完成
|
||||
JSONArray allrows2 = WQL.getWO("QST_BIG_SCREEN").addParam("flag", "12").process()
|
||||
.getResultJSONArray(0);
|
||||
jo.put("allrows", allrows);
|
||||
jo.put("allrows2", allrows2);
|
||||
|
||||
Set<String> set = new HashSet<String>();
|
||||
JSONArray result = new JSONArray();
|
||||
for (int i = 0; i < allrows.size(); i++) {
|
||||
JSONObject outjo = allrows.getJSONObject(i);
|
||||
set.add(outjo.optString("label_code"));
|
||||
}
|
||||
for (int i = 0; i < allrows2.size(); i++) {
|
||||
JSONObject outjo = allrows2.getJSONObject(i);
|
||||
set.add(outjo.optString("label_code"));
|
||||
}
|
||||
|
||||
for (String label_code : set) {
|
||||
JSONObject materijo = new JSONObject();
|
||||
materijo.put("label_code", label_code);
|
||||
// 拿到物料编码去找 名称 跟出库 数
|
||||
for (int i = 0; i < allrows.size(); i++) {
|
||||
JSONObject outjo = allrows.getJSONObject(i);
|
||||
String out_material_code = outjo.optString("label_code");
|
||||
if (out_material_code.equals(label_code)) {
|
||||
materijo.put("formula", outjo.optString("formula"));
|
||||
materijo.put("pcsn", outjo.optString("pcsn"));
|
||||
materijo.put("label_code", outjo.optString("label_code"));
|
||||
materijo.put("sewting_quantity", outjo.optString("sewting_quantity"));
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < allrows2.size(); i++) {
|
||||
JSONObject injo = allrows2.getJSONObject(i);
|
||||
String in_material_code = injo.optString("label_code");
|
||||
if (in_material_code.equals(label_code)) {
|
||||
materijo.put("formula", injo.optString("formula"));
|
||||
materijo.put("pcsn", injo.optString("pcsn"));
|
||||
materijo.put("label_code", injo.optString("label_code"));
|
||||
materijo.put("finished_quantity", injo.optString("finished_quantity"));
|
||||
}
|
||||
}
|
||||
// 判断materijo 里面有没有出入库数,没有给0
|
||||
if (!materijo.has("sewting_quantity")) {
|
||||
materijo.put("sewting_quantity", "0");
|
||||
}
|
||||
if (!materijo.has("finished_quantity")) {
|
||||
materijo.put("finished_quantity", "0");
|
||||
}
|
||||
result.add(materijo);
|
||||
}
|
||||
JSONArray rows = new JSONArray();
|
||||
for (int i = 0; i < result.size(); i++) {
|
||||
JSONObject row = new JSONObject();
|
||||
JSONObject resultrow = result.getJSONObject(i);
|
||||
String label_code = resultrow.optString("label_code");
|
||||
String material_name = label_code.substring(label_code.length() - 4);
|
||||
String material_code = label_code.substring(label_code.length() - 4);
|
||||
resultrow.put("material_name", material_name);
|
||||
resultrow.put("material_code", material_code);
|
||||
resultrow.put("pcsn", resultrow.optString("pcsn"));
|
||||
resultrow.put("formula", resultrow.optString("formula"));
|
||||
rows.add(resultrow);
|
||||
}
|
||||
|
||||
return rows;
|
||||
}
|
||||
|
||||
@@ -249,7 +181,7 @@ public class BigScreenServiceImpl implements BigScreenService {
|
||||
if (StrUtil.isNotEmpty(labeldtl_uuid)) {
|
||||
JSONObject jsonObject1 = materialLabelDtlTab.query("labeldtl_uuid = '" + labeldtl_uuid + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonObject1)) {
|
||||
JSONObject labelObj = WQL.getWO("QST_BIG_SCREEN").addParam("flag", "13").addParam("labeldtl_uuid", labeldtl_uuid).process().uniqueResult(0);
|
||||
JSONObject labelObj = WQL.getWO("QST_BIG_SCREEN").addParam("flag", "12").addParam("labeldtl_uuid", labeldtl_uuid).process().uniqueResult(0);
|
||||
//配方-批次-重量(YC-B8-1000)
|
||||
String material_ivt_info = labelObj.getString("formula") + "-" + labelObj.getString("pcsn") + "-" + labelObj.getString("weight");
|
||||
json.put("material_ivt_info", material_ivt_info);
|
||||
@@ -356,12 +288,12 @@ public class BigScreenServiceImpl implements BigScreenService {
|
||||
JSONArray ja = WQL.getWO("QST_BIG_SCREEN").addParamMap(hashMap).process().getResultJSONArray(0);
|
||||
for (int i = 0; i < ja.size(); i++) {
|
||||
JSONObject jo = ja.getJSONObject(i);
|
||||
String label_code = jo.optString("label_code");
|
||||
/*String label_code = jo.optString("label_code");
|
||||
String flag = label_code.substring(label_code.length() - 4);
|
||||
String material_name = flag;
|
||||
String material_code = flag;
|
||||
jo.put("material_name", material_name);
|
||||
jo.put("material_code", material_code);
|
||||
jo.put("material_code", material_code);*/
|
||||
jo.put("formula", jo.optString("formula"));
|
||||
jo.put("pcsn", jo.optString("pcsn"));
|
||||
rows.add(jo);
|
||||
@@ -382,7 +314,7 @@ public class BigScreenServiceImpl implements BigScreenService {
|
||||
if (StrUtil.isNotEmpty(labeldtl_uuid)) {
|
||||
JSONObject jsonObject1 = materialLabelDtlTab.query("labeldtl_uuid = '" + labeldtl_uuid + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(jsonObject1)) {
|
||||
JSONObject labelObj = WQL.getWO("QST_BIG_SCREEN").addParam("flag", "13").addParam("labeldtl_uuid", labeldtl_uuid).process().uniqueResult(0);
|
||||
JSONObject labelObj = WQL.getWO("QST_BIG_SCREEN").addParam("flag", "12").addParam("labeldtl_uuid", labeldtl_uuid).process().uniqueResult(0);
|
||||
//配方-批次-重量(YC-B8-1000)
|
||||
String material_ivt_info = labelObj.getString("formula") + "-" + labelObj.getString("pcsn") + "-" + labelObj.getString("weight");
|
||||
json.put("material_ivt_info", material_ivt_info);
|
||||
|
||||
@@ -95,7 +95,7 @@ IF 输入.flag = "2"
|
||||
max( material.material_name ) AS material_name,
|
||||
round (sum( ivtflow.change_qty ),0 )AS out_quantity
|
||||
FROM
|
||||
st_vt_structivtflow ivtflow
|
||||
st_ivt_structIvtFlow ivtflow
|
||||
left join sch_base_point point on point.point_uuid = ivtflow.struct_uuid
|
||||
left join md_base_material material on material.material_uuid=ivtflow.material_uuid
|
||||
|
||||
@@ -125,7 +125,7 @@ IF 输入.flag = "3"
|
||||
max( material.material_name ) AS material_name,
|
||||
round (sum( ivtflow.change_qty ),0 )AS in_quantity
|
||||
FROM
|
||||
st_vt_structivtflow ivtflow
|
||||
st_ivt_structIvtFlow ivtflow
|
||||
left join sch_base_point point on point.point_uuid = ivtflow.struct_uuid
|
||||
left join md_base_material material on material.material_uuid=ivtflow.material_uuid
|
||||
|
||||
@@ -272,7 +272,7 @@ IF 输入.flag = "3"
|
||||
max( material.material_code ) AS material_code,
|
||||
round (sum( ivtflow.change_qty ),0) AS out_quantity
|
||||
FROM
|
||||
st_vt_structivtflow ivtflow
|
||||
st_ivt_structIvtFlow ivtflow
|
||||
left join sch_base_point point on point.point_uuid = ivtflow.struct_uuid
|
||||
left join md_base_material material on material.material_uuid=ivtflow.material_uuid
|
||||
|
||||
@@ -300,7 +300,7 @@ IF 输入.flag = "8"
|
||||
max( material.material_code ) AS material_code,
|
||||
round (sum( ivtflow.change_qty ) ,0)AS in_quantity
|
||||
FROM
|
||||
st_vt_structivtflow ivtflow
|
||||
st_ivt_structIvtFlow ivtflow
|
||||
left join sch_base_point point on point.point_uuid = ivtflow.struct_uuid
|
||||
left join md_base_material material on material.material_uuid=ivtflow.material_uuid
|
||||
|
||||
@@ -323,19 +323,16 @@ IF 输入.flag = "8"
|
||||
IF 输入.flag = "9"
|
||||
QUERY
|
||||
SELECT
|
||||
max( ivt.label_code ) AS label_code,
|
||||
round( sum( ivt.canuse_qty ), 0 ) AS total_quantity,
|
||||
mst.formula,
|
||||
mst.pcsn
|
||||
sum(1) AS total_quantity,
|
||||
concat(mst.formula,'-',mst.pcsn) as material_ivt_info
|
||||
FROM
|
||||
st_ivt_structivt ivt
|
||||
LEFT JOIN sch_base_point point ON point.point_uuid = ivt.struct_uuid
|
||||
LEFT JOIN md_base_materialLabelMst mst ON ivt.label_uuid = ivt.label_uuid
|
||||
LEFT JOIN md_base_materialLabelMst mst ON mst.label_uuid = ivt.label_uuid
|
||||
WHERE
|
||||
point.area_type IN ( 03 )
|
||||
point.area_type IN ( '03' )
|
||||
GROUP BY
|
||||
mst.formula,
|
||||
mst.pcsn ,ivt.label_code
|
||||
mst.formula,mst.pcsn
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -376,45 +373,25 @@ IF 输入.flag = "8"
|
||||
|
||||
IF 输入.flag = "11"
|
||||
QUERY
|
||||
SELECT
|
||||
round ( sum( ivt.canuse_qty ), 0 ) AS sewting_quantity,
|
||||
ivt.label_code,
|
||||
mst.formula,
|
||||
mst.pcsn
|
||||
FROM
|
||||
st_ivt_structivt ivt
|
||||
LEFT JOIN sch_base_point point ON point.point_uuid = ivt.struct_uuid
|
||||
LEFT JOIN md_base_materialLabelMst mst ON ivt.label_uuid = ivt.label_uuid
|
||||
WHERE
|
||||
TIMESTAMPDIFF( HOUR, ivt.instorage_time, now( ) ) < ivt.stand_hour
|
||||
AND point.area_type IN ( '01', '02' )
|
||||
GROUP BY
|
||||
mst.formula, mst.pcsn,ivt.label_code
|
||||
SELECT
|
||||
sum( CASE WHEN TIMESTAMPDIFF( HOUR, ivt.instorage_time, now( ) ) >= ivt.stand_hour THEN 1 ELSE 0 END ) AS sewting_quantity,
|
||||
sum( CASE WHEN TIMESTAMPDIFF( HOUR, ivt.instorage_time, now( ) ) < ivt.stand_hour THEN 1 ELSE 0 END ) AS finish_quantity,
|
||||
concat(mst.formula,'-',mst.pcsn) as material_ivt_info
|
||||
FROM
|
||||
st_ivt_structivt ivt
|
||||
LEFT JOIN sch_base_point point ON point.point_uuid = ivt.struct_uuid
|
||||
LEFT JOIN md_base_materialLabelMst mst ON mst.label_uuid = ivt.label_uuid
|
||||
WHERE
|
||||
TIMESTAMPDIFF( HOUR, ivt.instorage_time, now( ) ) >= ivt.stand_hour
|
||||
AND point.area_type IN ( '01', '02' )
|
||||
GROUP BY
|
||||
mst.formula,mst.pcsn
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "12"
|
||||
QUERY
|
||||
SELECT
|
||||
round ( sum( ivt.canuse_qty ), 0 ) AS finished_quantity,
|
||||
ivt.label_code,
|
||||
mst.formula,
|
||||
mst.pcsn
|
||||
FROM
|
||||
st_ivt_structivt ivt
|
||||
LEFT JOIN sch_base_point point ON point.point_uuid = ivt.struct_uuid
|
||||
LEFT JOIN md_base_materialLabelMst mst ON ivt.label_uuid = ivt.label_uuid
|
||||
WHERE
|
||||
TIMESTAMPDIFF( HOUR, ivt.instorage_time, now( ) ) >= ivt.stand_hour
|
||||
AND point.area_type IN ( '01', '02' )
|
||||
GROUP BY
|
||||
mst.formula,mst.pcsn,ivt.label_code
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "13"
|
||||
IF 输入.flag = "12"
|
||||
QUERY
|
||||
SELECT
|
||||
mst.material_uuid,
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -55,8 +55,8 @@ public class StoreIvtServiceImpl {
|
||||
param.put("change_qty", change_qty);
|
||||
param.put("struct_uuid", struct_uuid);
|
||||
param.put("change_type", changeType.getIndex());
|
||||
// 仓位库存变动记录表【st_vt_structIvtFlow】
|
||||
WQLObject ivtFlowTab = WQLObject.getWQLObject("st_vt_structIvtFlow");
|
||||
// 仓位库存变动记录表【st_ivt_structIvtFlow】
|
||||
WQLObject ivtFlowTab = WQLObject.getWQLObject("st_ivt_structIvtFlow");
|
||||
ivtFlowTab.insert(param);
|
||||
// 根据变动记录改变仓位库存
|
||||
param.put("vehicle_code", vehicle_code);
|
||||
|
||||
Binary file not shown.
@@ -7,12 +7,11 @@ spring:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
##url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.57}:${DB_PORT:3306}/${DB_NAME:ch_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:ch_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:ch_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
|
||||
username: ${DB_USER:root}
|
||||
##username: ${DB_USER:root}
|
||||
##password: ${DB_PWD:dzhdghmt0617}
|
||||
##password: ${DB_PWD:Root.123456}
|
||||
password: ${DB_PWD:root}
|
||||
password: ${DB_PWD:Root.123456}
|
||||
# 初始连接数dataSource-1
|
||||
initial-size: 5
|
||||
# 最小连接数
|
||||
|
||||
Reference in New Issue
Block a user