From 76225d3560edade4b324fd52a1863685a02ac95f Mon Sep 17 00:00:00 2001 From: cez Date: Mon, 25 Jul 2022 22:33:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=B5=E5=AD=90=E5=9F=8E?= =?UTF-8?q?=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zzjee/api/ApiController.java | 7 ++ .../java/com/zzjee/api/wmomController.java | 26 +++++++ .../wm/controller/WmInQmIController.java | 56 ++++++++++++++- src/main/resources/sysConfig.properties | 1 + .../webpage/com/zzjee/rfid/rfidBuseList.jsp | 2 +- .../webpage/com/zzjee/wm/wmInQmI-add.jsp | 64 ++++++++++------- .../webpage/com/zzjee/wm/wmInQmI-update.jsp | 70 +++++++++++++------ 7 files changed, 174 insertions(+), 52 deletions(-) diff --git a/src/main/java/com/zzjee/api/ApiController.java b/src/main/java/com/zzjee/api/ApiController.java index e42c166f..257c347e 100644 --- a/src/main/java/com/zzjee/api/ApiController.java +++ b/src/main/java/com/zzjee/api/ApiController.java @@ -291,6 +291,13 @@ public class ApiController { return mdGoodsController.xiadan(mdGoodsstr, uriBuilder); } + @RequestMapping(value = "/weightsave/{username}", method = RequestMethod.GET) + @ResponseBody + public ResponseMessage list10(@PathVariable("username") String username, + @RequestParam(value = "searchstr", required = false) String searchstr ) { + return wmomController.weight_save(username, searchstr); + } + @RequestMapping(value = "/rfidsave/{username}", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) @ResponseBody @ApiOperation(value = "RFID保存", produces = "application/json", httpMethod = "POST") diff --git a/src/main/java/com/zzjee/api/wmomController.java b/src/main/java/com/zzjee/api/wmomController.java index 299fcd56..f3a8125e 100644 --- a/src/main/java/com/zzjee/api/wmomController.java +++ b/src/main/java/com/zzjee/api/wmomController.java @@ -639,6 +639,7 @@ wmomController { for(wmi1entity t: wmi1entityList){ RfidBuseEntity rf = new RfidBuseEntity(); rf.setCreateBy(username); + rf.setCreateDate(now()); rf.setRfidType(rfidType); rf.setRfidBuseno(rfidbuseno); rf.setRfidBusecont(rfidbusecon); @@ -655,4 +656,29 @@ wmomController { } return Result.success("RFID保存成功"); } + + @RequestMapping(value = "/weightsave/{username}", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) + @ResponseBody + @ApiOperation(value = "weight保存", produces = "application/json", httpMethod = "POST") + public synchronized ResponseMessage weight_save(@PathVariable("username") String username, + @RequestParam(value="searchstr", required=false)String searchstr ) { + + + RfidBuseEntity rf = new RfidBuseEntity(); + rf.setCreateBy(username); + rf.setCreateDate(now()); + rf.setRfidType("weight"); + rf.setRfidBuseno("1"); + Double d = Double.parseDouble(searchstr)/100; + rf.setRfidBusecont(d.toString()); + + + try{ + systemService.save(rf); + }catch (Exception e){ + Result.error("保存失败"); + } + return Result.success("保存成功"); + } + } diff --git a/src/main/java/com/zzjee/wm/controller/WmInQmIController.java b/src/main/java/com/zzjee/wm/controller/WmInQmIController.java index 5c71778e..4339e9b9 100644 --- a/src/main/java/com/zzjee/wm/controller/WmInQmIController.java +++ b/src/main/java/com/zzjee/wm/controller/WmInQmIController.java @@ -1,6 +1,7 @@ package com.zzjee.wm.controller; import java.io.IOException; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -12,6 +13,8 @@ import javax.servlet.http.HttpServletResponse; import javax.validation.ConstraintViolation; import javax.validation.Validator; +import com.zzjee.rfid.entity.RfidBuseEntity; +import com.zzjee.rfid.service.RfidBuseServiceI; import com.zzjee.wm.entity.*; import com.zzjee.wm.page.confrowpage; import com.zzjee.wm.page.wminqmpage; @@ -24,6 +27,7 @@ import org.jeecgframework.core.common.exception.BusinessException; import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery; import org.jeecgframework.core.common.model.json.AjaxJson; import org.jeecgframework.core.common.model.json.DataGrid; +import org.jeecgframework.core.common.model.json.TreeGrid; import org.jeecgframework.core.constant.Globals; import org.jeecgframework.core.util.DateUtils; import org.jeecgframework.core.util.ExceptionUtil; @@ -38,6 +42,7 @@ import org.jeecgframework.poi.excel.entity.ImportParams; import org.jeecgframework.poi.excel.entity.vo.NormalExcelConstants; import org.jeecgframework.tag.core.easyui.TagUtil; import org.jeecgframework.web.system.pojo.base.TSBaseUser; +import org.jeecgframework.web.system.pojo.base.TSType; import org.jeecgframework.web.system.pojo.base.TSUser; import org.jeecgframework.web.system.service.SystemService; import org.springframework.beans.factory.annotation.Autowired; @@ -89,7 +94,8 @@ public class WmInQmIController extends BaseController { private SystemService systemService; @Autowired private Validator validator; - + @Autowired + private RfidBuseServiceI rfidBuseService; /** * 批量收货列表 页面跳转 @@ -818,6 +824,28 @@ public class WmInQmIController extends BaseController { wmInQmI.setQmOkQuat(Long.toString(quat)); wmInQmI.setTinId(wmUtil.gettuopanma()); + if (ResourceUtil.getConfigByName("sys.weight").equals("on")) { + String rfidcontent = ""; + try{ + CriteriaQuery cq; + cq = new CriteriaQuery(RfidBuseEntity.class); + cq.eq("rfidType", "weight"); + cq.ge("createDate", new SimpleDateFormat("yyyy-MM-dd").parse(DateUtils.getDate("yyyy-MM-dd"))); + cq.add(); + + List listByCriteriaQuery = rfidBuseService.getListByCriteriaQuery(cq, false); + RfidBuseEntity rfidBuseEntity = listByCriteriaQuery.get(listByCriteriaQuery.size()-1); + rfidcontent = rfidBuseEntity.getRfidBusecont(); + }catch (Exception e){ + e.printStackTrace(); + } + + wmInQmI.setBaseInGoodscount(rfidcontent); + } + + + + req.setAttribute("wmInQmIPage", wmInQmI); return new ModelAndView("com/zzjee/wm/wmInQmI-add"); @@ -833,6 +861,32 @@ public class WmInQmIController extends BaseController { if (StringUtil.isNotEmpty(wmInQmI.getId())) { wmInQmI = wmInQmIService.getEntity(WmInQmIEntity.class, wmInQmI.getId()); + + if (ResourceUtil.getConfigByName("sys.weight").equals("on")&&StringUtil.isEmpty(wmInQmI.getBaseOutGoodscount())) { + String rfidcontent = ""; + try{ + CriteriaQuery cq; + cq = new CriteriaQuery(RfidBuseEntity.class); + cq.eq("rfidType", "weight"); + cq.ge("createDate", new SimpleDateFormat("yyyy-MM-dd").parse(DateUtils.getDate("yyyy-MM-dd"))); + cq.add(); + + List listByCriteriaQuery = rfidBuseService.getListByCriteriaQuery(cq, false); + RfidBuseEntity rfidBuseEntity = listByCriteriaQuery.get(listByCriteriaQuery.size()-1); + rfidcontent = rfidBuseEntity.getRfidBusecont(); + }catch (Exception e){ + e.printStackTrace(); + } + wmInQmI.setBaseOutGoodscount(rfidcontent); + if(StringUtil.isNotEmpty(wmInQmI.getBaseInGoodscount())&&StringUtil.isNotEmpty(wmInQmI.getBaseOutGoodscount())){ + Double basecount = Double.parseDouble(wmInQmI.getBaseOutGoodscount()) - Double.parseDouble(wmInQmI.getBaseInGoodscount()); + String basecountStr = String.format("%.2f", basecount); +// wmInQmI.setImQuat(basecountStr); + wmInQmI.setQmOkQuat(basecountStr); + wmInQmI.setBaseGoodscount(basecountStr); + wmInQmI.setTinZhl(basecountStr); + } + } req.setAttribute("wmInQmIPage", wmInQmI); } return new ModelAndView("com/zzjee/wm/wmInQmI-update"); diff --git a/src/main/resources/sysConfig.properties b/src/main/resources/sysConfig.properties index d45f5120..2ad1f3a0 100644 --- a/src/main/resources/sysConfig.properties +++ b/src/main/resources/sysConfig.properties @@ -225,6 +225,7 @@ sys.del=database wm.alldown=yes wm.movesta=\u5DF2\u786E\u8BA4 cus.role=CUS +sys.weight=on diff --git a/src/main/webapp/webpage/com/zzjee/rfid/rfidBuseList.jsp b/src/main/webapp/webpage/com/zzjee/rfid/rfidBuseList.jsp index 609eb078..80577d81 100644 --- a/src/main/webapp/webpage/com/zzjee/rfid/rfidBuseList.jsp +++ b/src/main/webapp/webpage/com/zzjee/rfid/rfidBuseList.jsp @@ -3,7 +3,7 @@
- + diff --git a/src/main/webapp/webpage/com/zzjee/wm/wmInQmI-add.jsp b/src/main/webapp/webpage/com/zzjee/wm/wmInQmI-add.jsp index e80e1144..a24587dd 100644 --- a/src/main/webapp/webpage/com/zzjee/wm/wmInQmI-add.jsp +++ b/src/main/webapp/webpage/com/zzjee/wm/wmInQmI-add.jsp @@ -12,10 +12,10 @@ - + - + @@ -36,7 +36,7 @@ @@ -78,7 +78,7 @@ window.onload = function() { - +
- @@ -107,7 +107,7 @@ window.onload = function() { 商品编码:
- @@ -115,9 +115,9 @@ window.onload = function() {
-
+
- +
数量(${wmInQmIPage.goodsUnit}) : @@ -127,8 +127,8 @@ window.onload = function() { - + datatype="*" /> +
@@ -149,15 +149,15 @@ window.onload = function() {
- - + +
生产日期:
@@ -166,7 +166,7 @@ window.onload = function() { 批次:
- @@ -179,7 +179,7 @@ window.onload = function() { 收货温度(°C):
- @@ -190,10 +190,10 @@ window.onload = function() {
+ typeGroupCode="sf_lp" hasLabel="false" title="品质"> - - + +
@@ -210,8 +210,18 @@ window.onload = function() {
- +
+ 入重量: +
+
+ + + +
+ - +
<%--
--%> @@ -270,5 +280,5 @@ window.onload = function() { - - \ No newline at end of file + + diff --git a/src/main/webapp/webpage/com/zzjee/wm/wmInQmI-update.jsp b/src/main/webapp/webpage/com/zzjee/wm/wmInQmI-update.jsp index 41b4314d..579127d7 100644 --- a/src/main/webapp/webpage/com/zzjee/wm/wmInQmI-update.jsp +++ b/src/main/webapp/webpage/com/zzjee/wm/wmInQmI-update.jsp @@ -12,10 +12,10 @@ - + - + @@ -74,7 +74,7 @@
+ dictTable="mv_cus" dictField="cus_code" dictText="cus_name" defaultVal="${wmInQmIPage.cusCode}" hasLabel="false" title="货主">
@@ -85,7 +85,7 @@
@@ -100,29 +100,29 @@
- - + +
是否已上架:
+ typeGroupCode="sf_yn" defaultVal="${wmInQmIPage.binSta}" hasLabel="false" title="是否已上架">
- + - - + +
商品:
+ dictTable="mv_goods" dictField="goods_code" dictText="goods_name" defaultVal="${wmInQmIPage.goodsId}" hasLabel="false" title="商品编码">
@@ -151,7 +151,7 @@
@@ -161,7 +161,7 @@
@@ -171,19 +171,19 @@
- +
生产日期:
- @@ -200,7 +200,7 @@
- +
收货温度: @@ -223,7 +223,31 @@
- + + +
+
+ 入重量: +
+
+ + + +
+
+ 出重量: +
+
+ + + +
+
+ - +
@@ -243,7 +267,7 @@ if(location.href.indexOf("load=detail")!=-1){ $(".jeecgDetail").hide(); } - + if(location.href.indexOf("mode=read")!=-1){ //查看模式控件禁用 $("#formobj").find(":input").attr("disabled","disabled"); @@ -256,11 +280,11 @@ var neibuClickFlag = false; function neibuClick() { - neibuClickFlag = true; + neibuClickFlag = true; $('#btn_sub').trigger('click'); } - - \ No newline at end of file + +