Browse Source

Merge branch 'pre-production'

newStockUp
pref_mail@163.com 1 year ago
parent
commit
97517a605b
  1. 22
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java
  2. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java
  3. 4
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/UnloadCarComHandler.java
  4. 10
      blade-service/logpm-factory/src/main/java/com/logpm/factory/zb/controller/ZbFactoryDataController.java
  5. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseGoodsAllocationMapper.java
  6. 12
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseGoodsAllocationMapper.xml
  7. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseGoodsAllocationServiceImpl.java
  8. 9
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

22
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java

@ -862,19 +862,19 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
} }
/** /**
* 获取订单对象 加入了缓存 * 获取订单缓存对象
* * @param receiptId 收货任务ID
* @param orderSelfNum * @param orderSelfNum 订单自编号
* @param departCode 发车单号
* @return * @return
*/ */
private AdvanceEntity findAdvanceEntityUseCacheByOrderSelfNumAndReceiptId(Long receiptId,String orderSelfNum,String departCode) { private AdvanceEntity findAdvanceEntityUseCacheByOrderSelfNumAndReceiptId(Long receiptId,String orderSelfNum,String departCode) {
String key = AdvanceEntity.class.getName() + ":"+receiptId + orderSelfNum + ":" + departCode; String key = AdvanceEntity.class.getName() + ":"+receiptId + orderSelfNum + ":" + departCode;
AdvanceEntity advanceEntity = bladeRedis.get(key); // if (ObjectUtils.isNull(advanceEntity)) {
// if (ObjectUtils.isNull(advanceEntity)) {
//// advanceEntity = iAdvanceClient.getEntityByMctsTruck(orderSelfNum,departCode); //// advanceEntity = iAdvanceClient.getEntityByMctsTruck(orderSelfNum,departCode);
//// bladeRedis.setEx(key, advanceEntity, 12 * 60 * 60L); //// bladeRedis.setEx(key, advanceEntity, 12 * 60 * 60L);
// } // }
return advanceEntity; return bladeRedis.get(key);
} }
private AdvanceEntity saveAdvanceInfor(ZbOrderPackageEntity serviceNumEntity, List<ZbOrderPackageEntity> zbOrderPackageEntityList) { private AdvanceEntity saveAdvanceInfor(ZbOrderPackageEntity serviceNumEntity, List<ZbOrderPackageEntity> zbOrderPackageEntityList) {
@ -884,7 +884,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
// 查询订单对应的发货单 // 查询订单对应的发货单
ZbReceiptEntity zbReceiptEntity = findZbReceiptEntityUseCacheById(serviceNumEntity.getReceiptId()); ZbReceiptEntity zbReceiptEntity = findZbReceiptEntityUseCacheById(serviceNumEntity.getReceiptId());
AdvanceEntity advanceEntity = findAdvanceEntityUseCacheByOrderSelfNumAndReceiptId(serviceNumEntity.getReceiptId(),serviceNumEntity.getRelationOrderCode(),zbReceiptEntity.getDepartCode()); AdvanceEntity advanceEntity = findAdvanceEntityUseCacheByOrderSelfNumAndReceiptId(serviceNumEntity.getReceiptId(),serviceNumEntity.getPlatformOrderCode(),zbReceiptEntity.getDepartCode());
if (ObjectUtils.isNotNull(advanceEntity)) { if (ObjectUtils.isNotNull(advanceEntity)) {
return advanceEntity; return advanceEntity;
} }
@ -893,13 +893,13 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
//添加订单信息 //添加订单信息
advanceEntity = new AdvanceEntity(); advanceEntity = new AdvanceEntity();
advanceEntity.setOrderSelfNum(StringUtil.isBlank(serviceNumEntity.getRelationOrderCode()) ? "" : serviceNumEntity.getRelationOrderCode()); //订单自编号 advanceEntity.setOrderSelfNum(StringUtil.isBlank(serviceNumEntity.getPlatformOrderCode()) ? "" : serviceNumEntity.getPlatformOrderCode()); //订单自编号
advanceEntity.setSiteName(""); // 基地 advanceEntity.setSiteName(""); // 基地
advanceEntity.setArea(""); // 区域 advanceEntity.setArea(""); // 区域
advanceEntity.setOrderTypeName(zbReceiptEntity.getOrderType()); //订单类型名称 可以为空 advanceEntity.setOrderTypeName(zbReceiptEntity.getOrderType()); //订单类型名称 可以为空
advanceEntity.setOrderClassName("工厂"); //订单类型 可以为空 advanceEntity.setOrderClassName("工厂"); //订单类型 可以为空
advanceEntity.setType(FactoryConstant.ZHIBANG); advanceEntity.setType(FactoryConstant.ZHIBANG);
int num = mathTotalOrderPackageNum(serviceNumEntity.getRelationOrderCode(), zbOrderPackageEntityList); int num = mathTotalOrderPackageNum(serviceNumEntity.getPlatformOrderCode(), zbOrderPackageEntityList);
advanceEntity.setTotal(num); //订单总数据 advanceEntity.setTotal(num); //订单总数据
advanceEntity.setMctsTruck(StringUtil.isBlank(zbReceiptEntity.getDepartCode()) ? "" : zbReceiptEntity.getDepartCode()); //车次 advanceEntity.setMctsTruck(StringUtil.isBlank(zbReceiptEntity.getDepartCode()) ? "" : zbReceiptEntity.getDepartCode()); //车次
advanceEntity.setMctsTruckNo(zbReceiptEntity.getCarNumber()); advanceEntity.setMctsTruckNo(zbReceiptEntity.getCarNumber());
@ -919,7 +919,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceEntity.setStoreNo(StringUtil.isBlank(serviceNumEntity.getCustomerCode()) ? "" : serviceNumEntity.getCustomerCode()); //门店编码 advanceEntity.setStoreNo(StringUtil.isBlank(serviceNumEntity.getCustomerCode()) ? "" : serviceNumEntity.getCustomerCode()); //门店编码
advanceEntity.setStoreName(serviceNumEntity.getCustomerName()); //门店名称 advanceEntity.setStoreName(serviceNumEntity.getCustomerName()); //门店名称
advanceEntity.setSerialKey(""); //序列号 advanceEntity.setSerialKey(""); //序列号
advanceEntity.setServiceNum(StringUtil.isBlank(serviceNumEntity.getPlatformOrderCode()) ? "" : serviceNumEntity.getPlatformOrderCode()); //服务号 advanceEntity.setServiceNum(StringUtil.isBlank(serviceNumEntity.getRelationOrderCode()) ? "" : serviceNumEntity.getRelationOrderCode()); //服务号
advanceEntity.setMatingCode("");//齐套模式 可以为空 advanceEntity.setMatingCode("");//齐套模式 可以为空
advanceEntity.setContractNum("");//合同号 可以为空 advanceEntity.setContractNum("");//合同号 可以为空
advanceEntity.setLeaveBehind(serviceNumEntity.getLegacyFlag());//遗留:Y=是,N=否 advanceEntity.setLeaveBehind(serviceNumEntity.getLegacyFlag());//遗留:Y=是,N=否
@ -962,7 +962,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
private int mathTotalOrderPackageNum(String orderNum, List<ZbOrderPackageEntity> zbOrderPackageEntityList) { private int mathTotalOrderPackageNum(String orderNum, List<ZbOrderPackageEntity> zbOrderPackageEntityList) {
int totalPackageNum = 0; int totalPackageNum = 0;
for (ZbOrderPackageEntity entity : zbOrderPackageEntityList) { for (ZbOrderPackageEntity entity : zbOrderPackageEntityList) {
if (entity.getRelationOrderCode().equals(orderNum)) { if (entity.getPlatformOrderCode().equals(orderNum)) {
totalPackageNum++; totalPackageNum++;
} }
} }

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java

@ -147,7 +147,7 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
if (Objects.isNull(packageEntity)) { if (Objects.isNull(packageEntity)) {
log.warn("############oid 查询数据失败: {}", key); log.warn("############oid 查询数据失败: {}", key);
// 查询欧派系统的的数据 // 查询欧派系统的的数据
String url = ouPaiProperties.getUri() + "tims_odata_api/api/odata/Package(" + key + ")?select=Code,PackageStatus,FirstClassCode,FirstClassName,SecondClassCode,SecondClassName,ThirdClassCode,ThirdClassName,BuyIn,CosourcingCode,CosourcingUnit,Length,Width,Height,Weight,IsInventory,SendTime,ReceivingTime,CreateTime,ShipTime,CarNumber,DeliveryMethod&$expand=ReceivingOrders($select=Code,Type,Status,Plate,PackagesCount,ReceivePackageCount,PlateNum,CarNumber,CarrierCode,SendTime,ArrivalTime,ReceiveTime,CreateTime,ReturnNumber;$expand=EndWarehouse($select=Name,Code))&$expand=Order($select=SelfCode,Code)"; String url = ouPaiProperties.getUri() + "tims_odata_api/api/odata/Package(" + key + ")?select=Code,PackageStatus,FirstClassCode,FirstClassName,SecondClassCode,SecondClassName,ThirdClassCode,ThirdClassName,BuyIn,CosourcingCode,CosourcingUnit,Length,Width,Height,Weight,IsInventory,SendTime,ReceivingTime,CreateTime,ShipTime,CarNumber,DeliveryMethod&$expand=ReceivingOrders($select=Code,Type,Status,Plate,PackagesCount,ReceivePackageCount,PlateNum,CarNumber,CarrierCode,SendTime,ArrivalTime,ReceiveTime,CreateTime,ReturnNumber;$expand=EndWarehouse($select=Name,Code)&$expand=FromWarehouse($select=Name,Code)&$expand=CurrentWarehouse($select=Name,Code))&$expand=Order($select=SelfCode,Code)";
OpOrderStatusLogEntity opOrderStatusLogEntity = sendRequestData(url, event); OpOrderStatusLogEntity opOrderStatusLogEntity = sendRequestData(url, event);
JSONObject jsonObject = JSONObject.parseObject(opOrderStatusLogEntity.getResponseBody()); JSONObject jsonObject = JSONObject.parseObject(opOrderStatusLogEntity.getResponseBody());

4
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/UnloadCarComHandler.java

@ -112,8 +112,8 @@ public class UnloadCarComHandler {
/** /**
* 根基匹配到的发货单编号 推送梦天 * 根基匹配到的发货单编号 推送梦天
* *
* @param carNum * @param carNum 车次号
* @param completeDate * @param completeDate 完成时间
* @throws ParseException * @throws ParseException
* @throws NoSuchAlgorithmException * @throws NoSuchAlgorithmException
* @throws JsonProcessingException * @throws JsonProcessingException

10
blade-service/logpm-factory/src/main/java/com/logpm/factory/zb/controller/ZbFactoryDataController.java

@ -30,6 +30,7 @@ import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.nio.file.Files;
import java.util.Objects; import java.util.Objects;
/** /**
@ -94,10 +95,6 @@ public class ZbFactoryDataController {
zbFactoryLogService.save(zbFactoryLogEntity); zbFactoryLogService.save(zbFactoryLogEntity);
// orderStatusLogService.save(orderStatusLog); // orderStatusLogService.save(orderStatusLog);
// //判断数据是否已存入 // //判断数据是否已存入
@ -149,8 +146,9 @@ public class ZbFactoryDataController {
, MediaType.MULTIPART_FORM_DATA_VALUE , MediaType.MULTIPART_FORM_DATA_VALUE
, true , true
, file.getName()); , file.getName());
try (InputStream input = new FileInputStream(file); try (
OutputStream os = item.getOutputStream()) { InputStream input = Files.newInputStream(file.toPath());
OutputStream os = item.getOutputStream()) {
// 流转移 // 流转移
IOUtils.copy(input, os); IOUtils.copy(input, os);
} catch (Exception e) { } catch (Exception e) {

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseGoodsAllocationMapper.java

@ -167,4 +167,6 @@ public interface WarehouseGoodsAllocationMapper extends BaseMapper<WarehouseGood
List<Long> selectIsStocking(@Param("allocationId") Long allocationId); List<Long> selectIsStocking(@Param("allocationId") Long allocationId);
Integer selectOrderNum(@Param("id") Long id);
} }

12
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseGoodsAllocationMapper.xml

@ -19,8 +19,7 @@
FROM logpm_warehouse_goods_allocation ${ew.customSqlSegment} FROM logpm_warehouse_goods_allocation ${ew.customSqlSegment}
</select> </select>
<select id="selectnum" resultType="com.logpm.warehouse.vo.WarehouseGoodsAllocationVO"> <select id="selectnum" resultType="com.logpm.warehouse.vo.WarehouseGoodsAllocationVO">
SELECT COALESCE(SUM(CASE WHEN association_type = '1' THEN num END), 0) orderNum, SELECT COALESCE(SUM(CASE WHEN association_type = '1' THEN num END), 0) lessNum,
COALESCE(SUM(CASE WHEN association_type = '2' THEN num END), 0) lessNum,
COALESCE(SUM(CASE WHEN association_type = '3' THEN num END), 0) packageNum, COALESCE(SUM(CASE WHEN association_type = '3' THEN num END), 0) packageNum,
COALESCE(SUM(CASE WHEN association_type = '4' THEN num END), 0) inventoryNum COALESCE(SUM(CASE WHEN association_type = '4' THEN num END), 0) inventoryNum
FROM logpm_warehouse_updown_goods FROM logpm_warehouse_updown_goods
@ -362,6 +361,15 @@
SELECT lwgaa.id FROM logpm_warehouse_goods_allocation lwgaa join logpm_warehouse_goods_area lwga on lwgaa.goods_area_id =lwga.id WHERE SELECT lwgaa.id FROM logpm_warehouse_goods_allocation lwgaa join logpm_warehouse_goods_area lwga on lwgaa.goods_area_id =lwga.id WHERE
lwgaa.id = #{allocationId} and lwgaa.is_deleted = 0 and lwga.area_type ='1' lwgaa.id = #{allocationId} and lwgaa.is_deleted = 0 and lwga.area_type ='1'
</select> </select>
<select id="selectOrderNum" resultType="java.lang.Integer">
SELECT COALESCE
( count( DISTINCT ldpl.stock_article_id), 0 )
FROM
logpm_warehouse_updown_goods lwug
JOIN logpm_distribution_parcel_list ldpl ON lwug.association_id = ldpl.id
where lwug.allocation_id = #{id}
and lwug.is_deleted = 0
</select>
</mapper> </mapper>

4
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseGoodsAllocationServiceImpl.java

@ -398,7 +398,9 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
Func.copy(warehouseGoodsAllocationEntity,warehouseGoodsAllocationVO); Func.copy(warehouseGoodsAllocationEntity,warehouseGoodsAllocationVO);
//查询数量 //查询数量
WarehouseGoodsAllocationVO warehouseGoodsAllocationVOData = baseMapper.selectnum(warehouseGoodsAllocationEntity.getId()); WarehouseGoodsAllocationVO warehouseGoodsAllocationVOData = baseMapper.selectnum(warehouseGoodsAllocationEntity.getId());
warehouseGoodsAllocationVO.setOrderNum(warehouseGoodsAllocationVOData.getOrderNum()); //查询订单数量
Integer i = baseMapper.selectOrderNum(warehouseGoodsAllocationEntity.getId());
warehouseGoodsAllocationVO.setOrderNum(i);
warehouseGoodsAllocationVO.setInventoryNum(warehouseGoodsAllocationVOData.getInventoryNum()); warehouseGoodsAllocationVO.setInventoryNum(warehouseGoodsAllocationVOData.getInventoryNum());
warehouseGoodsAllocationVO.setLessNum(warehouseGoodsAllocationVOData.getLessNum()); warehouseGoodsAllocationVO.setLessNum(warehouseGoodsAllocationVOData.getLessNum());
warehouseGoodsAllocationVO.setPackageNum(warehouseGoodsAllocationVOData.getPackageNum()); warehouseGoodsAllocationVO.setPackageNum(warehouseGoodsAllocationVOData.getPackageNum());

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

@ -184,11 +184,9 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
distributionStockArticleEntity.setBrand(warehouseWaybill.getBrand()); distributionStockArticleEntity.setBrand(warehouseWaybill.getBrand());
distributionStockArticleEntity.setResource("零担"); distributionStockArticleEntity.setResource("零担");
if (!Objects.isNull(basicdataWarehouseEntity)) { distributionStockArticleEntity.setCreateDept(Objects.isNull(basicdataWarehouseEntity.getDepartment()) ? null : basicdataWarehouseEntity.getDepartment());
distributionStockArticleEntity.setCreateDept(Objects.isNull(basicdataWarehouseEntity.getDepartment()) ? null : basicdataWarehouseEntity.getDepartment());
}
String customerName = warehouseWaybill.getConsignee();//客户名称 String customerName = warehouseWaybill.getConsignee();//客户名称
//通过客户名称去查询客户的服务类型、 //通过客户名称去查询客户的服务类型、
distributionStockArticleEntity.setTypeService("1");//默认商配 distributionStockArticleEntity.setTypeService("1");//默认商配
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findByName(customerName); BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findByName(customerName);
@ -313,8 +311,7 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
public WarehouseWaybillEntity findByWaybillNo(String waybillNo) { public WarehouseWaybillEntity findByWaybillNo(String waybillNo) {
QueryWrapper<WarehouseWaybillEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<WarehouseWaybillEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("waybill_no", waybillNo); queryWrapper.eq("waybill_no", waybillNo);
WarehouseWaybillEntity warehouseWaybillEntity = warehouseWaybillMapper.selectOne(queryWrapper); return warehouseWaybillMapper.selectOne(queryWrapper);
return warehouseWaybillEntity;
} }
@Override @Override

Loading…
Cancel
Save