From c395e634cb33af49be9c6447fc51a825c99efec1 Mon Sep 17 00:00:00 2001 From: e Date: Sat, 8 Dec 2018 23:43:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E9=87=87=E8=B4=AD=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wm/controller/WmImNoticeHController.java | 2 +- src/main/java/com/zzjee/wmutil/yyUtil.java | 103 +++++++++++++++++- 2 files changed, 101 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/zzjee/wm/controller/WmImNoticeHController.java b/src/main/java/com/zzjee/wm/controller/WmImNoticeHController.java index dec5ff52..4b1aeeef 100644 --- a/src/main/java/com/zzjee/wm/controller/WmImNoticeHController.java +++ b/src/main/java/com/zzjee/wm/controller/WmImNoticeHController.java @@ -1673,7 +1673,7 @@ public class WmImNoticeHController extends BaseController { if(StringUtil.isEmpty(formDate)){ formDate = "2011-01-01"; } - yyUtil.getPo(formDate); + yyUtil.getPord(formDate); } if ("UAS".equals(ResourceUtil.getConfigByName("interfacetype"))){ diff --git a/src/main/java/com/zzjee/wmutil/yyUtil.java b/src/main/java/com/zzjee/wmutil/yyUtil.java index d628574c..1099a28f 100644 --- a/src/main/java/com/zzjee/wmutil/yyUtil.java +++ b/src/main/java/com/zzjee/wmutil/yyUtil.java @@ -89,7 +89,13 @@ public class yyUtil { BaUnitEntity mdn = new BaUnitEntity(); mdn.setUnitCode(prodbo.get("cComunitCode").toString()); mdn.setUnitZhName(prodbo.get("cComUnitName").toString()); - mdn.setUnitChange(prodbo.get("iChangeRate").toString()); + try{ + mdn.setUnitChange(prodbo.get("iChangRate").toString()); + + }catch (Exception e){ + mdn.setUnitChange("1"); + + } try { BaUnitEntity baunit = systemService.findUniqueByProperty( @@ -115,17 +121,31 @@ public class yyUtil { mdn.setSuoShuKeHu("hwm"); mdn.setShpMingCheng(prodbo.get("cInvName").toString()); mdn.setBzhiQi("360"); - mdn.setChpShuXing(prodbo.get("cInvCCode").toString().substring(0,2)); + try{ + mdn.setChpShuXing(prodbo.get("cInvCCode").toString().substring(0,2)); + + }catch (Exception e){ + + } // mdn.setChpShuXing("其他"); - mdn.setShpGuiGe(prodbo.get("cInvStd").toString()); + try{ + mdn.setShpGuiGe(prodbo.get("cInvStd").toString()); + }catch (Exception e){ + + } + + mdn.setJshDanWei(prodbo.get("cComUnitCode").toString());//拆零单位 BaUnitEntity baunit = systemService.findUniqueByProperty( BaUnitEntity.class, "unitCode", mdn.getJshDanWei()); if (baunit !=null){ mdn.setJshDanWei(baunit.getUnitZhName());//拆零单位 } + try{ mdn.setShlDanWei(prodbo.get("cSAComUnitCode").toString());//单位 + }catch (Exception e){ + } if(StringUtil.isEmpty(mdn.getShlDanWei())){ mdn.setChlShl("1"); mdn.setChlKongZhi("N"); @@ -173,6 +193,83 @@ public class yyUtil { } } } + public static void getPord(String indate) { +// PO_Pomain 采购订单主表 +// PO_Podetails 采购订单子表 + String dbKey= ResourceUtil.getConfigByName("yydbkey"); + List> result=null; + List> resultdetail=null; + String querySql = "select * from RdRecord01 where ddate = '"+indate+"'"; + Map queryparams = new LinkedHashMap(); + + SystemService systemService =ApplicationContextUtil.getContext().getBean(SystemService.class); + WmImNoticeHServiceI wmImNoticeHService =ApplicationContextUtil.getContext().getBean(WmImNoticeHServiceI.class); + + if(StringUtils.isNotBlank(dbKey)) { + result = DynamicDBUtil.findList(dbKey, SqlUtil.jeecgCreatePageSql(dbKey, querySql, queryparams, 1, 1000000)); + } + if (result!=null&&result.size()>0) { + for (int i = 0; i < result.size(); i++) { + Map prodbo = result.get(i); + String poid = prodbo.get("id").toString(); + + if (StringUtil.isNotEmpty(poid)) { + WmImNoticeHEntity wmimh = systemService.findUniqueByProperty(WmImNoticeHEntity.class, "imCusCode", poid); + if (wmimh == null) { + WmImNoticeHEntity wmImNoticeH = new WmImNoticeHEntity(); + List wmImNoticeIListnew = new ArrayList(); + + wmImNoticeH.setOrderTypeCode("01"); + String noticeid = wmUtil.getNextNoticeid(wmImNoticeH.getOrderTypeCode()); + + wmImNoticeH.setCusCode(ResourceUtil.getConfigByName("yy.cuscode")); + wmImNoticeH.setNoticeId(noticeid); +// wmImNoticeH.setPlatformCode(Integer.toString(billResult.getData().get(s).getPiId())); +// wmImNoticeH.setPiClass(billResult.getData().get(s).getPiClass()); +// wmImNoticeH.setPiMaster(master); +// wmImNoticeH.setSupCode(billResult.getData().get(s).getPiCardcode()); +// MdSupEntity mdsup = systemService.findUniqueByProperty(MdSupEntity.class, "gysBianMa", wmImNoticeH.getSupCode()); +// if (mdsup != null) { +// wmImNoticeH.setSupName(mdsup.getZhongWenQch()); +// } + try{ + wmImNoticeH.setImBeizhu(prodbo.get("cMemo").toString()); + }catch (Exception e){ + + } + wmImNoticeH.setImCusCode(poid); + String querySqldetail = "select * from RdRecords01 where id = '"+poid+"'"; + if (resultdetail!=null){ + resultdetail.clear(); + } + resultdetail = DynamicDBUtil.findList(dbKey, SqlUtil.jeecgCreatePageSql(dbKey, querySqldetail, queryparams, 1, 1000000)); + + for (int k = 0; k < resultdetail.size(); k++) { + WmImNoticeIEntity wmi = new WmImNoticeIEntity(); + Map proddet = resultdetail.get(k); + wmi.setGoodsCode(proddet.get("cInvCode").toString()); + MvGoodsEntity mvgoods = systemService.findUniqueByProperty( + MvGoodsEntity.class, "goodsCode", wmi.getGoodsCode()); + if (mvgoods != null) { + wmi.setGoodsName(mvgoods.getGoodsName()); + wmi.setGoodsUnit(mvgoods.getShlDanWei()); + } + wmi.setGoodsCount(Long.toString(new BigDecimal(proddet.get("iQuantity").toString()).setScale(0, RoundingMode.UP).longValue())); +// wmi.setGoodsPrdData(billResult.getData().get(s).getDetail().get(k).getPdProdmadedate2User()); +// wmi.setOtherId(); + wmImNoticeIListnew.add(wmi); + } + wmImNoticeHService.addMain(wmImNoticeH, wmImNoticeIListnew); + } + } else { + continue; + } + } + } + } + + + public static void getPo(String indate) { // PO_Pomain 采购订单主表 // PO_Podetails 采购订单子表