标准箱信息查询

This commit is contained in:
mashuai 2025-06-30 13:44:27 +08:00
parent 8b614fd7dd
commit 93e1838c34
6 changed files with 124 additions and 3 deletions

View File

@ -260,4 +260,26 @@ public class BmQrBoxController extends BaseController {
{
qrBoxService.download(bmQrBoxInfo, response);
}
/**
* 标准箱信息查询
* @param info
* @return
*/
@ApiOperation(value = "标准箱信息查询")
@GetMapping("/getBoxInfo")
public AjaxResult getBoxInfo(BoxBindWarehouseDto info) {
return qrBoxService.getBoxInfo(info);
}
/**
* 标准箱信息详情查询
* @param info
* @return
*/
@ApiOperation(value = "标准箱信息详情查询")
@GetMapping("/getBoxDetails")
public AjaxResult getBoxDetails(BoxBindWarehouseDto info) {
return qrBoxService.getBoxDetails(info);
}
}

View File

@ -1,5 +1,6 @@
package com.bonus.material.basic.domain.dto;
import com.bonus.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
@ -15,7 +16,7 @@ import java.math.BigDecimal;
*/
@Data
@Accessors(chain = true)
public class BoxBindWarehouseDto {
public class BoxBindWarehouseDto extends BaseEntity {
@ApiModelProperty(value = "标准箱ID")
private Long boxId;
@ -39,4 +40,16 @@ public class BoxBindWarehouseDto {
private String maStatus;
@ApiModelProperty(value = "入库数量")
private BigDecimal inputNum;
@ApiModelProperty(value = "标准箱状态")
private String boxStatus;
@ApiModelProperty(value = "机具名称")
private String typeName;
@ApiModelProperty(value = "规格型号")
private String typeModelName;
@ApiModelProperty(value = "标准箱名称")
private String boxName;
}

View File

@ -152,4 +152,11 @@ public interface BmQrBoxMapper {
int updateStorageNum(BoxBindWarehouseDto boxMa);
int updateBoxStatus(BoxBindWarehouseDto boxMa);
/**
* 查询标准箱信息
* @param info
* @return
*/
BoxBindWarehouseDto getBoxInfo(BoxBindWarehouseDto info);
}

View File

@ -112,4 +112,18 @@ public interface BmQrBoxService {
AjaxResult getBoxCodeList(BmQrBoxInfo bmQrBoxInfo);
AjaxResult appBoxInput(BoxBindWarehouseDto boxBindWarehouseDto);
/**
* 查询标准箱信息
* @param info
* @return
*/
AjaxResult getBoxInfo(BoxBindWarehouseDto info);
/**
* 标准箱信息详情查询
* @param info
* @return
*/
AjaxResult getBoxDetails(BoxBindWarehouseDto info);
}

View File

@ -21,6 +21,7 @@ import com.bonus.material.basic.mapper.BmQrBoxMapper;
import com.bonus.material.basic.service.BmQrBoxService;
import com.bonus.material.ma.domain.vo.MachineVo;
import com.bonus.material.ma.mapper.MachineMapper;
import com.bonus.material.purchase.config.RemoteConfig;
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
import com.bonus.material.purchase.domain.vo.PurchaseVo;
import com.bonus.material.purchase.mapper.PurchaseBindMapper;
@ -64,6 +65,9 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
@Resource
private TmTaskMapper tmTaskMapper;
@Resource
private RemoteConfig remoteConfig;
/**
* 查询二维码标准箱管理列表
*/
@ -601,6 +605,49 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
return AjaxResult.success();
}
/**
* 获取标准箱详情
* @param info
* @return
*/
@Override
public AjaxResult getBoxInfo(BoxBindWarehouseDto info) {
BoxBindWarehouseDto bmQrBoxInfo = bmQrBoxMapper.getBoxInfo(info);
// 根据boxCode查询标准箱详情
List<BoxBindWarehouseDto> boxList = bmQrBoxMapper.getBoxList(info);
if (bmQrBoxInfo != null) {
Map<String, String> boxStatus = remoteConfig.getDictValue("qr_box_status");
if (StringUtils.isNotBlank(bmQrBoxInfo.getBoxStatus())) {
bmQrBoxInfo.setBoxStatus(StringUtils.isBlank(boxStatus.get(bmQrBoxInfo.getBoxStatus())) ? "" : boxStatus.get(bmQrBoxInfo.getBoxStatus()));
}
if (CollectionUtil.isNotEmpty(boxList)) {
bmQrBoxInfo.setInputNum(BigDecimal.valueOf(boxList.size()));
}
}
return AjaxResult.success(bmQrBoxInfo);
}
/**
* 标准箱信息详情查询
* @param dto
* @return
*/
@Override
public AjaxResult getBoxDetails(BoxBindWarehouseDto dto) {
List<BoxBindWarehouseDto> list = bmQrBoxMapper.getBoxList(dto);
if (CollectionUtil.isNotEmpty(list)) {
Map<String, String> machineStatus = remoteConfig.getDictValue("ma_machine_status");
if (CollectionUtils.isNotEmpty(list)) {
list.forEach(info -> {
if (StringUtils.isNotBlank(info.getMaStatus())) {
info.setMaStatus(StringUtils.isBlank(machineStatus.get(info.getMaStatus())) ? "" : machineStatus.get(info.getMaStatus()));
}
});
}
}
return AjaxResult.success(list);
}
private int updateBoxStatus(BoxBindWarehouseDto boxMa) {
int result = 0;
result = bmQrBoxMapper.updateBoxStatus(boxMa);

View File

@ -334,7 +334,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mm.ma_code AS maCode,
mm.ma_status AS maStatus,
mm.type_id AS maTypeId,
mm.buy_task AS taskId
mm.buy_task AS taskId,
qb.create_time AS createTime
FROM
bm_qrcode_box_bind qb
LEFT JOIN bm_qrcode_box bb on qb.box_id = bb.box_id
@ -344,7 +345,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
AND mt1.del_flag = '0'
WHERE
bb.box_code =#{boxCode}
bb.box_code = #{boxCode}
<if test="maCode != null and maCode != ''">
AND mm.ma_code LIKE concat('%',#{maCode},'%')
</if>
</select>
<update id="updateNewInputNum">
@ -383,6 +387,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND pcd.status NOT IN (19)
</select>
<select id="getBoxInfo" resultType="com.bonus.material.basic.domain.dto.BoxBindWarehouseDto">
SELECT
box_id AS boxId,
box_name AS boxName,
box_status AS boxStatus,
box_code AS boxCode,
create_by AS createBy,
create_time AS createTime
FROM
bm_qrcode_box
WHERE
box_code = #{boxCode}
</select>
<update id="updateTaskStatus">
UPDATE tm_task SET task_status = 22 WHERE task_id = #{taskId}
</update>