diff --git a/src/main/java/com/zzjee/wm/controller/WmOmNoticeHController.java b/src/main/java/com/zzjee/wm/controller/WmOmNoticeHController.java index 06b23de8..22733787 100644 --- a/src/main/java/com/zzjee/wm/controller/WmOmNoticeHController.java +++ b/src/main/java/com/zzjee/wm/controller/WmOmNoticeHController.java @@ -427,16 +427,9 @@ public class WmOmNoticeHController extends BaseController { if (wmOmNoticeH.getOmSta() == null) { cq.notEq("omSta", Constants.wm_sta4); } -// Map map = new HashMap(); -// map.put("omSta", "desc"); -// cq.setOrder(map); -// Map map2 = new HashMap(); -// map2.put("omSta", "asc"); -// cq.setOrder(map2); Map map1 = new HashMap(); map1.put("createDate", "desc"); cq.setOrder(map1); -// cq.like("omNoticeId", "CK%"); cq.add(); this.wmOmNoticeHService.getDataGridReturn(cq, true); TagUtil.datagrid(response, dataGrid); @@ -456,11 +449,8 @@ public class WmOmNoticeHController extends BaseController { if(!StringUtil.isEmpty(goodsid)){ if(goodsid.endsWith("l")){ goods = goodsid.substring(0,goodsid.length() - 1); - System.out.print("11111111I"+goods); }else{ goods = goodsid; - System.out.print("22222"+goods); - } } @@ -560,26 +550,7 @@ public class WmOmNoticeHController extends BaseController { AjaxJson j = new AjaxJson(); String message = "添加成功"; try{ - Map countMap = systemService - .findOneForJdbc("SELECT count(*)+1 as count FROM wm_om_notice_h t where TO_DAYS(t.create_date) = TO_DAYS(NOW());"); - String noticeid = null; - if(wmOmNoticeH.getOrderTypeCode().equals("19")){ - noticeid = "QT" - + DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd) - + "-" - + StringUtil.leftPad( - ((Long) countMap.get("count")).intValue(), 4, - '0'); - }else { - noticeid = "CK" - + DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd) - + "-" - + StringUtil.leftPad( - ((Long) countMap.get("count")).intValue(), 4, - '0'); - } - - + String noticeid = getNextNoticeId(wmOmNoticeH.getOrderTypeCode()); WmPlatIoEntity wmPlatIo = new WmPlatIoEntity(); wmPlatIo.setCarno(wmOmNoticeH.getReCarno()); wmPlatIo.setDocId(noticeid); @@ -591,15 +562,12 @@ public class WmOmNoticeHController extends BaseController { systemService.save(wmPlatIo); wmOmNoticeH.setOmNoticeId(noticeid); wmOmNoticeH.setOmSta(Constants.wm_sta1); - - if(wmOmNoticeH.getCusCode()==null){ if(StringUtil.isNotEmpty(wmUtil.getCusCode())){ wmOmNoticeH.setCusCode(wmUtil.getCusCode()); } } - List wmomNoticeIListnew = new ArrayList(); for (WmOmNoticeIEntity wmomNoticeIEntity : wmOmNoticeIList) { if(!StringUtil.isEmpty(wmomNoticeIEntity.getGoodsId())){ @@ -644,6 +612,30 @@ public class WmOmNoticeHController extends BaseController { j.setMsg(message); return j; } + private String getNextNoticeId(String orderType){ + Map countMap = systemService + .findOneForJdbc("SELECT count(*)+1 as count FROM wm_om_notice_h t where TO_DAYS(t.create_date) = TO_DAYS(NOW());"); + String noticeid = null; + if (StringUtil.isEmpty(orderType)){ + orderType = "11"; + } + if(orderType.equals("19")){ + noticeid = "QT" + + DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd) + + "-" + + StringUtil.leftPad( + ((Long) countMap.get("count")).intValue(), 4, + '0'); + }else { + noticeid = "CK" + + DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd) + + "-" + + StringUtil.leftPad( + ((Long) countMap.get("count")).intValue(), 4, + '0'); + } + return noticeid; + } @RequestMapping(params = "doGet") @ResponseBody public AjaxJson dogetfromother(String formDate, HttpServletRequest request) { @@ -673,21 +665,11 @@ public class WmOmNoticeHController extends BaseController { if (wmimh == null) { WmOmNoticeHEntity wmOmNoticeH = new WmOmNoticeHEntity(); List wmomNoticeIListnew = new ArrayList(); - Map countMap = systemService - .findOneForJdbc("SELECT count(*)+1 as count FROM wm_om_notice_h t where TO_DAYS(t.create_date) = TO_DAYS(NOW());"); - String noticeid = null; - if (countMap != null) { - noticeid = "CK" - + DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd) - + "-" - + StringUtil.leftPad( - ((Long) countMap.get("count")).intValue(), 4, - '0'); - } wmOmNoticeH.setOmPlatNo(Integer.toString(billResult.getData().get(s).getPiId())); wmOmNoticeH.setOrderTypeCode("11"); wmOmNoticeH.setCusCode(ResourceUtil.getConfigByName("uas.cuscode")); + String noticeid = getNextNoticeId(wmOmNoticeH.getOrderTypeCode()); wmOmNoticeH.setOmNoticeId(noticeid); wmOmNoticeH.setPiClass(billResult.getData().get(s).getPiClass()); wmOmNoticeH.setPiMaster(master); @@ -798,9 +780,6 @@ public class WmOmNoticeHController extends BaseController { //先把读进来的图片放到一个ByteArrayOutputStream中,以便产生ByteArray try { StringBuffer sber=new StringBuffer(); - - - ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream(); bufferImg = ImageIO.read(BarcodeUtil.generateToStream(wmOmNoticeH.getOmNoticeId())); // 进行转码,使其支持中文文件名 @@ -829,7 +808,6 @@ public class WmOmNoticeHController extends BaseController { - // 创建第一行 Row row = sheet.createRow((short) 0); //第一行空白 @@ -1776,20 +1754,11 @@ public class WmOmNoticeHController extends BaseController { } } WmOmNoticeHEntity wmOmNoticeH = new WmOmNoticeHEntity(); - Map countMap = systemService - .findOneForJdbc("SELECT count(*)+1 as count FROM wm_om_notice_h t where TO_DAYS(t.create_date) = TO_DAYS(NOW());"); - String noticeid = null; - if (countMap != null) { - noticeid = "CK" - + DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd) - + "-" - + StringUtil.leftPad( - ((Long) countMap.get("count")).intValue(), 4, - '0'); - } + wmOmNoticeH.setDelvData(pageheader.getImData()); wmOmNoticeH.setOrderTypeCode(pageheader.getOrderTypeCode()); wmOmNoticeH.setCusCode(pageheader.getCusCode()); + String noticeid = getNextNoticeId(wmOmNoticeH.getOrderTypeCode()); wmOmNoticeH.setOmNoticeId(noticeid); wmOmNoticeH.setOmBeizhu(pageheader.getImBeizhu()); wmOmNoticeH.setOcusCode(pageheader.getSupCode()); @@ -1920,20 +1889,11 @@ public class WmOmNoticeHController extends BaseController { } } WmOmNoticeHEntity wmOmNoticeH = new WmOmNoticeHEntity(); - Map countMap = systemService - .findOneForJdbc("SELECT count(*)+1 as count FROM wm_om_notice_h t where TO_DAYS(t.create_date) = TO_DAYS(NOW());"); - String noticeid = null; - if (countMap != null) { - noticeid = "CK" - + DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd) - + "-" - + StringUtil.leftPad( - ((Long) countMap.get("count")).intValue(), 4, - '0'); - } + wmOmNoticeH.setDelvData(pageheader.getImData()); wmOmNoticeH.setOrderTypeCode(pageheader.getOrderTypeCode()); wmOmNoticeH.setCusCode(pageheader.getCusCode()); + String noticeid = getNextNoticeId(wmOmNoticeH.getOrderTypeCode()); wmOmNoticeH.setOmNoticeId(noticeid); wmOmNoticeH.setOmBeizhu(pageheader.getImBeizhu()); wmOmNoticeH.setOcusCode(pageheader.getSupCode());