diff --git a/src/main/java/com/chint/interfaces/rest/amap/dto/travelapplication/DepartTimeLimit.java b/src/main/java/com/chint/interfaces/rest/amap/dto/travelapplication/DepartTimeLimit.java new file mode 100644 index 00000000..41012b1b --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/amap/dto/travelapplication/DepartTimeLimit.java @@ -0,0 +1,22 @@ +package com.chint.interfaces.rest.amap.dto.travelapplication; + +import lombok.Data; + +/** + * 允许的出发时间范围 + * + * (如需限制发单时间则参数必填) + * @Author:nxj + * @Date:2024/4/25 9:38 + */ +@Data +public class DepartTimeLimit { + /** + * 是否支持跨天,0-否 1-是;跨天只用来对时间参数做强校验,如end < start ,type=0会拦截 + */ + private Integer type; + //开始时间(HH:mm:ss) + private String start; + //终止时间(HH:mm:ss) + private String end; +} diff --git a/src/main/java/com/chint/interfaces/rest/amap/dto/travelapplication/ModifyTravelApplicationDto.java b/src/main/java/com/chint/interfaces/rest/amap/dto/travelapplication/ModifyTravelApplicationDto.java new file mode 100644 index 00000000..bd4862fd --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/amap/dto/travelapplication/ModifyTravelApplicationDto.java @@ -0,0 +1,58 @@ +package com.chint.interfaces.rest.amap.dto.travelapplication; + +import com.chint.interfaces.rest.amap.BaseRequestParam; +import lombok.Data; + +/** + * 提交申请单 + * @Author:nxj + * @Date:2024/4/24 16:44 + */ +@Data +public class ModifyTravelApplicationDto extends BaseRequestParam { + + /** + * 必填 + */ + //企业审批ID + private String outApplyRecordId; + //高德审批ID + private String applyRecordId; + //审批模板Code :travel + private String templateCode; + + + + + + /** + * 非必填 + */ + //申请人手机号 + private String applyMobile; + //申请人姓名 + private String applyName; + //部门ID + private String departmentId; + //部门名称 + private String departmentName; + //申请单【审批模板】内容(JSON格式) + private ProcessContent processContent; + //审批状态 1有效 0无效 + private String status; + //申请备注/原因(长度限制256字符) + private String remark; + //申请单场景入口展示名称(长度限制64字符) + private String sceneName; + //是否占用个人月度限额, 0 否 1 是,默认为0 + private String usePersonalAmount; + /** + * 支持的叫车业务类型 + *(1 实时单,2 预约单,3 接送机,5 接送站,6 代叫车; + *可传多个,多个参数⽤英⽂逗号分隔,例:1,2; + *不传默认为 实时单+预约单) + */ + private String orderServiceType; + //企业自定义申请单名称(长度限制5字符),申请单入口标签名称 + private String customSceneLabel; +} diff --git a/src/main/java/com/chint/interfaces/rest/amap/dto/travelapplication/ProcessContent.java b/src/main/java/com/chint/interfaces/rest/amap/dto/travelapplication/ProcessContent.java new file mode 100644 index 00000000..5fc0722e --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/amap/dto/travelapplication/ProcessContent.java @@ -0,0 +1,64 @@ +package com.chint.interfaces.rest.amap.dto.travelapplication; + +import lombok.Data; + +import java.util.List; + +/** + * 审批单 + * @Author:nxj + * @Date:2024/4/25 9:13 + */ +@Data +public class ProcessContent { + /** + * 必填 + */ + //权限开始时间(yyyy-MM-dd) + private String startTime; + //单笔限额 -1 表示不限制【单位分】 + private String amountLimited; + //0-不允许跨城 1-允许跨城 2-不允许跨城,但部分临近城市可以跨城用车 + private String allowCrossCity; + + + /** + * 权限结束时间(yyyy-MM-dd) + * + * 不传表示不限制结束日期 + * + * 日限额必传(且不能大于startTime179天) + */ + private String endTime; + /** + * 可用城市列表 + * + * 不传表示不限制可用城市 + * + * 需要采用城市信息的adcode,最多不超过25个adcode + */ + private List validCityList; + //不传表示不限制用车类型 + private List carTypeList; + //日限额必传 限额方式 1日清 2每日累加(传错或不传视为不限额) + private String applyDailyAmountType; + //每日限额金额,单位分,值必须为正整数。日限额必传,applyDailyAmountType值有效时才生效 + private String dailyAmountLimited; + //允许的出发时间范围(如需限制发单时间则参数必填) + private DepartTimeLimit departTimeLimit; + /** + * 允许部分跨城的城市白名单 + * + * 格式例如:adcode-adcode; + * + * 110000-120000;110000-130000-140000 + */ + private String whiteCityGroup; + //申请单总计可用车次数 不传代表不限制,格式要求:1-99 的正整数 + private String applyTotalCount; + //申请单每日可用车次数 不传代表不限制,格式要求:1-99 的正整数 + private String applyCountPerDay; + + + +} diff --git a/src/main/java/com/chint/interfaces/rest/amap/dto/travelapplication/TravelApplicationDto.java b/src/main/java/com/chint/interfaces/rest/amap/dto/travelapplication/TravelApplicationDto.java new file mode 100644 index 00000000..24e73f0d --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/amap/dto/travelapplication/TravelApplicationDto.java @@ -0,0 +1,68 @@ +package com.chint.interfaces.rest.amap.dto.travelapplication; + +import com.chint.interfaces.rest.amap.BaseRequestParam; +import lombok.Data; + +/** + * 提交申请单 + * @Author:nxj + * @Date:2024/4/24 16:44 + */ +@Data +public class TravelApplicationDto extends BaseRequestParam { + + /** + * 必填 + */ + //企业审批ID + private String outApplyRecordId; + //申请人UserId + private String applyEUserId; + //申请人手机号 + private String applyMobile; + //申请人姓名 + private String applyName; + //审批模板Code :travel + private String templateCode; + //申请单【审批模板】内容(JSON格式) + private ProcessContent processContent; + //审批状态 1有效 0无效 + private String status; + + + + /** + * 非必填 + */ + //部门ID + private String departmentId; + //部门名称 + private String departmentName; + //申请备注/原因(长度限制256字符) + private String remark; + //申请单场景入口展示名称(长度限制64字符) + private String sceneName; + //企业自定义字段(企业自行定义数据结构进行解析)长度限制1024 + private String enterpriseCustomFields; + //申请单总限额(分),不传表示不限 + private String totalQuotaAmount; + //是否占用个人月度限额, 0 否 1 是,默认为0 + private String usePersonalAmount; + /** + * 支持的叫车业务类型 + *(1 实时单,2 预约单,3 接送机,5 接送站,6 代叫车; + *可传多个,多个参数⽤英⽂逗号分隔,例:1,2; + *不传默认为 实时单+预约单) + */ + private String orderServiceType; + /** + * 申请单关联的制度 id + *纯申请单:不传 + *申请单关联制度:必传,传【出差】场景制度ID(需开通申请单API能力) + */ + private String regulationId; + //企业自定义申请单名称(长度限制5字符),申请单入口标签名称 + private String customSceneLabel; + //同行人信息(具体字段见【同行人信息】) + private String companions; +} diff --git a/src/main/java/com/chint/interfaces/rest/amap/dto/travelapplication/TravelApplicationDtoResponse.java b/src/main/java/com/chint/interfaces/rest/amap/dto/travelapplication/TravelApplicationDtoResponse.java new file mode 100644 index 00000000..1baf3638 --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/amap/dto/travelapplication/TravelApplicationDtoResponse.java @@ -0,0 +1,17 @@ +package com.chint.interfaces.rest.amap.dto.travelapplication; + +import com.chint.interfaces.rest.amap.BaseResponse; +import lombok.Data; + +/** + * + * @Author:nxj + * @Date:2024/4/24 16:59 + */ +@Data +public class TravelApplicationDtoResponse extends BaseResponse { + //高德审批单ID + private String data; + //服务器时间 + private Long timestamp; +} diff --git a/src/main/java/com/chint/interfaces/rest/amap/request/TravelApplicationRequest.java b/src/main/java/com/chint/interfaces/rest/amap/request/TravelApplicationRequest.java new file mode 100644 index 00000000..08ff2d33 --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/amap/request/TravelApplicationRequest.java @@ -0,0 +1,30 @@ +package com.chint.interfaces.rest.amap.request; + +import com.chint.interfaces.rest.amap.dto.travelapplication.ModifyTravelApplicationDto; +import com.chint.interfaces.rest.amap.dto.travelapplication.TravelApplicationDto; +import com.chint.interfaces.rest.amap.dto.travelapplication.TravelApplicationDtoResponse; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * 差旅 + * @Author:nxj + * @Date:2024/4/24 16:40 + */ +public class TravelApplicationRequest { + //创建差旅申请单 + private final static String APPLY_RECORD_CREATE="/ws/boss/enterprise/openapi/apply/record/create"; + + //修改差旅申请单 + private final static String APPLY_RECORD_UPDATE="/ws/boss/enterprise/openapi/apply/record/update"; + + @Autowired + private AmapRequest amapRequest; + + public TravelApplicationDtoResponse apply(TravelApplicationDto dto){ + return amapRequest.post(APPLY_RECORD_CREATE,dto, TravelApplicationDtoResponse.class); + } + + public TravelApplicationDtoResponse modify(ModifyTravelApplicationDto dto){ + return amapRequest.post(APPLY_RECORD_UPDATE,dto, TravelApplicationDtoResponse.class); + } +}