Browse Source

Merge remote-tracking branch 'origin/dev' into dev

training
caoyizhong 2 years ago
parent
commit
f1fe5b3180
  1. 56
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/entity/FactoryPackageDetailEntity.java
  2. 9
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/FactoryPackageDetailMapper.java
  3. 7
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/IFactoryPackageDetailService.java
  4. 13
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/FactoryPackageDetailServiceImpl.java
  5. 53
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java

56
blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/entity/FactoryPackageDetailEntity.java

@ -0,0 +1,56 @@
package com.logpm.factory.oupai.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
@Data
@TableName("op_factory_package_detail")
@ApiModel(value = "FactoryPackageDetail对象", description = "欧派工厂物料表")
@EqualsAndHashCode(callSuper = true)
public class FactoryPackageDetailEntity extends BaseEntity {
/** 预留1 */
@ApiModelProperty(name = "预留1",notes = "")
private String reserve1 ;
/** 预留2 */
@ApiModelProperty(name = "预留2",notes = "")
private String reserve2 ;
/** 预留3 */
@ApiModelProperty(name = "预留3",notes = "")
private String reserve3 ;
/** 预留4 */
@ApiModelProperty(name = "预留4",notes = "")
private String reserve4 ;
/** 预留5 */
@ApiModelProperty(name = "预留5",notes = "")
private String reserve5 ;
/** 包件id */
@ApiModelProperty(name = "包件id",notes = "")
private Long packageId ;
/** 物料编码 */
@ApiModelProperty(name = "物料编码",notes = "")
private String code ;
/** 物料名称 */
@ApiModelProperty(name = "物料名称",notes = "")
private String name ;
/** 物料规格 */
@ApiModelProperty(name = "物料规格",notes = "")
private String type ;
/** 物料单位 */
@ApiModelProperty(name = "物料单位",notes = "")
private String unit ;
/** 原物料编码 */
@ApiModelProperty(name = "原物料编码",notes = "")
private String orgCode ;
}

9
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/FactoryPackageDetailMapper.java

@ -0,0 +1,9 @@
package com.logpm.factory.oupai.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factory.oupai.entity.FactoryPackageDetailEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface FactoryPackageDetailMapper extends BaseMapper<FactoryPackageDetailEntity> {
}

7
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/IFactoryPackageDetailService.java

@ -0,0 +1,7 @@
package com.logpm.factory.oupai.service;
import com.logpm.factory.oupai.entity.FactoryPackageDetailEntity;
import org.springblade.core.mp.base.BaseService;
public interface IFactoryPackageDetailService extends BaseService<FactoryPackageDetailEntity> {
}

13
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/FactoryPackageDetailServiceImpl.java

@ -0,0 +1,13 @@
package com.logpm.factory.oupai.service.impl;
import com.logpm.factory.oupai.entity.FactoryPackageDetailEntity;
import com.logpm.factory.oupai.mapper.FactoryPackageDetailMapper;
import com.logpm.factory.oupai.service.IFactoryPackageDetailService;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@Service
@AllArgsConstructor
public class FactoryPackageDetailServiceImpl extends BaseServiceImpl<FactoryPackageDetailMapper,FactoryPackageDetailEntity> implements IFactoryPackageDetailService {
}

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

@ -6,15 +6,9 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.logpm.factory.oupai.entity.FactoryOrderEntity; import com.logpm.factory.oupai.entity.*;
import com.logpm.factory.oupai.entity.FactoryPackageEntity;
import com.logpm.factory.oupai.entity.OpOrderStatusLogEntity;
import com.logpm.factory.oupai.entity.ReceivingOrderEntity;
import com.logpm.factory.oupai.mapper.ReceivingOrderMapper; import com.logpm.factory.oupai.mapper.ReceivingOrderMapper;
import com.logpm.factory.oupai.service.IFactoryOrderService; import com.logpm.factory.oupai.service.*;
import com.logpm.factory.oupai.service.IFactoryPackageService;
import com.logpm.factory.oupai.service.IOpOrderStatusLogService;
import com.logpm.factory.oupai.service.IOuPaiFactoryService;
import com.logpm.factory.props.OuPaiProperties; import com.logpm.factory.props.OuPaiProperties;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException; import org.springblade.common.exception.CustomerException;
@ -43,6 +37,9 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
@Autowired @Autowired
private IOpOrderStatusLogService opOrderStatusLogService; private IOpOrderStatusLogService opOrderStatusLogService;
@Autowired
private IFactoryPackageDetailService factoryPackageDetailService;
@Override @Override
public String saveOuPaiFactoryOrderDTOByCarCarNumber(String carNumber) { public String saveOuPaiFactoryOrderDTOByCarCarNumber(String carNumber) {
@ -204,7 +201,11 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
factoryOrderEntity.setReservationStatus(1); factoryOrderEntity.setReservationStatus(1);
} }
factoryOrderEntity.setStoreName("");//TODO 没有找到门店字段 JSONObject store = orderEntity.getJSONObject("Store");
if(!Objects.isNull(store)){
factoryOrderEntity.setStoreCode(store.getString("Code"));
factoryOrderEntity.setStoreName(store.getString("Name"));
}
factoryOrderEntity.setMatingCode(orderEntity.getString("MatingCode")); factoryOrderEntity.setMatingCode(orderEntity.getString("MatingCode"));
Boolean isMating = orderEntity.getBoolean("IsMating"); Boolean isMating = orderEntity.getBoolean("IsMating");
@ -325,11 +326,30 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
} else { } else {
factoryPackageEntity.setFreeze(0); factoryPackageEntity.setFreeze(0);
} }
//保存包件信息 //保存包件信息
factoryPackageEntity.setReceiptStatus(0); factoryPackageEntity.setReceiptStatus(0);
factoryPackageEntity.setPushStatus(0); factoryPackageEntity.setPushStatus(0);
factoryPackageEntity.setTurnStatus(0); factoryPackageEntity.setTurnStatus(0);
factoryPackageService.save(factoryPackageEntity); boolean save = factoryPackageService.save(factoryPackageEntity);
if(save){
Long packageId = factoryPackageEntity.getId();
//保存物料信息
JSONArray packageDetails = packageEntity.getJSONArray("PackageDetails");
if(!Objects.isNull(packageDetails)){
for (int k = 0; k < packageDetails.size(); k++) {
JSONObject packageDetailsJSONObject = packageDetails.getJSONObject(k);
FactoryPackageDetailEntity factoryPackageDetailEntity = new FactoryPackageDetailEntity();
factoryPackageDetailEntity.setPackageId(packageId);
factoryPackageDetailEntity.setCode(packageDetailsJSONObject.getString("Code"));
factoryPackageDetailEntity.setName(packageDetailsJSONObject.getString("Name"));
factoryPackageDetailEntity.setType(packageDetailsJSONObject.getString("Type"));
factoryPackageDetailEntity.setUnit(packageDetailsJSONObject.getString("Unit"));
factoryPackageDetailEntity.setOrgCode(packageDetailsJSONObject.getString("OrgCode"));
factoryPackageDetailService.save(factoryPackageDetailEntity);
}
}
}
} else { } else {
log.warn("############handleData: 包件码已存在 packageCode={}", packageCode); log.warn("############handleData: 包件码已存在 packageCode={}", packageCode);
throw new CustomerException(403, "包件码已存在"); throw new CustomerException(403, "包件码已存在");
@ -357,11 +377,16 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
*/ */
private OpOrderStatusLogEntity findOurPaiDataByCarNumber(String carNumber) { private OpOrderStatusLogEntity findOurPaiDataByCarNumber(String carNumber) {
String url = ouPaiProperties.getUri() + "tims_odata_api/api/odata/ReceivingOrder?$filter=CarNumber eq '" + carNumber + "'&select=Code,Type,Status,Plate,PlateNum,CarNumber,CarrierCode,PackagesCount,ReceivePackageCount,SendTime,ArrivalTime,ReceiveTime,CreateTime,ReturnNumber\n" + String url = ouPaiProperties.getUri() + "tims_odata_api/api/odata/ReceivingOrder?$filter=CarNumber eq '"+carNumber+"'&select=Code,Type,Status,Plate,PackagesCount,ReceivePackageCount,PlateNum,CarNumber,CarrierCode,SendTime,ArrivalTime,ReceiveTime,CreateTime,ReturnNumber\n" +
"&$expand=Packages($select=Code,PdaNumber,FirstClassCode,FirstClassName,SecondClassCode,SecondClassName,ThirdClassCode,ThirdClassName,BuyIn,CosourcingCode,CosourcingUnit,SortingCenter,DistributionCenter,Length,Width,Height,Weight,PackageDetails,OrderDetail,Order,PathIndex,PathDetail,DeliveryOrders,ReceivingOrders,LPN,LpnSerialNum,IsEntruck,ReservationOrder,OutGoingOrderDetail,SignBill,IsInventory,Inventories,InventoryInDetails,Freeze,OutGoingOrderDetailInventoryDetail,From,Creator,CreateTime,ShipTime,CarNumber,DeliveryMethod,DeliveryReceiver,DeliveryReceiverPhone,ReturnNumber,GroupType,CarrierCode,CarrierName,PackageDetailNames,ReceivingTime,SendTime,ExceptionSignRemark,Descript,SignTime,OutOrder,IsReceiveByHand,PackageStatus;\n" + "&$expand=" +
"Packages($select=Code,PdaNumber,FirstClassCode,FirstClassName,SecondClassCode,SecondClassName,ThirdClassCode,ThirdClassName,BuyIn,CosourcingCode,CosourcingUnit,SortingCenter,DistributionCenter,Length,Width,Height,Weight,OrderDetail,Order,PathIndex,PathDetail,DeliveryOrders,ReceivingOrders,LPN,LpnSerialNum,IsEntruck,ReservationOrder,OutGoingOrderDetail,SignBill,IsInventory,Inventories,InventoryInDetails,Freeze,OutGoingOrderDetailInventoryDetail,From,Creator,CreateTime,ShipTime,CarNumber,DeliveryMethod,DeliveryReceiver,DeliveryReceiverPhone,ReturnNumber,GroupType,CarrierCode,CarrierName,PackageDetailNames,ReceivingTime,SendTime,ExceptionSignRemark,Descript,SignTime,OutOrder,IsReceiveByHand,PackageStatus,PackageDetailNames;" +
"$expand=Order($select=" + "$expand=Order($select=" +
"Code,SelfCode,ContractNumber,ServiceNumber,OrderClass,OrderType,Status,FactoryShipStatus,FactorySendQty,WarehouseReceiveStatus,WarehouseReceiveQty,ReservationStatus,Store,MatingCode,IsMating,FirstClassCode,Leave,Customer,Province,City,CustomerAddress,CustomerPhone,ShopReceiver,BrandCode,BrandName,From,OutGoingTime,CreateTime,Freeze,FirstShipTime,MatingShipTime,FirstReceiveTime,MatingReceiveTime\n" + "Code,SelfCode,ContractNumber,ServiceNumber,OrderClass,OrderType,Status,FactoryShipStatus,FactorySendQty,WarehouseReceiveStatus,WarehouseReceiveQty,ReservationStatus,Store,MatingCode,IsMating,FirstClassCode,Leave,Customer,Province,City,CustomerAddress,CustomerPhone,ShopReceiver,BrandCode,BrandName,From,OutGoingTime,CreateTime,Freeze,FirstShipTime,MatingShipTime,FirstReceiveTime,MatingReceiveTime;\n" +
"))&$expand=FromWarehouse($select=Name,Code)&$expand=CurrentWarehouse($select=Name,Code)&$expand=EndWarehouse($select=Name,Code)"; "$expand=Store($select=Name,Code))" +
"&$expand=PackageDetails($select=Code,Name,OrgCode,OrgCode)" +
"&$expand=CurrentWarehouse($select=Name,Code)" +
"&$expand=SendWarehouse($select=Name,Code)" +
")&$expand=FromWarehouse($select=Name,Code)&$expand=CurrentWarehouse($select=Name,Code)&$expand=EndWarehouse($select=Name,Code)";
log.info(">>> findOurPaiDataByCarNumber url {}", url); log.info(">>> findOurPaiDataByCarNumber url {}", url);

Loading…
Cancel
Save