增加电子城对接

master
cez 2022-07-25 22:33:08 +08:00
parent 23730d2a4c
commit 76225d3560
7 changed files with 174 additions and 52 deletions

View File

@ -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")

View File

@ -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("保存成功");
}
}

View File

@ -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<RfidBuseEntity> 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<RfidBuseEntity> 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");

View File

@ -225,6 +225,7 @@ sys.del=database
wm.alldown=yes
wm.movesta=\u5DF2\u786E\u8BA4
cus.role=CUS
sys.weight=on

View File

@ -3,7 +3,7 @@
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
<div region="center" style="padding:0px;border:0px">
<t:datagrid name="rfidBuseList" checkbox="false" pagination="true" fitColumns="false" title="RFID表" actionUrl="rfidBuseController.do?datagrid" idField="id" fit="true" queryMode="group">
<t:datagrid name="rfidBuseList" sortName="createDate" sortOrder="desc" checkbox="false" pagination="true" fitColumns="false" title="RFID表" actionUrl="rfidBuseController.do?datagrid" idField="id" fit="true" queryMode="group">
<t:dgCol title="主键" field="id" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="创建人名称" field="createName" hidden="true" queryMode="single" width="120"></t:dgCol>
<t:dgCol title="创建人登录名称" field="createBy" query="true" queryMode="single" width="120"></t:dgCol>

View File

@ -12,10 +12,10 @@
<link rel="stylesheet" href="online/template/ledefault/css/bootstrap-theme.css">
<link rel="stylesheet" href="online/template/ledefault/css/bootstrap.css">
<link rel="stylesheet" href="online/template/ledefault/css/app.css">
<link rel="stylesheet" href="plug-in/Validform/css/metrole/style.css" type="text/css"/>
<link rel="stylesheet" href="plug-in/Validform/css/metrole/tablefrom.css" type="text/css"/>
<script type="text/javascript" src="plug-in/jquery/jquery-1.8.3.js"></script>
<script type="text/javascript" src="plug-in/tools/dataformat.js"></script>
<script type="text/javascript" src="plug-in/easyui/jquery.easyui.min.1.3.2.js"></script>
@ -36,7 +36,7 @@
<script type="text/javascript">
//编写自定义JS代码
function gethuozhu(){
ajaxurl="wmInQmIController.do?doGethuozhu&noticeid="+$('#imNoticeId').val();
$.get(ajaxurl).done(function (data) {
@ -45,11 +45,11 @@
$('#custext').val(obj.obj.zhongWenQch);
});
}
function gettext(){
ajaxurl="wmInQmIController.do?doGettext&goodsid="+$('#goodsId').val()+"&noticeid="+$('#imNoticeId').val();
$.get(ajaxurl).done(function (data) {
var obj = eval('(' + data + ')');;
var obj = eval('(' + data + ')');;
console.log(obj);
if(!obj.success){
$('#goodstext').val(obj.msg);
@ -58,17 +58,17 @@ function gettext(){
$('#goodstext').val(obj.obj.shpMingCheng);
$('#qmOkQuat').val(obj.obj.chlShl);
}
});
}
function setbatch(){
$('#goodsBatch').val( $('#proData').val())
}
window.onload = function() {
window.onload = function() {
gethuozhu();
gettext();
};
};
</script>
</head>
@ -78,7 +78,7 @@ window.onload = function() {
<input type="hidden" id="btn_sub" class="btn_sub"/>
<input type="hidden" id="id" name="id"/>
<input type="hidden" id="binSta" name="binSta" value="N"/>
<div class="tab-wrapper">
<!-- tab -->
<ul class="nav nav-tabs">
@ -92,7 +92,7 @@ window.onload = function() {
<b>到货通知单:</b>
</div>
<div class="col-xs-3">
<input id="imNoticeId" name="imNoticeId" type="text" class="form-control"
<input id="imNoticeId" name="imNoticeId" type="text" class="form-control"
ignore="ignore" onchange="gethuozhu()" datatype="*" value='${wmInQmIPage.imNoticeId}'
/>
<span class="Validform_checktip" style="float:left;height:0px;"></span>
@ -107,7 +107,7 @@ window.onload = function() {
<b>商品编码:</b>
</div>
<div class="col-xs-3">
<input id="goodsId" name="goodsId" type="text" class="form-control"
<input id="goodsId" name="goodsId" type="text" class="form-control"
ignore="ignore" datatype="*" onchange="gettext()" value='${wmInQmIPage.goodsId}'
/>
<span class="Validform_checktip" style="float:left;height:0px;"> </span>
@ -115,9 +115,9 @@ window.onload = function() {
</div>
<div class="col-xs-3 text-center">
<input id="goodstext" readonly="readonly" style="width:320px;" class="form-control" />
</div>
</div>
</div>
<div class="row show-grid">
<div class="col-xs-3 text-center">
<b>数量(${wmInQmIPage.goodsUnit}) </b>
@ -127,8 +127,8 @@ window.onload = function() {
<input id="qmOkQuat" name="qmOkQuat" type="text" class="form-control"
ignore="checked" value='${wmInQmIPage.qmOkQuat}' style="width:80px;"
datatype="*" />
datatype="*" />
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">数量</label>
</div>
@ -149,15 +149,15 @@ window.onload = function() {
</div>
<div class="row show-grid">
<div class="col-xs-3 text-center">
<b>生产日期:</b>
</div>
<div class="col-xs-3">
<input id="proData" name="proData" type="text"
ignore="checked" onchange="setbatch()"
ignore="checked" onchange="setbatch()"
style="background: url('plug-in/ace/images/datetime.png') no-repeat scroll right center transparent;" class="form-control" onClick="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'%y-%M-%d'})" type="date" />
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">生产日期</label>
@ -166,7 +166,7 @@ window.onload = function() {
<b>批次:</b>
</div>
<div class="col-xs-3">
<input id="goodsBatch" name="goodsBatch" type="text" class="form-control"
<input id="goodsBatch" name="goodsBatch" type="text" class="form-control"
ignore="ignore"
/>
<span class="Validform_checktip" style="float:left;height:0px;"></span>
@ -179,7 +179,7 @@ window.onload = function() {
<b>收货温度°C</b>
</div>
<div class="col-xs-3">
<input id="recDeg" name="recDeg" type="text" class="form-control"
<input id="recDeg" name="recDeg" type="text" class="form-control"
ignore="ignore"
/>
<span class="Validform_checktip" style="float:left;height:0px;"></span>
@ -190,10 +190,10 @@ window.onload = function() {
</div>
<div class="col-xs-3">
<t:dictSelect field="itemText" type="radio" extendJson="{class:'form-control'}" defaultVal="良品"
typeGroupCode="sf_lp" hasLabel="false" title="品质"></t:dictSelect>
typeGroupCode="sf_lp" hasLabel="false" title="品质"></t:dictSelect>
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">备注</label>
</div>
@ -210,8 +210,18 @@ window.onload = function() {
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">托盘</label>
</div>
</div>
<div class="col-xs-3 text-center">
<b>入重量:</b>
</div>
<div class="col-xs-3">
<input id="baseInGoodscount" name="baseInGoodscount" type="text" class="form-control"
value='${wmInQmIPage.baseInGoodscount}'
/>
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">入重量</label>
</div>
</div>
<div class="row" id = "sub_tr" style="display: none;">
<div class="col-xs-12 layout-header">
<div class="col-xs-6"></div>
@ -220,7 +230,7 @@ window.onload = function() {
</div>
</div>
</div>
<div class="con-wrapper" id="con-wrapper2" style="display: block;"></div>
</div>
<%--<div style="margin:3px auto"><button onclick="sub('formobj');">验收</button></div>--%>
@ -270,5 +280,5 @@ window.onload = function() {
</script>
</body>
<script src = "webpage/com/zzjee/wm/wmInQmI.js"></script>
</html>
<script src = "webpage/com/zzjee/wm/wmInQmI.js"></script>
</html>

View File

@ -12,10 +12,10 @@
<link rel="stylesheet" href="online/template/ledefault/css/bootstrap-theme.css">
<link rel="stylesheet" href="online/template/ledefault/css/bootstrap.css">
<link rel="stylesheet" href="online/template/ledefault/css/app.css">
<link rel="stylesheet" href="plug-in/Validform/css/metrole/style.css" type="text/css"/>
<link rel="stylesheet" href="plug-in/Validform/css/metrole/tablefrom.css" type="text/css"/>
<script type="text/javascript" src="plug-in/jquery/jquery-1.8.3.js"></script>
<script type="text/javascript" src="plug-in/tools/dataformat.js"></script>
<script type="text/javascript" src="plug-in/easyui/jquery.easyui.min.1.3.2.js"></script>
@ -74,7 +74,7 @@
</div>
<div class="col-xs-3">
<t:dictSelect field="cusCode" type="list" extendJson="{class:'form-control'}" readonly="readonly"
dictTable="mv_cus" dictField="cus_code" dictText="cus_name" defaultVal="${wmInQmIPage.cusCode}" hasLabel="false" title="货主"></t:dictSelect>
dictTable="mv_cus" dictField="cus_code" dictText="cus_name" defaultVal="${wmInQmIPage.cusCode}" hasLabel="false" title="货主"></t:dictSelect>
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">货主</label>
</div>
@ -85,7 +85,7 @@
</div>
<div class="col-xs-3">
<input id="tinId" name="tinId" type="text" class="form-control"
ignore="checked"
ignore="checked"
datatype="*" value='${wmInQmIPage.tinId}' />
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">托盘</label>
@ -100,29 +100,29 @@
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">储位</label>
</div>
<div class="col-xs-3 text-center">
<b>是否已上架:</b>
</div>
<div class="col-xs-3">
<t:dictSelect readonly="readonly" field="binSta" type="list" extendJson="{class:'form-control'}"
typeGroupCode="sf_yn" defaultVal="${wmInQmIPage.binSta}" hasLabel="false" title="是否已上架"></t:dictSelect>
typeGroupCode="sf_yn" defaultVal="${wmInQmIPage.binSta}" hasLabel="false" title="是否已上架"></t:dictSelect>
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">是否已上架</label>
</div>
</div>
<div class="row show-grid">
<div class="col-xs-3 text-center">
<b>商品:</b>
</div>
<div class="col-xs-3">
<t:dictSelect field="goodsId" type="list" extendJson="{class:'form-control'}" readonly="readonly"
dictTable="mv_goods" dictField="goods_code" dictText="goods_name" defaultVal="${wmInQmIPage.goodsId}" hasLabel="false" title="商品编码"></t:dictSelect>
dictTable="mv_goods" dictField="goods_code" dictText="goods_name" defaultVal="${wmInQmIPage.goodsId}" hasLabel="false" title="商品编码"></t:dictSelect>
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">商品编码</label>
</div>
@ -151,7 +151,7 @@
</div>
<div class="col-xs-3">
<input id="qmOkQuat" name="qmOkQuat" type="text" class="form-control"
ignore="checked"
ignore="checked"
datatype="*" value='${wmInQmIPage.qmOkQuat}' />
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">数量</label>
@ -161,7 +161,7 @@
</div>
<div class="col-xs-3">
<input id="tinTj" name="tinTj" type="text" class="form-control"
ignore="ignore"
ignore="ignore"
value='${wmInQmIPage.tinTj}' />
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">体积</label>
@ -171,19 +171,19 @@
</div>
<div class="col-xs-3">
<input id="tinZhl" name="tinZhl" type="text" class="form-control"
ignore="ignore"
ignore="ignore"
value='${wmInQmIPage.tinZhl}' />
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">重量</label>
</div>
</div>
<div class="row show-grid">
<div class="col-xs-3 text-center">
<b>生产日期:</b>
</div>
<div class="col-xs-3">
<input id="proData" name="proData" type="text"
<input id="proData" name="proData" type="text"
ignore="checked"
style="background: url('plug-in/ace/images/datetime.png') no-repeat scroll right center transparent;" class="form-control" onClick="WdatePicker()" datatype="*" value="${wmInQmIPage.proData}" />
<span class="Validform_checktip" style="float:left;height:0px;"></span>
@ -200,7 +200,7 @@
<label class="Validform_label" style="display: none">批次</label>
</div>
</div>
<div class="row show-grid">
<div class="col-xs-3 text-center">
<b>收货温度:</b>
@ -223,7 +223,31 @@
<label class="Validform_label" style="display: none">备注</label>
</div>
</div>
<div class="row show-grid">
<div class="col-xs-3 text-center">
<b>入重量:</b>
</div>
<div class="col-xs-3">
<input id="baseInGoodscount" name="baseInGoodscount" type="text" class="form-control"
ignore="ignore"
value='${wmInQmIPage.baseInGoodscount}' />
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">入重量</label>
</div>
<div class="col-xs-3 text-center">
<b>出重量:</b>
</div>
<div class="col-xs-3">
<input id="baseOutGoodscount" name="baseOutGoodscount" type="text" class="form-control"
ignore="ignore"
value='${wmInQmIPage.baseOutGoodscount}' />
<span class="Validform_checktip" style="float:left;height:0px;"></span>
<label class="Validform_label" style="display: none">出重量</label>
</div>
</div>
<div class="row" id = "sub_tr" style="display: none;">
<div class="col-xs-12 layout-header">
<div class="col-xs-6"></div>
@ -232,7 +256,7 @@
</div>
</div>
</div>
<div class="con-wrapper" id="con-wrapper2" style="display: block;"></div>
</div>
</t:formvalid>
@ -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');
}
</script>
</body>
<script src = "webpage/com/zzjee/wm/wmInQmI.js"></script>
</html>
<script src = "webpage/com/zzjee/wm/wmInQmI.js"></script>
</html>