Browse Source

fix:增加一个库存品 批量查看二维码的功能

dist.1.3.0
pref_mail@163.com 5 months ago
parent
commit
db91403b3a
  1. 19
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java
  2. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java
  3. 89
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java

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

@ -173,6 +173,25 @@ public class DistributionStockListController extends BladeController {
return R.data(orderPackgeCodeDataVo); return R.data(orderPackgeCodeDataVo);
} }
/**
*
* @param orderPackgeCodes 多个库存品码的 号分割
* @return
*/
@GetMapping("/showInventoryPackgeCodes")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "返回模板和模板内容")
public R showInventoryPackgeCodes(@ApiIgnore @RequestParam String orderPackgeCodes){
OrderPackgeCodeDataVO orderPackgeCodeDataVo= null;
try {
orderPackgeCodeDataVo = distributionStockListService.showInvnetoryPackgeCodes(orderPackgeCodes);
} catch (Exception e) {
return R.fail(e.getMessage());
}
return R.data(orderPackgeCodeDataVo);
}
@GetMapping("/showInventorySourcePackageCode") @GetMapping("/showInventorySourcePackageCode")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)

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

@ -222,6 +222,13 @@ public interface IDistributionStockListService extends BaseService<DistributionS
**/ **/
DistributionStockListEntity findStockListByAttrAndWarehouseId(DistributionStockListEntity stockListEntity); DistributionStockListEntity findStockListByAttrAndWarehouseId(DistributionStockListEntity stockListEntity);
/**
* 批量查看库存品二维码
* @param orderPackgeCodes
* @return
*/
OrderPackgeCodeDataVO showInvnetoryPackgeCodes(String orderPackgeCodes);
// /** // /**
// * 查询库存品详情 // * 查询库存品详情

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

@ -147,7 +147,6 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
private ITrunklinePackageTrackLogClient trunklinePackageTrackLogClient; private ITrunklinePackageTrackLogClient trunklinePackageTrackLogClient;
@Override @Override
public IPage<DistributionStockListVO> selectDistributionStockListPage(IPage<DistributionStockListVO> page, DistributionStockListVO distributionStockList) { public IPage<DistributionStockListVO> selectDistributionStockListPage(IPage<DistributionStockListVO> page, DistributionStockListVO distributionStockList) {
return page.setRecords(baseMapper.selectDistributionStockListPage(page, distributionStockList)); return page.setRecords(baseMapper.selectDistributionStockListPage(page, distributionStockList));
@ -192,7 +191,6 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
List<DistributionStockListEntity> distributionStockListEntities = baseMapper.exportDistributionStockList(queryWrapper); List<DistributionStockListEntity> distributionStockListEntities = baseMapper.exportDistributionStockList(queryWrapper);
List<DistributionStockListExcel> excelList = new ArrayList<>(); List<DistributionStockListExcel> excelList = new ArrayList<>();
distributionStockListEntities.forEach(stockList -> { distributionStockListEntities.forEach(stockList -> {
// stockList.setServiceType(DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, stockList.getServiceType())); // stockList.setServiceType(DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, stockList.getServiceType()));
@ -308,6 +306,76 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
return null; return null;
} }
@Override
public OrderPackgeCodeDataVO showInvnetoryPackgeCodes(String orderPackgeCodes) {
OrderPackgeCodeDataVO orderPackgeCodeDataVO = new OrderPackgeCodeDataVO();
List<Map> data = new ArrayList<>();
BasicPrintTemplateEntity template = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.daiqueren_11.getValue());
if (ObjectUtil.isEmpty(template)) {
throw new CustomerException("模板内容未找到");
}
if (orderPackgeCodes.isEmpty()) {
throw new CustomerException("模板内容未找到");
}
String[] packageCodes = orderPackgeCodes.split(",");
String html = null;
try {
html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl());
orderPackgeCodeDataVO.setTemplateHtml(html);
orderPackgeCodeDataVO.setTemplateId(template.getId());
for (String packageCode : packageCodes) {
//查询库存品包件
LambdaQueryWrapper<DisStockListDetailEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(DisStockListDetailEntity::getStockPackageCode, packageCode);
DisStockListDetailEntity disStockListDetail = disStockListDetailService.getOne(wrapper);
if (Func.isEmpty(disStockListDetail)) {
log.error("##################查询库存品包件失败 packageCode:{}", packageCode);
throw new ServiceException("库存品包件查询失败");
}
//查询库存品信息
DistributionStockListEntity stockListEntity = this.getById(disStockListDetail.getStockListId());
if (Func.isEmpty(stockListEntity)) {
log.info("##############查询ID:{}", disStockListDetail.getStockListId());
throw new ServiceException("查询库存品信息失败");
}
DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(disStockListDetail.getReservationId());
if (Func.isEmpty(distributionReservationEntity)) {
log.info("##############查询ID:{}", distributionReservationEntity);
throw new ServiceException("查询库存品信息失败");
}
Map<String, Object> map = JSONObject.parseObject(JSONObject.toJSONString(stockListEntity), Map.class);
map.put("id", disStockListDetail.getId());
map.put("customerName", distributionReservationEntity.getConsignee());
map.put("customerTelephone", distributionReservationEntity.getDeliveryPhone());
map.put("customerAddress", distributionReservationEntity.getDeliveryAddress());
map.put("shipperName", " ");
map.put("shipperAddress", " ");
map.put("stockPackageCode", disStockListDetail.getStockPackageCode());
String filename = QRCodeUtil.createCodeToFile(disStockListDetail.getStockPackageCode());
map.put("img", QRCodeUtil.getEmpAutograph(filename));
if (Func.isNotEmpty(stockListEntity.getOrderCode())) {
String fileTypeName = QRCodeUtil.createCodeToFile(stockListEntity.getOrderCode());
map.put("imgType", QRCodeUtil.getEmpAutograph(fileTypeName));
}
data.add(map);
}
orderPackgeCodeDataVO.setDataList(data);
return orderPackgeCodeDataVO;
} catch (Exception e) {
throw new CustomerException(e.getMessage());
}
}
@Override @Override
public void importUser(List<DistributionStockListExcel> data, Boolean isCovered) { public void importUser(List<DistributionStockListExcel> data, Boolean isCovered) {
@ -344,7 +412,6 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
} }
/** /**
*
* @param distributionStockListDTO * @param distributionStockListDTO
*/ */
@Override @Override
@ -397,8 +464,6 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
if (Func.isNotEmpty(one2)) { if (Func.isNotEmpty(one2)) {
//查询是否存在有拆包产物 //查询是否存在有拆包产物
//存在则是进行数量的累加 //存在则是进行数量的累加
//有修改 //有修改
@ -521,9 +586,6 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
} }
// //不存在拆包产物 // //不存在拆包产物
// //添加新的库存品信息 // //添加新的库存品信息
// list = this.list(Wrappers.<DistributionStockListEntity>query().lambda() // list = this.list(Wrappers.<DistributionStockListEntity>query().lambda()
@ -627,6 +689,7 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
/** /**
* 查询客户信息 * 查询客户信息
*
* @param * @param
* @param distributionStockListEntity * @param distributionStockListEntity
* @return * @return
@ -671,6 +734,7 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
/** /**
* 添加 * 添加
*
* @param distributionStockList * @param distributionStockList
* @return * @return
*/ */
@ -728,7 +792,6 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
} }
/** /**
*
* @param reservationId * @param reservationId
* @param stockListId * @param stockListId
* @return * @return
@ -824,7 +887,6 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
} }
/** /**
*
* @param distributionStockListEntity * @param distributionStockListEntity
* @return * @return
*/ */
@ -841,8 +903,6 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
return baseMapper.selectStockInforByOrderPackageCode(orderPackageCode); return baseMapper.selectStockInforByOrderPackageCode(orderPackageCode);
} }
@Override @Override
@ -1140,8 +1200,6 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
} }
return distributionMerchantStockListVOS; return distributionMerchantStockListVOS;
} }
@ -1207,8 +1265,6 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
.in(DistributionParcelListEntity::getId, packageIds); .in(DistributionParcelListEntity::getId, packageIds);
//清理包件的物料信息 //清理包件的物料信息
boolean update = distributionParcelListService.update(up); boolean update = distributionParcelListService.update(up);
//维护订单信息 //维护订单信息
@ -1237,7 +1293,6 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
} }
private JSONObject handleLogJSONObject(BasicdataWarehouseEntity warehouse, BladeUser user, String orderPackageCode, String content, Integer node) { private JSONObject handleLogJSONObject(BasicdataWarehouseEntity warehouse, BladeUser user, String orderPackageCode, String content, Integer node) {
JSONObject trunklinePackageTrackLog = new JSONObject(); JSONObject trunklinePackageTrackLog = new JSONObject();
trunklinePackageTrackLog.put("tenantId", user.getTenantId()); trunklinePackageTrackLog.put("tenantId", user.getTenantId());

Loading…
Cancel
Save