From 5661411f2f938d1e63c46c0064c10acb27e23bf0 Mon Sep 17 00:00:00 2001 From: zhouxi Date: Mon, 16 Aug 2021 13:37:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../md/controller/MdGoodsController.java | 35 +++- .../md/controller/MvGoodsController.java | 59 +++--- .../wm/controller/WmImNoticeHController.java | 9 +- .../wm/controller/WmInQmIController.java | 2 +- .../zzjee/wm/controller/WmsApiController.java | 11 ++ .../wmapi/controller/WvNoticeController.java | 2 +- .../controller/core/SystemController.java | 22 +-- .../webpage/com/zzjee/md/mdGoods-add.jsp | 28 +-- .../webpage/com/zzjee/md/mdGoods-update.jsp | 10 +- .../com/zzjee/wm/print/imnotice-print.jsp | 124 ++++++------ .../com/zzjee/wm/print/imnoticerkd-print.jsp | 66 ++++--- .../webpage/com/zzjee/wm/wmPrintModel-add.jsp | 154 +++++++++++++-- .../com/zzjee/wm/wmPrintModel-update.jsp | 176 ++++++++++++++++-- .../webpage/com/zzjee/wm/wmPrintModelList.jsp | 2 +- 14 files changed, 513 insertions(+), 187 deletions(-) diff --git a/src/main/java/com/zzjee/md/controller/MdGoodsController.java b/src/main/java/com/zzjee/md/controller/MdGoodsController.java index d8c3eca8..fdd48fcb 100644 --- a/src/main/java/com/zzjee/md/controller/MdGoodsController.java +++ b/src/main/java/com/zzjee/md/controller/MdGoodsController.java @@ -237,7 +237,19 @@ public class MdGoodsController extends BaseController { } catch (Exception e) { // TODO: handle exception } - + //查询当前商品类型的商品数量 + Map countMap = systemService.findOneForJdbc("select right(shp_bian_ma,7) shp_bian_ma from md_goods where chp_shu_xing=? and shp_bian_ma like ? ORDER BY shp_bian_ma desc LIMIT 1",mdGoods.getChpShuXing(),mdGoods.getChpShuXing()+"%"); + if (countMap == null) { + mdGoods.setShpBianMa(mdGoods.getChpShuXing()+String.format("%07d", 1)); + }else { + Object goodsCode = countMap.get("shp_bian_ma"); + if (goodsCode != null) { + mdGoods.setShpBianMa(mdGoods.getChpShuXing()+String.format("%07d",Integer.parseInt(((String) goodsCode))+1)); + }else { + mdGoods.setShpBianMa(mdGoods.getChpShuXing()+String.format("%07d", 1)); + } + } + mdGoods.setShpTiaoMa(mdGoods.getShpBianMa()); mdGoodsService.save(mdGoods); systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO); @@ -436,6 +448,25 @@ public class MdGoodsController extends BaseController { MdGoodsEntity.class, "shpBianMa", mdGoods.getShpBianMa()); if(mdGoods1 ==null ){ try { + //查询当前商品类型的商品数量 +// Map map = systemService.findOneForJdbc("select ifnull(count(1),0) num from ba_goods_type where goods_type_code = ? order by create_date desc limit 1",mdGoods.getChpShuXing()); +// if ((Long)map.get("num") <= 0L) { +// j.setSuccess(false); +// j.setMsg("产品属性错误:"+mdGoods.getChpShuXing()); +// return j; +// } + Map countMap = systemService.findOneForJdbc("select right(shp_bian_ma,7) shp_bian_ma from md_goods where chp_shu_xing=? and shp_bian_ma like ? ORDER BY shp_bian_ma desc LIMIT 1",mdGoods.getChpShuXing(),mdGoods.getChpShuXing()+"%"); + if (countMap == null) { + mdGoods.setShpBianMa(mdGoods.getChpShuXing()+String.format("%07d", 1)); + }else { + Object goodsCode = countMap.get("shp_bian_ma"); + if (goodsCode != null) { + mdGoods.setShpBianMa(mdGoods.getChpShuXing()+String.format("%07d",Integer.parseInt(((String) goodsCode))+1)); + }else { + mdGoods.setShpBianMa(mdGoods.getChpShuXing()+String.format("%07d", 1)); + } + } + if(StringUtil.isEmpty(mdGoods.getZhlKgm())){ if(!StringUtil.isEmpty(mdGoods.getBzhiQi())){ int bzhiq = Integer.parseInt(mdGoods.getBzhiQi()); @@ -457,6 +488,7 @@ public class MdGoodsController extends BaseController { } catch (Exception e) { // TODO: handle exception + e.printStackTrace(); } mdGoodsService.save(mdGoods); }else{ @@ -469,6 +501,7 @@ public class MdGoodsController extends BaseController { } } catch (Exception e) { + e.printStackTrace(); // TODO: handle exception } MyBeanUtils.copyBeanNotNull2Bean(mdGoods, mdGoods1); diff --git a/src/main/java/com/zzjee/md/controller/MvGoodsController.java b/src/main/java/com/zzjee/md/controller/MvGoodsController.java index fbadb43f..415cce03 100644 --- a/src/main/java/com/zzjee/md/controller/MvGoodsController.java +++ b/src/main/java/com/zzjee/md/controller/MvGoodsController.java @@ -51,12 +51,12 @@ import org.springframework.web.util.UriComponentsBuilder; import com.zzjee.md.entity.MvGoodsEntity; import com.zzjee.md.service.MvGoodsServiceI; -/** - * @Title: Controller +/** + * @Title: Controller * @Description: 商品视图 * @author erzhongxmu * @date 2017-11-02 23:59:31 - * @version V1.0 + * @version V1.0 * */ @Controller @@ -78,7 +78,7 @@ public class MvGoodsController extends BaseController { /** * 商品视图列表 页面跳转 - * + * * @return */ @RequestMapping(params = "list") @@ -89,7 +89,7 @@ public class MvGoodsController extends BaseController { // mv.addObject("coscode", oConvertUtils.getString(request.getParameter("coscode"))); // mv.addObject("goodsCode", mvGoods.getGoodsCode()); return mv; - + } /** * 删除销售订单 @@ -109,7 +109,7 @@ public class MvGoodsController extends BaseController { } /** * easyui AJAX请求数据 - * + * * @param request * @param response * @param dataGrid @@ -125,8 +125,9 @@ public class MvGoodsController extends BaseController { //自定义追加查询条件 System.out.print("ResourceUtil.getSessionUserName().setBrowser(cusCode)data"+ ResourceUtil.getSessionUserName().getBrowser()); + // String cusCode = ResourceUtil.getSessionUserName().getBrowser(); if(!StringUtil.isEmpty(ResourceUtil.getSessionUserName().getBrowser())){ - cq.like("cusCode", ResourceUtil.getSessionUserName().getBrowser()); + cq.eq("cusCode", coscode); } cq.add(); if(!StringUtil.isEmpty(goodsCode)){ @@ -139,7 +140,7 @@ public class MvGoodsController extends BaseController { // TSUser user = ResourceUtil.getSessionUserName(); // String roles = ""; System.out.println("datagrid"+goodsCode); - + // if (user != null) { // List rUsers = systemService.findByProperty(TSRoleUser.class, "TSUser.id", user.getId()); @@ -152,17 +153,17 @@ public class MvGoodsController extends BaseController { // } // if(roles.equals("CUS")){ // cq.eq("cusCode", user.getUserName()); -// +// // } // } cq.add(); this.mvGoodsService.getDataGridReturn(cq, true); TagUtil.datagrid(response, dataGrid); } - + /** * 删除商品视图 - * + * * @return */ @RequestMapping(params = "doDel") @@ -183,10 +184,10 @@ public class MvGoodsController extends BaseController { j.setMsg(message); return j; } - + /** * 批量删除商品视图 - * + * * @return */ @RequestMapping(params = "doBatchDel") @@ -197,7 +198,7 @@ public class MvGoodsController extends BaseController { message = "商品视图删除成功"; try{ for(String id:ids.split(",")){ - MvGoodsEntity mvGoods = systemService.getEntity(MvGoodsEntity.class, + MvGoodsEntity mvGoods = systemService.getEntity(MvGoodsEntity.class, id ); mvGoodsService.delete(mvGoods); @@ -215,7 +216,7 @@ public class MvGoodsController extends BaseController { /** * 添加商品视图 - * + * * @return */ @RequestMapping(params = "doAdd") @@ -235,10 +236,10 @@ public class MvGoodsController extends BaseController { j.setMsg(message); return j; } - + /** * 更新商品视图 - * + * * @return */ @RequestMapping(params = "doUpdate") @@ -260,11 +261,11 @@ public class MvGoodsController extends BaseController { j.setMsg(message); return j; } - + /** * 商品视图新增页面跳转 - * + * * @return */ @RequestMapping(params = "goAdd") @@ -277,7 +278,7 @@ public class MvGoodsController extends BaseController { } /** * 商品视图编辑页面跳转 - * + * * @return */ @RequestMapping(params = "goUpdate") @@ -288,10 +289,10 @@ public class MvGoodsController extends BaseController { } return new ModelAndView("com/zzjee/md/mvGoods-update"); } - + /** * 导入功能跳转 - * + * * @return */ @RequestMapping(params = "upload") @@ -299,10 +300,10 @@ public class MvGoodsController extends BaseController { req.setAttribute("controller_name","mvGoodsController"); return new ModelAndView("common/upload/pub_excel_upload"); } - + /** * 导出excel - * + * * @param request * @param response */ @@ -321,7 +322,7 @@ public class MvGoodsController extends BaseController { } /** * 导出excel 使模板 - * + * * @param request * @param response */ @@ -335,13 +336,13 @@ public class MvGoodsController extends BaseController { modelMap.put(NormalExcelConstants.DATA_LIST,new ArrayList()); return NormalExcelConstants.JEECG_EXCEL_VIEW; } - + @SuppressWarnings("unchecked") @RequestMapping(params = "importExcel", method = RequestMethod.POST) @ResponseBody public AjaxJson importExcel(HttpServletRequest request, HttpServletResponse response) { AjaxJson j = new AjaxJson(); - + MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; Map fileMap = multipartRequest.getFileMap(); for (Map.Entry entity : fileMap.entrySet()) { @@ -369,14 +370,14 @@ public class MvGoodsController extends BaseController { } return j; } - + @RequestMapping(method = RequestMethod.GET) @ResponseBody public List list() { List listMvGoodss=mvGoodsService.getList(MvGoodsEntity.class); return listMvGoodss; } - + @RequestMapping(value = "/{id}", method = RequestMethod.GET) @ResponseBody public ResponseEntity get(@PathVariable("id") String id) { diff --git a/src/main/java/com/zzjee/wm/controller/WmImNoticeHController.java b/src/main/java/com/zzjee/wm/controller/WmImNoticeHController.java index 7f1aac48..523febda 100644 --- a/src/main/java/com/zzjee/wm/controller/WmImNoticeHController.java +++ b/src/main/java/com/zzjee/wm/controller/WmImNoticeHController.java @@ -55,6 +55,7 @@ import java.awt.image.BufferedImage; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; +import java.math.BigDecimal; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.*; @@ -158,6 +159,7 @@ public class WmImNoticeHController extends BaseController { try { List wmImNoticeIEntityList = systemService .findHql(hql0, id0); + BigDecimal totalCount = BigDecimal.ZERO; for (WmImNoticeIEntity wmImNoticeIEntity : wmImNoticeIEntityList) { if (StringUtil.isEmpty(wmImNoticeIEntity.getBinPlan())){ String hqlup = "from WmToUpGoodsEntity where 1 = 1 AND goodsId = ? order by createDate desc"; @@ -193,13 +195,13 @@ public class WmImNoticeHController extends BaseController { }catch (Exception e){ } - + totalCount = totalCount.add(new BigDecimal(wmImNoticeIEntity.getGoodsCount())); wmImNoticeIEntitynewList.add(wmImNoticeIEntity); } - request.setAttribute("wmImNoticeIList", wmImNoticeIEntitynewList); + request.setAttribute("totalCount",totalCount); }catch (Exception e){ } @@ -2080,7 +2082,8 @@ public class WmImNoticeHController extends BaseController { printHeader.setHeader08("客户名称: " +wmImNoticeH.getCusCode()+md.getZhongWenQch()); - printHeader.setHeader09("供应商: "+wmImNoticeH.getSupCode()+ wmImNoticeH.getSupName()); + printHeader.setHeader09("供应商: "+(StringUtils.isEmpty(wmImNoticeH.getSupCode())||StringUtils.isEmpty(wmImNoticeH.getSupName())?"":wmImNoticeH.getSupCode()+ wmImNoticeH.getSupName())); + printHeader.setHeader10("客户电话: " +md.getDianHua()); diff --git a/src/main/java/com/zzjee/wm/controller/WmInQmIController.java b/src/main/java/com/zzjee/wm/controller/WmInQmIController.java index de9ebd51..4c172443 100644 --- a/src/main/java/com/zzjee/wm/controller/WmInQmIController.java +++ b/src/main/java/com/zzjee/wm/controller/WmInQmIController.java @@ -926,7 +926,7 @@ for (WmInQmIEntity wmInQmIEntity : wmInQmIso) { String hql = " from WmInQmIEntity where 1 = 1 and binSta = 'N' "; D0.setOK(true); if(!StringUtil.isEmpty(searchstr)) { - hql=hql+" and imNoticeId like '%" + searchstr + "%'"; + hql=hql+" and (imNoticeId like '%" + searchstr + "%' or tin_id like '%"+searchstr+"%')"; } if(!StringUtil.isEmpty(searchstr2)) { try{ diff --git a/src/main/java/com/zzjee/wm/controller/WmsApiController.java b/src/main/java/com/zzjee/wm/controller/WmsApiController.java index aa8bb8f6..c78cc572 100644 --- a/src/main/java/com/zzjee/wm/controller/WmsApiController.java +++ b/src/main/java/com/zzjee/wm/controller/WmsApiController.java @@ -135,6 +135,17 @@ public class WmsApiController { MdGoodsEntity.class, "shpBianMa", mdGoods.getShpBianMa()); if(mdGoods1 ==null ){ + Map countMap = systemService.findOneForJdbc("select right(shp_bian_ma,7) shp_bian_ma from md_goods where chp_shu_xing=? and shp_bian_ma like ? ORDER BY shp_bian_ma desc LIMIT 1",mdGoods.getChpShuXing(),mdGoods.getChpShuXing()+"%"); + if (countMap == null) { + mdGoods.setShpBianMa(mdGoods.getChpShuXing()+String.format("%07d", 1)); + }else { + Object goodsCode = countMap.get("shp_bian_ma"); + if (goodsCode != null) { + mdGoods.setShpBianMa(mdGoods.getChpShuXing()+String.format("%07d",Integer.parseInt(((String) goodsCode))+1)); + }else { + mdGoods.setShpBianMa(mdGoods.getChpShuXing()+String.format("%07d", 1)); + } + } if(StringUtil.isEmpty(mdGoods.getChlKongZhi()) ){ mdGoods.setChlKongZhi("N"); } diff --git a/src/main/java/com/zzjee/wmapi/controller/WvNoticeController.java b/src/main/java/com/zzjee/wmapi/controller/WvNoticeController.java index 1adeab0b..be246f36 100644 --- a/src/main/java/com/zzjee/wmapi/controller/WvNoticeController.java +++ b/src/main/java/com/zzjee/wmapi/controller/WvNoticeController.java @@ -347,7 +347,7 @@ public class WvNoticeController extends BaseController { } String[] ss = searchstr2.split(","); if (ss.length == 1) { - hql = hql + " and goodsCode like '%" + searchstr2 + "%'"; + hql = hql + " and (goodsCode like '%" + searchstr2 + "%'"+"or shp_ming_cheng like '%"+searchstr2+"%')"; } else { String insearch = ""; diff --git a/src/main/java/org/jeecgframework/web/system/controller/core/SystemController.java b/src/main/java/org/jeecgframework/web/system/controller/core/SystemController.java index 3a332c9f..f3fb7733 100644 --- a/src/main/java/org/jeecgframework/web/system/controller/core/SystemController.java +++ b/src/main/java/org/jeecgframework/web/system/controller/core/SystemController.java @@ -143,7 +143,7 @@ public class SystemController extends BaseController { return ajaxJson; } - + /** * 类型字典列表页面跳转 * @@ -196,7 +196,7 @@ public class SystemController extends BaseController { } MutiLangSqlCriteriaUtil.assembleCondition(typegroupnameKeyList, cq, "typegroupname", typegroupname); } - + String typegroupcode = request.getParameter("typegroupcode"); if(oConvertUtils.isNotEmpty(typegroupcode)) { cq.eq("typegroupcode", typegroupcode); @@ -1040,8 +1040,8 @@ public class SystemController extends BaseController { } } } - - + + /** * 在线用户列表 * @param request @@ -1188,7 +1188,7 @@ public class SystemController extends BaseController { }else{ dataLogDiff.setValue1(""); } - + if (map2.containsKey(string)) { value2 = map2.get(string).toString(); if (value2 == null) { @@ -1200,7 +1200,7 @@ public class SystemController extends BaseController { dataLogDiff.setValue2(""); } - + if (value1 == null && value2 == null) { dataLogDiff.setDiff("N"); }else { @@ -1229,7 +1229,7 @@ public class SystemController extends BaseController { return new ModelAndView("system/dataLog/diffDataVersion"); } - + /** * WebUploader * 文件上传处理/删除处理 @@ -1247,10 +1247,10 @@ public class SystemController extends BaseController { //如果是上传操作 if("1".equals(upFlag)){ String fileName = null; - String nowday=new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()); + String nowday=new SimpleDateFormat("yyyyMMdd").format(new Date()); File file = new File(ctxPath+File.separator+nowday); if (!file.exists()) { - file.mkdir();// 创建文件根目录 + file.mkdirs();// 创建文件根目录 } MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; MultipartFile mf=multipartRequest.getFile("file");// 获取上传文件对象 @@ -1311,7 +1311,7 @@ public class SystemController extends BaseController { }else{ response.setContentType("image/jpeg;charset=utf-8"); } - + InputStream inputStream = null; OutputStream outputStream=null; try { @@ -1336,5 +1336,5 @@ public class SystemController extends BaseController { } } } - + } diff --git a/src/main/webapp/webpage/com/zzjee/md/mdGoods-add.jsp b/src/main/webapp/webpage/com/zzjee/md/mdGoods-add.jsp index ac7b349d..00bf2e6f 100644 --- a/src/main/webapp/webpage/com/zzjee/md/mdGoods-add.jsp +++ b/src/main/webapp/webpage/com/zzjee/md/mdGoods-add.jsp @@ -96,21 +96,21 @@ function counttiji(){ - +<%-- --%> -
+<%--
--%> -
- 商品编码 -
-
- - - -
+<%--
--%> +<%-- 商品编码--%> +<%--
--%> +<%--
--%> +<%-- +<%-- ignore="checked"--%> +<%-- datatype="*" required="required" />--%> +<%-- --%> +<%-- --%> +<%--
--%>
客户商品编码
@@ -210,11 +210,11 @@ function counttiji(){
- 重量 + 重量
diff --git a/src/main/webapp/webpage/com/zzjee/md/mdGoods-update.jsp b/src/main/webapp/webpage/com/zzjee/md/mdGoods-update.jsp index 7b3e26a8..b38d48c6 100644 --- a/src/main/webapp/webpage/com/zzjee/md/mdGoods-update.jsp +++ b/src/main/webapp/webpage/com/zzjee/md/mdGoods-update.jsp @@ -128,7 +128,7 @@
- 商品条码 + 商品条码
- 体积 + 体积
- 重量 + 重量
- +
- +
-入库通知打印 - - - + +