wms 库存管理-抄码商品对照表-打印页面查询

This commit is contained in:
zhaoqing
2026-04-14 20:52:03 +08:00
parent 281bf9b965
commit 76e82f635a
10 changed files with 97 additions and 9 deletions
@@ -1,12 +1,16 @@
package com.mhd.wms.application.service.CopyCodeReference;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.system.api.model.LoginUser;
import com.mhd.wms.domain.copyCodeReference.repository.po.CopyCodeReferencePO;
import com.mhd.wms.domain.copyCodeReference.repository.todo.CopyCodeReferenceDO;
import com.mhd.wms.domain.copyCodeReference.service.CopyCodeReferenceDomainService;
import com.mhd.wms.interfaces.dto.copyCodeReference.CopyCodeReferenceDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
@Service
@@ -16,8 +20,24 @@ public class CopyCodeReferenceApplicationService {
public List<CopyCodeReferencePO> queryList(CopyCodeReferenceDO copyCodeReferenceDO) {
LoginUser loginUser = SecurityUtils.getLoginUser();
if (loginUser != null){
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
if (topOrganizationId != null && topOrganizationId != 1){
copyCodeReferenceDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
}
}
List<CopyCodeReferencePO> list = copyCodeReferenceDomainService.queryList(copyCodeReferenceDO);
return list;
}
public List<CopyCodeReferencePO> queryWeightList(CopyCodeReferenceDTO dto) {
List<CopyCodeReferencePO> list = copyCodeReferenceDomainService.queryWeightList(dto);
for(int i = 0;i < list.size();i++) {
list.get(i).setSerialNumber(i+1);
}
return list;
}
}
@@ -3,11 +3,15 @@ package com.mhd.wms.domain.copyCodeReference.repository.facade;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mhd.wms.domain.copyCodeReference.repository.po.CopyCodeReferencePO;
import com.mhd.wms.domain.copyCodeReference.repository.todo.CopyCodeReferenceDO;
import com.mhd.wms.interfaces.dto.copyCodeReference.CopyCodeReferenceDTO;
import java.math.BigDecimal;
import java.util.List;
public interface ICopyCodeReferenceService extends IService<CopyCodeReferenceDO> {
List<CopyCodeReferencePO> queryList(CopyCodeReferenceDO copyCodeReferenceDO);
List<CopyCodeReferencePO> queryWeightList(CopyCodeReferenceDTO dto);
}
@@ -3,12 +3,16 @@ package com.mhd.wms.domain.copyCodeReference.repository.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mhd.wms.domain.copyCodeReference.repository.po.CopyCodeReferencePO;
import com.mhd.wms.domain.copyCodeReference.repository.todo.CopyCodeReferenceDO;
import com.mhd.wms.interfaces.dto.copyCodeReference.CopyCodeReferenceDTO;
import org.apache.ibatis.annotations.Mapper;
import java.math.BigDecimal;
import java.util.List;
@Mapper
public interface CopyCodeReferenceMapper extends BaseMapper<CopyCodeReferenceDO> {
List<CopyCodeReferencePO> queryList(CopyCodeReferenceDO copyCodeReferenceDO);
List<CopyCodeReferencePO> queryWeightList(CopyCodeReferenceDTO dto);
}
@@ -8,12 +8,17 @@ import com.mhd.wms.domain.copyCodeReference.repository.todo.CopyCodeReferenceDO;
import com.mhd.wms.domain.inMaterialDetailSerialNumber.entity.InMaterialDetailSerialNumber;
import com.mhd.wms.domain.inMaterialDetailSerialNumber.repository.facade.IInMaterialDetailSerialNumberService;
import com.mhd.wms.domain.inMaterialDetailSerialNumber.repository.mapper.InMaterialDetailSerialNumberMapper;
import com.mhd.wms.interfaces.dto.copyCodeReference.CopyCodeReferenceDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.Collections;
import java.util.List;
@Slf4j
@Service
public class CopyCodeReferenceImpl extends ServiceImpl<CopyCodeReferenceMapper, CopyCodeReferenceDO> implements ICopyCodeReferenceService {
@@ -23,8 +28,15 @@ public class CopyCodeReferenceImpl extends ServiceImpl<CopyCodeReferenceMapper,
@Override
public List<CopyCodeReferencePO> queryList(CopyCodeReferenceDO copyCodeReferenceDO) {
List<CopyCodeReferencePO> l = copyCodeReferenceMapper.queryList(copyCodeReferenceDO);
//List<CopyCodeReferencePO> l = copyCodeReferenceMapper.queryList(copyCodeReferenceDO);
// log.info()
return copyCodeReferenceMapper.queryList(copyCodeReferenceDO);
}
@Override
public List<CopyCodeReferencePO> queryWeightList(CopyCodeReferenceDTO dto) {
List<CopyCodeReferencePO> a = copyCodeReferenceMapper.queryWeightList(dto);
log.info("{}",a);
return copyCodeReferenceMapper.queryWeightList(dto);
}
}
@@ -61,5 +61,9 @@ public class CopyCodeReferencePO extends BaseVOEntity {
@Excel(name = "托盘号")
private String boxPalletNo;
@ApiModelProperty("物料状态")
@Excel(name = "物料状态")
private String materialStatusName;
}
@@ -1,5 +1,6 @@
package com.mhd.wms.domain.copyCodeReference.repository.todo;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -24,4 +25,16 @@ public class CopyCodeReferenceDO extends BaseVOEntity {
@ApiModelProperty("托盘号")
private String containerCode;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
}
@@ -4,9 +4,11 @@ package com.mhd.wms.domain.copyCodeReference.service;
import com.mhd.wms.domain.copyCodeReference.repository.facade.ICopyCodeReferenceService;
import com.mhd.wms.domain.copyCodeReference.repository.po.CopyCodeReferencePO;
import com.mhd.wms.domain.copyCodeReference.repository.todo.CopyCodeReferenceDO;
import com.mhd.wms.interfaces.dto.copyCodeReference.CopyCodeReferenceDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
@Service
@@ -18,4 +20,8 @@ public class CopyCodeReferenceDomainService {
public List<CopyCodeReferencePO> queryList(CopyCodeReferenceDO copyCodeReferenceDO) {
return copyCodeReferenceService.queryList(copyCodeReferenceDO);
}
public List<CopyCodeReferencePO> queryWeightList(CopyCodeReferenceDTO dto) {
return copyCodeReferenceService.queryWeightList(dto);
}
}
@@ -1,13 +1,14 @@
package com.mhd.wms.interfaces.dto.copyCodeReference;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "潮妈商品对照表请求DTO")
@ApiModel(value = "抄码商品对照表请求DTO")
public class CopyCodeReferenceDTO extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@@ -24,6 +25,8 @@ public class CopyCodeReferenceDTO extends BaseVOEntity {
private String batchNumber;
@ApiModelProperty("托盘号")
private String containerCode;
private String boxPalletNo;
}
@@ -2,6 +2,7 @@ package com.mhd.wms.interfaces.facadeApi.copyCodeReference;
import com.mhd.common.core.web.controller.BaseController;
import com.mhd.common.core.web.domain.AjaxResult;
import com.mhd.common.core.web.page.TableDataInfo;
import com.mhd.wms.application.service.CopyCodeReference.CopyCodeReferenceApplicationService;
import com.mhd.wms.domain.copyCodeReference.repository.po.CopyCodeReferencePO;
@@ -10,11 +11,10 @@ import com.mhd.wms.interfaces.assember.copyCodeReference.CopyCodeReferenceAssemb
import com.mhd.wms.interfaces.dto.copyCodeReference.CopyCodeReferenceDTO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;
@RestController
@@ -32,13 +32,19 @@ public class CopyCodeReferenceApi extends BaseController {
*/
@ApiOperation("查询抄码商品对照表列表")
@GetMapping("/list")
public TableDataInfo list(CopyCodeReferenceDTO dto) {
CopyCodeReferenceDO copyCodeReferenceDO = copyCodeReferenceAssembler.toDO(dto);
public TableDataInfo list(CopyCodeReferenceDTO copyCodeReferenceDTO) {
CopyCodeReferenceDO copyCodeReferenceDO = copyCodeReferenceAssembler.toDO(copyCodeReferenceDTO);
startPage();
List<CopyCodeReferencePO> list = copyCodeReferenceApplicationService.queryList(copyCodeReferenceDO);
return getDataTable(list);
}
@ApiOperation("打印-查询重量列表")
@PostMapping("/queryWeightList")
public AjaxResult queryWeightList(@RequestBody CopyCodeReferenceDTO dto) {
List<CopyCodeReferencePO> weightList = copyCodeReferenceApplicationService.queryWeightList(dto);
return AjaxResult.success(weightList);
}
}
@@ -15,6 +15,7 @@
<result property="inventoryQuantity" column="inventory_quantity"/>
<result property="shipperName" column="shipper_name"/>
<result property="boxPalletNo" column="box_pallet_no"/>
<result property="materialStatusName" column="material_status_name"/>
<result property="netWeight" column="net_weight"/>
</resultMap>
@@ -31,7 +32,8 @@
mi.net_weight,
mi.shipper_name,
mi.lot_number,
mi.box_pallet_no
mi.box_pallet_no,
mi.material_status_name
FROM material_inventory mi
LEFT JOIN material_base_info mbi ON mi.material_base_info_id = mbi.material_base_info_id
LEFT JOIN shelf_material_detail ssd ON mi.material_detail_id = ssd.material_detail_id
@@ -53,6 +55,20 @@
<if test="containerCode != null and containerCode != ''">
AND mi.container_code = #{containerCode}
</if>
order by mi.create_time desc
</select>
<select id="queryWeightList" resultMap="CopyCodeReferencePOMap">
SELECT
mi.net_weight,
mi.material_inventory_id
FROM material_inventory mi
LEFT JOIN material_base_info mbi ON mbi.material_base_info_id = mi.material_base_info_id AND mbi.del_flag = 1
WHERE mi.del_flag = 1
AND mbi.copy_code = 1
AND mbi.material_code = #{materialCode}
AND mi.batch_number = #{batchNumber}
AND mi.box_pallet_no = #{boxPalletNo}
</select>
</mapper>