新能云枢超标、改签、变更流程代码调整
This commit is contained in:
parent
12f272a395
commit
040917c413
|
@ -6,7 +6,9 @@ import com.chint.infrastructure.constant.BPMConstant;
|
||||||
import com.chint.infrastructure.constant.CommonMessageConstant;
|
import com.chint.infrastructure.constant.CommonMessageConstant;
|
||||||
import com.chint.infrastructure.util.Result;
|
import com.chint.infrastructure.util.Result;
|
||||||
import com.chint.interfaces.rest.bpm.dot.BPMBack;
|
import com.chint.interfaces.rest.bpm.dot.BPMBack;
|
||||||
|
import com.chint.interfaces.rest.ctrip.CTripAuditRequest;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.repository.query.Param;
|
import org.springframework.data.repository.query.Param;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
@ -16,20 +18,46 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static com.chint.infrastructure.constant.BPMConstant.H3BPM;
|
import static com.chint.infrastructure.constant.BPMConstant.*;
|
||||||
|
import static com.chint.infrastructure.constant.Constant.*;
|
||||||
|
import static com.chint.infrastructure.constant.SupplierNameConstant.*;
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/public/BPM")
|
@RequestMapping("/public/BPM")
|
||||||
public class BPMController {
|
public class BPMController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CTripAuditRequest cTripAuditRequest;
|
||||||
|
|
||||||
//超标
|
//超标
|
||||||
@ApiOperation("BPM超标审批结果回传")
|
@ApiOperation("BPM超标审批结果回传")
|
||||||
@PostMapping("/exceedStandard/back")
|
@PostMapping("/exceedStandard/back")
|
||||||
public Result<TravelStandards> exceedStandardBack(@RequestBody BPMBack bpmBack) {
|
public Result<TravelStandards> exceedStandardBack(@RequestBody BPMBack bpmBack) {
|
||||||
//H3BPM平台
|
//H3BPM平台
|
||||||
if (H3BPM.equals(bpmBack.getTag())) {
|
|
||||||
System.out.println("H3BPM");
|
|
||||||
}
|
|
||||||
System.out.println("bpmBack = " + bpmBack);
|
System.out.println("bpmBack = " + bpmBack);
|
||||||
|
String result = bpmBack.getResult();//结果
|
||||||
|
String orderTypeValue = bpmBack.getOrderType(); // 获取订单类型的值
|
||||||
|
if (orderTypeValue != null) {
|
||||||
|
//携程商旅
|
||||||
|
if (SUPPLIER_C_TRIP_BPM_NAME.equals(bpmBack.getOrderSource())) {
|
||||||
|
Integer orderType = getCTripOrderType(orderTypeValue); // 调用方法获取订单类型
|
||||||
|
if ("通过".equals(result)) {
|
||||||
|
cTripAuditRequest.auditSuccess(bpmBack.getOrderNo(), orderType);
|
||||||
|
} else {
|
||||||
|
cTripAuditRequest.auditFail(bpmBack.getOrderNo(), orderType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//同程商旅
|
||||||
|
if (SUPPLIER_L_Y_BPM_NAME.equals(bpmBack.getOrderSource())) {
|
||||||
|
Integer orderType = getLYOrderType(orderTypeValue); // 调用方法获取订单类型
|
||||||
|
if ("通过".equals(result)) {
|
||||||
|
cTripAuditRequest.auditSuccess(bpmBack.getOrderNo(), orderType);
|
||||||
|
} else {
|
||||||
|
cTripAuditRequest.auditFail(bpmBack.getOrderNo(), orderType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return Result.Success(CommonMessageConstant.SUCCESS);
|
return Result.Success(CommonMessageConstant.SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,4 +78,30 @@ public class BPMController {
|
||||||
System.out.println("bpmBack = " + bpmBack);
|
System.out.println("bpmBack = " + bpmBack);
|
||||||
return Result.Success(CommonMessageConstant.SUCCESS);
|
return Result.Success(CommonMessageConstant.SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//类型映射
|
||||||
|
|
||||||
|
//携程类型映射
|
||||||
|
//1:机票;2:酒店;3:火车票;4:用车(接送机/站,国内租车,马上用车,国内包车,汽车票)
|
||||||
|
public Integer getCTripOrderType(String orderType) {
|
||||||
|
return switch (orderType) {
|
||||||
|
case EXCEED_STANDARD_TYPE_TRAIN -> 3;
|
||||||
|
case EXCEED_STANDARD_TYPE_HOTEL -> 2;
|
||||||
|
case EXCEED_STANDARD_TYPE_FLIGHT -> 1;
|
||||||
|
case EXCEED_STANDARD_TYPE_CAR -> 4;
|
||||||
|
default -> 0; // 默认值,如果都不匹配则为0
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
//同程类型映射
|
||||||
|
public Integer getLYOrderType(String orderType) {
|
||||||
|
return switch (orderType) {
|
||||||
|
case EXCEED_STANDARD_TYPE_TRAIN -> PRODUCT_TYPE_TRAIN;
|
||||||
|
case EXCEED_STANDARD_TYPE_HOTEL -> PRODUCT_TYPE_TRAIN_HOTEL;
|
||||||
|
case EXCEED_STANDARD_TYPE_FLIGHT -> PRODUCT_TYPE_FLY;
|
||||||
|
case EXCEED_STANDARD_TYPE_CAR -> PRODUCT_TYPE_TRAIN_CAR;
|
||||||
|
default -> 0; // 默认值,如果都不匹配则为0
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,10 +11,7 @@ import com.chint.interfaces.rest.base.PostRequest;
|
||||||
import com.chint.interfaces.rest.bpm.XNBPM.ClientFactory;
|
import com.chint.interfaces.rest.bpm.XNBPM.ClientFactory;
|
||||||
import com.chint.interfaces.rest.bpm.XNBPM.XNTokenDto;
|
import com.chint.interfaces.rest.bpm.XNBPM.XNTokenDto;
|
||||||
import com.chint.interfaces.rest.bpm.dot.BPMBaseResponse;
|
import com.chint.interfaces.rest.bpm.dot.BPMBaseResponse;
|
||||||
import com.chint.interfaces.rest.bpm.dto.BPMBaseRequest;
|
import com.chint.interfaces.rest.bpm.dto.*;
|
||||||
import com.chint.interfaces.rest.bpm.dto.BPMResponse;
|
|
||||||
import com.chint.interfaces.rest.bpm.dto.ExceedStandardDto;
|
|
||||||
import com.chint.interfaces.rest.bpm.dto.RescheduleDto;
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -41,21 +38,48 @@ public class BPMRequest {
|
||||||
private String XNBPMUrl;
|
private String XNBPMUrl;
|
||||||
|
|
||||||
//超标申请
|
//超标申请
|
||||||
public BPMResponse exceedStandard(ExceedStandardDto exceedStandardDto , String sysCode ) {
|
public BPMResponse exceedStandard(ExceedStandardDto exceedStandardDto, String sysCode) {
|
||||||
if ("H3BPM".equals("XNBPM")) {
|
return switch (sysCode) {
|
||||||
return XNBPMSubmitWorkflow("JG_AS_CLCESQ", exceedStandardDto);
|
case "FSSC", "H3BPM" -> H3BPMSubmitWorkflow("JT_FI_CLCESQ", exceedStandardDto);
|
||||||
} else {
|
case "XNFSSC" -> XNBPMSubmitWorkflow("JG_AS_CLCESQ", exceedStandardDto);
|
||||||
return H3BPMSubmitWorkflow("JT_FI_CLCESQ", exceedStandardDto);
|
case "ANFSSC" -> null;
|
||||||
|
default -> {
|
||||||
|
BPMResponse bpmResponse = new BPMResponse();
|
||||||
|
bpmResponse.setSuccess(false);
|
||||||
|
bpmResponse.setMessage("订单系统标识不正确!");
|
||||||
|
yield bpmResponse;
|
||||||
}
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//改签申请
|
//改签申请
|
||||||
public BPMResponse reschedule(RescheduleDto rescheduleDto) {
|
public BPMResponse reschedule(RescheduleDto rescheduleDto, String sysCode) {
|
||||||
if ("H3BPM".equals("XNBPM")) {
|
return switch (sysCode) {
|
||||||
return XNBPMSubmitWorkflow("JG_AS_CLGQSQ", rescheduleDto);
|
case "FSSC", "H3BPM" -> H3BPMSubmitWorkflow("JT_FI_CLGQSQ", rescheduleDto);
|
||||||
} else {
|
case "XNFSSC" -> XNBPMSubmitWorkflow("JG_AS_CLGQSQ", rescheduleDto);
|
||||||
return H3BPMSubmitWorkflow("JT_FI_CLGQSQ", rescheduleDto);
|
case "ANFSSC" -> null;
|
||||||
|
default -> {
|
||||||
|
BPMResponse bpmResponse = new BPMResponse();
|
||||||
|
bpmResponse.setSuccess(false);
|
||||||
|
bpmResponse.setMessage("订单系统标识不正确!");
|
||||||
|
yield bpmResponse;
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
//变更申请
|
||||||
|
public <T> BPMResponse change(T changeDto, String sysCode) {
|
||||||
|
return switch (sysCode) {
|
||||||
|
case "FSSC", "H3BPM" -> H3BPMSubmitWorkflow("JT_FI_CLBGSQ", changeDto);
|
||||||
|
case "XNFSSC" -> XNBPMSubmitWorkflow("XN_AS_CLBGSQ", changeDto);
|
||||||
|
case "ANFSSC" -> null;
|
||||||
|
default -> {
|
||||||
|
BPMResponse bpmResponse = new BPMResponse();
|
||||||
|
bpmResponse.setSuccess(false);
|
||||||
|
bpmResponse.setMessage("订单系统标识不正确!");
|
||||||
|
yield bpmResponse;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,7 +4,9 @@ import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class BPMBack {
|
public class BPMBack {
|
||||||
private String tag;//BPM平台:H3BPM/其它
|
private String tag;//BPM平台:H3BPM/XNBPM/其它
|
||||||
private String orderNo;//订单号
|
private String orderNo;//订单号
|
||||||
|
private String orderType;//订单类型 超标:酒店超标,火车票超标,机票超标 改签:机票改签,机票退票,火车票改签,火车票退票
|
||||||
|
private String orderSource;//订单来源: 携程商旅/同程商旅
|
||||||
private String result;//审批结果:通过/拒绝
|
private String result;//审批结果:通过/拒绝
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
public class ChangeDto {
|
public class JTH3ChangeDto {
|
||||||
private String StartTime;//出差开始时间 是否必填 是
|
private String StartTime;//出差开始时间 是否必填 是
|
||||||
private String EndTime;//出差结束时间 是否必填 是
|
private String EndTime;//出差结束时间 是否必填 是
|
||||||
private String Reason;//出差说明 是否必填 是
|
private String Reason;//出差说明 是否必填 是
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.chint.interfaces.rest.bpm.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class XNChangeDto {
|
||||||
|
private String StartTime;//出差开始时间 是否必填 是
|
||||||
|
private String EndTime;//出差结束时间 是否必填 是
|
||||||
|
private String Reason;//出差说明 是否必填 是
|
||||||
|
private List<JTH3ChangeDto.NewTrip> XN_AS_CLBGSQ_ITEM_NewTrip;//新增行程信息 是否必填 否
|
||||||
|
private List<JTH3ChangeDto.OldTrip> XN_AS_CLBGSQ_ITEM_OldTrip;//原行程信息 是否必填 否
|
||||||
|
private List<JTH3ChangeDto.ChangeTrip> XN_AS_CLBGSQ_ITEM_ChangeTrip;//变更行程信息 是否必填 否
|
||||||
|
|
||||||
|
//新增行程信息
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public static class NewTrip {
|
||||||
|
private String AllowProductTypes;//行程类型 是否必填 是
|
||||||
|
private String DepartCitiesName;//出发地 是否必填 是
|
||||||
|
private String ArriveCitiesName;//目的地 是否必填 是
|
||||||
|
private String bsDate;//开始时间 是否必填 否
|
||||||
|
private String edDate;//结束时间 是否必填 否
|
||||||
|
private String Reason;//新增行程原因 是否必填 否
|
||||||
|
}
|
||||||
|
|
||||||
|
//原行程信息
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public static class OldTrip {
|
||||||
|
private String AllowProductTypes;//行程类型 是否必填 是
|
||||||
|
private String DepartCitiesName;//出发地 是否必填 是
|
||||||
|
private String ArriveCitiesName;//目的地 是否必填 是
|
||||||
|
private String bsDate;//开始时间 是否必填 否
|
||||||
|
private String edDate;//结束时间 是否必填 否
|
||||||
|
}
|
||||||
|
|
||||||
|
//变更行程信息
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public static class ChangeTrip {
|
||||||
|
private String AllowProductTypes;//行程类型 是否必填 是
|
||||||
|
private String DepartCitiesName;//出发地 是否必填 是
|
||||||
|
private String ArriveCitiesName;//目的地 是否必填 是
|
||||||
|
private String bsDate;//开始时间 是否必填 否
|
||||||
|
private String edDate;//结束时间 是否必填 否
|
||||||
|
private String Reason;//新增行程原因 是否必填 否
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.chint.interfaces.rest.bpm.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class ZWChangeDto {
|
||||||
|
private String StartTime;//出差开始时间 是否必填 是
|
||||||
|
private String EndTime;//出差结束时间 是否必填 是
|
||||||
|
private String Reason;//出差说明 是否必填 是
|
||||||
|
private List<JTH3ChangeDto.NewTrip> ZW_AS_CLBGSQ_ITEM_NewTrip;//新增行程信息 是否必填 否
|
||||||
|
private List<JTH3ChangeDto.OldTrip> ZW_AS_CLBGSQ_ITEM_OldTrip;//原行程信息 是否必填 否
|
||||||
|
private List<JTH3ChangeDto.ChangeTrip> ZW_AS_CLBGSQ_ITEM_ChangeTrip;//变更行程信息 是否必填 否
|
||||||
|
|
||||||
|
//新增行程信息
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public static class NewTrip {
|
||||||
|
private String AllowProductTypes;//行程类型 是否必填 是
|
||||||
|
private String DepartCitiesName;//出发地 是否必填 是
|
||||||
|
private String ArriveCitiesName;//目的地 是否必填 是
|
||||||
|
private String bsDate;//开始时间 是否必填 否
|
||||||
|
private String edDate;//结束时间 是否必填 否
|
||||||
|
private String Reason;//新增行程原因 是否必填 否
|
||||||
|
}
|
||||||
|
|
||||||
|
//原行程信息
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public static class OldTrip {
|
||||||
|
private String AllowProductTypes;//行程类型 是否必填 是
|
||||||
|
private String DepartCitiesName;//出发地 是否必填 是
|
||||||
|
private String ArriveCitiesName;//目的地 是否必填 是
|
||||||
|
private String bsDate;//开始时间 是否必填 否
|
||||||
|
private String edDate;//结束时间 是否必填 否
|
||||||
|
}
|
||||||
|
|
||||||
|
//变更行程信息
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public static class ChangeTrip {
|
||||||
|
private String AllowProductTypes;//行程类型 是否必填 是
|
||||||
|
private String DepartCitiesName;//出发地 是否必填 是
|
||||||
|
private String ArriveCitiesName;//目的地 是否必填 是
|
||||||
|
private String bsDate;//开始时间 是否必填 否
|
||||||
|
private String edDate;//结束时间 是否必填 否
|
||||||
|
private String Reason;//新增行程原因 是否必填 否
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
package com.chint;
|
package com.chint;
|
||||||
|
|
||||||
import cn.hutool.core.lang.hash.Hash;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
|
||||||
import com.authine.cloudpivot.opensdk.ApiException;
|
import com.authine.cloudpivot.opensdk.ApiException;
|
||||||
|
@ -10,7 +9,6 @@ import com.authine.cloudpivot.opensdk.model.response.workflow.StartWorkflowRespo
|
||||||
import com.chint.domain.aggregates.user.User;
|
import com.chint.domain.aggregates.user.User;
|
||||||
import com.chint.infrastructure.constant.LYConstant;
|
import com.chint.infrastructure.constant.LYConstant;
|
||||||
import com.chint.infrastructure.util.BaseContext;
|
import com.chint.infrastructure.util.BaseContext;
|
||||||
import com.chint.infrastructure.util.OrderNo;
|
|
||||||
import com.chint.interfaces.rest.base.PostRequest;
|
import com.chint.interfaces.rest.base.PostRequest;
|
||||||
import com.chint.interfaces.rest.bpm.XNBPM.ClientFactory;
|
import com.chint.interfaces.rest.bpm.XNBPM.ClientFactory;
|
||||||
import com.chint.interfaces.rest.bpm.XNBPM.XNTokenDto;
|
import com.chint.interfaces.rest.bpm.XNBPM.XNTokenDto;
|
||||||
|
@ -313,7 +311,7 @@ public class LYTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
//超标
|
//超标
|
||||||
// @Test
|
@Test
|
||||||
void exceedStandard() {
|
void exceedStandard() {
|
||||||
BPMBaseRequest bpmRequest = new BPMBaseRequest();
|
BPMBaseRequest bpmRequest = new BPMBaseRequest();
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
|
@ -340,7 +338,7 @@ public class LYTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
//改签
|
//改签
|
||||||
// @Test
|
@Test
|
||||||
void reschedule() {
|
void reschedule() {
|
||||||
BPMBaseRequest bpmRequest = new BPMBaseRequest();
|
BPMBaseRequest bpmRequest = new BPMBaseRequest();
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
|
@ -373,10 +371,10 @@ public class LYTest {
|
||||||
void change() {
|
void change() {
|
||||||
BPMBaseRequest bpmRequest = new BPMBaseRequest();
|
BPMBaseRequest bpmRequest = new BPMBaseRequest();
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
ChangeDto changeDto = new ChangeDto();
|
JTH3ChangeDto changeDto = new JTH3ChangeDto();
|
||||||
//新增行程
|
//新增行程
|
||||||
ArrayList<ChangeDto.NewTrip> newTrips = new ArrayList<>();
|
ArrayList<JTH3ChangeDto.NewTrip> newTrips = new ArrayList<>();
|
||||||
ChangeDto.NewTrip newTrip = new ChangeDto.NewTrip();
|
JTH3ChangeDto.NewTrip newTrip = new JTH3ChangeDto.NewTrip();
|
||||||
newTrip.setAllowProductTypes("飞机")
|
newTrip.setAllowProductTypes("飞机")
|
||||||
.setDepartCitiesName("温州")
|
.setDepartCitiesName("温州")
|
||||||
.setArriveCitiesName("北京")
|
.setArriveCitiesName("北京")
|
||||||
|
@ -385,8 +383,8 @@ public class LYTest {
|
||||||
.setReason("出差帮扶");
|
.setReason("出差帮扶");
|
||||||
newTrips.add(newTrip);
|
newTrips.add(newTrip);
|
||||||
//原行程
|
//原行程
|
||||||
ArrayList<ChangeDto.OldTrip> oldTrips = new ArrayList<>();
|
ArrayList<JTH3ChangeDto.OldTrip> oldTrips = new ArrayList<>();
|
||||||
ChangeDto.OldTrip oldTrip = new ChangeDto.OldTrip();
|
JTH3ChangeDto.OldTrip oldTrip = new JTH3ChangeDto.OldTrip();
|
||||||
oldTrip.setAllowProductTypes("火车")
|
oldTrip.setAllowProductTypes("火车")
|
||||||
.setDepartCitiesName("温州")
|
.setDepartCitiesName("温州")
|
||||||
.setArriveCitiesName("杭州")
|
.setArriveCitiesName("杭州")
|
||||||
|
@ -394,8 +392,8 @@ public class LYTest {
|
||||||
.setEdDate("2024-03-01");
|
.setEdDate("2024-03-01");
|
||||||
oldTrips.add(oldTrip);
|
oldTrips.add(oldTrip);
|
||||||
//变更行程
|
//变更行程
|
||||||
ArrayList<ChangeDto.ChangeTrip> changeTrips = new ArrayList<>();
|
ArrayList<JTH3ChangeDto.ChangeTrip> changeTrips = new ArrayList<>();
|
||||||
ChangeDto.ChangeTrip changeTrip = new ChangeDto.ChangeTrip();
|
JTH3ChangeDto.ChangeTrip changeTrip = new JTH3ChangeDto.ChangeTrip();
|
||||||
changeTrip.setAllowProductTypes("火车")
|
changeTrip.setAllowProductTypes("火车")
|
||||||
.setDepartCitiesName("乐清")
|
.setDepartCitiesName("乐清")
|
||||||
.setArriveCitiesName("杭州")
|
.setArriveCitiesName("杭州")
|
||||||
|
@ -448,7 +446,8 @@ public class LYTest {
|
||||||
.setReason("酒店爆满订不到");//超标原因
|
.setReason("酒店爆满订不到");//超标原因
|
||||||
|
|
||||||
String entityParamValues = gson.toJson(exceedStandardDto);
|
String entityParamValues = gson.toJson(exceedStandardDto);
|
||||||
Type type = new TypeToken<HashMap<String, Object>>(){}.getType();
|
Type type = new TypeToken<HashMap<String, Object>>() {
|
||||||
|
}.getType();
|
||||||
HashMap<String, Object> map = gson.fromJson(entityParamValues, type);
|
HashMap<String, Object> map = gson.fromJson(entityParamValues, type);
|
||||||
request.setData(map);//数据
|
request.setData(map);//数据
|
||||||
request.setDepartmentId("");//部门id,默认主部门
|
request.setDepartmentId("");//部门id,默认主部门
|
||||||
|
@ -490,7 +489,8 @@ public class LYTest {
|
||||||
.setFee(BigDecimal.valueOf(100))//费用
|
.setFee(BigDecimal.valueOf(100))//费用
|
||||||
.setReason("行程冲突");//原因
|
.setReason("行程冲突");//原因
|
||||||
String entityParamValues = gson.toJson(rescheduleDto);
|
String entityParamValues = gson.toJson(rescheduleDto);
|
||||||
Type type = new TypeToken<HashMap<String, Object>>(){}.getType();
|
Type type = new TypeToken<HashMap<String, Object>>() {
|
||||||
|
}.getType();
|
||||||
HashMap<String, Object> map = gson.fromJson(entityParamValues, type);
|
HashMap<String, Object> map = gson.fromJson(entityParamValues, type);
|
||||||
request.setData(map);//数据
|
request.setData(map);//数据
|
||||||
request.setDepartmentId("");//部门id,默认主部门
|
request.setDepartmentId("");//部门id,默认主部门
|
||||||
|
@ -505,4 +505,72 @@ public class LYTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 差旅变更申请
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDemo3() throws Exception {
|
||||||
|
XNTokenDto xnTokenDto = httpPostRequest.get(XNBPMUrl + XNBPM_TOKEN_URL + "?code=" + "191107079", XNTokenDto.class);
|
||||||
|
if (!"0".equals(xnTokenDto.getErrcode())) {
|
||||||
|
throw new RuntimeException("用户不存在!");
|
||||||
|
}
|
||||||
|
String userId = xnTokenDto.getUser_id();
|
||||||
|
CloudpivotOpenClient client = ClientFactory.getInstance();
|
||||||
|
StartWorkflowRequest request = new StartWorkflowRequest();
|
||||||
|
Gson gson = new Gson();
|
||||||
|
XNChangeDto changeDto = new XNChangeDto();
|
||||||
|
//新增行程
|
||||||
|
ArrayList<JTH3ChangeDto.NewTrip> newTrips = new ArrayList<>();
|
||||||
|
JTH3ChangeDto.NewTrip newTrip = new JTH3ChangeDto.NewTrip();
|
||||||
|
newTrip.setAllowProductTypes("飞机")
|
||||||
|
.setDepartCitiesName("温州")
|
||||||
|
.setArriveCitiesName("北京")
|
||||||
|
.setBsDate("2024-03-01")
|
||||||
|
.setEdDate("2024-03-01")
|
||||||
|
.setReason("出差帮扶");
|
||||||
|
newTrips.add(newTrip);
|
||||||
|
//原行程
|
||||||
|
ArrayList<JTH3ChangeDto.OldTrip> oldTrips = new ArrayList<>();
|
||||||
|
JTH3ChangeDto.OldTrip oldTrip = new JTH3ChangeDto.OldTrip();
|
||||||
|
oldTrip.setAllowProductTypes("火车")
|
||||||
|
.setDepartCitiesName("温州")
|
||||||
|
.setArriveCitiesName("杭州")
|
||||||
|
.setBsDate("2024-03-01")
|
||||||
|
.setEdDate("2024-03-01");
|
||||||
|
oldTrips.add(oldTrip);
|
||||||
|
//变更行程
|
||||||
|
ArrayList<JTH3ChangeDto.ChangeTrip> changeTrips = new ArrayList<>();
|
||||||
|
JTH3ChangeDto.ChangeTrip changeTrip = new JTH3ChangeDto.ChangeTrip();
|
||||||
|
changeTrip.setAllowProductTypes("火车")
|
||||||
|
.setDepartCitiesName("乐清")
|
||||||
|
.setArriveCitiesName("杭州")
|
||||||
|
.setBsDate("2024-03-01")
|
||||||
|
.setEdDate("2024-03-01")
|
||||||
|
.setReason("出发地变更");
|
||||||
|
changeTrips.add(changeTrip);
|
||||||
|
//设置值
|
||||||
|
changeDto.setStartTime("2024-03-01")//出差开始时间
|
||||||
|
.setEndTime("2024-03-01")//出差结束时间
|
||||||
|
.setReason("出差帮扶")//出差说明
|
||||||
|
.setXN_AS_CLBGSQ_ITEM_NewTrip(newTrips)//新增行程信息
|
||||||
|
.setXN_AS_CLBGSQ_ITEM_OldTrip(oldTrips)//原行程信息
|
||||||
|
.setXN_AS_CLBGSQ_ITEM_ChangeTrip(changeTrips);//变更行程信息
|
||||||
|
|
||||||
|
String entityParamValues = gson.toJson(changeDto);
|
||||||
|
Type type = new TypeToken<HashMap<String, Object>>() {
|
||||||
|
}.getType();
|
||||||
|
HashMap<String, Object> map = gson.fromJson(entityParamValues, type);
|
||||||
|
request.setData(map);//数据
|
||||||
|
request.setDepartmentId("");//部门id,默认主部门
|
||||||
|
request.setFinishStart(true);//发起流程
|
||||||
|
request.setUserId(userId);//员工号
|
||||||
|
request.setWorkflowCode("XN_AS_CLBGSQ");//差旅变更流程
|
||||||
|
try {
|
||||||
|
StartWorkflowResponse response = client.startWorkflow(request);
|
||||||
|
System.out.println("response = " + JSON.toJSONString(response));
|
||||||
|
} catch (ApiException e) {
|
||||||
|
throw new RuntimeException(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue