igds-core/src/main/java/com/ld/igds/common/CoreCommonService.java
@@ -5,6 +5,7 @@ import com.bstek.bdf2.core.model.DefaultCompany; import com.ld.igds.common.dto.DepotSerData; import com.ld.igds.common.dto.THDto; import com.ld.igds.data.SimpleDepot; import com.ld.igds.inout.dto.InoutData; import com.ld.igds.models.*; igds-core/src/main/java/com/ld/igds/common/impl/CommonDataServiceImpl.java
@@ -70,6 +70,7 @@ public List<Depot> getCacheDepotList(String companyId, String deptId) { if (null == deptId) return null; String patten = RedisConst.buildKey(companyId, RedisConst.KEY_DEPOT); Set<String> keys = redisUtil.keys(patten); if (null == keys) return null; igds-core/src/main/java/com/ld/igds/common/manager/CommonManager.java
@@ -11,6 +11,7 @@ import com.ld.igds.data.BaseParam; import com.ld.igds.data.Page; import com.ld.igds.data.PageResponse; import com.ld.igds.data.SimpleDepot; import com.ld.igds.grain.dto.GrainData; import com.ld.igds.grain.service.CoreGrainService; import com.ld.igds.inout.dto.InoutParam; @@ -64,24 +65,45 @@ private RedisUtil redisUtil; /** * 获取入库的下拉框 * 获取入库作业中,仓库下拉框,值获取状态=非满仓的粮库 * * @return */ public List<Depot> listInDepot() { List<Depot> list = listDepot(true); return list; public List<SimpleDepot> getCacheDeptIn(String companyId, String deptId) { List<SimpleDepot> result = new ArrayList<>(); List<Depot> list = coreCommonService.getCacheDepotList(companyId, deptId); for (Depot depot : list) { if (DepotStatus.STATUS_3.getCode().equals(depot.getDepotStatus())) continue; if (DepotStatus.STATUS_31.getCode().equals(depot.getDepotStatus())) continue; if (DepotStatus.STATUS_32.getCode().equals(depot.getDepotStatus())) continue; if (DepotStatus.STATUS_33.getCode().equals(depot.getDepotStatus())) continue; if (DepotStatus.STATUS_34.getCode().equals(depot.getDepotStatus())) continue; result.add(new SimpleDepot(depot)); } return result; } /** * 获取出库的下拉框 * 获取出库下拉框列表,自动屏蔽空仓 * * @return */ public List<Depot> listOutDepot() { List<Depot> list = listDepot(true); public List<SimpleDepot> getCacheDeptOut(String companyId, String deptId) { List<SimpleDepot> result = new ArrayList<>(); List<Depot> list = coreCommonService.getCacheDepotList(companyId, deptId); return list; for (Depot depot : list) { if (DepotStatus.STATUS_1.getCode().equals(depot.getDepotStatus())) continue; if (DepotStatus.STATUS_2.getCode().equals(depot.getDepotStatus())) continue; result.add(new SimpleDepot(depot)); } return result; } /** @@ -117,38 +139,12 @@ /** * 查询部门下属所有仓库列表 * * @param isDelOther * @param companyId * @param deptId * @return */ public List<Depot> listDepotByDeptId(boolean isDelOther, String deptId) { String companyId = ContextUtil.getCompanyId(); if (StringUtils.isEmpty(deptId)) { return null; } List<Depot> list = coreCommonService.getCacheDepotList(companyId); if (null == list || list.isEmpty()) { return list; } List<Depot> listDepot = new ArrayList<>(); for (Depot depot : list) { if (depot.getDeptId().contains(deptId)) { listDepot.add(depot); } } // 删除非仓库列表 if (isDelOther) { return listDepot .stream() .filter(item -> !item.getDepotType().equals( DepotType.TYPE_99.getCode())).collect(Collectors.toList()); } return listDepot; public List<Depot> listDepotByDeptId(String companyId, String deptId) { return coreCommonService.getCacheDepotList(companyId, deptId); } /** igds-core/src/main/java/com/ld/igds/data/SimpleDepot.java
@@ -1,6 +1,7 @@ package com.ld.igds.data; import com.bstek.dorado.annotation.PropertyDef; import com.ld.igds.models.Depot; import lombok.Data; import javax.persistence.Column; @@ -37,4 +38,31 @@ @PropertyDef(label = "仓库状态", description = "与库存表关联,通过库存变更") private String depotStatus; public SimpleDepot() { } public SimpleDepot(String id, String companyId, String deptId, String name, String buildingId, String granaryId, String depotType, String depotStatus) { this.id = id; this.companyId = companyId; this.deptId = deptId; this.name = name; this.buildingId = buildingId; this.granaryId = granaryId; this.depotType = depotType; this.depotStatus = depotStatus; } public SimpleDepot(Depot depot) { this.id = depot.getId(); this.companyId = depot.getCompanyId(); this.deptId = depot.getDeptId(); this.name = depot.getName(); this.buildingId = depot.getBuildingId(); this.granaryId = depot.getGranaryId(); this.depotType = depot.getDepotType(); this.depotStatus = depot.getDepotStatus(); } } igds-core/src/main/java/com/ld/igds/models/InoutConf.java
@@ -78,10 +78,6 @@ @PropertyDef(label = "控制端口") private Integer portCtrl; // @Column(name = "PORT_WEB_") // @PropertyDef(label = "WEB端口") // private Integer portWeb; @Column(name = "TYPE_", length = 10) @PropertyDef(label = "设备类型") private String type; igds-databoard/src/main/java/com/ld/igds/databoard/controller/DataboardController.java
@@ -430,7 +430,7 @@ view.addObject(Constant.MODEL_KEY_DEPT_ID, iDept.getId()); // 仓库列表 List<Depot> listDepot = commonManager.listDepotByDeptId(true, iDept.getId()); List<Depot> listDepot = commonManager.listDepotByDeptId(user.getCompanyId(), iDept.getId()); view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot); // 库区列表 igds-inout/src/main/java/com/ld/igds/inout/controller/InoutController.java
@@ -9,11 +9,11 @@ import com.ld.igds.data.BaseParam; import com.ld.igds.data.Page; import com.ld.igds.data.PageResponse; import com.ld.igds.data.SimpleDepot; import com.ld.igds.inout.InoutConstant; import com.ld.igds.inout.dto.*; import com.ld.igds.inout.manager.InoutCommonManager; import com.ld.igds.inout.manager.InoutManager; import com.ld.igds.io.dto.WeightDto; import com.ld.igds.models.Depot; import com.ld.igds.models.DicTrigger; import com.ld.igds.models.InoutConf; @@ -171,7 +171,6 @@ } ModelAndView view = new ModelAndView(); IUser user = ContextUtil.getLoginUser(); view.addObject(Constant.MODEL_KEY_LOGIN_USER, user); @@ -181,59 +180,52 @@ view.addObject("deptId", deptId); // 仓库列表做下拉框使用 List<Depot> listDepot = commonManager.listInDepot(); List<SimpleDepot> listDepot = commonManager.getCacheDeptIn(user.getCompanyId(), deptId); view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot); // 当前流程标签 view.addObject("progress", InoutConstant.PROGRESS_WEIGHT_TAG); //入库流程 //入库流程配置 String inoutProgress = inoutCommonManager.getInoutProgressConf(user.getCompanyId(), deptId, InoutConstant.TYPE_IN); view.addObject("inoutProgress", inoutProgress); //称重结果是否可修改 String weightEditTag = inoutCommonManager.getWeightEditTag(user.getCompanyId(), ContextUtil.subDeptId(user)); //称重是否可编辑标签 String weightEditTag = inoutCommonManager.getWeightEditTag(user.getCompanyId(), deptId); view.addObject("weightEditTag", weightEditTag); // 粮食品种下拉框 List<DicTrigger> listFoodVariety = inoutCommonManager.getDicTrigger(Constant.TRIGGER_PARENT_FOOD_VARIETY, user.getCompanyId()); view.addObject("listFoodVariety", listFoodVariety); // 获取出入库配置信息 // 获取出入库设备配置信息 List<InoutConf> listInoutConf = inoutCommonManager.getListInoutConf(user.getCompanyId(), deptId); //获取所有的地磅列表用于页面用户选择 List<WeightDto> listWeight = inoutCommonManager.getInoutWeightAll(listInoutConf, InoutConstant.CONF_TYPE_30); //根据出入库设备信息筛选地磅配置信息,所有地磅,支持用户手动选择 List<InoutConf> listWeight = inoutCommonManager.getInoutConf(listInoutConf, InoutConstant.CONF_TYPE_30); view.addObject("listWeight", listWeight); // 获取当前地磅信息 WeightDto weightDto = inoutCommonManager.getInoutCurWeight(listWeight, sort); // 获取当前地磅 InoutConf weightDto = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_30); view.addObject("weightDto", weightDto); // 过程摄像头1 InoutConf conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60, InoutConstant.PROGRESS_WEIGHT_TAG, 1); InoutConf conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60, InoutConstant.PROGRESS_WEIGHT_TAG, 1); view.addObject("snapDto1", conf); // 过程摄像头2 conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60, InoutConstant.PROGRESS_WEIGHT_TAG, 2); conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60, InoutConstant.PROGRESS_WEIGHT_TAG, 2); view.addObject("snapDto2", conf); // 过程摄像头3 conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60, InoutConstant.PROGRESS_WEIGHT_TAG, 3); conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_60, InoutConstant.PROGRESS_WEIGHT_TAG, 3); view.addObject("snapDto3", conf); conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_70, InoutConstant.PROGRESS_WEIGHT_TAG, 1); view.addObject("gateDto", conf); // 智慧卡 // 远程智慧卡 conf = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_80, InoutConstant.PROGRESS_WEIGHT_TAG, 1); if (null != conf) conf.setSort(sort); view.addObject("cardDto", conf); view.setViewName("admin/inout/in-weight"); return view; @@ -252,12 +244,13 @@ IUser user = ContextUtil.getLoginUser(); view.addObject(Constant.MODEL_KEY_LOGIN_USER, user); String deptId = ContextUtil.subDeptId(user); view.addObject("bizType", BizType.INOUT_IN.getCode()); view.addObject("deptId", ContextUtil.subDeptId(user)); view.addObject("deptId", deptId); view.addObject("type", InoutConstant.TYPE_IN); // 仓库列表做下拉框使用 List<Depot> listDepot = commonManager.listInDepot(); List<SimpleDepot> listDepot = commonManager.getCacheDeptIn(user.getCompanyId(), deptId); view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot); //入库流程 @@ -294,12 +287,13 @@ IUser user = ContextUtil.getLoginUser(); view.addObject(Constant.MODEL_KEY_LOGIN_USER, user); String deptId = ContextUtil.subDeptId(user); view.addObject("bizType", BizType.INOUT_IN.getCode()); view.addObject("deptId", ContextUtil.subDeptId(user)); view.addObject("deptId", deptId); view.addObject("type", InoutConstant.TYPE_IN); // 仓库列表做下拉框使用 List<Depot> listDepot = commonManager.listInDepot(); List<SimpleDepot> listDepot = commonManager.getCacheDeptIn(user.getCompanyId(), deptId); view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot); //入库流程 @@ -387,7 +381,7 @@ view.addObject("deptId", deptId); // 仓库列表做下拉框使用 List<Depot> listDepot = commonManager.listInDepot(); List<SimpleDepot> listDepot = commonManager.getCacheDeptOut(user.getCompanyId(), deptId); view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot); // 当前流程标签 @@ -409,11 +403,11 @@ List<InoutConf> listInoutConf = inoutCommonManager.getListInoutConf(user.getCompanyId(), deptId); //获取所有的地磅列表用于页面用户选择 List<WeightDto> listWeight = inoutCommonManager.getInoutWeightAll(listInoutConf, InoutConstant.CONF_TYPE_30); List<InoutConf> listWeight = inoutCommonManager.getInoutConf(listInoutConf, InoutConstant.CONF_TYPE_30); view.addObject("listWeight", listWeight); // 获取当前地磅信息 WeightDto weightDto = inoutCommonManager.getInoutCurWeight(listWeight, sort); InoutConf weightDto = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_30); view.addObject("weightDto", weightDto); // 过程摄像头1 @@ -454,7 +448,7 @@ view.addObject("type", InoutConstant.TYPE_OUT); // 仓库列表做下拉框使用 List<Depot> listDepot = commonManager.listOutDepot(); List<SimpleDepot> listDepot = commonManager.getCacheDeptOut(user.getCompanyId(),deptId); view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot); //出库流程 @@ -489,16 +483,20 @@ ModelAndView view = new ModelAndView(); // 仓库列表做下拉框使用 List<Depot> listDepot = commonManager.listOutDepot(); view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot); IUser user = ContextUtil.getLoginUser(); String deptId = ContextUtil.subDeptId(user); view.addObject(Constant.MODEL_KEY_LOGIN_USER, user); view.addObject("bizType", BizType.INOUT_OUT.getCode()); view.addObject("deptId", ContextUtil.subDeptId(user)); view.addObject("deptId",deptId); view.addObject("type", InoutConstant.TYPE_OUT); // 仓库列表做下拉框使用 List<SimpleDepot> listDepot = commonManager.getCacheDeptOut(user.getCompanyId(),deptId); view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot); //出库流程 String inoutProgress = inoutCommonManager.getInoutProgressConf(user.getCompanyId(), ContextUtil.subDeptId(user), InoutConstant.TYPE_OUT); igds-inout/src/main/java/com/ld/igds/inout/controller/InoutController2.java
@@ -7,6 +7,7 @@ import com.ld.igds.constant.RespCodeEnum; import com.ld.igds.data.Page; import com.ld.igds.data.PageResponse; import com.ld.igds.data.SimpleDepot; import com.ld.igds.file.dto.FileData; import com.ld.igds.inout.InoutConstant; import com.ld.igds.inout.dto.InoutData; @@ -28,6 +29,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.servlet.ModelAndView; import javax.annotation.Resource; import java.net.URLDecoder; import java.util.Date; @@ -126,7 +128,7 @@ view.addObject("deptId", deptId); // 仓库列表做下拉框使用 List<Depot> listDepot = commonManager.listInDepot(); List<SimpleDepot> listDepot = commonManager.getCacheDeptIn(user.getCompanyId(), deptId); view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot); //入库流程 @@ -202,7 +204,7 @@ view.addObject("deptId", deptId); // 仓库列表做下拉框使用 List<Depot> listDepot = commonManager.listOutDepot(); List<SimpleDepot> listDepot = commonManager.getCacheDeptOut(user.getCompanyId(), deptId); view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot); //入库流程 @@ -338,7 +340,7 @@ view.addObject("deptId", deptId); // 仓库列表做下拉框使用 List<Depot> listDepot = commonManager.listInDepot(); List<SimpleDepot> listDepot = commonManager.getCacheDeptIn(user.getCompanyId(), deptId); view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot); // 粮食品种下拉框 @@ -379,7 +381,7 @@ view.addObject("deptId", deptId); // 仓库列表做下拉框使用 List<Depot> listDepot = commonManager.listInDepot(); List<SimpleDepot> listDepot = commonManager.getCacheDeptIn(user.getCompanyId(), deptId); view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot); //入库流程 @@ -410,11 +412,11 @@ .getCompanyId(), deptId); //获取所有的地磅列表用于页面用户选择 List<WeightDto> listWeight = inoutCommonManager.getInoutWeightAll(listInoutConf, InoutConstant.CONF_TYPE_30); List<InoutConf> listWeight = inoutCommonManager.getInoutConf(listInoutConf, InoutConstant.CONF_TYPE_30); view.addObject("listWeight", listWeight); // 获取当前地磅信息 WeightDto weightDto = inoutCommonManager.getInoutCurWeight(listWeight, sort); InoutConf weightDto = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_30); view.addObject("weightDto", weightDto); // 过程摄像头1 @@ -456,7 +458,7 @@ view.addObject("deptId", deptId); // 仓库列表做下拉框使用 List<Depot> listDepot = commonManager.listInDepot(); List<SimpleDepot> listDepot = commonManager.getCacheDeptOut(user.getCompanyId(), deptId); view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot); // 粮食品种下拉框 @@ -495,7 +497,7 @@ view.addObject("deptId", deptId); // 仓库列表做下拉框使用 List<Depot> listDepot = commonManager.listInDepot(); List<SimpleDepot> listDepot = commonManager.getCacheDeptOut(user.getCompanyId(),deptId); view.addObject(Constant.MODEL_KEY_DEPOT_LIST, listDepot); //入库流程 @@ -526,11 +528,11 @@ .getCompanyId(), deptId); //获取所有的地磅列表用于页面用户选择 List<WeightDto> listWeight = inoutCommonManager.getInoutWeightAll(listInoutConf, InoutConstant.CONF_TYPE_30); List<InoutConf> listWeight = inoutCommonManager.getInoutConf(listInoutConf, InoutConstant.CONF_TYPE_30); view.addObject("listWeight", listWeight); // 获取当前地磅信息 WeightDto weightDto = inoutCommonManager.getInoutCurWeight(listWeight, sort); InoutConf weightDto = inoutCommonManager.getInoutConf(listInoutConf, sort, InoutConstant.CONF_TYPE_30); view.addObject("weightDto", weightDto); // 过程摄像头1 igds-inout/src/main/java/com/ld/igds/inout/manager/InoutCommonManager.java
@@ -94,6 +94,33 @@ return result; } public List<InoutConf> getInoutConf(List<InoutConf> listInoutConf, String type) { List<InoutConf> result = new ArrayList<>(); if (null == listInoutConf) return result; for (InoutConf conf : listInoutConf) { if (type.equals(conf.getType())) { result.add(conf); } } return result; } public InoutConf getInoutConf(List<InoutConf> listInoutConf, String sort,String type) { if (null == listInoutConf) return new InoutConf(sort); if (StringUtils.isEmpty(sort)) sort = "1"; InoutConf result = null; for (InoutConf conf : listInoutConf) { if (sort.equals(conf.getSort()) && type.equals(conf.getType())) { return conf; } } if (null == result) return new InoutConf(sort); return result; } /** * 根据类型获取字典表下拉框 @@ -123,28 +150,6 @@ return weightEditTag; } public List<WeightDto> getInoutWeightAll(List<InoutConf> listInoutConf, String type) { List<WeightDto> result = new ArrayList<>(); if (null == listInoutConf) return result; for (InoutConf conf : listInoutConf) { if (type.equals(conf.getType())) { result.add(new WeightDto(conf)); } } return result; } public WeightDto getInoutCurWeight(List<WeightDto> listWeight, String sort) { if (null == listWeight || listWeight.isEmpty()) return new WeightDto(); if (listWeight.size() == 1) return listWeight.get(0); for (WeightDto weight : listWeight) { if (weight.getSort().equals(sort)) return weight; } return new WeightDto(); } /** igds-inout/src/main/java/com/ld/igds/io/dto/WeightDto.java
@@ -9,6 +9,8 @@ /** * 地磅基信息 * * 2023年5月31日 13:57:15 取消舍弃使用,改用InoutConf对象和ApiInoutData * * @author: andy.jia * @description: * @version: igds-web/src/main/resources/static/admin/inout/in-weight.js
@@ -6,6 +6,7 @@ var snapData;//系统抓拍对象信息 var timerWeight; var textParam;//设备识别结果 var curProgress;//当前详细流程 $(function () { layui.use(['layer', 'laydate', 'form', 'table', 'util'], function () { @@ -49,8 +50,7 @@ // 监听重量变化 $(".weight").blur(function () { var name = this.name; deAutoByIn(name); deAutoByIn(this.name); }); // 初始化WebSocket @@ -78,7 +78,6 @@ updateWeight(); }); }); }; // socket信息返回處理 @@ -92,7 +91,6 @@ $("#btn-submit").removeClass("layui-btn-disabled"); $("#btn-submit").attr("disabled", false); } if ("btn-submit" == btnId) { $("#btn-submit").addClass("layui-btn-disabled"); $("#btn-submit").attr("disabled", true); @@ -105,8 +103,6 @@ $("#btn-printBill").removeClass("layui-btn-disabled"); $("#btn-printBill").attr("disabled", false); addDisabled(); } } if ("btn-printBill" == btnId) {// 打印过磅单,说明业务完成 @@ -119,44 +115,15 @@ $("#btn-printBill").addClass("layui-btn-disabled"); $("#btn-printBill").attr("disabled", true); delDisabled(); resetForm(); } } //更改扣重信息框不可编辑 function addDisabled() { //杂质 $("#impurity").attr("disabled", true); $("#deImpurity").attr("disabled", true); //水分 $("#wet").attr("disabled", true); $("#deWet").attr("disabled", true); //值仓 $("#deHandle").attr("disabled", true); //其他 $("#deOther").attr("disabled", true); } //恢复扣重信息框编辑状态 function delDisabled() { //杂质 $("#impurity").attr("disabled", false); $("#deImpurity").attr("disabled", false); //水分 $("#wet").attr("disabled", false); $("#deWet").attr("disabled", false); //值仓 $("#deHandle").attr("disabled", false); //其他 $("#deOther").attr("disabled", false); } // 点击称重 //点击称重 function weight() { // 没有业务数据不可执行 if (!recordData) { layer.alert("没有查询到业务数据,执行被拒绝!!"); alertError("没有查询到业务数据,执行被拒绝!!"); return; } @@ -224,7 +191,7 @@ //新的读卡方式 function flushICCard() { flushICCard1(); flushICCard1(); } /** @@ -283,7 +250,7 @@ success: function (json) { var data = json.no; if (data === "not found") { alertError("请重新读卡!"); alertError("请重新读卡!"); } else { textParam = data; $("#text-param").text("识别卡号:" + textParam); @@ -291,7 +258,7 @@ } }, error: function () { alertError("IC卡读取出错!"); alertError("IC卡读取出错!"); } }); } igds-web/src/main/resources/templates/admin/inout/in-weight.html
@@ -702,19 +702,14 @@ var weightEditTag = [[${weightEditTag}]]; //userId var userId = [[${loginUser.username}]]; //出入库类型 var type = [[${type}]]; var companyId = [[${loginUser.companyId}]]; //品种 var listFoodVariety = [[${listFoodVariety}]]; //地磅信息 var weightDto = [[${weightDto}]]; //车牌识别信息 //var lprDto = [[${lprDto}]]; //过程摄像头 var snapDto1 = [[${snapDto1}]];