feat:标签更换

master
wanghao 3 weeks ago
parent 9f2316cac7
commit 8033e0fef3

@ -12,7 +12,7 @@ import java.util.List;
/**
* base_basket_info
*
* @author wenjy
* @author
* @date 2024-07-19
*/
public class BaseBasketInfo extends BaseEntity {
@ -92,6 +92,35 @@ public class BaseBasketInfo extends BaseEntity {
// @Excel(name = "生产厂家", targetAttr = "manufacturerName", type = Excel.Type.EXPORT)
private BaseManufacturer baseManufacturer;
// gps位置提交换RFID
private String gpsLocation;
private String oldBasketEpc;
private String oldBasketEpc2;
public String getOldBasketEpc() {
return oldBasketEpc;
}
public void setOldBasketEpc(String oldBasketEpc) {
this.oldBasketEpc = oldBasketEpc;
}
public String getOldBasketEpc2() {
return oldBasketEpc2;
}
public void setOldBasketEpc2(String oldBasketEpc2) {
this.oldBasketEpc2 = oldBasketEpc2;
}
public String getGpsLocation() {
return gpsLocation;
}
public void setGpsLocation(String gpsLocation) {
this.gpsLocation = gpsLocation;
}
public List<LedgerInstantBinding> getLedgerInstantBindings() {
return ledgerInstantBindings;

@ -36,6 +36,17 @@ public class RecordBaseketChangeRfid extends BaseEntity
// @Excel(name = "gpsW")
private String gpsLocation;
private BaseBasketInfo baseBasketInfo;
public BaseBasketInfo getBaseBasketInfo() {
return baseBasketInfo;
}
public void setBaseBasketInfo(BaseBasketInfo baseBasketInfo) {
this.baseBasketInfo = baseBasketInfo;
}
public String getGpsLocation() {
return gpsLocation;
}

@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.manager.mapper.RecordBaseketChangeRfidMapper">
<resultMap type="RecordBaseketChangeRfid" id="RecordBaseketChangeRfidResult">
<resultMap type="com.ruoyi.manager.domain.RecordBaseketChangeRfid" id="RecordBaseketChangeRfidResult">
<result property="objid" column="objid" />
<result property="basketId" column="basket_id" />
<result property="basketEpc" column="basket_epc" />
@ -13,18 +13,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="gpsLocation" column="gps_location" />
<association property="baseBasketInfo" resultMap="com.ruoyi.manager.mapper.BaseBasketInfoMapper.BaseBasketInfoResult"/>
</resultMap>
<sql id="selectRecordBaseketChangeRfidVo">
select objid, basket_id, basket_epc, basket_epc2, change_type, create_by, create_time,gps_location from record_baseket_change_rfid
</sql>
<sql id="selectLeft">
select objid,
basket_id,
rbcr.basket_epc,
rbcr.basket_epc2,
change_type,
create_by,
create_time,
gps_location,
basket_code,
basket_spe,
basket_type,
steel_grade,
self_code
from record_baseket_change_rfid rbcr
left join base_basket_info bbi on rbcr.basket_id = bbi.obj_id
</sql>
<select id="selectRecordBaseketChangeRfidList" parameterType="RecordBaseketChangeRfid" resultMap="RecordBaseketChangeRfidResult">
<include refid="selectRecordBaseketChangeRfidVo"/>
<include refid="selectLeft"/>
<where>
<if test="basketId != null "> and basket_id = #{basketId}</if>
<if test="changeType != null and changeType != ''"> and change_type = #{changeType}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="createBy != null and createBy != ''"> and rbcr.create_by = #{createBy}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
</where>
</select>

@ -1,82 +1,89 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<html lang="zh" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('资产RFID更换记录列表')" />
<th:block th:include="include :: header('资产RFID更换记录列表')"/>
</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>资产ID</label>
<input type="text" name="basketId"/>
</li>
<li>
<label>更换情况:</label>
<select name="changeType" th:with="type=${@dict.getType('change_rfid_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>更换人:</label>
<input type="text" name="createBy"/>
</li>
<li class="select-time">
<label>更换时间:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>资产ID</label>
<input name="basketId" type="text"/>
</li>
<li>
<label>更换情况:</label>
<select name="changeType" th:with="type=${@dict.getType('change_rfid_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>更换人:</label>
<input name="createBy" type="text"/>
</li>
<li class="select-time">
<label>更换时间:</label>
<input class="time-input" id="startTime" name="params[beginCreateTime]" placeholder="开始时间"
type="text"/>
<span>-</span>
<input class="time-input" id="endTime" name="params[endCreateTime]" placeholder="结束时间"
type="text"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</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="manager:change_rfid:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="manager:change_rfid:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="manager:change_rfid:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="manager:change_rfid: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 class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="manager:change_rfid:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()"
shiro:hasPermission="manager:change_rfid:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
shiro:hasPermission="manager:change_rfid:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="manager:change_rfid: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>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('manager:change_rfid:edit')}]];
var removeFlag = [[${@permission.hasPermi('manager:change_rfid:remove')}]];
var changeTypeDatas = [[${@dict.getType('change_rfid_type')}]];
var prefix = ctx + "manager/change_rfid";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "资产RFID更换记录",
columns: [{
checkbox: true
},
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('manager:change_rfid:edit')}]];
var removeFlag = [[${@permission.hasPermi('manager:change_rfid:remove')}]];
var changeTypeDatas = [[${@dict.getType('change_rfid_type')}]];
var prefix = ctx + "manager/change_rfid";
var basketTypeDatas = [[${@dict.getType('basket_type')}]];
$(function () {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "资产RFID更换记录",
columns: [{
checkbox: true
},
{
field: 'objid',
title: '自增主键',
@ -84,8 +91,31 @@
},
{
field: 'basketId',
title: '资产ID'
title: '资产ID', visible: false
},
{
field: 'baseBasketInfo.basketCode',
title: '资产编号'
},
{
field: 'baseBasketInfo.basketType',
title: '资产类型',
formatter: function (value, row, index) {
return $.table.selectDictLabel(basketTypeDatas, value);
}
},
{
field: 'baseBasketInfo.steelGrade',
title: '钢号'
},
{
field: 'baseBasketInfo.selfCode',
title: '自编号'
},
{
field: 'basketEpc',
title: '货筐RFID(旧)'
@ -97,8 +127,8 @@
{
field: 'changeType',
title: '更换情况',
formatter: function(value, row, index) {
return $.table.selectDictLabel(changeTypeDatas, value);
formatter: function (value, row, index) {
return $.table.selectDictLabel(changeTypeDatas, value);
}
},
{
@ -112,16 +142,16 @@
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
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>
};
$.table.init(options);
});
</script>
</body>
</html>

@ -63,6 +63,8 @@ public class ApiController extends BaseController {
private IBaseAirCodeService baseAirCodeService;
@Autowired
private IRecordDeliveryTaskWaybillService recordDeliveryTaskWaybillService;//进港接货
@Autowired
private IRecordBaseketChangeRfidService recordBaseketChangeRfidService;//更换RFID记录
@PostMapping("/findBindingList")
public AjaxResult findBindingList(String epc) {
@ -273,7 +275,7 @@ public class ApiController extends BaseController {
setLocationInfo(gps);
}});
// 插入任务子表
recordDeliveryTaskWaybillService.updateRecord(taskCode,waybillNumber,cargoFrameEpc,basketId);
recordDeliveryTaskWaybillService.updateRecord(taskCode, waybillNumber, cargoFrameEpc, basketId);
});
recordDeliveryTaskService.closeTaskByReceipt(taskCode, user, gps);//关闭任务
@ -549,6 +551,48 @@ public class ApiController extends BaseController {
return AjaxResult.success(list);
}
// 更换RFID提交记录添加
@PostMapping("/changeBasketEpc")
public AjaxResult changeBasketEpc(@RequestBody BaseBasketInfo baseBasketInfo) {
// int tagCount = baseBasketInfoService.selectCountBasketByEpc(baseBasketInfo.getBasketEpc());
// if (tagCount > 0) {
// return AjaxResult.error("RFID标签1已绑定");
// }
// tagCount = baseBasketInfoService.selectCountBasketByEpc(baseBasketInfo.getBasketEpc2());
// if (tagCount > 0) {
// return AjaxResult.error("RFID标签2已绑定");
// }
int i = baseBasketInfoService.updateBaseBasketInfo(baseBasketInfo);
if (baseBasketInfo.getBasketEpc() != null) {
recordBaseketChangeRfidService.insertRecordBaseketChangeRfid(new RecordBaseketChangeRfid() {{
setBasketId(baseBasketInfo.getObjId());
setBasketEpc(baseBasketInfo.getOldBasketEpc());
setBasketEpc2(baseBasketInfo.getBasketEpc());
setChangeType("1");
setGpsLocation(baseBasketInfo.getGpsLocation());
setCreateBy(baseBasketInfo.getUpdatedBy());
}});
}
if (baseBasketInfo.getBasketEpc2() != null) {
recordBaseketChangeRfidService.insertRecordBaseketChangeRfid(new RecordBaseketChangeRfid() {{
setBasketId(baseBasketInfo.getObjId());
setBasketEpc(baseBasketInfo.getOldBasketEpc2());
setBasketEpc2(baseBasketInfo.getBasketEpc2());
setChangeType("2");
setGpsLocation(baseBasketInfo.getGpsLocation());
setCreateBy(baseBasketInfo.getUpdatedBy());
}});
}
if (i > 0) return AjaxResult.success();
return AjaxResult.error();
}
@GetMapping("/getVersion")
public String getVersion() {

Loading…
Cancel
Save