From 4e14482d14e211001075059865c97fb718bc4efc Mon Sep 17 00:00:00 2001 From: e Date: Wed, 24 Apr 2019 22:53:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=B8=8B=E6=9E=B6=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E5=95=86=E5=93=81=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zzjee/api/wmomController.java | 46 +++++++++++++++++-- .../wm/controller/WmImNoticeHController.java | 46 ++----------------- .../wm/controller/WmOmNoticeHController.java | 33 ++----------- src/main/java/com/zzjee/wmutil/wmUtil.java | 17 ++++++- 4 files changed, 67 insertions(+), 75 deletions(-) diff --git a/src/main/java/com/zzjee/api/wmomController.java b/src/main/java/com/zzjee/api/wmomController.java index fffd3c2e..d2adb47d 100644 --- a/src/main/java/com/zzjee/api/wmomController.java +++ b/src/main/java/com/zzjee/api/wmomController.java @@ -61,9 +61,49 @@ public class wmomController { @Autowired SystemService systemService; + + @RequestMapping(value = "/alllist/{username}", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "获取全部订单列表信息", produces = "application/json", httpMethod = "GET") + public ResponseMessage> alllist(@PathVariable("username") String username, @RequestParam int pageNumber, @RequestParam int pageSize, HttpServletRequest request) { + CriteriaQuery query = new CriteriaQuery(WmOmNoticeHEntity.class); + try { + + if(StringUtil.isNotEmpty(request.getParameter("omNoticeId"))){ + query.like("omNoticeId","%"+request.getParameter("omNoticeId")+"%"); + } + if(StringUtil.isNotEmpty(request.getParameter("delvMobile"))){ + query.like("delvMobile","%"+request.getParameter("delvMobile")+"%"); + } + if(StringUtil.isNotEmpty(request.getParameter("delvMember"))){ + query.like("delvMember","%"+request.getParameter("delvMember")+"%"); + } + if(StringUtil.isNotEmpty(request.getParameter("delvAddr"))){ + query.like("delvAddr","%"+request.getParameter("delvAddr")+"%"); + } + String orgcode = ""; + TSUser task = wmUtil.getsysorgcode(username); + if (task != null) { + query.like("reCarno", "%" + task.getUserName() + "%"); + } + } catch (Exception e) { + } + query.add(); + List listsize = this.systemService.getListByCriteriaQuery(query, false); + query.setCurPage(pageNumber <= 0 ? 1 : pageNumber); + query.setPageSize(pageSize < 1 ? 1 : pageSize); + query.add(); + Map map = new HashMap(); + map.put("createDate", "desc"); + query.setOrder(map); + List list = this.systemService.getListByCriteriaQuery(query, true); + return Result.success(list, (long) listsize.size()); + } + + @RequestMapping(value = "/list/{username}", method = RequestMethod.GET) @ResponseBody - @ApiOperation(value = "订单列表信息", produces = "application/json", httpMethod = "GET") + @ApiOperation(value = "获取未完成订单列表信息", produces = "application/json", httpMethod = "GET") public ResponseMessage> list(@PathVariable("username") String username, @RequestParam int pageNumber, @RequestParam int pageSize, HttpServletRequest request) { CriteriaQuery query = new CriteriaQuery(WmOmNoticeHEntity.class); try { @@ -138,7 +178,7 @@ public class wmomController { @RequestMapping(value = "/goodsdownlist/{orderNo}", method = RequestMethod.GET) @ResponseBody - @ApiOperation(value = "订单file信息", produces = "application/json", httpMethod = "GET") + @ApiOperation(value = "订单出库商品信息", produces = "application/json", httpMethod = "GET") public ResponseMessage> filelist(@PathVariable("orderNo") String orderNo, HttpServletRequest request) { String hql0 = "from WmToDownGoodsEntity where 1 = 1 AND orderId = ? "; List wmToDownGoodsEntitiesList = this.systemService.findHql(hql0, orderNo); @@ -164,7 +204,7 @@ public class wmomController { @RequestMapping(value="/getNotice/{username}", method = RequestMethod.GET) @ResponseBody - @ApiOperation(value="附近巡检任务列表信息",produces="application/json",httpMethod="GET") + @ApiOperation(value="获取公告",produces="application/json",httpMethod="GET") public ResponseMessage> getNotice(@PathVariable("username") String username, HttpServletRequest request) { List list = new ArrayList<>(); diff --git a/src/main/java/com/zzjee/wm/controller/WmImNoticeHController.java b/src/main/java/com/zzjee/wm/controller/WmImNoticeHController.java index b88e1f31..0c9d37b8 100644 --- a/src/main/java/com/zzjee/wm/controller/WmImNoticeHController.java +++ b/src/main/java/com/zzjee/wm/controller/WmImNoticeHController.java @@ -1653,7 +1653,7 @@ public class WmImNoticeHController extends BaseController { String message = "进货通知添加成功"; try { - String noticeid = getNextNoticeid(wmImNoticeH.getOrderTypeCode()); + String noticeid = wmUtil.getNextNoticeid(wmImNoticeH.getOrderTypeCode()) ; wmImNoticeH.setNoticeId(noticeid); WmPlatIoEntity wmPlatIo = new WmPlatIoEntity(); wmPlatIo.setCarno(wmImNoticeH.getImCarNo()); @@ -1769,7 +1769,7 @@ public class WmImNoticeHController extends BaseController { List wmImNoticeIListnew = new ArrayList(); wmImNoticeH.setOrderTypeCode("01"); - String noticeid = getNextNoticeid(wmImNoticeH.getOrderTypeCode()); + String noticeid = wmUtil.getNextNoticeid(wmImNoticeH.getOrderTypeCode()); wmImNoticeH.setCusCode(ResourceUtil.getConfigByName("uas.cuscode")); wmImNoticeH.setNoticeId(noticeid); @@ -1897,47 +1897,7 @@ public class WmImNoticeHController extends BaseController { return new Date(time); // 将毫秒数转换成日期 } -private String getNextNoticeid(String orderType){ - String noticeid=null; - Map countMap = systemService - .findOneForJdbc("SELECT count(*)+1 as count FROM wm_im_notice_h t where TO_DAYS(t.create_date) = TO_DAYS(NOW());"); - if (StringUtil.isEmpty(orderType)){ - orderType = "01"; - } - if (countMap != null) { - if(orderType.equals("03")){ - noticeid = "TH" - + DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd) - + "-" - + StringUtil.leftPad( - ((Long) countMap.get("count")).intValue(), 4, - '0'); - }else if(orderType.equals("01")){ - noticeid = "RK" - + DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd) - + "-" - + StringUtil.leftPad( - ((Long) countMap.get("count")).intValue(), 4, - '0'); - }else if(orderType.equals("04")){ - noticeid = "YK" - + DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd) - + "-" - + StringUtil.leftPad( - ((Long) countMap.get("count")).intValue(), 4, - '0'); - }else if(orderType.equals("09")){ - noticeid = "QT" - + DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd) - + "-" - + StringUtil.leftPad( - ((Long) countMap.get("count")).intValue(), 4, - '0'); - } - } - return noticeid; -} /** * 更新进货通知抬头 * @@ -2262,7 +2222,7 @@ private String getNextNoticeid(String orderType){ WmImNoticeHEntity wmImNoticeH = new WmImNoticeHEntity(); wmImNoticeH.setOrderTypeCode(pageheader.getOrderTypeCode()); - String noticeid = getNextNoticeid(wmImNoticeH.getOrderTypeCode()); + String noticeid = wmUtil.getNextNoticeid(wmImNoticeH.getOrderTypeCode()); wmImNoticeH.setCusCode(pageheader.getCusCode()); wmImNoticeH.setNoticeId(noticeid); wmImNoticeH.setImData(pageheader.getImData()); diff --git a/src/main/java/com/zzjee/wm/controller/WmOmNoticeHController.java b/src/main/java/com/zzjee/wm/controller/WmOmNoticeHController.java index 5e8fe9c2..596a3734 100644 --- a/src/main/java/com/zzjee/wm/controller/WmOmNoticeHController.java +++ b/src/main/java/com/zzjee/wm/controller/WmOmNoticeHController.java @@ -901,7 +901,7 @@ public class WmOmNoticeHController extends BaseController { AjaxJson j = new AjaxJson(); String message = "添加成功"; try{ - String noticeid = getNextNoticeId(wmOmNoticeH.getOrderTypeCode()); + String noticeid = wmUtil.getNextomNoticeId(wmOmNoticeH.getOrderTypeCode()); WmPlatIoEntity wmPlatIo = new WmPlatIoEntity(); wmPlatIo.setCarno(wmOmNoticeH.getReCarno()); wmPlatIo.setDocId(noticeid); @@ -961,30 +961,7 @@ 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) { @@ -1026,7 +1003,7 @@ public class WmOmNoticeHController extends BaseController { wmOmNoticeH.setOmPlatNo(Integer.toString(billResult.getData().get(s).getPiId())); wmOmNoticeH.setOrderTypeCode("11"); wmOmNoticeH.setCusCode(ResourceUtil.getConfigByName("uas.cuscode")); - String noticeid = getNextNoticeId(wmOmNoticeH.getOrderTypeCode()); + String noticeid = wmUtil.getNextomNoticeId(wmOmNoticeH.getOrderTypeCode()); wmOmNoticeH.setOmNoticeId(noticeid); wmOmNoticeH.setPiClass(billResult.getData().get(s).getPiClass()); wmOmNoticeH.setPiMaster(master); @@ -2159,7 +2136,7 @@ public class WmOmNoticeHController extends BaseController { wmOmNoticeH.setDelvData(pageheader.getImData()); wmOmNoticeH.setOrderTypeCode(pageheader.getOrderTypeCode()); wmOmNoticeH.setCusCode(pageheader.getCusCode()); - String noticeid = getNextNoticeId(wmOmNoticeH.getOrderTypeCode()); + String noticeid = wmUtil.getNextomNoticeId(wmOmNoticeH.getOrderTypeCode()); wmOmNoticeH.setOmNoticeId(noticeid); wmOmNoticeH.setOmBeizhu(pageheader.getImBeizhu()); wmOmNoticeH.setOcusCode(pageheader.getSupCode()); @@ -2294,7 +2271,7 @@ public class WmOmNoticeHController extends BaseController { wmOmNoticeH.setDelvData(pageheader.getImData()); wmOmNoticeH.setOrderTypeCode(pageheader.getOrderTypeCode()); wmOmNoticeH.setCusCode(pageheader.getCusCode()); - String noticeid = getNextNoticeId(wmOmNoticeH.getOrderTypeCode()); + String noticeid = wmUtil.getNextomNoticeId(wmOmNoticeH.getOrderTypeCode()); wmOmNoticeH.setOmNoticeId(noticeid); wmOmNoticeH.setOmBeizhu(pageheader.getImBeizhu()); wmOmNoticeH.setOcusCode(pageheader.getSupCode()); diff --git a/src/main/java/com/zzjee/wmutil/wmUtil.java b/src/main/java/com/zzjee/wmutil/wmUtil.java index 840aa4d3..14c0d786 100644 --- a/src/main/java/com/zzjee/wmutil/wmUtil.java +++ b/src/main/java/com/zzjee/wmutil/wmUtil.java @@ -89,8 +89,16 @@ public class wmUtil { + StringUtil.leftPad( ((Long) countMap.get("count")).intValue(), 4, '0'); + }else { + noticeid = "QT" + + DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd) + + "-" + + StringUtil.leftPad( + ((Long) countMap.get("count")).intValue(), 4, + '0'); } + } return noticeid; } @@ -111,13 +119,20 @@ public class wmUtil { + StringUtil.leftPad( ((Long) countMap.get("count")).intValue(), 4, '0'); - }else { + }else if (orderType.equals("11")){ noticeid = "CK" + DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd) + "-" + StringUtil.leftPad( ((Long) countMap.get("count")).intValue(), 4, '0'); + }else { + noticeid = "QT" + + DateUtils.date2Str(new Date(), DateUtils.yyyyMMdd) + + "-" + + StringUtil.leftPad( + ((Long) countMap.get("count")).intValue(), 4, + '0'); } return noticeid; }