标准箱绑定新购批次判断
This commit is contained in:
parent
cbf86d3d75
commit
476eaf3a81
|
|
@ -166,7 +166,7 @@ public class BmQrBoxController extends BaseController {
|
|||
* APP -- 扫码绑定机具
|
||||
*/
|
||||
@ApiOperation(value = "APP -- 扫码绑定机具")
|
||||
@PreventRepeatSubmit
|
||||
// @PreventRepeatSubmit
|
||||
//@RequiresPermissions("basic:qrBox:edit")
|
||||
@SysLog(title = "APP-二维码标准箱管理", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->APP扫码绑定机具")
|
||||
@PostMapping("/app_bind_ma")
|
||||
|
|
|
|||
|
|
@ -52,6 +52,13 @@ public interface BmQrBoxMapper {
|
|||
*/
|
||||
List<Long> getBoxMaTypeList(Long boxId);
|
||||
|
||||
/**
|
||||
* 根据标准箱ID查询标准箱已绑定物资的任务ID
|
||||
* @param boxId 标准箱id
|
||||
* @return 标准箱物资的绑定批次 buyTask
|
||||
*/
|
||||
Long getBoxBindMaBuyTaskByBoxId(Long boxId);
|
||||
|
||||
/**
|
||||
* 查询此机具是否已经被标准箱绑定过
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -357,8 +357,17 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
|
|||
return AjaxResult.error("物资状态非在库或待入库状态,无法操作:" + machineVo.getMaStatus());
|
||||
}
|
||||
|
||||
// 物资的新购批次判断,是否和Box标准箱内已存在的是同一批
|
||||
if (null == machineVo.getBuyTask()) {
|
||||
return AjaxResult.error("物资未关联采购批次,请完善后重试!");
|
||||
}
|
||||
Long boxBindMaBuyTaskId = bmQrBoxMapper.getBoxBindMaBuyTaskByBoxId(bmQrBoxInfo.getBoxId());
|
||||
if (null != boxBindMaBuyTaskId && !Objects.equals(boxBindMaBuyTaskId, machineVo.getBuyTask())) {
|
||||
return AjaxResult.error("该物资批次与标准箱已存在批次不匹配,请完善后重试!");
|
||||
}
|
||||
|
||||
// 此物资未在其他标准型入过库,才可以绑定
|
||||
if (bmQrBoxMapper.existsMaId(machineVo.getMaId()) > 0) {
|
||||
if (0 < bmQrBoxMapper.existsMaId(machineVo.getMaId())) {
|
||||
return AjaxResult.error("该物资已绑定其他标准箱,无法再次绑定!");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,4 +42,7 @@ public class MachineVo extends Machine {
|
|||
@ApiModelProperty("状态名称")
|
||||
private String statusName;
|
||||
|
||||
@ApiModelProperty("购置批次")
|
||||
private Long buyTask;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -223,13 +223,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="getMaInfoByQrCode" resultType="com.bonus.material.basic.domain.BmQrBoxInfo">
|
||||
select
|
||||
bqi.id, bqi.qr_code, bqi.type_id as maTypeId, bqi.ma_code , mm.ma_id, mm.ma_status
|
||||
bqi.id, bqi.qr_code, bqi.type_id as maTypeId, bqi.ma_code, mm.ma_id, mm.ma_status
|
||||
from
|
||||
bm_qrcode_info bqi
|
||||
left join
|
||||
ma_machine mm on bqi.type_id = mm.type_id and bqi.ma_code = mm.ma_code
|
||||
where
|
||||
bqi.del_flag is null or bqi.del_flag = '0'
|
||||
bqi.del_flag is null or bqi.del_flag = '0' and bqi.qr_code = #{qrCode}
|
||||
group by
|
||||
bqi.id limit 1
|
||||
</select>
|
||||
|
|
@ -255,4 +255,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
bqb.box_code = #{boxCode} AND
|
||||
mt.type_id = #{maTypeId}
|
||||
</select>
|
||||
|
||||
<select id="getBoxBindMaBuyTaskByBoxId" resultType="java.lang.Long">
|
||||
select
|
||||
mm.buy_task
|
||||
from
|
||||
bm_qrcode_box_bind qbb
|
||||
LEFT JOIN
|
||||
ma_machine mm ON mm.ma_id = qbb.ma_id
|
||||
where
|
||||
qbb.box_id = #{boxId}
|
||||
group by
|
||||
qbb.box_id LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue