yao-zengchun
2025-05-23 2fca78b4607264e13a11f0deb84c34c9ac9489cc
Merge branch 'wcd-2411-update' of http://192.168.1.110:5678/r/pms-upgrade into wcd
62 files added
24 files modified
4847 ■■■■■ changed files
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/api/WxCpOaWeDocSmartsheetService.java 235 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/api/impl/WxCpOaWeDocSmartsheetServiceImpl.java 157 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/constant/WxCpSmartSheetApiPathConsts.java 91 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/AttachmentFieldProperty.java 27 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/AutoNumberFieldProperty.java 40 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/CheckboxFieldProperty.java 27 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/CreatedTimeFieldProperty.java 28 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/CurrencyFieldProperty.java 48 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/DateTimeFieldProperty.java 33 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/Field.java 154 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/FieldNumberRule.java 34 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/FieldOption.java 41 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/LocationFieldProperty.java 27 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/ModifiedTimeFieldProperty.java 28 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/NumberFieldProperty.java 34 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/PercentageFieldProperty.java 34 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/ProgressFieldProperty.java 28 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/ReferenceFieldProperty.java 45 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/SelectFieldProperty.java 34 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/SingleSelectFieldProperty.java 34 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/UrlFieldProperty.java 27 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/UserFieldProperty.java 33 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/WwGroupFieldProperty.java 27 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/WxCpFieldCreateData.java 29 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/WxCpFieldCreateRequest.java 48 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/WxCpFieldEditData.java 29 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/WxCpFieldEditRequest.java 49 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/WxCpFieldInfo.java 35 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/WxCpFieldQueryRequest.java 72 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/Record.java 156 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordCellAttachmentValue.java 63 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordCellImageValue.java 51 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordCellLocationValue.java 51 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordCellTextValue.java 39 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordCellUrlValue.java 39 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordCellUserValue.java 27 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordOption.java 41 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordSort.java 34 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/WxCpRecordCreateData.java 27 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/WxCpRecordCreateRequest.java 52 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/WxCpRecordEditData.java 27 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/WxCpRecordEditRequest.java 52 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/WxCpRecordInfo.java 47 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/WxCpRecordQueryRequest.java 90 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/sheet/SheetProperties.java 51 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/sheet/WxCpSheetCreateData.java 25 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/sheet/WxCpSheetCreateRequest.java 38 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/sheet/WxCpSheetEditRequest.java 41 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/sheet/WxCpSheetInfo.java 29 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/sheet/WxCpSheetQueryRequest.java 47 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/View.java 30 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/ViewCondition.java 141 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/ViewFilterSpec.java 34 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/ViewGroupSpec.java 28 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/ViewProperty.java 64 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/ViewSortSpec.java 28 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/ViewSpecInfo.java 33 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/WxCpViewCreateData.java 25 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/WxCpViewCreateRequest.java 119 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/WxCpViewEditRequest.java 59 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/WxCpViewInfo.java 47 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/WxCpViewQueryRequest.java 60 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/approval/rest/ApproveEventController.java 14 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/AttendanceService.java 8 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/dto/AttendanceLeaveQueryCriteria.java 8 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/dto/AttendanceOvertimeQueryCriteria.java 6 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceBusinessTravelServiceImpl.java 103 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceServiceImpl.java 62 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/constant/Constant.java 13 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/rest/ProjectController.java 9 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/service/ProjectService.java 6 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/service/impl/ProjectServiceImpl.java 17 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/WeComServiceImpl.java 1039 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/OpenApiWeComMethod.java 8 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/rest/TaskDaliyController.java 9 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/TaskDaliyService.java 5 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskDaliyServiceImpl.java 31 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/temp/service/WechatSendHistoryService.java 6 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/temp/service/dto/WechatSendHistoryQueryCriteria.java 3 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/temp/service/impl/WechatSendHistoryServiceImpl.java 17 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/api/project/project.js 10 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/api/task/taskDaliy.js 10 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/components/ApprovalLine/index.vue 8 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/attendance/attendanceBusinessTravel/index.vue 36 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/project/project/index.vue 70 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/task/taskDaliy/index.vue 126 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/api/WxCpOaWeDocSmartsheetService.java
New file
@@ -0,0 +1,235 @@
package me.zhengjie.weixin.cp.api;
import lombok.NonNull;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
import me.zhengjie.weixin.cp.bean.smartsheet.field.*;
import me.zhengjie.weixin.cp.bean.smartsheet.record.*;
import me.zhengjie.weixin.cp.bean.smartsheet.sheet.*;
import me.zhengjie.weixin.cp.bean.smartsheet.view.*;
import java.util.List;
/**
 * 企业微信文档相关接口
 * <a href="https://developer.work.weixin.qq.com/document/path/97392">文档</a>
 *
 * @author baolh
 */
public interface WxCpOaWeDocSmartsheetService {
    /**
     * 添加子表
     * 本接口用于在表格的某个位置添加一个智能表,该智能表不存在视图、记录和字段,可以使用 API 在该智能表中添加视图、记录和字段。
     * <p>
     * 请求方式:POST(HTTPS)
     * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/add_sheet?access_token=ACCESS_TOKEN
     *
     * @param request 添加子表对应请求参数
     * @return properties:智能表属性,properties.sheet_id:智能表 ID,创建子表时生成的 6 位随机 ID,properties.title:智能表标题,properties.index:智能表下标
     * @throws WxErrorException the wx error exception
     */
    WxCpSheetCreateData sheetCreate(@NonNull WxCpSheetCreateRequest request) throws WxErrorException;
    /**
     * 删除子表
     * 本接口用于删除在线表格中的某个智能表。
     * <p>
     * 请求方式:POST(HTTPS)
     * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/delete_sheet?access_token=ACCESS_TOKEN
     *
     * @param docId 文档的docid
     * @param sheetId 删除的Smartsheet 子表 ID
     * @return wx cp base resp
     * @throws WxErrorException the wx error exception
     */
    WxCpBaseResp sheetDelete(String docId, String sheetId) throws WxErrorException;
    /**
     * 更新子表
     * 本接口用于修改表格中某个子表的标题。
     * <p>
     * 请求方式:POST(HTTPS)
     * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/update_sheet?access_token=ACCESS_TOKEN
     *
     * @param request 更新子表对应请求参数
     * @return wx cp base resp
     * @throws WxErrorException the wx error exception
     */
    WxCpBaseResp sheetEdit(@NonNull WxCpSheetEditRequest request) throws WxErrorException;
    /**
     * 查询子表
     * 本接口用于查询一篇在线表格中全部智能表信息。
     * <p>
     * 请求方式:POST(HTTPS)
     * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/get_sheet?access_token=ACCESS_TOKEN
     *
     * @param request 查询子表对应请求参数
     * @return sheetList:智能表信息列表
     * @throws WxErrorException the wx error exception
     */
    WxCpSheetInfo sheetInfo(@NonNull WxCpSheetQueryRequest request) throws WxErrorException;
    /**
     * 添加视图
     * 本接口用于在 Smartsheet 中的某个子表里添加一个新视图。单表最多允许有200个视图。
     * <p>
     * 请求方式:POST(HTTPS)
     * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/add_view?access_token=ACCESS_TOKEN
     *
     * @param request 添加子表对应请求参数
     * @return view:添加视图响应
     * @throws WxErrorException the wx error exception
     */
    WxCpViewCreateData viewCreate(@NonNull WxCpViewCreateRequest request) throws WxErrorException;
    /**
     * 删除视图
     * 本接口用于在 smartsheet 中的某个子表里删除若干个视图。
     * <p>
     * 请求方式:POST(HTTPS)
     * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/delete_views?access_token=ACCESS_TOKEN
     *
     * @param docId 文档的docid
     * @param sheetId Smartsheet 子表ID
     * @param viewIds 要删除的视图ID列表
     * @return wx cp base resp
     * @throws WxErrorException the wx error exception
     */
    WxCpBaseResp viewDelete(String docId, String sheetId, List<String> viewIds) throws WxErrorException;
    /**
     * 更新视图
     * 本接口用于在 smartsheet 中的某个子表里更新若干个视图。
     * <p>
     * 请求方式:POST(HTTPS)
     * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/update_view?access_token=ACCESS_TOKEN
     *
     * @param request 更新视图对应请求参数
     * @return wx cp base resp
     * @throws WxErrorException the wx error exception
     */
    WxCpBaseResp viewEdit(@NonNull WxCpViewEditRequest request) throws WxErrorException;
    /**
     * 查询视图
     * 本接口用于获取 Smartsheet 中某个子表里全部视图信息。
     * <p>
     * 请求方式:POST(HTTPS)
     * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/get_views?access_token=ACCESS_TOKEN
     *
     * @param request 查询视图对应请求参数
     * @return total:符合筛选条件的视图总数,hasMore:是否还有更多项,next:下次下一个搜索结果的偏移量,views:视图数据,
     * @throws WxErrorException the wx error exception
     */
    WxCpViewInfo viewInfo(@NonNull WxCpViewQueryRequest request) throws WxErrorException;
    /**
     * 添加字段
     * 本接口用于在智能表中的某个子表里添加一列或多列新字段。单表最多允许有150个字段。
     * <p>
     * 请求方式:POST(HTTPS)
     * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/add_fields?access_token=ACCESS_TOKEN
     *
     * @param request 添加字段对应请求参数
     * @return fields:字段详情
     * @throws WxErrorException the wx error exception
     */
    WxCpFieldCreateData fieldCreate(@NonNull WxCpFieldCreateRequest request) throws WxErrorException;
    /**
     * 删除字段
     * 本接口用于删除智能表中的某个子表里的一列或多列字段。
     * <p>
     * 请求方式:POST(HTTPS)
     * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/delete_fields?access_token=ACCESS_TOKEN
     *
     * @param docId 文档的docid
     * @param sheetId 表格ID
     * @param fieldIds 需要删除的字段id列表
     * @return wx cp base resp
     * @throws WxErrorException the wx error exception
     */
    WxCpBaseResp fieldDelete(String docId, String sheetId, List<String> fieldIds) throws WxErrorException;
    /**
     * 更新字段
     * 本接口用于更新智能中的某个子表里的一个或多个字段的标题和字段属性信息。
     * <p>
     * 请求方式:POST(HTTPS)
     * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/update_fields?access_token=ACCESS_TOKEN
     *
     * @param request 添加字段对应请求参数
     * @return fields:字段详情
     * @throws WxErrorException the wx error exception
     */
    WxCpFieldEditData fieldEdit(@NonNull WxCpFieldEditRequest request) throws WxErrorException;
    /**
     * 查询字段
     * 本接口用于获取智能表中某个子表下字段信息,该接口可以完成下面三种功能:获取全部字段信息、依据字段名获取对应字段、依据字段 ID 获取对应字段信息。
     * <p>
     * 请求方式:POST(HTTPS)
     * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/get_fields?access_token=ACCESS_TOKEN
     *
     * @param request 查询字段对应请求参数
     * @return total:字段总数,fields:字段详情,
     * @throws WxErrorException the wx error exception
     */
    WxCpFieldInfo fieldInfo(@NonNull WxCpFieldQueryRequest request) throws WxErrorException;
    /**
     * 添加记录
     * 本接口用于在 Smartsheet 中的某个子表里添加一行或多行新记录。单表最多允许有40000行记录。
     * 注意:不能通过添加记录接口给创建时间、最后编辑时间、创建人和最后编辑人四种类型的字段添加记录。
     * <p>
     * 请求方式:POST(HTTPS)
     * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/add_records?access_token=ACCESS_TOKEN
     *
     * @param request 添加记录对应请求参数
     * @return fields:字段详情
     * @throws WxErrorException the wx error exception
     */
    WxCpRecordCreateData recordCreate(@NonNull WxCpRecordCreateRequest request) throws WxErrorException;
    /**
     * 删除记录
     * 本接口用于删除 Smartsheet 的某个子表中的一行或多行记录。
     * <p>
     * 请求方式:POST(HTTPS)
     * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/delete_records?access_token=ACCESS_TOKEN
     *
     * @param docId 文档的docid
     * @param sheetId Smartsheet 子表ID
     * @param recordIds 要删除的记录 ID
     * @return wx cp base resp
     * @throws WxErrorException the wx error exception
     */
    WxCpBaseResp recordDelete(String docId, String sheetId, List<String> recordIds) throws WxErrorException;
    /**
     * 更新记录
     * 本接口用于更新 Smartsheet 中的某个子表里的一行或多行记录。
     * <p>
     * 请求方式:POST(HTTPS)
     * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/update_records?access_token=ACCESS_TOKEN
     *
     * @param request 添加字段对应请求参数
     * @return records:由更新成功的记录的具体内容组成的 JSON 数组
     * @throws WxErrorException the wx error exception
     */
    WxCpRecordEditData recordEdit(@NonNull WxCpRecordEditRequest request) throws WxErrorException;
    /**
     * 查询记录
     * 本接口用于获取 Smartsheet 中某个子表下记录信息,该接口可以完成下面三种功能:获取全部记录信息、依据字段名和记录 ID 获取对应记录、对记录进行排序。
     * <p>
     * 请求方式:POST(HTTPS)
     * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/get_records?access_token=ACCESS_TOKEN
     *
     * @param request 查询记录对应请求参数
     * @return total:记录总数,hasMore:是否还有更多项,next:下次下一个搜索结果的偏移量,records:由查询记录的具体内容组成的 JSON 数组,
     * @throws WxErrorException the wx error exception
     */
    WxCpRecordInfo recordInfo(@NonNull WxCpRecordQueryRequest request) throws WxErrorException;
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/api/impl/WxCpOaWeDocSmartsheetServiceImpl.java
New file
@@ -0,0 +1,157 @@
package me.zhengjie.weixin.cp.api.impl;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
import me.zhengjie.weixin.cp.api.WxCpOaWeDocSmartsheetService;
import me.zhengjie.weixin.cp.bean.smartsheet.constant.WxCpSmartSheetApiPathConsts;
import me.zhengjie.weixin.cp.bean.smartsheet.field.*;
import me.zhengjie.weixin.cp.bean.smartsheet.record.*;
import me.zhengjie.weixin.cp.bean.smartsheet.sheet.*;
import me.zhengjie.weixin.cp.bean.smartsheet.view.*;
import org.springframework.stereotype.Component;
import java.util.List;
@Slf4j
@RequiredArgsConstructor
@Component
public class WxCpOaWeDocSmartsheetServiceImpl implements WxCpOaWeDocSmartsheetService {
    private final WxCpService cpService;
    @Override
    public WxCpSheetCreateData sheetCreate(@NonNull WxCpSheetCreateRequest request) throws WxErrorException {
        String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(WxCpSmartSheetApiPathConsts.Sheet.ADD_SHEET);
        String responseContent = this.cpService.post(apiUrl, request.toJson());
        return WxCpSheetCreateData.fromJson(responseContent);
    }
    @Override
    public WxCpBaseResp sheetDelete(String docId, String sheetId) throws WxErrorException {
        String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(WxCpSmartSheetApiPathConsts.Sheet.DELETE_SHEET);
        JsonObject jsonObject = new JsonObject();
        jsonObject.addProperty("docid", docId);
        jsonObject.addProperty("sheet_id", sheetId);
        String responseContent = this.cpService.post(apiUrl, jsonObject.toString());
        return WxCpBaseResp.fromJson(responseContent);
    }
    @Override
    public WxCpBaseResp sheetEdit(@NonNull WxCpSheetEditRequest request) throws WxErrorException {
        String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(WxCpSmartSheetApiPathConsts.Sheet.UPDATE_SHEET);
        String responseContent = this.cpService.post(apiUrl, request.toJson());
        return WxCpBaseResp.fromJson(responseContent);
    }
    @Override
    public WxCpSheetInfo sheetInfo(@NonNull WxCpSheetQueryRequest request) throws WxErrorException {
        String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(WxCpSmartSheetApiPathConsts.Sheet.GET_SHEET);
        String responseContent = this.cpService.post(apiUrl, request.toJson());
        return WxCpSheetInfo.fromJson(responseContent);
    }
    @Override
    public WxCpViewCreateData viewCreate(@NonNull WxCpViewCreateRequest request) throws WxErrorException {
        String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(WxCpSmartSheetApiPathConsts.View.ADD_VIEW);
        String responseContent = this.cpService.post(apiUrl, request.toJson());
        return WxCpViewCreateData.fromJson(responseContent);
    }
    @Override
    public WxCpBaseResp viewDelete(String docId, String sheetId, List<String> viewIds) throws WxErrorException {
        String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(WxCpSmartSheetApiPathConsts.View.DELETE_VIEW);
        JsonObject jsonObject = new JsonObject();
        jsonObject.addProperty("docid", docId);
        jsonObject.addProperty("sheet_id", sheetId);
        JsonArray jsonArray = viewIds.stream().collect(JsonArray::new, JsonArray::add, JsonArray::addAll);
        jsonObject.add("view_ids", jsonArray);
        String responseContent = this.cpService.post(apiUrl, jsonObject.toString());
        return WxCpBaseResp.fromJson(responseContent);
    }
    @Override
    public WxCpBaseResp viewEdit(@NonNull WxCpViewEditRequest request) throws WxErrorException {
        String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(WxCpSmartSheetApiPathConsts.View.UPDATE_VIEW);
        String responseContent = this.cpService.post(apiUrl, request.toJson());
        return WxCpBaseResp.fromJson(responseContent);
    }
    @Override
    public WxCpViewInfo viewInfo(@NonNull WxCpViewQueryRequest request) throws WxErrorException {
        String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(WxCpSmartSheetApiPathConsts.View.GET_VIEW);
        String responseContent = this.cpService.post(apiUrl, request.toJson());
        return WxCpViewInfo.fromJson(responseContent);
    }
    @Override
    public WxCpFieldCreateData fieldCreate(@NonNull WxCpFieldCreateRequest request) throws WxErrorException {
        String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(WxCpSmartSheetApiPathConsts.Field.ADD_FIELD);
        String responseContent = this.cpService.post(apiUrl, request.toJson());
        return WxCpFieldCreateData.fromJson(responseContent);
    }
    @Override
    public WxCpBaseResp fieldDelete(String docId, String sheetId, List<String> fieldIds) throws WxErrorException {
        String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(WxCpSmartSheetApiPathConsts.Field.DELETE_FIELD);
        JsonObject jsonObject = new JsonObject();
        jsonObject.addProperty("docid", docId);
        jsonObject.addProperty("sheet_id", sheetId);
        JsonArray jsonArray = fieldIds.stream().collect(JsonArray::new, JsonArray::add, JsonArray::addAll);
        jsonObject.add("field_ids", jsonArray);
        String responseContent = this.cpService.post(apiUrl, jsonObject.toString());
        return WxCpBaseResp.fromJson(responseContent);
    }
    @Override
    public WxCpFieldEditData fieldEdit(@NonNull WxCpFieldEditRequest request) throws WxErrorException {
        String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(WxCpSmartSheetApiPathConsts.Field.UPDATE_FIELD);
        String responseContent = this.cpService.post(apiUrl, request.toJson());
        return WxCpFieldEditData.fromJson(responseContent);
    }
    @Override
    public WxCpFieldInfo fieldInfo(@NonNull WxCpFieldQueryRequest request) throws WxErrorException {
        String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(WxCpSmartSheetApiPathConsts.Field.GET_FIELD);
        String responseContent = this.cpService.post(apiUrl, request.toJson());
        return WxCpFieldInfo.fromJson(responseContent);
    }
    @Override
    public WxCpRecordCreateData recordCreate(@NonNull WxCpRecordCreateRequest request) throws WxErrorException {
        String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(WxCpSmartSheetApiPathConsts.Record.ADD_RECORD);
        String responseContent = this.cpService.post(apiUrl, request.toJson());
        return WxCpRecordCreateData.fromJson(responseContent);
    }
    @Override
    public WxCpBaseResp recordDelete(String docId, String sheetId, List<String> recordIds) throws WxErrorException {
        String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(WxCpSmartSheetApiPathConsts.Record.DELETE_RECORD);
        JsonObject jsonObject = new JsonObject();
        jsonObject.addProperty("docid", docId);
        jsonObject.addProperty("sheet_id", sheetId);
        JsonArray jsonArray = recordIds.stream().collect(JsonArray::new, JsonArray::add, JsonArray::addAll);
        jsonObject.add("record_ids", jsonArray);
        String responseContent = this.cpService.post(apiUrl, jsonObject.toString());
        return WxCpBaseResp.fromJson(responseContent);
    }
    @Override
    public WxCpRecordEditData recordEdit(@NonNull WxCpRecordEditRequest request) throws WxErrorException {
        String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(WxCpSmartSheetApiPathConsts.Record.UPDATE_RECORD);
        String responseContent = this.cpService.post(apiUrl, request.toJson());
        return WxCpRecordEditData.fromJson(responseContent);
    }
    @Override
    public WxCpRecordInfo recordInfo(@NonNull WxCpRecordQueryRequest request) throws WxErrorException {
        String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(WxCpSmartSheetApiPathConsts.Record.GET_RECORD);
        String responseContent = this.cpService.post(apiUrl, request.toJson());
        return WxCpRecordInfo.fromJson(responseContent);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/constant/WxCpSmartSheetApiPathConsts.java
New file
@@ -0,0 +1,91 @@
package me.zhengjie.weixin.cp.bean.smartsheet.constant;
public interface WxCpSmartSheetApiPathConsts {
    interface Sheet {
        /**
         * 添加子表
         */
        String ADD_SHEET = "/cgi-bin/wedoc/smartsheet/add_sheet";
        /**
         * 删除子表
         */
        String DELETE_SHEET = "/cgi-bin/wedoc/smartsheet/delete_sheet";
        /**
         * 更新子表
         */
        String UPDATE_SHEET = "/cgi-bin/wedoc/smartsheet/update_sheet";
        /**
         * 查询子表
         */
        String GET_SHEET = "/cgi-bin/wedoc/smartsheet/get_sheet";
    }
    interface View {
        /**
         * 添加视图
         */
        String ADD_VIEW = "/cgi-bin/wedoc/smartsheet/add_view";
        /**
         * 删除视图
         */
        String DELETE_VIEW = "/cgi-bin/wedoc/smartsheet/delete_views";
        /**
         * 更新视图
         */
        String UPDATE_VIEW = "/cgi-bin/wedoc/smartsheet/update_view";
        /**
         * 查询视图
         */
        String GET_VIEW = "/cgi-bin/wedoc/smartsheet/get_views";
    }
    interface Field {
        /**
         * 添加字段
         */
        String ADD_FIELD = "/cgi-bin/wedoc/smartsheet/add_fields";
        /**
         * 删除字段
         */
        String DELETE_FIELD = "/cgi-bin/wedoc/smartsheet/delete_fields";
        /**
         * 更新字段
         */
        String UPDATE_FIELD = "/cgi-bin/wedoc/smartsheet/update_fields";
        /**
         * 查询字段
         */
        String GET_FIELD = "/cgi-bin/wedoc/smartsheet/get_fields";
    }
    interface Record {
        /**
         * 添加记录
         */
        String ADD_RECORD = "/cgi-bin/wedoc/smartsheet/add_records";
        /**
         * 删除记录
         */
        String DELETE_RECORD = "/cgi-bin/wedoc/smartsheet/delete_records";
        /**
         * 更新记录
         */
        String UPDATE_RECORD = "/cgi-bin/wedoc/smartsheet/update_records";
        /**
         * 查询记录
         */
        String GET_RECORD = "/cgi-bin/wedoc/smartsheet/get_records";
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/AttachmentFieldProperty.java
New file
@@ -0,0 +1,27 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class AttachmentFieldProperty implements Serializable {
    private static final long serialVersionUID = 8146652996582944847L;
    /**
     * 设置展示样式:DISPLAY_MODE_LIST-列表样式;DISPLAY_MODE_GRID-宫格样式
     */
    @SerializedName("display_mode")
    private String displayMode;
    public static AttachmentFieldProperty fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, AttachmentFieldProperty.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/AutoNumberFieldProperty.java
New file
@@ -0,0 +1,40 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.List;
@Data
public class AutoNumberFieldProperty implements Serializable {
    private static final long serialVersionUID = 8264989322286868003L;
    /**
     * 输入类型:NUMBER_TYPE_INCR-自增数字类型;NUMBER_TYPE_CUSTOM-自定义类型;
     */
    @SerializedName("type")
    private String type;
    /**
     * 自定义规则
     */
    @SerializedName("rules")
    private List<FieldNumberRule> rules;
    /**
     * 是否应用于已有编号
     */
    @SerializedName("reformat_existing_record")
    private Boolean reformatExistingRecord;
    public static AutoNumberFieldProperty fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, AutoNumberFieldProperty.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/CheckboxFieldProperty.java
New file
@@ -0,0 +1,27 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class CheckboxFieldProperty implements Serializable {
    private static final long serialVersionUID = -8297337434317087771L;
    /**
     * 新增时是否默认勾选
     */
    @SerializedName("checked")
    private Boolean checked;
    public static CheckboxFieldProperty fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, CheckboxFieldProperty.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/CreatedTimeFieldProperty.java
New file
@@ -0,0 +1,28 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class CreatedTimeFieldProperty implements Serializable {
    private static final long serialVersionUID = -5289717479666769182L;
    /**
     * 设置日期格式:yyyy"年"m"月"d"日"、yyyy-mm-dd、yyyy/m/d、m"月"d"日"、yyyy"年"m"月"d"日" dddd、
     * "yyyy"年"m"月"d"日" hh:mm、yyyy-mm-dd hh:mm、m/d/yyyy、d/m/yyyy
     */
    @SerializedName("format")
    private String format;
    public static CreatedTimeFieldProperty fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, CreatedTimeFieldProperty.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/CurrencyFieldProperty.java
New file
@@ -0,0 +1,48 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class CurrencyFieldProperty implements Serializable {
    private static final long serialVersionUID = 6359206659461067939L;
    /**
     * 输入类型:CURRENCY_TYPE_CNY-人民币;CURRENCY_TYPE_USD-美元;CURRENCY_TYPE_EUR-欧元;
     * CURRENCY_TYPE_GBP-英镑;CURRENCY_TYPE_JPY-日元;CURRENCY_TYPE_KRW-韩元;
     * CURRENCY_TYPE_HKD-港元;CURRENCY_TYPE_MOP-澳门元;CURRENCY_TYPE_TWD-新台币;
     * CURRENCY_TYPE_AED-阿联酋迪拉姆;CURRENCY_TYPE_AUD-澳大利亚元;CURRENCY_TYPE_BRL-巴西雷亚尔;
     * CURRENCY_TYPE_CAD-加拿大元;CURRENCY_TYPE_CHF-瑞士法郎;CURRENCY_TYPE_IDR-印尼卢比;
     * CURRENCY_TYPE_INR-印度卢比;CURRENCY_TYPE_MXN-墨西哥比索;CURRENCY_TYPE_MYR-马来西亚林吉特;
     * CURRENCY_TYPE_PHP-菲律宾比索;CURRENCY_TYPE_PLN-波兰兹罗提;CURRENCY_TYPE_RUB-俄罗斯卢布;
     * CURRENCY_TYPE_SGD-新加坡元;CURRENCY_TYPE_THB-泰国铢;CURRENCY_TYPE_TRY-土耳其里拉;
     * CURRENCY_TYPE_VND-越南盾;
     */
    @SerializedName("currency_type")
    private String currencyType;
    /**
     * 表示小数点的位数,即数字精度:-1-显示原值;0-代表整数;1-精确到小数点后一位(1.0);
     * 2-精确到小数点后两位(1.00);3-精确到小数点后三位(1.000);4-精确到小数点后四位(1.0000);
     */
    @SerializedName("decimal_places")
    private Integer decimalPlaces;
    /**
     * 是否使用千位符,设置此属性后数字字段将以英文逗号分隔千分位,如 1,000
     */
    @SerializedName("use_separate")
    private Boolean useSeparate;
    public static CurrencyFieldProperty fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, CurrencyFieldProperty.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/DateTimeFieldProperty.java
New file
@@ -0,0 +1,33 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class DateTimeFieldProperty implements Serializable {
    private static final long serialVersionUID = 5830572304284001526L;
    /**
     * 设置日期格式:yyyy"年"m"月"d"日"、yyyy-mm-dd、yyyy/m/d、m"月"d"日"、yyyy"年"m"月"d"日" dddd、
     * "yyyy"年"m"月"d"日" hh:mm、yyyy-mm-dd hh:mm、m/d/yyyy、d/m/yyyy
     */
    @SerializedName("format")
    private String format;
    /**
     * 新建记录时,是否自动填充时间
     */
    @SerializedName("auto_fill")
    private Boolean autoFill;
    public static DateTimeFieldProperty fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, DateTimeFieldProperty.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/Field.java
New file
@@ -0,0 +1,154 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class Field implements Serializable {
    private static final long serialVersionUID = 5351952693670880715L;
    /**
     * 字段ID
     */
    @SerializedName("field_id")
    private String fieldId;
    /**
     * 字段标题
     */
    @SerializedName("field_title")
    private String fieldTitle;
    /**
     * 字段类型:FIELD_TYPE_TEXT-文本;FIELD_TYPE_NUMBER-数字;FIELD_TYPE_CHECKBOX-复选框;
     * FIELD_TYPE_DATE_TIME-日期;FIELD_TYPE_IMAGE-图片;FIELD_TYPE_ATTACHMENT-文件;
     * FIELD_TYPE_USER-成员;FIELD_TYPE_URL-超链接;FIELD_TYPE_SELECT-多选;
     * FIELD_TYPE_CREATED_USER-创建人;FIELD_TYPE_MODIFIED_USER-最后编辑人;FIELD_TYPE_CREATED_TIME-创建时间;
     * FIELD_TYPE_MODIFIED_TIME-最后编辑时间;FIELD_TYPE_PROGRESS-进度;FIELD_TYPE_PHONE_NUMBER-电话;
     * FIELD_TYPE_EMAIL-邮件;FIELD_TYPE_SINGLE_SELECT-单选;FIELD_TYPE_REFERENCE-关联;
     * FIELD_TYPE_LOCATION-地理位置;FIELD_TYPE_CURRENCY-货币;FIELD_TYPE_WWGROUP-群;
     * FIELD_TYPE_AUTONUMBER-自动编号;FIELD_TYPE_PERCENTAGE-百分数;
     */
    @SerializedName("field_type")
    private String fieldType;
    /**
     * 文本 类型的字段属性为空
     */
    @SerializedName("property_text")
    private String propertyText;
    /**
     * 数字 类型的字段属性
     */
    @SerializedName("property_number")
    private NumberFieldProperty propertyNumber;
    /**
     * 复选框 类型的字段属性
     */
    @SerializedName("property_checkbox")
    private CheckboxFieldProperty propertyCheckbox;
    /**
     * 日期 类型的字段属性
     */
    @SerializedName("property_date_time")
    private DateTimeFieldProperty propertyDateTime;
    /**
     * 文件 类型的字段属性
     */
    @SerializedName("property_attachment")
    private AttachmentFieldProperty propertyAttachment;
    /**
     * 人员 类型的字段属性
     */
    @SerializedName("property_user")
    private UserFieldProperty propertyUser;
    /**
     * 超链接 类型的字段属性
     */
    @SerializedName("property_url")
    private UrlFieldProperty propertyUrl;
    /**
     * 多选 类型的字段属性
     */
    @SerializedName("property_select")
    private SelectFieldProperty propertySelect;
    /**
     * 创建时间 类型的字段属性
     */
    @SerializedName("property_created_time")
    private CreatedTimeFieldProperty propertyCreatedTime;
    /**
     * 最后编辑时间 类型的字段属性
     */
    @SerializedName("property_modified_time")
    private ModifiedTimeFieldProperty propertyModifiedTime;
    /**
     * 进度 类型的字段属性
     */
    @SerializedName("property_progress")
    private ProgressFieldProperty propertyProgress;
    /**
     * 单选 类型的字段属性
     */
    @SerializedName("property_single_select")
    private SingleSelectFieldProperty propertySingleSelect;
    /**
     * 引用 类型的字段属性
     */
    @SerializedName("property_reference")
    private ReferenceFieldProperty propertyReference;
    /**
     * 地理位置 类型的字段属性
     */
    @SerializedName("property_location")
    private LocationFieldProperty propertyLocation;
    /**
     * 自动编号 类型的字段属性
     */
    @SerializedName("property_auto_number")
    private AutoNumberFieldProperty propertyAutoNumber;
    /**
     * 货币 类型的字段属性
     */
    @SerializedName("property_currency")
    private CurrencyFieldProperty propertyCurrency;
    /**
     * 群 类型的字段属性
     */
    @SerializedName("property_ww_group")
    private WwGroupFieldProperty propertyWwGroup;
    /**
     * 百分数 类型的字段属性
     */
    @SerializedName("property_percentage")
    private PercentageFieldProperty propertyPercentage;
    public static Field fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, Field.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/FieldNumberRule.java
New file
@@ -0,0 +1,34 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class FieldNumberRule implements Serializable {
    private static final long serialVersionUID = 3414702884007267003L;
    /**
     * 规则类型:NUMBER_RULE_TYPE_INCR-自增id;NUMBER_RULE_TYPE_FIXED_CHAR-固定字符;
     * NUMBER_RULE_TYPE_TIME-创建时间;
     */
    @SerializedName("type")
    private String type;
    /**
     * 存放创建时间格式CreateTimeFormat 或固定字符,自增数字位数。例如:YYYYMMDD
     */
    @SerializedName("value")
    private String value;
    public static FieldNumberRule fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, FieldNumberRule.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/FieldOption.java
New file
@@ -0,0 +1,41 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class FieldOption implements Serializable {
    private static final long serialVersionUID = 4677240639752573746L;
    /**
     * 选项 ID
     */
    @SerializedName("id")
    private String id;
    /**
     * 要填写的选项内容
     */
    @SerializedName("text")
    private String text;
    /**
     * 选项颜色:1-浅红1;2-浅橙1;3-浅天蓝1;4-浅绿1;5-浅紫1;6-浅粉红1;7-浅灰1;8-白;9-灰;
     * 10-浅蓝1;11-浅蓝2;12-蓝;13-浅天蓝2;14-天蓝;15-浅绿2;16-绿;17-浅红2;18-红;
     * 19-浅橙2;20-橙;21-浅黄1;22-浅黄2;23-黄;24-浅紫2;25-紫;26-浅粉红2;27-粉红;
     */
    @SerializedName("style")
    private Integer style;
    public static FieldOption fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, FieldOption.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/LocationFieldProperty.java
New file
@@ -0,0 +1,27 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class LocationFieldProperty implements Serializable {
    private static final long serialVersionUID = -4039759248715773747L;
    /**
     * 输入类型:LOCATION_INPUT_TYPE_MANUAL-手动输入;LOCATION_INPUT_TYPE_AUTO-自动定位;
     */
    @SerializedName("input_type")
    private String inputType;
    public static LocationFieldProperty fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, LocationFieldProperty.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/ModifiedTimeFieldProperty.java
New file
@@ -0,0 +1,28 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class ModifiedTimeFieldProperty implements Serializable {
    private static final long serialVersionUID = 1813585124466186490L;
    /**
     * 设置日期格式:yyyy"年"m"月"d"日"、yyyy-mm-dd、yyyy/m/d、m"月"d"日"、yyyy"年"m"月"d"日" dddd、
     * "yyyy"年"m"月"d"日" hh:mm、yyyy-mm-dd hh:mm、m/d/yyyy、d/m/yyyy
     */
    @SerializedName("format")
    private String format;
    public static ModifiedTimeFieldProperty fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, ModifiedTimeFieldProperty.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/NumberFieldProperty.java
New file
@@ -0,0 +1,34 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class NumberFieldProperty implements Serializable {
    private static final long serialVersionUID = 8489717417031024639L;
    /**
     * 表示小数点的位数,即数字精度:-1-显示原值;0-代表整数;1-精确到小数点后一位(1.0);
     * 2-精确到小数点后两位(1.00);3-精确到小数点后三位(1.000);4-精确到小数点后四位(1.0000);
     */
    @SerializedName("decimal_places")
    private Integer decimalPlaces;
    /**
     * 是否使用千位符,设置此属性后数字字段将以英文逗号分隔千分位,如 1,000
     */
    @SerializedName("use_separate")
    private Boolean useSeparate;
    public static NumberFieldProperty fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, NumberFieldProperty.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/PercentageFieldProperty.java
New file
@@ -0,0 +1,34 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class PercentageFieldProperty implements Serializable {
    private static final long serialVersionUID = 244260441549136288L;
    /**
     * 表示小数点的位数,即数字精度:-1-显示原值;0-代表整数;1-精确到小数点后一位(1.0);
     * 2-精确到小数点后两位(1.00);3-精确到小数点后三位(1.000);4-精确到小数点后四位(1.0000);
     */
    @SerializedName("decimal_places")
    private Integer decimalPlaces;
    /**
     * 是否使用千位符,设置此属性后数字字段将以英文逗号分隔千分位,如 1,000
     */
    @SerializedName("use_separate")
    private Boolean useSeparate;
    public static PercentageFieldProperty fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, PercentageFieldProperty.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/ProgressFieldProperty.java
New file
@@ -0,0 +1,28 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class ProgressFieldProperty implements Serializable {
    private static final long serialVersionUID = -5441331254700056725L;
    /**
     * 小数位数:-1-显示原值;0-代表整数;1-精确到小数点后一位(1.0);
     * 2-精确到小数点后两位(1.00);3-精确到小数点后三位(1.000);4-精确到小数点后四位(1.0000);
     */
    @SerializedName("decimal_places")
    private Integer decimalPlaces;
    public static ProgressFieldProperty fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, ProgressFieldProperty.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/ReferenceFieldProperty.java
New file
@@ -0,0 +1,45 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class ReferenceFieldProperty implements Serializable {
    private static final long serialVersionUID = -8249394016227815187L;
    /**
     * 关联的子表id,为空时,表示关联本子表
     */
    @SerializedName("sub_id")
    private String subId;
    /**
     * 关联的字段id
     */
    @SerializedName("filed_id")
    private String filedId;
    /**
     * 是否允许多选
     */
    @SerializedName("is_multiple")
    private Boolean isMultiple;
    /**
     * 视图id
     */
    @SerializedName("view_id")
    private String viewId;
    public static ReferenceFieldProperty fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, ReferenceFieldProperty.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/SelectFieldProperty.java
New file
@@ -0,0 +1,34 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.List;
@Data
public class SelectFieldProperty implements Serializable {
    private static final long serialVersionUID = -6983864395559502772L;
    /**
     * 是否允许填写时新增选项,用户不需要设置该参数
     */
    @SerializedName("is_quick_add")
    private Boolean isQuickAdd;
    /**
     * 多选选项的格式设置
     */
    @SerializedName("options")
    private List<FieldOption> options;
    public static SelectFieldProperty fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, SelectFieldProperty.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/SingleSelectFieldProperty.java
New file
@@ -0,0 +1,34 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.List;
@Data
public class SingleSelectFieldProperty implements Serializable {
    private static final long serialVersionUID = -1905950518459659786L;
    /**
     * 是否允许填写时新增选项,用户不需要设置该参数
     */
    @SerializedName("is_quick_add")
    private Boolean isQuickAdd;
    /**
     * 单选选项的格式设置
     */
    @SerializedName("options")
    private List<FieldOption> options;
    public static SingleSelectFieldProperty fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, SingleSelectFieldProperty.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/UrlFieldProperty.java
New file
@@ -0,0 +1,27 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class UrlFieldProperty implements Serializable {
    private static final long serialVersionUID = -7106696821360341960L;
    /**
     * 超链接展示样式:LINK_TYPE_PURE_TEXT-文字;LINK_TYPE_ICON_TEXT-图标文字;
     */
    @SerializedName("type")
    private String type;
    public static UrlFieldProperty fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, UrlFieldProperty.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/UserFieldProperty.java
New file
@@ -0,0 +1,33 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class UserFieldProperty implements Serializable {
    private static final long serialVersionUID = -2257207759963849355L;
    /**
     * 允许添加多个人员
     */
    @SerializedName("is_multiple")
    private Boolean isMultiple;
    /**
     * 添加人员时通知用户,关闭后不通知
     */
    @SerializedName("is_notified")
    private Boolean isNotified;
    public static UserFieldProperty fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, UserFieldProperty.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/WwGroupFieldProperty.java
New file
@@ -0,0 +1,27 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class WwGroupFieldProperty implements Serializable {
    private static final long serialVersionUID = 4887589375831032032L;
    /**
     * 是否允许多个群聊
     */
    @SerializedName("allow_multiple")
    private Boolean allow_multiple;
    public static WwGroupFieldProperty fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, WwGroupFieldProperty.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/WxCpFieldCreateData.java
New file
@@ -0,0 +1,29 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.List;
@Data
public class WxCpFieldCreateData extends WxCpBaseResp implements Serializable {
    private static final long serialVersionUID = -4962069349749656123L;
    /**
     * 字段详情
     */
    @SerializedName("fields")
    private List<Field> fields;
    public static WxCpFieldCreateData fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, WxCpFieldCreateData.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/WxCpFieldCreateRequest.java
New file
@@ -0,0 +1,48 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.List;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class WxCpFieldCreateRequest implements Serializable {
    private static final long serialVersionUID = -4431743414513462166L;
    /**
     * 文档的docid
     */
    @SerializedName("docid")
    private String docId;
    /**
     * 表格ID
     */
    @SerializedName("sheet_id")
    private String sheetId;
    /**
     * 字段详情
     */
    @SerializedName("fields")
    private List<Field> fields;
    public static WxCpFieldCreateRequest fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, WxCpFieldCreateRequest.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/WxCpFieldEditData.java
New file
@@ -0,0 +1,29 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.List;
@Data
public class WxCpFieldEditData extends WxCpBaseResp implements Serializable {
    private static final long serialVersionUID = 8449975646062567389L;
    /**
     * 字段详情
     */
    @SerializedName("fields")
    private List<Field> fields;
    public static WxCpFieldEditData fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, WxCpFieldEditData.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/WxCpFieldEditRequest.java
New file
@@ -0,0 +1,49 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.List;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class WxCpFieldEditRequest implements Serializable {
    private static final long serialVersionUID = 319054960346725656L;
    /**
     * 文档的docid
     */
    @SerializedName("docid")
    private String docId;
    /**
     * 表格ID
     */
    @SerializedName("sheet_id")
    private String sheet_id;
    /**
     * 字段详情
     */
    @SerializedName("fields")
    private List<Field> fields;
    public static WxCpFieldEditRequest fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, WxCpFieldEditRequest.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/WxCpFieldInfo.java
New file
@@ -0,0 +1,35 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.List;
@Data
public class WxCpFieldInfo extends WxCpBaseResp implements Serializable {
    private static final long serialVersionUID = 1076663473107845717L;
    /**
     * 字段总数
     */
    @SerializedName("total")
    private Integer total;
    /**
     * 字段详情
     */
    @SerializedName("fields")
    private List<Field> fields;
    public static WxCpFieldInfo fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, WxCpFieldInfo.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/WxCpFieldQueryRequest.java
New file
@@ -0,0 +1,72 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.List;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class WxCpFieldQueryRequest implements Serializable {
    private static final long serialVersionUID = 4181290855872923676L;
    /**
     * 文档的docid
     */
    @SerializedName("docid")
    private String docId;
    /**
     * 表格ID
     */
    @SerializedName("sheet_id")
    private String sheetId;
    /**
     * 视图 ID
     */
    @SerializedName("view_id")
    private String viewId;
    /**
     * 由字段 ID 组成的 JSON 数组
     */
    @SerializedName("field_ids")
    private List<String> fieldIds;
    /**
     * 由字段标题组成的 JSON 数组
     */
    @SerializedName("field_titles")
    private List<String> fieldTitles;
    /**
     * 偏移量,初始值为 0
     */
    @SerializedName("offset")
    private Integer offset;
    /**
     * 分页大小 , 每页返回多少条数据;当不填写该参数或将该参数设置为 0 时,如果总数大于 1000,一次性返回 1000 个字段,当总数小于 1000 时,返回全部字段;limit 最大值为 1000
     */
    @SerializedName("limit")
    private Integer limit;
    public static WxCpFieldQueryRequest fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, WxCpFieldQueryRequest.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/Record.java
New file
@@ -0,0 +1,156 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.Getter;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import me.zhengjie.exception.BadRequestException;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
@Data
public class Record implements Serializable {
    private static final long serialVersionUID = 5451947001602028650L;
    /**
     * 记录 ID
     */
    @SerializedName("record_id")
    private String recordId;
    /**
     * 记录的具体内容,key 为字段标题或字段 ID
     */
    @SerializedName("values")
    private Map<String, Object> values;
    /**
     * 记录的创建时间
     */
    @SerializedName("create_time")
    private String createTime;
    /**
     * 记录的更新时间
     */
    @SerializedName("update_time")
    private String updateTime;
    /**
     * 创建者名字
     */
    @SerializedName("creator_name")
    private String creatorName;
    /**
     * 最后编辑者名字
     */
    @SerializedName("updater_name")
    private String updaterName;
    public enum DataType {
        FIELD_TYPE_TEXT,
        FIELD_TYPE_NUMBER,
        FIELD_TYPE_CHECKBOX,
        FIELD_TYPE_DATE_TIME,
        FIELD_TYPE_IMAGE,
        FIELD_TYPE_ATTACHMENT,
        FIELD_TYPE_USER,
        FIELD_TYPE_URL,
        FIELD_TYPE_SELECT,
        FIELD_TYPE_PROGRESS,
        FIELD_TYPE_PHONE_NUMBER,
        FIELD_TYPE_EMAIL,
        FIELD_TYPE_SINGLE_SELECT,
        FIELD_TYPE_LOCATION,
        FIELD_TYPE_CURRENCY,
        FIELD_TYPE_PERCENTAGE;
    }
    @Getter
    public static class TypedValue {
        private DataType type;
        private Object value;
        public TypedValue(DataType type, Object value) {
            if (type.equals(DataType.FIELD_TYPE_TEXT)) {
                if (!(value instanceof List && ((List<?>) value).stream().allMatch(RecordCellTextValue.class::isInstance))) {
                    throw new BadRequestException("类型错误");
                }
            } else if (type.equals(DataType.FIELD_TYPE_NUMBER)) {
                if (!(value instanceof Double)) {
                    throw new BadRequestException("类型错误");
                }
            } else if (type.equals(DataType.FIELD_TYPE_CHECKBOX)) {
                if (!(value instanceof Boolean)) {
                    throw new BadRequestException("类型错误");
                }
            } else if (type.equals(DataType.FIELD_TYPE_DATE_TIME)) {
                if (!(value instanceof String)) {
                    throw new BadRequestException("类型错误");
                }
            } else if (type.equals(DataType.FIELD_TYPE_IMAGE)) {
                if (!(value instanceof List && ((List<?>) value).stream().allMatch(RecordCellImageValue.class::isInstance))) {
                    throw new BadRequestException("类型错误");
                }
            } else if (type.equals(DataType.FIELD_TYPE_ATTACHMENT)) {
                if (!(value instanceof List && ((List<?>) value).stream().allMatch(RecordCellAttachmentValue.class::isInstance))) {
                    throw new BadRequestException("类型错误");
                }
            } else if (type.equals(DataType.FIELD_TYPE_USER)) {
                if(!(value instanceof List && ((List<?>) value).stream().allMatch(RecordCellUserValue.class::isInstance))) {
                    throw new BadRequestException("类型错误");
                }
            } else if (type.equals(DataType.FIELD_TYPE_URL)) {
                if (!(value instanceof List && ((List<?>) value).stream().allMatch(RecordCellUrlValue.class::isInstance))) {
                    throw new BadRequestException("类型错误");
                }
            } else if (type.equals(DataType.FIELD_TYPE_SELECT)) {
                if (!(value instanceof List && ((List<?>) value).stream().allMatch(RecordOption.class::isInstance))) {
                    throw new BadRequestException("类型错误");
                }
            } else if (type.equals(DataType.FIELD_TYPE_PROGRESS)) {
                if (!(value instanceof Double)) {
                    throw new BadRequestException("类型错误");
                }
            } else if (type.equals(DataType.FIELD_TYPE_PHONE_NUMBER)) {
                if (!(value instanceof String)) {
                    throw new BadRequestException("类型错误");
                }
            } else if (type.equals(DataType.FIELD_TYPE_EMAIL)) {
                if (!(value instanceof String)) {
                    throw new BadRequestException("类型错误");
                }
            } else if (type.equals(DataType.FIELD_TYPE_SINGLE_SELECT)) {
                if (!(value instanceof List && ((List<?>) value).stream().allMatch(RecordOption.class::isInstance))) {
                    throw new BadRequestException("类型错误");
                }
            } else if (type.equals(DataType.FIELD_TYPE_LOCATION)) {
                if (!(value instanceof List && ((List<?>) value).stream().allMatch(RecordCellLocationValue.class::isInstance))) {
                    throw new BadRequestException("类型错误");
                }
            } else if (type.equals(DataType.FIELD_TYPE_CURRENCY)) {
                if (!(value instanceof Double)) {
                    throw new BadRequestException("类型错误");
                }
            } else if (type.equals(DataType.FIELD_TYPE_PERCENTAGE)) {
                if (!(value instanceof Double)) {
                    throw new BadRequestException("类型错误");
                }
            }
            this.type = type;
            this.value = value;
        }
    }
    public static Record fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, Record.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordCellAttachmentValue.java
New file
@@ -0,0 +1,63 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class RecordCellAttachmentValue implements Serializable {
    private static final long serialVersionUID = -4394111625603696112L;
    /**
     * 文件名
     */
    @SerializedName("name")
    private String name;
    /**
     * 文件大小
     */
    @SerializedName("size")
    private Integer size;
    /**
     * 文件扩展名。文件夹为空,文件为对应文件拓展名,收集表为FORM,文档为DOC,表格为SHEET,幻灯片为SLIDE,思维导图为MIND,流程图为FLOWCHART,智能表为SMARTSHEET
     */
    @SerializedName("file_ext")
    private String fileExt;
    /**
     * 文件ID
     */
    @SerializedName("file_id")
    private String fileId;
    /**
     * 文件url ,如果是微盘文档则通过获取分享链接获得,如果是文档,则为文档url
     */
    @SerializedName("file_url")
    private String fileUrl;
    /**
     * 文件类型。文件夹为Folder,微盘文件为Wedrive,收集表为30,文档为50,表格是51,幻灯片为52,思维导图为54,流程图为55,智能表为70
     */
    @SerializedName("file_type")
    private String fileType;
    /**
     * 文件类型,用于区分文件夹和文件
     */
    @SerializedName("doc_type")
    private String docType;
    public static RecordCellAttachmentValue fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, RecordCellAttachmentValue.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordCellImageValue.java
New file
@@ -0,0 +1,51 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class RecordCellImageValue implements Serializable {
    private static final long serialVersionUID = 7922935584848729761L;
    /**
     * 图片 ID,自定义id
     */
    @SerializedName("id")
    private String id;
    /**
     * 图片标题
     */
    @SerializedName("title")
    private String title;
    /**
     * 图片链接,通过上传图片接口获取
     */
    @SerializedName("image_url")
    private String imageUrl;
    /**
     * 图片宽度
     */
    @SerializedName("width")
    private Integer width;
    /**
     * 图片高度
     */
    @SerializedName("height")
    private Integer height;
    public static RecordCellImageValue fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, RecordCellImageValue.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordCellLocationValue.java
New file
@@ -0,0 +1,51 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class RecordCellLocationValue implements Serializable {
    private static final long serialVersionUID = 5336066522888954119L;
    /**
     * 填1,表示来源为腾讯地图。目前只支持腾讯地图来源
     */
    @SerializedName("source_type")
    private Integer sourceType;
    /**
     * 地点ID
     */
    @SerializedName("id")
    private String id;
    /**
     * 纬度
     */
    @SerializedName("latitude")
    private String latitude;
    /**
     * 经度
     */
    @SerializedName("longitude")
    private String longitude;
    /**
     * 地点名称
     */
    @SerializedName("title")
    private String title;
    public static RecordCellLocationValue fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, RecordCellLocationValue.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordCellTextValue.java
New file
@@ -0,0 +1,39 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class RecordCellTextValue implements Serializable {
    private static final long serialVersionUID = 8567229542233973559L;
    /**
     * 内容为文本(值为text)、内容为链接(值为url)
     */
    @SerializedName("type")
    private String type;
    /**
     * 单元格内容
     */
    @SerializedName("text")
    private String text;
    /**
     * 当type时url时,表示链接跳转url
     */
    @SerializedName("link")
    private String link;
    public static RecordCellTextValue fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, RecordCellTextValue.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordCellUrlValue.java
New file
@@ -0,0 +1,39 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class RecordCellUrlValue implements Serializable {
    private static final long serialVersionUID = -141049080702891902L;
    /**
     * 填url
     */
    @SerializedName("type")
    private String type;
    /**
     * 链接显示文本
     */
    @SerializedName("text")
    private String text;
    /**
     * 链接跳转url
     */
    @SerializedName("link")
    private String link;
    public static RecordCellUrlValue fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, RecordCellUrlValue.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordCellUserValue.java
New file
@@ -0,0 +1,27 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class RecordCellUserValue implements Serializable {
    private static final long serialVersionUID = -5306856543716114863L;
    /**
     * 成员ID
     */
    @SerializedName("user_id")
    private String userId;
    public static RecordCellUserValue fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, RecordCellUserValue.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordOption.java
New file
@@ -0,0 +1,41 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class RecordOption implements Serializable {
    private static final long serialVersionUID = -2714323896879795602L;
    /**
     * 选项ID,当选项存在时,通过ID识别选项,当需要新增选项,则不填写此字段
     */
    @SerializedName("id")
    private String id;
    /**
     * 选项颜色。新增选项时填写:1-浅红1;2-浅橙1;3-浅天蓝1;4-浅绿1;5-浅紫1;6-浅粉红1;7-浅灰1;8-白;9-灰;
     * 10-浅蓝1;11-浅蓝2;12-蓝;13-浅天蓝2;14-天蓝;15-浅绿2;16-绿;17-浅红2;18-红;
     * 19-浅橙2;20-橙;21-浅黄1;22-浅黄2;23-黄;24-浅紫2;25-紫;26-浅粉红2;27-粉红;
     */
    @SerializedName("style")
    private Integer style;
    /**
     * 要填写的选项内容。新增选项时填写,已经存在时优先匹配已经存在的选项,否则会新增选项
     */
    @SerializedName("text")
    private String text;
    public static RecordOption fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, RecordOption.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordSort.java
New file
@@ -0,0 +1,34 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.Getter;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class RecordSort implements Serializable {
    private static final long serialVersionUID = 3375206557312718145L;
    /**
     * 需要排序的字段标题
     */
    @SerializedName("field_title")
    private String fieldTitle;
    /**
     * 是否进行降序排序,默认值为 false
     */
    @SerializedName("desc")
    private Boolean desc;
    public static RecordSort fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, RecordSort.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/WxCpRecordCreateData.java
New file
@@ -0,0 +1,27 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.List;
@Data
public class WxCpRecordCreateData extends WxCpBaseResp implements Serializable {
    /**
     * 由添加成功的记录的具体内容组成的 JSON 数组
     */
    @SerializedName("records")
    private List<Record> records;
    public static WxCpRecordCreateData fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, WxCpRecordCreateData.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/WxCpRecordCreateRequest.java
New file
@@ -0,0 +1,52 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.List;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class WxCpRecordCreateRequest implements Serializable {
    /**
     * 文档的docid
     */
    @SerializedName("docid")
    private String docId;
    /**
     * Smartsheet 子表ID
     */
    @SerializedName("sheet_id")
    private String sheetId;
    /**
     * 返回记录中单元格的key类型,默认用标题:CELL_VALUE_KEY_TYPE_FIELD_TITLE-key用字段标题表示;CELL_VALUE_KEY_TYPE_FIELD_ID-key用字段 ID 表示;
     */
    @SerializedName("key_type")
    private String keyType;
    /**
     * 需要添加的记录的具体内容组成的 JSON 数组
     */
    @SerializedName("records")
    private List<Record> records;
    public static WxCpRecordCreateRequest fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, WxCpRecordCreateRequest.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/WxCpRecordEditData.java
New file
@@ -0,0 +1,27 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.List;
@Data
public class WxCpRecordEditData extends WxCpBaseResp implements Serializable {
    /**
     * 由添加成功的记录的具体内容组成的 JSON 数组
     */
    @SerializedName("records")
    private List<Record> records;
    public static WxCpRecordEditData fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, WxCpRecordEditData.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/WxCpRecordEditRequest.java
New file
@@ -0,0 +1,52 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.List;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class WxCpRecordEditRequest implements Serializable {
    /**
     * 文档的docid
     */
    @SerializedName("docid")
    private String docId;
    /**
     * Smartsheet 子表ID
     */
    @SerializedName("sheet_id")
    private String sheetId;
    /**
     * 返回记录中单元格的key类型,默认用标题:CELL_VALUE_KEY_TYPE_FIELD_TITLE-key用字段标题表示;CELL_VALUE_KEY_TYPE_FIELD_ID-key用字段 ID 表示;
     */
    @SerializedName("key_type")
    private String keyType;
    /**
     * 需要添加的记录的具体内容组成的 JSON 数组
     */
    @SerializedName("records")
    private List<Record> records;
    public static WxCpRecordEditRequest fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, WxCpRecordEditRequest.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/WxCpRecordInfo.java
New file
@@ -0,0 +1,47 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.List;
@Data
public class WxCpRecordInfo extends WxCpBaseResp implements Serializable {
    private static final long serialVersionUID = -2565752448993692740L;
    /**
     * 记录总数
     */
    @SerializedName("total")
    private Integer total;
    /**
     * 是否还有更多项
     */
    @SerializedName("has_more")
    private Boolean hasMore;
    /**
     * 下次下一个搜索结果的偏移量
     */
    @SerializedName("next")
    private Integer next;
    /**
     * 由查询记录的具体内容组成的 JSON 数组
     */
    @SerializedName("records")
    private List<Record> records;
    public static WxCpRecordInfo fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, WxCpRecordInfo.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/WxCpRecordQueryRequest.java
New file
@@ -0,0 +1,90 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.List;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class WxCpRecordQueryRequest implements Serializable {
    private static final long serialVersionUID = 1623084825199377776L;
    /**
     * 文档的docid
     */
    @SerializedName("docid")
    private String docId;
    /**
     * Smartsheet 子表ID
     */
    @SerializedName("sheet_id")
    private String sheetId;
    /**
     * 视图 ID
     */
    @SerializedName("view_id")
    private String viewId;
    /**
     * 由记录 ID 组成的 JSON 数组
     */
    @SerializedName("record_ids")
    private List<String> recordIds;
    /**
     * 返回记录中单元格的key类型:CELL_VALUE_KEY_TYPE_FIELD_TITLE-key用字段标题表示;CELL_VALUE_KEY_TYPE_FIELD_ID-key用字段 ID 表示;
     */
    @SerializedName("key_type")
    private String keyType;
    /**
     * 返回指定列,由字段 ID 组成的 JSON 数组 ,key_type 为 CELL_VALUE_KEY_TYPE_FIELD_ID 时有效
     */
    @SerializedName("field_ids")
    private List<String> fieldIds;
    /**
     * 返回指定列,由字段标题组成的 JSON 数组 ,key_type 为 CELL_VALUE_KEY_TYPE_FIELD_TITLE 时有效
     */
    @SerializedName("field_titles")
    private List<String> fieldTitles;
    /**
     * 对返回记录进行排序
     */
    @SerializedName("sort")
    private List<RecordSort> sort;
    /**
     * 偏移量,初始值为 0
     */
    @SerializedName("offset")
    private Integer offset;
    /**
     * 分页大小 , 每页返回多少条数据;当不填写该参数或将该参数设置为 0 时,如果总数大于 1000,一次性返回 1000 个字段,当总数小于 1000 时,返回全部字段;limit 最大值为 1000
     */
    @SerializedName("limit")
    private Integer limit;
    public static WxCpRecordQueryRequest fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, WxCpRecordQueryRequest.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/sheet/SheetProperties.java
New file
@@ -0,0 +1,51 @@
package me.zhengjie.weixin.cp.bean.smartsheet.sheet;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class SheetProperties implements Serializable {
    private static final long serialVersionUID = 3000460472715119581L;
    /**
     * 智能表 ID,创建子表时生成的 6 位随机 ID
     */
    @SerializedName("sheet_id")
    private String sheetId;
    /**
     * 智能表标题
     */
    @SerializedName("title")
    private String title;
    /**
     * 智能表下标
     */
    @SerializedName("index")
    private Integer index;
    /**
     * 子表是否可见
     */
    @SerializedName("is_visible")
    private Boolean isVisible;
    /**
     * 子表类型。"dashboard" 仪表盘。"external" 说明页,"smartsheet" 智能表
     */
    @SerializedName("type")
    private String type;
    public static SheetProperties fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, SheetProperties.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/sheet/WxCpSheetCreateData.java
New file
@@ -0,0 +1,25 @@
package me.zhengjie.weixin.cp.bean.smartsheet.sheet;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class WxCpSheetCreateData extends WxCpBaseResp implements Serializable {
    private static final long serialVersionUID = 1178875768451103849L;
    @SerializedName("properties")
    private SheetProperties properties;
    public static WxCpSheetCreateData fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, WxCpSheetCreateData.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/sheet/WxCpSheetCreateRequest.java
New file
@@ -0,0 +1,38 @@
package me.zhengjie.weixin.cp.bean.smartsheet.sheet;
import com.google.gson.annotations.SerializedName;
import lombok.*;
import lombok.experimental.Accessors;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class WxCpSheetCreateRequest implements Serializable {
    private static final long serialVersionUID = -230920854678140021L;
    /**
     * 文档的docid
     */
    @SerializedName("docid")
    private String docId;
    /**
     * 智能表属性
     */
    @SerializedName("properties")
    private SheetProperties properties;
    public static WxCpSheetCreateRequest fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, WxCpSheetCreateRequest.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/sheet/WxCpSheetEditRequest.java
New file
@@ -0,0 +1,41 @@
package me.zhengjie.weixin.cp.bean.smartsheet.sheet;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class WxCpSheetEditRequest implements Serializable {
    private static final long serialVersionUID = 747308375841881355L;
    /**
     * 文档的docid
     */
    @SerializedName("docid")
    private String docId;
    /**
     * 智能表属性
     */
    @SerializedName("properties")
    private SheetProperties properties;
    public static WxCpSheetEditRequest fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, WxCpSheetEditRequest.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/sheet/WxCpSheetInfo.java
New file
@@ -0,0 +1,29 @@
package me.zhengjie.weixin.cp.bean.smartsheet.sheet;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.List;
@Data
public class WxCpSheetInfo extends WxCpBaseResp implements Serializable {
    private static final long serialVersionUID = -2571477132080639160L;
    /**
     * 由添加成功的记录的具体内容组成的 JSON 数组
     */
    @SerializedName("sheet_list")
    private List<SheetProperties> sheetList;
    public static WxCpSheetInfo fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, WxCpSheetInfo.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/sheet/WxCpSheetQueryRequest.java
New file
@@ -0,0 +1,47 @@
package me.zhengjie.weixin.cp.bean.smartsheet.sheet;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class WxCpSheetQueryRequest implements Serializable {
    private static final long serialVersionUID = -1557962643283667169L;
    /**
     * 文档的docid
     */
    @SerializedName("docid")
    private String docId;
    /**
     * 指定子表ID查询
     */
    @SerializedName("sheet_id")
    private String sheetId;
    /**
     * 获取所有类型子表
     */
    @SerializedName("need_all_type_sheet")
    private Boolean needAllTypeSheet;
    public static WxCpSheetQueryRequest fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, WxCpSheetQueryRequest.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/View.java
New file
@@ -0,0 +1,30 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class View implements Serializable {
    private static final long serialVersionUID = 2293426984233236997L;
    @SerializedName("view_id")
    private String viewId;
    @SerializedName("view_title")
    private String viewTitle;
    @SerializedName("view_type")
    private String viewType;
    public static View fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, View.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/ViewCondition.java
New file
@@ -0,0 +1,141 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.List;
@Data
public class ViewCondition implements Serializable {
    private static final long serialVersionUID = 12570485108497198L;
    /**
     * 字段ID
     */
    @SerializedName("field_id")
    private String fieldId;
    /**
     * 判断类型:OPERATOR_UNKNOWN-未知;OPERATOR_IS-等于;OPERATOR_IS_NOT-不等于;OPERATOR_CONTAINS-包含;
     * OPERATOR_DOES_NOT_CONTAIN-不包含;OPERATOR_IS_GREATER-大于;OPERATOR_IS_GREATER_OR_EQUAL-大于或等于;
     * OPERATOR_IS_LESS-小于;OPERATOR_IS_LESS_OR_EQUAL-小于或等于;OPERATOR_IS_EMPTY-为空;OPERATOR_IS_NOT_EMPTY-不为空;
     */
    @SerializedName("operator")
    private String operator;
    /**
     * 文本、网址、电话、邮箱、地理位置、关联、单选、多选等列类型使用。关联列为记录ID;选项列为选项ID;其它为文本值
     */
    @SerializedName("string_value")
    private StringValue stringValue;
    /**
     * 数字、进度列类型使用
     */
    @SerializedName("number_value")
    private DoubleValue numberValue;
    /**
     * 复选框列类型使用
     */
    @SerializedName("bool_value")
    private BoolValue boolValue;
    /**
     * 人员、创建人、最后编辑人列类型使用,值为成员ID
     */
    @SerializedName("user_value")
    private StringValue userValue;
    /**
     * 日期、创建时间、最后编辑时间列类型使用
     */
    @SerializedName("date_time_value")
    private FilterDataTimeValue dateTimeValue;
    @Data
    public static class StringValue implements Serializable {
        @SerializedName("value")
        private List<String> value;
        public static StringValue fromJson(String json) {
            return WxCpGsonBuilder.create().fromJson(json, StringValue.class);
        }
        public String toJson() {
            return WxCpGsonBuilder.create().toJson(this);
        }
    }
    @Data
    public static class DoubleValue implements Serializable {
        @SerializedName("value")
        private Double value;
        public static DoubleValue fromJson(String json) {
            return WxCpGsonBuilder.create().fromJson(json, DoubleValue.class);
        }
        public String toJson() {
            return WxCpGsonBuilder.create().toJson(this);
        }
    }
    @Data
    public static class BoolValue implements Serializable {
        @SerializedName("value")
        private Boolean value;
        public static BoolValue fromJson(String json) {
            return WxCpGsonBuilder.create().fromJson(json, BoolValue.class);
        }
        public String toJson() {
            return WxCpGsonBuilder.create().toJson(this);
        }
    }
    @Data
    public static class FilterDataTimeValue implements Serializable {
        /**
         * 日期类型:DATE_TIME_TYPE_DETAIL_DATE-具体时间;DATE_TIME_TYPE_DETAIL_DATE_RANGE-具体时间范围;
         * DATE_TIME_TYPE_TODAY-今天;DATE_TIME_TYPE_TOMORROW-明天;
         * DATE_TIME_TYPE_YESTERDAY-昨天;DATE_TIME_TYPE_CURRENT_WEEK-本周;
         * DATE_TIME_TYPE_LAST_WEEK-上周;DATE_TIME_TYPE_CURRENT_MONTH-本月;
         * DATE_TIME_TYPE_THE_PAST_7_DAYS-过去 7 天内;DATE_TIME_TYPE_THE_NEXT_7_DAYS-接下来 7 天内;
         * DATE_TIME_TYPE_LAST_MONTH-上月;DATE_TIME_TYPE_THE_PAST_30_DAYS-过去 30 天内;
         * DATE_TIME_TYPE_THE_NEXT_30_DAYS-接下来 30 天内;
         */
        @SerializedName("type")
        private String type;
        /**
         * 具体日期值,type为具体日期(DATE_TIME_TYPE_DETAIL_DATE)或具体日期范围(DATE_TIME_TYPE_DETAIL_DATE_RANGE)时必填
         */
        @SerializedName("value")
        private List<String> value;
        public static FilterDataTimeValue fromJson(String json) {
            return WxCpGsonBuilder.create().fromJson(json, FilterDataTimeValue.class);
        }
        public String toJson() {
            return WxCpGsonBuilder.create().toJson(this);
        }
    }
    public static ViewCondition fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, ViewCondition.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/ViewFilterSpec.java
New file
@@ -0,0 +1,34 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.List;
@Data
public class ViewFilterSpec implements Serializable {
    private static final long serialVersionUID = 7064487147263706348L;
    /**
     * 多个conditions之间是以and(CONJUNCTION_AND)还是or(CONJUNCTION_OR)进行组合
     */
    @SerializedName("conjunction")
    private String conjunction;
    /**
     * 判断条件
     */
    @SerializedName("conditions")
    private List<ViewCondition> viewConditions;
    public static ViewFilterSpec fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, ViewFilterSpec.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/ViewGroupSpec.java
New file
@@ -0,0 +1,28 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.List;
@Data
public class ViewGroupSpec implements Serializable {
    private static final long serialVersionUID = 4455009363000580993L;
    /**
     * 参与分组的字段列表
     */
    @SerializedName("groups")
    private List<ViewSpecInfo> groups;
    public static ViewGroupSpec fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, ViewGroupSpec.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/ViewProperty.java
New file
@@ -0,0 +1,64 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.Map;
@Data
public class ViewProperty implements Serializable {
    private static final long serialVersionUID = 1618058468928082752L;
    /**
     * 记录变更后自动重新排序
     */
    @SerializedName("auto_sort")
    private Boolean autoSort;
    /**
     * 排序设置
     */
    @SerializedName("sort_spec")
    private ViewSortSpec sortSpec;
    /**
     * 分组设置
     */
    @SerializedName("filter_spec")
    private ViewFilterSpec filterSpec;
    /**
     * 过滤设置
     */
    @SerializedName("group_spec")
    private ViewGroupSpec groupSpec;
    /**
     * 是否使用数据统计
     */
    @SerializedName("is_field_stat_enabled")
    private Boolean isFieldStatEnabled;
    /**
     * 类似map。 key为字段ID, value为布尔值表示是否显示
     */
    @SerializedName("field_visibility")
    private Map<String, Boolean> fieldVisibility;
    /**
     * 冻结列数量,从首列开始
     */
    @SerializedName("frozen_field_count")
    private Integer frozenFieldCount;
    public static ViewProperty fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, ViewProperty.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/ViewSortSpec.java
New file
@@ -0,0 +1,28 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.List;
@Data
public class ViewSortSpec implements Serializable {
    private static final long serialVersionUID = -183052296376724000L;
    /**
     * 参与排序的字段列表
     */
    @SerializedName("sort_infos")
    private List<ViewSpecInfo> sortInfos;
    public static ViewSortSpec fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, ViewSortSpec.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/ViewSpecInfo.java
New file
@@ -0,0 +1,33 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class ViewSpecInfo implements Serializable {
    private static final long serialVersionUID = 5735012013638234658L;
    /**
     * 字段id
     */
    @SerializedName("field_id")
    private String fieldId;
    /**
     * 是否降序
     */
    @SerializedName("desc")
    private Boolean desc;
    public static ViewSpecInfo fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, ViewSpecInfo.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/WxCpViewCreateData.java
New file
@@ -0,0 +1,25 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
public class WxCpViewCreateData extends WxCpBaseResp implements Serializable {
    private static final long serialVersionUID = 227968342029225522L;
    @SerializedName("view")
    private View view;
    public static WxCpViewCreateData fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, WxCpViewCreateData.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/WxCpViewCreateRequest.java
New file
@@ -0,0 +1,119 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class WxCpViewCreateRequest implements Serializable {
    private static final long serialVersionUID = 3133970068933654124L;
    /**
     * 文档的docid
     */
    @SerializedName("docid")
    private String docId;
    /**
     * Smartsheet 子表ID
     */
    @SerializedName("sheet_id")
    private String sheetId;
    /**
     * 视图标题
     */
    @SerializedName("view_title")
    private String viewTitle;
    /**
     * 视图类型:VEW_UNKNOWN-未知类型视图,传递该值不合法;VIEW_TYPE_GRID-网格视图;VIEW_TYPE_KANBAN-看板视图;
     * VIEW_TYPE_GALLERY-画册视图;VIEW_TYPE_GANTT-甘特视图;VIEW_TYPE_CALENDAR-日历视图;
     */
    @SerializedName("view_type")
    private String viewType;
    /**
     * 甘特视图属性,添加甘特图时必填
     */
    @SerializedName("property_gantt")
    private String propertyGantt;
    /**
     * 日历视图属性,添加日历视图时必填
     */
    @SerializedName("property_calendar")
    private String propertyCalendar;
    @Data
    public static class PropertyGantt implements Serializable {
        private static final long serialVersionUID = 5343908283998906715L;
        /**
         * 时间条起点字段ID,只允许日期类型(FIELD_TYPE_DATE_TIME)的字段ID
         */
        @SerializedName("start_date_field_id")
        private String startDateFieldId;
        /**
         * 时间条终点字段ID,只允许日期类型(FIELD_TYPE_DATE_TIME)的字段ID
         */
        @SerializedName("end_date_field_id")
        private String endDateFieldId;
        public static PropertyGantt fromJson(String json) {
            return WxCpGsonBuilder.create().fromJson(json, PropertyGantt.class);
        }
        public String toJson() {
            return WxCpGsonBuilder.create().toJson(this);
        }
    }
    @Data
    public static class PropertyCalendar implements Serializable {
        private static final long serialVersionUID = 5398219668235477683L;
        /**
         * 时间条起点字段ID,只允许日期类型(FIELD_TYPE_DATE_TIME)的字段ID
         */
        @SerializedName("start_date_field_id")
        private String startDateFieldId;
        /**
         * 时间条终点字段ID,只允许日期类型(FIELD_TYPE_DATE_TIME)的字段ID
         */
        @SerializedName("end_date_field_id")
        private String endDateFieldId;
        public static PropertyCalendar fromJson(String json) {
            return WxCpGsonBuilder.create().fromJson(json, PropertyCalendar.class);
        }
        public String toJson() {
            return WxCpGsonBuilder.create().toJson(this);
        }
    }
    public static WxCpViewCreateRequest fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, WxCpViewCreateRequest.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/WxCpViewEditRequest.java
New file
@@ -0,0 +1,59 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class WxCpViewEditRequest implements Serializable {
    private static final long serialVersionUID = -3647520440740513032L;
    /**
     * 文档的docid
     */
    @SerializedName("docid")
    private String docId;
    /**
     * Smartsheet 子表ID
     */
    @SerializedName("sheet_id")
    private String sheetId;
    /**
     * 视图ID
     */
    @SerializedName("view_id")
    private String viewId;
    /**
     * 视图标题
     */
    @SerializedName("view_title")
    private String viewTitle;
    /**
     * 视图的排序/过滤/分组配置
     */
    @SerializedName("property")
    private ViewProperty property;
    public static WxCpViewEditRequest fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, WxCpViewEditRequest.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/WxCpViewInfo.java
New file
@@ -0,0 +1,47 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.List;
@Data
public class WxCpViewInfo extends WxCpBaseResp implements Serializable {
    private static final long serialVersionUID = 2784209688695630244L;
    /**
     * 符合筛选条件的视图总数
     */
    @SerializedName("total")
    private Integer total;
    /**
     * 是否还有更多项
     */
    @SerializedName("has_more")
    private Boolean hasMore;
    /**
     * 下次下一个搜索结果的偏移量
     */
    @SerializedName("next")
    private Integer next;
    /**
     * 视图数据
     */
    @SerializedName("views")
    private List<View> views;
    public static WxCpViewInfo fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, WxCpViewInfo.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/WxCpViewQueryRequest.java
New file
@@ -0,0 +1,60 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import java.io.Serializable;
import java.util.List;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class WxCpViewQueryRequest implements Serializable {
    private static final long serialVersionUID = 8359738740216474310L;
    /**
     * 文档的docid
     */
    @SerializedName("docid")
    private String docId;
    /**
     * Smartsheet 子表ID
     */
    @SerializedName("sheet_id")
    private String sheetId;
    /**
     * 需要查询的视图 ID 数组
     */
    @SerializedName("view_ids")
    private List<String> viewIds;
    /**
     * 偏移量,初始值为 0
     */
    @SerializedName("offset")
    private Integer offset;
    /**
     * 分页大小 , 每页返回多少条数据;当不填写该参数或将该参数设置为 0 时,如果总数大于 1000,一次性返回 1000 个视图,当总数小于 1000 时,返回全部视图;limit 最大值为 1000
     */
    @SerializedName("limit")
    private Integer limit;
    public static WxCpViewQueryRequest fromJson(String json) {
        return WxCpGsonBuilder.create().fromJson(json, WxCpViewQueryRequest.class);
    }
    public String toJson() {
        return WxCpGsonBuilder.create().toJson(this);
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/approval/rest/ApproveEventController.java
@@ -15,12 +15,12 @@
*/
package me.zhengjie.modules.approval.rest;
import me.zhengjie.annotation.AnonymousAccess;
import me.zhengjie.annotation.Log;
import me.zhengjie.modules.approval.domain.ApproveEvent;
import me.zhengjie.modules.approval.service.ApproveEventService;
import me.zhengjie.modules.approval.service.dto.ApproveEventQueryCriteria;
import me.zhengjie.modules.temp.event.ChangeApprovalStatusEvent;
import me.zhengjie.modules.temp.service.WechatSendHistoryService;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.data.domain.Pageable;
import lombok.RequiredArgsConstructor;
@@ -45,6 +45,7 @@
public class ApproveEventController {
    private final ApproveEventService approveEventService;
    private final WechatSendHistoryService wechatSendHistoryService;
    private final ApplicationEventPublisher applicationEventPublisher;
    @Log("导出数据")
@@ -89,11 +90,16 @@
        return new ResponseEntity<>(HttpStatus.OK);
    }
    @AnonymousAccess
    @GetMapping(value = "/test/{id}")
    public ResponseEntity<Object> test(@PathVariable Long id) {
    @GetMapping(value = "/changeById/{id}")
    public ResponseEntity<Object> changeById(@PathVariable Long id) {
        ChangeApprovalStatusEvent event = new ChangeApprovalStatusEvent(new Object(), id);
        applicationEventPublisher.publishEvent(event);
        return new ResponseEntity<>(HttpStatus.OK);
    }
    @GetMapping(value = "/changeBySpNo/{spNo}")
    public ResponseEntity<Object> changeBySpNo(@PathVariable String spNo) {
        wechatSendHistoryService.handleWechatSendHistoryBySpNo(spNo);
        return new ResponseEntity<>(HttpStatus.OK);
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/AttendanceService.java
@@ -21,7 +21,6 @@
import me.zhengjie.modules.attendance.service.dto.AttendanceQueryCriteria;
import org.springframework.data.domain.Pageable;
import java.time.LocalDateTime;
import java.util.Map;
import java.util.List;
import java.io.IOException;
@@ -86,6 +85,13 @@
    Integer calculateTimes(Calculate calculate, Long userId);
    /**
     * 计算时长(小时)包含假期
     * @param userId
     * @return
     */
    Integer calcTimesIncludeHoliday(Calculate calculate, Long userId);
    /**
     * 计算时长(天)
     *
     * @return
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/dto/AttendanceLeaveQueryCriteria.java
@@ -61,4 +61,12 @@
    @Query(type = Query.Type.EQUAL)
    private String wecomSpNo;
    /* 模糊 */
    @Query(propName = "leaveStartTime", type = Query.Type.GREATER_THAN)
    private Timestamp leaveStartTimeGreaterThan;
    /* 模糊 */
    @Query(propName = "leaveEndTime", type = Query.Type.LESS_THAN)
    private Timestamp leaveEndTimeLessThan;
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/dto/AttendanceOvertimeQueryCriteria.java
@@ -49,4 +49,10 @@
    @Query(type = Query.Type.EQUAL)
    private String wecomSpNo;
    @Query(type = Query.Type.GREATER_THAN, propName = "overtimeStartTime")
    private Timestamp overtimeStartTimeGreaterThan;
    @Query(type = Query.Type.LESS_THAN, propName = "overtimeEndTime")
    private Timestamp overtimeEndTimeLessThan;
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceBusinessTravelServiceImpl.java
@@ -23,6 +23,7 @@
import me.zhengjie.modules.attendance.domain.*;
import me.zhengjie.modules.attendance.repository.AttendanceGoOutRepository;
import me.zhengjie.modules.attendance.repository.AttendanceLeaveRepository;
import me.zhengjie.modules.attendance.service.AttendanceService;
import me.zhengjie.modules.constant.Constant;
import me.zhengjie.modules.quartz.service.impl.WeComServiceImpl;
import me.zhengjie.modules.system.domain.DictDetail;
@@ -46,8 +47,10 @@
import org.springframework.data.domain.Pageable;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.*;
@@ -78,6 +81,7 @@
    private final DictDetailRepository dictDetailRepository;
    private final WeComServiceImpl weComService;
    private final TemplateControlFieldService templateControlFieldService;
    private final AttendanceService attendanceService;
    @Override
    public Map<String, Object> queryAll(AttendanceBusinessTravelQueryCriteria criteria, Pageable pageable) {
@@ -170,6 +174,10 @@
//                // 不是周末并且节假日表中不存在在创建
//                if((!isWeekend && !holiday.contains(date)) || (isWeekend && isWork.contains(date))){
                AttendanceBusinessTravel attendanceBusinessTravel = getAttendanceBuss(resources, date, user, i, bussStartTime, bussEndTime, null);
                // 过滤掉出差时长不足的记录
                if (new BigDecimal(attendanceBusinessTravel.getTravelDuration()).compareTo(BigDecimal.ZERO) == 0) {
                    continue;
                }
//                Timestamp travelEndTime = attendanceBusinessTravel.getTravelEndTime();
//                //获取当前时间
//                Calendar c = Calendar.getInstance();
@@ -271,6 +279,10 @@
//                // 不是周末并且节假日表中不存在在创建
//                if((!isWeekend && !holiday.contains(date)) || (isWeekend && isWork.contains(date))){
                AttendanceBusinessTravel attendanceBusinessTravel1 = getAttendanceBuss(resources, date, user, i, bussStartTime, bussEndTime, resUserId);
                // 过滤掉出差时长不足的记录
                if (new BigDecimal(attendanceBusinessTravel1.getTravelDuration()).compareTo(BigDecimal.ZERO) == 0) {
                    continue;
                }
                i++;
                attendanceBusinessTravelRepository.save(attendanceBusinessTravel1);
//                }
@@ -285,25 +297,46 @@
     * @param date
     * @param user
     * @param i
     * @param LeaStartTime
     * @param LeaEndTime
     * @param overStartTime
     * @param overEndTime
     * @param resUserId
     * @return
     */
    public AttendanceBusinessTravel getAttendanceBuss(AttendanceBusinessTravel resources, String date, User user, int i, String LeaStartTime, String LeaEndTime, Long resUserId) {
        DateTimeFormatter sdf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    public AttendanceBusinessTravel getAttendanceBuss(AttendanceBusinessTravel resources, String date, User user, int i, String overStartTime, String overEndTime, Long resUserId) {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss");
        AttendanceBusinessTravel attendanceBusinessTravel = new AttendanceBusinessTravel();
        //resUserId为null说明是添加,反之
        // resUserId为null说明是添加,反之
        if (resUserId == null) {
            resources.setUserId(user.getId());
        } else {
            resources.setUserId(resUserId);
        }
        String startTime = date + " " + "00:00:00";
        String endTime = date + " " + "23:59:59";
        resources.setTravelStartTime(Timestamp.valueOf(startTime));
        resources.setTravelEndTime(Timestamp.valueOf(endTime));
        resources.setTravelDuration(Constant.NUMBER_ONE);
        // 请假开始时间结束时间不相等的情况
        if (!overStartTime.substring(0, 10).equals(overEndTime.substring(0, 10))) {
            // 默认用下班基准时间和请假开始时间算时长
            resources.setTravelStartTime(Timestamp.valueOf(String.format("%s %s", date, user.getSysRostering().getWorkStartTime().format(formatter))));
            resources.setTravelEndTime(Timestamp.valueOf(String.format("%s %s", date, user.getSysRostering().getWorkEndTime().format(formatter))));
            if (date.equals(overStartTime.substring(0, 10))) {
                // 首次循环,开始时间填充为所选开始时间
                String startTime = String.format("%s %s", date, overStartTime.substring(11, 19));
                resources.setTravelStartTime(Timestamp.valueOf(startTime));
                if (resources.getTravelStartTime().after(resources.getTravelEndTime())) {
                    resources.setTravelEndTime(Timestamp.valueOf(String.format("%s 23:59:59", date)));
                }
            }
            if (date.equals(overEndTime.substring(0, 10))) {
                // 最后一次循环,开始时间填充为所选结束时间
                String endTime = String.format("%s %s", date, overEndTime.substring(11, 19));
                resources.setTravelEndTime(Timestamp.valueOf(endTime));
                if (resources.getTravelEndTime().before(resources.getTravelStartTime())) {
                    resources.setTravelStartTime(Timestamp.valueOf(String.format("%s 00:00:00", date)));
                }
            }
            Double result = getRemainingTime(resources);
            resources.setTravelDuration(result);
        }
        resources.setApprovalStatus(Constant.BUSSINESS_APPROVE_STATUS_REVIEWED);
        attendanceBusinessTravel.copy(resources);
        return attendanceBusinessTravel;
@@ -395,13 +428,49 @@
     */
    @Override
    public Double getRemainingTime(AttendanceBusinessTravel attendanceBusinessTravel) {
        Calculate calculate = new Calculate();
        calculate.setStart(attendanceBusinessTravel.getTravelStartTime().toLocalDateTime());
        calculate.setEnd(attendanceBusinessTravel.getTravelEndTime().toLocalDateTime());
        Double result = new Double(0.00);
        Long days = ChronoUnit.DAYS.between(calculate.getStart().toLocalDate(), calculate.getEnd().toLocalDate()) + 1;
        result = Double.valueOf(new BigDecimal(days).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
        return result;
        BigDecimal result = BigDecimal.ZERO;
        if (!attendanceBusinessTravel.getTravelStartTime().equals(attendanceBusinessTravel.getTravelEndTime()) && attendanceBusinessTravel.getTravelStartTime().before(attendanceBusinessTravel.getTravelEndTime())) {
            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss");
            // 按照小时计算出天数:4小时以内算0.5天,4小时以上算1天,因出差的特殊性0小时也至少算半天, (开始结束时间一样或是时差小于等于1小时返回0)
            List<String> dateList = attendanceLeaveService.getBetweenDate(attendanceBusinessTravel.getTravelStartTime().toLocalDateTime().toString(), attendanceBusinessTravel.getTravelEndTime().toLocalDateTime().toString());
            User user = userRepository.getOne(SecurityUtils.getCurrentUserId());
            LocalTime startLocalTime = attendanceBusinessTravel.getTravelStartTime().toLocalDateTime().toLocalTime();
            LocalTime endLocalTime = attendanceBusinessTravel.getTravelEndTime().toLocalDateTime().toLocalTime();
            for (String date : dateList) {
                Calculate calculate = new Calculate();
                String startTime = String.format("%s %s", date, startLocalTime.format(formatter));
                String endTime = String.format("%s %s", date, endLocalTime.format(formatter));
                // 默认用下班基准时间和请假开始时间算时长
                Timestamp startTimestamp = Timestamp.valueOf(String.format("%s %s", date, user.getSysRostering().getWorkStartTime().format(formatter)));
                Timestamp endTimestamp = Timestamp.valueOf(String.format("%s %s", date, user.getSysRostering().getWorkEndTime().format(formatter)));
                if (date.equals(attendanceBusinessTravel.getTravelStartTime().toLocalDateTime().toLocalDate().toString())) {
                    // 第一次循环
                    startTimestamp = Timestamp.valueOf(startTime);
                    if (startTimestamp.after(endTimestamp)) {
                        endTimestamp = Timestamp.valueOf(String.format("%s 23:59:59", date));
                    }
                }
                if (date.equals(attendanceBusinessTravel.getTravelEndTime().toLocalDateTime().toLocalDate().toString())) {
                    // 最后一次循环
                    endTimestamp = Timestamp.valueOf(endTime);
                    if (endTimestamp.before(startTimestamp)) {
                        startTimestamp = Timestamp.valueOf(String.format("%s 00:00:00", date));
                    }
                }
                calculate.setStart(startTimestamp.toLocalDateTime());
                calculate.setEnd(endTimestamp.toLocalDateTime());
                Integer timeSeconds = attendanceService.calcTimesIncludeHoliday(calculate, SecurityUtils.getCurrentUserId());
                BigDecimal dayResult = new BigDecimal((float) timeSeconds / 3600).divide(new BigDecimal(4)).setScale(0, RoundingMode.UP).multiply(new BigDecimal(0.5));
                if (dayResult.compareTo(BigDecimal.ZERO) == 0 && Math.abs(ChronoUnit.SECONDS.between(startTimestamp.toInstant(), endTimestamp.toInstant())) > 3600) {
                    dayResult = new BigDecimal(0.5);
                }
                result = result.add(dayResult);
            }
        }
        return result.doubleValue();
    }
    /**
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceServiceImpl.java
@@ -207,6 +207,68 @@
    }
    /**
     * 计算时间(小时)包含假期
     * @param userId
     * @return
     */
    @Override
    public Integer calcTimesIncludeHoliday(Calculate calculate, Long userId) {
        User userInfo = userRepository.getOne(userId);
        SysRostering sysRostering = userInfo.getSysRostering();
        // 计算天数
        Integer count = 0;
        Long chronoUnit =  ChronoUnit.DAYS.between(calculate.getStart().toLocalDate(), calculate.getEnd().toLocalDate());
        for (Integer i = 0; i <= chronoUnit; i++) {
            count++;
        }
        Calculate startCalculate = new Calculate();
        startCalculate.setStart(calculate.getStart());
        startCalculate.setEnd(calculate.getStart());
        Integer startDays = 0;
        Long startChronoUnit =  ChronoUnit.DAYS.between(startCalculate.getStart().toLocalDate(), startCalculate.getEnd().toLocalDate());
        for (Integer i = 0; i <= startChronoUnit; i++) {
            startDays++;
        }
        Calculate endCalculate = new Calculate();
        endCalculate.setStart(calculate.getEnd());
        endCalculate.setEnd(calculate.getEnd());
        Integer endDays = 0;
        Long endChronoUnit =  ChronoUnit.DAYS.between(endCalculate.getStart().toLocalDate(), endCalculate.getEnd().toLocalDate());
        for (Integer i = 0; i <= endChronoUnit; i++) {
            endDays++;
        }
        Integer time = 0;
        time = (count - startDays - endDays) * 8 * 3600;
        calculate.setStart(formateDateTime(calculate.getStart(), sysRostering));
        calculate.setEnd(formateDateTime(calculate.getEnd(), sysRostering));
        if (startDays > 0) {
            Duration startDuration = Duration.between(calculate.getStart(), calculate.getStart().toLocalDate().atTime(sysRostering.getWorkEndTime()));
            Long StartSeconds = startDuration.getSeconds();
            if (calculate.getStart().toLocalTime().isBefore(LocalTime.NOON)) {
                time += StartSeconds.intValue() - 3600;
            }else if(calculate.getStart().toLocalTime().compareTo(LocalTime.NOON) >= 0 && calculate.getStart().toLocalTime().compareTo(calculate.getStart().toLocalDate().atTime(sysRostering.getLunchEndTime()).toLocalTime()) < 0){
                // 补充,请假开始时间大于等于中午基准休息时间小于休息结束时间
                time += StartSeconds.intValue() - 3600;
            } else {
                time += StartSeconds.intValue();
            }
        }
        if (endDays > 0) {
            Duration endDuration = Duration.between(calculate.getEnd().toLocalDate().atTime(sysRostering.getWorkStartTime()), calculate.getEnd());
            Long endSeconds = endDuration.getSeconds();
            if (calculate.getEnd().toLocalTime().isAfter(LocalTime.NOON)) {
                time += endSeconds.intValue() - 3600;
            } else {
                time += endSeconds.intValue();
            }
        }
        return time;
    }
    /**
     * 计算时间(天)
     * @param calculate
     * @return
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/constant/Constant.java
@@ -114,6 +114,8 @@
    // 项目区分
    public static final String PROJECT_DISTINGUISH = "project_distinguish";
    // 项目区分:科技
    public static final String PROJECT_DISTINGUISH_PRODUCT = "project_distinguish_product";
    // 单价币种
    public static final String STANDARD_UNIT_CURRENCY = "standard_unit_currency";
@@ -413,4 +415,15 @@
    public static final String REIMBURSE_TYPE = "reimburse_type";
    // 报销费用类型
    public static final String REIMBURSE_EXPENSE_TYPE = "reimburse_expense_type";
    // 企微报告参数
    public static final String WECOM_REPORT_PARAM = "wecom_report_param";
    // 企微报告参数:周报文件ID
    public static final String WEEKLY_REPORT_DOC_ID = "weekly_report_doc_id";
    // 企微报告参数:项目周报子表名称
    public static final String WEEKLY_REPORT_PROJECT_SHEET_NAME = "weekly_report_project_sheet_name";
    // 企微报告参数:假勤周报子表名称
    public static final String WEEKLY_REPORT_ATTENDANCE_SHEET_NAME = "weekly_report_attendance_sheet_name";
    // 企微报告参数:项目WBS报告子表名称
    public static final String PROJECT_REPORT_WBS_SHEET_NAME = "project_report_wbs_sheet_name";
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/rest/ProjectController.java
@@ -195,4 +195,13 @@
    public ResponseEntity<Object> querySubgroupTopHours(ProjectQueryCriteria criteria){
        return new ResponseEntity<>(projectService.querySubgroupTopHours(criteria),HttpStatus.OK);
    }
    @PostMapping(value = "/generateReport")
    @Log("根据项目生成报告")
    @ApiOperation("根据项目生成报告")
    @PreAuthorize("@el.check('project:report')")
    public ResponseEntity<Object> generateReport(@RequestBody ProjectQueryCriteria criteria){
        projectService.generateReport(criteria);
        return new ResponseEntity<>(HttpStatus.OK);
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/service/ProjectService.java
@@ -157,4 +157,10 @@
    List<ProjectDto> querySubgroupTopHours(ProjectQueryCriteria criteria);
    List<ProjectDto> queryRelevantOfDaily(Long userId);
    /**
     * 根据项目生成报告
     * @param criteria
     */
    void generateReport(ProjectQueryCriteria criteria);
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/service/impl/ProjectServiceImpl.java
@@ -28,6 +28,7 @@
import me.zhengjie.modules.project.service.dto.ProjectQueryCriteria;
import me.zhengjie.modules.project.service.dto.ProjectTypeQueryCriteria;
import me.zhengjie.modules.project.service.mapstruct.ProjectMapper;
import me.zhengjie.modules.quartz.service.impl.WeComServiceImpl;
import me.zhengjie.modules.system.domain.DictDetail;
import me.zhengjie.modules.system.domain.User;
import me.zhengjie.modules.system.repository.DictDetailRepository;
@@ -101,6 +102,7 @@
    private final CostRepository costRepository;
    private final ContractProjectRepository contractProjectRepository;
    private final SysGoalSettingService sysGoalSettingService;
    private final WeComServiceImpl weComService;
    @Autowired
    private TaskService taskService;
@@ -808,4 +810,19 @@
            return projectDto;
        }).collect(Collectors.toList());
    }
    @Override
    public void generateReport(ProjectQueryCriteria criteria) {
        List<Long> projectIds;
        if (criteria.getIdInList().size() > 0) {
            // 指定项目
            projectIds = criteria.getIdInList();
        } else {
            // 暂定科技全部未结束、未停滞项目
            criteria.setProjectDistinguish(Constant.PROJECT_DISTINGUISH_PRODUCT);
            criteria.setProjectStatusIn(Arrays.asList(Constant.PROJECT_STATUS_NOT_STARTED, Constant.PROJECT_STATUS_UNDER_WAY));
            projectIds = projectRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder)).stream().map(p -> p.getId()).collect(Collectors.toList());
        }
        weComService.toWeComSheetPushProjectReport(projectIds);
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/WeComServiceImpl.java
@@ -1,36 +1,67 @@
package me.zhengjie.modules.quartz.service.impl;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.util.ObjectUtil;
import com.google.gson.Gson;
import lombok.RequiredArgsConstructor;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.bean.message.WxCpMessage;
import me.chanjar.weixin.cp.bean.oa.WxCpCheckinData;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.modules.attendance.domain.*;
import me.zhengjie.modules.attendance.repository.*;
import me.zhengjie.modules.attendance.service.dto.AttendanceLeaveQueryCriteria;
import me.zhengjie.modules.attendance.service.dto.AttendanceOvertimeQueryCriteria;
import me.zhengjie.modules.constant.Constant;
import me.zhengjie.modules.system.domain.SysConfigHoliday;
import me.zhengjie.modules.system.domain.SysRostering;
import me.zhengjie.modules.system.domain.User;
import me.zhengjie.modules.project.domain.Project;
import me.zhengjie.modules.project.domain.ProjectCostOther;
import me.zhengjie.modules.project.domain.ProjectCostSummary;
import me.zhengjie.modules.project.domain.ProjectType;
import me.zhengjie.modules.project.repository.ProjectCostOtherRepository;
import me.zhengjie.modules.project.repository.ProjectCostRepository;
import me.zhengjie.modules.project.repository.ProjectRepository;
import me.zhengjie.modules.project.repository.ProjectTypeRepository;
import me.zhengjie.modules.project.service.dto.ProjectQueryCriteria;
import me.zhengjie.modules.system.domain.*;
import me.zhengjie.modules.system.repository.DictDetailRepository;
import me.zhengjie.modules.system.repository.SysConfigHolidayRepository;
import me.zhengjie.modules.system.repository.SysRosteringRepository;
import me.zhengjie.modules.system.repository.UserRepository;
import me.zhengjie.modules.system.service.DeptService;
import me.zhengjie.modules.system.service.DictDetailService;
import me.zhengjie.modules.system.service.dto.UserQueryCriteria;
import me.zhengjie.modules.task.domain.TaskDaliyMongo;
import me.zhengjie.modules.task.domain.TaskMongo;
import me.zhengjie.modules.task.domain.TaskUserMongo;
import me.zhengjie.modules.task.service.dto.TaskDaliyMongoDto;
import me.zhengjie.modules.treatment.domain.UserInsurance;
import me.zhengjie.modules.treatment.domain.UserLevelWage;
import me.zhengjie.modules.treatment.repository.UserInsuranceRepository;
import me.zhengjie.modules.treatment.repository.UserLevelWageRepository;
import me.zhengjie.utils.QueryHelp;
import me.zhengjie.utils.StringUtils;
import me.zhengjie.weixin.cp.api.WxCpOaWeDocSmartsheetService;
import me.zhengjie.weixin.cp.bean.smartsheet.field.*;
import me.zhengjie.weixin.cp.bean.smartsheet.record.*;
import me.zhengjie.weixin.cp.bean.smartsheet.sheet.*;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.aggregation.Aggregation;
import org.springframework.data.mongodb.core.aggregation.AggregationResults;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.time.LocalDateTime;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
@Service
@@ -46,6 +77,17 @@
    private final AttendanceBusinessTravelRepository attendanceBusinessTravelRepository;
    private final AttendanceGoOutRepository attendanceGoOutRepository;
    private final DictDetailService dictDetailService;
    private final DeptService deptService;
    private final WxCpOaWeDocSmartsheetService wxCpOaWeDocSmartsheetService;
    private final AttendanceOvertimeRepository attendanceOvertimeRepository;
    private final DictDetailRepository dictDetailRepository;
    private final ProjectRepository projectRepository;
    private final ProjectTypeRepository projectTypeRepository;
    private final ProjectCostRepository projectCostRepository;
    private final ProjectCostOtherRepository projectCostOtherRepository;
    private final UserLevelWageRepository sysUserLevelWageRepository;
    private final UserInsuranceRepository sysUserLevelInsuranceRepository;
    private final MongoTemplate mongoTemplate;
    /**
     * 凌晨0点执行,新增用户考勤信息
@@ -218,11 +260,11 @@
                        }
                        Timestamp checkInTime = unixtimeToTimestamp(weComRecordResult.getCheckinTime());
                        // 早打卡
                        // TODO:补充上班补卡记录
                        if (ObjectUtils.isEmpty(attendance.getActualWorkStartTime()) && !isHoliday && (attendance.getStartClockResults().equals(Constant.ATTENDANCE_STATE_WAITFOR) || attendance.getStartClockResults().equals(Constant.ATTENDANCE_STATE_LACK_OF_TIME))) {
                            cardDatetimeSupplement(attendance.getUserId(), strAttendDate, Constant.CARD_REPLACEMENT_DIFFERENTIATION_GOON, attendance);
                        }
                        if ("上班打卡".equals(weComRecordResult.getCheckinType())) {
                            // 补充上班补卡记录
                            if (ObjectUtils.isEmpty(attendance.getActualWorkStartTime()) && !isHoliday && (attendance.getStartClockResults().equals(Constant.ATTENDANCE_STATE_WAITFOR) || attendance.getStartClockResults().equals(Constant.ATTENDANCE_STATE_LACK_OF_TIME))) {
                                cardDatetimeSupplement(attendance.getUserId(), strAttendDate, Constant.CARD_REPLACEMENT_DIFFERENTIATION_GOON, attendance);
                            }
                            // 调用验证状态方法
                            Boolean flag = getCardSupplement(attendance.getUserId(), attendance.getStartClockResults(), attendance.getActualWorkStartTime());
                            // 考勤记录
@@ -235,11 +277,11 @@
                            attendance.setActualWorkStartTime(flag == true ? attendance.getActualWorkStartTime() : checkInTime);
                        }
                        // 晚打卡
                        // TODO:补充下班补卡记录
                        if (ObjectUtils.isEmpty(attendance.getActualWorkEndTime()) && !isHoliday && (attendance.getEndClockResults().equals(Constant.ATTENDANCE_STATE_WAITFOR) || attendance.getEndClockResults().equals(Constant.ATTENDANCE_STATE_LACK_OF_TIME))) {
                            cardDatetimeSupplement(attendance.getUserId(), strAttendDate, Constant.CARD_REPLACEMENT_DIFFERENTIATION_GOOFF, attendance);
                        }
                        if ("下班打卡".equals(weComRecordResult.getCheckinType())) {
                            // 补充下班补卡记录
                            if (ObjectUtils.isEmpty(attendance.getActualWorkEndTime()) && !isHoliday && (attendance.getEndClockResults().equals(Constant.ATTENDANCE_STATE_WAITFOR) || attendance.getEndClockResults().equals(Constant.ATTENDANCE_STATE_LACK_OF_TIME))) {
                                cardDatetimeSupplement(attendance.getUserId(), strAttendDate, Constant.CARD_REPLACEMENT_DIFFERENTIATION_GOOFF, attendance);
                            }
                            // 调用验证状态方法
                            Boolean flag = getCardSupplement(attendance.getUserId(), attendance.getEndClockResults(), attendance.getActualWorkEndTime());
                            // 考勤记录
@@ -352,11 +394,11 @@
                        }
                        Timestamp checkInTime = unixtimeToTimestamp(weComRecordResult.getCheckinTime());
                        // 早打卡
                        // TODO:补充上班补卡记录
                        if (ObjectUtils.isEmpty(attendance.getActualWorkStartTime()) && !isHoliday && (attendance.getStartClockResults().equals(Constant.ATTENDANCE_STATE_WAITFOR) || attendance.getStartClockResults().equals(Constant.ATTENDANCE_STATE_LACK_OF_TIME))) {
                            cardDatetimeSupplement(attendance.getUserId(), strAttendDate, Constant.CARD_REPLACEMENT_DIFFERENTIATION_GOON, attendance);
                        }
                        if ("上班打卡".equals(weComRecordResult.getCheckinType())) {
                            // 补充上班补卡记录
                            if (ObjectUtils.isEmpty(attendance.getActualWorkStartTime()) && !isHoliday && (attendance.getStartClockResults().equals(Constant.ATTENDANCE_STATE_WAITFOR) || attendance.getStartClockResults().equals(Constant.ATTENDANCE_STATE_LACK_OF_TIME))) {
                                cardDatetimeSupplement(attendance.getUserId(), strAttendDate, Constant.CARD_REPLACEMENT_DIFFERENTIATION_GOON, attendance);
                            }
                            // 调用验证状态方法
                            Boolean flag = getCardSupplement(attendance.getUserId(), attendance.getStartClockResults(), attendance.getActualWorkStartTime());
                            // 考勤记录
@@ -369,11 +411,11 @@
                            attendance.setActualWorkStartTime(flag == true ? attendance.getActualWorkStartTime() : checkInTime);
                        }
                        // 晚打卡
                        // TODO:补充下班补卡记录
                        if (ObjectUtils.isEmpty(attendance.getActualWorkEndTime()) && !isHoliday && (attendance.getEndClockResults().equals(Constant.ATTENDANCE_STATE_WAITFOR) || attendance.getEndClockResults().equals(Constant.ATTENDANCE_STATE_LACK_OF_TIME))) {
                            cardDatetimeSupplement(attendance.getUserId(), strAttendDate, Constant.CARD_REPLACEMENT_DIFFERENTIATION_GOOFF, attendance);
                        }
                        if ("下班打卡".equals(weComRecordResult.getCheckinType())) {
                            // 补充下班补卡记录
                            if (ObjectUtils.isEmpty(attendance.getActualWorkEndTime()) && !isHoliday && (attendance.getEndClockResults().equals(Constant.ATTENDANCE_STATE_WAITFOR) || attendance.getEndClockResults().equals(Constant.ATTENDANCE_STATE_LACK_OF_TIME))) {
                                cardDatetimeSupplement(attendance.getUserId(), strAttendDate, Constant.CARD_REPLACEMENT_DIFFERENTIATION_GOOFF, attendance);
                            }
                            // 调用验证状态方法
                            Boolean flag = getCardSupplement(attendance.getUserId(), attendance.getEndClockResults(), attendance.getActualWorkEndTime());
                            // 考勤记录
@@ -1048,4 +1090,951 @@
            }
        }
    }
    /**
     * 发送企微每周报告
     */
    public void toWecomSheetPushReport() {
        // 校验当天
        LocalDate todayDate = LocalDate.now();
        SysConfigHoliday todayHolidayConfig = sysConfigHolidayRepository.findByHolidayDate(todayDate.toString());
        if (isNonWorkingDay(todayDate, todayHolidayConfig)) {
            return;
        }
        // 校验第二天
        LocalDate tomorrowDate = todayDate.plusDays(1);
        SysConfigHoliday tomorrowHolidayConfig = sysConfigHolidayRepository.findByHolidayDate(tomorrowDate.toString());
        if (isWorkingDay(tomorrowDate, tomorrowHolidayConfig)) {
            return;
        }
        // 计算统计时间段
        DateTime startTime = findPreviousHoliday(todayDate);
        DateTime endTime = new DateTime(todayDate);
        // 个人报告
        UserQueryCriteria userQueryCriteria = new UserQueryCriteria();
        userQueryCriteria.setEnabled(true);
        userQueryCriteria.getDeptIds().add(7L);
        // 先查找是否存在子节点
        List<Dept> data = deptService.findByPid(7L);
        // 然后把子节点的ID都加入到集合中
        userQueryCriteria.getDeptIds().addAll(deptService.getDeptChildren(data));
        List<Long> userIds = userRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, userQueryCriteria, criteriaBuilder)).stream().map(u -> u.getId()).collect(Collectors.toList());
        toWecomSheetPushWeeklyReport(userIds, startTime, endTime);
        // 项目报告
        ProjectQueryCriteria projectQueryCriteria = new ProjectQueryCriteria();
        projectQueryCriteria.setProjectDistinguish(Constant.PROJECT_DISTINGUISH_PRODUCT);
        projectQueryCriteria.setProjectStatusIn(Arrays.asList(Constant.PROJECT_STATUS_NOT_STARTED, Constant.PROJECT_STATUS_UNDER_WAY));
        List<Long> projectIds = projectRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, projectQueryCriteria, criteriaBuilder)).stream().map(p -> p.getId()).collect(Collectors.toList());
        toWeComSheetPushProjectReport(projectIds);
    }
    /**
     * 发送企微周报
     *
     * @param userIds 周报用户企微ID
     * @param startTime 开始时间
     * @param endTime 结束时间
     */
    public void toWecomSheetPushWeeklyReport(List<Long> userIds, DateTime startTime, DateTime endTime) {
        if (userIds.size() > 0 && ObjectUtils.isNotEmpty(startTime) && ObjectUtils.isNotEmpty(endTime)) {
            Map<Long, Project> projectMap = new HashMap<>();
            // 计算检索时间
            Calendar calendar = Calendar.getInstance();
            calendar.setTime(startTime);
            calendar.set(Calendar.HOUR_OF_DAY, 0);
            calendar.set(Calendar.MINUTE, 0);
            calendar.set(Calendar.SECOND, 0);
            calendar.set(Calendar.MILLISECOND, 0);
            Timestamp leaveQueryStartTime = new Timestamp(calendar.getTimeInMillis());
            Timestamp overtimeQueryStartTime = new Timestamp(calendar.getTimeInMillis());
            calendar.setTime(endTime);
            calendar.set(Calendar.HOUR_OF_DAY, 23);
            calendar.set(Calendar.MINUTE, 59);
            calendar.set(Calendar.SECOND, 59);
            calendar.set(Calendar.MILLISECOND, 0);
            Timestamp leaveQueryEndTime = new Timestamp(calendar.getTimeInMillis());
            calendar.add(Calendar.DAY_OF_MONTH, 1);
            calendar.set(Calendar.HOUR_OF_DAY, 4);
            Timestamp overtimeQueryEndTime = new Timestamp(calendar.getTimeInMillis());
            // 获取企微报告参数
            Map<String, String> reportParamMap = dictDetailRepository.findByDictName(Constant.WECOM_REPORT_PARAM).stream().collect(Collectors.toMap(DictDetail::getLabel, DictDetail::getValue));
            if (!reportParamMap.containsKey(Constant.WEEKLY_REPORT_DOC_ID)) {
                throw new BadRequestException("周报文件ID未设置");
            }
            try {
                // 获取企业微信Token
                wxCpService.getAccessToken();
                // 查询现有子表信息
                WxCpSheetQueryRequest sheetQueryRequest = new WxCpSheetQueryRequest();
                sheetQueryRequest.setDocId(reportParamMap.get(Constant.WEEKLY_REPORT_DOC_ID));
                WxCpSheetInfo sheetInfo = wxCpOaWeDocSmartsheetService.sheetInfo(sheetQueryRequest);
                Gson gson = new Gson();
                // 特殊参数:开发-公共事务、公司-公共事务的项目名称细化到任务详情一级
                Set<Long> specialProjectType = new HashSet<>(Arrays.asList(46L, 47L));
                for (Long userId : userIds) {
                    // 查询用户信息
                    User user = userRepository.findById(userId).orElseGet(User::new);
                    // 创建查询条件
                    Criteria criteriaMongo = new Criteria();
                    criteriaMongo.and("userId").is(userId);
                    criteriaMongo.andOperator(Criteria.where("fillDate").gte(startTime), Criteria.where("fillDate").lte(endTime));
                    Query query = Query.query(criteriaMongo);
                    query.with(Sort.by(Sort.Order.desc("fillDate")));
                    // 开始查询
                    List<TaskDaliyMongo> daliyMongoList = mongoTemplate.find(query, TaskDaliyMongo.class);
                    List<TaskDaliyMongoDto> daliyMongoDtoList = daliyMongoList.stream().collect(
                            Collectors.groupingBy(
                                    (TaskDaliyMongo taskDaliyMongo) -> {
                                        Project project;
                                        if (projectMap.containsKey(taskDaliyMongo.getTaskUserMongo().getTask().getProjectId())) {
                                            project = projectMap.get(taskDaliyMongo.getTaskUserMongo().getTask().getProjectId());
                                        } else {
                                            project = projectRepository.findById(taskDaliyMongo.getTaskUserMongo().getTask().getProjectId()).orElseGet(Project::new);
                                            projectMap.put(taskDaliyMongo.getTaskUserMongo().getTask().getProjectId(), project);
                                        }
                                        if (specialProjectType.contains(project.getProjectTypeId())) {
                                            return "task_" + taskDaliyMongo.getTaskUserMongo().getTask().getId();
                                        } else {
                                            return "project_" + taskDaliyMongo.getTaskUserMongo().getTask().getProjectId();
                                        }
                                    },
                                    Collectors.reducing(
                                            null,
                                            (TaskDaliyMongo prev, TaskDaliyMongo cur) -> {
                                                if (prev == null) {
                                                    return cur;
                                                }
                                                // 计算工时
                                                prev.setConsumedHours(prev.getConsumedHours() + cur.getConsumedHours());
                                                return prev;
                                            }
                                    )
                            )
                    ).values().stream().map(taskDaliyMongo -> {
                        TaskDaliyMongoDto dto = new TaskDaliyMongoDto();
                        dto.setId(taskDaliyMongo.getId());
                        dto.setFillDate(taskDaliyMongo.getFillDate());
                        dto.setUserId(userId);
                        // TODO:暂时用来存储企微ID
                        dto.setUserNickName(user.getWeComId());
                        dto.setProjectId(taskDaliyMongo.getTaskUserMongo().getTask().getProjectId());
                        dto.setProjectName(projectMap.get(taskDaliyMongo.getTaskUserMongo().getTask().getProjectId()).getName());
                        dto.setTaskName(taskDaliyMongo.getTaskUserMongo().getTask().getName());
                        dto.setTaskId(taskDaliyMongo.getTaskUserMongo().getTask().getId());
                        dto.setConsumedHours(BigDecimal.valueOf(taskDaliyMongo.getConsumedHours()).setScale(2, RoundingMode.HALF_UP).doubleValue());
                        dto.setTaskProgress(taskDaliyMongo.getTaskProgress());
                        dto.setSettlementStatus(taskDaliyMongo.getSettlementStatus());
                        dto.setRemarks(taskDaliyMongo.getRemarks());
                        dto.setTaskUserMongo(taskDaliyMongo.getTaskUserMongo());
                        return dto;
                    }).sorted(Comparator.comparing(TaskDaliyMongoDto::getProjectId)).collect(Collectors.toList());
                    // 统计请假加班信息
                    AttendanceLeaveQueryCriteria leaveQueryCriteria = new AttendanceLeaveQueryCriteria();
                    leaveQueryCriteria.setUserId(userId);
                    leaveQueryCriteria.setApprovalStatus(Constant.APPROVAL_STATUS_PASSED);
                    leaveQueryCriteria.setLeaveStartTimeGreaterThan(leaveQueryStartTime);
                    leaveQueryCriteria.setLeaveEndTimeLessThan(leaveQueryEndTime);
                    List<AttendanceLeave> leaveList = attendanceLeaveRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,leaveQueryCriteria,criteriaBuilder));
                    Double leaveCountHour = leaveList.stream().map(leave -> {
                        if (leave.getLeaveDurationUnit().equals(Constant.LEAVE_TIME_TYPE_DAY)) {
                            return new BigDecimal(8).multiply(new BigDecimal(leave.getLeaveDuration()));
                        } else {
                            return new BigDecimal(leave.getLeaveDuration());
                        }
                    }).reduce(BigDecimal.ZERO, (res, cur) -> res.add(cur)).doubleValue();
                    // 统计请假加班信息
                    AttendanceOvertimeQueryCriteria overtimeQueryCriteria = new AttendanceOvertimeQueryCriteria();
                    overtimeQueryCriteria.setUserId(userId);
                    overtimeQueryCriteria.setApprovalStatus(Constant.OVERTIME_PASS);
                    overtimeQueryCriteria.setOvertimeStartTimeGreaterThan(overtimeQueryStartTime);
                    overtimeQueryCriteria.setOvertimeEndTimeLessThan(overtimeQueryEndTime);
                    List<AttendanceOvertime> overtimeList = attendanceOvertimeRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,overtimeQueryCriteria,criteriaBuilder));
                    Double overtimeCountHour = overtimeList.stream().map(overtime -> new BigDecimal(overtime.getOvertimeDuration())).reduce(BigDecimal.ZERO, (res, cur) -> res.add(cur)).doubleValue();
                    // 项目周报
                    SheetProperties weeklyReportProjectSheet = sheetInfo.getSheetList().stream().reduce(null, (res, cur) -> cur.getTitle().equals(reportParamMap.get(Constant.WEEKLY_REPORT_PROJECT_SHEET_NAME)) ? cur : res);
                    if (ObjectUtils.isNotEmpty(weeklyReportProjectSheet)) {
                        // 获取旧记录
                        WxCpRecordQueryRequest recordQueryRequest = new WxCpRecordQueryRequest();
                        recordQueryRequest.setDocId(reportParamMap.get(Constant.WEEKLY_REPORT_DOC_ID));
                        recordQueryRequest.setSheetId(weeklyReportProjectSheet.getSheetId());
                        recordQueryRequest.setKeyType("CELL_VALUE_KEY_TYPE_FIELD_TITLE");
                        recordQueryRequest.setOffset(0);
                        recordQueryRequest.setLimit(1000);
                        RecordSort sort = new RecordSort();
                        sort.setFieldTitle("提交日期");
                        sort.setDesc(true);
                        recordQueryRequest.setSort(Arrays.asList(sort));
                        WxCpRecordInfo recordInfo = wxCpOaWeDocSmartsheetService.recordInfo(recordQueryRequest);
                        // 制作项目周报数据
                        Map<String, List<Record>> filterRecordMap = daliyMongoDtoList.stream().map(item -> {
                            Record record = recordInfo.getRecords().stream().filter(r -> {
                                LocalDate createDate = Instant.ofEpochMilli(Long.parseLong(r.getValues().get("提交日期").toString())).atZone(ZoneId.systemDefault()).toLocalDate();
                                List<RecordOption> projectNames = ((List<?>) r.getValues().get("项目名称")).stream().map(o -> RecordOption.fromJson(gson.toJson(o))).collect(Collectors.toList());
                                List<RecordCellUserValue> submitters = ((List<?>) r.getValues().get("提交人")).stream().map(o -> RecordCellUserValue.fromJson(gson.toJson(o))).collect(Collectors.toList());
                                return createDate.equals(endTime.toLocalDateTime().toLocalDate()) && projectNames.get(0).getText().equals(item.getProjectName()) && submitters.get(0).getUserId().equals(item.getUserNickName());
                            }).findFirst().orElseGet(Record::new);
                            Map<String, Object> values = new HashMap<>(10);
                            // 项目名称
                            RecordOption projectName = new RecordOption();
                            if (specialProjectType.contains(projectMap.get(item.getProjectId()).getProjectTypeId())) {
                                projectName.setText(item.getProjectName().concat("-").concat(item.getTaskName()));
                            } else {
                                projectName.setText(item.getProjectName());
                            }
                            values.put("项目名称", new Record.TypedValue(Record.DataType.FIELD_TYPE_SELECT, Arrays.asList(projectName)).getValue());
                            // 项目负责人
                            RecordCellUserValue projectLeader = new RecordCellUserValue();
                            projectLeader.setUserId(item.getUserNickName());
                            values.put("项目负责人", new Record.TypedValue(Record.DataType.FIELD_TYPE_USER, Arrays.asList(projectLeader)).getValue());
                            // 项目进度
                            RecordOption projectProgress = new RecordOption();
                            projectProgress.setText("按期");
                            values.put("项目进度", new Record.TypedValue(Record.DataType.FIELD_TYPE_SELECT, Arrays.asList(projectProgress)).getValue());
                            // 预计结束日期
                            String endTimestamp = String.valueOf(projectRepository.findById(item.getProjectId()).get().getPlanEndDate().getTime());
                            values.put("预计结束日期", new Record.TypedValue(Record.DataType.FIELD_TYPE_DATE_TIME, endTimestamp).getValue());
                            // 本周实际投入
                            values.put("本周实际投入", new Record.TypedValue(Record.DataType.FIELD_TYPE_NUMBER, item.getConsumedHours()).getValue());
                            // 提交人
                            RecordCellUserValue submitter = new RecordCellUserValue();
                            submitter.setUserId(item.getUserNickName());
                            values.put("提交人", new Record.TypedValue(Record.DataType.FIELD_TYPE_USER, Arrays.asList(submitter)).getValue());
                            // 提交日期
                            String submitTimestamp = String.valueOf(endTime.getTime());
                            values.put("提交日期", new Record.TypedValue(Record.DataType.FIELD_TYPE_DATE_TIME, submitTimestamp).getValue());
                            record.setValues(values);
                            return record;
                        }).collect(Collectors.groupingBy(record -> StringUtils.isNotBlank(record.getRecordId()) ? "EDIT" : "CREATE"));
                        // 创建新纪录
                        List<Record> recordCreateList = filterRecordMap.getOrDefault("CREATE", Collections.emptyList());
                        if (recordCreateList.size() > 0) {
                            WxCpRecordCreateRequest recordCreateRequest = new WxCpRecordCreateRequest();
                            recordCreateRequest.setDocId(reportParamMap.get(Constant.WEEKLY_REPORT_DOC_ID));
                            recordCreateRequest.setSheetId(weeklyReportProjectSheet.getSheetId());
                            recordCreateRequest.setKeyType("CELL_VALUE_KEY_TYPE_FIELD_TITLE");
                            recordCreateRequest.setRecords(recordCreateList);
                            // 提交记录
                            wxCpOaWeDocSmartsheetService.recordCreate(recordCreateRequest);
                        }
                        // 编辑记录
                        List<Record> recordEditList = filterRecordMap.getOrDefault("EDIT", Collections.emptyList());
                        if (recordEditList.size() > 0) {
                            WxCpRecordEditRequest recordEditRequest = new WxCpRecordEditRequest();
                            recordEditRequest.setDocId(reportParamMap.get(Constant.WEEKLY_REPORT_DOC_ID));
                            recordEditRequest.setSheetId(weeklyReportProjectSheet.getSheetId());
                            recordEditRequest.setKeyType("CELL_VALUE_KEY_TYPE_FIELD_TITLE");
                            recordEditRequest.setRecords(recordEditList);
                            // 提交记录
                            wxCpOaWeDocSmartsheetService.recordEdit(recordEditRequest);
                        }
                    } else {
                        System.out.println("项目周报子表不存在");
                    }
                    // 假勤周报
                    if (!leaveCountHour.equals(0) || !overtimeCountHour.equals(0)) {
                        SheetProperties weeklyReportAttendanceSheet = sheetInfo.getSheetList().stream().reduce(null, (res, cur) -> cur.getTitle().equals(reportParamMap.get(Constant.WEEKLY_REPORT_ATTENDANCE_SHEET_NAME)) ? cur : res);
                        if (ObjectUtils.isNotEmpty(weeklyReportAttendanceSheet)) {
                            // 获取旧记录
                            WxCpRecordQueryRequest recordQueryRequest = new WxCpRecordQueryRequest();
                            recordQueryRequest.setDocId(reportParamMap.get(Constant.WEEKLY_REPORT_DOC_ID));
                            recordQueryRequest.setSheetId(weeklyReportAttendanceSheet.getSheetId());
                            recordQueryRequest.setKeyType("CELL_VALUE_KEY_TYPE_FIELD_TITLE");
                            recordQueryRequest.setOffset(0);
                            recordQueryRequest.setLimit(1000);
                            RecordSort sort = new RecordSort();
                            sort.setFieldTitle("提交日期");
                            sort.setDesc(true);
                            recordQueryRequest.setSort(Arrays.asList(sort));
                            WxCpRecordInfo recordInfo = wxCpOaWeDocSmartsheetService.recordInfo(recordQueryRequest);
                            // 制作假勤周报数据
                            Record record = recordInfo.getRecords().stream().filter(r -> {
                                LocalDate createDate = Instant.ofEpochMilli(Long.parseLong(r.getValues().get("提交日期").toString())).atZone(ZoneId.systemDefault()).toLocalDate();
                                return createDate.equals(endTime.toLocalDateTime().toLocalDate());
                            }).findFirst().orElseGet(Record::new);
                            Map<String, Object> values = new HashMap<>(3);
                            // 人员名称
                            RecordCellTextValue userName = new RecordCellTextValue();
                            userName.setType("text");
                            userName.setText(user.getNickName());
                            values.put("人员名称", new Record.TypedValue(Record.DataType.FIELD_TYPE_TEXT, Arrays.asList(userName)).getValue());
                            // 加班
                            values.put("加班(H)", new Record.TypedValue(Record.DataType.FIELD_TYPE_NUMBER, overtimeCountHour).getValue());
                            // 请假
                            values.put("请假(H)", new Record.TypedValue(Record.DataType.FIELD_TYPE_NUMBER, leaveCountHour).getValue());
                            // 提交日期
                            String submitTimestamp = String.valueOf(endTime.getTime());
                            values.put("提交日期", new Record.TypedValue(Record.DataType.FIELD_TYPE_DATE_TIME, submitTimestamp).getValue());
                            record.setValues(values);
                            if (StringUtils.isNotBlank(record.getRecordId())) {
                                // 编辑记录
                                WxCpRecordEditRequest recordEditRequest = new WxCpRecordEditRequest();
                                recordEditRequest.setDocId(reportParamMap.get(Constant.WEEKLY_REPORT_DOC_ID));
                                recordEditRequest.setSheetId(weeklyReportAttendanceSheet.getSheetId());
                                recordEditRequest.setKeyType("CELL_VALUE_KEY_TYPE_FIELD_TITLE");
                                recordEditRequest.setRecords(Arrays.asList(record));
                                // 提交记录
                                wxCpOaWeDocSmartsheetService.recordEdit(recordEditRequest);
                            } else {
                                // 创建新纪录
                                WxCpRecordCreateRequest recordCreateRequest = new WxCpRecordCreateRequest();
                                recordCreateRequest.setDocId(reportParamMap.get(Constant.WEEKLY_REPORT_DOC_ID));
                                recordCreateRequest.setSheetId(weeklyReportAttendanceSheet.getSheetId());
                                recordCreateRequest.setKeyType("CELL_VALUE_KEY_TYPE_FIELD_TITLE");
                                recordCreateRequest.setRecords(Arrays.asList(record));
                                // 提交记录
                                wxCpOaWeDocSmartsheetService.recordCreate(recordCreateRequest);
                            }
                        } else {
                            System.out.println("假勤周报子表不存在");
                        }
                    }
                }
            } catch (WxErrorException wxErrorException) {
                wxErrorException.printStackTrace();
            }
        } else {
            throw new BadRequestException("企微周报参数缺失");
        }
    }
    /**
     * 发送企微项目WBS及独立报告
     *
     * @param projectIds 周报用户企微ID
     */
    public void toWeComSheetPushProjectReport(List<Long> projectIds) {
        if (projectIds.size() > 0) {
            // 查询项目类型
            Map<Long, ProjectType> projectTypeMap = projectTypeRepository.findAll().stream().collect(Collectors.toMap(ProjectType::getId, i -> i));
            // 查询项目状态
            Map<String, String> projectStatusMap = dictDetailRepository.findByDictName(Constant.PROJECT_STATUS).stream().collect(Collectors.toMap(DictDetail::getValue, DictDetail::getLabel));
            // 查询任务状态
            Map<String, String> taskStatusMap = dictDetailRepository.findByDictName(Constant.TASK_STATUS).stream().collect(Collectors.toMap(DictDetail::getValue, DictDetail::getLabel));
            // 获取企微报告参数
            Map<String, String> reportParamMap = dictDetailRepository.findByDictName(Constant.WECOM_REPORT_PARAM).stream().collect(Collectors.toMap(DictDetail::getLabel, DictDetail::getValue));
            if (!reportParamMap.containsKey(Constant.WEEKLY_REPORT_DOC_ID)) {
                throw new BadRequestException("周报文件ID未设置");
            }
            try {
                // 获取企业微信Token
                wxCpService.getAccessToken();
                // 查询现有子表信息
                WxCpSheetQueryRequest sheetQueryRequest = new WxCpSheetQueryRequest();
                sheetQueryRequest.setDocId(reportParamMap.get(Constant.WEEKLY_REPORT_DOC_ID));
                WxCpSheetInfo sheetInfo = wxCpOaWeDocSmartsheetService.sheetInfo(sheetQueryRequest);
                for (Long projectId : projectIds) {
                    // 获取项目信息
                    Project project = projectRepository.findById(projectId).orElseGet(Project::new);
                    // 获取任务信息
                    Query taskQuery = new Query(Criteria.where("projectId").is(projectId));
                    List<TaskMongo> taskMongoList = mongoTemplate.find(taskQuery, TaskMongo.class);
                    List<TaskUserMongo> taskUserMongoList = mongoTemplate.find(Query.query(Criteria.where("task").in(taskMongoList)), TaskUserMongo.class);
                    // 项目WBS信息
                    SheetProperties wbsProjectSheet = sheetInfo.getSheetList().stream().reduce(null, (res, cur) -> cur.getTitle().equals(reportParamMap.get(Constant.PROJECT_REPORT_WBS_SHEET_NAME)) ? cur : res);
                    if (ObjectUtils.isNotEmpty(wbsProjectSheet)) {
                        Record projectRecord = new Record();
                        Integer queryOffset = 0;
                        do {
                            // 制作查询项目WBS子表记录条件
                            WxCpRecordQueryRequest recordQueryRequest = new WxCpRecordQueryRequest();
                            recordQueryRequest.setDocId(reportParamMap.get(Constant.WEEKLY_REPORT_DOC_ID));
                            recordQueryRequest.setSheetId(wbsProjectSheet.getSheetId());
                            recordQueryRequest.setKeyType("CELL_VALUE_KEY_TYPE_FIELD_TITLE");
                            recordQueryRequest.setOffset(queryOffset);
                            recordQueryRequest.setLimit(1000);
                            RecordSort sort = new RecordSort();
                            sort.setFieldTitle("项目ID");
                            sort.setDesc(true);
                            recordQueryRequest.setSort(Arrays.asList(sort));
                            // 查询项目WBS子表记录
                            WxCpRecordInfo wbsRecordInfo = wxCpOaWeDocSmartsheetService.recordInfo(recordQueryRequest);
                            // 查找对应项目记录
                            List<Record> filterRecordList = wbsRecordInfo.getRecords().stream().filter(item -> !item.getValues().isEmpty() && item.getValues().containsKey("项目ID") && Double.valueOf(projectId).equals(item.getValues().get("项目ID"))).collect(Collectors.toList());
                            projectRecord = filterRecordList.stream().findFirst().orElseGet(Record::new);
                            if (StringUtils.isBlank(projectRecord.getRecordId()) && !wbsRecordInfo.getHasMore()) {
                                break;
                            } else {
                                queryOffset++;
                            }
                        } while (StringUtils.isBlank(projectRecord.getRecordId()));
                        // 创建/更新记录
                        Map<String, Object> values = Optional.ofNullable(projectRecord.getValues()).orElse(new HashMap<>());
                        // 项目ID
                        if (!values.containsKey("项目ID")) {
                            values.put("项目ID", new Record.TypedValue(Record.DataType.FIELD_TYPE_NUMBER, projectId.doubleValue()).getValue());
                        }
                        // 项目类型
                        if (projectTypeMap.containsKey(project.getProjectTypeId())) {
                            RecordOption projectType = new RecordOption();
                            projectType.setText(projectTypeMap.get(project.getProjectTypeId()).getName());
                            values.put("项目类型", new Record.TypedValue(Record.DataType.FIELD_TYPE_SELECT, Arrays.asList(projectType)).getValue());
                        }
                        // 项目名称
                        RecordCellTextValue projectName = new RecordCellTextValue();
                        projectName.setType("text");
                        projectName.setText(project.getName());
                        values.put("项目名称", new Record.TypedValue(Record.DataType.FIELD_TYPE_TEXT, Arrays.asList(projectName)).getValue());
                        // 项目负责人
                        RecordCellTextValue projectLeader = new RecordCellTextValue();
                        String leaderName = Arrays.stream(project.getLiableUserId().split(",")).filter(f -> StringUtils.isNotBlank(f)).map(m -> {
                            Long userId = Long.parseLong(m.replace("-", ""));
                            User user = userRepository.findById(userId).orElseGet(User::new);
                            return Optional.ofNullable(user.getNickName()).orElse("");
                        }).collect(Collectors.joining(","));
                        projectLeader.setType("text");
                        projectLeader.setText(leaderName);
                        values.put("项目负责人", new Record.TypedValue(Record.DataType.FIELD_TYPE_TEXT, Arrays.asList(projectLeader)).getValue());
                        // 计划成本
                        ProjectCostSummary projectCostSummary = projectCostRepository.findSummaryByProjectId(projectId);
                        List<ProjectCostOther> projectCostOtherList = projectCostOtherRepository.findByProjectId(projectId);
                        Double planCost = projectCostSummary.getTotalLaborCost().add(projectCostOtherList.stream().map(ProjectCostOther::getProjectCost).reduce(BigDecimal.ZERO, BigDecimal::add)).doubleValue();
                        values.put("计划成本", new Record.TypedValue(Record.DataType.FIELD_TYPE_CURRENCY, planCost).getValue());
                        // 实际成本
                        Aggregation customerAgg = Aggregation.newAggregation(
                                Aggregation.match(Criteria.where("taskUserMongo").in(taskUserMongoList)),
                                Aggregation.project("userId", "consumedHours"),
                                Aggregation.group("userId").sum("consumedHours").as("consumedHours")
                        );
                        AggregationResults<Map> aggregate = mongoTemplate.aggregate(customerAgg, TaskDaliyMongo.class, Map.class);
                        BigDecimal actualCost = aggregate.getMappedResults().stream().filter(data -> data.get("_id") != null).map(data -> {
                            BigDecimal moneyTotalCost = calcUserCostByHours(Long.parseLong(String.valueOf(data.get("_id"))), Double.valueOf(String.valueOf(data.get("consumedHours"))));
                            return moneyTotalCost;
                        }).reduce(BigDecimal.ZERO, BigDecimal::add);
                        values.put("实际成本", new Record.TypedValue(Record.DataType.FIELD_TYPE_CURRENCY, actualCost.doubleValue()).getValue());
                        // 预计开始时间
                        String planStartTimestamp = String.valueOf(project.getPlanStartDate().getTime());
                        values.put("预计开始时间", new Record.TypedValue(Record.DataType.FIELD_TYPE_DATE_TIME, planStartTimestamp).getValue());
                        // 预计结束时间
                        String planEndTimestamp = String.valueOf(project.getPlanEndDate().getTime());
                        values.put("预计结束时间", new Record.TypedValue(Record.DataType.FIELD_TYPE_DATE_TIME, planEndTimestamp).getValue());
                        // 计划投入人月
                        BigDecimal planManMonth = taskUserMongoList.stream().map(p -> new BigDecimal(p.getTaskHours())).reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(160), 2, BigDecimal.ROUND_CEILING);
                        values.put("计划投入人月", new Record.TypedValue(Record.DataType.FIELD_TYPE_NUMBER, planManMonth.doubleValue()).getValue());
                        // 实际投入人月
                        BigDecimal actualManMonth = taskUserMongoList.stream().map(p -> new BigDecimal(p.getCostHours())).reduce(BigDecimal.ZERO, BigDecimal::add).divide(new BigDecimal(160), 2, BigDecimal.ROUND_CEILING);
                        values.put("实际投入人月", new Record.TypedValue(Record.DataType.FIELD_TYPE_NUMBER, actualManMonth.doubleValue()).getValue());
                        // 盈余
                        BigDecimal surplus = planManMonth.subtract(actualManMonth).max(BigDecimal.ZERO);
                        values.put("盈余", new Record.TypedValue(Record.DataType.FIELD_TYPE_NUMBER, surplus.doubleValue()).getValue());
                        // 项目状态
                        RecordOption projectStatus = new RecordOption();
                        projectStatus.setText(projectStatusMap.get(project.getProjectStatus()));
                        values.put("项目状态", new Record.TypedValue(Record.DataType.FIELD_TYPE_SELECT, Arrays.asList(projectStatus)).getValue());
                        // 项目描述
                        if (StringUtils.isNotBlank(project.getRequirement())) {
                            RecordCellTextValue projectDescription = new RecordCellTextValue();
                            projectDescription.setType("text");
                            projectDescription.setText(project.getRequirement());
                            values.put("项目描述", new Record.TypedValue(Record.DataType.FIELD_TYPE_TEXT, Arrays.asList(projectDescription)).getValue());
                        }
                        // 备注
                        if (StringUtils.isNotBlank(project.getRemarks())) {
                            RecordCellTextValue projectRemark = new RecordCellTextValue();
                            projectRemark.setType("text");
                            projectRemark.setText(project.getRemarks());
                            values.put("备注", new Record.TypedValue(Record.DataType.FIELD_TYPE_TEXT, Arrays.asList(projectRemark)).getValue());
                        }
                        if (StringUtils.isNotBlank(projectRecord.getRecordId())) {
                            // 更新记录
                            WxCpRecordEditRequest recordEditRequest = new WxCpRecordEditRequest();
                            recordEditRequest.setDocId(reportParamMap.get(Constant.WEEKLY_REPORT_DOC_ID));
                            recordEditRequest.setSheetId(wbsProjectSheet.getSheetId());
                            recordEditRequest.setKeyType("CELL_VALUE_KEY_TYPE_FIELD_TITLE");
                            projectRecord.setValues(values);
                            recordEditRequest.setRecords(Arrays.asList(projectRecord));
                            wxCpOaWeDocSmartsheetService.recordEdit(recordEditRequest);
                        } else {
                            // 创建记录
                            WxCpRecordCreateRequest recordCreateRequest = new WxCpRecordCreateRequest();
                            recordCreateRequest.setDocId(reportParamMap.get(Constant.WEEKLY_REPORT_DOC_ID));
                            recordCreateRequest.setSheetId(wbsProjectSheet.getSheetId());
                            recordCreateRequest.setKeyType("CELL_VALUE_KEY_TYPE_FIELD_TITLE");
                            projectRecord.setValues(values);
                            recordCreateRequest.setRecords(Arrays.asList(projectRecord));
                            wxCpOaWeDocSmartsheetService.recordCreate(recordCreateRequest);
                        }
                    } else {
                        System.out.println("项目WBS报告子表不存在");
                    }
                    // 项目独立报告
                    SheetProperties separateProjectSheet = sheetInfo.getSheetList().stream().reduce(null, (res, cur) -> cur.getTitle().equals(project.getName()) ? cur : res);
                    if (ObjectUtils.isEmpty(separateProjectSheet)) {
                        // 新建项目独立报告Sheet
                        WxCpSheetCreateRequest sheetCreateRequest = new WxCpSheetCreateRequest();
                        sheetCreateRequest.setDocId(reportParamMap.get(Constant.WEEKLY_REPORT_DOC_ID));
                        SheetProperties sheetProperties = new SheetProperties();
                        sheetProperties.setTitle(project.getName());
                        sheetProperties.setIndex(4);
                        sheetCreateRequest.setProperties(sheetProperties);
                        // 执行新建项目独立报告Sheet
                        WxCpSheetCreateData sheetCreateData = wxCpOaWeDocSmartsheetService.sheetCreate(sheetCreateRequest);
                        separateProjectSheet = sheetCreateData.getProperties();
                        // 查询Sheet字段默认列:因智能表格至少一列的要求,创建Sheet时会有一个默认列
                        WxCpFieldQueryRequest fieldQueryRequest = new WxCpFieldQueryRequest();
                        fieldQueryRequest.setDocId(reportParamMap.get(Constant.WEEKLY_REPORT_DOC_ID));
                        fieldQueryRequest.setSheetId(separateProjectSheet.getSheetId());
                        fieldQueryRequest.setOffset(0);
                        fieldQueryRequest.setLimit(1000);
                        WxCpFieldInfo fieldInfo = wxCpOaWeDocSmartsheetService.fieldInfo(fieldQueryRequest);
                        // 创建项目独立报告Field
                        List<Field> fieldList = new ArrayList<>();
                        // 任务ID
                        Field taskId = new Field();
                        taskId.setFieldTitle("任务ID");
                        taskId.setFieldType("FIELD_TYPE_TEXT");
                        fieldList.add(taskId);
                        // 优先级
                        Field taskLevel = new Field();
                        taskLevel.setFieldTitle("优先级");
                        taskLevel.setFieldType("FIELD_TYPE_SINGLE_SELECT");
                        SingleSelectFieldProperty taskLevelProp = new SingleSelectFieldProperty();
                        taskLevelProp.setIsQuickAdd(false);
                        FieldOption highOption = new FieldOption();
                        highOption.setText("高");
                        highOption.setStyle(18);
                        FieldOption mediumOption = new FieldOption();
                        mediumOption.setText("中");
                        mediumOption.setStyle(23);
                        FieldOption lowOption = new FieldOption();
                        lowOption.setText("低");
                        lowOption.setStyle(14);
                        taskLevelProp.setOptions(Arrays.asList(highOption, mediumOption, lowOption));
                        taskLevel.setPropertySingleSelect(taskLevelProp);
                        fieldList.add(taskLevel);
                        // 备注
                        Field remark = new Field();
                        remark.setFieldTitle("备注");
                        remark.setFieldType("FIELD_TYPE_TEXT");
                        fieldList.add(remark);
                        // 完成度
                        Field completePercent = new Field();
                        completePercent.setFieldTitle("完成度");
                        completePercent.setFieldType("FIELD_TYPE_PERCENTAGE");
                        PercentageFieldProperty completePercentProp = new PercentageFieldProperty();
                        completePercentProp.setDecimalPlaces(0);
                        completePercentProp.setUseSeparate(false);
                        completePercent.setPropertyPercentage(completePercentProp);
                        fieldList.add(completePercent);
                        // 状态
                        Field taskStatus = new Field();
                        taskStatus.setFieldTitle("状态");
                        taskStatus.setFieldType("FIELD_TYPE_SINGLE_SELECT");
                        SingleSelectFieldProperty taskStatusProp = new SingleSelectFieldProperty();
                        taskStatusProp.setIsQuickAdd(false);
                        FieldOption notStartOption = new FieldOption();
                        notStartOption.setText("未开始");
                        notStartOption.setStyle(21);
                        FieldOption inHandOption = new FieldOption();
                        inHandOption.setText("进行中");
                        inHandOption.setStyle(23);
                        FieldOption toBeTestOption = new FieldOption();
                        toBeTestOption.setText("待测试");
                        toBeTestOption.setStyle(12);
                        FieldOption stopOption = new FieldOption();
                        stopOption.setText("已暂停");
                        stopOption.setStyle(18);
                        FieldOption toBeAdminOption = new FieldOption();
                        toBeAdminOption.setText("待承认");
                        toBeAdminOption.setStyle(20);
                        FieldOption completeOption = new FieldOption();
                        completeOption.setText("已完成");
                        completeOption.setStyle(16);
                        taskStatusProp.setOptions(Arrays.asList(notStartOption, inHandOption, toBeTestOption, stopOption, toBeAdminOption, completeOption));
                        taskStatus.setPropertySingleSelect(taskStatusProp);
                        fieldList.add(taskStatus);
                        // 实际工时
                        Field actualHours = new Field();
                        actualHours.setFieldTitle("实际工时");
                        actualHours.setFieldType("FIELD_TYPE_NUMBER");
                        NumberFieldProperty actualHoursProperty = new NumberFieldProperty();
                        actualHoursProperty.setDecimalPlaces(2);
                        actualHoursProperty.setUseSeparate(false);
                        actualHours.setPropertyNumber(actualHoursProperty);
                        fieldList.add(actualHours);
                        // 实际完成时间
                        Field actualEndTime = new Field();
                        actualEndTime.setFieldTitle("实际完成时间");
                        actualEndTime.setFieldType("FIELD_TYPE_DATE_TIME");
                        DateTimeFieldProperty actualEndTimeProp = new DateTimeFieldProperty();
                        actualEndTimeProp.setFormat("yyyy\"年\"m\"月\"d\"日\"");
                        actualEndTimeProp.setAutoFill(false);
                        actualEndTime.setPropertyDateTime(actualEndTimeProp);
                        fieldList.add(actualEndTime);
                        // 实际开始时间
                        Field actualStartTime = new Field();
                        actualStartTime.setFieldTitle("实际开始时间");
                        actualStartTime.setFieldType("FIELD_TYPE_DATE_TIME");
                        DateTimeFieldProperty actualStartTimeProp = new DateTimeFieldProperty();
                        actualStartTimeProp.setFormat("yyyy\"年\"m\"月\"d\"日\"");
                        actualStartTimeProp.setAutoFill(false);
                        actualStartTime.setPropertyDateTime(actualStartTimeProp);
                        fieldList.add(actualStartTime);
                        // 预计工时
                        Field expectHours = new Field();
                        expectHours.setFieldTitle("预计工时");
                        expectHours.setFieldType("FIELD_TYPE_NUMBER");
                        NumberFieldProperty expectHoursProperty = new NumberFieldProperty();
                        expectHoursProperty.setDecimalPlaces(2);
                        expectHoursProperty.setUseSeparate(false);
                        expectHours.setPropertyNumber(expectHoursProperty);
                        fieldList.add(expectHours);
                        // 预计完成时间
                        Field planEndTime = new Field();
                        planEndTime.setFieldTitle("预计完成时间");
                        planEndTime.setFieldType("FIELD_TYPE_DATE_TIME");
                        DateTimeFieldProperty planEndTimeProp = new DateTimeFieldProperty();
                        planEndTimeProp.setFormat("yyyy\"年\"m\"月\"d\"日\"");
                        planEndTimeProp.setAutoFill(false);
                        planEndTime.setPropertyDateTime(planEndTimeProp);
                        fieldList.add(planEndTime);
                        // 预计开始时间
                        Field planStartTime = new Field();
                        planStartTime.setFieldTitle("预计开始时间");
                        planStartTime.setFieldType("FIELD_TYPE_DATE_TIME");
                        DateTimeFieldProperty planStartTimeProp = new DateTimeFieldProperty();
                        planStartTimeProp.setFormat("yyyy\"年\"m\"月\"d\"日\"");
                        planStartTimeProp.setAutoFill(false);
                        planStartTime.setPropertyDateTime(planStartTimeProp);
                        fieldList.add(planStartTime);
                        // 作成者
                        Field taskAllocCreator = new Field();
                        taskAllocCreator.setFieldTitle("作成者");
                        taskAllocCreator.setFieldType("FIELD_TYPE_TEXT");
                        fieldList.add(taskAllocCreator);
                        // 任务分配-名称
                        Field taskAllocName = new Field();
                        taskAllocName.setFieldTitle("任务分配-名称");
                        taskAllocName.setFieldType("FIELD_TYPE_TEXT");
                        fieldList.add(taskAllocName);
                        // 任务详情-描述
                        Field taskDetailDescription = new Field();
                        taskDetailDescription.setFieldTitle("任务详情-描述");
                        taskDetailDescription.setFieldType("FIELD_TYPE_TEXT");
                        fieldList.add(taskDetailDescription);
                        // 任务详情-任务负责人
                        Field taskDetailLeader = new Field();
                        taskDetailLeader.setFieldTitle("任务详情-任务负责人");
                        taskDetailLeader.setFieldType("FIELD_TYPE_TEXT");
                        fieldList.add(taskDetailLeader);
                        // 任务详情-名称
                        Field taskDetailName = new Field();
                        taskDetailName.setFieldTitle("任务详情-名称");
                        taskDetailName.setFieldType("FIELD_TYPE_TEXT");
                        fieldList.add(taskDetailName);
                        // 项目负责人
                        Field projectLeader = new Field();
                        projectLeader.setFieldTitle("项目负责人");
                        projectLeader.setFieldType("FIELD_TYPE_TEXT");
                        fieldList.add(projectLeader);
                        // 项目名称
                        Field projectName = new Field();
                        projectName.setFieldTitle("项目名称");
                        projectName.setFieldType("FIELD_TYPE_TEXT");
                        fieldList.add(projectName);
                        // 执行创建项目独立报告Field
                        WxCpFieldCreateRequest fieldCreateRequest = new WxCpFieldCreateRequest();
                        fieldCreateRequest.setDocId(reportParamMap.get(Constant.WEEKLY_REPORT_DOC_ID));
                        fieldCreateRequest.setSheetId(separateProjectSheet.getSheetId());
                        fieldCreateRequest.setFields(fieldList);
                        wxCpOaWeDocSmartsheetService.fieldCreate(fieldCreateRequest);
                        // 删除创建Sheet时的默认列
                        List<String> delFieldIdList = fieldInfo.getFields().stream().map(f -> f.getFieldId()).collect(Collectors.toList());
                        wxCpOaWeDocSmartsheetService.fieldDelete(reportParamMap.get(Constant.WEEKLY_REPORT_DOC_ID), separateProjectSheet.getSheetId(), delFieldIdList);
                    }
                    // 添加项目独立报告记录
                    List<Record> recordList = new ArrayList<>();
                    Integer queryOffset = 0;
                    do {
                        // 查询项目独立报告记录
                        WxCpRecordQueryRequest recordQueryRequest = new WxCpRecordQueryRequest();
                        recordQueryRequest.setDocId(reportParamMap.get(Constant.WEEKLY_REPORT_DOC_ID));
                        recordQueryRequest.setSheetId(separateProjectSheet.getSheetId());
                        recordQueryRequest.setKeyType("CELL_VALUE_KEY_TYPE_FIELD_TITLE");
                        RecordSort sort = new RecordSort();
                        sort.setFieldTitle("任务ID");
                        sort.setDesc(true);
                        recordQueryRequest.setSort(Arrays.asList(sort));
                        recordQueryRequest.setOffset(queryOffset);
                        recordQueryRequest.setLimit(1000);
                        WxCpRecordInfo recordInfo = wxCpOaWeDocSmartsheetService.recordInfo(recordQueryRequest);
                        recordList.addAll(recordInfo.getRecords());
                        if (!recordInfo.getHasMore()) {
                            break;
                        } else {
                            queryOffset++;
                        }
                    } while (recordList.size() > 0);
                    // 整理新建及更新数据
                    Map<String, List<Record>> filterRecordMap = taskUserMongoList.stream().map(taskUserMongo -> {
                        Record taskRecord = recordList.stream().filter(record -> taskUserMongo.getId().equals(record.getValues().get("任务ID"))).findFirst().orElseGet(Record::new);
                        // 获取日报信息
                        List<TaskDaliyMongo> daliyMongoList = mongoTemplate.find(Query.query(new Criteria("taskUserMongo").is(taskUserMongo)), TaskDaliyMongo.class);
                        Map<String, Object> values = new HashMap<>();
                        // 项目名称
                        RecordCellTextValue projectName = new RecordCellTextValue();
                        projectName.setType("text");
                        projectName.setText(project.getName());
                        values.put("项目名称", new Record.TypedValue(Record.DataType.FIELD_TYPE_TEXT, Arrays.asList(projectName)).getValue());
                        // 项目负责人
                        RecordCellTextValue projectLeader = new RecordCellTextValue();
                        String leaderName = Arrays.stream(project.getLiableUserId().split(",")).filter(f -> StringUtils.isNotBlank(f)).map(m -> {
                            Long userId = Long.parseLong(m.replace("-", ""));
                            User user = userRepository.findById(userId).orElseGet(User::new);
                            return Optional.ofNullable(user.getNickName()).orElse("");
                        }).collect(Collectors.joining(","));
                        projectLeader.setType("text");
                        projectLeader.setText(leaderName);
                        values.put("项目负责人", new Record.TypedValue(Record.DataType.FIELD_TYPE_TEXT, Arrays.asList(projectLeader)).getValue());
                        // 任务详情-名称
                        RecordCellTextValue taskDetailName = new RecordCellTextValue();
                        taskDetailName.setType("text");
                        taskDetailName.setText(taskUserMongo.getTask().getName());
                        values.put("任务详情-名称", new Record.TypedValue(Record.DataType.FIELD_TYPE_TEXT, Arrays.asList(taskDetailName)).getValue());
                        // 任务详情-任务负责人
                        String taskDetailLeaderName = taskUserMongo.getTask().getUserIdList().stream().map(userId -> {
                            User user = userRepository.findById(userId).orElseGet(User::new);
                            return Optional.ofNullable(user.getNickName()).orElse("");
                        }).collect(Collectors.joining(","));
                        RecordCellTextValue taskDetailLeader = new RecordCellTextValue();
                        taskDetailLeader.setType("text");
                        taskDetailLeader.setText(taskDetailLeaderName);
                        values.put("任务详情-任务负责人", new Record.TypedValue(Record.DataType.FIELD_TYPE_TEXT, Arrays.asList(taskDetailLeader)).getValue());
                        // 任务详情-描述
                        if (StringUtils.isNotBlank(taskUserMongo.getTask().getDescription())) {
                            RecordCellTextValue taskDetailDescription = new RecordCellTextValue();
                            taskDetailDescription.setType("text");
                            taskDetailDescription.setText(taskUserMongo.getTask().getDescription());
                            values.put("任务详情-描述", new Record.TypedValue(Record.DataType.FIELD_TYPE_TEXT, Arrays.asList(taskDetailDescription)).getValue());
                        }
                        // 任务分配-名称
                        RecordCellTextValue taskAllocName = new RecordCellTextValue();
                        taskAllocName.setType("text");
                        taskAllocName.setText(taskUserMongo.getName());
                        values.put("任务分配-名称", new Record.TypedValue(Record.DataType.FIELD_TYPE_TEXT, Arrays.asList(taskAllocName)).getValue());
                        // 作成者
                        RecordCellTextValue taskAllocCreator = new RecordCellTextValue();
                        taskAllocCreator.setType("text");
                        if (ObjectUtils.isNotEmpty(taskUserMongo.getUserId())) {
                            User user = userRepository.findById(taskUserMongo.getUserId()).orElseGet(User::new);
                            taskAllocCreator.setText(user.getNickName());
                        } else {
                            taskAllocCreator.setText("");
                        }
                        values.put("作成者", new Record.TypedValue(Record.DataType.FIELD_TYPE_TEXT, Arrays.asList(taskAllocCreator)).getValue());
                        // 预计开始时间
                        String planStartTimestamp = String.valueOf(taskUserMongo.getTaskStartDate().getTime());
                        values.put("预计开始时间", new Record.TypedValue(Record.DataType.FIELD_TYPE_DATE_TIME, planStartTimestamp).getValue());
                        // 预计完成时间
                        String planEndTimestamp = String.valueOf(taskUserMongo.getTaskEndDate().getTime());
                        values.put("预计完成时间", new Record.TypedValue(Record.DataType.FIELD_TYPE_DATE_TIME, planEndTimestamp).getValue());
                        // 预计工时
                        values.put("预计工时", new Record.TypedValue(Record.DataType.FIELD_TYPE_NUMBER, taskUserMongo.getTaskHours()).getValue());
                        // 实际开始时间
                        if (daliyMongoList.size() > 0) {
                            daliyMongoList.sort(((o1, o2) -> o1.getFillDate().compareTo(o2.getFillDate())));
                            String actualStartTimestamp = String.valueOf(daliyMongoList.get(0).getFillDate().getTime());
                            values.put("实际开始时间", new Record.TypedValue(Record.DataType.FIELD_TYPE_DATE_TIME, actualStartTimestamp).getValue());
                        }
                        // 实际完成时间
                        if (daliyMongoList.size() > 0 && Constant.TASK_STATUS_COMPLETED.equals(taskUserMongo.getTaskStatus())) {
                            daliyMongoList.sort(((o1, o2) -> o2.getFillDate().compareTo(o1.getFillDate())));
                            String actualEndTimestamp = String.valueOf(daliyMongoList.get(0).getFillDate().getTime());
                            values.put("实际完成时间", new Record.TypedValue(Record.DataType.FIELD_TYPE_DATE_TIME, actualEndTimestamp).getValue());
                        }
                        // 实际工时
                        values.put("实际工时", new Record.TypedValue(Record.DataType.FIELD_TYPE_NUMBER, taskUserMongo.getCostHours()).getValue());
                        // 状态
                        RecordOption taskStatus = new RecordOption();
                        taskStatus.setText(taskStatusMap.get(taskUserMongo.getTaskStatus()));
                        values.put("状态", new Record.TypedValue(Record.DataType.FIELD_TYPE_SELECT, Arrays.asList(taskStatus)).getValue());
                        // 完成度
                        Double completePercent = new Double(0);
                        if (daliyMongoList.size() > 0) {
                            daliyMongoList.sort(((o1, o2) -> o2.getFillDate().compareTo(o1.getFillDate())));
                            completePercent = daliyMongoList.get(0).getTaskProgress();
                        }
                        values.put("完成度", new Record.TypedValue(Record.DataType.FIELD_TYPE_PERCENTAGE, completePercent).getValue());
                        // 任务ID
                        RecordCellTextValue taskId = new RecordCellTextValue();
                        taskId.setType("text");
                        taskId.setText(taskUserMongo.getId());
                        values.put("任务ID", new Record.TypedValue(Record.DataType.FIELD_TYPE_TEXT, Arrays.asList(taskId)).getValue());
                        taskRecord.setValues(values);
                        return taskRecord;
                    }).collect(Collectors.groupingBy(record -> StringUtils.isNotBlank(record.getRecordId()) ? "EDIT" : "CREATE"));
                    // 创建新纪录
                    List<Record> recordCreateList = filterRecordMap.getOrDefault("CREATE", Collections.emptyList());
                    if (recordCreateList.size() > 0) {
                        WxCpRecordCreateRequest recordCreateRequest = new WxCpRecordCreateRequest();
                        recordCreateRequest.setDocId(reportParamMap.get(Constant.WEEKLY_REPORT_DOC_ID));
                        recordCreateRequest.setSheetId(separateProjectSheet.getSheetId());
                        recordCreateRequest.setKeyType("CELL_VALUE_KEY_TYPE_FIELD_TITLE");
                        recordCreateRequest.setRecords(recordCreateList);
                        wxCpOaWeDocSmartsheetService.recordCreate(recordCreateRequest);
                    }
                    // 编辑记录
                    List<Record> recordEditList = filterRecordMap.getOrDefault("EDIT", Collections.emptyList());
                    if (recordEditList.size() > 0) {
                        WxCpRecordEditRequest recordEditRequest = new WxCpRecordEditRequest();
                        recordEditRequest.setDocId(reportParamMap.get(Constant.WEEKLY_REPORT_DOC_ID));
                        recordEditRequest.setSheetId(separateProjectSheet.getSheetId());
                        recordEditRequest.setKeyType("CELL_VALUE_KEY_TYPE_FIELD_TITLE");
                        recordEditRequest.setRecords(recordEditList);
                        wxCpOaWeDocSmartsheetService.recordEdit(recordEditRequest);
                    }
                    // 删除记录
                    Set<String> taskUserMongoIdSet = taskUserMongoList.stream().map(TaskUserMongo::getId).collect(Collectors.toSet());
                    List<String> delRecordIdList = recordList.stream()
                            .filter(record -> !taskUserMongoIdSet.contains(record.getValues().getOrDefault("任务ID", "").toString()))
                            .map(t -> t.getRecordId()).collect(Collectors.toList());
                    if (delRecordIdList.size() > 0) {
                        wxCpOaWeDocSmartsheetService.recordDelete(reportParamMap.get(Constant.WEEKLY_REPORT_DOC_ID), separateProjectSheet.getSheetId(), delRecordIdList);
                    }
                }
            } catch (WxErrorException wxErrorException) {
                wxErrorException.printStackTrace();
            }
        } else {
            throw new BadRequestException("企微项目WBS及独立报告参数缺失");
        }
    }
    /**
     * 计算用户所需成本
     *
     * @param userId
     * @param timeTotalCost
     * @return
     */
    private BigDecimal calcUserCostByHours(Long userId, Double timeTotalCost) {
        // 工资
        BigDecimal wageCost = BigDecimal.valueOf(0);
        // 通过id获取用户级别工资
        List<UserLevelWage> sysUserLevelWages = sysUserLevelWageRepository.findUserLevelWageByUserId(userId);
        if (sysUserLevelWages.size() == 0) {
            return BigDecimal.ZERO;
        }
        // 通过id获取用户级别保险
        List<UserInsurance> sysUserLevelInsurances = sysUserLevelInsuranceRepository.findByUserId(userId);
        if (sysUserLevelInsurances.size() == 0) {
            return BigDecimal.ZERO;
        }
        // 工资
        UserLevelWage sysUserLevelWage = sysUserLevelWages.get(sysUserLevelWages.size() - 1);
        wageCost = wageCost.add(sysUserLevelWage.getBasicWage().add(sysUserLevelWage.getRankWage()).add(sysUserLevelWage.getPerformanceWage()).multiply(BigDecimal.valueOf(timeTotalCost)).divide(BigDecimal.valueOf(160), 2, BigDecimal.ROUND_CEILING));
        // 五险一金
        UserInsurance sysUserLevelInsurance = sysUserLevelInsurances.get(sysUserLevelInsurances.size() - 1);
        BigDecimal accumulationRadix = sysUserLevelInsurance.getAccumulationFund().multiply(BigDecimal.valueOf(sysUserLevelInsurance.getAccumulationFundCompany() / 100));
        BigDecimal pensionRadix = sysUserLevelInsurance.getRetirementInsurance().multiply(BigDecimal.valueOf(sysUserLevelInsurance.getRetirementInsuranceCompany() / 100));
        BigDecimal medicalRadix = sysUserLevelInsurance.getMedicalInsurance().multiply(BigDecimal.valueOf(sysUserLevelInsurance.getMedicalInsuranceCompany() / 100));
        BigDecimal unemploymentRadix = sysUserLevelInsurance.getUnemploymentInsurance().multiply(BigDecimal.valueOf(sysUserLevelInsurance.getUnemploymentInsuranceCompany() / 100));
        BigDecimal maternityRadix = sysUserLevelInsurance.getBirthInsurance().multiply(BigDecimal.valueOf(sysUserLevelInsurance.getBirthInsuranceCompany() / 100));
        BigDecimal industrialInjuryRadix = sysUserLevelInsurance.getEmploymentInsurance().multiply(BigDecimal.valueOf(sysUserLevelInsurance.getEmploymentInsuranceCompany() / 100));
        wageCost = wageCost.add(accumulationRadix.add(pensionRadix).add(medicalRadix).add(unemploymentRadix).add(maternityRadix).add(industrialInjuryRadix).multiply(BigDecimal.valueOf(timeTotalCost)).divide(BigDecimal.valueOf(160), 2, BigDecimal.ROUND_CEILING));
        return wageCost;
    }
    /**
     * 判断是否为非工作日
     *
     * @param date
     * @param holidayConfig
     * @return
     */
    private boolean isNonWorkingDay(LocalDate date, SysConfigHoliday holidayConfig) {
        boolean isWeekend = date.getDayOfWeek() == DayOfWeek.SATURDAY || date.getDayOfWeek() == DayOfWeek.SUNDAY;
        if (holidayConfig != null) {
            String dateType = holidayConfig.getDateType();
            return (isWeekend && !Constant.DATE_TYPE_WEEKDAY.equals(dateType)) ||
                    Constant.DATE_TYPE_WEEKEND.equals(dateType) ||
                    Constant.DATE_TYPE_LEGAL_HOLIDAYS.equals(dateType) ||
                    Constant.DATE_TYPE_HOLIDAYS.equals(dateType);
        }
        return isWeekend;
    }
    /**
     * 判断是否为工作日
     *
     * @param date
     * @param holidayConfig
     * @return
     */
    private boolean isWorkingDay(LocalDate date, SysConfigHoliday holidayConfig) {
        boolean isWeekend = date.getDayOfWeek() == DayOfWeek.SATURDAY || date.getDayOfWeek() == DayOfWeek.SUNDAY;
        if (holidayConfig != null) {
            String dateType = holidayConfig.getDateType();
            return (isWeekend && Constant.DATE_TYPE_WEEKDAY.equals(dateType)) ||
                    (!isWeekend && !Constant.DATE_TYPE_WEEKEND.equals(dateType) && !Constant.DATE_TYPE_LEGAL_HOLIDAYS.equals(dateType) && !Constant.DATE_TYPE_HOLIDAYS.equals(dateType));
        }
        return !isWeekend;
    }
    /**
     * 查找第一个工作日
     *
     * @param todayDate
     * @return
     */
    private DateTime findPreviousHoliday(LocalDate todayDate) {
        int minusDay = 1;
        while (true) {
            LocalDate beforeDate = todayDate.minusDays(minusDay);
            SysConfigHoliday beforeHolidayConfig = sysConfigHolidayRepository.findByHolidayDate(beforeDate.toString());
            if (isNonWorkingDay(beforeDate, beforeHolidayConfig)) {
                return new DateTime(todayDate.minusDays(minusDay - 1));
            }
            minusDay++;
        }
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/OpenApiWeComMethod.java
@@ -38,4 +38,12 @@
        // 凌晨02:30执行,更新晚打卡情况
        weComService.getWeComAttendanceListOfNight(null,null);
    }
    /**
     * 每周最后一天14:00执行,更新企微周报
     */
    public void getWeComWeeklyReport() throws Exception {
        // 下午14:00执行,更新企微周报
        weComService.toWecomSheetPushReport();
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/rest/TaskDaliyController.java
@@ -166,4 +166,13 @@
    public ResponseEntity<Object> checkTask(Double taskProgress, String taskUserId, String fillDate) {
        return new ResponseEntity<>(taskDaliyService.checkTask(taskProgress, taskUserId.split(",")[0],fillDate.split(",")[0]),HttpStatus.OK);
    }
    @PostMapping(value = "/generateReport")
    @Log("根据时间生成人员报告")
    @ApiOperation("根据时间生成人员报告")
    @PreAuthorize("@el.check('taskDaliy:report')")
    public ResponseEntity<Object> generateReport(@RequestBody TaskDaliyQueryCriteria criteria) {
        taskDaliyService.generateReport(criteria);
        return new ResponseEntity<>(HttpStatus.OK);
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/TaskDaliyService.java
@@ -131,4 +131,9 @@
    boolean checkTask(Double taskProgress, String taskUserId, String fillDate);
    /**
     * 根据时间生成人员报告
     * @param criteria
     */
    void generateReport(TaskDaliyQueryCriteria criteria);
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskDaliyServiceImpl.java
@@ -26,11 +26,14 @@
import cn.hutool.core.date.DateTime;
import me.zhengjie.modules.project.domain.Project;
import me.zhengjie.modules.quartz.service.impl.WeComServiceImpl;
import me.zhengjie.modules.system.domain.Dept;
import me.zhengjie.modules.system.domain.DictDetail;
import me.zhengjie.modules.system.domain.User;
import me.zhengjie.modules.system.repository.DictDetailRepository;
import me.zhengjie.modules.system.service.DeptService;
import me.zhengjie.modules.system.service.dto.UserQueryCriteria;
import me.zhengjie.modules.task.domain.*;
import me.zhengjie.modules.task.repository.TaskRepository;
import me.zhengjie.modules.task.service.dto.TaskDaliyMongoDto;
import me.zhengjie.utils.*;
import org.apache.commons.lang3.ObjectUtils;
@@ -74,10 +77,11 @@
    private final ProjectRepository projectRepository;
    private final UserRepository userRepository;
    private final TaskUserRepository taskUserRepository;
    private final TaskRepository taskRepository;
    private final DictDetailRepository dictDetailRepository;
    private final RoleService roleService;
    private final MongoTemplate mongoTemplate;
    private final WeComServiceImpl weComService;
    private final DeptService deptService;
    @Override
    public List<TaskDaliyMongoDto> statistics(TaskDaliyQueryCriteria criteria) {
@@ -852,4 +856,27 @@
            throw new RuntimeException(e);
        }
    }
    @Override
    public void generateReport(TaskDaliyQueryCriteria criteria) {
        List<Long> userIds = new ArrayList<>();
        DateTime startTime = new DateTime(criteria.getFillDates().get(0));
        DateTime endTime = new DateTime(criteria.getFillDates().get(1));
        if (ObjectUtils.isNotEmpty(criteria.getUserId())) {
            // 指定人员
            userIds = Arrays.asList(criteria.getUserId());
        } else {
            // 全部开发部人员
            UserQueryCriteria userQueryCriteria = new UserQueryCriteria();
            userQueryCriteria.setEnabled(true);
            userQueryCriteria.getDeptIds().add(7L);
            // 先查找是否存在子节点
            List<Dept> data = deptService.findByPid(7L);
            // 然后把子节点的ID都加入到集合中
            userQueryCriteria.getDeptIds().addAll(deptService.getDeptChildren(data));
            userIds = userRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, userQueryCriteria, criteriaBuilder)).stream().map(u -> u.getId()).collect(Collectors.toList());
        }
        weComService.toWecomSheetPushWeeklyReport(userIds, startTime, endTime);
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/temp/service/WechatSendHistoryService.java
@@ -103,4 +103,10 @@
     * @return String
     */
    void handleApprovalCallback(String msgSignature, String timestamp, String nonce, HttpServletRequest request, HttpServletResponse response);
    /**
     * 用SpNo处理下发企微消息
     * @param spNo /
     */
    void handleWechatSendHistoryBySpNo(String spNo);
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/temp/service/dto/WechatSendHistoryQueryCriteria.java
@@ -26,4 +26,7 @@
**/
@Data
public class WechatSendHistoryQueryCriteria{
    /** 模糊 */
    @Query(type = Query.Type.INNER_LIKE, propName = "content")
    private String contentInnerLike;
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/temp/service/impl/WechatSendHistoryServiceImpl.java
@@ -30,6 +30,7 @@
import org.json.JSONObject;
import org.json.XML;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.data.domain.Page;
@@ -202,6 +203,22 @@
        }
    }
    @Override
    public void handleWechatSendHistoryBySpNo(String spNo) {
        if (StringUtils.isNotBlank(spNo)) {
            WechatSendHistoryQueryCriteria criteria = new WechatSendHistoryQueryCriteria();
            criteria.setContentInnerLike(spNo);
            List<WechatSendHistory> historyList = wechatSendHistoryRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder), Sort.by(Sort.Direction.DESC, "id"));
            if (historyList.size() > 0) {
                WechatSendHistory filterData = historyList.stream().filter(h -> h.getContent().startsWith("{\"ApprovalInfo\"")).findFirst().orElseGet(WechatSendHistory::new);
                if (StringUtils.isNotBlank(filterData.getContent())) {
                    ChangeApprovalStatusEvent event = new ChangeApprovalStatusEvent(new Object(), filterData.getId());
                    applicationEventPublisher.publishEvent(event);
                }
            }
        }
    }
    /**
     * 判断字符串是不是Json格式
     *
eladmin-web-master/src/api/project/project.js
@@ -127,4 +127,12 @@
  })
}
export default { getAll, add, edit, del, editAdmit, editDisavow, getPartake, getRelevant, getProjectCost, getSubgroupTurnover, getSubgroupWorkingHours, getProjectWorkingHours, getTypeContractPrice, getTypeWorkingHours, getSubgroupTopHours, getRelevantOfDaily }
export function generateReport(data) {
  return request({
    url: 'api/project/generateReport',
    method: 'post',
    data
  })
}
export default { getAll, add, edit, del, editAdmit, editDisavow, getPartake, getRelevant, getProjectCost, getSubgroupTurnover, getSubgroupWorkingHours, getProjectWorkingHours, getTypeContractPrice, getTypeWorkingHours, getSubgroupTopHours, getRelevantOfDaily, generateReport }
eladmin-web-master/src/api/task/taskDaliy.js
@@ -112,4 +112,12 @@
  })
}
export default { get, getAll, getStatistics, add, edit, del, completedWork, complianceWork, taskTotalConsumedHours, getTaskDaliyWithHours, taskConsumedHours, getDailyDetail, getDailyTaskProgress, checkTaskHours }
export function generateReport(data) {
  return request({
    url: 'api/taskDaliy/generateReport',
    method: 'post',
    data
  })
}
export default { get, getAll, getStatistics, add, edit, del, completedWork, complianceWork, taskTotalConsumedHours, getTaskDaliyWithHours, taskConsumedHours, getDailyDetail, getDailyTaskProgress, checkTaskHours, generateReport }
eladmin-web-master/src/components/ApprovalLine/index.vue
@@ -5,7 +5,7 @@
        <div v-if="node.NodeType && node.NodeType === 1 && node.SubNodeList" class="flex-column gap-10">
          <div class="flex-row gap-10 weight-600">
            <div class="flex-row align-center">审批人</div>
            <div class="flex-row align-center">
            <div v-show="!eventRejectSpStatus.includes(eventData.spStatus) || node.SpStatus !== 1" class="flex-row align-center">
              <span>{{ spStatusMap[node.SpStatus] || '其他' }}</span>
            </div>
            <div>
@@ -21,7 +21,7 @@
                  </el-badge>
                  <div class="name">{{ userNameMap[subNode.UserInfo.UserId] || subNode.UserInfo.UserId }}</div>
                </div>
                <div class="flex-row gap-10 align-center">
                <div v-show="!eventRejectSpStatus.includes(eventData.spStatus) || subNode.Sptime" class="flex-row gap-10 align-center">
                  <div class="status">{{ node.ApvRel === 2 && node.SpStatus !== subNode.SpYj ? '' : (subSpStatusMap[subNode.SpYj] || '其他') }}</div>
                  <div class="time">{{ subNode.Sptime > 0 ? parseTime(subNode.Sptime, '{y}/{m}/{d} {h}:{i}') : '' }}</div>
                </div>
@@ -127,7 +127,9 @@
        13: '同意并加签',
        14: '已办理',
        15: '已转交'
      }
      },
      // 事件否决终态
      eventRejectSpStatus: ['3', '4', '6', '7']
    }
  },
  computed: {
eladmin-web-master/src/views/attendance/attendanceBusinessTravel/index.vue
@@ -178,48 +178,36 @@
          <el-form-item label="出差开始日期" prop="travelStartTime">
            <el-date-picker
              v-model="form.travelStartTime"
              :type="'date'"
              type="datetime"
              placeholder="选择日期"
              value-format="yyyy-MM-dd"
              value-format="yyyy-MM-dd HH:mm:ss"
              style="width: 340px;"
              align="right"
              :picker-options="{
                disabledDate(time) {
                  return form.travelEndTime
                    ? time.getTime() >
                      new Date(form.travelEndTime).getTime() - 8.64e7
                    : false;
                  return form.travelEndTime ? time.getTime() > new Date(form.travelEndTime).getTime() - 8.64e7 : false;
                }
              }"
              :disabled="
                form.approvalStatus == dictGoOutAgree ||
                  form.approvalStatus == dictGoOutReturn ||
                  form.wecomSpNo !== null
              "
              :default-time="$store.state.user.user.sysRostering.workStartTime + ':00'"
              :disabled="form.approvalStatus == dictGoOutAgree || form.approvalStatus == dictGoOutReturn || form.wecomSpNo !== null"
              @change="checkTime"
            />
          </el-form-item>
          <el-form-item label="出差结束日期" prop="travelEndTime">
            <el-date-picker
              v-model="form.travelEndTime"
              :type="'date'"
              type="datetime"
              placeholder="选择日期"
              style="width: 340px;"
              value-format="yyyy-MM-dd"
              value-format="yyyy-MM-dd HH:mm:ss"
              align="right"
              :picker-options="{
                disabledDate(time) {
                  return form.travelStartTime
                    ? time.getTime() <
                      new Date(form.travelStartTime).getTime() - 8.64e7
                    : false;
                  return form.travelStartTime ? time.getTime() < new Date(form.travelStartTime).getTime() - 8.64e7 : false;
                }
              }"
              :disabled="
                form.approvalStatus == dictGoOutAgree ||
                  form.approvalStatus == dictGoOutReturn ||
                  form.wecomSpNo !== null
              "
              :default-time="$store.state.user.user.sysRostering.workEndTime + ':00'"
              :disabled="form.approvalStatus == dictGoOutAgree || form.approvalStatus == dictGoOutReturn || form.wecomSpNo !== null"
              @change="checkTime"
            />
          </el-form-item>
@@ -467,7 +455,7 @@
          show-overflow-tooltip
        >
          <template slot-scope="scope">
            {{ crud.toDate(scope.row.travelStartTime) }}
            {{ scope.row.travelStartTime }}
          </template>
        </el-table-column>
        <el-table-column
@@ -477,7 +465,7 @@
          show-overflow-tooltip
        >
          <template slot-scope="scope">
            {{ crud.toDate(scope.row.travelEndTime) }}
            {{ scope.row.travelEndTime }}
          </template>
        </el-table-column>
        <el-table-column
eladmin-web-master/src/views/project/project/index.vue
@@ -109,6 +109,19 @@
        >
          其他成本
        </el-button>
        <el-button
          slot="right"
          v-permission="permission.report"
          :loading="generateReportParam.loading"
          class="filter-item"
          size="mini"
          type="primary"
          icon="el-icon-document"
          style="margin-left: 4px !important;"
          @click="doGenerateReport()"
        >
          报告生成
        </el-button>
      </crudOperation>
      <!--表单组件-->
      <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="690px">
@@ -419,13 +432,12 @@
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import { mapGetters } from 'vuex'
import moneyInput from '@/views/assembly/moneyInput/index.vue'
import constant from '@/utils/constant'
const defaultForm = { id: null, name: null, projectTypeId: null, projectDistinguish: null, companyId: null, requirement: null, unitCurrency: null, performanceObjectives: null, quotationPrice: null, performancePrice: null, contractPrice: null, contractPrePrice: null, projectPrice: null, liableUserId: null, liableUserIdList: [], planStartDate: null, planEndDate: null, projectStatus: null, approveStatus: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null }
export default {
  name: 'Project',
  components: { pagination, crudOperation, rrOperation, udOperation, moneyInput },
  components: { pagination, crudOperation, rrOperation, udOperation },
  mixins: [presenter(), header(), form(defaultForm), crud()],
  dicts: [constant.STANDARD_UNIT_CURRENCY, constant.PROJECT_DISTINGUISH, constant.PROJECT_STATUS, constant.APPROVE_STATUS],
  cruds() {
@@ -442,15 +454,15 @@
        callback()
      }
    }
    // 比例(百内)验证
    var proportionValidate = (rule, value, callback) => {
      const reg = /^([0-9]|[1-9]\d)(\.\d{1,2})?$|100$/
      if (value != null && value !== '' && !reg.test(value)) {
        callback(new Error('请输入 一百 以内的正整数或两位小数'))
      } else {
        callback()
      }
    }
    // // 比例(百内)验证
    // var proportionValidate = (rule, value, callback) => {
    //   const reg = /^([0-9]|[1-9]\d)(\.\d{1,2})?$|100$/
    //   if (value != null && value !== '' && !reg.test(value)) {
    //     callback(new Error('请输入 一百 以内的正整数或两位小数'))
    //   } else {
    //     callback()
    //   }
    // }
    return {
      permission: {
        add: ['admin', 'project:add'],
@@ -460,7 +472,8 @@
        admit: ['admin', 'project:admit'],
        seeTask: ['admin', 'project:seeTask'],
        seeCost: ['admin', 'project:seeCost'],
        master: ['admin', 'project:master']
        master: ['admin', 'project:master'],
        report: ['admin', 'project:report']
      },
      rules: {
        name: [
@@ -534,7 +547,11 @@
        }
      },
      // 表单禁用标记(承认状态)
      disabledFlagByApprove: false
      disabledFlagByApprove: false,
      // 报告生成参数
      generateReportParam: {
        loading: false
      }
    }
  },
  computed: {
@@ -772,6 +789,33 @@
          projectId: data.id
        }
      })
    },
    // 执行报告生成
    doGenerateReport() {
      const that = this
      let projectIds = []
      if (that.crud.selections.length > 0) {
        projectIds = that.crud.selections.map(p => p.id)
      }
      that.$confirm(
        projectIds.length > 0 ? '此操作会生成所有选中项目的报告, 是否继续?' : '您未选中项目,本次操作会生成所有未完成项目的报告, 是否继续?',
        '提示',
        {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }
      ).then(() => {
        that.generateReportParam.loading = true
        that.crud.crudMethod.generateReport({ idInList: projectIds }).then(() => {
          that.generateReportParam.loading = false
          that.$message({ type: 'success', message: '操作成功' })
        }).catch(() => {
          that.generateReportParam.loading = false
        })
      }).catch(() => {
        that.$message({ type: 'info', message: '已取消操作' })
      })
    }
  }
}
eladmin-web-master/src/views/task/taskDaliy/index.vue
@@ -153,6 +153,17 @@
        >
          统计
        </el-button>
        <el-button
          slot="right"
          class="filter-item"
          size="mini"
          type="primary"
          icon="el-icon-document"
          style="margin-left: 4px !important;"
          @click="toGenerateReport"
        >
          报告生成
        </el-button>
      </crudOperation>
      <!--表单组件-->
      <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
@@ -305,6 +316,50 @@
          </el-table-column>
        </el-table>
      </el-dialog>
      <!--报告生成表单组件-->
      <el-dialog :close-on-click-modal="false" :before-close="closeGenerateReport" :visible.sync="generateReportParam.visible" title="报告生成" width="580px">
        <el-form ref="reportForm" :model="generateReportParam.form" :rules="generateReportParam.rules" size="small" label-width="110px">
          <el-form-item label="考勤日期" prop="attendTime">
            <!-- <el-date-picker
              v-model="generateReportParam.form.attendTime"
              type="date"
              placeholder="选择日期"
              style="width: 370px;"
              value-format="yyyy-MM-dd"
              align="right"
            /> -->
            <el-date-picker
              v-model="generateReportParam.form.attendTime"
              type="daterange"
              clearable
              class="filter-item"
              value-format="yyyy-MM-dd"
              placeholder="请选择日期"
              range-separator=" ~ "
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              style="width: 370px;"
            />
          </el-form-item>
          <el-form-item label="所属员工" prop="userId">
            <el-select v-model="generateReportParam.form.userId" filterable clearable placeholder="请选择" style="width: 370px;">
              <el-option
                v-for="item in users"
                :key="item.id"
                :label="item.nickName"
                :value="item.id"
              />
            </el-select>
          </el-form-item>
          <div class="tips-content">*选择员工则生成选中员工的考勤报告,未选择员工则更新所有员工(暂为开发部所有员工)的考勤报告</div>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button type="text" @click="closeGenerateReport">取消</el-button>
          <el-button :loading="generateReportParam.loading" type="primary" @click="doGenerateReport">确认</el-button>
        </div>
      </el-dialog>
      <!--表格渲染-->
      <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
        <el-table-column type="selection" width="55" />
@@ -347,7 +402,7 @@
        <el-table-column prop="remarks" label="备注" min-width="140px" />
        <el-table-column v-if="checkPer(['admin','taskDaliy:add','taskDaliy:edit','taskDaliy:del'])" label="操作" width="180px" align="center" fixed="right">
          <template slot-scope="scope">
            <udOperation :data="scope.row" :permission="permission" >
            <udOperation :data="scope.row" :permission="permission">
              <el-button
                slot="left"
                v-permission="permission.add"
@@ -405,6 +460,7 @@
import crudTask from '@/api/task/task'
import crudTaskUser from '@/api/task/taskUser'
import crudAttendance from '@/api/attendance/attendance'
import crudUser from '@/api/system/user'
const defaultForm = { id: null, projectId: null, taskId: null, taskName: null, taskMongoId: null, taskUserMongo: {}, userId: null, fillDate: null, consumedHours: null, todayFixedHours: 0, todayAttendanceHours: 0, alreadyConsumedHours: 0, taskHours: 0, consumedWorkload: null, consumedWorkloadUnit: null, taskProgress: null, settlementStatus: constant.SETTLEMENT_STATUS_UNSETTLED, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null }
export default {
@@ -439,7 +495,8 @@
        add: ['admin', 'taskDaliy:add'],
        edit: ['admin', 'taskDaliy:edit'],
        del: ['admin', 'taskDaliy:del'],
        download: ['admin', 'taskDaliy:download']
        download: ['admin', 'taskDaliy:download'],
        report: ['admin', 'taskDaliy:report']
      },
      rules: {
        fillDate: [
@@ -539,7 +596,19 @@
      loadingQueryProjects: false,
      loadingQueryProjectsTwo: false,
      statisticsLoading: false,
      statisticsData: []
      statisticsData: [],
      // 报告生成参数
      generateReportParam: {
        loading: false,
        visible: false,
        form: {
          attendTime: [],
          userId: null
        },
        rules: {
          attendTime: [{ required: true, message: '考勤日期不能为空', trigger: 'change' }]
        }
      }
    }
  },
  computed: {
@@ -572,6 +641,12 @@
    'crud.status.edit': function() {
      this.editVar = this.form.consumedHours
    }
  },
  created() {
    const that = this
    crudUser.getAll().then(res => {
      that.users = res
    })
  },
  methods: {
    // 钩子:在获取表格数据之前执行,false 则代表不获取数据
@@ -761,7 +836,7 @@
          this.centerDialogVisibleTaskProgress = true
          if (this.confirmProgress) {
            // 如果确定了
            const result = this.form.alreadyConsumedHours
            // const result = this.form.alreadyConsumedHours
            // if (result > this.form.taskHours && !this.confirmHours) {
            //   this.centerDialogVisibleTaskHours = true
            //   if (this.confirmHours) {
@@ -979,7 +1054,7 @@
        // 判断是否为选中任务
        if (this.formTasks[i].id === this.form.taskId) {
          crudTask.getRelevantTaskUser({ 'taskId': this.form.taskId }).then(res => {
            if (res == []) {
            if (res === []) {
              this.formTaskUserIds = []
              return
            }
@@ -1054,6 +1129,41 @@
    submitDialogTaskProgress() {
      this.centerDialogVisibleTaskProgress = false
      this.confirmProgress = true
    },
    // 开启报告生成
    toGenerateReport() {
      const that = this
      that.generateReportParam.visible = true
    },
    // 执行报告生成
    doGenerateReport() {
      const that = this
      that.$refs.reportForm.validate((valid) => {
        if (!valid) {
          return
        }
        // 制作数据
        const data = {
          fillDates: that.generateReportParam.form.attendTime,
          userId: that.generateReportParam.form.userId
        }
        that.$set(that.generateReportParam, 'loading', true)
        // 生成报告
        that.crud.crudMethod.generateReport(data).then(() => {
          that.$message({ type: 'success', message: '操作成功' })
          that.closeGenerateReport()
        }).catch(() => {
          that.$set(that.generateReportParam, 'loading', false)
        })
      })
    },
    // 关闭报告生成
    closeGenerateReport() {
      const that = this
      that.$refs.reportForm.clearValidate()
      that.$set(that.generateReportParam, 'loading', false)
      that.$set(that.generateReportParam, 'visible', false)
      that.$set(that.generateReportParam, 'form', { attendTime: [], userId: null })
    }
  }
}
@@ -1063,4 +1173,10 @@
  adventTable tr:first-child {
    display: none;
  }
  .tips-content {
    font-size: 12px;
    text-align: center;
    color: red;
    padding: 0px 40px;
  }
</style>