feat: 同步的行程节点查看和同步时加入供应商规则(系统标识,公司名,差标管控)
This commit is contained in:
parent
4d77602010
commit
79e03e9ca5
|
@ -95,18 +95,20 @@ public class AutoWorkController {
|
||||||
return Result.Success(SUCCESS);
|
return Result.Success(SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("拉取按月份的流水")
|
@ApiOperation("拉取供应商的结算账单")
|
||||||
@PostMapping("/record/pull/month/")
|
@PostMapping("/record/pull")
|
||||||
public Result<String> pullDataFromSupplier(@RequestBody RecordMonthSaveDTO param) {
|
public Result<String> pullDataFromSupplier(@RequestBody RecordMonthSaveDTO param) {
|
||||||
String date = param.getDate();
|
String date = param.getDate();
|
||||||
OrderRecordPuller orderRecordPuller = supplierAdapterSelector
|
OrderRecordPuller orderRecordPuller = supplierAdapterSelector
|
||||||
.of(param.getSupplierName(), OrderRecordPuller.class);
|
.of(param.getSupplierName(), OrderRecordPuller.class);
|
||||||
//将昨天的结算数据生成为财务共享需要的数据
|
//将昨天的结算数据生成为财务共享需要的数据
|
||||||
OrderRecordGenerateCommand command = Command.of(OrderRecordGenerateCommand.class)
|
OrderRecordGenerateCommand command = Command.of(OrderRecordGenerateCommand.class)
|
||||||
.startTime(DateTimeUtil.firstDayOfMonth(date))
|
|
||||||
.endTime(DateTimeUtil.endDayOfMonth(date))
|
|
||||||
.date(date)
|
|
||||||
.supplierName(param.getSupplierName());
|
.supplierName(param.getSupplierName());
|
||||||
|
if (date != null) {
|
||||||
|
command.startTime(DateTimeUtil.firstDayOfMonth(date))
|
||||||
|
.endTime(DateTimeUtil.endDayOfMonth(date))
|
||||||
|
.date(date);
|
||||||
|
}
|
||||||
if (param.getProductType().equals(LEG_TYPE_TRAIN)) {
|
if (param.getProductType().equals(LEG_TYPE_TRAIN)) {
|
||||||
orderRecordPuller.pullTrainOrderRecord(command);
|
orderRecordPuller.pullTrainOrderRecord(command);
|
||||||
}
|
}
|
||||||
|
@ -123,6 +125,15 @@ public class AutoWorkController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @ApiOperation("生成结算数据根据时间参数")
|
||||||
|
// @PostMapping("/record/pull")
|
||||||
|
// public Result<String> generateFromRecord(@RequestBody RecordMonthSaveDTO param) {
|
||||||
|
//
|
||||||
|
// return Result.Success(SUCCESS);
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@ApiOperation("根据月份生成结算记录")
|
@ApiOperation("根据月份生成结算记录")
|
||||||
@PostMapping("/record/save/month")
|
@PostMapping("/record/save/month")
|
||||||
|
|
|
@ -46,6 +46,12 @@ public class RankController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private JdbcRanksStandardLevelRepository jdbcRanksStandardLevelRepository;
|
private JdbcRanksStandardLevelRepository jdbcRanksStandardLevelRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RanksRepository ranksRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RanksFactory ranksFactory;
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation("分页查询等级")
|
@ApiOperation("分页查询等级")
|
||||||
@PostMapping("/pageQuery")
|
@PostMapping("/pageQuery")
|
||||||
|
@ -74,6 +80,21 @@ public class RankController {
|
||||||
return Result.Success(CommonMessageConstant.SUCCESS, jdbcRanksRepository.save(ranks));
|
return Result.Success(CommonMessageConstant.SUCCESS, jdbcRanksRepository.save(ranks));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
@ApiOperation("保存职级和差标映射")
|
||||||
|
@PostMapping("/save/add")
|
||||||
|
public Result<Ranks> saveRanks(@RequestBody RanksData ranksdata) {
|
||||||
|
Ranks ranks = ranksFactory.createRanks(ranksdata);
|
||||||
|
Ranks save = null;
|
||||||
|
try {
|
||||||
|
save = ranksRepository.save(ranks);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new DuplicateException(CommonMessageConstant.DUPLICATE_ERROR);
|
||||||
|
}
|
||||||
|
return Result.Success(CommonMessageConstant.SUCCESS, save);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@ApiOperation("添加差标标准")
|
@ApiOperation("添加差标标准")
|
||||||
@PostMapping("/save/standards")
|
@PostMapping("/save/standards")
|
||||||
|
|
|
@ -92,6 +92,24 @@ public class Leg implements Serializable {
|
||||||
return new Leg(legId);
|
return new Leg(legId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean legIsInternal() {
|
||||||
|
if (this.originLocation != null && !this.originLocation.isInternal()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (this.destinationLocation != null && !this.destinationLocation.isInternal()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (this.legExtensionField != null) {
|
||||||
|
for (Location location : this.legExtensionField.getLocationList()) {
|
||||||
|
if (!location.isInternal()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public Leg queryEstimateAmount(EstimateAdapter estimateAdapter, String supplierName) {
|
public Leg queryEstimateAmount(EstimateAdapter estimateAdapter, String supplierName) {
|
||||||
if (!this.getLegType().equals(LEG_TYPE_OTHER) && !this.getLegType().equals(LEG_TYPE_TAXI)) {
|
if (!this.getLegType().equals(LEG_TYPE_OTHER) && !this.getLegType().equals(LEG_TYPE_TAXI)) {
|
||||||
this.amount = estimateAdapter.of(supplierName).amountEstimate(this);
|
this.amount = estimateAdapter.of(supplierName).amountEstimate(this);
|
||||||
|
|
|
@ -33,4 +33,8 @@ public class Location implements Serializable {
|
||||||
private Long cityId;
|
private Long cityId;
|
||||||
private Integer isHaveAirport;
|
private Integer isHaveAirport;
|
||||||
private Integer locationType;
|
private Integer locationType;
|
||||||
|
|
||||||
|
public boolean isInternal(){
|
||||||
|
return isInternal == 1;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -34,10 +34,26 @@ public class SupplierProduct implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean checkStandardLevelIfInUse(String standardLevel) {
|
public boolean checkStandardLevelIfInUse(String standardLevel) {
|
||||||
return this.getSupplierProductStandardLevelList()
|
return this.supplierProductStandardLevelList
|
||||||
.stream()
|
.stream()
|
||||||
.filter(SupplierProductStandardLevel::inUse)
|
.filter(SupplierProductStandardLevel::inUse)
|
||||||
.map(SupplierProductStandardLevel::getStandardLevelName)
|
.map(SupplierProductStandardLevel::getStandardLevelName)
|
||||||
.anyMatch(it -> it.equals(standardLevel));
|
.anyMatch(it -> it.equals(standardLevel));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean checkSysCodeIfNotUse(String sysCode) {
|
||||||
|
return this.supplierProductSysCodeList
|
||||||
|
.stream()
|
||||||
|
.filter(SupplierProductSysCode::notUse)
|
||||||
|
.map(SupplierProductSysCode::getSystemCode)
|
||||||
|
.anyMatch(it -> it.equals(sysCode));
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean checkCompanyIfNotUse(String companyCode) {
|
||||||
|
return this.supplierProductCompanyList
|
||||||
|
.stream()
|
||||||
|
.filter(SupplierProductCompany::notUse)
|
||||||
|
.map(SupplierProductCompany::getCompanyCode)
|
||||||
|
.anyMatch(it -> it.equals(companyCode));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,4 +22,7 @@ public class SupplierProductCompany implements Serializable {
|
||||||
public boolean inUse() {
|
public boolean inUse() {
|
||||||
return status == 1;
|
return status == 1;
|
||||||
}
|
}
|
||||||
|
public boolean notUse() {
|
||||||
|
return status == 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,4 +23,8 @@ public class SupplierProductStandardLevel implements Serializable {
|
||||||
public boolean inUse() {
|
public boolean inUse() {
|
||||||
return status == 1;
|
return status == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean notUse() {
|
||||||
|
return status == 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,12 @@ public class SupplierProductSysCode implements Serializable {
|
||||||
private String systemCode;
|
private String systemCode;
|
||||||
private Integer status;
|
private Integer status;
|
||||||
private String extension;
|
private String extension;
|
||||||
|
|
||||||
public boolean inUse() {
|
public boolean inUse() {
|
||||||
return status == 1;
|
return status == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean notUse() {
|
||||||
|
return status == 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@ public class RanksFactoryImpl implements RanksFactory {
|
||||||
case STANDARD_LEVEL_WL_CODE -> STANDARD_LEVEL_WL;
|
case STANDARD_LEVEL_WL_CODE -> STANDARD_LEVEL_WL;
|
||||||
case STANDARD_LEVEL_AN_CODE -> STANDARD_LEVEL_AN;
|
case STANDARD_LEVEL_AN_CODE -> STANDARD_LEVEL_AN;
|
||||||
case STANDARD_LEVEL_GY_CODE -> STANDARD_LEVEL_GY;
|
case STANDARD_LEVEL_GY_CODE -> STANDARD_LEVEL_GY;
|
||||||
|
case STANDARD_LEVEL_QC_CODE -> STANDARD_LEVEL_QC;
|
||||||
// case STANDARD_LEVEL_SZKJ_CODE -> STANDARD_LEVEL_SZKJ;
|
// case STANDARD_LEVEL_SZKJ_CODE -> STANDARD_LEVEL_SZKJ;
|
||||||
case STANDARD_LEVEL_SDZN_CODE -> STANDARD_LEVEL_SDZN;
|
case STANDARD_LEVEL_SDZN_CODE -> STANDARD_LEVEL_SDZN;
|
||||||
// case STANDARD_LEVEL_DQXS_CODE -> STANDARD_LEVEL_DQXS;
|
// case STANDARD_LEVEL_DQXS_CODE -> STANDARD_LEVEL_DQXS;
|
||||||
|
|
|
@ -8,5 +8,7 @@ public interface AmapCarOrderRecordRepository {
|
||||||
|
|
||||||
List<AmapCarOrderRecord> saveAll(List<AmapCarOrderRecord> records);
|
List<AmapCarOrderRecord> saveAll(List<AmapCarOrderRecord> records);
|
||||||
|
|
||||||
|
List<AmapCarOrderRecord> findByOrderIds(List<String> orderIds);
|
||||||
|
|
||||||
List<AmapCarOrderRecord> findByDs(String ds);
|
List<AmapCarOrderRecord> findByDs(String ds);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,13 +2,17 @@ package com.chint.domain.service;
|
||||||
|
|
||||||
import com.chint.application.dtos.response.LegRes;
|
import com.chint.application.dtos.response.LegRes;
|
||||||
import com.chint.domain.aggregates.order.*;
|
import com.chint.domain.aggregates.order.*;
|
||||||
|
import com.chint.domain.aggregates.supplier.Supplier;
|
||||||
|
import com.chint.domain.aggregates.supplier.SupplierProduct;
|
||||||
import com.chint.domain.exceptions.LegEventException;
|
import com.chint.domain.exceptions.LegEventException;
|
||||||
import com.chint.domain.factoriy.leg_event.LegEventFactory;
|
import com.chint.domain.factoriy.leg_event.LegEventFactory;
|
||||||
import com.chint.domain.repository.*;
|
import com.chint.domain.repository.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
import static com.chint.infrastructure.constant.CommonMessageConstant.LEG_CHANGE_MAX_ERROR;
|
import static com.chint.infrastructure.constant.CommonMessageConstant.LEG_CHANGE_MAX_ERROR;
|
||||||
import static com.chint.infrastructure.constant.LegConstant.*;
|
import static com.chint.infrastructure.constant.LegConstant.*;
|
||||||
|
@ -90,7 +94,7 @@ public class LegDomainService {
|
||||||
|
|
||||||
public void deleteByLegNo(String legNo) {
|
public void deleteByLegNo(String legNo) {
|
||||||
Leg byLegNo = legRepository.findByLegNo(legNo);
|
Leg byLegNo = legRepository.findByLegNo(legNo);
|
||||||
if(byLegNo == null){
|
if (byLegNo == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RouteOrder routeOrder = routeRepository.queryById(byLegNo.getRouteId()).reloadStatus();
|
RouteOrder routeOrder = routeRepository.queryById(byLegNo.getRouteId()).reloadStatus();
|
||||||
|
@ -131,7 +135,7 @@ public class LegDomainService {
|
||||||
public List<Leg> queryLocation(List<Leg> list) {
|
public List<Leg> queryLocation(List<Leg> list) {
|
||||||
list.forEach(leg -> {
|
list.forEach(leg -> {
|
||||||
LegExtensionField legExtensionField = leg.getLegExtensionField();
|
LegExtensionField legExtensionField = leg.getLegExtensionField();
|
||||||
if (legExtensionField != null && legExtensionField.getLocationIds() != null ) {
|
if (legExtensionField != null && legExtensionField.getLocationIds() != null) {
|
||||||
List<Long> locationIdsAsLong;
|
List<Long> locationIdsAsLong;
|
||||||
if (legExtensionField.getLocationIds().startsWith("[")) {
|
if (legExtensionField.getLocationIds().startsWith("[")) {
|
||||||
locationIdsAsLong = legExtensionField.getLocationIdsAsLongFromArray();
|
locationIdsAsLong = legExtensionField.getLocationIdsAsLongFromArray();
|
||||||
|
@ -168,16 +172,57 @@ public class LegDomainService {
|
||||||
|
|
||||||
public List<Leg> queryLegsCanSync(RouteOrder routeOrder, String supplierName) {
|
public List<Leg> queryLegsCanSync(RouteOrder routeOrder, String supplierName) {
|
||||||
List<Leg> legItems = routeOrder.getLegItems();
|
List<Leg> legItems = routeOrder.getLegItems();
|
||||||
legItems = legItems.stream().filter(it -> !it.getLegType().equals(LEG_TYPE_OTHER)).toList();
|
|
||||||
|
|
||||||
//通过查看供应商的商品类型,来进行同步
|
|
||||||
legItems = supplierDomainService.ifCanSync(legItems, supplierName);
|
|
||||||
|
|
||||||
legItems.forEach(Leg::reloadStatus);
|
|
||||||
queryLocation(legItems);
|
queryLocation(legItems);
|
||||||
|
legItems = legItems.stream()
|
||||||
|
.filter(it -> !it.getLegType().equals(LEG_TYPE_OTHER) && it.legIsInternal())
|
||||||
|
.toList();
|
||||||
|
// 通过查看供应商的商品类型,来进行同步
|
||||||
|
legItems = ifCanSync(legItems, routeOrder, supplierName);
|
||||||
|
legItems.forEach(Leg::reloadStatus);
|
||||||
return legItems;
|
return legItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<Leg> ifCanSync(List<Leg> legs, RouteOrder routeOrder, String supplierName) {
|
||||||
|
return supplierRepository.findBySupplierName(supplierName)
|
||||||
|
.map(supplier -> {
|
||||||
|
List<Integer> productTypes = supplier.getSupplierProductList()
|
||||||
|
.stream()
|
||||||
|
.filter(it -> it.getIfCanOrder().equals(1))
|
||||||
|
.map(SupplierProduct::getProductType)
|
||||||
|
.toList();
|
||||||
|
return legs.stream()
|
||||||
|
.filter(leg -> productTypes.contains(leg.getLegType()) && checkLegCompatibility(leg, routeOrder, supplier))
|
||||||
|
.toList();
|
||||||
|
})
|
||||||
|
.orElse(legs);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean checkLegCompatibility(Leg leg, RouteOrder routeOrder, Supplier supplier) {
|
||||||
|
return switch (leg.getLegType()) {
|
||||||
|
case LEG_TYPE_TRAIN -> supplier.trainSupplierProduct()
|
||||||
|
.map(product -> isProductCompatible(routeOrder, product))
|
||||||
|
.orElse(false);
|
||||||
|
case LEG_TYPE_AIRPLANE -> supplier.flightSupplierProduct()
|
||||||
|
.map(product -> isProductCompatible(routeOrder, product))
|
||||||
|
.orElse(false);
|
||||||
|
case LEG_TYPE_HOTEL -> supplier.hotelSupplierProduct()
|
||||||
|
.map(product -> isProductCompatible(routeOrder, product))
|
||||||
|
.orElse(false);
|
||||||
|
case LEG_TYPE_TAXI -> supplier.carSupplierProduct()
|
||||||
|
.map(product -> isProductCompatible(routeOrder, product))
|
||||||
|
.orElse(false);
|
||||||
|
default -> false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isProductCompatible(RouteOrder routeOrder,
|
||||||
|
SupplierProduct supplierProduct) {
|
||||||
|
return supplierProduct.checkStandardLevelIfInUse(routeOrder.getStandardLevel())
|
||||||
|
&& !supplierProduct.checkSysCodeIfNotUse(routeOrder.getApproveOrderNo().getSysCode())
|
||||||
|
&& !supplierProduct.checkSysCodeIfNotUse(routeOrder.getApproveOrderNo().getAccountCompany())
|
||||||
|
&& !supplierProduct.checkSysCodeIfNotUse(routeOrder.getApproveOrderNo().getAccountCompanyName());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<Leg> syncLegExclusive(RouteOrder routeOrder, List<Leg> legItems, String supplierName) {
|
public List<Leg> syncLegExclusive(RouteOrder routeOrder, List<Leg> legItems, String supplierName) {
|
||||||
List<Long> alreadySyncLegs = routeOrder.getRouteRequestList()
|
List<Long> alreadySyncLegs = routeOrder.getRouteRequestList()
|
||||||
|
|
|
@ -76,11 +76,12 @@ public class RouteRequestDomainService {
|
||||||
RouteOrder routeOrder = routeRepository.queryById(syncLegData.getRouteId());
|
RouteOrder routeOrder = routeRepository.queryById(syncLegData.getRouteId());
|
||||||
legDomainService.checkLegIfStartApproval(routeOrder);
|
legDomainService.checkLegIfStartApproval(routeOrder);
|
||||||
List<Long> legIds = syncLegData.getLegIds();
|
List<Long> legIds = syncLegData.getLegIds();
|
||||||
RouteRequest routeRequest = getRouteRequest(routeOrder, legIds, syncLegData.getSupplierName());
|
String supplierName = syncLegData.getSupplierName();
|
||||||
|
RouteRequest routeRequest = getRouteRequest(routeOrder, legIds, supplierName);
|
||||||
if (routeRequest.getStatus().equals(ROUTE_REQUEST_STATUS_PREPARE)) {
|
if (routeRequest.getStatus().equals(ROUTE_REQUEST_STATUS_PREPARE)) {
|
||||||
//如果是刚生成的订单需要加入行程规划单当中
|
//如果是刚生成的订单需要加入行程规划单当中
|
||||||
//保存供应商信息
|
//保存供应商信息
|
||||||
routeRequest.setSupplier(syncLegData.getSupplierName());
|
routeRequest.setSupplier(supplierName);
|
||||||
routeOrder.addRouteRequest(routeRequest);
|
routeOrder.addRouteRequest(routeRequest);
|
||||||
} else {
|
} else {
|
||||||
//如果是不是刚生成的,需要调整差旅申请单的行程
|
//如果是不是刚生成的,需要调整差旅申请单的行程
|
||||||
|
@ -102,15 +103,26 @@ public class RouteRequestDomainService {
|
||||||
}
|
}
|
||||||
|
|
||||||
legs.forEach(it -> it.addEvent(legEventFactory.creatLegEvent(LEG_EVENT_NOT_ORDERED)));
|
legs.forEach(it -> it.addEvent(legEventFactory.creatLegEvent(LEG_EVENT_NOT_ORDERED)));
|
||||||
//这里执行同步
|
|
||||||
if (supplierAdapterSelector.of(syncLegData.getSupplierName(), SupplierOrderSync.class).syncRouteRequest(routeRequest)) {
|
supplierRepository.findBySupplierName(supplierName)
|
||||||
routeRequest.addEvent(RouteRequestEvent.sync(syncLegData.getSupplierName()));
|
.ifPresentOrElse(
|
||||||
//通过保存聚合根来保存差旅申请单
|
supplier -> syncRouteRequest(routeRequest, supplier, routeOrder),
|
||||||
|
() -> {
|
||||||
|
throw new CommandException("未找到供应商,无法同步差旅申请单,联系管理员");
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return routeRequest;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提取同步逻辑到一个单独的方法
|
||||||
|
private void syncRouteRequest(RouteRequest routeRequest, Supplier supplier, RouteOrder routeOrder) {
|
||||||
|
if (supplierAdapterSelector.of(supplier.getName(), SupplierOrderSync.class).syncRouteRequest(routeRequest, supplier)) {
|
||||||
|
routeRequest.addEvent(RouteRequestEvent.sync(supplier.getName()));
|
||||||
|
// 通过保存聚合根来保存差旅申请单
|
||||||
routeRepository.save(routeOrder);
|
routeRepository.save(routeOrder);
|
||||||
} else {
|
} else {
|
||||||
throw new CommandException("同步差旅申请单失败,联系管理员");
|
throw new CommandException("同步差旅申请单失败,联系管理员");
|
||||||
}
|
}
|
||||||
return routeRequest;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -118,59 +130,76 @@ public class RouteRequestDomainService {
|
||||||
List<Long> legIds = syncLegData.getLegIds();
|
List<Long> legIds = syncLegData.getLegIds();
|
||||||
Long routeId = syncLegData.getRouteId();
|
Long routeId = syncLegData.getRouteId();
|
||||||
RouteOrder routeOrder = routeRepository.queryById(routeId);
|
RouteOrder routeOrder = routeRepository.queryById(routeId);
|
||||||
Optional<RouteRequest> optionalRouteRequest;
|
|
||||||
if (syncLegData.getRouteRequestId() != null) {
|
|
||||||
//如果指定的对应的差旅申请单 , 那么取消对应的差旅申请单
|
|
||||||
optionalRouteRequest = routeOrder.getRouteRequestList()
|
|
||||||
.stream()
|
|
||||||
.filter(it -> it.getId().equals(syncLegData.getRouteRequestId()))
|
|
||||||
.findFirst();
|
|
||||||
} else {
|
|
||||||
//如果指定的行程单号和供应商 , 该供应商对应的差旅申请单
|
|
||||||
optionalRouteRequest = routeOrder.getRouteRequestList()
|
|
||||||
.stream()
|
|
||||||
.filter(it -> it.getSupplier().equals(syncLegData.getSupplierName()))
|
|
||||||
.findFirst();
|
|
||||||
}
|
|
||||||
optionalRouteRequest.ifPresent(it -> {
|
|
||||||
//这里的逻辑为发现 差旅申请单的机票行程节点 如果已经是 下单的状态, 就不进行取消, 因此实际上按照 该差旅申请单的 同步来进行
|
|
||||||
List<Leg> legs = it.loadLegInfoSelf(routeOrder)
|
|
||||||
.getRouteRequestLegList()
|
|
||||||
.stream()
|
|
||||||
.map(RouteRequestLeg::getLeg)
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
Optional<Supplier> supplierOptional = supplierRepository.findBySupplierName(it.getSupplier());
|
Optional<RouteRequest> optionalRouteRequest = findRouteRequest(routeOrder, syncLegData);
|
||||||
Map<Boolean, List<Leg>> collect;
|
|
||||||
|
optionalRouteRequest.ifPresent(routeRequest -> {
|
||||||
|
List<Leg> legs = getLegsFromRouteRequest(routeRequest, routeOrder);
|
||||||
|
|
||||||
|
Optional<Supplier> supplierOptional = supplierRepository.findBySupplierName(routeRequest.getSupplier());
|
||||||
|
|
||||||
if (supplierOptional.isPresent()) {
|
if (supplierOptional.isPresent()) {
|
||||||
collect = legs
|
Map<Boolean, List<Leg>> legsPartitionedByOrderStatus = partitionLegsByOrderStatus(legs, legIds, routeRequest);
|
||||||
.stream()
|
handleOrderedLegs(routeRequest, legsPartitionedByOrderStatus.get(false), routeOrder);
|
||||||
.collect(Collectors.partitioningBy(leg -> supplierDomainService.ifCanCancel(leg, it.getSupplier()) && legIds.contains(leg.getLegId())));
|
handleNotOrderedLegs(routeRequest, legsPartitionedByOrderStatus.get(true), routeOrder);
|
||||||
List<Leg> orderedLegs = collect.get(false);
|
|
||||||
if (!orderedLegs.isEmpty()) {
|
|
||||||
it.reloadGenerateRequestLegs(orderedLegs);
|
|
||||||
supplierAdapterSelector.of(it.getSupplier(), SupplierOrderSync.class).syncRouteRequest(it);
|
|
||||||
it.addEvent(RouteRequestEvent.sync(it.getSupplier()));
|
|
||||||
List<Leg> notOrderLegs = collect.get(true);
|
|
||||||
notOrderLegs.forEach(leg -> leg.addEvent(legEventFactory.creatLegEvent(LEG_EVENT_APPROVAL)));
|
|
||||||
} else {
|
|
||||||
it.addEvent(RouteRequestEvent.cancel(it.getSupplier()));
|
|
||||||
getLegInfoFromRouteOrder(it, routeOrder);
|
|
||||||
supplierAdapterSelector.of(it.getSupplier(), SupplierOrderSync.class).syncRouteRequest(it);
|
|
||||||
it.getRouteRequestLegList()
|
|
||||||
.forEach(requestLeg -> requestLeg.getLeg().addEvent(legEventFactory.creatLegEvent(LEG_EVENT_APPROVAL)));
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
it.addEvent(RouteRequestEvent.cancel(it.getSupplier()));
|
cancelRouteRequest(routeRequest, routeOrder);
|
||||||
getLegInfoFromRouteOrder(it, routeOrder);
|
|
||||||
supplierAdapterSelector.of(it.getSupplier(), SupplierOrderSync.class).syncRouteRequest(it);
|
|
||||||
it.getRouteRequestLegList()
|
|
||||||
.forEach(requestLeg -> requestLeg.getLeg().addEvent(legEventFactory.creatLegEvent(LEG_EVENT_APPROVAL)));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
routeRepository.save(routeOrder);
|
routeRepository.save(routeOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Optional<RouteRequest> findRouteRequest(RouteOrder routeOrder, SyncLegData syncLegData) {
|
||||||
|
return (syncLegData.getRouteRequestId() != null)
|
||||||
|
? routeOrder.getRouteRequestList().stream()
|
||||||
|
.filter(it -> it.getId().equals(syncLegData.getRouteRequestId()))
|
||||||
|
.findFirst()
|
||||||
|
: routeOrder.getRouteRequestList().stream()
|
||||||
|
.filter(it -> it.getSupplier().equals(syncLegData.getSupplierName()))
|
||||||
|
.findFirst();
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Leg> getLegsFromRouteRequest(RouteRequest routeRequest, RouteOrder routeOrder) {
|
||||||
|
return routeRequest.loadLegInfoSelf(routeOrder)
|
||||||
|
.getRouteRequestLegList()
|
||||||
|
.stream()
|
||||||
|
.map(RouteRequestLeg::getLeg)
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<Boolean, List<Leg>> partitionLegsByOrderStatus(List<Leg> legs, List<Long> legIds, RouteRequest routeRequest) {
|
||||||
|
return legs.stream()
|
||||||
|
.collect(Collectors.partitioningBy(leg -> supplierDomainService.ifCanCancel(leg, routeRequest.getSupplier()) && legIds.contains(leg.getLegId())));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleOrderedLegs(RouteRequest routeRequest, List<Leg> orderedLegs, RouteOrder routeOrder) {
|
||||||
|
if (!orderedLegs.isEmpty()) {
|
||||||
|
routeRequest.reloadGenerateRequestLegs(orderedLegs);
|
||||||
|
syncRouteRequest(routeRequest);
|
||||||
|
routeRequest.addEvent(RouteRequestEvent.sync(routeRequest.getSupplier()));
|
||||||
|
} else {
|
||||||
|
cancelRouteRequest(routeRequest, routeOrder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleNotOrderedLegs(RouteRequest routeRequest, List<Leg> notOrderedLegs, RouteOrder routeOrder) {
|
||||||
|
notOrderedLegs.forEach(leg -> leg.addEvent(legEventFactory.creatLegEvent(LEG_EVENT_APPROVAL)));
|
||||||
|
syncRouteRequest(routeRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void cancelRouteRequest(RouteRequest routeRequest, RouteOrder routeOrder) {
|
||||||
|
routeRequest.addEvent(RouteRequestEvent.cancel(routeRequest.getSupplier()));
|
||||||
|
getLegInfoFromRouteOrder(routeRequest, routeOrder);
|
||||||
|
syncRouteRequest(routeRequest);
|
||||||
|
routeRequest.getRouteRequestLegList()
|
||||||
|
.forEach(requestLeg -> requestLeg.getLeg().addEvent(legEventFactory.creatLegEvent(LEG_EVENT_APPROVAL)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void syncRouteRequest(RouteRequest routeRequest) {
|
||||||
|
supplierAdapterSelector.of(routeRequest.getSupplier(), SupplierOrderSync.class).syncRouteRequest(routeRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//获取目前已经同步到供应商的差旅申请单
|
//获取目前已经同步到供应商的差旅申请单
|
||||||
private RouteRequest getRouteRequest(RouteOrder routeOrder, List<Long> legIds, String supplier) {
|
private RouteRequest getRouteRequest(RouteOrder routeOrder, List<Long> legIds, String supplier) {
|
||||||
|
@ -224,7 +253,11 @@ public class RouteRequestDomainService {
|
||||||
}
|
}
|
||||||
RouteRequest routeRequest = routeRequestRepository.findByRouteRequestNo(journeyNo);
|
RouteRequest routeRequest = routeRequestRepository.findByRouteRequestNo(journeyNo);
|
||||||
if (routeRequest == null) {
|
if (routeRequest == null) {
|
||||||
return routeRepository.findByOrderNo(journeyNo);
|
RouteOrder byOrderNo = routeRepository.findByOrderNo(journeyNo);
|
||||||
|
if (byOrderNo == null) {
|
||||||
|
byOrderNo = routeRepository.findByOrderNo(journeyNo.split("#")[0]);
|
||||||
|
}
|
||||||
|
return byOrderNo;
|
||||||
}
|
}
|
||||||
return routeRepository.queryById(routeRequest.getRouteId());
|
return routeRepository.queryById(routeRequest.getRouteId());
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,6 +59,8 @@ public class SupplierDomainService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ListenTo(command = "SupplierCallBackErrorCommand", order = 0)
|
@ListenTo(command = "SupplierCallBackErrorCommand", order = 0)
|
||||||
public void supplierCallBackError(SupplierCallBackErrorCommand command) {
|
public void supplierCallBackError(SupplierCallBackErrorCommand command) {
|
||||||
SupplierCallBackLog supplierCallBackLog = SupplierCallBackLog
|
SupplierCallBackLog supplierCallBackLog = SupplierCallBackLog
|
||||||
|
|
|
@ -13,7 +13,7 @@ import java.util.List;
|
||||||
import static com.chint.infrastructure.constant.SupplierNameConstant.SUPPLIER_AMAP;
|
import static com.chint.infrastructure.constant.SupplierNameConstant.SUPPLIER_AMAP;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class AmapOrderRecordPuller implements OrderRecordPuller{
|
public class AmapOrderRecordPuller implements OrderRecordPuller {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private AmapSettleBillRequest amapSettleBillRequest;
|
private AmapSettleBillRequest amapSettleBillRequest;
|
||||||
|
@ -39,8 +39,23 @@ public class AmapOrderRecordPuller implements OrderRecordPuller{
|
||||||
@Override
|
@Override
|
||||||
public boolean pullCarOrderRecord(OrderRecordGenerateCommand command) {
|
public boolean pullCarOrderRecord(OrderRecordGenerateCommand command) {
|
||||||
try {
|
try {
|
||||||
List<FinishedOrderResponse.ListElement> listElements = amapSettleBillRequest.amapRecordByMonth(command.getDate());
|
List<FinishedOrderResponse.ListElement> listElements;
|
||||||
List<AmapCarOrderRecord> list = listElements.stream().map(AmapCarOrderRecord::of).toList();
|
String date = command.getDate();
|
||||||
|
String oneDate = command.getOneDate();
|
||||||
|
if (date != null) {
|
||||||
|
listElements = amapSettleBillRequest.amapRecordByMonth(date);
|
||||||
|
} else if (oneDate != null) {
|
||||||
|
listElements = amapSettleBillRequest.amapRecordByDay(oneDate);
|
||||||
|
} else {
|
||||||
|
listElements = amapSettleBillRequest.amapRecordByDay();
|
||||||
|
}
|
||||||
|
List<String> orderIdList = listElements.stream().map(FinishedOrderResponse.ListElement::getAmapOrderId).toList();
|
||||||
|
List<AmapCarOrderRecord> alreadyExist = amapCarOrderRecordRepository.findByOrderIds(orderIdList);
|
||||||
|
List<AmapCarOrderRecord> list = listElements.parallelStream().map(AmapCarOrderRecord::of).peek(it -> alreadyExist.forEach(already -> {
|
||||||
|
if (already.getAmapOrderId().equals(it.getAmapOrderId())) {
|
||||||
|
it.setId(already.getId());
|
||||||
|
}
|
||||||
|
})).toList();
|
||||||
amapCarOrderRecordRepository.saveAll(list);
|
amapCarOrderRecordRepository.saveAll(list);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
@ -144,6 +144,9 @@ public class AmapOrderSyncAdapter implements SupplierOrderSync {
|
||||||
}
|
}
|
||||||
List<String> areaCodes = new ArrayList<>();
|
List<String> areaCodes = new ArrayList<>();
|
||||||
for (Location location : locationList) {
|
for (Location location : locationList) {
|
||||||
|
if (!location.isInternal()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (location.getLocationType() != LOCATION_TYPE_CITY) {
|
if (location.getLocationType() != LOCATION_TYPE_CITY) {
|
||||||
//如果类型不是地级市,那么就从地区路径获取地级市信息
|
//如果类型不是地级市,那么就从地区路径获取地级市信息
|
||||||
String[] split = location.getLocationPathName().split("_");
|
String[] split = location.getLocationPathName().split("_");
|
||||||
|
@ -173,7 +176,9 @@ public class AmapOrderSyncAdapter implements SupplierOrderSync {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (routeRequestFields.getAccountCompanyName().equals("浙江正泰物联技术有限公司") ||
|
if (routeRequestFields.getAccountCompanyName().equals("浙江正泰物联技术有限公司") ||
|
||||||
routeRequestFields.getAccountCompanyName().equals("浙江正泰仪器仪表有限责任公司")) {
|
routeRequestFields.getAccountCompanyName().equals("浙江正泰仪器仪表有限责任公司") ||
|
||||||
|
routeRequestFields.getAccountCompanyName().equals("浙江正泰水务科技有限公司") ||
|
||||||
|
routeRequestFields.getAccountCompanyName().equals("山东鲁正电子有限公司")) {
|
||||||
throw new AuthException("你目前的公司暂不支持使用高德打车");
|
throw new AuthException("你目前的公司暂不支持使用高德打车");
|
||||||
}
|
}
|
||||||
return dto;
|
return dto;
|
||||||
|
|
|
@ -3,12 +3,14 @@ package com.chint.domain.service.order_sync;
|
||||||
|
|
||||||
import com.chint.domain.aggregates.order.*;
|
import com.chint.domain.aggregates.order.*;
|
||||||
import com.chint.domain.aggregates.supplier.Supplier;
|
import com.chint.domain.aggregates.supplier.Supplier;
|
||||||
import com.chint.domain.aggregates.supplier.SupplierProductStandardLevel;
|
import com.chint.domain.aggregates.supplier.SupplierProduct;
|
||||||
import com.chint.domain.exceptions.AuthException;
|
import com.chint.domain.exceptions.AuthException;
|
||||||
import com.chint.domain.service.supplier.SupplierAdapter;
|
import com.chint.domain.service.supplier.SupplierAdapter;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.chint.infrastructure.constant.LegConstant.*;
|
||||||
|
|
||||||
public interface SupplierOrderSync extends SupplierAdapter {
|
public interface SupplierOrderSync extends SupplierAdapter {
|
||||||
boolean syncSupplierOrder(RouteOrder order);
|
boolean syncSupplierOrder(RouteOrder order);
|
||||||
|
|
||||||
|
@ -19,43 +21,60 @@ public interface SupplierOrderSync extends SupplierAdapter {
|
||||||
boolean cancelRouteRequest(RouteRequest routeRequest);
|
boolean cancelRouteRequest(RouteRequest routeRequest);
|
||||||
|
|
||||||
default boolean syncRouteRequest(RouteRequest routeRequest, Supplier supplier) {
|
default boolean syncRouteRequest(RouteRequest routeRequest, Supplier supplier) {
|
||||||
|
if (routeRequest == null || supplier == null) {
|
||||||
|
throw new AuthException("验证差旅申请单失败,请联系管理员");
|
||||||
|
}
|
||||||
RouteRequestFields routeRequestFields = routeRequest.getRouteRequestFields();
|
RouteRequestFields routeRequestFields = routeRequest.getRouteRequestFields();
|
||||||
|
List<Leg> legList = routeRequest.getRouteRequestLegList()
|
||||||
List<Integer> legType = routeRequest.getRouteRequestLegList()
|
|
||||||
.stream()
|
.stream()
|
||||||
.map(RouteRequestLeg::getLeg)
|
.map(RouteRequestLeg::getLeg)
|
||||||
.map(Leg::getLegType)
|
|
||||||
.toList();
|
.toList();
|
||||||
|
legList.forEach(leg -> {
|
||||||
supplier.carSupplierProduct()
|
switch (leg.getLegType()) {
|
||||||
.ifPresent(carSupplierProduct -> {
|
case LEG_TYPE_TRAIN -> trainProductCheck(routeRequestFields, supplier);
|
||||||
if (!carSupplierProduct.checkStandardLevelIfInUse(routeRequestFields.getStandardLevel())) {
|
case LEG_TYPE_AIRPLANE -> flightProductCheck(routeRequestFields, supplier);
|
||||||
throw new AuthException("你目前的公司暂不支持使用高德打车");
|
case LEG_TYPE_HOTEL -> hotelProductCheck(routeRequestFields, supplier);
|
||||||
}
|
case LEG_TYPE_TAXI -> carProductCheck(routeRequestFields, supplier);
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
supplier.flightSupplierProduct().ifPresent(flightSupplierProduct -> {
|
|
||||||
if (flightSupplierProduct.getSupplierProductStandardLevelList()
|
|
||||||
.stream()
|
|
||||||
.filter(SupplierProductStandardLevel::inUse)
|
|
||||||
.map(SupplierProductStandardLevel::getStandardLevelName)
|
|
||||||
.noneMatch(standardLevel -> standardLevel.equals(routeRequestFields.getStandardLevel()))) {
|
|
||||||
throw new AuthException("你目前的公司暂不支持使用高德打车");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
supplier.flightSupplierProduct().ifPresent(flightSupplierProduct -> {
|
|
||||||
if (flightSupplierProduct.getSupplierProductStandardLevelList()
|
|
||||||
.stream()
|
|
||||||
.filter(SupplierProductStandardLevel::inUse)
|
|
||||||
.map(SupplierProductStandardLevel::getStandardLevelName)
|
|
||||||
.noneMatch(standardLevel -> standardLevel.equals(routeRequestFields.getStandardLevel()))) {
|
|
||||||
throw new AuthException("你目前的公司暂不支持使用高德打车");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return syncRouteRequest(routeRequest);
|
return syncRouteRequest(routeRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void carProductCheck(RouteRequestFields routeRequestFields, Supplier supplier) {
|
||||||
|
supplier.carSupplierProduct()
|
||||||
|
.ifPresent(carSupplierProduct -> productCheck(routeRequestFields, carSupplierProduct, supplier, "打车"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void flightProductCheck(RouteRequestFields routeRequestFields, Supplier supplier) {
|
||||||
|
supplier.flightSupplierProduct()
|
||||||
|
.ifPresent(flightSupplierProduct -> productCheck(routeRequestFields, flightSupplierProduct, supplier, "机票"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void hotelProductCheck(RouteRequestFields routeRequestFields, Supplier supplier) {
|
||||||
|
supplier.hotelSupplierProduct()
|
||||||
|
.ifPresent(hotelSupplierProduct -> productCheck(routeRequestFields, hotelSupplierProduct, supplier, "酒店"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void trainProductCheck(RouteRequestFields routeRequestFields, Supplier supplier) {
|
||||||
|
supplier.trainSupplierProduct()
|
||||||
|
.ifPresent(trainSupplierProduct -> productCheck(routeRequestFields, trainSupplierProduct, supplier, "火车"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void productCheck(RouteRequestFields routeRequestFields,
|
||||||
|
SupplierProduct supplierProduct,
|
||||||
|
Supplier supplier,
|
||||||
|
String legCnName) {
|
||||||
|
if (!supplierProduct.checkStandardLevelIfInUse(routeRequestFields.getStandardLevel())) {
|
||||||
|
throw new AuthException("你目前的差标暂不支持使用" + supplier.getCnName() + legCnName);
|
||||||
|
}
|
||||||
|
if (supplierProduct.checkSysCodeIfNotUse(routeRequestFields.getSysCode())) {
|
||||||
|
throw new AuthException("你目前的来源系统暂不支持使用" + supplier.getCnName() + legCnName);
|
||||||
|
}
|
||||||
|
if (supplierProduct.checkSysCodeIfNotUse(routeRequestFields.getAccountCompany())) {
|
||||||
|
throw new AuthException("你目前的公司暂不支持使用" + supplier.getCnName() + legCnName);
|
||||||
|
}
|
||||||
|
if (supplierProduct.checkSysCodeIfNotUse(routeRequestFields.getAccountCompanyName())) {
|
||||||
|
throw new AuthException("你目前的公司暂不支持使用" + supplier.getCnName() + legCnName);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,6 @@ public class SupplierAdapterSelector {
|
||||||
Map<String, SupplierAdapter> beansOfType = applicationContext.getBeansOfType(SupplierAdapter.class);
|
Map<String, SupplierAdapter> beansOfType = applicationContext.getBeansOfType(SupplierAdapter.class);
|
||||||
for (SupplierAdapter adapter : beansOfType.values()) {
|
for (SupplierAdapter adapter : beansOfType.values()) {
|
||||||
String supplierName = adapter.getSupplierName();
|
String supplierName = adapter.getSupplierName();
|
||||||
log.info(supplierName);
|
|
||||||
adapterMap
|
adapterMap
|
||||||
.computeIfAbsent(supplierName, k -> new HashMap<>())
|
.computeIfAbsent(supplierName, k -> new HashMap<>())
|
||||||
.put(adapter.getClass().getInterfaces()[0], adapter);
|
.put(adapter.getClass().getInterfaces()[0], adapter);
|
||||||
|
|
|
@ -10,6 +10,7 @@ public class SupplierConstantUtil {
|
||||||
return switch (supplier) {
|
return switch (supplier) {
|
||||||
case SUPPLIER_L_Y -> SUPPLIER_L_Y_CN_NAME;
|
case SUPPLIER_L_Y -> SUPPLIER_L_Y_CN_NAME;
|
||||||
case SUPPLIER_C_TRIP -> SUPPLIER_C_TRIP_CN_NAME;
|
case SUPPLIER_C_TRIP -> SUPPLIER_C_TRIP_CN_NAME;
|
||||||
|
case SUPPLIER_AMAP -> SUPPLIER_AMAP_CN_NAME;
|
||||||
default -> "未知供应商";
|
default -> "未知供应商";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,10 +10,12 @@ public class RankConstant {
|
||||||
public static final String STANDARD_LEVEL_WL_CODE = "A70000059";//仪表编号
|
public static final String STANDARD_LEVEL_WL_CODE = "A70000059";//仪表编号
|
||||||
public static final String STANDARD_LEVEL_AN_CODE = "A70000021";//仪表编号
|
public static final String STANDARD_LEVEL_AN_CODE = "A70000021";//仪表编号
|
||||||
public static final String STANDARD_LEVEL_GY_CODE = "A20000001";//正泰电气股份有限公司
|
public static final String STANDARD_LEVEL_GY_CODE = "A20000001";//正泰电气股份有限公司
|
||||||
|
public static final String STANDARD_LEVEL_QC_CODE = "A30040001";//正泰电气股份有限公司
|
||||||
public static final String STANDARD_LEVEL_YB = "YB_";//浙江正泰仪器仪表有限责任公司
|
public static final String STANDARD_LEVEL_YB = "YB_";//浙江正泰仪器仪表有限责任公司
|
||||||
public static final String STANDARD_LEVEL_WL = "WL_";//浙江正泰仪器仪表有限责任公司
|
public static final String STANDARD_LEVEL_WL = "WL_";//浙江正泰仪器仪表有限责任公司
|
||||||
public static final String STANDARD_LEVEL_AN = "AN_";//浙江正泰仪器仪表有限责任公司
|
public static final String STANDARD_LEVEL_AN = "AN_";//浙江正泰仪器仪表有限责任公司
|
||||||
public static final String STANDARD_LEVEL_GY = "GY_";//正泰电气股份有限公司
|
public static final String STANDARD_LEVEL_GY = "GY_";//正泰电气股份有限公司
|
||||||
|
public static final String STANDARD_LEVEL_QC = "QC_";//汽车科技
|
||||||
public static final String STANDARD_LEVEL_SZKJ_CODE = "";//数智科技编号
|
public static final String STANDARD_LEVEL_SZKJ_CODE = "";//数智科技编号
|
||||||
public static final String STANDARD_LEVEL_SZKJ = "SZKJ_";//数智科技
|
public static final String STANDARD_LEVEL_SZKJ = "SZKJ_";//数智科技
|
||||||
public static final String STANDARD_LEVEL_SDZN_CODE = "A70000067";//山东智能编号
|
public static final String STANDARD_LEVEL_SDZN_CODE = "A70000067";//山东智能编号
|
||||||
|
|
|
@ -22,6 +22,11 @@ public class AmapCarOrderRecordRepositoryImpl implements AmapCarOrderRecordRepos
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AmapCarOrderRecord> findByOrderIds(List<String> orderIds) {
|
||||||
|
return jdbcAmapCarOrderRecordRepository.findByAmapOrderIdIn(orderIds);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AmapCarOrderRecord> findByDs(String ds) {
|
public List<AmapCarOrderRecord> findByDs(String ds) {
|
||||||
return jdbcAmapCarOrderRecordRepository.findByDsContaining(ds);
|
return jdbcAmapCarOrderRecordRepository.findByDsContaining(ds);
|
||||||
|
|
|
@ -4,9 +4,11 @@ import com.chint.domain.aggregates.order.order_record.amap_order_record.AmapCarO
|
||||||
import org.springframework.data.repository.CrudRepository;
|
import org.springframework.data.repository.CrudRepository;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public interface JdbcAmapCarOrderRecordRepository extends CrudRepository<AmapCarOrderRecord, Long> {
|
public interface JdbcAmapCarOrderRecordRepository extends CrudRepository<AmapCarOrderRecord, Long> {
|
||||||
List<AmapCarOrderRecord> findByDsContaining(String ds);
|
List<AmapCarOrderRecord> findByDsContaining(String ds);
|
||||||
|
List<AmapCarOrderRecord> findByAmapOrderIdIn(Collection<String> amapOrderId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ public class DateTimeUtil {
|
||||||
return formatter.format(time);
|
return formatter.format(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static String timeToStr(LocalDateTime input) {
|
public static String timeToStr(LocalDateTime input) {
|
||||||
return input.format(formatterDate);
|
return input.format(formatterDate);
|
||||||
}
|
}
|
||||||
|
@ -37,6 +38,10 @@ public class DateTimeUtil {
|
||||||
return input.format(formatterDateYYYYMMDD);
|
return input.format(formatterDateYYYYMMDD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static LocalDateTime strToTimeYYYYMMDD(String input) {
|
||||||
|
return LocalDateTime.parse(input, formatterDateYYYYMMDD);
|
||||||
|
}
|
||||||
|
|
||||||
public static LocalDateTime strToTime(String input) {
|
public static LocalDateTime strToTime(String input) {
|
||||||
return LocalDateTime.parse(input.substring(0, 19), formatter);
|
return LocalDateTime.parse(input.substring(0, 19), formatter);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,37 +2,14 @@ package com.chint.interfaces.rest.amap.request;
|
||||||
|
|
||||||
import com.chint.infrastructure.util.SignUtils;
|
import com.chint.infrastructure.util.SignUtils;
|
||||||
import com.chint.interfaces.rest.amap.BaseRequestParam;
|
import com.chint.interfaces.rest.amap.BaseRequestParam;
|
||||||
|
|
||||||
import com.chint.interfaces.rest.amap.BaseResponse;
|
|
||||||
import com.chint.interfaces.rest.base.PostRequest;
|
import com.chint.interfaces.rest.base.PostRequest;
|
||||||
import com.google.common.base.Charsets;
|
|
||||||
import com.google.gson.Gson;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.http.HttpEntity;
|
|
||||||
import org.apache.http.NameValuePair;
|
|
||||||
import org.apache.http.client.HttpClient;
|
|
||||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
|
||||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
|
||||||
import org.apache.http.client.methods.HttpGet;
|
|
||||||
import org.apache.http.client.methods.HttpPost;
|
|
||||||
import org.apache.http.client.methods.HttpUriRequest;
|
|
||||||
import org.apache.http.impl.client.CloseableHttpClient;
|
|
||||||
import org.apache.http.impl.client.HttpClients;
|
|
||||||
import org.apache.http.message.BasicNameValuePair;
|
|
||||||
import org.apache.http.util.EntityUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.URLEncoder;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static com.chint.infrastructure.constant.AmapConstant.USER_CREATE_PATH;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
public class AmapRequest {
|
public class AmapRequest {
|
||||||
|
@ -68,7 +45,7 @@ public class AmapRequest {
|
||||||
return request.getSend(url, params, responseType);
|
return request.getSend(url, params, responseType);
|
||||||
}
|
}
|
||||||
|
|
||||||
public <V> V post(String url,BaseRequestParam baseRequestParam, Class<V> responseType) {
|
public <V> V post(String url, BaseRequestParam baseRequestParam, Class<V> responseType) {
|
||||||
baseRequestParam.setAppId(appId);
|
baseRequestParam.setAppId(appId);
|
||||||
baseRequestParam.setEid(eid);
|
baseRequestParam.setEid(eid);
|
||||||
baseRequestParam.setEnt(4);
|
baseRequestParam.setEnt(4);
|
||||||
|
|
|
@ -7,6 +7,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -60,4 +62,16 @@ public class AmapSettleBillRequest {
|
||||||
String endDayOfMonth = DateTimeUtil.timeToStrYYYYMMDD(DateTimeUtil.endDayOfMonth(date));
|
String endDayOfMonth = DateTimeUtil.timeToStrYYYYMMDD(DateTimeUtil.endDayOfMonth(date));
|
||||||
return pageFinishedOrder(firstDayOfMonth, endDayOfMonth);
|
return pageFinishedOrder(firstDayOfMonth, endDayOfMonth);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<FinishedOrderResponse.ListElement> amapRecordByDay() {
|
||||||
|
LocalDateTime today = LocalDateTime.now();
|
||||||
|
LocalDateTime yesterday = today.minusDays(1).toLocalDate().atStartOfDay();
|
||||||
|
return pageFinishedOrder(DateTimeUtil.timeToStrYYYYMMDD(yesterday), DateTimeUtil.timeToStrYYYYMMDD(today));
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<FinishedOrderResponse.ListElement> amapRecordByDay(String date) {
|
||||||
|
LocalDateTime localDateTime = DateTimeUtil.strToTimeYYYYMMDD(date);
|
||||||
|
LocalDateTime yesterday = localDateTime.minusDays(1).toLocalDate().atStartOfDay();
|
||||||
|
return pageFinishedOrder(DateTimeUtil.timeToStrYYYYMMDD(yesterday), DateTimeUtil.timeToStrYYYYMMDD(localDateTime));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@ import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
|
|
||||||
import static com.chint.infrastructure.constant.CTripConstant.*;
|
import static com.chint.infrastructure.constant.CTripConstant.*;
|
||||||
|
|
||||||
|
@ -58,9 +57,19 @@ public class CTripOrderDetailRequest {
|
||||||
|
|
||||||
|
|
||||||
public OrderFlightResponse getFlightOrder() {
|
public OrderFlightResponse getFlightOrder() {
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
LocalDateTime now = LocalDateTime.now();
|
||||||
LocalDateTime localDateTime = LocalDateTime.now().minusDays(1L);
|
LocalDateTime localDateTime = now.minusDays(1L);
|
||||||
return getFlightOrder(formatter.format(localDateTime), formatter.format(localDateTime));
|
return postRequest.post(flightOrderUrl,
|
||||||
|
getParamByDateFromAndDateTo(DateTimeUtil.timeToStr(localDateTime), DateTimeUtil.timeToStr(now)),
|
||||||
|
OrderFlightResponse.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrderFlightResponse getFlightOrder(String oneDate) {
|
||||||
|
LocalDateTime oneDateL = DateTimeUtil.strToTimeYYYYMMDD(oneDate);
|
||||||
|
LocalDateTime localDateTime = oneDateL.minusDays(1L);
|
||||||
|
return postRequest.post(flightOrderUrl,
|
||||||
|
getParamByDateFromAndDateTo(DateTimeUtil.timeToStr(localDateTime), DateTimeUtil.timeToStr(oneDateL)),
|
||||||
|
OrderFlightResponse.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrderFlightResponse getFlightOrderByDate(String date) {
|
public OrderFlightResponse getFlightOrderByDate(String date) {
|
||||||
|
@ -70,7 +79,7 @@ public class CTripOrderDetailRequest {
|
||||||
|
|
||||||
|
|
||||||
public OrderFlightResponse getFlightOrder(String dateFrom, String dateTo) {
|
public OrderFlightResponse getFlightOrder(String dateFrom, String dateTo) {
|
||||||
return postRequest.post(flightOrderUrl, getParamByDateFromAndDateTo(dateFrom, dateTo),
|
return postRequest.post(flightOrderUrl, getParamByBatch(dateFrom, dateTo),
|
||||||
OrderFlightResponse.class);
|
OrderFlightResponse.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,13 +89,23 @@ public class CTripOrderDetailRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrderHotelResponse getHotelOrder() {
|
public OrderHotelResponse getHotelOrder() {
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
LocalDateTime now = LocalDateTime.now();
|
||||||
LocalDateTime localDateTime = LocalDateTime.now().minusDays(1L);
|
LocalDateTime localDateTime = now.minusDays(1L);
|
||||||
return getHotelOrder(formatter.format(localDateTime), formatter.format(localDateTime));
|
return postRequest.post(hotelOrderUrl,
|
||||||
|
getParamByDateFromAndDateTo(DateTimeUtil.timeToStr(localDateTime), DateTimeUtil.timeToStr(now)),
|
||||||
|
OrderHotelResponse.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrderHotelResponse getHotelOrder(String oneDate) {
|
||||||
|
LocalDateTime oneDateL = DateTimeUtil.strToTimeYYYYMMDD(oneDate);
|
||||||
|
LocalDateTime localDateTime = oneDateL.minusDays(1L);
|
||||||
|
return postRequest.post(hotelOrderUrl,
|
||||||
|
getParamByDateFromAndDateTo(DateTimeUtil.timeToStr(localDateTime), DateTimeUtil.timeToStr(oneDateL)),
|
||||||
|
OrderHotelResponse.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrderHotelResponse getHotelOrder(String dateFrom, String dateTo) {
|
public OrderHotelResponse getHotelOrder(String dateFrom, String dateTo) {
|
||||||
return postRequest.post(hotelOrderUrl, getParamByDateFromAndDateTo(dateFrom, dateTo),
|
return postRequest.post(hotelOrderUrl, getParamByBatch(dateFrom, dateTo),
|
||||||
OrderHotelResponse.class);
|
OrderHotelResponse.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,13 +116,24 @@ public class CTripOrderDetailRequest {
|
||||||
|
|
||||||
|
|
||||||
public OrderTrainResponse getTrainOrder() {
|
public OrderTrainResponse getTrainOrder() {
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
LocalDateTime now = LocalDateTime.now();
|
||||||
LocalDateTime localDateTime = LocalDateTime.now().minusDays(1L);
|
LocalDateTime localDateTime = now.minusDays(1L);
|
||||||
return getTrainOrder(formatter.format(localDateTime), formatter.format(localDateTime));
|
return postRequest.post(trainOrderUrl,
|
||||||
|
getParamByDateFromAndDateTo(DateTimeUtil.timeToStr(localDateTime), DateTimeUtil.timeToStr(now)),
|
||||||
|
OrderTrainResponse.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public OrderTrainResponse getTrainOrder(String oneDate) {
|
||||||
|
LocalDateTime oneDateL = DateTimeUtil.strToTimeYYYYMMDD(oneDate);
|
||||||
|
LocalDateTime localDateTime = oneDateL.minusDays(1L);
|
||||||
|
return postRequest.post(trainOrderUrl,
|
||||||
|
getParamByDateFromAndDateTo(DateTimeUtil.timeToStr(localDateTime), DateTimeUtil.timeToStr(oneDateL)),
|
||||||
|
OrderTrainResponse.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public OrderTrainResponse getTrainOrder(String dateFrom, String dateTo) {
|
public OrderTrainResponse getTrainOrder(String dateFrom, String dateTo) {
|
||||||
return postRequest.post(trainOrderUrl, getParamByDateFromAndDateTo(dateFrom, dateTo),
|
return postRequest.post(trainOrderUrl, getParamByBatch(dateFrom, dateTo),
|
||||||
OrderTrainResponse.class);
|
OrderTrainResponse.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,17 +143,40 @@ public class CTripOrderDetailRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrderCarResponse getCarOrder() {
|
public OrderCarResponse getCarOrder() {
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
LocalDateTime now = LocalDateTime.now();
|
||||||
LocalDateTime localDateTime = LocalDateTime.now().minusDays(1L);
|
LocalDateTime localDateTime = now.minusDays(1L);
|
||||||
return getCarOrder(formatter.format(localDateTime), formatter.format(localDateTime));
|
return postRequest.post(carOrderUrl,
|
||||||
|
getParamByDateFromAndDateTo(DateTimeUtil.timeToStr(localDateTime), DateTimeUtil.timeToStr(now)),
|
||||||
|
OrderCarResponse.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrderCarResponse getCarOrder(String oneDate) {
|
||||||
|
LocalDateTime oneDateL = DateTimeUtil.strToTimeYYYYMMDD(oneDate);
|
||||||
|
LocalDateTime localDateTime = oneDateL.minusDays(1L);
|
||||||
|
return postRequest.post(carOrderUrl,
|
||||||
|
getParamByDateFromAndDateTo(DateTimeUtil.timeToStr(localDateTime), DateTimeUtil.timeToStr(oneDateL)),
|
||||||
|
OrderCarResponse.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrderCarResponse getCarOrder(String dateFrom, String dateTo) {
|
public OrderCarResponse getCarOrder(String dateFrom, String dateTo) {
|
||||||
return postRequest.post(carOrderUrl, getParamByDateFromAndDateTo(dateFrom, dateTo),
|
return postRequest.post(carOrderUrl, getParamByBatch(dateFrom, dateTo),
|
||||||
OrderCarResponse.class);
|
OrderCarResponse.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private OrderRecordParam getParamByDateFromAndDateTo(String dateFrom, String dateTo) {
|
private OrderRecordParam getParamByDateFromAndDateTo(String dateFrom, String dateTo) {
|
||||||
|
OrderRecordParam orderFlightParam = OrderRecordParam.of(
|
||||||
|
C_TRIP_ACCOUNT_ID,
|
||||||
|
dateFrom,
|
||||||
|
dateTo,
|
||||||
|
null
|
||||||
|
);
|
||||||
|
orderFlightParam.auth(Authentification.midOf(C_TRIP_APP_KEY, ticketRequest.loadTicket()));
|
||||||
|
orderFlightParam.setAppKey(C_TRIP_APP_KEY);
|
||||||
|
orderFlightParam.setTicket(ticketRequest.loadTicket());
|
||||||
|
return orderFlightParam;
|
||||||
|
}
|
||||||
|
|
||||||
|
private OrderRecordParam getParamByBatch(String dateFrom, String dateTo) {
|
||||||
String substring = dateFrom.substring(0, 6);
|
String substring = dateFrom.substring(0, 6);
|
||||||
String dateFromNew = substring + "01";
|
String dateFromNew = substring + "01";
|
||||||
String batchNo = C_TRIP_CORP_ID + "_" + C_TRIP_ACCOUNT_ID + "_" + dateFromNew;
|
String batchNo = C_TRIP_CORP_ID + "_" + C_TRIP_ACCOUNT_ID + "_" + dateFromNew;
|
||||||
|
|
|
@ -250,7 +250,7 @@ public class CTripTest {
|
||||||
@Test
|
@Test
|
||||||
void search() {
|
void search() {
|
||||||
BaseContext.setCurrentUser(user);
|
BaseContext.setCurrentUser(user);
|
||||||
SearchOrderResponse response = orderSearchRequest.searchOrderResponseByOrderId("32559146895");
|
SearchOrderResponse response = orderSearchRequest.searchOrderResponseByOrderId("31592018105");
|
||||||
System.out.println(response);
|
System.out.println(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ import com.chint.domain.service.JTCompanyDomainService;
|
||||||
import com.chint.domain.service.OrderDomainService;
|
import com.chint.domain.service.OrderDomainService;
|
||||||
import com.chint.domain.service.SystemDomainService;
|
import com.chint.domain.service.SystemDomainService;
|
||||||
import com.chint.domain.service.order_sync.LYOrderSyncAdapter;
|
import com.chint.domain.service.order_sync.LYOrderSyncAdapter;
|
||||||
|
import com.chint.domain.value_object.RanksData;
|
||||||
import com.chint.infrastructure.repository.CTripOrderDetailImpl;
|
import com.chint.infrastructure.repository.CTripOrderDetailImpl;
|
||||||
import com.chint.infrastructure.util.DateTimeUtil;
|
import com.chint.infrastructure.util.DateTimeUtil;
|
||||||
import com.chint.infrastructure.util.Digest;
|
import com.chint.infrastructure.util.Digest;
|
||||||
|
@ -304,7 +305,7 @@ class RouteApplicationTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void loginSign() {
|
void loginSign() {
|
||||||
String sfno = "230410022";
|
String sfno = "190506003";
|
||||||
String syscode = "FSSC";
|
String syscode = "FSSC";
|
||||||
String billcode = "CLSQ240225000099";
|
String billcode = "CLSQ240225000099";
|
||||||
String companycode = "正泰集团股份有限公司";
|
String companycode = "正泰集团股份有限公司";
|
||||||
|
@ -315,7 +316,7 @@ class RouteApplicationTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void loginSignProd() {
|
void loginSignProd() {
|
||||||
String sfno = "230214151";
|
String sfno = "240611055";
|
||||||
String syscode = "FSSC";
|
String syscode = "FSSC";
|
||||||
String billcode = "CLSQ240225000099";
|
String billcode = "CLSQ240225000099";
|
||||||
String companycode = "正泰集团股份有限公司";
|
String companycode = "正泰集团股份有限公司";
|
||||||
|
@ -1368,34 +1369,34 @@ class RouteApplicationTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// @Test
|
@Test
|
||||||
void addRanks() {
|
void addRanks() {
|
||||||
// RanksData ranksData = new RanksData();
|
RanksData ranksData = new RanksData();
|
||||||
// ranksData.setIndustry("正泰电气股份有限公司");
|
ranksData.setIndustry("浙江正泰汽车科技有限公司");
|
||||||
// ranksData.setCompanyCode("A20000001");
|
ranksData.setCompanyCode("A30040001");
|
||||||
// for (int i = 1; i < 13; i++) {
|
for (int i = 1; i < 13; i++) {
|
||||||
// if (i <= 1) {
|
if (i <= 1) {
|
||||||
// ranksData.setLevel(3);
|
ranksData.setLevel(3);
|
||||||
// } else if (i <= 4) {
|
} else if (i <= 5) {
|
||||||
// ranksData.setLevel(3);
|
ranksData.setLevel(3);
|
||||||
// } else if (i <= 8) {
|
} else if (i <= 7) {
|
||||||
// ranksData.setLevel(2);
|
ranksData.setLevel(2);
|
||||||
// } else {
|
} else {
|
||||||
// ranksData.setLevel(1);
|
ranksData.setLevel(1);
|
||||||
// }
|
}
|
||||||
// ranksData.setRankName("P" + i);
|
ranksData.setRankName("P" + i);
|
||||||
// rankController.saveRanks(ranksData);
|
rankController.saveRanks(ranksData);
|
||||||
// ranksData.setRankName("M" + i);
|
ranksData.setRankName("M" + i);
|
||||||
// rankController.saveRanks(ranksData);
|
rankController.saveRanks(ranksData);
|
||||||
// ranksData.setRankName("L" + i);
|
ranksData.setRankName("L" + i);
|
||||||
// rankController.saveRanks(ranksData);
|
rankController.saveRanks(ranksData);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// for (int i = 1; i < 6; i++) {
|
for (int i = 1; i < 6; i++) {
|
||||||
// ranksData.setLevel(4);
|
ranksData.setLevel(4);
|
||||||
// ranksData.setRankName("PR" + i);
|
ranksData.setRankName("PR" + i);
|
||||||
// rankController.saveRanks(ranksData);
|
rankController.saveRanks(ranksData);
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Test
|
// @Test
|
||||||
|
|
Loading…
Reference in New Issue