Browse Source

修改查询库存品校验

training
caoyizhong 1 year ago
parent
commit
5beed7e85a
  1. 10
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayGoodsClient.java
  2. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionParcelListController.java
  3. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java
  4. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListInfoController.java
  5. 206
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionStockListExcel.java
  6. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  7. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.java
  8. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml
  9. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListInfoService.java
  10. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java
  11. 28
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  12. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  13. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListInfoServiceImpl.java
  14. 61
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java
  15. 19
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseTrayGoodsClient.java
  16. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml
  17. 9
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java
  18. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

10
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayGoodsClient.java

@ -21,6 +21,7 @@ import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity;
import org.springblade.common.constant.ModuleNameConstant; import org.springblade.common.constant.ModuleNameConstant;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import java.util.List; import java.util.List;
@ -39,6 +40,7 @@ public interface IWarehouseTrayGoodsClient {
String API_PREFIX = "warehousetraygoods/client"; String API_PREFIX = "warehousetraygoods/client";
String TOP = API_PREFIX + "/top10"; String TOP = API_PREFIX + "/top10";
String GETTRAYIDLIST = API_PREFIX + "/trayIdList"; String GETTRAYIDLIST = API_PREFIX + "/trayIdList";
String GETTRAYLIST = API_PREFIX + "/getTrayList";
/** /**
* 通过主键删除 * 通过主键删除
@ -72,4 +74,12 @@ public interface IWarehouseTrayGoodsClient {
@PostMapping(GETTRAYIDLIST) @PostMapping(GETTRAYIDLIST)
List<WarehouseTrayGoodsEntity> getTrayIdList(@RequestParam String trayId,@RequestParam String trayBarCode); List<WarehouseTrayGoodsEntity> getTrayIdList(@RequestParam String trayId,@RequestParam String trayBarCode);
/**
* 通过查询托盘上面的货物
*
* @param warehouseTrayGoodsEntity
*/
@PostMapping(GETTRAYLIST)
List<WarehouseTrayGoodsEntity> getTrayList(@RequestBody WarehouseTrayGoodsEntity warehouseTrayGoodsEntity);
} }

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionParcelListController.java

@ -181,7 +181,7 @@ public class DistributionParcelListController extends BladeController {
distributionParcelListDTO.setId(Long.parseLong(i)); distributionParcelListDTO.setId(Long.parseLong(i));
distributionParcelListDTO.setMaterialCode(materialOwnId.getProductCode()); distributionParcelListDTO.setMaterialCode(materialOwnId.getProductCode());
distributionParcelListDTO.setMaterialName(materialOwnId.getName()); distributionParcelListDTO.setMaterialName(materialOwnId.getName());
distributionParcelListDTO.setMaterialUnit(DictBizCache.getValue(DictBizConstant.LOGPM_UNIT,materialOwnId.getLogpmUnit())); distributionParcelListDTO.setMaterialUnit(materialOwnId.getLogpmUnit());
distributionParcelListDTO.setSku(materialOwnId.getSku()); distributionParcelListDTO.setSku(materialOwnId.getSku());
distributionParcelListService.updateById(distributionParcelListDTO); distributionParcelListService.updateById(distributionParcelListDTO);
}); });

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java

@ -198,12 +198,8 @@ public class DistributionStockListController extends BladeController {
@ApiOperationSupport(order = 9) @ApiOperationSupport(order = 9)
@ApiOperation(value = "导出数据", notes = "传入distributionStockList") @ApiOperation(value = "导出数据", notes = "传入distributionStockList")
public void exportDistributionStockList(@ApiIgnore @RequestParam Map<String, Object> distributionStockList, BladeUser bladeUser, HttpServletResponse response) { public void exportDistributionStockList(@ApiIgnore @RequestParam Map<String, Object> distributionStockList, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<DistributionStockListEntity> queryWrapper = Condition.getQueryWrapper(distributionStockList, DistributionStockListEntity.class);
//if (!AuthUtil.isAdministrator()) { List<DistributionStockListExcel> list = distributionStockListService.exportDistributionStockList(distributionStockList);
// queryWrapper.lambda().eq(DistributionStockList::getTenantId, bladeUser.getTenantId());
//}
queryWrapper.lambda().eq(DistributionStockListEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<DistributionStockListExcel> list = distributionStockListService.exportDistributionStockList(queryWrapper);
ExcelUtil.export(response, "库存品管理数据" + DateUtil.time(), "库存品管理数据表", list, DistributionStockListExcel.class); ExcelUtil.export(response, "库存品管理数据" + DateUtil.time(), "库存品管理数据表", list, DistributionStockListExcel.class);
} }

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListInfoController.java

@ -139,12 +139,8 @@ public class DistributionStockListInfoController extends BladeController {
@ApiOperationSupport(order = 9) @ApiOperationSupport(order = 9)
@ApiOperation(value = "导出数据", notes = "传入distributionStockListInfo") @ApiOperation(value = "导出数据", notes = "传入distributionStockListInfo")
public void exportDistributionStockListInfo(@ApiIgnore @RequestParam Map<String, Object> distributionStockListInfo, BladeUser bladeUser, HttpServletResponse response) { public void exportDistributionStockListInfo(@ApiIgnore @RequestParam Map<String, Object> distributionStockListInfo, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<DistributionStockListInfoEntity> queryWrapper = Condition.getQueryWrapper(distributionStockListInfo, DistributionStockListInfoEntity.class);
//if (!AuthUtil.isAdministrator()) { List<DistributionStockListInfoExcel> list = distributionStockListInfoService.exportDistributionStockListInfo(distributionStockListInfo);
// queryWrapper.lambda().eq(DistributionStockListInfo::getTenantId, bladeUser.getTenantId());
//}
queryWrapper.lambda().eq(DistributionStockListInfoEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<DistributionStockListInfoExcel> list = distributionStockListInfoService.exportDistributionStockListInfo(queryWrapper);
ExcelUtil.export(response, "库存品明细数据" + DateUtil.time(), "库存品明细数据表", list, DistributionStockListInfoExcel.class); ExcelUtil.export(response, "库存品明细数据" + DateUtil.time(), "库存品明细数据表", list, DistributionStockListInfoExcel.class);
} }

206
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionStockListExcel.java

@ -41,124 +41,198 @@ public class DistributionStockListExcel implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 租户 * 服务
*/ */
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty("租户号") @ExcelProperty("服务号")
private String tenantId; private String serviceNumber;
/** /**
* 是否已删除 * 服务类型
*/ */
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty("是否已删除") @ExcelProperty("服务类型")
private Integer isDeleted; private String serviceTypeName;
/**
* 预留1
*/
@ColumnWidth(20)
@ExcelProperty("预留1")
private String reserve1;
/**
* 预留2
*/
@ColumnWidth(20)
@ExcelProperty("预留2")
private String reserve2;
/** /**
* 预留3 * 服务类型
*/ */
@ColumnWidth(20) // @ColumnWidth(20)
@ExcelProperty("预留3") // @ExcelProperty("服务类型")
private String reserve3; // private String serviceType;
/** /**
* 预留4 * 商场名称
*/ */
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty("预留4") @ExcelProperty("商场名称")
private String reserve4; private String marketName;
/** /**
* 预留5 * 货物名称
*/ */
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty("预留5") @ExcelProperty("货物名称")
private String reserve5; private String descriptionGoods;
/** /**
* 订单自编号 * 货物编码
*/ */
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty("订单自编号") @ExcelProperty("货物编码")
private String orderSelfNumbering; private String cargoNumber;
/** /**
* 入库批次 * 入库批次
*/ */
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty("入库批次") @ExcelProperty("入库批次")
private String incomingBatch; private String incomingBatch;
/** /**
* 货物名称 * 库存数量
*/ */
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty("货物名称") @ExcelProperty("库存数量")
private String descriptionGoods; private Integer quantityStock;
/** /**
* 货物编号 * 冻结数量
*/ */
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty("货物编号") @ExcelProperty("冻结数量")
private String cargoNumber; private Integer quantityOccupied;
/** /**
* 仓库 * 出库数量
*/ */
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty("仓库") @ExcelProperty("出库数量")
private String warehouse; private Integer outboundQuantity;
/** /**
* 商场 * 品牌
*/ */
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty("商场") @ExcelProperty("品牌")
private String market; private String brandName;
/** /**
* 货物单位 * 门店名称
*/ */
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty("货物单位") @ExcelProperty("门店名称")
private String cargoUnit; private String storeName;
/** /**
* 门店 * 所在托盘
*/ */
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty("门店") @ExcelProperty("所在托盘")
private String shop; private String trayCode;
/** /**
* 库位信息 * 仓库名称
*/ */
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty("库位信息") @ExcelProperty("仓库名称")
private String storageLocation; private String warehouseName;
/** /**
* 商城名称 * 物料单位
*/ */
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty("商城名称") @ExcelProperty("物料单位")
private String mallName; private String cargoUnit;
/** /**
* 库存数量 * 包装数量
*/ */
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty("库存数量") @ExcelProperty("包装数量")
private Integer quantityStock; private String packNum;
/** /**
* 出库数量 * 拆包数量
*/ */
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty("出库数量") @ExcelProperty("拆包数量")
private Integer outboundQuantity; private Integer unpackingQuantity;
/** /**
* 发运车次 * 拆包状态
*/ */
@ColumnWidth(20) @ColumnWidth(20)
@ExcelProperty("发运车次") @ExcelProperty("拆包状态")
private String despatch; private String unpack;
// /**
// * 订单自编号
// */
// @ColumnWidth(20)
// @ExcelProperty("订单自编号")
// private String orderSelfNumbering;
// /**
// * 入库批次号
// */
// @ColumnWidth(20)
// @ExcelProperty("入库批次号")
// private String incomingBatch;
// /**
// * 货物名称
// */
// @ColumnWidth(20)
// @ExcelProperty("货物名称")
// private String descriptionGoods;
// /**
// * 货物编号
// */
// @ColumnWidth(20)
// @ExcelProperty("货物编号")
// private String cargoNumber;
// /**
// * 仓库
// */
// @ColumnWidth(20)
// @ExcelProperty("仓库")
// private String warehouse;
// /**
// * 商场
// */
// @ColumnWidth(20)
// @ExcelProperty("商场")
// private String market;
// /**
// * 货物单位
// */
// @ColumnWidth(20)
// @ExcelProperty("货物单位")
// private String cargoUnit;
// /**
// * 门店
// */
// @ColumnWidth(20)
// @ExcelProperty("门店")
// private String shop;
// /**
// * 库位信息
// */
// @ColumnWidth(20)
// @ExcelProperty("库位信息")
// private String storageLocation;
// /**
// * 商城名称
// */
// @ColumnWidth(20)
// @ExcelProperty("商城名称")
// private String mallName;
// /**
// * 库存数量
// */
// @ColumnWidth(20)
// @ExcelProperty("库存数量")
// private Integer quantityStock;
// /**
// * 出库数量
// */
// @ColumnWidth(20)
// @ExcelProperty("出库数量")
// private Integer outboundQuantity;
// /**
// * 发运车次
// */
// @ColumnWidth(20)
// @ExcelProperty("发运车次")
// private String despatch;
} }

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml

@ -435,6 +435,7 @@
</foreach> </foreach>
</if> </if>
<if test="param.stockArticleIdsLike != null and param.stockArticleIdsLike != ''" >and ldpl.stock_article_id = #{param.stockArticleIdsLike} </if> <if test="param.stockArticleIdsLike != null and param.stockArticleIdsLike != ''" >and ldpl.stock_article_id = #{param.stockArticleIdsLike} </if>
<if test="param.stockArticleId != null and param.stockArticleId != ''" >and ldpl.stock_article_id = #{param.stockArticleId} </if>
</where> </where>

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.java

@ -56,7 +56,7 @@ public interface DistributionStockListMapper extends BaseMapper<DistributionStoc
* @param queryWrapper * @param queryWrapper
* @return * @return
*/ */
List<DistributionStockListExcel> exportDistributionStockList(@Param("ew") Wrapper<DistributionStockListEntity> queryWrapper); List<DistributionStockListEntity> exportDistributionStockList(@Param("ew") Wrapper<DistributionStockListEntity> queryWrapper);
IPage<DistributionStockListVO> pageOwn(IPage page,@Param("param") DistributionStockListEntity distributionStockListEntity); IPage<DistributionStockListVO> pageOwn(IPage page,@Param("param") DistributionStockListEntity distributionStockListEntity);

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml

@ -94,7 +94,7 @@
</select> </select>
<select id="exportDistributionStockList" resultType="com.logpm.distribution.excel.DistributionStockListExcel"> <select id="exportDistributionStockList" resultType="com.logpm.distribution.entity.DistributionStockListEntity">
SELECT * FROM logpm_distribution_stock_list ${ew.customSqlSegment} SELECT * FROM logpm_distribution_stock_list ${ew.customSqlSegment}
</select> </select>

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListInfoService.java

@ -24,6 +24,7 @@ import com.logpm.distribution.vo.DistributionStockListInfoVO;
import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 库存品明细 服务类 * 库存品明细 服务类
@ -48,6 +49,6 @@ public interface IDistributionStockListInfoService extends BaseService<Distribut
* @param queryWrapper * @param queryWrapper
* @return * @return
*/ */
List<DistributionStockListInfoExcel> exportDistributionStockListInfo(Wrapper<DistributionStockListInfoEntity> queryWrapper); List<DistributionStockListInfoExcel> exportDistributionStockListInfo(Map<String, Object> distributionStockListInfo);
} }

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java

@ -57,10 +57,10 @@ public interface IDistributionStockListService extends BaseService<DistributionS
/** /**
* 导出数据 * 导出数据
* *
* @param queryWrapper * @param distributionStockList
* @return * @return
*/ */
List<DistributionStockListExcel> exportDistributionStockList(Wrapper<DistributionStockListEntity> queryWrapper); List<DistributionStockListExcel> exportDistributionStockList(Map<String, Object> distributionStockList);
/** /**
* 查询订单下的包件信息 * 查询订单下的包件信息

28
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java

@ -227,6 +227,10 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
@Override @Override
public IPage<DistributionParcelListEntity> pageOweList(IPage<Object> page, Map<String, Object> distributionParcelList) { public IPage<DistributionParcelListEntity> pageOweList(IPage<Object> page, Map<String, Object> distributionParcelList) {
Object o = distributionParcelList.get("parcelType");
if(ObjectUtils.isNotNull(o)){
distributionParcelList.remove("parcelType");
}
DistributionParcelListDTO distributionParcelListDTO = JSONObject.parseObject(JSONObject.toJSONString(distributionParcelList), DistributionParcelListDTO.class); DistributionParcelListDTO distributionParcelListDTO = JSONObject.parseObject(JSONObject.toJSONString(distributionParcelList), DistributionParcelListDTO.class);
if(Func.isNotEmpty(distributionParcelListDTO.getStockArticleIds())){ if(Func.isNotEmpty(distributionParcelListDTO.getStockArticleIds())){
String trim = distributionParcelListDTO.getStockArticleIds().trim(); String trim = distributionParcelListDTO.getStockArticleIds().trim();
@ -236,19 +240,23 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
}else{ }else{
distributionParcelListDTO.setStockArticleIdsLike(trim); distributionParcelListDTO.setStockArticleIdsLike(trim);
} }
//查询包件有没有上架,打托信息 if(ObjectUtils.isNotNull(o) && String.valueOf(o).equals("2")){
List<DistributionStockArticleGroundingVO> list2 = distributionStockArticleMapper.selectListGrounding(list); //查询包件上架状态
if(!list2.isEmpty()){ //查询包件有没有上架,打托信息
boolean b = list2.stream().anyMatch(i -> i.getGroundingStatus().equals(OrderPackageGroundingStatusConstant.yishangjia.getValue())); List<DistributionStockArticleGroundingVO> list2 = distributionStockArticleMapper.selectListGrounding(list);
if(b){ if(!list2.isEmpty()){
throw new ServiceException("选择的订单有上架的包件,请下架后在操作!"); boolean b = list2.stream().anyMatch(i -> i.getGroundingStatus().equals(OrderPackageGroundingStatusConstant.yishangjia.getValue()));
}else{ if(b){
boolean b1 = list2.stream().anyMatch(i -> ObjectUtils.isNotNull(i.getAssociationType())); throw new ServiceException("选择的订单有上架的包件,请下架后在操作!");
if(b1){ }else{
throw new ServiceException("选择的订单在托盘上面有包件,请解托后在操作!"); boolean b1 = list2.stream().anyMatch(i -> ObjectUtils.isNotNull(i.getAssociationType()));
if(b1){
throw new ServiceException("选择的订单在托盘上面有包件,请解托后在操作!");
}
} }
} }
} }
} }
return baseMapper.pageOweList(page,distributionParcelListDTO); return baseMapper.pageOweList(page,distributionParcelListDTO);
} }

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -139,6 +139,11 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
return distributionStockArticleList; return distributionStockArticleList;
} }
/**
* 订单转库存品操作
* @param ids
* @return
*/
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Boolean saveStock(String ids) { public Boolean saveStock(String ids) {

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListInfoServiceImpl.java

@ -17,6 +17,7 @@
package com.logpm.distribution.service.impl; package com.logpm.distribution.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.entity.DistributionStockListInfoEntity; import com.logpm.distribution.entity.DistributionStockListInfoEntity;
import com.logpm.distribution.excel.DistributionStockListInfoExcel; import com.logpm.distribution.excel.DistributionStockListInfoExcel;
@ -24,9 +25,12 @@ import com.logpm.distribution.mapper.DistributionStockListInfoMapper;
import com.logpm.distribution.service.IDistributionStockListInfoService; import com.logpm.distribution.service.IDistributionStockListInfoService;
import com.logpm.distribution.vo.DistributionStockListInfoVO; import com.logpm.distribution.vo.DistributionStockListInfoVO;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.tool.constant.BladeConstant;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 库存品明细 服务实现类 * 库存品明细 服务实现类
@ -44,7 +48,11 @@ public class DistributionStockListInfoServiceImpl extends BaseServiceImpl<Distri
@Override @Override
public List<DistributionStockListInfoExcel> exportDistributionStockListInfo(Wrapper<DistributionStockListInfoEntity> queryWrapper) { public List<DistributionStockListInfoExcel> exportDistributionStockListInfo(Map<String, Object> distributionStockListInfo) {
QueryWrapper<DistributionStockListInfoEntity> queryWrapper = Condition.getQueryWrapper(distributionStockListInfo, DistributionStockListInfoEntity.class);
queryWrapper.lambda().eq(DistributionStockListInfoEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<DistributionStockListInfoExcel> distributionStockListInfoList = baseMapper.exportDistributionStockListInfo(queryWrapper); List<DistributionStockListInfoExcel> distributionStockListInfoList = baseMapper.exportDistributionStockListInfo(queryWrapper);
//distributionStockListInfoList.forEach(distributionStockListInfo -> { //distributionStockListInfoList.forEach(distributionStockListInfo -> {
// distributionStockListInfo.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionStockListInfo.getType())); // distributionStockListInfo.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionStockListInfo.getType()));

61
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java

@ -18,6 +18,7 @@ package com.logpm.distribution.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@ -39,16 +40,23 @@ import com.logpm.distribution.service.IDistributionStockListService;
import com.logpm.distribution.service.IDistributionUnpackingDetailsService; import com.logpm.distribution.service.IDistributionUnpackingDetailsService;
import com.logpm.distribution.vo.*; import com.logpm.distribution.vo.*;
import com.logpm.distribution.vo.app.StockMallVO; import com.logpm.distribution.vo.app.StockMallVO;
import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity;
import com.logpm.warehouse.feign.IWarehouseTrayGoodsClient;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant; import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.DistributionTypeConstant;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.cache.DictBizCache; import org.springblade.system.cache.DictBizCache;
import org.springblade.system.cache.DictCache;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -80,6 +88,7 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
// private final IBasicdataWarehouseClient basicdataWarehouseClient; // private final IBasicdataWarehouseClient basicdataWarehouseClient;
private final IDistributionReservationStocklistService reservationStocklistService; private final IDistributionReservationStocklistService reservationStocklistService;
private final IWarehouseTrayGoodsClient warehouseTrayGoodsClient;
@ -105,12 +114,52 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
@Override @Override
public List<DistributionStockListExcel> exportDistributionStockList(Wrapper<DistributionStockListEntity> queryWrapper) { public List<DistributionStockListExcel> exportDistributionStockList(Map<String, Object> distributionStockList) {
List<DistributionStockListExcel> distributionStockListList = baseMapper.exportDistributionStockList(queryWrapper); Object o = distributionStockList.get("row");
//distributionStockListList.forEach(distributionStockList -> { Object ids = distributionStockList.get("ids");
// distributionStockList.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionStockList.getType())); if(ObjectUtils.isNotNull(ids)){
//}); distributionStockList.remove("ids");
return distributionStockListList; }
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNotNull(myCurrentWarehouse)){
distributionStockList.put("warehouseId",myCurrentWarehouse.getId());
}else{
throw new ServiceException("请选择仓库,在进行导出数据!!!");
}
QueryWrapper<DistributionStockListEntity> queryWrapper = Condition.getQueryWrapper(distributionStockList, DistributionStockListEntity.class);
queryWrapper.lambda().eq(DistributionStockListEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
if(ObjectUtils.isNotNull(ids)){
queryWrapper.in(ObjectUtils.isNotNull(ids),"id",String.valueOf(ids).split(","));
}
List<DistributionStockListEntity> distributionStockListEntities = baseMapper.exportDistributionStockList(queryWrapper);
List<DistributionStockListExcel> excelList = new ArrayList<>();
distributionStockListEntities.forEach(stockList -> {
// stockList.setServiceType(DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, stockList.getServiceType()));
DistributionStockListExcel distributionStockListExcel = new DistributionStockListExcel();
BeanUtil.copyProperties(stockList,distributionStockListExcel);
String value = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, stockList.getServiceType());
distributionStockListExcel.setServiceTypeName(value);
distributionStockListExcel.setUnpack(stockList.getUnpack() ? "是":"否");
//查询包装数量
BasicMaterialEntity materialOwnId = basicMaterialClient.getMaterialOwnId(stockList.getMaterialId());
if(ObjectUtils.isNotNull(materialOwnId)){
distributionStockListExcel.setPackNum(materialOwnId.getPackageNum());
}
//查询托盘信息
WarehouseTrayGoodsEntity warehouseTrayGoodsEntity = new WarehouseTrayGoodsEntity();
warehouseTrayGoodsEntity.setMarketId(stockList.getMarketId());
warehouseTrayGoodsEntity.setWarehouseId(myCurrentWarehouse.getId());
warehouseTrayGoodsEntity.setIncomingBatch(stockList.getIncomingBatch());
warehouseTrayGoodsEntity.setAssociationId(stockList.getMaterialId());
warehouseTrayGoodsEntity.setAssociationType("4");
List<WarehouseTrayGoodsEntity> trayList = warehouseTrayGoodsClient.getTrayList(warehouseTrayGoodsEntity);
if(!trayList.isEmpty()){
distributionStockListExcel.setTrayCode(trayList.stream().map(WarehouseTrayGoodsEntity::getTrayCode).collect(Collectors.joining(",")));
}
excelList.add(distributionStockListExcel);
});
return excelList;
} }
@Override @Override

19
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseTrayGoodsClient.java

@ -2,6 +2,7 @@ package com.logpm.warehouse.feign;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity; import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity;
import com.logpm.warehouse.service.IWarehouseTrayGoodsService; import com.logpm.warehouse.service.IWarehouseTrayGoodsService;
import com.logpm.warehouse.service.IWarehouseTrayTypeService; import com.logpm.warehouse.service.IWarehouseTrayTypeService;
@ -59,4 +60,22 @@ public class WarehouseTrayGoodsClient implements IWarehouseTrayGoodsClient {
queryWrapper.eq("association_type","3"); queryWrapper.eq("association_type","3");
return warehouseTrayGoodsService.list(queryWrapper); return warehouseTrayGoodsService.list(queryWrapper);
} }
/**
* 查询托盘信息
*
* @param warehouseTrayGoodsEntity
* @return
*/
@Override
@PostMapping(GETTRAYLIST)
public List<WarehouseTrayGoodsEntity> getTrayList(WarehouseTrayGoodsEntity warehouseTrayGoodsEntity) {
return warehouseTrayGoodsService.list(Wrappers.<WarehouseTrayGoodsEntity>query().lambda()
.eq(ObjectUtils.isNotNull(warehouseTrayGoodsEntity.getAssociationId()),WarehouseTrayGoodsEntity:: getAssociationId,warehouseTrayGoodsEntity.getAssociationId())
.eq(ObjectUtils.isNotNull(warehouseTrayGoodsEntity.getWarehouseId()),WarehouseTrayGoodsEntity:: getWarehouseId,warehouseTrayGoodsEntity.getWarehouseId())
.eq(ObjectUtils.isNotNull(warehouseTrayGoodsEntity.getIncomingBatch()),WarehouseTrayGoodsEntity:: getIncomingBatch,warehouseTrayGoodsEntity.getIncomingBatch())
.eq(ObjectUtils.isNotNull(warehouseTrayGoodsEntity.getMarketId()),WarehouseTrayGoodsEntity::getMarketId ,warehouseTrayGoodsEntity.getMarketId())
.eq(ObjectUtils.isNotNull(warehouseTrayGoodsEntity.getAssociationType()),WarehouseTrayGoodsEntity::getAssociationType ,warehouseTrayGoodsEntity.getAssociationType())
);
}
} }

6
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml

@ -134,12 +134,12 @@
<select id="findMaterialList" resultType="com.logpm.warehouse.vo.WarehouseMaterialVO"> <select id="findMaterialList" resultType="com.logpm.warehouse.vo.WarehouseMaterialVO">
select lbm.product_code, select lbm.product_code materialCode,
lbm.`name` lbm.`name` materialName
from logpm_basicdata_material lbm from logpm_basicdata_material lbm
where lbm.is_deleted = 0 where lbm.is_deleted = 0
<if test="param.materialCode != null and param.materialCode != '' "> <if test="param.materialCode != null and param.materialCode != '' ">
and (lbm.product_code like concat('%',#{materialCode},'%') or lbm.`name` like concat('%',#{materialCode},'%')) and (lbm.product_code like concat('%',#{param.materialCode},'%') or lbm.`name` like concat('%',#{param.materialCode},'%'))
</if> </if>

9
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java

@ -91,6 +91,10 @@ public interface ITaskQuestService extends BaseService<TaskQuestEntity> {
void updateQuestSetail(TaskSearchDTO taskSearchDTO); void updateQuestSetail(TaskSearchDTO taskSearchDTO);
/**
* 更新盘点数据库位
* @param taskSearchDTO
*/
void updateQuestDetailAllocation(TaskSearchDTO taskSearchDTO); void updateQuestDetailAllocation(TaskSearchDTO taskSearchDTO);
void deleteQuestDetail(TaskSearchDTO taskSearchDTO); void deleteQuestDetail(TaskSearchDTO taskSearchDTO);
@ -102,6 +106,11 @@ public interface ITaskQuestService extends BaseService<TaskQuestEntity> {
* @return * @return
*/ */
R trayListInfo(IPage<Object> page, TaskSearchDTO taskSearchDTO); R trayListInfo(IPage<Object> page, TaskSearchDTO taskSearchDTO);
/**
* 保存新的盘点数据
* @param taskSearchDTO
*/
void saveNewQuestDetail(TaskSearchDTO taskSearchDTO); void saveNewQuestDetail(TaskSearchDTO taskSearchDTO);
List<WarehouseMaterialVO> findMaterialList(TaskSearchDTO taskSearchDTO); List<WarehouseMaterialVO> findMaterialList(TaskSearchDTO taskSearchDTO);

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

@ -829,7 +829,10 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
} }
} }
/**
* 更新盘点数据库位
* @param taskSearchDTO
*/
@Transactional @Transactional
@Override @Override
public void updateQuestDetailAllocation(TaskSearchDTO taskSearchDTO) { public void updateQuestDetailAllocation(TaskSearchDTO taskSearchDTO) {

Loading…
Cancel
Save