标准箱查询
This commit is contained in:
parent
0fcb6fec5d
commit
e728414713
|
|
@ -110,6 +110,16 @@ public class BmQrBoxController extends BaseController {
|
|||
return qrBoxService.updateBmQrcodeInfoByCode(bmQrBoxInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* APP -- 新购入库扫码 -- BoxCode查询标准箱信息
|
||||
*/
|
||||
@ApiOperation(value = "APP -- 新购入库扫码 -- BoxCode查询标准箱信息")
|
||||
@SysLog(title = "APP-二维码标准箱管理", businessType = OperaType.QUERY, logType = 1,module = "仓储管理->BoxCode查询标准箱信息")
|
||||
@GetMapping("/get_info_bind_by_code")
|
||||
public AjaxResult getBoxInfoBindListByCode(@NotNull(message = "参数不能为空") BmQrBoxInfo bmQrBoxInfo) {
|
||||
return qrBoxService.getBoxInfoBindListByCode(bmQrBoxInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* APP -- 扫码绑定机具
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
package com.bonus.material.basic.domain.vo;
|
||||
|
||||
import com.bonus.material.basic.domain.BmQrBoxInfo;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : 阮世耀
|
||||
* @version : 1.0
|
||||
* @PackagePath: com.bonus.material.basic.domain.vo
|
||||
* @CreateTime: 2024-12-20 11:01
|
||||
* @Description: 二维码标准箱信息及绑定明细VO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class BoxInfoBindVo {
|
||||
|
||||
private BmQrBoxInfo boxInfo;
|
||||
|
||||
private List<BmQrBoxInfo> boxBindList;
|
||||
|
||||
}
|
||||
|
|
@ -15,6 +15,11 @@ public interface BmQrBoxMapper {
|
|||
*/
|
||||
List<BmQrBoxInfo> find(BmQrBoxInfo bmQrBoxInfo);
|
||||
|
||||
/**
|
||||
* 根据box_code 或 box_id查询二维码标准箱信息
|
||||
*/
|
||||
List<BmQrBoxInfo> findBoxInfoByKey(BmQrBoxInfo bmQrBoxInfo);
|
||||
|
||||
/**
|
||||
* 新增二维码标准箱管理
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -23,6 +23,11 @@ public interface BmQrBoxService {
|
|||
*/
|
||||
AjaxResult insertBmQrcodeInfo(BmQrBoxInfo bmQrBoxInfo);
|
||||
|
||||
/**
|
||||
* BoxCode查询标准箱信息
|
||||
*/
|
||||
AjaxResult getBoxInfoBindListByCode(BmQrBoxInfo bmQrBoxInfo);
|
||||
|
||||
/**
|
||||
* 下载二维码标准箱
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.bonus.common.core.utils.DateUtils;
|
|||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.basic.domain.BmQrBoxInfo;
|
||||
import com.bonus.material.basic.domain.vo.BoxInfoBindVo;
|
||||
import com.bonus.material.basic.mapper.BmQrBoxMapper;
|
||||
import com.bonus.material.basic.service.BmQrBoxService;
|
||||
import com.bonus.material.ma.domain.vo.MachineVo;
|
||||
|
|
@ -66,6 +67,37 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
|
|||
return result > 0 ? AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg()) : AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
||||
}
|
||||
|
||||
/**
|
||||
* BoxCode查询标准箱信息
|
||||
*
|
||||
* @param bmQrBoxInfo 查询条件
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getBoxInfoBindListByCode(BmQrBoxInfo bmQrBoxInfo) {
|
||||
if (bmQrBoxInfo.getBoxCode() == null) {
|
||||
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "请输入标准箱编码");
|
||||
}
|
||||
BoxInfoBindVo boxInfoBindVo = new BoxInfoBindVo();
|
||||
|
||||
List<BmQrBoxInfo> boxInfos = bmQrBoxMapper.findBoxInfoByKey(bmQrBoxInfo);
|
||||
boxInfos.removeIf(Objects::isNull);
|
||||
if (boxInfos.isEmpty()) {
|
||||
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "标准箱编码不存在");
|
||||
} else if (boxInfos.size() == 1) {
|
||||
if (boxInfos.get(0).getBoxId() == null) {
|
||||
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), "标准箱信息异常,请联系运维人员处理");
|
||||
}
|
||||
boxInfoBindVo.setBoxInfo(boxInfos.get(0));
|
||||
} else {
|
||||
return AjaxResult.warn("该二维码已绑定多个标准箱,请联系运维人员处理");
|
||||
}
|
||||
|
||||
List<BmQrBoxInfo> boxBindList = bmQrBoxMapper.getBoxBindList(boxInfoBindVo.getBoxInfo().getBoxId());
|
||||
boxBindList.removeIf(Objects::isNull);
|
||||
boxInfoBindVo.setBoxBindList(boxBindList);
|
||||
return AjaxResult.success(boxInfoBindVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载二维码标准箱
|
||||
* @param response 响应对象
|
||||
|
|
|
|||
|
|
@ -4,6 +4,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.material.basic.mapper.BmQrBoxMapper">
|
||||
|
||||
<select id="findBoxInfoByKey" resultType="com.bonus.material.basic.domain.BmQrBoxInfo">
|
||||
select * from bm_qrcode_box
|
||||
<where>
|
||||
<if test="boxId != null">and bqb.box_id = #{boxId}</if>
|
||||
<if test="boxCode != null and boxCode != ''">and bqb.box_code = #{boxCode}</if>
|
||||
<if test="boxType != null">and bqb.box_type = #{boxType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="find" resultType="com.bonus.material.basic.domain.BmQrBoxInfo">
|
||||
select
|
||||
bqb.box_id as boxId,
|
||||
|
|
|
|||
Loading…
Reference in New Issue