diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/dp/service/imp/BigScreenServiceImpl.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/dp/service/imp/BigScreenServiceImpl.java index 0fa9417..1c09d43 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/dp/service/imp/BigScreenServiceImpl.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/dp/service/imp/BigScreenServiceImpl.java @@ -162,77 +162,9 @@ public class BigScreenServiceImpl implements BigScreenService { } public JSONArray queryShivtquantity(Map 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 set = new HashSet(); - 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); diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/dp/wql/QST_BIG_SCREEN.wql b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/dp/wql/QST_BIG_SCREEN.wql index 2c42520..41e3639 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/dp/wql/QST_BIG_SCREEN.wql +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/dp/wql/QST_BIG_SCREEN.wql @@ -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, diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/md/wql/md.xls b/wms/hd/nladmin-system/src/main/java/org/nl/wms/md/wql/md.xls index fe64924..ec5d85d 100644 Binary files a/wms/hd/nladmin-system/src/main/java/org/nl/wms/md/wql/md.xls and b/wms/hd/nladmin-system/src/main/java/org/nl/wms/md/wql/md.xls differ diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/wql/pdm.xls b/wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/wql/pdm.xls index e75cc32..fe34b85 100644 Binary files a/wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/wql/pdm.xls and b/wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/wql/pdm.xls differ diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/wql/sch.xls b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/wql/sch.xls index 63d4bd2..62535fd 100644 Binary files a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/wql/sch.xls and b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/wql/sch.xls differ diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/ivt/StoreInventoryServiceImpl.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/ivt/StoreInventoryServiceImpl.java deleted file mode 100644 index 35c61ad..0000000 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/ivt/StoreInventoryServiceImpl.java +++ /dev/null @@ -1,2435 +0,0 @@ -/* -package org.nl.wms.st.ivt; - -import com.noblelift.imp.platform.core.util.JSONArraySort; -import com.noblelift.imp.platform.core.util.WdkUtil; -import com.noblelift.imp.products.mes.api.st.ivt.StoreInventoryService; -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; - -import java.math.BigDecimal; -import java.util.HashMap; - -import org.wdk.WDK; -import org.wdk.core.bean.ServiceResultBean; -import org.wdk.core.bean.WDKException; -import org.wdk.core.env.context.ServiceContext; -import org.wdk.core.spring.SpringContext; -import org.wdk.core.spring.annotation.WDKTransaction; -import org.wdk.core.util.uMath; -import org.wdk.core.util.uString; -import org.wdk.core.wql.core.bean.ResultBean; -import org.wdk.core.wql.core.bean.WQLObject; - -*/ -/** - * Description : com.noblelift.imp.products.mes.service.st.ivt - * Time : 15:26 - * - * @author : hz_hews - * @date : 2019-02-02 - *//* - -public class StoreInventoryServiceImpl implements StoreInventoryService { - - - */ -/** - * STACKIVTFLOW_TABLE 仓位库存变动表 - *//* - - private static final String STIVTSTACKIVTFLOW_TABLE = "ST_IVT_StructIvtflow"; - */ -/** - * ST_IVT_OrgIvt 组织库存表 - *//* - - private static final String STIVTORGIVT_TABLE = "ST_IVT_OrgIvt"; - */ -/** - * ST_IVT_StorIvt 仓库库存表 - *//* - - private static final String STIVTSTORIVT_TABLE = "ST_IVT_StorIvt"; - */ -/** - * ST_IVT_StructIvt 仓位库存表 - *//* - - private static final String STIVTSTACKIVT_TABLE = "ST_IVT_StructIvt"; - - - */ -/** - * STOREIVTFLOW_TABLE 仓库库存变动表 - *//* - - private static final String STIVTSTORIVTFLOW_TABLE = "st_ivt_storivtflow"; - - */ -/** - * ORGIVTFLOW_TABLE 组织库存变动表 - *//* - - private static final String STIVTORGIVTFLOW_TABLE = "st_ivt_orgivtflow"; - - - */ -/** - * 库存变动 - * - * @param context 上下文 - * @param op_account_uuid 操作账号标识 - * @param op_person_uuid 操作员标识 - * @param bizinv_info 待变动信息 - * @param bizinv_dtl_info 待变动明细信息 - * @return - *//* - - @WDKTransaction - @Override - public ServiceResultBean doInvIvtChange(ServiceContext context, String op_account_uuid, String op_person_uuid, JSONObject bizinv_info, JSONArray bizinv_dtl_info) { - StoreInventoryService custInventoryService = (StoreInventoryService)SpringContext.getBean("service.st.ivt.storeinventory"); - ServiceResultBean serviceResultBean = new ServiceResultBean(); - if(bizinv_info==null||bizinv_info.isNullObject()) throw new WDKException("[待变动信息]不能为空"); - if(bizinv_dtl_info==null||bizinv_dtl_info.isEmpty()||bizinv_dtl_info.size()==0) throw new WDKException("[待变动明细信息]不能为空"); - String quality_scode = bizinv_info.optString("quality_scode");//品质类型 - if(uString.isBlank(quality_scode)) quality_scode="01"; - String iostorinv_uuid = bizinv_info.optString("iostorinv_uuid"); - if(uString.isBlank(iostorinv_uuid)) throw new WDKException("[单据标识]不能为空"); - String bill_type = bizinv_info.optString("bill_type"); - if(uString.isBlank(bill_type)) throw new WDKException("[单据类型]不能为空"); - String change_type_scode = bizinv_info.optString("change_type_scode"); - if(uString.isBlank(change_type_scode)) throw new WDKException("[变动方式]不能为空"); - String is_backout = bizinv_info.optString("is_backout"); - if(uString.isBlank(is_backout)) throw new WDKException("[是否回退]不能为空"); - String bill_status = bizinv_info.optString("bill_status"); - if(uString.isBlank(bill_status)) throw new WDKException("[单据状态]不能为空"); - String source_uuid = bizinv_info.optString("source_uuid"); - //if(uString.isBlank(source_uuid)) throw new WDKException("[来源方标识]不能为空"); - String source_name = bizinv_info.optString("source_name"); - - for(int i=0;i0 - // unit_uuid(计量单位) 有效性校验 - - - //三、处理 - //对bizinv_dtl_info数据按“product_uuid”进行排序 - JSONArraySort.sort(bizinv_dtl_info, "material_code"); - for (int i = 0; i < bizinv_dtl_info.size(); i++) { - JSONObject dtlObject = bizinv_dtl_info.getJSONObject(i); - - dtlObject.put("org_uuid", bizinv_info.optString("org_uuid")); - dtlObject.put("source_uuid", source_uuid); //设置商家标识 - dtlObject.put("is_backout", is_backout); //设置是否回退 - dtlObject.put("bill_type_scode", bill_type); //设置单据类型 - dtlObject.put("quality_scode", quality_scode); //品质类型 - - dtlObject.put("change_qty", dtlObject.optString("change_qty"));//可用数变动数量 - dtlObject.put("changecanuse_qty", dtlObject.optString("changecanuse_qty"));//库存数变动数量 - dtlObject.put("change_num", dtlObject.optString("change_num"));//可用数变动数量 - dtlObject.put("changecanuse_num", dtlObject.optString("changecanuse_num"));//库存数变动数量 - - dtlObject.put("stor_uuid", bizinv_info.optString("stor_uuid")); - dtlObject.put("stor_name", bizinv_info.optString("stor_name")); - - //库存变动痕迹 - JSONObject change_info = new JSONObject(); - change_info.put("iostorinv_uuid",iostorinv_uuid); - change_info.put("org_uuid", bizinv_info.optString("org_uuid")); - change_info.put("bill_type_scode",bill_type); - change_info.put("inv_uuid",dtlObject.optString("iostorinv_dtluuid")); - change_info.put("change_type",change_type_scode); - change_info.put("change_type_scode",change_type_scode); - change_info.put("is_backout",is_backout); - change_info.put("source_uuid",source_uuid); - change_info.put("source_uuid",source_uuid); - change_info.put("source_name",source_name); - change_info.put("struct_uuid",dtlObject.optString("struct_uuid")); - change_info.put("struct_name",dtlObject.optString("struct_name")); - change_info.put("stack_uuid",dtlObject.optString("struct_uuid")); - change_info.put("stor_uuid", bizinv_info.optString("stor_uuid")); - change_info.put("stor_name", bizinv_info.optString("stor_name")); - change_info.put("material_uuid",dtlObject.optString("material_uuid")); - change_info.put("material_code",dtlObject.optString("material_code")); - change_info.put("material_name",dtlObject.optString("material_name")); - if(uString.isBlank(dtlObject.optString("pcsn"))){ - dtlObject.put("pcsn","00000000"); - } - change_info.put("pcsn",dtlObject.optString("pcsn")); - if(uString.isBlank(dtlObject.optString("order_code"))){ - dtlObject.put("order_code","00000000"); - } - change_info.put("order_code",dtlObject.optString("order_code")); - if(uString.isBlank(dtlObject.optString("work_seq"))){ - dtlObject.put("work_seq","00000000"); - } - change_info.put("work_seq",dtlObject.optString("work_seq")); - if(uString.isBlank(dtlObject.optString("workflow_code"))){ - dtlObject.put("workflow_code","00000000"); - } - change_info.put("workflow_code",dtlObject.optString("workflow_code")); - - change_info.put("qty",dtlObject.optString("qty")); - change_info.put("real_qty",dtlObject.optString("real_qty")); - change_info.put("base_qty",dtlObject.optString("base_qty")); - change_info.put("assist_qty",dtlObject.optString("assist_qty")); - change_info.put("qty_unit_uuid",dtlObject.optString("qty_unit_uuid")); - change_info.put("qty_unit_name",dtlObject.optString("qty_unit_name")); - change_info.put("num",dtlObject.optString("num")); - change_info.put("real_num",dtlObject.optString("real_num")); - change_info.put("base_num",dtlObject.optString("base_num")); - change_info.put("assist_num",dtlObject.optString("assist_num")); - change_info.put("num_unit_uuid",dtlObject.optString("num_unit_uuid")); - change_info.put("num_unit_name",dtlObject.optString("num_unit_name")); - - -//操作记录此次先不做 - String change_type = change_type_scode; - switch (change_type_scode) { - case "11": - //变动方式 变动方式: '+' 、 '-'、'++'、'+-'、'--'、'-+' - change_info.put("change_mode","-"); - //扣减可用 - serviceResultBean = custInventoryService.minusCanuseQty(context, op_account_uuid, op_person_uuid,change_type_scode, dtlObject); - if (!serviceResultBean.isSuccess()) - throw new WDKException("减可用失败"); - change_info.put("change_qty", serviceResultBean.getParam("change_qty")); - change_info.put("changecanuse_qty", serviceResultBean.getParam("changecanuse_qty")); - change_info.put("change_num", serviceResultBean.getParam("change_num")); - change_info.put("changecanuse_num", serviceResultBean.getParam("changecanuse_num")); - - */ -/* //库存台账 - ledger_info.put("in_qty","0");//入库数量 in_qty - ledger_info.put("in_amt","0");//入库金额 in_amt - ledger_info.put("out_qty",serviceResultBean.getParam("change_biz_qty"));//出库数量 out_qty - ledger_info.put("out_amt",serviceResultBean.getParam("change_stock_amt"));//出库金额 out_amt - ledger_info.put("stor_qty",serviceResultBean.getParam("after_biz_qty"));//结存数量 stor_qty - ledger_info.put("stor_amt",serviceResultBean.getParam("after_stock_amt"));//结存金额 stor_amt - ledger_info.put("remark","出库减库存" + dtlObject.optString("biz_inv_dtl_uuid"));//摘要 remark - *//* - serviceResultBean = custInventoryService.recInventoryTrace(context, op_account_uuid, op_person_uuid,change_type, change_info); - if (!serviceResultBean.isSuccess()) - throw new WDKException("存变动记录更新失败"); - break; - case "12": - //增加可用 - //变动方式 变动方式: '+' 、 '-'、'++'、'+-'、'--'、'-+' - change_info.put("change_mode","+"); - serviceResultBean = addCanuseQty(context, op_account_uuid, op_person_uuid, change_type, dtlObject); - if (!serviceResultBean.isSuccess()) - throw new WDKException("加可用失败"); - change_info.put("change_qty", serviceResultBean.getParam("change_qty")); - change_info.put("changecanuse_qty", serviceResultBean.getParam("changecanuse_qty")); - change_info.put("change_num", serviceResultBean.getParam("change_num")); - change_info.put("changecanuse_num", serviceResultBean.getParam("changecanuse_num")); - */ -/* //库存台账 - ledger_info.put("in_qty","0");//入库数量 in_qty - ledger_info.put("in_amt","0");//入库金额 in_amt - ledger_info.put("out_qty",serviceResultBean.getParam("change_biz_qty"));//出库数量 out_qty - ledger_info.put("out_amt",serviceResultBean.getParam("change_stock_amt"));//出库金额 out_amt - ledger_info.put("stor_qty",serviceResultBean.getParam("after_biz_qty"));//结存数量 stor_qty - ledger_info.put("stor_amt",serviceResultBean.getParam("after_stock_amt"));//结存金额 stor_amt - ledger_info.put("remark","出库减库存" + dtlObject.optString("biz_inv_dtl_uuid"));//摘要 remark - *//* - - serviceResultBean = custInventoryService.recInventoryTrace(context, op_account_uuid, op_person_uuid,change_type, change_info); - if (!serviceResultBean.isSuccess()) - throw new WDKException("存变动记录更新失败"); - break; - case "13": - //刷新可用 - //变动方式 变动方式: '+' 、 '-'、'++'、'+-'、'--'、'-+' - change_info.put("change_mode","-+"); - serviceResultBean = reflushCanuseQty(context, op_account_uuid, op_person_uuid, change_type, dtlObject); - if (!serviceResultBean.isSuccess()) - throw new WDKException("刷新可用失败"); - change_info.put("change_qty", serviceResultBean.getParam("change_qty")); - change_info.put("changecanuse_qty", serviceResultBean.getParam("changecanuse_qty")); - change_info.put("change_num", serviceResultBean.getParam("change_num")); - change_info.put("changecanuse_num", serviceResultBean.getParam("changecanuse_num")); - */ -/* //库存台账 - ledger_info.put("in_qty","0");//入库数量 in_qty - ledger_info.put("in_amt","0");//入库金额 in_amt - ledger_info.put("out_qty",serviceResultBean.getParam("change_biz_qty"));//出库数量 out_qty - ledger_info.put("out_amt",serviceResultBean.getParam("change_stock_amt"));//出库金额 out_amt - ledger_info.put("stor_qty",serviceResultBean.getParam("after_biz_qty"));//结存数量 stor_qty - ledger_info.put("stor_amt",serviceResultBean.getParam("after_stock_amt"));//结存金额 stor_amt - ledger_info.put("remark","出库减库存" + dtlObject.optString("biz_inv_dtl_uuid"));//摘要 remark - *//* - serviceResultBean = custInventoryService.recInventoryTrace(context, op_account_uuid, op_person_uuid,change_type, change_info); - if (!serviceResultBean.isSuccess()) - throw new WDKException("存变动记录更新失败"); - break; - case "21": - //减库存 - //变动方式 变动方式: '+' 、 '-'、'++'、'+-'、'--'、'-+' - change_info.put("change_mode","-"); - serviceResultBean = custInventoryService.minusIvtQty(context, op_account_uuid, op_person_uuid,change_type, dtlObject); - if (!serviceResultBean.isSuccess()) - throw new WDKException("减库存失败"); - change_info.put("change_qty", serviceResultBean.getParam("change_qty")); - change_info.put("changecanuse_qty", serviceResultBean.getParam("changecanuse_qty")); - change_info.put("change_num", serviceResultBean.getParam("change_num")); - change_info.put("changecanuse_num", serviceResultBean.getParam("changecanuse_num")); - */ -/* //库存台账 - ledger_info.put("in_qty","0");//入库数量 in_qty - ledger_info.put("in_amt","0");//入库金额 in_amt - ledger_info.put("out_qty",serviceResultBean.getParam("change_biz_qty"));//出库数量 out_qty - ledger_info.put("out_amt",serviceResultBean.getParam("change_stock_amt"));//出库金额 out_amt - ledger_info.put("stor_qty",serviceResultBean.getParam("after_biz_qty"));//结存数量 stor_qty - ledger_info.put("stor_amt",serviceResultBean.getParam("after_stock_amt"));//结存金额 stor_amt - ledger_info.put("remark","出库减库存" + dtlObject.optString("biz_inv_dtl_uuid"));//摘要 remark - *//* - serviceResultBean = custInventoryService.recInventoryTrace(context, op_account_uuid, op_person_uuid,change_type, change_info); - if (!serviceResultBean.isSuccess()) - throw new WDKException("存变动记录更新失败"); - break; - case "22": - //加库存 - //变动方式 变动方式: '+' 、 '-'、'++'、'+-'、'--'、'-+' - change_info.put("change_mode","+"); - serviceResultBean = addIvtQty(context, op_account_uuid, op_person_uuid, change_type, dtlObject); - if (!serviceResultBean.isSuccess()) - throw new WDKException("加库存失败"); - change_info.put("change_qty", serviceResultBean.getParam("change_qty")); - change_info.put("changecanuse_qty", serviceResultBean.getParam("changecanuse_qty")); - change_info.put("change_num", serviceResultBean.getParam("change_num")); - change_info.put("changecanuse_num", serviceResultBean.getParam("changecanuse_num")); - */ -/* //库存台账 - ledger_info.put("in_qty","0");//入库数量 in_qty - ledger_info.put("in_amt","0");//入库金额 in_amt - ledger_info.put("out_qty",serviceResultBean.getParam("change_biz_qty"));//出库数量 out_qty - ledger_info.put("out_amt",serviceResultBean.getParam("change_stock_amt"));//出库金额 out_amt - ledger_info.put("stor_qty",serviceResultBean.getParam("after_biz_qty"));//结存数量 stor_qty - ledger_info.put("stor_amt",serviceResultBean.getParam("after_stock_amt"));//结存金额 stor_amt - ledger_info.put("remark","出库减库存" + dtlObject.optString("biz_inv_dtl_uuid"));//摘要 remark - *//* - serviceResultBean = custInventoryService.recInventoryTrace(context, op_account_uuid, op_person_uuid,change_type, change_info); - if (!serviceResultBean.isSuccess()) - throw new WDKException("存变动记录更新失败"); - break; - case "23": - //同时加 - //变动方式 变动方式: '+' 、 '-'、'++'、'+-'、'--'、'-+' - change_info.put("change_mode","++"); - serviceResultBean = addBothQty(context, op_account_uuid, op_person_uuid, change_type, dtlObject); - if (!serviceResultBean.isSuccess()) - throw new WDKException("加库存加可用失败"); - change_info.put("change_qty", serviceResultBean.getParam("change_qty")); - change_info.put("changecanuse_qty", serviceResultBean.getParam("changecanuse_qty")); - change_info.put("change_num", serviceResultBean.getParam("change_num")); - change_info.put("changecanuse_num", serviceResultBean.getParam("changecanuse_num")); - */ -/* //库存台账 - ledger_info.put("in_qty","0");//入库数量 in_qty - ledger_info.put("in_amt","0");//入库金额 in_amt - ledger_info.put("out_qty",serviceResultBean.getParam("change_biz_qty"));//出库数量 out_qty - ledger_info.put("out_amt",serviceResultBean.getParam("change_stock_amt"));//出库金额 out_amt - ledger_info.put("stor_qty",serviceResultBean.getParam("after_biz_qty"));//结存数量 stor_qty - ledger_info.put("stor_amt",serviceResultBean.getParam("after_stock_amt"));//结存金额 stor_amt - ledger_info.put("remark","出库减库存" + dtlObject.optString("biz_inv_dtl_uuid"));//摘要 remark - *//* - serviceResultBean = custInventoryService.recInventoryTrace(context, op_account_uuid, op_person_uuid,change_type, change_info); - if (!serviceResultBean.isSuccess()) - throw new WDKException("存变动记录更新失败"); - break; - case "24": - //同时减 - //变动方式 变动方式: '+' 、 '-'、'++'、'+-'、'--'、'-+' - change_info.put("change_mode","--"); - serviceResultBean = minusBothQty(context, op_account_uuid, op_person_uuid, change_type, dtlObject); - if (!serviceResultBean.isSuccess()) - throw new WDKException("减库存减可用失败"); - change_info.put("change_qty", serviceResultBean.getParam("change_qty")); - change_info.put("changecanuse_qty", serviceResultBean.getParam("changecanuse_qty")); - change_info.put("change_num", serviceResultBean.getParam("change_num")); - change_info.put("changecanuse_num", serviceResultBean.getParam("changecanuse_num")); - */ -/* //库存台账 - ledger_info.put("in_qty","0");//入库数量 in_qty - ledger_info.put("in_amt","0");//入库金额 in_amt - ledger_info.put("out_qty",serviceResultBean.getParam("change_biz_qty"));//出库数量 out_qty - ledger_info.put("out_amt",serviceResultBean.getParam("change_stock_amt"));//出库金额 out_amt - ledger_info.put("stor_qty",serviceResultBean.getParam("after_biz_qty"));//结存数量 stor_qty - ledger_info.put("stor_amt",serviceResultBean.getParam("after_stock_amt"));//结存金额 stor_amt - ledger_info.put("remark","出库减库存" + dtlObject.optString("biz_inv_dtl_uuid"));//摘要 remark - *//* - serviceResultBean = custInventoryService.recInventoryTrace(context, op_account_uuid, op_person_uuid,change_type, change_info); - if (!serviceResultBean.isSuccess()) - throw new WDKException("存变动记录更新失败"); - break; - case "31": - //加待入 - //变动方式 变动方式: '+' 、 '-'、'++'、'+-'、'--'、'-+' - change_info.put("change_mode","+"); - serviceResultBean = addStayinQty(context, op_account_uuid, op_person_uuid, change_type, dtlObject); - if (!serviceResultBean.isSuccess()) - throw new WDKException("加待入失败"); - change_info.put("change_qty", serviceResultBean.getParam("change_qty")); - change_info.put("changecanuse_qty", serviceResultBean.getParam("changecanuse_qty")); - change_info.put("change_num", serviceResultBean.getParam("change_num")); - change_info.put("changecanuse_num", serviceResultBean.getParam("changecanuse_num")); - */ -/* //库存台账 - ledger_info.put("in_qty","0");//入库数量 in_qty - ledger_info.put("in_amt","0");//入库金额 in_amt - ledger_info.put("out_qty",serviceResultBean.getParam("change_biz_qty"));//出库数量 out_qty - ledger_info.put("out_amt",serviceResultBean.getParam("change_stock_amt"));//出库金额 out_amt - ledger_info.put("stor_qty",serviceResultBean.getParam("after_biz_qty"));//结存数量 stor_qty - ledger_info.put("stor_amt",serviceResultBean.getParam("after_stock_amt"));//结存金额 stor_amt - ledger_info.put("remark","出库减库存" + dtlObject.optString("biz_inv_dtl_uuid"));//摘要 remark - *//* - serviceResultBean = custInventoryService.recInventoryTrace(context, op_account_uuid, op_person_uuid,change_type, change_info); - if (!serviceResultBean.isSuccess()) - throw new WDKException("存变动记录更新失败"); - break; - case "32": - //减待入 - //变动方式 变动方式: '+' 、 '-'、'++'、'+-'、'--'、'-+' - change_info.put("change_mode","-"); - serviceResultBean = minusStayinQty(context, op_account_uuid, op_person_uuid, change_type, dtlObject); - if (!serviceResultBean.isSuccess()) - throw new WDKException("减待入失败"); - change_info.put("change_qty", serviceResultBean.getParam("change_qty")); - change_info.put("changecanuse_qty", serviceResultBean.getParam("changecanuse_qty")); - change_info.put("change_num", serviceResultBean.getParam("change_num")); - change_info.put("changecanuse_num", serviceResultBean.getParam("changecanuse_num")); - */ -/* //库存台账 - ledger_info.put("in_qty","0");//入库数量 in_qty - ledger_info.put("in_amt","0");//入库金额 in_amt - ledger_info.put("out_qty",serviceResultBean.getParam("change_biz_qty"));//出库数量 out_qty - ledger_info.put("out_amt",serviceResultBean.getParam("change_stock_amt"));//出库金额 out_amt - ledger_info.put("stor_qty",serviceResultBean.getParam("after_biz_qty"));//结存数量 stor_qty - ledger_info.put("stor_amt",serviceResultBean.getParam("after_stock_amt"));//结存金额 stor_amt - ledger_info.put("remark","出库减库存" + dtlObject.optString("biz_inv_dtl_uuid"));//摘要 remark - *//* - serviceResultBean = custInventoryService.recInventoryTrace(context, op_account_uuid, op_person_uuid,change_type, change_info); - if (!serviceResultBean.isSuccess()) - throw new WDKException("存变动记录更新失败"); - break; - case "10": - //其他 - - break; - default: - break; - } - - } - return serviceResultBean; - } - - */ -/** - * 减可用数 - * - * @param context 上下文 - * @param op_account_uuid 操作账号标识 - * @param op_person_uuid 操作员标识 - * @param change_type 变动类型 orgivt-组织 storeivt-仓库 stackivt-仓位 - * @param change_info 待变动信息 - * @return before_canuse_qty 更新前可用数 - * before_frozen_qty 更新前冻结数 - * before_ivt_qty 更新前库存数 - * before_warehousing_qty 更新前待入数 - * before_qc_qty 更新前待检数 - *

- * change_canuse_qty 变化可用数 - * change_frozen_qty 变化冻结数 - * change_ivt_qty 变化库存数 - * change_warehousing_qty 变化待入数 - * change_qc_qty 变化待检数 - *

- * after_canuse_qty 更新后可用数 - * after_frozen_qty 更新后冻结数 - * after_ivt_qty 更新后库存数 - * after_warehousing_qty 更新后待入数 - * after_qc_qty 更新后待检数 - *//* - - @WDKTransaction - @Override - public ServiceResultBean minusCanuseQty(ServiceContext context, String op_account_uuid, String op_person_uuid, String change_type, JSONObject change_info) { - ServiceResultBean srb = new ServiceResultBean(); - if(change_info==null||change_info.isNullObject()) throw new WDKException("[待变动信息]不能为空"); - String org_uuid = change_info.optString("org_uuid"); - String pcsn = change_info.optString("pcsn"); - String order_code = change_info.optString("order_code"); - String workflow_code = change_info.optString("workflow_code"); - String work_seq = change_info.optString("work_seq"); - String changecanuse_qty = "0"; - String changecanuse_num = "0"; - if(uString.isBlank(pcsn)) throw new WDKException("[批次]不能为空"); - if(uString.isBlank(org_uuid)) throw new WDKException("[组织id]不能为空"); - String material_uuid = change_info.optString("material_uuid"); - if(uString.isBlank(material_uuid)) throw new WDKException("[物料id]不能为空"); - String ivt_type_code = change_info.optString("ivt_type_code"); - if(uString.isBlank(ivt_type_code)) ivt_type_code ="01";//throw new WDKException("[库存类型]不能为空"); - String change_qty = change_info.optString("change_qty"); - String quality_scode = change_info.optString("quality_scode"); - if(uString.isBlank(change_qty)) throw new WDKException("[变动可用量]不能为空"); - String change_num = change_info.optString("change_num"); - - if(uString.isBlank(change_num)) throw new WDKException("[变动可用数]不能为空"); - String struct_uuid = change_info.optString("struct_uuid"); - String stor_uuid = change_info.optString("stor_uuid"); - JSONObject orderObj = new JSONObject(); - String canuse_qty =""; - String canuse_num =""; - HashMap map = new HashMap<>(); - if(uString.isNotBlank(org_uuid)){ - - orderObj = WQLObject.getWQLObject(STIVTORGIVT_TABLE) - .query("org_uuid = ? and material_uuid = ? and ivt_type_code = ? AND workflow_code = ? AND work_seq = ?", new String[] { org_uuid, material_uuid,ivt_type_code,workflow_code, work_seq}, "").uniqueResult(0); - - //减组织可用 - if(orderObj==null||orderObj.isNullObject()){ - throw new WDKException("[组织库存]不存在"); - } - canuse_qty = orderObj.optString("canuse_qty"); - if(uString.isBlank(canuse_qty)) throw new WDKException("[组织库存可用量]不能为空"); - canuse_qty = uMath.subtract(canuse_qty, change_qty, 4, BigDecimal.ROUND_HALF_UP) ; - JSONObject qty = new JSONObject(); - qty.put("canuse_qty",canuse_qty); - if(qty.optInt("canuse_qty")<0) { - throw new WDKException("[组织库存可用量]不足"); - } - canuse_num = orderObj.optString("canuse_num"); - if(uString.isBlank(canuse_num)) throw new WDKException("[组织库存可用数]不能为空"); - canuse_num = uMath.subtract(canuse_num, change_num, 4, BigDecimal.ROUND_HALF_UP) ; - qty = new JSONObject(); - qty.put("canuse_num",canuse_num); - if(qty.optInt("canuse_num")<0) { - throw new WDKException("[组织库存可用数]不足"); - } - map = new HashMap<>(); - map.put("canuse_qty", canuse_qty); - map.put("canuse_num", canuse_num); - map.put("change_time", WDK.getDateTime()); - WQLObject.getWQLObject(STIVTORGIVT_TABLE).update(map, "org_uuid = ? AND material_uuid= ? AND ivt_type_code= ? AND workflow_code = ? AND work_seq = ?", - new String[] { org_uuid,material_uuid,ivt_type_code,workflow_code, work_seq }); - String nums = uMath.subtract(canuse_qty, canuse_num, 0, BigDecimal.ROUND_HALF_UP); - - if("0".equals(nums)){ - WQLObject.getWQLObject(STIVTORGIVT_TABLE).delete("org_uuid = ? AND material_uuid= ? AND ivt_type_code= ? AND workflow_code = ? AND work_seq = ?", - new String[] { org_uuid,material_uuid,ivt_type_code,workflow_code, work_seq }); - - } - - - } - - - //仓位库存 - if(uString.isNotBlank(struct_uuid)) { - - orderObj = WQLObject.getWQLObject(STIVTSTACKIVT_TABLE).query("org_uuid = ? and order_code = ? and work_seq = ? and workflow_code = ? and ivt_type_code = ? and struct_uuid = ? and stor_uuid = ? and material_uuid = ? AND pcsn=? AND quality_scode=?", new String[] { org_uuid, order_code,work_seq,workflow_code,ivt_type_code ,struct_uuid,stor_uuid,material_uuid,pcsn,quality_scode}, "").uniqueResult(0); - - if(orderObj==null||orderObj.isNullObject()){ - throw new WDKException("[仓位库存]不存在"); - } - canuse_qty = orderObj.optString("canuse_qty"); - if(uString.isBlank(canuse_qty)) throw new WDKException("[仓位库存可用量]不能为空"); - canuse_qty = uMath.subtract(canuse_qty, change_qty, 4, BigDecimal.ROUND_HALF_UP) ; - JSONObject qty = new JSONObject(); - qty.put("canuse_qty",canuse_qty); - if(qty.optInt("canuse_qty")<0) { - throw new WDKException("[仓位库存可用量]不足"); - } - canuse_num = orderObj.optString("canuse_num"); - if(uString.isBlank(canuse_num)) throw new WDKException("[仓位库存可用数]不能为空"); - canuse_num = uMath.subtract(canuse_num, change_num, 4, BigDecimal.ROUND_HALF_UP) ; - qty = new JSONObject(); - qty.put("canuse_num",canuse_num); - if(qty.optInt("canuse_num")<0) { - throw new WDKException("[仓位库存可用数]不足"); - } - map = new HashMap<>(); - map.put("canuse_qty", canuse_qty); - map.put("canuse_num", canuse_num); - map.put("change_time", WDK.getDateTime()); - WQLObject.getWQLObject(STIVTSTACKIVT_TABLE).update(map,"org_uuid = ? and order_code = ? and work_seq = ? and workflow_code = ? and ivt_type_code = ? and struct_uuid = ? and stor_uuid = ? and material_uuid = ? AND pcsn=? AND quality_scode=?", new String[] { org_uuid, order_code,work_seq,workflow_code,ivt_type_code ,struct_uuid,stor_uuid,material_uuid,pcsn,quality_scode}); - - }; - //仓库库存 - if(uString.isNotBlank(stor_uuid)) { - orderObj = WQLObject.getWQLObject(STIVTSTORIVT_TABLE) - .query("org_uuid = ? and material_uuid = ? and ivt_type_code = ? AND workflow_code = ? AND work_seq = ? and stor_uuid = ? AND quality_scode=?", new String[] { org_uuid, material_uuid,ivt_type_code,workflow_code, work_seq,stor_uuid,quality_scode}, "").uniqueResult(0); - - if(orderObj==null||orderObj.isNullObject()){ - throw new WDKException("[仓库库存]不存在"); - } - canuse_qty = orderObj.optString("canuse_qty"); - if(uString.isBlank(canuse_qty)) throw new WDKException("[仓库库存可用量]不能为空"); - canuse_qty = uMath.subtract(canuse_qty, change_qty, 4, BigDecimal.ROUND_HALF_UP) ; - JSONObject qty = new JSONObject(); - qty.put("canuse_qty",canuse_qty); - if(qty.optInt("canuse_qty")<0) { - throw new WDKException("[仓库库存可用量]不足"); - } - - canuse_num = orderObj.optString("canuse_num"); - if(uString.isBlank(canuse_num)) throw new WDKException("[仓库库存可用数]不能为空"); - canuse_num = uMath.subtract(canuse_num, change_num, 4, BigDecimal.ROUND_HALF_UP) ; - qty = new JSONObject(); - qty.put("canuse_num",canuse_num); - if(qty.optInt("canuse_num")<0) { - throw new WDKException("[仓库库存可用数]不足"); - } - map = new HashMap<>(); - map.put("canuse_qty", canuse_qty); - map.put("canuse_num", canuse_num); - map.put("change_time", WDK.getDateTime()); - - WQLObject.getWQLObject(STIVTSTORIVT_TABLE).update(map, "org_uuid = ? AND material_uuid= ? AND ivt_type_code= ? AND workflow_code = ? AND work_seq = ? and stor_uuid = ? AND quality_scode=?", - new String[] { org_uuid,material_uuid,ivt_type_code,workflow_code, work_seq,stor_uuid ,quality_scode}); - }; - srb.setSuccess(); - srb.setDesc("生成成功!"); - srb.addParam("change_qty", change_qty); - srb.addParam("changecanuse_qty", changecanuse_qty); - srb.addParam("change_num", change_num); - srb.addParam("changecanuse_num", changecanuse_num); - return srb; - } - - */ -/** - * 加可用 - * - * @param context 上下文 - * @param op_account_uuid 操作账号标识 - * @param op_person_uuid 操作员标识 - * @param change_type 变动类型 orgivt-组织 storeivt-仓库 stackivt-仓位 - * @param change_info 待变动信息 - * @return before_canuse_qty 更新前可用数 - * before_frozen_qty 更新前冻结数 - * before_ivt_qty 更新前库存数 - * before_warehousing_qty 更新前待入数 - * before_qc_qty 更新前待检数 - *

- * change_canuse_qty 变化可用数 - * change_frozen_qty 变化冻结数 - * change_ivt_qty 变化库存数 - * change_warehousing_qty 变化待入数 - * change_qc_qty 变化待检数 - *

- * after_canuse_qty 更新后可用数 - * after_frozen_qty 更新后冻结数 - * after_ivt_qty 更新后库存数 - * after_warehousing_qty 更新后待入数 - * after_qc_qty 更新后待检数 - *//* - - @WDKTransaction - @Override - public ServiceResultBean addCanuseQty(ServiceContext context, String op_account_uuid, String op_person_uuid, String change_type, JSONObject change_info) { - ServiceResultBean srb = new ServiceResultBean(); - if(change_info==null||change_info.isNullObject()) throw new WDKException("[待变动信息]不能为空"); - String org_uuid = change_info.optString("org_uuid"); - String pcsn = change_info.optString("pcsn"); - String order_code = change_info.optString("order_code"); - String workflow_code = change_info.optString("workflow_code"); - String work_seq = change_info.optString("work_seq"); - String quality_scode = change_info.optString("quality_scode"); - - String changecanuse_qty = "0"; - String changecanuse_num = "0"; - if(uString.isBlank(pcsn)) throw new WDKException("[批次]不能为空"); - if(uString.isBlank(org_uuid)) throw new WDKException("[组织id]不能为空"); - String material_uuid = change_info.optString("material_uuid"); - if(uString.isBlank(material_uuid)) throw new WDKException("[物料id]不能为空"); - String ivt_type_code = change_info.optString("ivt_type_code"); - if(uString.isBlank(ivt_type_code)) ivt_type_code ="01";//throw new WDKException("[库存类型]不能为空"); - String change_qty = change_info.optString("change_qty"); - - if(uString.isBlank(change_qty)) throw new WDKException("[变动可用量]不能为空"); - String change_num = change_info.optString("change_num"); - - if(uString.isBlank(change_num)) throw new WDKException("[变动可用数]不能为空"); - String struct_uuid = change_info.optString("struct_uuid"); - String stor_uuid = change_info.optString("stor_uuid"); - JSONObject orderObj = new JSONObject(); - String canuse_qty =""; - String canuse_num =""; - HashMap map = new HashMap<>(); - if(uString.isNotBlank(org_uuid)){ - - orderObj = WQLObject.getWQLObject(STIVTORGIVT_TABLE) - .query("org_uuid = ? and material_uuid = ? and ivt_type_code = ? AND workflow_code = ? AND work_seq = ?", new String[] { org_uuid, material_uuid,ivt_type_code,workflow_code, work_seq}, "").uniqueResult(0); - - //减组织可用 - if(orderObj==null||orderObj.isNullObject()){ - - JSONObject orgivt = new JSONObject(); - orgivt.put("org_uuid", change_info.optString("org_uuid")); - orgivt.put("material_uuid", change_info.optString("material_uuid")); - orgivt.put("material_code", change_info.optString("material_code")); - orgivt.put("material_name", change_info.optString("material_name")); - orgivt.put("ivt_type_code", ivt_type_code); - orgivt.put("canuse_qty", change_qty); - orgivt.put("frozen_qty", "0"); - orgivt.put("stayin_qty", "0"); - orgivt.put("qc_qty", "0"); - orgivt.put("qty_unit_uuid", change_info.optString("qty_unit_uuid")); - orgivt.put("qty_unit_name", change_info.optString("qty_unit_name")); - orgivt.put("canuse_num", change_num); - orgivt.put("ivt_num", "0"); - orgivt.put("ivt_qty", "0"); - orgivt.put("frozen_num", "0"); - orgivt.put("warehousing_num", "0"); - orgivt.put("qc_num", "0"); - orgivt.put("num_unit_uuid", change_info.optString("num_unit_uuid")); - orgivt.put("num_unit_name", change_info.optString("num_unit_name")); - orgivt.put("work_seq", change_info.optString("work_seq")); - orgivt.put("workflow_code", change_info.optString("workflow_code")); - orgivt.put("change_time", WDK.getDateTime()); - ResultBean resultBean = WQLObject.getWQLObject(STIVTORGIVT_TABLE).insert(orgivt); - }else { - - canuse_qty = orderObj.optString("canuse_qty"); - if(uString.isBlank(canuse_qty)) throw new WDKException("[组织库存可用量]不能为空"); - canuse_qty = uMath.add(canuse_qty, change_qty, 4, BigDecimal.ROUND_HALF_UP) ; - JSONObject qty = new JSONObject(); - qty.put("canuse_qty",canuse_qty); - if(qty.optInt("canuse_qty")<0) { - throw new WDKException("[组织库存可用量]不足"); - } - canuse_num = orderObj.optString("canuse_num"); - if(uString.isBlank(canuse_num)) throw new WDKException("[组织库存可用数]不能为空"); - canuse_num = uMath.add(canuse_num, change_num, 4, BigDecimal.ROUND_HALF_UP) ; - qty = new JSONObject(); - qty.put("canuse_num",canuse_num); - if(qty.optInt("canuse_num")<0) { - throw new WDKException("[组织库存可用数]不足"); - } - map = new HashMap<>(); - map.put("canuse_qty", canuse_qty); - map.put("canuse_num", canuse_num); - map.put("change_time", WDK.getDateTime()); - WQLObject.getWQLObject(STIVTORGIVT_TABLE).update(map, "org_uuid = ? AND material_uuid= ? AND ivt_type_code= ? AND workflow_code = ? AND work_seq = ?", - new String[] { org_uuid,material_uuid,ivt_type_code,workflow_code, work_seq }); - - } - } - - - //仓位库存 - if(uString.isNotBlank(struct_uuid)) { - orderObj = WQLObject.getWQLObject(STIVTSTACKIVT_TABLE).query("org_uuid = ? and order_code = ? and work_seq = ? and workflow_code = ? and ivt_type_code = ? and struct_uuid = ? and stor_uuid = ? and material_uuid = ? AND pcsn=? AND quality_scode=?", new String[] { org_uuid, order_code,work_seq,workflow_code,ivt_type_code ,struct_uuid,stor_uuid,material_uuid,pcsn,quality_scode}, "").uniqueResult(0); - - if(orderObj==null||orderObj.isNullObject()){ - JSONObject orgivt = new JSONObject(); - orgivt.put("struct_uuid", change_info.optString("struct_uuid")); - orgivt.put("struct_name", change_info.optString("struct_name")); - orgivt.put("material_uuid", change_info.optString("material_uuid")); - orgivt.put("material_code", change_info.optString("material_code")); - orgivt.put("material_name", change_info.optString("material_name")); - orgivt.put("order_code", change_info.optString("order_code")); - orgivt.put("quality_scode", quality_scode); - orgivt.put("work_seq", change_info.optString("work_seq")); - orgivt.put("workflow_code", change_info.optString("workflow_code")); - orgivt.put("ivt_type_code", ivt_type_code); - orgivt.put("pcsn", change_info.optString("pcsn")); - orgivt.put("org_uuid", change_info.optString("org_uuid")); - orgivt.put("stor_uuid", change_info.optString("stor_uuid")); - orgivt.put("stor_name", change_info.optString("stor_name")); - orgivt.put("quality_type_scode", change_info.optString("quality_type_scode")); - orgivt.put("canuse_qty", change_qty); - orgivt.put("frozen_qty", "0"); - orgivt.put("ivt_qty", "0"); - orgivt.put("warehousing_qty", "0"); - orgivt.put("qc_qty", "0"); - orgivt.put("qty_unit_uuid", change_info.optString("qty_unit_uuid")); - orgivt.put("qty_unit_name", change_info.optString("qty_unit_name")); - orgivt.put("number_type_scode", change_info.optString("number_type_scode")); - orgivt.put("canuse_num", change_num); - orgivt.put("frozen_num", "0"); - orgivt.put("ivt_num", "0"); - orgivt.put("warehousing_num", "0"); - orgivt.put("qc_num", "0"); - orgivt.put("num_unit_uuid", change_info.optString("num_unit_uuid")); - orgivt.put("num_unit_name", change_info.optString("num_unit_name")); - orgivt.put("change_time", WDK.getDateTime()); - ResultBean resultBean = WQLObject.getWQLObject(STIVTSTACKIVT_TABLE).insert(orgivt); - }else { - canuse_qty = orderObj.optString("canuse_qty"); - if (uString.isBlank(canuse_qty)) throw new WDKException("[仓位库存可用量]不能为空"); - canuse_qty = uMath.add(canuse_qty, change_qty, 4, BigDecimal.ROUND_HALF_UP); - JSONObject qty = new JSONObject(); - qty.put("canuse_qty", canuse_qty); - if (qty.optInt("canuse_qty") < 0) { - throw new WDKException("[仓位库存可用量]不足"); - } - canuse_num = orderObj.optString("canuse_num"); - if (uString.isBlank(canuse_num)) throw new WDKException("[仓位库存可用数]不能为空"); - canuse_num = uMath.add(canuse_num, change_num, 4, BigDecimal.ROUND_HALF_UP); - qty = new JSONObject(); - qty.put("canuse_num", canuse_num); - if (qty.optInt("canuse_num") < 0) { - throw new WDKException("[仓位库存可用数]不足"); - } - map = new HashMap<>(); - map.put("canuse_qty", canuse_qty); - map.put("canuse_num", canuse_num); - map.put("change_time", WDK.getDateTime()); - WQLObject.getWQLObject(STIVTSTACKIVT_TABLE).update(map, "org_uuid = ? and order_code = ? and work_seq = ? and workflow_code = ? and ivt_type_code = ? and struct_uuid = ? and stor_uuid = ? and material_uuid = ? AND pcsn=? AND quality_scode=?", new String[]{org_uuid, order_code, work_seq, workflow_code, ivt_type_code, struct_uuid, stor_uuid, material_uuid, pcsn, quality_scode}); - } - }; - //仓库库存 - if(uString.isNotBlank(stor_uuid)) { - - orderObj = WQLObject.getWQLObject(STIVTSTORIVT_TABLE) - .query("org_uuid = ? and material_uuid = ? and ivt_type_code = ? AND workflow_code = ? AND work_seq = ? and stor_uuid = ? AND quality_scode=?", new String[] { org_uuid, material_uuid,ivt_type_code,workflow_code, work_seq,stor_uuid,quality_scode}, "").uniqueResult(0); - - if(orderObj==null||orderObj.isNullObject()){ - JSONObject orgivt = new JSONObject(); - orgivt.put("stor_uuid", change_info.optString("stor_uuid")); - orgivt.put("stor_name", change_info.optString("stor_name")); - orgivt.put("material_uuid", change_info.optString("material_uuid")); - orgivt.put("material_code", change_info.optString("material_code")); - orgivt.put("material_name", change_info.optString("material_name")); - orgivt.put("ivt_type_code", ivt_type_code); - orgivt.put("org_uuid", change_info.optString("org_uuid")); - orgivt.put("canuse_qty", change_qty); - orgivt.put("quality_scode", quality_scode); - orgivt.put("frozen_qty", "0"); - orgivt.put("stayin_qty", "0"); - orgivt.put("qc_qty", "0"); - orgivt.put("qty_unit_uuid", change_info.optString("qty_unit_uuid")); - orgivt.put("qty_unit_name", change_info.optString("qty_unit_name")); - orgivt.put("canuse_num", change_num); - orgivt.put("frozen_num", "0"); - orgivt.put("ivt_num", "0"); - orgivt.put("ivt_qty", "0"); - orgivt.put("warehousing_num", "0"); - orgivt.put("qc_num", "0"); - orgivt.put("num_unit_uuid", change_info.optString("num_unit_uuid")); - orgivt.put("num_unit_name", change_info.optString("num_unit_name")); - orgivt.put("work_seq", change_info.optString("work_seq")); - orgivt.put("workflow_code", change_info.optString("workflow_code")); - orgivt.put("change_time", WDK.getDateTime()); - ResultBean resultBean = WQLObject.getWQLObject(STIVTSTORIVT_TABLE).insert(orgivt); - }else { - canuse_qty = orderObj.optString("canuse_qty"); - if (uString.isBlank(canuse_qty)) throw new WDKException("[仓库库存可用量]不能为空"); - canuse_qty = uMath.add(canuse_qty, change_qty, 4, BigDecimal.ROUND_HALF_UP); - JSONObject qty = new JSONObject(); - qty.put("canuse_qty", canuse_qty); - if (qty.optInt("canuse_qty") < 0) { - throw new WDKException("[仓库库存可用量]不足"); - } - - canuse_num = orderObj.optString("canuse_num"); - if (uString.isBlank(canuse_num)) throw new WDKException("[仓库库存可用数]不能为空"); - canuse_num = uMath.add(canuse_num, change_num, 4, BigDecimal.ROUND_HALF_UP); - qty = new JSONObject(); - qty.put("canuse_num", canuse_num); - if (qty.optInt("canuse_num") < 0) { - throw new WDKException("[仓库库存可用数]不足"); - } - map = new HashMap<>(); - map.put("canuse_qty", canuse_qty); - map.put("canuse_num", canuse_num); - map.put("change_time", WDK.getDateTime()); - - WQLObject.getWQLObject(STIVTSTORIVT_TABLE).update(map, "org_uuid = ? AND material_uuid= ? AND ivt_type_code= ? AND workflow_code = ? AND work_seq = ? and stor_uuid = ? AND quality_scode=?", - new String[]{org_uuid, material_uuid, ivt_type_code, workflow_code, work_seq, stor_uuid, quality_scode}); - } - }; - srb.setSuccess(); - srb.setDesc("生成成功!"); - srb.addParam("change_qty", change_qty); - srb.addParam("changecanuse_qty", changecanuse_qty); - srb.addParam("change_num", change_num); - srb.addParam("changecanuse_num", changecanuse_num); - return srb; - } - - */ -/** - * 刷新可用 - * - * @param context 上下文 - * @param op_account_uuid 操作账号标识 - * @param op_person_uuid 操作员标识 - * @param change_type 变动类型 orgivt-组织 storeivt-仓库 stackivt-仓位 - * @param change_info 待变动信息 - * @return before_canuse_qty 更新前可用数 - * before_frozen_qty 更新前冻结数 - * before_ivt_qty 更新前库存数 - * before_warehousing_qty 更新前待入数 - * before_qc_qty 更新前待检数 - *

- * change_canuse_qty 变化可用数 - * change_frozen_qty 变化冻结数 - * change_ivt_qty 变化库存数 - * change_warehousing_qty 变化待入数 - * change_qc_qty 变化待检数 - *

- * after_canuse_qty 更新后可用数 - * after_frozen_qty 更新后冻结数 - * after_ivt_qty 更新后库存数 - * after_warehousing_qty 更新后待入数 - * after_qc_qty 更新后待检数 - *//* - - @WDKTransaction - @Override - public ServiceResultBean reflushCanuseQty(ServiceContext context, String op_account_uuid, String op_person_uuid, String change_type, JSONObject change_info) { - return null; - } - - */ -/** - * 减库存 - * - * @param context 上下文 - * @param op_account_uuid 操作账号标识 - * @param op_person_uuid 操作员标识 - * @param change_type 变动类型 orgivt-组织 storeivt-仓库 stackivt-仓位 - * @param change_info 待变动信息 - * @return before_canuse_qty 更新前可用数 - * before_frozen_qty 更新前冻结数 - * before_ivt_qty 更新前库存数 - * before_warehousing_qty 更新前待入数 - * before_qc_qty 更新前待检数 - *

- * change_canuse_qty 变化可用数 - * change_frozen_qty 变化冻结数 - * change_ivt_qty 变化库存数 - * change_warehousing_qty 变化待入数 - * change_qc_qty 变化待检数 - *

- * after_canuse_qty 更新后可用数 - * after_frozen_qty 更新后冻结数 - * after_ivt_qty 更新后库存数 - * after_warehousing_qty 更新后待入数 - * after_qc_qty 更新后待检数 - *//* - - @Override - @WDKTransaction - public ServiceResultBean minusIvtQty(ServiceContext context, String op_account_uuid, String op_person_uuid, String change_type, JSONObject change_info) { - ServiceResultBean srb = new ServiceResultBean(); - if(change_info==null||change_info.isNullObject()) throw new WDKException("[待变动信息]不能为空"); - String org_uuid = change_info.optString("org_uuid"); - if(uString.isBlank(org_uuid)) throw new WDKException("[组织id]不能为空"); - String pcsn = change_info.optString("pcsn"); - String changecanuse_qty = change_info.optString("ivt_qty"); - if(uString.isBlank(changecanuse_qty)) throw new WDKException("[变动库存量]不能为空"); - String changecanuse_num = change_info.optString("ivt_num"); - if(uString.isBlank(changecanuse_num)) throw new WDKException("[变动库存数]不能为空"); - String material_uuid = change_info.optString("material_uuid"); - if(uString.isBlank(material_uuid)) throw new WDKException("[物料id]不能为空"); - String ivt_type_code = change_info.optString("ivt_type_code"); - if(uString.isBlank(ivt_type_code)) ivt_type_code ="01";//throw new WDKException("[库存类型]不能为空"); - String struct_uuid = change_info.optString("struct_uuid"); - String stor_uuid = change_info.optString("stor_uuid"); - JSONObject orderObj = new JSONObject(); - HashMap map = new HashMap<>(); - String order_code = change_info.optString("order_code"); - String workflow_code = change_info.optString("workflow_code"); - String work_seq = change_info.optString("work_seq"); - String quality_scode = change_info.optString("quality_scode"); - - //仓位 - if(uString.isNotBlank(struct_uuid)) { - - //仓位库存 - orderObj = WQLObject.getWQLObject(STIVTSTACKIVT_TABLE).query("org_uuid = ? and order_code = ? and work_seq = ? and workflow_code = ? and ivt_type_code = ? and struct_uuid = ? and stor_uuid = ? and material_uuid = ? AND pcsn=? AND quality_scode=?", new String[] { org_uuid, order_code,work_seq,workflow_code,ivt_type_code ,struct_uuid,stor_uuid,material_uuid,pcsn,quality_scode}, "").uniqueResult(0); - if(orderObj==null||orderObj.isNullObject()){ - throw new WDKException("[仓位库存]不存在"); - }else { - String ivt_qty = orderObj.optString("ivt_qty"); - if(uString.isBlank(ivt_qty)) throw new WDKException("[仓位库存库存量]不能为空"); - ivt_qty = uMath.subtract(ivt_qty, changecanuse_qty, 4, BigDecimal.ROUND_HALF_UP) ; - JSONObject qty = new JSONObject(); - qty.put("canuse",ivt_qty); - if(qty.optInt("canuse")<0) { - throw new WDKException("[仓位库存可用量]不足"); - } - String ivt_num = orderObj.optString("ivt_num"); - if(uString.isBlank(ivt_num)) throw new WDKException("[仓位库存库存数]不能为空"); - ivt_num = uMath.subtract(ivt_num, changecanuse_num, 4, BigDecimal.ROUND_HALF_UP) ; - - qty.put("canuse",ivt_num); - if(qty.optInt("canuse")<0) { - throw new WDKException("[仓位库存可用数]不足"); - } - map = new HashMap<>(); - map.put("ivt_qty", ivt_qty); - map.put("ivt_num", ivt_num); - map.put("change_time", WDK.getDateTime()); - - WQLObject.getWQLObject(STIVTSTACKIVT_TABLE).update(map,"org_uuid = ? and order_code = ? and work_seq = ? and workflow_code = ? and ivt_type_code = ? and struct_uuid = ? and stor_uuid = ? and material_uuid = ? AND pcsn=? AND quality_scode=?", new String[] { org_uuid, order_code,work_seq,workflow_code,ivt_type_code ,struct_uuid,stor_uuid,material_uuid,pcsn,quality_scode}); - String nums = uMath.subtract(ivt_num, ivt_qty, 0, BigDecimal.ROUND_HALF_UP); - if("0".equals(nums)){ - WQLObject.getWQLObject(STIVTSTACKIVT_TABLE).delete("org_uuid = ? and order_code = ? and work_seq = ? and workflow_code = ? and ivt_type_code = ? and struct_uuid = ? and stor_uuid = ? and material_uuid = ? AND pcsn=? AND quality_scode=?", new String[] { org_uuid, order_code,work_seq,workflow_code,ivt_type_code ,struct_uuid,stor_uuid,material_uuid,pcsn,quality_scode}); - } - } - - - } - - //仓库库存 - if(uString.isNotBlank(stor_uuid)) { - - orderObj = WQLObject.getWQLObject(STIVTSTORIVT_TABLE) - .query("org_uuid = ? and material_uuid = ? and ivt_type_code = ? AND workflow_code = ? AND work_seq = ? and stor_uuid = ? AND quality_scode=?", new String[] { org_uuid, material_uuid,ivt_type_code,workflow_code, work_seq,stor_uuid,quality_scode}, "").uniqueResult(0); - - if(orderObj==null||orderObj.isNullObject()){ - throw new WDKException("[仓库库存]不存在"); - }else { - - String ivt_qty = orderObj.optString("ivt_qty"); - if(uString.isBlank(ivt_qty)) throw new WDKException("[仓库库存库存量]不能为空"); - ivt_qty = uMath.subtract(ivt_qty, changecanuse_qty, 4, BigDecimal.ROUND_HALF_UP) ; - JSONObject qty = new JSONObject(); - qty.put("canuse",ivt_qty); - if(qty.optInt("canuse")<0) { - throw new WDKException("[仓库库存可用量]不足"); - } - String ivt_num = orderObj.optString("ivt_num"); - if(uString.isBlank(ivt_num)) throw new WDKException("[仓库库存库存数]不能为空"); - ivt_num = uMath.subtract(ivt_num, changecanuse_num, 4, BigDecimal.ROUND_HALF_UP) ; - qty.put("canuse",ivt_num); - if(qty.optInt("canuse")<0) { - throw new WDKException("[仓库库存可用数]不足"); - } - map = new HashMap<>(); - map.put("ivt_qty", ivt_qty); - map.put("ivt_num", ivt_num); - map.put("change_time", WDK.getDateTime()); - - WQLObject.getWQLObject(STIVTSTORIVT_TABLE).update(map, "org_uuid = ? AND material_uuid= ? AND ivt_type_code= ? AND workflow_code = ? AND work_seq = ? and stor_uuid = ? AND quality_scode=?", - new String[] { org_uuid,material_uuid,ivt_type_code,workflow_code, work_seq,stor_uuid ,quality_scode}); - String nums = uMath.subtract(ivt_num, ivt_qty, 0, BigDecimal.ROUND_HALF_UP); - - if("0".equals(nums)){ - WQLObject.getWQLObject(STIVTSTORIVT_TABLE).delete("org_uuid = ? AND material_uuid= ? AND ivt_type_code= ? AND workflow_code = ? AND work_seq = ? and stor_uuid = ? AND quality_scode=?", - new String[] { org_uuid,material_uuid,ivt_type_code,workflow_code, work_seq,stor_uuid,quality_scode }); - } - - }; - } - - srb.setSuccess(); - srb.setDesc("生成成功!"); - srb.addParam("change_qty", changecanuse_qty); - srb.addParam("change_num", changecanuse_num); - srb.addParam("changecanuse_qty", changecanuse_qty); - srb.addParam("changecanuse_num", changecanuse_num); - return srb; - } - - */ -/** - * 加库存 - * - * @param context 上下文 - * @param op_account_uuid 操作账号标识 - * @param op_person_uuid 操作员标识 - * @param change_type 变动类型 orgivt-组织 storeivt-仓库 stackivt-仓位 - * @param change_info 待变动信息 - * @return before_canuse_qty 更新前可用数 - * before_frozen_qty 更新前冻结数 - * before_ivt_qty 更新前库存数 - * before_warehousing_qty 更新前待入数 - * before_qc_qty 更新前待检数 - *

- * change_canuse_qty 变化可用数 - * change_frozen_qty 变化冻结数 - * change_ivt_qty 变化库存数 - * change_warehousing_qty 变化待入数 - * change_qc_qty 变化待检数 - *

- * after_canuse_qty 更新后可用数 - * after_frozen_qty 更新后冻结数 - * after_ivt_qty 更新后库存数 - * after_warehousing_qty 更新后待入数 - * after_qc_qty 更新后待检数 - *//* - - @Override - @WDKTransaction - public ServiceResultBean addIvtQty(ServiceContext context, String op_account_uuid, String op_person_uuid, String change_type, JSONObject change_info) { - ServiceResultBean srb = new ServiceResultBean(); - if(change_info==null||change_info.isNullObject()) throw new WDKException("[待变动信息]不能为空"); - String org_uuid = change_info.optString("org_uuid"); - if(uString.isBlank(org_uuid)) throw new WDKException("[组织id]不能为空"); - String pcsn = change_info.optString("pcsn"); - String changecanuse_qty = change_info.optString("ivt_qty"); - if(uString.isBlank(changecanuse_qty)) throw new WDKException("[变动库存量]不能为空"); - String changecanuse_num = change_info.optString("ivt_num"); - if(uString.isBlank(changecanuse_num)) throw new WDKException("[变动库存数]不能为空"); - String material_uuid = change_info.optString("material_uuid"); - if(uString.isBlank(material_uuid)) throw new WDKException("[物料id]不能为空"); - String ivt_type_code = change_info.optString("ivt_type_code"); - if(uString.isBlank(ivt_type_code)) ivt_type_code ="01";//throw new WDKException("[库存类型]不能为空"); - String struct_uuid = change_info.optString("struct_uuid"); - String stor_uuid = change_info.optString("stor_uuid"); - JSONObject orderObj = new JSONObject(); - HashMap map = new HashMap<>(); - String order_code = change_info.optString("order_code"); - String workflow_code = change_info.optString("workflow_code"); - String work_seq = change_info.optString("work_seq"); - String quality_scode = change_info.optString("quality_scode"); - - //仓位 - if(uString.isNotBlank(struct_uuid)) { - - orderObj = WQLObject.getWQLObject(STIVTSTACKIVT_TABLE).query("org_uuid = ? and order_code = ? and work_seq = ? and workflow_code = ? and ivt_type_code = ? and struct_uuid = ? and stor_uuid = ? and material_uuid = ? AND pcsn=? AND quality_scode=?", new String[] { org_uuid, order_code,work_seq,workflow_code,ivt_type_code ,struct_uuid,stor_uuid,material_uuid,pcsn,quality_scode}, "").uniqueResult(0); - - if(orderObj==null||orderObj.isNullObject()){ - JSONObject orgivt = new JSONObject(); - orgivt.put("struct_uuid", change_info.optString("struct_uuid")); - orgivt.put("struct_name", change_info.optString("struct_name")); - orgivt.put("material_uuid", change_info.optString("material_uuid")); - orgivt.put("material_code", change_info.optString("material_code")); - orgivt.put("material_name", change_info.optString("material_name")); - orgivt.put("order_code", change_info.optString("order_code")); - - orgivt.put("quality_scode", quality_scode); - orgivt.put("work_seq", change_info.optString("work_seq")); - orgivt.put("workflow_code", change_info.optString("workflow_code")); - orgivt.put("ivt_type_code", ivt_type_code); - orgivt.put("pcsn", change_info.optString("pcsn")); - orgivt.put("org_uuid", change_info.optString("org_uuid")); - orgivt.put("stor_uuid", change_info.optString("stor_uuid")); - orgivt.put("stor_name", change_info.optString("stor_name")); - orgivt.put("quality_type_scode", change_info.optString("quality_type_scode")); - orgivt.put("canuse_qty", changecanuse_qty); - orgivt.put("frozen_qty", "0"); - orgivt.put("ivt_qty", changecanuse_qty); - orgivt.put("warehousing_qty", "0"); - orgivt.put("qc_qty", "0"); - orgivt.put("qty_unit_uuid", change_info.optString("qty_unit_uuid")); - orgivt.put("qty_unit_name", change_info.optString("qty_unit_name")); - orgivt.put("number_type_scode", change_info.optString("number_type_scode")); - orgivt.put("canuse_num", changecanuse_num); - orgivt.put("frozen_num", "0"); - orgivt.put("ivt_num", changecanuse_num); - orgivt.put("warehousing_num", "0"); - orgivt.put("qc_num", "0"); - orgivt.put("num_unit_uuid", change_info.optString("num_unit_uuid")); - orgivt.put("num_unit_name", change_info.optString("num_unit_name")); - orgivt.put("change_time", WDK.getDateTime()); - ResultBean resultBean = WQLObject.getWQLObject(STIVTSTACKIVT_TABLE).insert(orgivt); - }else { - String ivt_qty = orderObj.optString("ivt_qty"); - if(uString.isBlank(ivt_qty)) throw new WDKException("[仓位库存库存量]不能为空"); - ivt_qty = uMath.add(ivt_qty, changecanuse_qty, 4, BigDecimal.ROUND_HALF_UP) ; - String ivt_num = orderObj.optString("ivt_num"); - if(uString.isBlank(ivt_num)) throw new WDKException("[仓位库存库存数]不能为空"); - ivt_num = uMath.add(ivt_num, changecanuse_num, 4, BigDecimal.ROUND_HALF_UP) ; - map = new HashMap<>(); - map.put("ivt_qty", ivt_qty); - map.put("ivt_num", ivt_num); - map.put("change_time", WDK.getDateTime()); - WQLObject.getWQLObject(STIVTSTACKIVT_TABLE).update(map,"org_uuid = ? and order_code = ? and work_seq = ? and workflow_code = ? and ivt_type_code = ? and struct_uuid = ? and stor_uuid = ? and material_uuid = ? AND pcsn=? AND quality_scode=?", new String[] { org_uuid, order_code,work_seq,workflow_code,ivt_type_code ,struct_uuid,stor_uuid,material_uuid,pcsn,quality_scode}); - - - } - - - } - */ -/* if(uString.isNotBlank(org_uuid)) { - if(uString.isBlank(workflow_code)){ - orderObj = WQLObject.getWQLObject(STIVTORGIVT_TABLE) - .query("org_uuid = ? and material_uuid = ? and ivt_type_code = ?", new String[] { org_uuid, material_uuid,ivt_type_code }, "").uniqueResult(0); - }else { - orderObj = WQLObject.getWQLObject(STIVTORGIVT_TABLE) - .query("org_uuid = ? and material_uuid = ? and ivt_type_code = ? AND workflow_code = ? AND work_seq = ?", new String[] { org_uuid, material_uuid,ivt_type_code,workflow_code, work_seq}, "").uniqueResult(0); - - } - - - if(orderObj==null||orderObj.isNullObject()){ - - JSONObject orgivt = new JSONObject(); - orgivt.put("org_uuid", change_info.optString("org_uuid")); - orgivt.put("material_uuid", change_info.optString("material_uuid")); - orgivt.put("material_code", change_info.optString("material_code")); - orgivt.put("material_name", change_info.optString("material_name")); - orgivt.put("ivt_type_code", ivt_type_code); - orgivt.put("canuse_qty", changecanuse_qty); - orgivt.put("frozen_qty", "0"); - orgivt.put("warehousing_qty", "0"); - orgivt.put("qc_qty", "0"); - orgivt.put("qty_unit_uuid", change_info.optString("qty_unit_uuid")); - orgivt.put("qty_unit_name", change_info.optString("qty_unit_name")); - orgivt.put("canuse_num", changecanuse_num); - orgivt.put("ivt_num", changecanuse_num); - orgivt.put("ivt_qty", changecanuse_qty); - orgivt.put("frozen_num", "0"); - orgivt.put("warehousing_num", "0"); - orgivt.put("qc_num", "0"); - orgivt.put("num_unit_uuid", change_info.optString("num_unit_uuid")); - orgivt.put("num_unit_name", change_info.optString("num_unit_name")); - orgivt.put("work_seq", change_info.optString("work_seq")); - orgivt.put("workflow_code", change_info.optString("workflow_code")); - orgivt.put("change_time", WDK.getDateTime()); - ResultBean resultBean = WQLObject.getWQLObject(STIVTORGIVT_TABLE).insert(orgivt); - }else { - - String ivt_qty = orderObj.optString("ivt_qty"); - if(uString.isBlank(ivt_qty)) throw new WDKException("[组织库存库存量]不能为空"); - ivt_qty = uMath.add(ivt_qty, changecanuse_qty, 4, BigDecimal.ROUND_HALF_UP) ; - String ivt_num = orderObj.optString("ivt_num"); - if(uString.isBlank(ivt_num)) throw new WDKException("[组织库存库存数]不能为空"); - ivt_num = uMath.add(ivt_num, changecanuse_num, 4, BigDecimal.ROUND_HALF_UP) ; - - map = new HashMap<>(); - map.put("ivt_qty", ivt_qty); - map.put("ivt_num", ivt_num); - map.put("change_time", WDK.getDateTime()); - if(uString.isBlank(workflow_code)){ - WQLObject.getWQLObject(STIVTORGIVT_TABLE) - .update(map,"org_uuid = ? and material_uuid = ? and ivt_type_code = ?", new String[] { org_uuid, material_uuid,ivt_type_code }); - }else { - WQLObject.getWQLObject(STIVTORGIVT_TABLE) - .update(map,"org_uuid = ? and material_uuid = ? and ivt_type_code = ? AND workflow_code = ? AND work_seq = ?", new String[] { org_uuid, material_uuid,ivt_type_code,workflow_code, work_seq}); - - } - } - }*//* - - //仓库库存 - if(uString.isNotBlank(stor_uuid)) { - orderObj = WQLObject.getWQLObject(STIVTSTORIVT_TABLE) - .query("org_uuid = ? and material_uuid = ? and ivt_type_code = ? AND workflow_code = ? AND work_seq = ? and stor_uuid = ? AND quality_scode=?", new String[] { org_uuid, material_uuid,ivt_type_code,workflow_code, work_seq,stor_uuid,quality_scode}, "").uniqueResult(0); - - if(orderObj==null||orderObj.isNullObject()){ - JSONObject orgivt = new JSONObject(); - orgivt.put("stor_uuid", change_info.optString("stor_uuid")); - orgivt.put("stor_name", change_info.optString("stor_name")); - orgivt.put("material_uuid", change_info.optString("material_uuid")); - orgivt.put("material_code", change_info.optString("material_code")); - orgivt.put("material_name", change_info.optString("material_name")); - orgivt.put("ivt_type_code", ivt_type_code); - orgivt.put("org_uuid", change_info.optString("org_uuid")); - orgivt.put("canuse_qty", changecanuse_qty); - orgivt.put("quality_scode", quality_scode); - orgivt.put("frozen_qty", "0"); - orgivt.put("warehousing_qty", "0"); - orgivt.put("qc_qty", "0"); - orgivt.put("qty_unit_uuid", change_info.optString("qty_unit_uuid")); - orgivt.put("qty_unit_name", change_info.optString("qty_unit_name")); - orgivt.put("canuse_num", changecanuse_num); - orgivt.put("frozen_num", "0"); - orgivt.put("ivt_num", changecanuse_num); - orgivt.put("ivt_qty", changecanuse_qty); - orgivt.put("warehousing_num", "0"); - orgivt.put("qc_num", "0"); - orgivt.put("num_unit_uuid", change_info.optString("num_unit_uuid")); - orgivt.put("num_unit_name", change_info.optString("num_unit_name")); - orgivt.put("work_seq", change_info.optString("work_seq")); - orgivt.put("workflow_code", change_info.optString("workflow_code")); - orgivt.put("change_time", WDK.getDateTime()); - ResultBean resultBean = WQLObject.getWQLObject(STIVTSTORIVT_TABLE).insert(orgivt); - }else { - - String ivt_qty = orderObj.optString("ivt_qty"); - if(uString.isBlank(ivt_qty)) throw new WDKException("[仓库库存库存量]不能为空"); - ivt_qty = uMath.add(ivt_qty, changecanuse_qty, 4, BigDecimal.ROUND_HALF_UP) ; - String ivt_num = orderObj.optString("ivt_num"); - if(uString.isBlank(ivt_num)) throw new WDKException("[仓库库存库存数]不能为空"); - ivt_num = uMath.add(ivt_num, changecanuse_num, 4, BigDecimal.ROUND_HALF_UP) ; - - map = new HashMap<>(); - map.put("ivt_qty", ivt_qty); - map.put("ivt_num", ivt_num); - map.put("change_time", WDK.getDateTime()); - - WQLObject.getWQLObject(STIVTSTORIVT_TABLE).update(map, "org_uuid = ? AND material_uuid= ? AND ivt_type_code= ? AND workflow_code = ? AND work_seq = ? and stor_uuid = ? AND quality_scode=?", - new String[] { org_uuid,material_uuid,ivt_type_code,workflow_code, work_seq,stor_uuid,quality_scode }); - - }; - } - - srb.setSuccess(); - srb.setDesc("生成成功!"); - srb.addParam("change_qty", changecanuse_qty); - srb.addParam("change_num", changecanuse_num); - srb.addParam("changecanuse_qty", changecanuse_qty); - srb.addParam("changecanuse_num", changecanuse_num); - return srb; - } - - */ -/** - * 同时加库存数和可用数 - * - * @param context 上下文 - * @param op_account_uuid 操作账号标识 - * @param op_person_uuid 操作员标识 - * @param change_type 变动类型 orgivt-组织 storeivt-仓库 stackivt-仓位 - * @param change_info 待变动信息 - * @return before_canuse_qty 更新前可用数 - * before_frozen_qty 更新前冻结数 - * before_ivt_qty 更新前库存数 - * before_warehousing_qty 更新前待入数 - * before_qc_qty 更新前待检数 - *

- * change_canuse_qty 变化可用数 - * change_frozen_qty 变化冻结数 - * change_ivt_qty 变化库存数 - * change_warehousing_qty 变化待入数 - * change_qc_qty 变化待检数 - *

- * after_canuse_qty 更新后可用数 - * after_frozen_qty 更新后冻结数 - * after_ivt_qty 更新后库存数 - * after_warehousing_qty 更新后待入数 - * after_qc_qty 更新后待检数 - *//* - - @Override - @WDKTransaction - public ServiceResultBean addBothQty(ServiceContext context, String op_account_uuid, String op_person_uuid, String change_type, JSONObject change_info) { - ServiceResultBean srb = new ServiceResultBean(); - if(change_info==null||change_info.isNullObject()) throw new WDKException("[待变动信息]不能为空"); - String org_uuid = change_info.optString("org_uuid"); - if(uString.isBlank(org_uuid)) throw new WDKException("[组织id]不能为空"); - String pcsn = change_info.optString("pcsn"); - String changecanuse_qty = change_info.optString("ivt_qty"); - if(uString.isBlank(changecanuse_qty)) throw new WDKException("[变动库存量]不能为空"); - String changecanuse_num = change_info.optString("ivt_num"); - if(uString.isBlank(changecanuse_num)) throw new WDKException("[变动库存数]不能为空"); - String material_uuid = change_info.optString("material_uuid"); - if(uString.isBlank(material_uuid)) throw new WDKException("[物料id]不能为空"); - String ivt_type_code = change_info.optString("ivt_type_code"); - if(uString.isBlank(ivt_type_code)) ivt_type_code ="01";//throw new WDKException("[库存类型]不能为空"); - String change_qty = change_info.optString("change_qty"); - String change_num = change_info.optString("change_num"); - String quality_scode = change_info.optString("quality_scode"); - - String struct_uuid = change_info.optString("struct_uuid"); - String stor_uuid = change_info.optString("stor_uuid"); - JSONObject orderObj = new JSONObject(); - String canuse_qty =""; - String canuse_num =""; - HashMap map = new HashMap<>(); - String order_code = change_info.optString("order_code"); - String workflow_code = change_info.optString("workflow_code"); - String work_seq = change_info.optString("work_seq"); - //仓位 - if(uString.isNotBlank(struct_uuid)) { - - //仓位库存 - orderObj = WQLObject.getWQLObject(STIVTSTACKIVT_TABLE).query("org_uuid = ? and order_code = ? and work_seq = ? and workflow_code = ? and ivt_type_code = ? and struct_uuid = ? and stor_uuid = ? and material_uuid = ? AND pcsn=? AND quality_scode=?", new String[] { org_uuid, order_code,work_seq,workflow_code,ivt_type_code ,struct_uuid,stor_uuid,material_uuid,pcsn,quality_scode}, "").uniqueResult(0); - - if(orderObj==null||orderObj.isNullObject()){ - JSONObject orgivt = new JSONObject(); - orgivt.put("struct_uuid", change_info.optString("struct_uuid")); - orgivt.put("struct_name", change_info.optString("struct_name")); - orgivt.put("material_uuid", change_info.optString("material_uuid")); - orgivt.put("material_code", change_info.optString("material_code")); - orgivt.put("material_name", change_info.optString("material_name")); - orgivt.put("order_code", change_info.optString("order_code")); - orgivt.put("quality_scode", quality_scode); - orgivt.put("work_seq", change_info.optString("work_seq")); - orgivt.put("workflow_code", change_info.optString("workflow_code")); - orgivt.put("ivt_type_code", ivt_type_code); - orgivt.put("pcsn", change_info.optString("pcsn")); - orgivt.put("org_uuid", change_info.optString("org_uuid")); - orgivt.put("stor_uuid", change_info.optString("stor_uuid")); - orgivt.put("stor_name", change_info.optString("stor_name")); - orgivt.put("quality_type_scode", change_info.optString("quality_type_scode")); - orgivt.put("canuse_qty", changecanuse_qty); - orgivt.put("frozen_qty", "0"); - orgivt.put("ivt_qty", changecanuse_qty); - orgivt.put("warehousing_qty", "0"); - orgivt.put("qc_qty", "0"); - orgivt.put("qty_unit_uuid", change_info.optString("qty_unit_uuid")); - orgivt.put("qty_unit_name", change_info.optString("qty_unit_name")); - orgivt.put("number_type_scode", change_info.optString("number_type_scode")); - orgivt.put("canuse_num", changecanuse_num); - orgivt.put("frozen_num", "0"); - orgivt.put("ivt_num", changecanuse_num); - orgivt.put("warehousing_num", "0"); - orgivt.put("qc_num", "0"); - orgivt.put("num_unit_uuid", change_info.optString("num_unit_uuid")); - orgivt.put("num_unit_name", change_info.optString("num_unit_name")); - orgivt.put("change_time", WDK.getDateTime()); - ResultBean resultBean = WQLObject.getWQLObject(STIVTSTACKIVT_TABLE).insert(orgivt); - }else { - String ivt_qty = orderObj.optString("ivt_qty"); - canuse_qty = orderObj.optString("canuse_qty"); - if(uString.isBlank(ivt_qty)) throw new WDKException("[仓位库存库存量]不能为空"); - ivt_qty = uMath.add(ivt_qty, changecanuse_qty, 4, BigDecimal.ROUND_HALF_UP) ; - - canuse_qty = uMath.add(canuse_qty, change_qty, 4, BigDecimal.ROUND_HALF_UP) ; - String ivt_num = orderObj.optString("ivt_num"); - canuse_num = orderObj.optString("canuse_num"); - if(uString.isBlank(ivt_num)) throw new WDKException("[仓位库存库存数]不能为空"); - ivt_num = uMath.add(ivt_num, changecanuse_num, 4, BigDecimal.ROUND_HALF_UP) ; - canuse_num = uMath.add(canuse_num, change_num, 4, BigDecimal.ROUND_HALF_UP) ; - - map = new HashMap<>(); - map.put("ivt_qty", ivt_qty); - map.put("canuse_qty", canuse_qty); - map.put("ivt_num", ivt_num); - map.put("canuse_num", canuse_num); - map.put("change_time", WDK.getDateTime()); - WQLObject.getWQLObject(STIVTSTACKIVT_TABLE).update(map,"org_uuid = ? and order_code = ? and work_seq = ? and workflow_code = ? and ivt_type_code = ? and struct_uuid = ? and stor_uuid = ? and material_uuid = ? AND pcsn=? AND quality_scode=?", new String[] { org_uuid, order_code,work_seq,workflow_code,ivt_type_code ,struct_uuid,stor_uuid,material_uuid,pcsn,quality_scode}); - - } - - - } - if(uString.isNotBlank(org_uuid)) { - - orderObj = WQLObject.getWQLObject(STIVTORGIVT_TABLE) - .query("org_uuid = ? and material_uuid = ? and ivt_type_code = ? AND workflow_code = ? AND work_seq = ?", new String[] { org_uuid, material_uuid,ivt_type_code,workflow_code, work_seq}, "").uniqueResult(0); - - if(orderObj==null||orderObj.isNullObject()){ - - JSONObject orgivt = new JSONObject(); - orgivt.put("org_uuid", change_info.optString("org_uuid")); - orgivt.put("material_uuid", change_info.optString("material_uuid")); - orgivt.put("material_code", change_info.optString("material_code")); - orgivt.put("material_name", change_info.optString("material_name")); - orgivt.put("ivt_type_code", ivt_type_code); - orgivt.put("canuse_qty", changecanuse_qty); - orgivt.put("frozen_qty", "0"); - orgivt.put("stayin_qty", "0"); - orgivt.put("qc_qty", "0"); - orgivt.put("qty_unit_uuid", change_info.optString("qty_unit_uuid")); - orgivt.put("qty_unit_name", change_info.optString("qty_unit_name")); - orgivt.put("canuse_num", changecanuse_num); - orgivt.put("ivt_num", "0"); - orgivt.put("ivt_qty", "0"); - orgivt.put("frozen_num", "0"); - orgivt.put("warehousing_num", "0"); - orgivt.put("qc_num", "0"); - orgivt.put("num_unit_uuid", change_info.optString("num_unit_uuid")); - orgivt.put("num_unit_name", change_info.optString("num_unit_name")); - orgivt.put("work_seq", change_info.optString("work_seq")); - orgivt.put("workflow_code", change_info.optString("workflow_code")); - orgivt.put("change_time", WDK.getDateTime()); - ResultBean resultBean = WQLObject.getWQLObject(STIVTORGIVT_TABLE).insert(orgivt); - }else { - - String ivt_qty = orderObj.optString("ivt_qty"); - canuse_qty = orderObj.optString("canuse_qty"); - if(uString.isBlank(ivt_qty)) throw new WDKException("[组织库存库存量]不能为空"); - ivt_qty = uMath.add(ivt_qty, changecanuse_qty, 4, BigDecimal.ROUND_HALF_UP) ; - canuse_qty = uMath.add(canuse_qty, change_qty, 4, BigDecimal.ROUND_HALF_UP) ; - String ivt_num = orderObj.optString("ivt_num"); - canuse_num = orderObj.optString("canuse_num"); - if(uString.isBlank(ivt_num)) throw new WDKException("[组织库存库存数]不能为空"); - ivt_num = uMath.add(ivt_num, changecanuse_num, 4, BigDecimal.ROUND_HALF_UP) ; - canuse_num = uMath.add(canuse_num, change_num, 4, BigDecimal.ROUND_HALF_UP) ; - - map = new HashMap<>(); - // map.put("ivt_qty", ivt_qty); - map.put("canuse_qty", canuse_qty); - // map.put("ivt_num", ivt_num); - map.put("canuse_num", canuse_num); - map.put("change_time", WDK.getDateTime()); - - WQLObject.getWQLObject(STIVTORGIVT_TABLE) - .update(map,"org_uuid = ? and material_uuid = ? and ivt_type_code = ? AND workflow_code = ? AND work_seq = ?", new String[] { org_uuid, material_uuid,ivt_type_code,workflow_code, work_seq}); - - - } - } - //仓库库存 - if(uString.isNotBlank(stor_uuid)) { - - orderObj = WQLObject.getWQLObject(STIVTSTORIVT_TABLE) - .query("org_uuid = ? and material_uuid = ? and ivt_type_code = ? AND workflow_code = ? AND work_seq = ? and stor_uuid = ? AND quality_scode=?", new String[] { org_uuid, material_uuid,ivt_type_code,workflow_code, work_seq,stor_uuid,quality_scode}, "").uniqueResult(0); - - if(orderObj==null||orderObj.isNullObject()){ - JSONObject orgivt = new JSONObject(); - orgivt.put("stor_uuid", change_info.optString("stor_uuid")); - orgivt.put("stor_name", change_info.optString("stor_name")); - orgivt.put("material_uuid", change_info.optString("material_uuid")); - orgivt.put("material_code", change_info.optString("material_code")); - orgivt.put("material_name", change_info.optString("material_name")); - orgivt.put("ivt_type_code", ivt_type_code); - orgivt.put("org_uuid", change_info.optString("org_uuid")); - orgivt.put("canuse_qty", changecanuse_qty); - orgivt.put("quality_scode", quality_scode); - orgivt.put("frozen_qty", "0"); - orgivt.put("stayin_qty", "0"); - orgivt.put("qc_qty", "0"); - orgivt.put("qty_unit_uuid", change_info.optString("qty_unit_uuid")); - orgivt.put("qty_unit_name", change_info.optString("qty_unit_name")); - orgivt.put("canuse_num", changecanuse_num); - orgivt.put("frozen_num", "0"); - orgivt.put("ivt_num", changecanuse_num); - orgivt.put("ivt_qty", changecanuse_qty); - orgivt.put("warehousing_num", "0"); - orgivt.put("qc_num", "0"); - orgivt.put("num_unit_uuid", change_info.optString("num_unit_uuid")); - orgivt.put("num_unit_name", change_info.optString("num_unit_name")); - orgivt.put("work_seq", change_info.optString("work_seq")); - orgivt.put("workflow_code", change_info.optString("workflow_code")); - orgivt.put("change_time", WDK.getDateTime()); - ResultBean resultBean = WQLObject.getWQLObject(STIVTSTORIVT_TABLE).insert(orgivt); - }else { - - String ivt_qty = orderObj.optString("ivt_qty"); - canuse_qty = orderObj.optString("canuse_qty"); - if(uString.isBlank(ivt_qty)) throw new WDKException("[仓库库存库存量]不能为空"); - ivt_qty = uMath.add(ivt_qty, changecanuse_qty, 4, BigDecimal.ROUND_HALF_UP) ; - canuse_qty = uMath.add(canuse_qty, change_qty, 4, BigDecimal.ROUND_HALF_UP) ; - String ivt_num = orderObj.optString("ivt_num"); - canuse_num = orderObj.optString("canuse_num"); - if(uString.isBlank(ivt_num)) throw new WDKException("[仓库库存库存数]不能为空"); - ivt_num = uMath.add(ivt_num, changecanuse_num, 4, BigDecimal.ROUND_HALF_UP) ; - canuse_num = uMath.add(canuse_num, change_num, 4, BigDecimal.ROUND_HALF_UP) ; - - map = new HashMap<>(); - map.put("ivt_qty", ivt_qty); - map.put("canuse_qty", canuse_qty); - map.put("ivt_num", ivt_num); - map.put("canuse_num", canuse_num); - map.put("change_time", WDK.getDateTime()); - - WQLObject.getWQLObject(STIVTSTORIVT_TABLE).update(map, "org_uuid = ? AND material_uuid= ? AND ivt_type_code= ? AND workflow_code = ? AND work_seq = ? and stor_uuid = ? AND quality_scode=?", - new String[] { org_uuid,material_uuid,ivt_type_code,workflow_code, work_seq,stor_uuid ,quality_scode}); - - }; - } - - srb.setSuccess(); - srb.setDesc("生成成功!"); - srb.addParam("change_qty", change_qty); - srb.addParam("changecanuse_qty", changecanuse_qty); - srb.addParam("change_num", change_num); - srb.addParam("changecanuse_num", changecanuse_num); - return srb; - } - - */ -/** - * 同时减库存和可用数 - * - * @param context 上下文 - * @param op_account_uuid 操作账号标识 - * @param op_person_uuid 操作员标识 - * @param change_type 变动类型 orgivt-组织 storeivt-仓库 stackivt-仓位 - * @param change_info 待变动信息 - * @return before_canuse_qty 更新前可用数 - * before_frozen_qty 更新前冻结数 - * before_ivt_qty 更新前库存数 - * before_warehousing_qty 更新前待入数 - * before_qc_qty 更新前待检数 - *

- * change_canuse_qty 变化可用数 - * change_frozen_qty 变化冻结数 - * change_ivt_qty 变化库存数 - * change_warehousing_qty 变化待入数 - * change_qc_qty 变化待检数 - *

- * after_canuse_qty 更新后可用数 - * after_frozen_qty 更新后冻结数 - * after_ivt_qty 更新后库存数 - * after_warehousing_qty 更新后待入数 - * after_qc_qty 更新后待检数 - *//* - - @Override - @WDKTransaction - public ServiceResultBean minusBothQty(ServiceContext context, String op_account_uuid, String op_person_uuid, String change_type, JSONObject change_info) { - ServiceResultBean srb = new ServiceResultBean(); - if(change_info==null||change_info.isNullObject()) throw new WDKException("[待变动信息]不能为空"); - String org_uuid = change_info.optString("org_uuid"); - if(uString.isBlank(org_uuid)) throw new WDKException("[组织id]不能为空"); - String pcsn = change_info.optString("pcsn"); - String changecanuse_qty = change_info.optString("ivt_qty"); - if(uString.isBlank(changecanuse_qty)) throw new WDKException("[变动库存量]不能为空"); - String changecanuse_num = change_info.optString("ivt_num"); - if(uString.isBlank(changecanuse_num)) throw new WDKException("[变动库存数]不能为空"); - String material_uuid = change_info.optString("material_uuid"); - if(uString.isBlank(material_uuid)) throw new WDKException("[物料id]不能为空"); - String ivt_type_code = change_info.optString("ivt_type_code"); - if(uString.isBlank(ivt_type_code)) ivt_type_code ="01";//throw new WDKException("[库存类型]不能为空"); - String change_qty = change_info.optString("change_qty"); - String change_num = change_info.optString("change_num"); - String quality_scode = change_info.optString("quality_scode"); - - String struct_uuid = change_info.optString("struct_uuid"); - String stor_uuid = change_info.optString("stor_uuid"); - JSONObject orderObj = new JSONObject(); - String canuse_qty =""; - String canuse_num =""; - HashMap map = new HashMap<>(); - String order_code = change_info.optString("order_code"); - String workflow_code = change_info.optString("workflow_code"); - String work_seq = change_info.optString("work_seq"); - //仓位 - if(uString.isNotBlank(struct_uuid)) { - - - orderObj = WQLObject.getWQLObject(STIVTSTACKIVT_TABLE).query("org_uuid = ? and order_code = ? and work_seq = ? and workflow_code = ? and ivt_type_code = ? and struct_uuid = ? and stor_uuid = ? and material_uuid = ? AND pcsn=? AND quality_scode=?", new String[] { org_uuid, order_code,work_seq,workflow_code,ivt_type_code ,struct_uuid,stor_uuid,material_uuid,pcsn,quality_scode}, "").uniqueResult(0); - - if(orderObj==null||orderObj.isNullObject()){ - throw new WDKException("[仓位库存]不存在"); - }else { - String ivt_qty = orderObj.optString("ivt_qty"); - canuse_qty = orderObj.optString("canuse_qty"); - if(uString.isBlank(ivt_qty)) throw new WDKException("[仓位库存库存量]不能为空"); - ivt_qty = uMath.subtract(ivt_qty, changecanuse_qty, 4, BigDecimal.ROUND_HALF_UP) ; - JSONObject qty = new JSONObject(); - qty.put("canuse",ivt_qty); - if(qty.optInt("canuse")<0) { - throw new WDKException("[仓位库存可用量]不足"); - } - canuse_qty = uMath.subtract(canuse_qty, change_qty, 4, BigDecimal.ROUND_HALF_UP) ; - qty.put("canuse",canuse_qty); - if(qty.optInt("canuse")<0) { - throw new WDKException("[仓位可用量]不足"); - } - String ivt_num = orderObj.optString("ivt_num"); - - canuse_num = orderObj.optString("canuse_num"); - if(uString.isBlank(ivt_num)) throw new WDKException("[仓位库存库存数]不能为空"); - ivt_num = uMath.subtract(ivt_num, changecanuse_num, 4, BigDecimal.ROUND_HALF_UP) ; - qty.put("canuse",ivt_num); - if(qty.optInt("canuse")<0) { - throw new WDKException("[仓位库存可用数]不足"); - } - canuse_num = uMath.subtract(canuse_num, change_num, 4, BigDecimal.ROUND_HALF_UP) ; - qty.put("canuse",canuse_num); - if(qty.optInt("canuse")<0) { - throw new WDKException("[仓位可用数]不足"); - } - - map = new HashMap<>(); - map.put("ivt_qty", ivt_qty); - map.put("canuse_qty", canuse_qty); - map.put("ivt_num", ivt_num); - map.put("canuse_num", canuse_num); - map.put("change_time", WDK.getDateTime()); - - WQLObject.getWQLObject(STIVTSTACKIVT_TABLE).update(map,"org_uuid = ? and order_code = ? and work_seq = ? and workflow_code = ? and ivt_type_code = ? and struct_uuid = ? and stor_uuid = ? and material_uuid = ? AND pcsn=? AND quality_scode=?", new String[] { org_uuid, order_code,work_seq,workflow_code,ivt_type_code ,struct_uuid,stor_uuid,material_uuid,pcsn,quality_scode}); - String nums = uMath.subtract(canuse_qty, ivt_qty, 0, BigDecimal.ROUND_HALF_UP); - nums = uMath.subtract(nums, ivt_num, 0, BigDecimal.ROUND_HALF_UP) ; - nums = uMath.subtract(nums, canuse_num, 0, BigDecimal.ROUND_HALF_UP) ; - if("0".equals(nums)){ - WQLObject.getWQLObject(STIVTSTACKIVT_TABLE).delete("org_uuid = ? and order_code = ? and work_seq = ? and workflow_code = ? and ivt_type_code = ? and struct_uuid = ? and stor_uuid = ? and material_uuid = ? AND pcsn=? AND quality_scode=?", new String[] { org_uuid, order_code,work_seq,workflow_code,ivt_type_code ,struct_uuid,stor_uuid,material_uuid,pcsn,quality_scode}); - - } - - } - - - } - if(uString.isNotBlank(org_uuid)) { - orderObj = WQLObject.getWQLObject(STIVTORGIVT_TABLE) - .query("org_uuid = ? and material_uuid = ? and ivt_type_code = ? AND workflow_code = ? AND work_seq = ?", new String[] { org_uuid, material_uuid,ivt_type_code,workflow_code, work_seq}, "").uniqueResult(0); - - if(orderObj==null||orderObj.isNullObject()){ - - throw new WDKException("[组织库存]不存在"); - }else { - - // String ivt_qty = orderObj.optString("ivt_qty"); - canuse_qty = orderObj.optString("canuse_qty"); - //if(uString.isBlank(ivt_qty)) throw new WDKException("[组织库存库存量]不能为空"); - // ivt_qty = uMath.subtract(ivt_qty, changecanuse_qty, 4, BigDecimal.ROUND_HALF_UP) ; - canuse_qty = uMath.subtract(canuse_qty, change_qty, 4, BigDecimal.ROUND_HALF_UP) ; - JSONObject qty = new JSONObject(); - qty.put("canuse",canuse_qty); - if(qty.optInt("canuse")<0) { - throw new WDKException("[组织库存可用量]不足"); - } - // String ivt_num = orderObj.optString("ivt_num"); - canuse_num = orderObj.optString("canuse_num"); - // if(uString.isBlank(ivt_num)) throw new WDKException("[组织库存库存数]不能为空"); - // ivt_num = uMath.subtract(ivt_num, changecanuse_num, 4, BigDecimal.ROUND_HALF_UP) ; - canuse_num = uMath.subtract(canuse_num, change_num, 4, BigDecimal.ROUND_HALF_UP) ; - qty.put("canuse",canuse_num); - if(qty.optInt("canuse")<0) { - throw new WDKException("[组织库存可用数]不足"); - } - map = new HashMap<>(); - // map.put("ivt_qty", ivt_qty); - map.put("canuse_qty", canuse_qty); - // map.put("ivt_num", ivt_num); - map.put("canuse_num", canuse_num); - map.put("change_time", WDK.getDateTime()); - - - WQLObject.getWQLObject(STIVTORGIVT_TABLE) - .update(map,"org_uuid = ? and material_uuid = ? and ivt_type_code = ? AND workflow_code = ? AND work_seq = ? ", new String[] { org_uuid, material_uuid,ivt_type_code,workflow_code, work_seq,}); - String nums = uMath.subtract(canuse_qty, canuse_num, 0, BigDecimal.ROUND_HALF_UP); - if("0".equals(nums)){ - WQLObject.getWQLObject(STIVTORGIVT_TABLE) - .delete("org_uuid = ? and material_uuid = ? and ivt_type_code = ? AND workflow_code = ? AND work_seq = ? ", new String[] { org_uuid, material_uuid,ivt_type_code,workflow_code, work_seq,}); - - } - - } - } - //仓库库存 - if(uString.isNotBlank(stor_uuid)) { - - orderObj = WQLObject.getWQLObject(STIVTSTORIVT_TABLE) - .query("org_uuid = ? and material_uuid = ? and ivt_type_code = ? AND workflow_code = ? AND work_seq = ? and stor_uuid = ? AND quality_scode=?", new String[] { org_uuid, material_uuid,ivt_type_code,workflow_code, work_seq,stor_uuid,quality_scode}, "").uniqueResult(0); - - if(orderObj==null||orderObj.isNullObject()){ - throw new WDKException("[仓库库存]不存在"); - }else { - String ivt_qty = orderObj.optString("ivt_qty"); - canuse_qty = orderObj.optString("canuse_qty"); - if(uString.isBlank(ivt_qty)) throw new WDKException("[仓库库存库存量]不能为空"); - ivt_qty = uMath.subtract(ivt_qty, changecanuse_qty, 4, BigDecimal.ROUND_HALF_UP) ; - JSONObject qty = new JSONObject(); - qty.put("canuse",ivt_qty); - if(qty.optInt("canuse")<0) { - throw new WDKException("[仓库库存可用量]不足"); - } - canuse_qty = uMath.subtract(canuse_qty, change_qty, 4, BigDecimal.ROUND_HALF_UP) ; - qty.put("canuse",canuse_qty); - if(qty.optInt("canuse")<0) { - throw new WDKException("[仓库可用量]不足"); - } - String ivt_num = orderObj.optString("ivt_num"); - - canuse_num = orderObj.optString("canuse_num"); - if(uString.isBlank(ivt_num)) throw new WDKException("[仓库库存库存数]不能为空"); - ivt_num = uMath.subtract(ivt_num, changecanuse_num, 4, BigDecimal.ROUND_HALF_UP) ; - qty.put("canuse",ivt_num); - if(qty.optInt("canuse")<0) { - throw new WDKException("[仓库库存可用数]不足"); - } - canuse_num = uMath.subtract(canuse_num, change_num, 4, BigDecimal.ROUND_HALF_UP) ; - qty.put("canuse",canuse_num); - if(qty.optInt("canuse")<0) { - throw new WDKException("[仓库可用数]不足"); - } - map = new HashMap<>(); - map.put("ivt_qty", ivt_qty); - map.put("canuse_qty", canuse_qty); - map.put("ivt_num", ivt_num); - map.put("canuse_num", canuse_num); - map.put("change_time", WDK.getDateTime()); - - WQLObject.getWQLObject(STIVTSTORIVT_TABLE).update(map, "org_uuid = ? AND material_uuid= ? AND ivt_type_code= ? AND workflow_code = ? AND work_seq = ? and stor_uuid = ? AND quality_scode=?", - new String[] { org_uuid,material_uuid,ivt_type_code,workflow_code, work_seq,stor_uuid,quality_scode }); - String nums = uMath.subtract(canuse_qty, ivt_qty, 0, BigDecimal.ROUND_HALF_UP); - nums = uMath.subtract(nums, ivt_num, 0, BigDecimal.ROUND_HALF_UP) ; - nums = uMath.subtract(nums, canuse_num, 0, BigDecimal.ROUND_HALF_UP) ; - if("0".equals(nums)){ - WQLObject.getWQLObject(STIVTSTORIVT_TABLE).delete("org_uuid = ? AND material_uuid= ? AND ivt_type_code= ? AND workflow_code = ? AND work_seq = ? and stor_uuid = ? AND quality_scode=?", - new String[] { org_uuid,material_uuid,ivt_type_code,workflow_code, work_seq,stor_uuid,quality_scode }); - - } - - }; - } - - srb.setSuccess(); - srb.setDesc("生成成功!"); - srb.addParam("change_qty", change_qty); - srb.addParam("changecanuse_qty", changecanuse_qty); - srb.addParam("change_num", change_num); - srb.addParam("changecanuse_num", changecanuse_num); - return srb; - } - - */ -/** - * 加带入 - * - * @param context 上下文 - * @param op_account_uuid 操作账号标识 - * @param op_person_uuid 操作员标识 - * @param change_type 变动类型 orgivt-组织 storeivt-仓库 stackivt-仓位 - * @param change_info 待变动信息 - * @return before_canuse_qty 更新前可用数 - * before_frozen_qty 更新前冻结数 - * before_ivt_qty 更新前库存数 - * before_warehousing_qty 更新前待入数 - * before_qc_qty 更新前待检数 - *

- * change_canuse_qty 变化可用数 - * change_frozen_qty 变化冻结数 - * change_ivt_qty 变化库存数 - * change_warehousing_qty 变化待入数 - * change_qc_qty 变化待检数 - *

- * after_canuse_qty 更新后可用数 - * after_frozen_qty 更新后冻结数 - * after_ivt_qty 更新后库存数 - * after_warehousing_qty 更新后待入数 - * after_qc_qty 更新后待检数 - *//* - - @Override - @WDKTransaction - public ServiceResultBean addStayinQty(ServiceContext context, String op_account_uuid, String op_person_uuid, String change_type, JSONObject change_info) { - ServiceResultBean srb = new ServiceResultBean(); - if(change_info==null||change_info.isNullObject()) throw new WDKException("[待变动信息]不能为空"); - String org_uuid = change_info.optString("org_uuid"); - if(uString.isBlank(org_uuid)) throw new WDKException("[组织id]不能为空"); - String pcsn = change_info.optString("pcsn"); - String changecanuse_qty = change_info.optString("change_qty"); - if(uString.isBlank(changecanuse_qty)) throw new WDKException("[变动库存量]不能为空"); - String changecanuse_num = change_info.optString("change_num"); - if(uString.isBlank(changecanuse_num)) throw new WDKException("[变动库存数]不能为空"); - String material_uuid = change_info.optString("material_uuid"); - if(uString.isBlank(material_uuid)) throw new WDKException("[物料id]不能为空"); - String ivt_type_code = change_info.optString("ivt_type_code"); - if(uString.isBlank(ivt_type_code)) ivt_type_code ="01";//throw new WDKException("[库存类型]不能为空"); - String struct_uuid = change_info.optString("struct_uuid"); - String stor_uuid = change_info.optString("stor_uuid"); - JSONObject orderObj = new JSONObject(); - HashMap map = new HashMap<>(); - String order_code = change_info.optString("order_code"); - String workflow_code = change_info.optString("workflow_code"); - String work_seq = change_info.optString("work_seq"); - String quality_scode = change_info.optString("quality_scode"); - - //仓位 - if(uString.isNotBlank(struct_uuid)) { - - //仓位库存 - orderObj = WQLObject.getWQLObject(STIVTSTACKIVT_TABLE).query("org_uuid = ? and order_code = ? and work_seq = ? and workflow_code = ? and ivt_type_code = ? and struct_uuid = ? and stor_uuid = ? and material_uuid = ? AND pcsn=? AND quality_scode=?", new String[] { org_uuid, order_code,work_seq,workflow_code,ivt_type_code ,struct_uuid,stor_uuid,material_uuid,pcsn,quality_scode}, "").uniqueResult(0); - if(orderObj==null||orderObj.isNullObject()){ - JSONObject orgivt = new JSONObject(); - orgivt.put("struct_uuid", change_info.optString("struct_uuid")); - orgivt.put("struct_name", change_info.optString("struct_name")); - orgivt.put("material_uuid", change_info.optString("material_uuid")); - orgivt.put("material_code", change_info.optString("material_code")); - orgivt.put("material_name", change_info.optString("material_name")); - orgivt.put("order_code", change_info.optString("order_code")); - orgivt.put("quality_scode", change_info.optString("quality_scode")); - - orgivt.put("work_seq", change_info.optString("work_seq")); - orgivt.put("workflow_code", change_info.optString("workflow_code")); - orgivt.put("ivt_type_code", ivt_type_code); - orgivt.put("pcsn", change_info.optString("pcsn")); - orgivt.put("org_uuid", change_info.optString("org_uuid")); - orgivt.put("stor_uuid", change_info.optString("stor_uuid")); - orgivt.put("stor_name", change_info.optString("stor_name")); - orgivt.put("quality_type_scode", change_info.optString("quality_type_scode")); - orgivt.put("canuse_qty", "0"); - orgivt.put("frozen_qty", "0"); - orgivt.put("ivt_qty", "0"); - orgivt.put("warehousing_qty", changecanuse_qty); - orgivt.put("qc_qty", "0"); - orgivt.put("qty_unit_uuid", change_info.optString("qty_unit_uuid")); - orgivt.put("qty_unit_name", change_info.optString("qty_unit_name")); - orgivt.put("number_type_scode", change_info.optString("number_type_scode")); - orgivt.put("canuse_num", "0"); - orgivt.put("frozen_num", "0"); - orgivt.put("ivt_num", "0"); - orgivt.put("warehousing_num", changecanuse_num); - orgivt.put("qc_num", "0"); - orgivt.put("num_unit_uuid", change_info.optString("num_unit_uuid")); - orgivt.put("num_unit_name", change_info.optString("num_unit_name")); - orgivt.put("change_time", WDK.getDateTime()); - ResultBean resultBean = WQLObject.getWQLObject(STIVTSTACKIVT_TABLE).insert(orgivt); - }else { - String warehousing_qty = orderObj.optString("warehousing_qty"); - if(uString.isBlank(warehousing_qty)) throw new WDKException("[仓位待入量]不能为空"); - warehousing_qty = uMath.add(warehousing_qty, changecanuse_qty, 4, BigDecimal.ROUND_HALF_UP) ; - String warehousing_num = orderObj.optString("warehousing_num"); - if(uString.isBlank(warehousing_num)) throw new WDKException("[仓位待入]不能为空"); - warehousing_num = uMath.add(warehousing_num, changecanuse_num, 4, BigDecimal.ROUND_HALF_UP) ; - map = new HashMap<>(); - map.put("warehousing_qty", warehousing_qty); - map.put("warehousing_num", warehousing_num); - map.put("change_time", WDK.getDateTime()); - WQLObject.getWQLObject(STIVTSTACKIVT_TABLE).update(map,"org_uuid = ? and order_code = ? and work_seq = ? and workflow_code = ? and ivt_type_code = ? and struct_uuid = ? and stor_uuid = ? and material_uuid = ? AND pcsn=? AND quality_scode=?", new String[] { org_uuid, order_code,work_seq,workflow_code,ivt_type_code ,struct_uuid,stor_uuid,material_uuid,pcsn,quality_scode}); - - } - - - } - */ -/*if(uString.isNotBlank(org_uuid)) { - if(uString.isBlank(workflow_code)){ - orderObj = WQLObject.getWQLObject(STIVTORGIVT_TABLE) - .query("org_uuid = ? and material_uuid = ? and ivt_type_code = ?", new String[] { org_uuid, material_uuid,ivt_type_code }, "").uniqueResult(0); - }else { - orderObj = WQLObject.getWQLObject(STIVTORGIVT_TABLE) - .query("org_uuid = ? and material_uuid = ? and ivt_type_code = ? AND workflow_code = ? AND work_seq = ?", new String[] { org_uuid, material_uuid,ivt_type_code,workflow_code, work_seq}, "").uniqueResult(0); - - } - - - if(orderObj==null||orderObj.isNullObject()){ - - JSONObject orgivt = new JSONObject(); - orgivt.put("org_uuid", change_info.optString("org_uuid")); - orgivt.put("material_uuid", change_info.optString("material_uuid")); - orgivt.put("material_code", change_info.optString("material_code")); - orgivt.put("material_name", change_info.optString("material_name")); - orgivt.put("ivt_type_code", ivt_type_code); - orgivt.put("canuse_qty", "0"); - orgivt.put("frozen_qty", "0"); - orgivt.put("stayin_qty", changecanuse_qty); - orgivt.put("qc_qty", "0"); - orgivt.put("qty_unit_uuid", change_info.optString("qty_unit_uuid")); - orgivt.put("qty_unit_name", change_info.optString("qty_unit_name")); - orgivt.put("canuse_num", "0"); - orgivt.put("ivt_num", "0"); - orgivt.put("ivt_qty", "0"); - orgivt.put("frozen_num", "0"); - orgivt.put("warehousing_num", changecanuse_num); - orgivt.put("qc_num", "0"); - orgivt.put("num_unit_uuid", change_info.optString("num_unit_uuid")); - orgivt.put("num_unit_name", change_info.optString("num_unit_name")); - orgivt.put("work_seq", change_info.optString("work_seq")); - orgivt.put("workflow_code", change_info.optString("workflow_code")); - orgivt.put("change_time", WDK.getDateTime()); - ResultBean resultBean = WQLObject.getWQLObject(STIVTORGIVT_TABLE).insert(orgivt); - }else { - - String warehousing_qty = orderObj.optString("stayin_qty"); - if(uString.isBlank(warehousing_qty)) throw new WDKException("[组织库存待入量]不能为空"); - warehousing_qty = uMath.add(warehousing_qty, changecanuse_qty, 4, BigDecimal.ROUND_HALF_UP) ; - String warehousing_num = orderObj.optString("warehousing_num"); - if(uString.isBlank(warehousing_num)) throw new WDKException("[组织库存待入数]不能为空"); - warehousing_num = uMath.add(warehousing_num, changecanuse_num, 4, BigDecimal.ROUND_HALF_UP) ; - - map = new HashMap<>(); - map.put("stayin_qty", warehousing_qty); - map.put("warehousing_num", warehousing_num); - map.put("change_time", WDK.getDateTime()); - if(uString.isBlank(workflow_code)){ - WQLObject.getWQLObject(STIVTORGIVT_TABLE) - .update(map,"org_uuid = ? and material_uuid = ? and ivt_type_code = ?", new String[] { org_uuid, material_uuid,ivt_type_code }); - }else { - WQLObject.getWQLObject(STIVTORGIVT_TABLE) - .update(map,"org_uuid = ? and material_uuid = ? and ivt_type_code = ? AND workflow_code = ? AND work_seq = ?", new String[] { org_uuid, material_uuid,ivt_type_code,workflow_code, work_seq}); - - } - } - }*//* - - //仓库库存 - */ -/*if(uString.isNotBlank(stor_uuid)) { - if(uString.isBlank(workflow_code)){ - orderObj = WQLObject.getWQLObject(STIVTSTORIVT_TABLE) - .query("org_uuid = ? and material_uuid = ? and ivt_type_code = ? and stor_uuid = ?", new String[] { org_uuid, material_uuid,ivt_type_code ,stor_uuid}, "").uniqueResult(0); - - }else { - orderObj = WQLObject.getWQLObject(STIVTSTORIVT_TABLE) - .query("org_uuid = ? and material_uuid = ? and ivt_type_code = ? AND workflow_code = ? AND work_seq = ? and stor_uuid = ?", new String[] { org_uuid, material_uuid,ivt_type_code,workflow_code, work_seq,stor_uuid}, "").uniqueResult(0); - } - if(orderObj==null||orderObj.isNullObject()){ - JSONObject orgivt = new JSONObject(); - orgivt.put("stor_uuid", change_info.optString("stor_uuid")); - orgivt.put("stor_name", change_info.optString("stor_name")); - orgivt.put("material_uuid", change_info.optString("material_uuid")); - orgivt.put("material_code", change_info.optString("material_code")); - orgivt.put("material_name", change_info.optString("material_name")); - orgivt.put("ivt_type_code", ivt_type_code); - orgivt.put("org_uuid", change_info.optString("org_uuid")); - orgivt.put("canuse_qty", "0"); - orgivt.put("frozen_qty", "0"); - orgivt.put("stayin_qty", changecanuse_qty); - orgivt.put("qc_qty", "0"); - orgivt.put("qty_unit_uuid", change_info.optString("qty_unit_uuid")); - orgivt.put("qty_unit_name", change_info.optString("qty_unit_name")); - orgivt.put("canuse_num", "0"); - orgivt.put("frozen_num", "0"); - orgivt.put("ivt_num", "0"); - orgivt.put("ivt_qty", "0"); - orgivt.put("warehousing_num", changecanuse_num); - orgivt.put("qc_num", "0"); - orgivt.put("num_unit_uuid", change_info.optString("num_unit_uuid")); - orgivt.put("num_unit_name", change_info.optString("num_unit_name")); - orgivt.put("work_seq", change_info.optString("work_seq")); - orgivt.put("workflow_code", change_info.optString("workflow_code")); - orgivt.put("change_time", WDK.getDateTime()); - ResultBean resultBean = WQLObject.getWQLObject(STIVTSTORIVT_TABLE).insert(orgivt); - }else { - - String warehousing_qty = orderObj.optString("stayin_qty"); - if(uString.isBlank(warehousing_qty)) throw new WDKException("[仓库库存待入量]不能为空"); - warehousing_qty = uMath.add(warehousing_qty, changecanuse_qty, 4, BigDecimal.ROUND_HALF_UP) ; - String warehousing_num = orderObj.optString("warehousing_num"); - if(uString.isBlank(warehousing_num)) throw new WDKException("[仓库库存待入数]不能为空"); - warehousing_num = uMath.add(warehousing_num, changecanuse_num, 4, BigDecimal.ROUND_HALF_UP) ; - - map = new HashMap<>(); - map.put("stayin_qty", warehousing_qty); - map.put("warehousing_num", warehousing_num); - map.put("change_time", WDK.getDateTime()); - if(uString.isBlank(workflow_code)){ - WQLObject.getWQLObject(STIVTSTORIVT_TABLE).update(map, "org_uuid = ? AND material_uuid= ? AND ivt_type_code= ? and stor_uuid = ?", - new String[] { org_uuid,material_uuid,ivt_type_code ,stor_uuid}); - }else { - WQLObject.getWQLObject(STIVTSTORIVT_TABLE).update(map, "org_uuid = ? AND material_uuid= ? AND ivt_type_code= ? AND workflow_code = ? AND work_seq = ? and stor_uuid = ?", - new String[] { org_uuid,material_uuid,ivt_type_code,workflow_code, work_seq,stor_uuid }); - } - }; - }*//* - - - srb.setSuccess(); - srb.setDesc("生成成功!"); - srb.addParam("change_qty", changecanuse_qty); - srb.addParam("change_num", changecanuse_num); - srb.addParam("changecanuse_qty", changecanuse_qty); - srb.addParam("changecanuse_num", changecanuse_num); - return srb; - } - - */ -/** - * 减待入 - * - * @param context 上下文 - * @param op_account_uuid 操作账号标识 - * @param op_person_uuid 操作员标识 - * @param change_type 变动类型 orgivt-组织 storeivt-仓库 stackivt-仓位 - * @param change_info 待变动信息 - * @return before_canuse_qty 更新前可用数 - * before_frozen_qty 更新前冻结数 - * before_ivt_qty 更新前库存数 - * before_warehousing_qty 更新前待入数 - * before_qc_qty 更新前待检数 - *

- * change_canuse_qty 变化可用数 - * change_frozen_qty 变化冻结数 - * change_ivt_qty 变化库存数 - * change_warehousing_qty 变化待入数 - * change_qc_qty 变化待检数 - *

- * after_canuse_qty 更新后可用数 - * after_frozen_qty 更新后冻结数 - * after_ivt_qty 更新后库存数 - * after_warehousing_qty 更新后待入数 - * after_qc_qty 更新后待检数 - *//* - - @Override - @WDKTransaction - public ServiceResultBean minusStayinQty(ServiceContext context, String op_account_uuid, String op_person_uuid, String change_type, JSONObject change_info) { - ServiceResultBean srb = new ServiceResultBean(); - if(change_info==null||change_info.isNullObject()) throw new WDKException("[待变动信息]不能为空"); - String org_uuid = change_info.optString("org_uuid"); - if(uString.isBlank(org_uuid)) throw new WDKException("[组织id]不能为空"); - String pcsn = change_info.optString("pcsn"); - String changecanuse_qty = change_info.optString("change_qty"); - if(uString.isBlank(changecanuse_qty)) throw new WDKException("[变动库存量]不能为空"); - String changecanuse_num = change_info.optString("change_num"); - if(uString.isBlank(changecanuse_num)) throw new WDKException("[变动库存数]不能为空"); - String material_uuid = change_info.optString("material_uuid"); - if(uString.isBlank(material_uuid)) throw new WDKException("[物料id]不能为空"); - String ivt_type_code = change_info.optString("ivt_type_code"); - if(uString.isBlank(ivt_type_code)) ivt_type_code ="01";//throw new WDKException("[库存类型]不能为空"); - String struct_uuid = change_info.optString("struct_uuid"); - String stor_uuid = change_info.optString("stor_uuid"); - JSONObject orderObj = new JSONObject(); - HashMap map = new HashMap<>(); - String order_code = change_info.optString("order_code"); - String workflow_code = change_info.optString("workflow_code"); - String work_seq = change_info.optString("work_seq"); - String quality_scode = change_info.optString("quality_scode"); - - //仓位 - if(uString.isNotBlank(struct_uuid)) { - - //仓位库存 - orderObj = WQLObject.getWQLObject(STIVTSTACKIVT_TABLE).query("org_uuid = ? and order_code = ? and work_seq = ? and workflow_code = ? and ivt_type_code = ? and struct_uuid = ? and stor_uuid = ? and material_uuid = ? AND pcsn=? AND quality_scode=?", new String[] { org_uuid, order_code,work_seq,workflow_code,ivt_type_code ,struct_uuid,stor_uuid,material_uuid,pcsn,quality_scode}, "").uniqueResult(0); - - if(orderObj==null||orderObj.isNullObject()){ - throw new WDKException("[仓位库存]不存在"); - }else { - String warehousing_qty = orderObj.optString("warehousing_qty"); - if(uString.isBlank(warehousing_qty)) throw new WDKException("[仓位库存待入量]不能为空"); - warehousing_qty = uMath.subtract(warehousing_qty, changecanuse_qty, 4, BigDecimal.ROUND_HALF_UP) ; - JSONObject qty = new JSONObject(); - qty.put("canuse",warehousing_qty); - if(qty.optInt("canuse")<0) { - throw new WDKException("[仓位库存待入量]不足"); - } - String warehousing_num = orderObj.optString("warehousing_num"); - if(uString.isBlank(warehousing_num)) throw new WDKException("[仓位库存待入数]不能为空"); - warehousing_num = uMath.subtract(warehousing_num, changecanuse_num, 4, BigDecimal.ROUND_HALF_UP) ; - qty.put("canuse",warehousing_num); - if(qty.optInt("canuse")<0) { - throw new WDKException("[仓位库存待入数]不足"); - } - map = new HashMap<>(); - map.put("warehousing_qty", warehousing_qty); - map.put("warehousing_num", warehousing_num); - map.put("change_time", WDK.getDateTime()); - WQLObject.getWQLObject(STIVTSTACKIVT_TABLE).update(map,"org_uuid = ? and order_code = ? and work_seq = ? and workflow_code = ? and ivt_type_code = ? and struct_uuid = ? and stor_uuid = ? and material_uuid = ? AND pcsn=? AND quality_scode=?", new String[] { org_uuid, order_code,work_seq,workflow_code,ivt_type_code ,struct_uuid,stor_uuid,material_uuid,pcsn,quality_scode}); - - } - - - } - */ -/* if(uString.isNotBlank(org_uuid)) { - if(uString.isBlank(workflow_code)){ - orderObj = WQLObject.getWQLObject(STIVTORGIVT_TABLE) - .query("org_uuid = ? and material_uuid = ? and ivt_type_code = ?", new String[] { org_uuid, material_uuid,ivt_type_code }, "").uniqueResult(0); - }else { - orderObj = WQLObject.getWQLObject(STIVTORGIVT_TABLE) - .query("org_uuid = ? and material_uuid = ? and ivt_type_code = ? AND workflow_code = ? AND work_seq = ?", new String[] { org_uuid, material_uuid,ivt_type_code,workflow_code, work_seq}, "").uniqueResult(0); - - } - - - if(orderObj==null||orderObj.isNullObject()){ - - throw new WDKException("[组织库存]不存在"); - }else { - - String warehousing_qty = orderObj.optString("stayin_qty"); - if(uString.isBlank(warehousing_qty)) throw new WDKException("[组织库存待入量]不能为空"); - warehousing_qty = uMath.subtract(warehousing_qty, changecanuse_qty, 4, BigDecimal.ROUND_HALF_UP) ; - String warehousing_num = orderObj.optString("warehousing_num"); - if(uString.isBlank(warehousing_num)) throw new WDKException("[组织库存待入数]不能为空"); - warehousing_num = uMath.subtract(warehousing_num, changecanuse_num, 4, BigDecimal.ROUND_HALF_UP) ; - - map = new HashMap<>(); - map.put("stayin_qty", warehousing_qty); - map.put("warehousing_num", warehousing_num); - map.put("change_time", WDK.getDateTime()); - - if(uString.isBlank(workflow_code)){ - WQLObject.getWQLObject(STIVTORGIVT_TABLE) - .update(map,"org_uuid = ? and material_uuid = ? and ivt_type_code = ?", new String[] { org_uuid, material_uuid,ivt_type_code }); - }else { - WQLObject.getWQLObject(STIVTORGIVT_TABLE) - .update(map,"org_uuid = ? and material_uuid = ? and ivt_type_code = ? AND workflow_code = ? AND work_seq = ?", new String[] { org_uuid, material_uuid,ivt_type_code,workflow_code, work_seq}); - - } - } - }*//* - - //仓库库存 - */ -/* if(uString.isNotBlank(stor_uuid)) { - if(uString.isBlank(workflow_code)){ - orderObj = WQLObject.getWQLObject(STIVTSTORIVT_TABLE) - .query("org_uuid = ? and material_uuid = ? and ivt_type_code = ? and stor_uuid = ?", new String[] { org_uuid, material_uuid,ivt_type_code ,stor_uuid}, "").uniqueResult(0); - - }else { - orderObj = WQLObject.getWQLObject(STIVTSTORIVT_TABLE) - .query("org_uuid = ? and material_uuid = ? and ivt_type_code = ? AND workflow_code = ? AND work_seq = ? and stor_uuid = ?", new String[] { org_uuid, material_uuid,ivt_type_code,workflow_code, work_seq,stor_uuid}, "").uniqueResult(0); - } - if(orderObj==null||orderObj.isNullObject()){ - throw new WDKException("[仓库库存]不存在"); - }else { - - String warehousing_qty = orderObj.optString("stayin_qty"); - if(uString.isBlank(warehousing_qty)) throw new WDKException("[仓库库存待入量]不能为空"); - warehousing_qty = uMath.subtract(warehousing_qty, changecanuse_qty, 4, BigDecimal.ROUND_HALF_UP) ; - String warehousing_num = orderObj.optString("warehousing_num"); - if(uString.isBlank(warehousing_num)) throw new WDKException("[仓库库存待入数]不能为空"); - warehousing_num = uMath.subtract(warehousing_num, changecanuse_num, 4, BigDecimal.ROUND_HALF_UP) ; - - map = new HashMap<>(); - map.put("stayin_qty", warehousing_qty); - map.put("warehousing_num", warehousing_num); - map.put("change_time", WDK.getDateTime()); - if(uString.isBlank(workflow_code)){ - WQLObject.getWQLObject(STIVTSTORIVT_TABLE).update(map, "org_uuid = ? AND material_uuid= ? AND ivt_type_code= ? and stor_uuid = ?", - new String[] { org_uuid,material_uuid,ivt_type_code ,stor_uuid}); - }else { - WQLObject.getWQLObject(STIVTSTORIVT_TABLE).update(map, "org_uuid = ? AND material_uuid= ? AND ivt_type_code= ? AND workflow_code = ? AND work_seq = ? and stor_uuid = ?", - new String[] { org_uuid,material_uuid,ivt_type_code,workflow_code, work_seq,stor_uuid }); - } - }; - }*//* - - - srb.setSuccess(); - srb.setDesc("生成成功!"); - srb.addParam("change_qty", changecanuse_qty); - srb.addParam("change_num", changecanuse_num); - srb.addParam("changecanuse_qty", changecanuse_qty); - srb.addParam("changecanuse_num", changecanuse_num); - return srb; - } - - */ -/** - * 库存变动记录 - * - * @param context 上下文 - * @param op_account_uuid 操作账号标识 - * @param op_person_uuid 操作员标识 - * @param change_type 变动类型 orgivt-组织 storeivt-仓库 stackivt-仓位 - * @param change_info 待变动信息 - * @return - *//* - - @Override - @WDKTransaction - public ServiceResultBean recInventoryTrace(ServiceContext context, String op_account_uuid, String op_person_uuid, String change_type, JSONObject change_info) { - if(change_info==null||change_info.isNullObject()) throw new WDKException("[库存变动记录信息]不能为空"); - String org_uuid = change_info.optString("org_uuid"); - if(uString.isBlank(org_uuid)) throw new WDKException("[组织id]不能为空"); - String materials_uuid = change_info.optString("material_uuid"); - if(uString.isBlank(materials_uuid)) throw new WDKException("[物料标识id]不能为空"); - String ivt_type_code = change_info.optString("ivt_type_code"); - if(uString.isBlank(ivt_type_code)) ivt_type_code ="01";//throw new WDKException("[库存类型]不能为空"); - String bill_type_scode = change_info.optString("bill_type_scode"); - if(uString.isBlank(bill_type_scode)) throw new WDKException("[单据类型]不能为空"); - String inv_uuid = change_info.optString("inv_uuid"); - if(uString.isBlank(inv_uuid)) throw new WDKException("[单据标识]不能为空"); - String change_type_scode = change_info.optString("change_type_scode"); - if(uString.isBlank(change_type_scode)) throw new WDKException("[变动类型]不能为空"); - - String change_mode = change_info.optString("change_mode"); - if(uString.isBlank(change_mode)) {//变动方式 - throw new WDKException("[变动方式]不能为空"); - }; - String change_qty = change_info.optString("change_qty"); - if(uString.isBlank(change_qty)) {//变动可用数 - change_qty = "0"; - }; - String changecanuse_qty = change_info.optString("changecanuse_qty"); - if(uString.isBlank(changecanuse_qty)) {//变动库存数 - changecanuse_qty = "0"; - }; - String changefrozen_qty = change_info.optString("changefrozen_qty"); - if(uString.isBlank(changefrozen_qty)) {//变动冻结数 - changefrozen_qty = "0"; - }; - String changeqc_qty = change_info.optString("changeqc_qty"); - if(uString.isBlank(changeqc_qty)) {//变动待检数 - changeqc_qty = "0"; - }; - String changein_qty = change_info.optString("changein_qty"); - if(uString.isBlank(changein_qty)) {//变动待入数 - changein_qty = "0"; - }; - - String change_num = change_info.optString("change_num"); - if(uString.isBlank(change_num)) {//变动可用数 - change_num = "0"; - }; - String changecanuse_num = change_info.optString("changecanuse_num"); - if(uString.isBlank(changecanuse_num)) {//变动库存数 - changecanuse_num = "0"; - }; - String changefrozen_num = change_info.optString("changefrozen_num"); - if(uString.isBlank(changefrozen_num)) {//变动冻结数 - changefrozen_num = "0"; - }; - String changeqc_num = change_info.optString("changeqc_num"); - if(uString.isBlank(changeqc_num)) {//变动待检数 - changeqc_num = "0"; - }; - String changein_num = change_info.optString("changein_num"); - if(uString.isBlank(changein_num)) {//变动待入数 - changein_num = "0"; - }; - JSONObject flow = new JSONObject(); - flow.put("flow_uuid", WDK.getUUID()); - flow.put("org_uuid",org_uuid); - flow.put("material_uuid",materials_uuid); - flow.put("ivt_type_code",ivt_type_code); - flow.put("bill_type_scode",bill_type_scode); - flow.put("inv_uuid",inv_uuid); - flow.put("change_type_scode",change_type_scode); - flow.put("change_time",WDK.getDateTime()); - flow.put("rec_person",op_person_uuid); - flow.put("change_qty",change_qty); - flow.put("changecanuse_qty",changecanuse_qty); - flow.put("changefrozen_qty",changefrozen_qty); - flow.put("changeqc_qty",changeqc_qty); - flow.put("changein_qty",changein_qty); - flow.put("change_mode",change_mode); - - flow.put("change_num",change_num); - flow.put("changecanuse_num",changecanuse_num); - flow.put("changefrozen_num",changefrozen_num); - flow.put("changeqc_num",changeqc_num); - flow.put("changein_num",changein_num); - flow.put("num_unit_uuid", change_info.optString("num_unit_uuid")); - flow.put("num_unit_name", change_info.optString("num_unit_name")); - flow.put("qty_unit_uuid", change_info.optString("qty_unit_uuid")); - flow.put("qty_unit_name", change_info.optString("qty_unit_name")); - flow.put("work_seq", change_info.optString("work_seq")); - flow.put("workflow_code", change_info.optString("workflow_code")); - //组织库存变动记录表 - WQLObject wql = WQLObject.getWQLObject(STIVTORGIVTFLOW_TABLE); - WdkUtil.fieldIsEmpty(WdkUtil.notEmptyFileds(STIVTORGIVTFLOW_TABLE), flow); - wql.insert(flow); - - String stor_uuid = change_info.optString("stor_uuid"); - if(uString.isNotBlank(stor_uuid)){ - flow = new JSONObject(); - flow.put("flow_uuid",WDK.getUUID()); - flow.put("stor_uuid",stor_uuid); - flow.put("material_uuid",materials_uuid); - flow.put("ivt_type_code",ivt_type_code); - flow.put("org_uuid",org_uuid); - flow.put("bill_type_scode",bill_type_scode); - flow.put("inv_uuid",inv_uuid); - flow.put("change_type_scode",change_type_scode); - flow.put("change_time",WDK.getDateTime()); - flow.put("rec_person",op_person_uuid); - flow.put("change_qty",change_qty); - flow.put("changecanuse_qty",changecanuse_qty); - flow.put("changefrozen_qty",changefrozen_qty); - flow.put("changeqc_qty",changeqc_qty); - flow.put("changein_qty",changein_qty); - flow.put("change_num",change_num); - flow.put("changecanuse_num",changecanuse_num); - flow.put("changefrozen_num",changefrozen_num); - flow.put("changeqc_num",changeqc_num); - flow.put("change_mode",change_mode); - flow.put("changein_num",changein_num); - flow.put("num_unit_uuid", change_info.optString("num_unit_uuid")); - flow.put("num_unit_name", change_info.optString("num_unit_name")); - flow.put("qty_unit_uuid", change_info.optString("qty_unit_uuid")); - flow.put("qty_unit_name", change_info.optString("qty_unit_name")); - flow.put("work_seq", change_info.optString("work_seq")); - flow.put("workflow_code", change_info.optString("workflow_code")); - //仓库库存变动记录表 - wql = WQLObject.getWQLObject(STIVTSTORIVTFLOW_TABLE); - WdkUtil.fieldIsEmpty(WdkUtil.notEmptyFileds(STIVTSTORIVTFLOW_TABLE), flow); - wql.insert(flow); - } - String stack_uuid = change_info.optString("stack_uuid"); - if(uString.isNotBlank(stack_uuid)){ - flow = new JSONObject(); - flow.put("flow_uuid",WDK.getUUID()); - flow.put("stack_uuid",stack_uuid); - flow.put("material_uuid",materials_uuid); - flow.put("order_code",change_info.optString("order_code")); - flow.put("work_seq",change_info.optString("work_seq")); - flow.put("workflow_code",change_info.optString("workflow_code")); - flow.put("ivt_type_code",ivt_type_code); - flow.put("pcsn",change_info.optString("pcsn")); - flow.put("org_uuid",org_uuid); - flow.put("stor_uuid",stor_uuid); - flow.put("change_mode",change_mode); - flow.put("bill_type_scode",bill_type_scode); - flow.put("inv_uuid",inv_uuid); - flow.put("change_type_scode",change_type_scode); - flow.put("change_time",WDK.getDateTime()); - flow.put("rec_person",op_person_uuid); - flow.put("change_qty",change_qty); - flow.put("changecanuse_qty",changecanuse_qty); - flow.put("changefrozen_qty",changefrozen_qty); - flow.put("changeqc_qty",changeqc_qty); - flow.put("changein_qty",changein_qty); - flow.put("change_mode",change_info.optString("change_mode")); - flow.put("order_code",change_info.optString("order_code")); - flow.put("work_seq",change_info.optString("work_seq")); - flow.put("workflow_code",change_info.optString("workflow_code")); - - flow.put("change_num",change_num); - flow.put("changecanuse_num",changecanuse_num); - flow.put("changefrozen_num",changefrozen_num); - flow.put("changeqc_num",changeqc_num); - flow.put("changein_num",changein_num); - flow.put("num_unit_uuid", change_info.optString("num_unit_uuid")); - flow.put("num_unit_name", change_info.optString("num_unit_name")); - flow.put("qty_unit_uuid", change_info.optString("qty_unit_uuid")); - flow.put("qty_unit_name", change_info.optString("qty_unit_name")); - //仓位库存变动记录表 - wql = WQLObject.getWQLObject(STIVTSTACKIVTFLOW_TABLE); - WdkUtil.fieldIsEmpty(WdkUtil.notEmptyFileds(STIVTSTACKIVTFLOW_TABLE), flow); - wql.insert(flow); - } - ServiceResultBean rsb = new ServiceResultBean(); - rsb.setSuccess(); - rsb.setDesc("新增成功!"); - return rsb; - } - - */ -/** - * - * 根据条件查询库存记录 - * - * @param context 上下文 - * @param op_account_uuid 操作账号标识 - * @param op_person_uuid 操作员标识 - * @param change_type 变动类型 orgivt-组织 storeivt-仓库 stackivt-仓位 - * @param query_fields 属性查询字段 - * @param results_fields 返回结果街字段 - * @param order_fields 排序字段 - * @return resultset - *//* - - @Override - public ServiceResultBean queryBizInvertoryByConf(ServiceContext context, String op_account_uuid, String op_person_uuid, String change_type, JSONObject query_fields, String results_fields, String order_fields) { - return null; - } -} -*/ diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/ivt/StoreIvtServiceImpl.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/ivt/StoreIvtServiceImpl.java index 003c99e..dbab002 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/ivt/StoreIvtServiceImpl.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/ivt/StoreIvtServiceImpl.java @@ -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); diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/wql/st.xls b/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/wql/st.xls index c0cbe50..c7d1cb4 100644 Binary files a/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/wql/st.xls and b/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/wql/st.xls differ diff --git a/wms/hd/nladmin-system/src/main/resources/config/application-dev.yml b/wms/hd/nladmin-system/src/main/resources/config/application-dev.yml index c10e7ff..111b029 100644 --- a/wms/hd/nladmin-system/src/main/resources/config/application-dev.yml +++ b/wms/hd/nladmin-system/src/main/resources/config/application-dev.yml @@ -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 # 最小连接数