feat:绑定及提交字段验证

master
wanghao 2 months ago
parent 58dd4ecc7f
commit e6c646d0f8

@ -64,9 +64,9 @@ spring:
servlet:
multipart:
# 单个文件大小
max-file-size: 10MB
max-file-size: 30MB
# 设置总上传的文件大小
max-request-size: 20MB
max-request-size: 60MB
# 服务模块
devtools:
restart:

@ -4,7 +4,7 @@ gen:
# 作者
author: ruoyi
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
packageName: com.ruoyi.system
packageName: com.ruoyi.manager
# 自动去除表前缀默认是false
autoRemovePre: false
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)

@ -0,0 +1,128 @@
package com.ruoyi.manager.controller;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.manager.domain.RecordtRfidBinding;
import com.ruoyi.manager.service.IRecordtRfidBindingService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* RFIDController
*
* @author ruoyi
* @date 2026-01-27
*/
@Controller
@RequestMapping("/manager/recordtRfidBinding")
public class RecordtRfidBindingController extends BaseController
{
private String prefix = "manager/recordtRfidBinding";
@Autowired
private IRecordtRfidBindingService recordtRfidBindingService;
@RequiresPermissions("manager:recordtRfidBinding:view")
@GetMapping()
public String recordtRfidBinding()
{
return prefix + "/recordtRfidBinding";
}
/**
* RFID
*/
@RequiresPermissions("manager:recordtRfidBinding:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(RecordtRfidBinding recordtRfidBinding)
{
startPage();
List<RecordtRfidBinding> list = recordtRfidBindingService.selectRecordtRfidBindingList(recordtRfidBinding);
return getDataTable(list);
}
/**
* RFID
*/
@RequiresPermissions("manager:recordtRfidBinding:export")
@Log(title = "货筐RFID绑定记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(RecordtRfidBinding recordtRfidBinding)
{
List<RecordtRfidBinding> list = recordtRfidBindingService.selectRecordtRfidBindingList(recordtRfidBinding);
ExcelUtil<RecordtRfidBinding> util = new ExcelUtil<RecordtRfidBinding>(RecordtRfidBinding.class);
return util.exportExcel(list, "货筐RFID绑定记录数据");
}
/**
* RFID
*/
@RequiresPermissions("manager:recordtRfidBinding:add")
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* RFID
*/
@RequiresPermissions("manager:recordtRfidBinding:add")
@Log(title = "货筐RFID绑定记录", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(RecordtRfidBinding recordtRfidBinding)
{
return toAjax(recordtRfidBindingService.insertRecordtRfidBinding(recordtRfidBinding));
}
/**
* RFID
*/
@RequiresPermissions("manager:recordtRfidBinding:edit")
@GetMapping("/edit/{rfidBindingId}")
public String edit(@PathVariable("rfidBindingId") Long rfidBindingId, ModelMap mmap)
{
RecordtRfidBinding recordtRfidBinding = recordtRfidBindingService.selectRecordtRfidBindingByRfidBindingId(rfidBindingId);
mmap.put("recordtRfidBinding", recordtRfidBinding);
return prefix + "/edit";
}
/**
* RFID
*/
@RequiresPermissions("manager:recordtRfidBinding:edit")
@Log(title = "货筐RFID绑定记录", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(RecordtRfidBinding recordtRfidBinding)
{
return toAjax(recordtRfidBindingService.updateRecordtRfidBinding(recordtRfidBinding));
}
/**
* RFID
*/
@RequiresPermissions("manager:recordtRfidBinding:remove")
@Log(title = "货筐RFID绑定记录", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(recordtRfidBindingService.deleteRecordtRfidBindingByRfidBindingIds(ids));
}
}

@ -0,0 +1,135 @@
package com.ruoyi.manager.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.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* RFID base_basket_rfid_binding_record
*
* @author ruoyi
* @date 2026-01-27
*/
public class RecordtRfidBinding extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 标识ID */
private Long rfidBindingId;
/** 资产ID */
@Excel(name = "资产ID")
private Long baseBasketId;
/** 货筐RFID */
@Excel(name = "货筐RFID")
private String basketEpc;
/** 货筐RFID(副) */
@Excel(name = "货筐RFID(副)")
private String basketEpc2;
/** 绑定人 */
@Excel(name = "绑定人")
private String createdBy;
private String filePath;
/** 绑定时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Excel(name = "绑定时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;
private BaseBasketInfo baseBasketInfo;
public BaseBasketInfo getBaseBasketInfo() {
return baseBasketInfo;
}
public void setBaseBasketInfo(BaseBasketInfo baseBasketInfo) {
this.baseBasketInfo = baseBasketInfo;
}
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
public void setRfidBindingId(Long rfidBindingId)
{
this.rfidBindingId = rfidBindingId;
}
public Long getRfidBindingId()
{
return rfidBindingId;
}
public void setBaseBasketId(Long baseBasketId)
{
this.baseBasketId = baseBasketId;
}
public Long getBaseBasketId()
{
return baseBasketId;
}
public void setBasketEpc(String basketEpc)
{
this.basketEpc = basketEpc;
}
public String getBasketEpc()
{
return basketEpc;
}
public void setBasketEpc2(String basketEpc2)
{
this.basketEpc2 = basketEpc2;
}
public String getBasketEpc2()
{
return basketEpc2;
}
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;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("rfidBindingId", getRfidBindingId())
.append("baseBasketId", getBaseBasketId())
.append("basketEpc", getBasketEpc())
.append("basketEpc2", getBasketEpc2())
.append("createdBy", getCreatedBy())
.append("createdTime", getCreatedTime())
.toString();
}
}

@ -65,4 +65,10 @@ public interface BaseBasketInfoMapper
BaseBasketInfo selectBaseBasketInfoByCode(String basketCode);
BaseBasketInfo selectBaseBasketInfoBySearchCode(String searchCode);
List<BaseBasketInfo> selectBaseBasketInfoBySearchCode2(String searchCode);
int selectCountBasketByEpc(String basketEpc);
List<BaseBasketInfo> checkBasketInfoBySteelGradeAndSelfCode(BaseBasketInfo baseBasketInfo);
}

@ -0,0 +1,61 @@
package com.ruoyi.manager.mapper;
import java.util.List;
import com.ruoyi.manager.domain.RecordtRfidBinding;
/**
* RFIDMapper
*
* @author ruoyi
* @date 2026-01-27
*/
public interface RecordtRfidBindingMapper
{
/**
* RFID
*
* @param rfidBindingId RFID
* @return RFID
*/
public RecordtRfidBinding selectRecordtRfidBindingByRfidBindingId(Long rfidBindingId);
/**
* RFID
*
* @param recordtRfidBinding RFID
* @return RFID
*/
public List<RecordtRfidBinding> selectRecordtRfidBindingList(RecordtRfidBinding recordtRfidBinding);
/**
* RFID
*
* @param recordtRfidBinding RFID
* @return
*/
public int insertRecordtRfidBinding(RecordtRfidBinding recordtRfidBinding);
/**
* RFID
*
* @param recordtRfidBinding RFID
* @return
*/
public int updateRecordtRfidBinding(RecordtRfidBinding recordtRfidBinding);
/**
* RFID
*
* @param rfidBindingId RFID
* @return
*/
public int deleteRecordtRfidBindingByRfidBindingId(Long rfidBindingId);
/**
* RFID
*
* @param rfidBindingIds
* @return
*/
public int deleteRecordtRfidBindingByRfidBindingIds(String[] rfidBindingIds);
}

@ -65,4 +65,10 @@ public interface IBaseBasketInfoService
String importBasketInfo(List<BaseBasketInfo> basketInfoList, boolean updateSupport, String operName);
BaseBasketInfo selectBaseBasketInfoBySearchCode(String searchCode);
List<BaseBasketInfo> selectBaseBasketInfoBySearchCode2(String searchCode);
int selectCountBasketByEpc(String basketEpc);
List<BaseBasketInfo> checkBasketInfoBySteelGradeAndSelfCode(BaseBasketInfo baseBasketInfo);
}

@ -0,0 +1,61 @@
package com.ruoyi.manager.service;
import java.util.List;
import com.ruoyi.manager.domain.RecordtRfidBinding;
/**
* RFIDService
*
* @author ruoyi
* @date 2026-01-27
*/
public interface IRecordtRfidBindingService
{
/**
* RFID
*
* @param rfidBindingId RFID
* @return RFID
*/
public RecordtRfidBinding selectRecordtRfidBindingByRfidBindingId(Long rfidBindingId);
/**
* RFID
*
* @param recordtRfidBinding RFID
* @return RFID
*/
public List<RecordtRfidBinding> selectRecordtRfidBindingList(RecordtRfidBinding recordtRfidBinding);
/**
* RFID
*
* @param recordtRfidBinding RFID
* @return
*/
public int insertRecordtRfidBinding(RecordtRfidBinding recordtRfidBinding);
/**
* RFID
*
* @param recordtRfidBinding RFID
* @return
*/
public int updateRecordtRfidBinding(RecordtRfidBinding recordtRfidBinding);
/**
* RFID
*
* @param rfidBindingIds RFID
* @return
*/
public int deleteRecordtRfidBindingByRfidBindingIds(String rfidBindingIds);
/**
* RFID
*
* @param rfidBindingId RFID
* @return
*/
public int deleteRecordtRfidBindingByRfidBindingId(Long rfidBindingId);
}

@ -11,7 +11,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* Service
@ -140,4 +139,19 @@ public class BaseBasketInfoServiceImpl implements IBaseBasketInfoService {
public BaseBasketInfo selectBaseBasketInfoBySearchCode(String searchCode) {
return baseBasketInfoMapper.selectBaseBasketInfoBySearchCode(searchCode);
}
}
@Override
public List<BaseBasketInfo> selectBaseBasketInfoBySearchCode2(String searchCode) {
return baseBasketInfoMapper.selectBaseBasketInfoBySearchCode2(searchCode);
}
@Override
public int selectCountBasketByEpc(String basketEpc) {
return baseBasketInfoMapper.selectCountBasketByEpc(basketEpc);
}
@Override
public List<BaseBasketInfo> checkBasketInfoBySteelGradeAndSelfCode(BaseBasketInfo baseBasketInfo) {
return baseBasketInfoMapper.checkBasketInfoBySteelGradeAndSelfCode(baseBasketInfo);
}
}

@ -0,0 +1,90 @@
package com.ruoyi.manager.service.impl;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.manager.domain.RecordtRfidBinding;
import com.ruoyi.manager.mapper.RecordtRfidBindingMapper;
import com.ruoyi.manager.service.IRecordtRfidBindingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* RFIDService
*
* @author ruoyi
* @date 2026-01-27
*/
@Service
public class RecordtRfidBindingServiceImpl implements IRecordtRfidBindingService {
@Autowired
private RecordtRfidBindingMapper recordtRfidBindingMapper;
/**
* RFID
*
* @param rfidBindingId RFID
* @return RFID
*/
@Override
public RecordtRfidBinding selectRecordtRfidBindingByRfidBindingId(Long rfidBindingId) {
return recordtRfidBindingMapper.selectRecordtRfidBindingByRfidBindingId(rfidBindingId);
}
/**
* RFID
*
* @param recordtRfidBinding RFID
* @return RFID
*/
@Override
public List<RecordtRfidBinding> selectRecordtRfidBindingList(RecordtRfidBinding recordtRfidBinding) {
return recordtRfidBindingMapper.selectRecordtRfidBindingList(recordtRfidBinding);
}
/**
* RFID
*
* @param recordtRfidBinding RFID
* @return
*/
@Override
public int insertRecordtRfidBinding(RecordtRfidBinding recordtRfidBinding) {
recordtRfidBinding.setCreatedTime(DateUtils.getNowDate());
return recordtRfidBindingMapper.insertRecordtRfidBinding(recordtRfidBinding);
}
/**
* RFID
*
* @param recordtRfidBinding RFID
* @return
*/
@Override
public int updateRecordtRfidBinding(RecordtRfidBinding recordtRfidBinding) {
return recordtRfidBindingMapper.updateRecordtRfidBinding(recordtRfidBinding);
}
/**
* RFID
*
* @param rfidBindingIds RFID
* @return
*/
@Override
public int deleteRecordtRfidBindingByRfidBindingIds(String rfidBindingIds) {
return recordtRfidBindingMapper.deleteRecordtRfidBindingByRfidBindingIds(Convert.toStrArray(rfidBindingIds));
}
/**
* RFID
*
* @param rfidBindingId RFID
* @return
*/
@Override
public int deleteRecordtRfidBindingByRfidBindingId(Long rfidBindingId) {
return recordtRfidBindingMapper.deleteRecordtRfidBindingByRfidBindingId(rfidBindingId);
}
}

@ -1,34 +1,34 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.manager.mapper.BaseBasketInfoMapper">
<resultMap type="com.ruoyi.manager.domain.BaseBasketInfo" id="BaseBasketInfoResult">
<result property="objId" column="obj_id" />
<result property="basketCode" column="basket_code" />
<result property="basketSpe" column="basket_spe" />
<result property="createdTime" column="created_time" />
<result property="basketEpc" column="basket_epc" />
<result property="basketEpc2" column="basket_epc2" />
<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="steelGrade" column="steel_grade" />
<result property="selfCode" column="self_code" />
<result property="manufacturerName" column="manufacturer_name" />
<result property="locationName" column="location_name" />
<result property="updatedBy" column="updated_by" />
<result property="updatedTime" column="updated_time" />
<result property="manufacturerId" column="manufacturer_id" />
<result property="localWeight" column="local_weight" />
<result property="department" column="department" />
<!-- <association property="baseManufacturer" javaType="BaseManufacturer">-->
<!-- <result property="manufacturerCode" column="manufacturer_code" />-->
<!-- <result property="manufacturerName" column="manufacturer_name" />-->
<!-- </association>-->
<resultMap type="com.ruoyi.manager.domain.BaseBasketInfo" id="BaseBasketInfoResult">
<result property="objId" column="obj_id"/>
<result property="basketCode" column="basket_code"/>
<result property="basketSpe" column="basket_spe"/>
<result property="createdTime" column="created_time"/>
<result property="basketEpc" column="basket_epc"/>
<result property="basketEpc2" column="basket_epc2"/>
<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="steelGrade" column="steel_grade"/>
<result property="selfCode" column="self_code"/>
<result property="manufacturerName" column="manufacturer_name"/>
<result property="locationName" column="location_name"/>
<result property="updatedBy" column="updated_by"/>
<result property="updatedTime" column="updated_time"/>
<result property="manufacturerId" column="manufacturer_id"/>
<result property="localWeight" column="local_weight"/>
<result property="department" column="department"/>
<!-- <association property="baseManufacturer" javaType="BaseManufacturer">-->
<!-- <result property="manufacturerCode" column="manufacturer_code" />-->
<!-- <result property="manufacturerName" column="manufacturer_name" />-->
<!-- </association>-->
</resultMap>
<sql id="selectBaseBasketInfoVo">
@ -54,24 +54,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from base_basket_info
</sql>
<select id="selectBaseBasketInfoList" parameterType="com.ruoyi.manager.domain.BaseBasketInfo" resultMap="BaseBasketInfoResult">
<select id="selectBaseBasketInfoList" parameterType="com.ruoyi.manager.domain.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>
<if test="steelGrade != null and steelGrade != ''"> and steel_grade like concat('%', #{steelGrade}, '%')</if>
<if test="selfCode != null and selfCode != ''"> and self_code like concat('%', #{selfCode}, '%')</if>
<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>
<if test="steelGrade != null and steelGrade != ''">and steel_grade like concat('%', #{steelGrade}, '%')
</if>
<if test="selfCode != null and selfCode != ''">and self_code like concat('%', #{selfCode}, '%')</if>
</where>
</select>
<select id="selectBaseBasketInfoByObjId" parameterType="Long" resultMap="BaseBasketInfoResult">
<include refid="selectBaseBasketInfoVo"/>
where obj_id = #{objId}
</select>
<insert id="insertBaseBasketInfo" parameterType="com.ruoyi.manager.domain.BaseBasketInfo" useGeneratedKeys="true" keyProperty="objId">
<insert id="insertBaseBasketInfo" parameterType="com.ruoyi.manager.domain.BaseBasketInfo" useGeneratedKeys="true"
keyProperty="objId">
insert into base_basket_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="basketCode != null">basket_code,</if>
@ -141,11 +144,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteBaseBasketInfoByObjId" parameterType="Long">
delete from base_basket_info where obj_id = #{objId}
delete
from base_basket_info
where obj_id = #{objId}
</delete>
<delete id="deleteBaseBasketInfoByObjIds" parameterType="String">
delete from base_basket_info where obj_id in
delete from base_basket_info where obj_id in
<foreach item="objId" collection="array" open="(" separator="," close=")">
#{objId}
</foreach>
@ -156,7 +161,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where basket_epc = #{epc} or basket_epc2 = #{epc} limit 1
</select>
<select id="selectBaseBasketInfoByCode" parameterType="String" resultMap="BaseBasketInfoResult">
<select id="selectBaseBasketInfoByCode" parameterType="String" resultMap="BaseBasketInfoResult">
<include refid="selectBaseBasketInfoVo"/>
where basket_code = #{epc} limit 1
</select>
@ -165,5 +170,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectBaseBasketInfoVo"/>
where basket_code = #{searchCode} or steel_grade = #{searchCode} limit 1
</select>
<select id="selectBaseBasketInfoBySearchCode2" parameterType="String" resultMap="BaseBasketInfoResult">
<include refid="selectBaseBasketInfoVo"/>
where basket_code = #{searchCode}
or steel_grade like concat('%', #{steelGrade}, '%')
or self_code like concat('%', #{selfCode}, '%')
</select>
<select id="selectCountBasketByEpc" parameterType="String" resultType="int">
select count(*)
from base_basket_info
where basket_epc = #{basketEpc}
or basket_epc2 = #{basketEpc}
</select>
<select id="checkBasketInfoBySteelGradeAndSelfCode" resultMap="BaseBasketInfoResult"
parameterType="com.ruoyi.manager.domain.BaseBasketInfo">
select *
from base_basket_info
<where>
<if test="selfCode != null or steelGrade != null">
and (self_code = #{selfCode} or steel_grade = #{steelGrade})
</if>
<if test="objId != null">
and obj_id != #{objId}
</if>
</where>
</select>
</mapper>

@ -0,0 +1,102 @@
<?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.ruoyi.manager.mapper.RecordtRfidBindingMapper">
<resultMap type="com.ruoyi.manager.domain.RecordtRfidBinding" id="RecordtRfidBindingResult">
<result property="rfidBindingId" column="RFID_binding_id"/>
<result property="baseBasketId" column="base_basket_id"/>
<result property="basketEpc" column="basket_epc"/>
<result property="basketEpc2" column="basket_epc2"/>
<result property="createdBy" column="created_by"/>
<result property="createdTime" column="created_time"/>
<result property="filePath" column="file_path"/>
<association property="baseBasketInfo"
resultMap="com.ruoyi.manager.mapper.BaseBasketInfoMapper.BaseBasketInfoResult"/>
</resultMap>
<sql id="selectRecordtRfidBindingListSql">
select RFID_binding_id,
base_basket_id,
base.basket_epc,
base.basket_epc2,
base.created_by,
base.created_time,
file_path,
basket_code,
steel_grade,
self_code,
basket_type
from base_basket_rfid_binding_record base
left join base_basket_info bbi on base.base_basket_id = bbi.obj_id
</sql>
<sql id="selectRecordtRfidBindingVo">
select RFID_binding_id, base_basket_id, basket_epc, basket_epc2, created_by, created_time
from base_basket_rfid_binding_record
</sql>
<select id="selectRecordtRfidBindingList" parameterType="RecordtRfidBinding" resultMap="RecordtRfidBindingResult">
<include refid="selectRecordtRfidBindingListSql"/>
<where>
<if test="createdBy != null and createdBy != ''">and base.created_by = #{createdBy}</if>
<if test="params.beginCreatedTime != null and params.beginCreatedTime != ''
and params.endCreatedTime != null and params.endCreatedTime != ''">
and base.created_time between #{params.beginCreatedTime} and #{params.endCreatedTime}
</if>
</where>
</select>
<select id="selectRecordtRfidBindingByRfidBindingId" parameterType="Long" resultMap="RecordtRfidBindingResult">
<include refid="selectRecordtRfidBindingVo"/>
where RFID_binding_id = #{rfidBindingId}
</select>
<insert id="insertRecordtRfidBinding" parameterType="RecordtRfidBinding" useGeneratedKeys="true"
keyProperty="rfidBindingId">
insert into base_basket_rfid_binding_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="baseBasketId != null">base_basket_id,</if>
<if test="basketEpc != null">basket_epc,</if>
<if test="basketEpc2 != null">basket_epc2,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="filePath != null">file_path,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="baseBasketId != null">#{baseBasketId},</if>
<if test="basketEpc != null">#{basketEpc},</if>
<if test="basketEpc2 != null">#{basketEpc2},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="filePath != null">#{filePath},</if>
</trim>
</insert>
<update id="updateRecordtRfidBinding" parameterType="RecordtRfidBinding">
update base_basket_rfid_binding_record
<trim prefix="SET" suffixOverrides=",">
<if test="baseBasketId != null">base_basket_id = #{baseBasketId},</if>
<if test="basketEpc != null">basket_epc = #{basketEpc},</if>
<if test="basketEpc2 != null">basket_epc2 = #{basketEpc2},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
</trim>
where RFID_binding_id = #{rfidBindingId}
</update>
<delete id="deleteRecordtRfidBindingByRfidBindingId" parameterType="Long">
delete
from base_basket_rfid_binding_record
where RFID_binding_id = #{rfidBindingId}
</delete>
<delete id="deleteRecordtRfidBindingByRfidBindingIds" parameterType="String">
delete from base_basket_rfid_binding_record where RFID_binding_id in
<foreach item="rfidBindingId" collection="array" open="(" separator="," close=")">
#{rfidBindingId}
</foreach>
</delete>
</mapper>

@ -0,0 +1,22 @@
-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('货筐RFID绑定记录', '2044', '1', '/manager/recordtRfidBinding', 'C', '0', 'manager:recordtRfidBinding:view', '#', 'admin', sysdate(), '', null, '货筐RFID绑定记录菜单');
-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('货筐RFID绑定记录查询', @parentId, '1', '#', 'F', '0', 'manager:recordtRfidBinding:list', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('货筐RFID绑定记录新增', @parentId, '2', '#', 'F', '0', 'manager:recordtRfidBinding:add', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('货筐RFID绑定记录修改', @parentId, '3', '#', 'F', '0', 'manager:recordtRfidBinding:edit', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('货筐RFID绑定记录删除', @parentId, '4', '#', 'F', '0', 'manager:recordtRfidBinding:remove', '#', 'admin', sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('货筐RFID绑定记录导出', @parentId, '5', '#', 'F', '0', 'manager:recordtRfidBinding:export', '#', 'admin', sysdate(), '', null, '');

@ -161,11 +161,11 @@
{
field: 'basketEpc',
title: '资产RFID'
title: 'RFID标签1'
},
{
field: 'basketEpc2',
title: '资产RFID(副)'
title: 'RFID标签2'
},
{
field: 'basketType',

@ -0,0 +1,76 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增货筐RFID绑定记录')" />
<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-recordtRfidBinding-add">
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">资产ID</label>
<div class="col-sm-8">
<input name="baseBasketId" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">货筐RFID</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">货筐RFID(副)</label>
<div class="col-sm-8">
<input name="basketEpc2" 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="createdBy" 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">
<div class="input-group date">
<input name="createdTime" 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 + "manager/recordtRfidBinding"
$("#form-recordtRfidBinding-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-recordtRfidBinding-add').serialize());
}
}
$("input[name='createdTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

@ -0,0 +1,77 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改货筐RFID绑定记录')" />
<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-recordtRfidBinding-edit" th:object="${recordtRfidBinding}">
<input name="rfidBindingId" th:field="*{rfidBindingId}" type="hidden">
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">资产ID</label>
<div class="col-sm-8">
<input name="baseBasketId" th:field="*{baseBasketId}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">货筐RFID</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">货筐RFID(副)</label>
<div class="col-sm-8">
<input name="basketEpc2" th:field="*{basketEpc2}" 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="createdBy" th:field="*{createdBy}" 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">
<div class="input-group date">
<input name="createdTime" th:value="${#dates.format(recordtRfidBinding.createdTime, '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 + "manager/recordtRfidBinding";
$("#form-recordtRfidBinding-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-recordtRfidBinding-edit').serialize());
}
}
$("input[name='createdTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
</body>
</html>

@ -0,0 +1,163 @@
<!DOCTYPE html>
<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绑定记录列表')"/>
</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 name="createdBy" type="text"/>
</li>
<li class="select-time">
<label>绑定时间:</label>
<input class="time-input" id="startTime" name="params[beginCreatedTime]"
placeholder="开始时间"
type="text"/>
<span>-</span>
<input class="time-input" id="endTime" name="params[endCreatedTime]" 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:recordtRfidBinding:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()"
shiro:hasPermission="manager:recordtRfidBinding:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
shiro:hasPermission="manager:recordtRfidBinding:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()"
shiro:hasPermission="manager:recordtRfidBinding: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('manager:recordtRfidBinding:edit')}]];
var removeFlag = [[${@permission.hasPermi('manager:recordtRfidBinding:remove')}]];
var basketTypeDatas = [[${@dict.getType('basket_type')}]];
var prefix = ctx + "manager/recordtRfidBinding";
$(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: 'rfidBindingId',
title: '标识ID',
visible: false
},
{
field: 'baseBasketId',
title: '资产ID',
visible: false
},
{
field: 'baseBasketInfo.basketCode',
title: '资产编号'
},
{
field: 'baseBasketInfo.steelGrade',
title: '钢号'
},
{
field: 'baseBasketInfo.selfCode',
title: '自编号'
},
{
field: 'baseBasketInfo.basketType',
title: '资产类型',
formatter: function (value, row, index) {
return $.table.selectDictLabel(basketTypeDatas, value);
}
},
{
field: 'basketEpc',
title: '货筐RFID'
},
{
field: 'basketEpc2',
title: '货筐RFID(副)'
},
{
field: 'filePath',
title: '绑定照片',
formatter: function (value, row, index) {
// return '<img src="' + ctx + value + '" alt="绑定照片" style="max-width: 100px; max-height: 100px;">';
return imageView(value, 540);
}
},
{
field: 'createdBy',
title: '绑定人'
},
{
field: 'createdTime',
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.rfidBindingId + '\')"><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.rfidBindingId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
//加载图片
function imageView(value, h, m) {
if (value != null) {
var url = value.split(',')
var ht = ''
url.forEach(function (value, i) {
// console.log('第'+i+"="+value)
// console.log('第'+i+"="+value == '')
ht += "<img class='img-circle img-xs' data-height='540px' data-width='324px' data-target='self' src='" + value + "'/>"
})
return ht
} else {
return '-'
}
}
</script>
</body>
</html>

@ -1,20 +1,22 @@
package com.ruoyi.webapi.controller;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.manager.domain.*;
import com.ruoyi.manager.domain.BaseManufacturer;
import com.ruoyi.manager.domain.LedgerInstantBinding;
import com.ruoyi.manager.domain.RecordBasketRepair;
import com.ruoyi.manager.service.IBaseBasketInfoService;
import com.ruoyi.manager.service.IBaseManufacturerService;
import com.ruoyi.manager.service.IRecordBasketRepairService;
import com.ruoyi.manager.service.IRecordtRfidBindingService;
import com.ruoyi.webapi.doman.BindingSubmitBeen;
import com.ruoyi.webapi.doman.JoinSubmitBeen;
import com.ruoyi.webapi.service.ApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.Date;
import java.util.List;
@ -32,6 +34,8 @@ public class ApiController {
private IBaseBasketInfoService baseBasketInfoService;
@Autowired
private IRecordBasketRepairService recordBasketRepairService;
@Autowired
private IRecordtRfidBindingService recordtRfidBindingService;
@PostMapping("/bindingSubmit")
public AjaxResult bindingSubmit(@RequestBody BindingSubmitBeen submitBeen) {
@ -131,17 +135,28 @@ public class ApiController {
*/
@PostMapping("/saveBasketInfo")
public AjaxResult saveBasketInfo(@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已绑定");
}
List<BaseBasketInfo> list = baseBasketInfoService.checkBasketInfoBySteelGradeAndSelfCode(baseBasketInfo);
if (list!=null && !list.isEmpty()){
return AjaxResult.error("钢号或自编号已存在");
}
baseBasketInfo.setUpdatedTime(new Date());
int i=0;
int i = 0;
if (baseBasketInfo.getObjId() == null) {
i = baseBasketInfoService.insertBaseBasketInfo(baseBasketInfo);
}else {
} else {
baseBasketInfo.setUpdatedBy(baseBasketInfo.getCreatedBy());
baseBasketInfo.setCreatedBy(null);
i = baseBasketInfoService.updateBaseBasketInfo(baseBasketInfo);
}
if (i > 0) return AjaxResult.success();
return AjaxResult.error();
}
@ -166,16 +181,69 @@ public class ApiController {
if (baseBasketInfo == null) return AjaxResult.error("没有维护该资产");
return AjaxResult.success(baseBasketInfo);
}
/**
*
*/
@GetMapping("/getBasketInfoBySearchCode")
public AjaxResult getBasketInfoBySearchCode(String searchCode) {
BaseBasketInfo baseBasketInfo = baseBasketInfoService.selectBaseBasketInfoBySearchCode(searchCode);
List<BaseBasketInfo> baseBasketInfo = baseBasketInfoService.selectBaseBasketInfoBySearchCode2(searchCode);
if (baseBasketInfo == null) return AjaxResult.error("没有维护该资产");
return AjaxResult.success(baseBasketInfo);
}
/**
*
*/
@PostMapping("/submitBindingRecord")
public AjaxResult submitBindingRecord(Long baseBasketId, String basketEpc, String basketEpc2, String createdBy, List<MultipartFile> files) {
int tagCount=baseBasketInfoService.selectCountBasketByEpc(basketEpc);
if (tagCount>0){
return AjaxResult.error("RFID标签1已绑定");
}
tagCount=baseBasketInfoService.selectCountBasketByEpc(basketEpc2);
if (tagCount>0){
return AjaxResult.error("RFID标签2已绑定");
}
// 验证钢号与自编号重复
String filePath = RuoYiConfig.getUploadPath();
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < files.size(); i++) {
String fileName = null;
try {
fileName = FileUploadUtils.upload(filePath, files.get(i));
} catch (IOException e) {
throw new RuntimeException(e);
}
// System.out.println("上传路径="+fileName);
stringBuilder.append(fileName);
if (i != files.size() - 1) {
stringBuilder.append(",");
}
}
// 新增绑定记录
RecordtRfidBinding recordtRfidBinding = new RecordtRfidBinding();
recordtRfidBinding.setBaseBasketId(baseBasketId);
recordtRfidBinding.setBasketEpc(basketEpc);
recordtRfidBinding.setBasketEpc2(basketEpc2);
recordtRfidBinding.setCreatedBy(createdBy);
recordtRfidBinding.setFilePath(stringBuilder.toString());
int i = recordtRfidBindingService.insertRecordtRfidBinding(recordtRfidBinding);
// 更新资产信息
BaseBasketInfo baseBasketInfo = new BaseBasketInfo();
baseBasketInfo.setBasketEpc(basketEpc);
baseBasketInfo.setBasketEpc2(basketEpc2);
baseBasketInfo.setUpdatedTime(new Date());
baseBasketInfo.setUpdatedBy(createdBy);
baseBasketInfo.setObjId(baseBasketId);
int i1 = baseBasketInfoService.updateBaseBasketInfo(baseBasketInfo);
if (i > 0 ) return AjaxResult.success();
return AjaxResult.error();
}
/* @GetMapping("/getVersion")
public String getVersion(){

Loading…
Cancel
Save