From aa782aa279b370d61c0a67efcc4dc0e6e6ad0a5f Mon Sep 17 00:00:00 2001 From: wenjy <wenjy@mesnac.com> Date: Mon, 22 Jul 2024 15:15:20 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=E5=BA=93=E5=AD=98=E5=8F=B0=E8=B4=A6?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/BaseBasketInfoController.java | 127 +++++++++++++ .../src/main/resources/application-druid.yml | 17 +- bgs-admin/src/main/resources/application.yml | 4 +- .../templates/base/basketInfo/add.html | 80 ++++++++ .../templates/base/basketInfo/basketInfo.html | 129 +++++++++++++ .../templates/base/basketInfo/edit.html | 81 +++++++++ .../templates/base/location/stockLedger.html | 10 +- .../com/bgs/system/domain/BaseBasketInfo.java | 171 ++++++++++++++++++ .../system/domain/LedgerInstantBinding.java | 28 ++- .../system/mapper/BaseBasketInfoMapper.java | 61 +++++++ .../service/IBaseBasketInfoService.java | 61 +++++++ .../impl/BaseBasketInfoServiceImpl.java | 94 ++++++++++ .../mapper/system/BaseBasketInfoMapper.xml | 92 ++++++++++ .../mapper/system/BaseLocationInfoMapper.xml | 37 +++- .../system/LedgerInstantBindingMapper.xml | 24 +-- 15 files changed, 975 insertions(+), 41 deletions(-) create mode 100644 bgs-admin/src/main/java/com/bgs/web/controller/base/BaseBasketInfoController.java create mode 100644 bgs-admin/src/main/resources/templates/base/basketInfo/add.html create mode 100644 bgs-admin/src/main/resources/templates/base/basketInfo/basketInfo.html create mode 100644 bgs-admin/src/main/resources/templates/base/basketInfo/edit.html create mode 100644 bgs-system/src/main/java/com/bgs/system/domain/BaseBasketInfo.java create mode 100644 bgs-system/src/main/java/com/bgs/system/mapper/BaseBasketInfoMapper.java create mode 100644 bgs-system/src/main/java/com/bgs/system/service/IBaseBasketInfoService.java create mode 100644 bgs-system/src/main/java/com/bgs/system/service/impl/BaseBasketInfoServiceImpl.java create mode 100644 bgs-system/src/main/resources/mapper/system/BaseBasketInfoMapper.xml diff --git a/bgs-admin/src/main/java/com/bgs/web/controller/base/BaseBasketInfoController.java b/bgs-admin/src/main/java/com/bgs/web/controller/base/BaseBasketInfoController.java new file mode 100644 index 0000000..19b4c31 --- /dev/null +++ b/bgs-admin/src/main/java/com/bgs/web/controller/base/BaseBasketInfoController.java @@ -0,0 +1,127 @@ +package com.bgs.web.controller.base; + +import java.util.List; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.bgs.common.annotation.Log; +import com.bgs.common.enums.BusinessType; +import com.bgs.system.domain.BaseBasketInfo; +import com.bgs.system.service.IBaseBasketInfoService; +import com.bgs.common.core.controller.BaseController; +import com.bgs.common.core.domain.AjaxResult; +import com.bgs.common.utils.poi.ExcelUtil; +import com.bgs.common.core.page.TableDataInfo; + +/** + * 货筐信息Controller + * + * @author wenjy + * @date 2024-07-19 + */ +@Controller +@RequestMapping("/base/basketInfo") +public class BaseBasketInfoController extends BaseController +{ + private String prefix = "base/basketInfo"; + + @Autowired + private IBaseBasketInfoService baseBasketInfoService; + + @RequiresPermissions("base:basketInfo:view") + @GetMapping() + public String basketInfo() + { + return prefix + "/basketInfo"; + } + + /** + * 查询货筐信息列表 + */ + @RequiresPermissions("base:basketInfo:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(BaseBasketInfo baseBasketInfo) + { + startPage(); + List<BaseBasketInfo> list = baseBasketInfoService.selectBaseBasketInfoList(baseBasketInfo); + return getDataTable(list); + } + + /** + * 导出货筐信息列表 + */ + @RequiresPermissions("base:basketInfo:export") + @Log(title = "货筐信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(BaseBasketInfo baseBasketInfo) + { + List<BaseBasketInfo> list = baseBasketInfoService.selectBaseBasketInfoList(baseBasketInfo); + ExcelUtil<BaseBasketInfo> util = new ExcelUtil<BaseBasketInfo>(BaseBasketInfo.class); + return util.exportExcel(list, "货筐信息数据"); + } + + /** + * 新增货筐信息 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存货筐信息 + */ + @RequiresPermissions("base:basketInfo:add") + @Log(title = "货筐信息", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(BaseBasketInfo baseBasketInfo) + { + return toAjax(baseBasketInfoService.insertBaseBasketInfo(baseBasketInfo)); + } + + /** + * 修改货筐信息 + */ + @RequiresPermissions("base:basketInfo:edit") + @GetMapping("/edit/{objId}") + public String edit(@PathVariable("objId") Long objId, ModelMap mmap) + { + BaseBasketInfo baseBasketInfo = baseBasketInfoService.selectBaseBasketInfoByObjId(objId); + mmap.put("baseBasketInfo", baseBasketInfo); + return prefix + "/edit"; + } + + /** + * 修改保存货筐信息 + */ + @RequiresPermissions("base:basketInfo:edit") + @Log(title = "货筐信息", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(BaseBasketInfo baseBasketInfo) + { + return toAjax(baseBasketInfoService.updateBaseBasketInfo(baseBasketInfo)); + } + + /** + * 删除货筐信息 + */ + @RequiresPermissions("base:basketInfo:remove") + @Log(title = "货筐信息", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(baseBasketInfoService.deleteBaseBasketInfoByObjIds(ids)); + } +} diff --git a/bgs-admin/src/main/resources/application-druid.yml b/bgs-admin/src/main/resources/application-druid.yml index 2ed9347..ba34a5c 100644 --- a/bgs-admin/src/main/resources/application-druid.yml +++ b/bgs-admin/src/main/resources/application-druid.yml @@ -6,16 +6,19 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://175.27.215.92:3306/bgs_wms_2024?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 +# url: jdbc:mysql://175.27.215.92:3306/bgs_wms_2024?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 +# username: root +# password: haiwei@123 + url: jdbc:mysql://10.32.128.150:6606/bgs-rfid-track?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true username: root - password: haiwei@123 + password: Haiwei@123 #150 # 从库数据源 slave: # 从数据源开关/默认关闭 enabled: false - url: - username: - password: + url: + username: + password: # 初始连接数 initialSize: 5 # 最小连接池数量 @@ -39,7 +42,7 @@ spring: testWhileIdle: true testOnBorrow: false testOnReturn: false - webStatFilter: + webStatFilter: enabled: true statViewServlet: enabled: true @@ -58,4 +61,4 @@ spring: merge-sql: true wall: config: - multi-statement-allow: true \ No newline at end of file + multi-statement-allow: true diff --git a/bgs-admin/src/main/resources/application.yml b/bgs-admin/src/main/resources/application.yml index de76d35..de475cd 100644 --- a/bgs-admin/src/main/resources/application.yml +++ b/bgs-admin/src/main/resources/application.yml @@ -16,7 +16,7 @@ ruoyi: # 开发环境配置 server: # 服务器的HTTP端口,默认为80 - port: 80 + port: 90 servlet: # 应用的访问路径 context-path: / @@ -30,7 +30,7 @@ server: max: 800 # Tomcat启动初始化的线程数,默认值10 min-spare: 100 - + # 日志配置 logging: level: diff --git a/bgs-admin/src/main/resources/templates/base/basketInfo/add.html b/bgs-admin/src/main/resources/templates/base/basketInfo/add.html new file mode 100644 index 0000000..7fdb89f --- /dev/null +++ b/bgs-admin/src/main/resources/templates/base/basketInfo/add.html @@ -0,0 +1,80 @@ +<!DOCTYPE html> +<html lang="zh" xmlns:th="http://www.thymeleaf.org" > +<head> + <th:block th:include="include :: header('新增货筐信息')" /> + <th:block th:include="include :: datetimepicker-css" /> +</head> +<body class="white-bg"> + <div class="wrapper wrapper-content animated fadeInRight ibox-content"> + <form class="form-horizontal m" id="form-basketInfo-add"> + <div class="col-xs-12"> + <div class="form-group"> + <label class="col-sm-3 control-label">货筐编号:</label> + <div class="col-sm-8"> + <input name="basketCode" class="form-control" type="text"> + </div> + </div> + </div> + <div class="col-xs-12"> + <div class="form-group"> + <label class="col-sm-3 control-label">货筐条码:</label> + <div class="col-sm-8"> + <input name="basketEpc" class="form-control" type="text"> + </div> + </div> + </div> + <div class="col-xs-12"> + <div class="form-group"> + <label class="col-sm-3 control-label">货筐类型:</label> + <div class="col-sm-8"> + <select name="basketType" class="form-control" th:with="type=${@dict.getType('basket_type')}"> + <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> + </select> + </div> + </div> + </div> + <div class="col-xs-12"> + <div class="form-group"> + <label class="col-sm-3 control-label">货筐状态:</label> + <div class="col-sm-8"> + <select name="basketStatus" class="form-control" th:with="type=${@dict.getType('basket_status')}"> + <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> + </select> + </div> + </div> + </div> + <!--<div class="col-xs-12"> + <div class="form-group"> + <label class="col-sm-3 control-label">更新时间:</label> + <div class="col-sm-8"> + <div class="input-group date"> + <input name="updatedTime" class="form-control" placeholder="yyyy-MM-dd" type="text"> + <span class="input-group-addon"><i class="fa fa-calendar"></i></span> + </div> + </div> + </div> + </div>--> + </form> + </div> + <th:block th:include="include :: footer" /> + <th:block th:include="include :: datetimepicker-js" /> + <script th:inline="javascript"> + var prefix = ctx + "base/basketInfo" + $("#form-basketInfo-add").validate({ + focusCleanup: true + }); + + function submitHandler() { + if ($.validate.form()) { + $.operate.save(prefix + "/add", $('#form-basketInfo-add').serialize()); + } + } + + $("input[name='updatedTime']").datetimepicker({ + format: "yyyy-mm-dd", + minView: "month", + autoclose: true + }); + </script> +</body> +</html> diff --git a/bgs-admin/src/main/resources/templates/base/basketInfo/basketInfo.html b/bgs-admin/src/main/resources/templates/base/basketInfo/basketInfo.html new file mode 100644 index 0000000..d05b5a1 --- /dev/null +++ b/bgs-admin/src/main/resources/templates/base/basketInfo/basketInfo.html @@ -0,0 +1,129 @@ +<!DOCTYPE html> +<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> +<head> + <th:block th:include="include :: header('货筐信息列表')" /> +</head> +<body class="gray-bg"> + <div class="container-div"> + <div class="row"> + <div class="col-sm-12 search-collapse"> + <form id="formId"> + <div class="select-list"> + <ul> + <li> + <label>货筐编号:</label> + <input type="text" name="basketCode"/> + </li> + <li> + <label>货筐条码:</label> + <input type="text" name="basketEpc"/> + </li> + <!--<li> + <label>货筐类型:</label> + <select name="basketType" th:with="type=${@dict.getType('basket_type')}"> + <option value="">所有</option> + <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> + </select> + </li>--> + <li> + <label>货筐状态:</label> + <select name="basketStatus" th:with="type=${@dict.getType('basket_status')}"> + <option value="">所有</option> + <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> + </select> + </li> + <li> + <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a> + </li> + </ul> + </div> + </form> + </div> + + <div class="btn-group-sm" id="toolbar" role="group"> + <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="base:basketInfo:add"> + <i class="fa fa-plus"></i> 添加 + </a> + <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="base:basketInfo:edit"> + <i class="fa fa-edit"></i> 修改 + </a> + <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="base:basketInfo:remove"> + <i class="fa fa-remove"></i> 删除 + </a> + <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="base:basketInfo:export"> + <i class="fa fa-download"></i> 导出 + </a> + </div> + <div class="col-sm-12 select-table table-striped"> + <table id="bootstrap-table"></table> + </div> + </div> + </div> + <th:block th:include="include :: footer" /> + <script th:inline="javascript"> + var editFlag = [[${@permission.hasPermi('base:basketInfo:edit')}]]; + var removeFlag = [[${@permission.hasPermi('base:basketInfo:remove')}]]; + var basketTypeDatas = [[${@dict.getType('basket_type')}]]; + var basketStatusDatas = [[${@dict.getType('basket_status')}]]; + var isFlagDatas = [[${@dict.getType('sys_is_flag')}]]; + var prefix = ctx + "base/basketInfo"; + + $(function() { + var options = { + url: prefix + "/list", + createUrl: prefix + "/add", + updateUrl: prefix + "/edit/{id}", + removeUrl: prefix + "/remove", + exportUrl: prefix + "/export", + modalName: "货筐信息", + columns: [{ + checkbox: true + }, + { + field: 'objId', + title: '标识ID', + visible: false + }, + { + field: 'basketCode', + title: '货筐编号' + }, + { + field: 'basketEpc', + title: '货筐RFID条码' + }, + { + field: 'basketType', + title: '货筐类型', + formatter: function(value, row, index) { + return $.table.selectDictLabel(basketTypeDatas, value); + } + }, + { + field: 'basketStatus', + title: '货筐状态', + formatter: function(value, row, index) { + return $.table.selectDictLabel(basketStatusDatas, value); + } + }, + { + field: 'updatedTime', + title: '更新时间' + }, + { + title: '操作', + align: 'center', + formatter: function(value, row, index) { + var actions = []; + actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.objId + '\')"><i class="fa fa-edit"></i>编辑</a> '); + actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.objId + '\')"><i class="fa fa-remove"></i>删除</a>'); + return actions.join(''); + } + }] + }; + $.table.init(options); + }); + </script> +</body> +</html> diff --git a/bgs-admin/src/main/resources/templates/base/basketInfo/edit.html b/bgs-admin/src/main/resources/templates/base/basketInfo/edit.html new file mode 100644 index 0000000..fae60c2 --- /dev/null +++ b/bgs-admin/src/main/resources/templates/base/basketInfo/edit.html @@ -0,0 +1,81 @@ +<!DOCTYPE html> +<html lang="zh" xmlns:th="http://www.thymeleaf.org" > +<head> + <th:block th:include="include :: header('修改货筐信息')" /> + <th:block th:include="include :: datetimepicker-css" /> +</head> +<body class="white-bg"> + <div class="wrapper wrapper-content animated fadeInRight ibox-content"> + <form class="form-horizontal m" id="form-basketInfo-edit" th:object="${baseBasketInfo}"> + <input name="objId" th:field="*{objId}" type="hidden"> + <div class="col-xs-12"> + <div class="form-group"> + <label class="col-sm-3 control-label">货筐编号:</label> + <div class="col-sm-8"> + <input name="basketCode" th:field="*{basketCode}" class="form-control" type="text"> + </div> + </div> + </div> + <div class="col-xs-12"> + <div class="form-group"> + <label class="col-sm-3 control-label">货筐条码:</label> + <div class="col-sm-8"> + <input name="basketEpc" th:field="*{basketEpc}" class="form-control" type="text"> + </div> + </div> + </div> + <div class="col-xs-12"> + <div class="form-group"> + <label class="col-sm-3 control-label">货筐类型:</label> + <div class="col-sm-8"> + <select name="basketType" class="form-control" th:with="type=${@dict.getType('basket_type')}"> + <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{basketType}"></option> + </select> + </div> + </div> + </div> + <div class="col-xs-12"> + <div class="form-group"> + <label class="col-sm-3 control-label">货筐状态:</label> + <div class="col-sm-8"> + <select name="basketStatus" class="form-control" th:with="type=${@dict.getType('basket_status')}"> + <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{basketStatus}"></option> + </select> + </div> + </div> + </div> + <!--<div class="col-xs-12"> + <div class="form-group"> + <label class="col-sm-3 control-label">更新时间:</label> + <div class="col-sm-8"> + <div class="input-group date"> + <input name="updatedTime" th:value="${#dates.format(baseBasketInfo.updatedTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text"> + <span class="input-group-addon"><i class="fa fa-calendar"></i></span> + </div> + </div> + </div> + </div>--> + </form> + </div> + <th:block th:include="include :: footer" /> + <th:block th:include="include :: datetimepicker-js" /> + <script th:inline="javascript"> + var prefix = ctx + "base/basketInfo"; + $("#form-basketInfo-edit").validate({ + focusCleanup: true + }); + + function submitHandler() { + if ($.validate.form()) { + $.operate.save(prefix + "/edit", $('#form-basketInfo-edit').serialize()); + } + } + + $("input[name='updatedTime']").datetimepicker({ + format: "yyyy-mm-dd", + minView: "month", + autoclose: true + }); + </script> +</body> +</html> diff --git a/bgs-admin/src/main/resources/templates/base/location/stockLedger.html b/bgs-admin/src/main/resources/templates/base/location/stockLedger.html index 0866a73..6dcc6a1 100644 --- a/bgs-admin/src/main/resources/templates/base/location/stockLedger.html +++ b/bgs-admin/src/main/resources/templates/base/location/stockLedger.html @@ -259,13 +259,17 @@ title: '库位编号' }, { - field: 'cargoFrameEpc', - title: '货筐RFID' + field: 'basketCode', + title: '货筐编号' }, { field: 'waybillNumber', title: '运单编号' }, + { + field: 'cargoFrameEpc', + title: '货筐RFID' + }, { field: 'crateTime', title: '绑定时间' @@ -296,4 +300,4 @@ }); </script> </body> -</html> \ No newline at end of file +</html> diff --git a/bgs-system/src/main/java/com/bgs/system/domain/BaseBasketInfo.java b/bgs-system/src/main/java/com/bgs/system/domain/BaseBasketInfo.java new file mode 100644 index 0000000..d48ebee --- /dev/null +++ b/bgs-system/src/main/java/com/bgs/system/domain/BaseBasketInfo.java @@ -0,0 +1,171 @@ +package com.bgs.system.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.bgs.common.annotation.Excel; +import com.bgs.common.core.domain.BaseEntity; + +/** + * 货筐信息对象 base_basket_info + * + * @author wenjy + * @date 2024-07-19 + */ +public class BaseBasketInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 标识ID */ + private Long objId; + + /** 货筐编号 */ + @Excel(name = "货筐编号") + private String basketCode; + + /** 货筐RFID */ + @Excel(name = "货筐RFID") + private String basketEpc; + + /** 货筐类型 */ + @Excel(name = "货筐类型") + private Long basketType; + + /** 货筐状态 */ + @Excel(name = "货筐状态") + private Long basketStatus; + + /** 是否状态 */ + private Long isFlag; + + /** 创建人 */ + private String createdBy; + + /** 创建时间 */ + private Date createdTime; + + /** 更新人 */ + private String updatedBy; + + /** 更新时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date updatedTime; + + public void setObjId(Long objId) + { + this.objId = objId; + } + + public Long getObjId() + { + return objId; + } + + public void setBasketCode(String basketCode) + { + this.basketCode = basketCode; + } + + public String getBasketCode() + { + return basketCode; + } + + public void setBasketEpc(String basketEpc) + { + this.basketEpc = basketEpc; + } + + public String getBasketEpc() + { + return basketEpc; + } + + public void setBasketType(Long basketType) + { + this.basketType = basketType; + } + + public Long getBasketType() + { + return basketType; + } + + public void setBasketStatus(Long basketStatus) + { + this.basketStatus = basketStatus; + } + + public Long getBasketStatus() + { + return basketStatus; + } + + public void setIsFlag(Long isFlag) + { + this.isFlag = isFlag; + } + + public Long getIsFlag() + { + return isFlag; + } + + public void setCreatedBy(String createdBy) + { + this.createdBy = createdBy; + } + + public String getCreatedBy() + { + return createdBy; + } + + public void setCreatedTime(Date createdTime) + { + this.createdTime = createdTime; + } + + public Date getCreatedTime() + { + return createdTime; + } + + public void setUpdatedBy(String updatedBy) + { + this.updatedBy = updatedBy; + } + + public String getUpdatedBy() + { + return updatedBy; + } + + public void setUpdatedTime(Date updatedTime) + { + this.updatedTime = updatedTime; + } + + public Date getUpdatedTime() + { + return updatedTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("objId", getObjId()) + .append("basketCode", getBasketCode()) + .append("basketEpc", getBasketEpc()) + .append("basketType", getBasketType()) + .append("basketStatus", getBasketStatus()) + .append("isFlag", getIsFlag()) + .append("createdBy", getCreatedBy()) + .append("createdTime", getCreatedTime()) + .append("updatedBy", getUpdatedBy()) + .append("updatedTime", getUpdatedTime()) + .toString(); + } +} diff --git a/bgs-system/src/main/java/com/bgs/system/domain/LedgerInstantBinding.java b/bgs-system/src/main/java/com/bgs/system/domain/LedgerInstantBinding.java index 92f29b9..6cc0ee9 100644 --- a/bgs-system/src/main/java/com/bgs/system/domain/LedgerInstantBinding.java +++ b/bgs-system/src/main/java/com/bgs/system/domain/LedgerInstantBinding.java @@ -9,7 +9,7 @@ import com.bgs.common.core.domain.BaseEntity; /** * 实时绑定台账对象 ledger_instant_binding - * + * * @author wenjy * @date 2024-07-15 */ @@ -35,42 +35,44 @@ public class LedgerInstantBinding extends BaseEntity private String locationCode; - public void setObjid(Long objid) + private String basketCode; + + public void setObjid(Long objid) { this.objid = objid; } - public Long getObjid() + public Long getObjid() { return objid; } - public void setCargoFrameEpc(String cargoFrameEpc) + public void setCargoFrameEpc(String cargoFrameEpc) { this.cargoFrameEpc = cargoFrameEpc; } - public String getCargoFrameEpc() + public String getCargoFrameEpc() { return cargoFrameEpc; } - public void setWaybillNumber(String waybillNumber) + public void setWaybillNumber(String waybillNumber) { this.waybillNumber = waybillNumber; } - public String getWaybillNumber() + public String getWaybillNumber() { return waybillNumber; } - public void setCrateTime(Date crateTime) + public void setCrateTime(Date crateTime) { this.crateTime = crateTime; } - public Date getCrateTime() + public Date getCrateTime() { return crateTime; } @@ -83,6 +85,14 @@ public class LedgerInstantBinding extends BaseEntity this.locationCode = locationCode; } + public String getBasketCode() { + return basketCode; + } + + public void setBasketCode(String basketCode) { + this.basketCode = basketCode; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/bgs-system/src/main/java/com/bgs/system/mapper/BaseBasketInfoMapper.java b/bgs-system/src/main/java/com/bgs/system/mapper/BaseBasketInfoMapper.java new file mode 100644 index 0000000..d78de93 --- /dev/null +++ b/bgs-system/src/main/java/com/bgs/system/mapper/BaseBasketInfoMapper.java @@ -0,0 +1,61 @@ +package com.bgs.system.mapper; + +import java.util.List; +import com.bgs.system.domain.BaseBasketInfo; + +/** + * 货筐信息Mapper接口 + * + * @author wenjy + * @date 2024-07-19 + */ +public interface BaseBasketInfoMapper +{ + /** + * 查询货筐信息 + * + * @param objId 货筐信息主键 + * @return 货筐信息 + */ + public BaseBasketInfo selectBaseBasketInfoByObjId(Long objId); + + /** + * 查询货筐信息列表 + * + * @param baseBasketInfo 货筐信息 + * @return 货筐信息集合 + */ + public List<BaseBasketInfo> selectBaseBasketInfoList(BaseBasketInfo baseBasketInfo); + + /** + * 新增货筐信息 + * + * @param baseBasketInfo 货筐信息 + * @return 结果 + */ + public int insertBaseBasketInfo(BaseBasketInfo baseBasketInfo); + + /** + * 修改货筐信息 + * + * @param baseBasketInfo 货筐信息 + * @return 结果 + */ + public int updateBaseBasketInfo(BaseBasketInfo baseBasketInfo); + + /** + * 删除货筐信息 + * + * @param objId 货筐信息主键 + * @return 结果 + */ + public int deleteBaseBasketInfoByObjId(Long objId); + + /** + * 批量删除货筐信息 + * + * @param objIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBaseBasketInfoByObjIds(String[] objIds); +} diff --git a/bgs-system/src/main/java/com/bgs/system/service/IBaseBasketInfoService.java b/bgs-system/src/main/java/com/bgs/system/service/IBaseBasketInfoService.java new file mode 100644 index 0000000..32de5d9 --- /dev/null +++ b/bgs-system/src/main/java/com/bgs/system/service/IBaseBasketInfoService.java @@ -0,0 +1,61 @@ +package com.bgs.system.service; + +import java.util.List; +import com.bgs.system.domain.BaseBasketInfo; + +/** + * 货筐信息Service接口 + * + * @author wenjy + * @date 2024-07-19 + */ +public interface IBaseBasketInfoService +{ + /** + * 查询货筐信息 + * + * @param objId 货筐信息主键 + * @return 货筐信息 + */ + public BaseBasketInfo selectBaseBasketInfoByObjId(Long objId); + + /** + * 查询货筐信息列表 + * + * @param baseBasketInfo 货筐信息 + * @return 货筐信息集合 + */ + public List<BaseBasketInfo> selectBaseBasketInfoList(BaseBasketInfo baseBasketInfo); + + /** + * 新增货筐信息 + * + * @param baseBasketInfo 货筐信息 + * @return 结果 + */ + public int insertBaseBasketInfo(BaseBasketInfo baseBasketInfo); + + /** + * 修改货筐信息 + * + * @param baseBasketInfo 货筐信息 + * @return 结果 + */ + public int updateBaseBasketInfo(BaseBasketInfo baseBasketInfo); + + /** + * 批量删除货筐信息 + * + * @param objIds 需要删除的货筐信息主键集合 + * @return 结果 + */ + public int deleteBaseBasketInfoByObjIds(String objIds); + + /** + * 删除货筐信息信息 + * + * @param objId 货筐信息主键 + * @return 结果 + */ + public int deleteBaseBasketInfoByObjId(Long objId); +} diff --git a/bgs-system/src/main/java/com/bgs/system/service/impl/BaseBasketInfoServiceImpl.java b/bgs-system/src/main/java/com/bgs/system/service/impl/BaseBasketInfoServiceImpl.java new file mode 100644 index 0000000..2ae4a0d --- /dev/null +++ b/bgs-system/src/main/java/com/bgs/system/service/impl/BaseBasketInfoServiceImpl.java @@ -0,0 +1,94 @@ +package com.bgs.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.bgs.system.mapper.BaseBasketInfoMapper; +import com.bgs.system.domain.BaseBasketInfo; +import com.bgs.system.service.IBaseBasketInfoService; +import com.bgs.common.core.text.Convert; + +/** + * 货筐信息Service业务层处理 + * + * @author wenjy + * @date 2024-07-19 + */ +@Service +public class BaseBasketInfoServiceImpl implements IBaseBasketInfoService +{ + @Autowired + private BaseBasketInfoMapper baseBasketInfoMapper; + + /** + * 查询货筐信息 + * + * @param objId 货筐信息主键 + * @return 货筐信息 + */ + @Override + public BaseBasketInfo selectBaseBasketInfoByObjId(Long objId) + { + return baseBasketInfoMapper.selectBaseBasketInfoByObjId(objId); + } + + /** + * 查询货筐信息列表 + * + * @param baseBasketInfo 货筐信息 + * @return 货筐信息 + */ + @Override + public List<BaseBasketInfo> selectBaseBasketInfoList(BaseBasketInfo baseBasketInfo) + { + return baseBasketInfoMapper.selectBaseBasketInfoList(baseBasketInfo); + } + + /** + * 新增货筐信息 + * + * @param baseBasketInfo 货筐信息 + * @return 结果 + */ + @Override + public int insertBaseBasketInfo(BaseBasketInfo baseBasketInfo) + { + return baseBasketInfoMapper.insertBaseBasketInfo(baseBasketInfo); + } + + /** + * 修改货筐信息 + * + * @param baseBasketInfo 货筐信息 + * @return 结果 + */ + @Override + public int updateBaseBasketInfo(BaseBasketInfo baseBasketInfo) + { + return baseBasketInfoMapper.updateBaseBasketInfo(baseBasketInfo); + } + + /** + * 批量删除货筐信息 + * + * @param objIds 需要删除的货筐信息主键 + * @return 结果 + */ + @Override + public int deleteBaseBasketInfoByObjIds(String objIds) + { + return baseBasketInfoMapper.deleteBaseBasketInfoByObjIds(Convert.toStrArray(objIds)); + } + + /** + * 删除货筐信息信息 + * + * @param objId 货筐信息主键 + * @return 结果 + */ + @Override + public int deleteBaseBasketInfoByObjId(Long objId) + { + return baseBasketInfoMapper.deleteBaseBasketInfoByObjId(objId); + } +} diff --git a/bgs-system/src/main/resources/mapper/system/BaseBasketInfoMapper.xml b/bgs-system/src/main/resources/mapper/system/BaseBasketInfoMapper.xml new file mode 100644 index 0000000..5deef5a --- /dev/null +++ b/bgs-system/src/main/resources/mapper/system/BaseBasketInfoMapper.xml @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper +PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.bgs.system.mapper.BaseBasketInfoMapper"> + + <resultMap type="BaseBasketInfo" id="BaseBasketInfoResult"> + <result property="objId" column="obj_id" /> + <result property="basketCode" column="basket_code" /> + <result property="basketEpc" column="basket_epc" /> + <result property="basketType" column="basket_type" /> + <result property="basketStatus" column="basket_status" /> + <result property="isFlag" column="is_flag" /> + <result property="createdBy" column="created_by" /> + <result property="createdTime" column="created_time" /> + <result property="updatedBy" column="updated_by" /> + <result property="updatedTime" column="updated_time" /> + </resultMap> + + <sql id="selectBaseBasketInfoVo"> + select obj_id, basket_code, basket_epc, basket_type, basket_status, is_flag, created_by, created_time, updated_by, updated_time from base_basket_info + </sql> + + <select id="selectBaseBasketInfoList" parameterType="BaseBasketInfo" resultMap="BaseBasketInfoResult"> + <include refid="selectBaseBasketInfoVo"/> + <where> + <if test="basketCode != null and basketCode != ''"> and basket_code = #{basketCode}</if> + <if test="basketEpc != null and basketEpc != ''"> and basket_epc = #{basketEpc}</if> + <if test="basketType != null "> and basket_type = #{basketType}</if> + <if test="basketStatus != null "> and basket_status = #{basketStatus}</if> + </where> + </select> + + <select id="selectBaseBasketInfoByObjId" parameterType="Long" resultMap="BaseBasketInfoResult"> + <include refid="selectBaseBasketInfoVo"/> + where obj_id = #{objId} + </select> + + <insert id="insertBaseBasketInfo" parameterType="BaseBasketInfo" useGeneratedKeys="true" keyProperty="objId"> + insert into base_basket_info + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="basketCode != null">basket_code,</if> + <if test="basketEpc != null">basket_epc,</if> + <if test="basketType != null">basket_type,</if> + <if test="basketStatus != null">basket_status,</if> + <if test="isFlag != null">is_flag,</if> + <if test="createdBy != null">created_by,</if> + <if test="createdTime != null">created_time,</if> + <if test="updatedBy != null">updated_by,</if> + <if test="updatedTime != null">updated_time,</if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="basketCode != null">#{basketCode},</if> + <if test="basketEpc != null">#{basketEpc},</if> + <if test="basketType != null">#{basketType},</if> + <if test="basketStatus != null">#{basketStatus},</if> + <if test="isFlag != null">#{isFlag},</if> + <if test="createdBy != null">#{createdBy},</if> + <if test="createdTime != null">#{createdTime},</if> + <if test="updatedBy != null">#{updatedBy},</if> + <if test="updatedTime != null">#{updatedTime},</if> + </trim> + </insert> + + <update id="updateBaseBasketInfo" parameterType="BaseBasketInfo"> + update base_basket_info + <trim prefix="SET" suffixOverrides=","> + <if test="basketCode != null">basket_code = #{basketCode},</if> + <if test="basketEpc != null">basket_epc = #{basketEpc},</if> + <if test="basketType != null">basket_type = #{basketType},</if> + <if test="basketStatus != null">basket_status = #{basketStatus},</if> + <if test="isFlag != null">is_flag = #{isFlag},</if> + <if test="createdBy != null">created_by = #{createdBy},</if> + <if test="createdTime != null">created_time = #{createdTime},</if> + <if test="updatedBy != null">updated_by = #{updatedBy},</if> + <if test="updatedTime != null">updated_time = #{updatedTime},</if> + </trim> + where obj_id = #{objId} + </update> + + <delete id="deleteBaseBasketInfoByObjId" parameterType="Long"> + delete from base_basket_info where obj_id = #{objId} + </delete> + + <delete id="deleteBaseBasketInfoByObjIds" parameterType="String"> + delete from base_basket_info where obj_id in + <foreach item="objId" collection="array" open="(" separator="," close=")"> + #{objId} + </foreach> + </delete> + +</mapper> \ No newline at end of file diff --git a/bgs-system/src/main/resources/mapper/system/BaseLocationInfoMapper.xml b/bgs-system/src/main/resources/mapper/system/BaseLocationInfoMapper.xml index 5c862dc..b737aa8 100644 --- a/bgs-system/src/main/resources/mapper/system/BaseLocationInfoMapper.xml +++ b/bgs-system/src/main/resources/mapper/system/BaseLocationInfoMapper.xml @@ -26,18 +26,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" <sql id="selectBaseLocationInfoVo"> select obj_id, location_code, location_name, localtion_type, location_describe, store_code, max_amount, used_amount, max_volume, used_volume, location_status, is_flag, remark, created_by, created_time, updated_by, updated_time from base_location_info + </sql> <select id="selectBaseLocationInfoList" parameterType="BaseLocationInfo" resultMap="BaseLocationInfoResult"> - <include refid="selectBaseLocationInfoVo"/> + select t1.obj_id, + t1.location_code, + t1.location_name, + t1.localtion_type, + t1.location_describe, + t1.store_code, + t1.max_amount, + t1.used_amount, + t1.max_volume, + t1.used_volume, + t1.location_status, + t1.is_flag, + t2.basket_code as remark, + t1.created_by, + t1.created_time, + t1.updated_by, + t1.updated_time + from base_location_info t1 + left join base_basket_info t2 on t1.remark = t2.basket_epc <where> - <if test="locationCode != null and locationCode != ''"> and location_code = #{locationCode}</if> - <if test="locationName != null and locationName != ''"> and location_name like concat('%', #{locationName}, '%')</if> - <if test="localtionType != null "> and localtion_type = #{localtionType}</if> - <if test="storeCode != null and storeCode != ''"> and store_code = #{storeCode}</if> - <if test="locationStatus != null "> and location_status = #{locationStatus}</if> - <if test="isFlag != null "> and is_flag = #{isFlag}</if> - <if test="params.beginUpdatedTime != null and params.beginUpdatedTime != '' and params.endUpdatedTime != null and params.endUpdatedTime != ''"> and updated_time between #{params.beginUpdatedTime} and #{params.endUpdatedTime}</if> + <if test="locationCode != null and locationCode != ''"> and t1.location_code = #{locationCode}</if> + <if test="locationName != null and locationName != ''"> and t1.location_name like concat('%', #{locationName}, '%')</if> + <if test="localtionType != null "> and t1.localtion_type = #{localtionType}</if> + <if test="storeCode != null and storeCode != ''"> and t1.store_code = #{storeCode}</if> + <if test="locationStatus != null "> and t1.location_status = #{locationStatus}</if> + <if test="isFlag != null "> and t1.is_flag = #{isFlag}</if> + <if test="params.beginUpdatedTime != null and params.beginUpdatedTime != '' and params.endUpdatedTime != null and params.endUpdatedTime != ''"> and t1.updated_time between #{params.beginUpdatedTime} and #{params.endUpdatedTime}</if> </where> </select> @@ -120,4 +139,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" </foreach> </delete> -</mapper> \ No newline at end of file +</mapper> diff --git a/bgs-system/src/main/resources/mapper/system/LedgerInstantBindingMapper.xml b/bgs-system/src/main/resources/mapper/system/LedgerInstantBindingMapper.xml index 25c30ef..1f31e13 100644 --- a/bgs-system/src/main/resources/mapper/system/LedgerInstantBindingMapper.xml +++ b/bgs-system/src/main/resources/mapper/system/LedgerInstantBindingMapper.xml @@ -3,13 +3,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.bgs.system.mapper.LedgerInstantBindingMapper"> - + <resultMap type="LedgerInstantBinding" id="LedgerInstantBindingResult"> <result property="objid" column="objid" /> <result property="cargoFrameEpc" column="cargo_frame_epc" /> <result property="waybillNumber" column="waybill_number" /> <result property="crateTime" column="crate_time" /> <result property="locationCode" column="location_code" /> + <result property="basketCode" column="basket_code" /> </resultMap> <sql id="selectLedgerInstantBindingVo"> @@ -17,16 +18,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" </sql> <select id="selectLedgerInstantBindingList" parameterType="LedgerInstantBinding" resultMap="LedgerInstantBindingResult"> - select t1.*,t2.location_code - from ledger_instant_binding t1 - left join base_location_info t2 on t1.cargo_frame_epc = t2.remark - <where> - <if test="cargoFrameEpc != null and cargoFrameEpc != ''"> and t1.cargo_frame_epc = #{cargoFrameEpc}</if> - <if test="waybillNumber != null and waybillNumber != ''"> and t1.waybill_number = #{waybillNumber}</if> - <if test="params.beginCrateTime != null and params.beginCrateTime != '' and params.endCrateTime != null and params.endCrateTime != ''"> and t1.crate_time between #{params.beginCrateTime} and #{params.endCrateTime}</if> + select t2.objid, t2.cargo_frame_epc, t1.basket_code, t3.location_code, t2.waybill_number, t2.crate_time + from base_basket_info t1 + left join ledger_instant_binding t2 on t1.basket_epc = t2.cargo_frame_epc + left join base_location_info t3 on t1.basket_epc = t3.remark + <where> + <if test="cargoFrameEpc != null and cargoFrameEpc != ''"> and t1.basket_code = #{cargoFrameEpc}</if> + <if test="waybillNumber != null and waybillNumber != ''"> and t2.waybill_number = #{waybillNumber}</if> + <if test="params.beginCrateTime != null and params.beginCrateTime != '' and params.endCrateTime != null and params.endCrateTime != ''"> and t2.crate_time between #{params.beginCrateTime} and #{params.endCrateTime}</if> </where> </select> - + <select id="selectLedgerInstantBindingByObjid" parameterType="Long" resultMap="LedgerInstantBindingResult"> <include refid="selectLedgerInstantBindingVo"/> where objid = #{objid} @@ -61,10 +63,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" </delete> <delete id="deleteLedgerInstantBindingByObjids" parameterType="String"> - delete from ledger_instant_binding where objid in + delete from ledger_instant_binding where objid in <foreach item="objid" collection="array" open="(" separator="," close=")"> #{objid} </foreach> </delete> -</mapper> \ No newline at end of file +</mapper>