二维码标准箱联调
This commit is contained in:
parent
a565d21313
commit
0fde9252fe
|
|
@ -35,7 +35,7 @@ public class BmQrBoxController extends BaseController {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询二维码标准箱管理列表")
|
@ApiOperation(value = "查询二维码标准箱管理列表")
|
||||||
@RequiresPermissions("basic:qrBox:list")
|
//@RequiresPermissions("basic:qrBox:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(BmQrBoxInfo bmQrBoxInfo)
|
public TableDataInfo list(BmQrBoxInfo bmQrBoxInfo)
|
||||||
{
|
{
|
||||||
|
|
@ -44,6 +44,21 @@ public class BmQrBoxController extends BaseController {
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询二维码标准箱绑定详情列表
|
||||||
|
* @param bmQrBoxInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "查询二维码标准箱绑定详情列表")
|
||||||
|
//@RequiresPermissions("basic:qrBox:list")
|
||||||
|
@GetMapping("/getList")
|
||||||
|
public TableDataInfo getList(BmQrBoxInfo bmQrBoxInfo)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<BmQrBoxInfo> list = qrBoxService.getList(bmQrBoxInfo);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增二维码标准箱管理
|
* 新增二维码标准箱管理
|
||||||
* @param bmQrBoxInfo
|
* @param bmQrBoxInfo
|
||||||
|
|
@ -80,7 +95,7 @@ public class BmQrBoxController extends BaseController {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "删除二维码标准箱")
|
@ApiOperation(value = "删除二维码标准箱")
|
||||||
//@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
//@RequiresPermissions("basic:info:remove")
|
//@RequiresPermissions("basic:info:remove")
|
||||||
@SysLog(title = "二维码标准箱管理", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除二维码标准箱")
|
@SysLog(title = "二维码标准箱管理", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除二维码标准箱")
|
||||||
@PostMapping("/deleteById")
|
@PostMapping("/deleteById")
|
||||||
|
|
@ -96,7 +111,7 @@ public class BmQrBoxController extends BaseController {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "下载二维码标准箱")
|
@ApiOperation(value = "下载二维码标准箱")
|
||||||
//@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
//@RequiresPermissions("basic:qrBox:download")
|
//@RequiresPermissions("basic:qrBox:download")
|
||||||
@PostMapping("/download")
|
@PostMapping("/download")
|
||||||
public void download(@RequestBody BmQrBoxInfo bmQrBoxInfo, HttpServletResponse response)
|
public void download(@RequestBody BmQrBoxInfo bmQrBoxInfo, HttpServletResponse response)
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ public class BmStorageLogController extends BaseController
|
||||||
* 查询库存日志列表
|
* 查询库存日志列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询库存日志列表")
|
@ApiOperation(value = "查询库存日志列表")
|
||||||
@RequiresPermissions("basic:log:list")
|
@RequiresPermissions("stock:log:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(BmStorageLog bmStorageLog)
|
public TableDataInfo list(BmStorageLog bmStorageLog)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package com.bonus.material.basic.domain;
|
package com.bonus.material.basic.domain;
|
||||||
|
|
||||||
import com.bonus.common.core.annotation.Excel;
|
|
||||||
import com.bonus.common.core.web.domain.BaseEntity;
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
|
@ -20,35 +20,46 @@ public class BmQrBoxInfo extends BaseEntity
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 二维码ID */
|
@ApiModelProperty(value = "绑定明细id")
|
||||||
private Long qrId;
|
private Long id;
|
||||||
|
|
||||||
|
/** 标准箱ID */
|
||||||
|
private Long boxId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "二维码标准箱名称")
|
@ApiModelProperty(value = "二维码标准箱名称")
|
||||||
private String qrName;
|
private String boxName;
|
||||||
|
|
||||||
/** 二维码 */
|
/** 二维码 */
|
||||||
@ApiModelProperty(value = "二维码")
|
@ApiModelProperty(value = "二维码")
|
||||||
private String qrCode;
|
private String boxCode;
|
||||||
|
|
||||||
@ApiModelProperty(value = "二维码路径")
|
@ApiModelProperty(value = "二维码路径")
|
||||||
private String qrUrl;
|
private String boxUrl;
|
||||||
|
|
||||||
/** 类型ID */
|
|
||||||
@ApiModelProperty(value = "类型ID")
|
|
||||||
private Long typeId;
|
|
||||||
|
|
||||||
/** 二维码类型 */
|
/** 二维码类型 */
|
||||||
@ApiModelProperty(value = "二维码类型")
|
@ApiModelProperty(value = "二维码类型")
|
||||||
private String qrType;
|
private String boxType;
|
||||||
|
|
||||||
/** 任务ID */
|
|
||||||
@Excel(name = "任务ID")
|
|
||||||
@ApiModelProperty(value = "任务ID")
|
|
||||||
private Long taskId;
|
|
||||||
|
|
||||||
/** 数据所属组织 */
|
/** 数据所属组织 */
|
||||||
@ApiModelProperty(value = "标准箱绑定机具数量")
|
@ApiModelProperty(value = "标准箱绑定机具数量")
|
||||||
private Integer typeNum;
|
private Integer devNum;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private String startTime;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private String endTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关键字")
|
||||||
|
private String keyWord;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型名称")
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "规格类型")
|
||||||
|
private String typeModelName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "机具编号")
|
||||||
|
private String maCode;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,4 +38,18 @@ public interface BmQrBoxMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int deleteById(BmQrBoxInfo bmQrBoxInfo);
|
int deleteById(BmQrBoxInfo bmQrBoxInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据二维码标准箱ID查询二维码数量
|
||||||
|
* @param boxId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int countBmQrcodeInfoByBoxId(Long boxId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询二维码标准箱管理绑定详情列表
|
||||||
|
* @param bmQrBoxInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<BmQrBoxInfo> getList(BmQrBoxInfo bmQrBoxInfo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,4 +47,11 @@ public interface BmQrBoxService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AjaxResult deleteById(BmQrBoxInfo bmQrBoxInfo);
|
AjaxResult deleteById(BmQrBoxInfo bmQrBoxInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询二维码标准箱管理列表
|
||||||
|
* @param bmQrBoxInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<BmQrBoxInfo> getList(BmQrBoxInfo bmQrBoxInfo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,8 +51,8 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
|
||||||
public AjaxResult insertBmQrcodeInfo(BmQrBoxInfo bmQrBoxInfo) {
|
public AjaxResult insertBmQrcodeInfo(BmQrBoxInfo bmQrBoxInfo) {
|
||||||
//生成二维码
|
//生成二维码
|
||||||
String code = "BOX-" + DateTimeHelper.getNowTimeFomart();
|
String code = "BOX-" + DateTimeHelper.getNowTimeFomart();
|
||||||
bmQrBoxInfo.setQrCode(code);
|
bmQrBoxInfo.setBoxCode(code);
|
||||||
bmQrBoxInfo.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
|
bmQrBoxInfo.setCreateBy(SecurityUtils.getUsername());
|
||||||
bmQrBoxInfo.setCreateTime(DateUtils.getNowDate());
|
bmQrBoxInfo.setCreateTime(DateUtils.getNowDate());
|
||||||
int result = bmQrBoxMapper.insertBmQrcodeInfo(bmQrBoxInfo);
|
int result = bmQrBoxMapper.insertBmQrcodeInfo(bmQrBoxInfo);
|
||||||
return result > 0 ? AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()) : AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
return result > 0 ? AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()) : AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
||||||
|
|
@ -70,7 +70,7 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
|
||||||
List<BmQrBoxInfo> list = bmQrBoxMapper.find(bmQrBoxInfo);
|
List<BmQrBoxInfo> list = bmQrBoxMapper.find(bmQrBoxInfo);
|
||||||
String code = "无编码";
|
String code = "无编码";
|
||||||
if (list.size() > 0) {
|
if (list.size() > 0) {
|
||||||
code = list.get(0).getQrCode();
|
code = list.get(0).getBoxCode();
|
||||||
}
|
}
|
||||||
// 新购管理-二维码打印-新增
|
// 新购管理-二维码打印-新增
|
||||||
String url = BackstageApplication.getUrl() + "backstage/machine/qrCodePage?qrcode=" + code;
|
String url = BackstageApplication.getUrl() + "backstage/machine/qrCodePage?qrcode=" + code;
|
||||||
|
|
@ -121,7 +121,7 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult updateBmQrcodeInfo(BmQrBoxInfo bmQrBoxInfo) {
|
public AjaxResult updateBmQrcodeInfo(BmQrBoxInfo bmQrBoxInfo) {
|
||||||
bmQrBoxInfo.setUpdateBy(String.valueOf(SecurityUtils.getUserId()));
|
bmQrBoxInfo.setUpdateBy(SecurityUtils.getUsername());
|
||||||
bmQrBoxInfo.setUpdateTime(DateUtils.getNowDate());
|
bmQrBoxInfo.setUpdateTime(DateUtils.getNowDate());
|
||||||
int result = bmQrBoxMapper.updateBmQrcodeInfo(bmQrBoxInfo);
|
int result = bmQrBoxMapper.updateBmQrcodeInfo(bmQrBoxInfo);
|
||||||
return result > 0 ? AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()) : AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
return result > 0 ? AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()) : AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
||||||
|
|
@ -134,7 +134,21 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult deleteById(BmQrBoxInfo bmQrBoxInfo) {
|
public AjaxResult deleteById(BmQrBoxInfo bmQrBoxInfo) {
|
||||||
|
//根据id查看标准箱是否绑定,绑定不能删除
|
||||||
|
if (bmQrBoxMapper.countBmQrcodeInfoByBoxId(bmQrBoxInfo.getBoxId()) > 0) {
|
||||||
|
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "该标准箱还绑定设备,无法删除");
|
||||||
|
}
|
||||||
int result = bmQrBoxMapper.deleteById(bmQrBoxInfo);
|
int result = bmQrBoxMapper.deleteById(bmQrBoxInfo);
|
||||||
return result > 0 ? AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()) : AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
return result > 0 ? AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()) : AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询二维码标准箱管理绑定详情列表
|
||||||
|
* @param bmQrBoxInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<BmQrBoxInfo> getList(BmQrBoxInfo bmQrBoxInfo) {
|
||||||
|
return bmQrBoxMapper.getList(bmQrBoxInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,36 +6,79 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="find" resultType="com.bonus.material.basic.domain.BmQrBoxInfo">
|
<select id="find" resultType="com.bonus.material.basic.domain.BmQrBoxInfo">
|
||||||
select
|
select
|
||||||
qr_id as qrId,
|
bqb.box_id as boxId,
|
||||||
qr_name as qrName,
|
bqb.box_name as boxName,
|
||||||
qr_code as qrCode,
|
bqb.box_code as boxCode,
|
||||||
qr_type as qrType,
|
bqb.box_type as boxType,
|
||||||
create_by as createBy,
|
bqb.create_by as createBy,
|
||||||
create_time as createTime,
|
bqb.create_time as createTime,
|
||||||
update_by as updateBy,
|
bqb.update_by as updateBy,
|
||||||
update_time as updateTime
|
bqb.update_time as updateTime,
|
||||||
from bm_qrcode_box
|
COUNT(qbb.box_id) as devNum
|
||||||
|
from bm_qrcode_box bqb
|
||||||
|
left join qrcode_box_bind qbb on bqb.box_id = qbb.box_id
|
||||||
<where>
|
<where>
|
||||||
<if test="qrId != null">and qr_id = #{qrId}</if>
|
<if test="boxId != null">and bqb.box_id = #{boxId}</if>
|
||||||
<if test="qrName != null and qrName != ''">and qr_name like concat('%',#{qrName},'%')</if>
|
<if test="boxName != null and boxName != ''">and bqb.box_name like concat('%',#{boxName},'%')</if>
|
||||||
<if test="qrCode != null and qrCode != ''">and qr_code like concat('%',#{qrCode},'%')</if>
|
<if test="boxCode != null and boxCode != ''">and bqb.box_code like concat('%',#{boxCode},'%')</if>
|
||||||
<if test="qrType != null">and qr_type = #{qrType}</if>
|
<if test="boxType != null">and bqb.box_type = #{boxType}</if>
|
||||||
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||||
|
<![CDATA[ AND DATE_FORMAT( bqb.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
|
||||||
|
</if>
|
||||||
|
<if test="keyWord != null and keyWord != ''">
|
||||||
|
AND (
|
||||||
|
bqb.box_name like concat('%',#{keyWord},'%')
|
||||||
|
OR bqb.box_code like concat('%',#{keyWord},'%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
GROUP BY bqb.box_id
|
||||||
|
order by bqb.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertBmQrcodeInfo" parameterType="com.bonus.material.basic.domain.BmQrBoxInfo" useGeneratedKeys="true" keyProperty="qrId">
|
<select id="countBmQrcodeInfoByBoxId" resultType="java.lang.Integer">
|
||||||
|
select count(1) from qrcode_box_bind where box_id = #{boxId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getList" resultType="com.bonus.material.basic.domain.BmQrBoxInfo">
|
||||||
|
SELECT
|
||||||
|
qb.id as id,
|
||||||
|
qb.box_id as boxId,
|
||||||
|
mt1.type_name as typeName,
|
||||||
|
mt.type_name as typeModelName,
|
||||||
|
mm.ma_code as maCode,
|
||||||
|
qb.create_by as createBy
|
||||||
|
FROM
|
||||||
|
qrcode_box_bind qb
|
||||||
|
LEFT JOIN ma_machine mm ON qb.ma_id = mm.ma_id
|
||||||
|
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
|
||||||
|
AND mt.del_flag = '0'
|
||||||
|
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||||
|
AND mt1.del_flag = '0'
|
||||||
|
WHERE
|
||||||
|
1 = 1
|
||||||
|
<if test="keyWord != null and keyWord != ''">
|
||||||
|
AND (
|
||||||
|
mt1.type_name like concat('%',#{keyWord},'%')
|
||||||
|
OR mt.type_name like concat('%',#{keyWord},'%')
|
||||||
|
OR mm.ma_code like concat('%',#{keyWord},'%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertBmQrcodeInfo" parameterType="com.bonus.material.basic.domain.BmQrBoxInfo" useGeneratedKeys="true" keyProperty="boxId">
|
||||||
insert into bm_qrcode_box
|
insert into bm_qrcode_box
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="qrCode != null">qr_code,</if>
|
<if test="boxCode != null">box_code,</if>
|
||||||
<if test="qrName != null and qrName != ''">qr_name,</if>
|
<if test="boxName != null and boxName != ''">box_name,</if>
|
||||||
<if test="qrType != null">qr_type,</if>
|
<if test="boxType != null">box_type,</if>
|
||||||
<if test="createBy != null">create_by,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
<if test="createTime != null">create_time,</if>
|
<if test="createTime != null">create_time,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="qrCode != null">#{qrCode},</if>
|
<if test="boxCode != null">#{boxCode},</if>
|
||||||
<if test="qrName != null and qrName != ''">#{qrName},</if>
|
<if test="boxName != null and boxName != ''">#{boxName},</if>
|
||||||
<if test="qrType != null">#{qrType},</if>
|
<if test="boxType != null">#{boxType},</if>
|
||||||
<if test="createBy != null">#{createBy},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
<if test="createTime != null">#{createTime},</if>
|
<if test="createTime != null">#{createTime},</if>
|
||||||
</trim>
|
</trim>
|
||||||
|
|
@ -44,19 +87,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<update id="updateBmQrcodeInfo" parameterType="com.bonus.material.basic.domain.BmQrBoxInfo">
|
<update id="updateBmQrcodeInfo" parameterType="com.bonus.material.basic.domain.BmQrBoxInfo">
|
||||||
update bm_qrcode_box
|
update bm_qrcode_box
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="qrCode != null">qr_code = #{qrCode},</if>
|
<if test="boxCode != null">box_code = #{boxCode},</if>
|
||||||
<if test="qrType != null">qr_type = #{qrType},</if>
|
<if test="boxType != null">box_type = #{boxType},</if>
|
||||||
<if test="qrName != null and qrName != ''">qr_name = #{qrName},</if>
|
<if test="boxName != null and boxName != ''">box_name = #{boxName},</if>
|
||||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
|
||||||
</trim>
|
</trim>
|
||||||
where qr_id = #{qrId}
|
where box_id = #{boxId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteById">
|
<delete id="deleteById">
|
||||||
delete
|
delete
|
||||||
from bm_qrcode_box
|
from bm_qrcode_box
|
||||||
where qr_id = #{qrId}
|
where box_id = #{boxId}
|
||||||
</delete>
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue