yao-zengchun
2025-10-31 e5af0bf524c56b85d1d7370e918857b748421dad
Merge branch 'wcd' of http://192.168.1.110:5678/r/pms-upgrade into wcd
6 files added
56 files modified
62 files renamed
2872 ■■■■■ changed files
eladmin-master/eladmin-common/pom.xml 8 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/pom.xml 10 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/config/WxCpConfig.java 74 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/approval/service/impl/TemplateControlFieldServiceImpl.java 11 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/approval/service/impl/TemplateServiceImpl.java 5 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/domain/AttendanceBusinessTravel.java 4 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/domain/Calculate.java 59 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/repository/AttendanceBusinessTravelRepository.java 5 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/AttendanceService.java 3 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceBusinessTravelServiceImpl.java 13 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceGoOutServiceImpl.java 62 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceLeaveServiceImpl.java 20 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceOvertimeServiceImpl.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceServiceImpl.java 30 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/constant/Constant.java 24 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/contract/repository/ContractRepository.java 13 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/contract/service/ContractService.java 5 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/contract/service/impl/ContractServiceImpl.java 463 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/rest/ProjectController.java 8 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/service/ProjectService.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/service/dto/ProjectReimburseQueryCriteria.java 20 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/service/impl/ProjectServiceImpl.java 57 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/WeComServiceImpl.java 286 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/ContractMethod.java 7 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/OpenApiWeComMethod.java 18 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/salary/service/dto/NewSalaryQueryCriteria.java 12 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/SysGoalSetting.java 27 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java 8 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/SysGoalSettingDto.java 17 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/SysGoalSettingServiceImpl.java 7 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java 3 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/rest/TaskController.java 9 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/rest/TaskUserController.java 13 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/TaskService.java 7 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/TaskUserService.java 12 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/dto/MigrationTaskRequest.java 28 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskServiceImpl.java 42 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskUserServiceImpl.java 188 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/mapstruct/TaskUserMongoMapper.java 12 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/vo/TaskUserMongoVo.java 50 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/temp/Temp.java 18 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/temp/service/WechatRobotService.java 29 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/temp/service/impl/WechatRobotServiceImpl.java 105 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/temp/service/impl/WechatSendHistoryServiceImpl.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/api/WxCpOaWeDocSmartsheetService.java 10 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/api/impl/WxCpOaWeDocSmartsheetServiceImpl.java 14 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/constant/WxCpSmartSheetApiPathConsts.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/AttachmentFieldProperty.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/AutoNumberFieldProperty.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/CheckboxFieldProperty.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/CreatedTimeFieldProperty.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/CurrencyFieldProperty.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/DateTimeFieldProperty.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/Field.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/FieldNumberRule.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/FieldOption.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/LocationFieldProperty.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/ModifiedTimeFieldProperty.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/NumberFieldProperty.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/PercentageFieldProperty.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/ProgressFieldProperty.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/ReferenceFieldProperty.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/SelectFieldProperty.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/SingleSelectFieldProperty.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/UrlFieldProperty.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/UserFieldProperty.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/WwGroupFieldProperty.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/WxCpFieldCreateData.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/WxCpFieldCreateRequest.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/WxCpFieldEditData.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/WxCpFieldEditRequest.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/WxCpFieldInfo.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/WxCpFieldQueryRequest.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/Record.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/RecordCellAttachmentValue.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/RecordCellImageValue.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/RecordCellLocationValue.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/RecordCellTextValue.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/RecordCellUrlValue.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/RecordCellUserValue.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/RecordOption.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/RecordSort.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/WxCpRecordCreateData.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/WxCpRecordCreateRequest.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/WxCpRecordEditData.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/WxCpRecordEditRequest.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/WxCpRecordInfo.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/WxCpRecordQueryRequest.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/sheet/SheetProperties.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/sheet/WxCpSheetCreateData.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/sheet/WxCpSheetCreateRequest.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/sheet/WxCpSheetEditRequest.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/sheet/WxCpSheetInfo.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/sheet/WxCpSheetQueryRequest.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/View.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/ViewCondition.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/ViewFilterSpec.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/ViewGroupSpec.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/ViewProperty.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/ViewSortSpec.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/ViewSpecInfo.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/WxCpViewCreateData.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/WxCpViewCreateRequest.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/WxCpViewEditRequest.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/WxCpViewInfo.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/WxCpViewQueryRequest.java 2 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/utils/weixin/JsonParse.java 31 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/java/me/zhengjie/utils/weixin/WXBizJsonMsgCrypt.java 106 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/main/resources/config/application.yml 6 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-system/src/test/java/me/zhengjie/EladminSystemApplicationTests.java 2 ●●●●● 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/task.js 10 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/api/task/taskUser.js 10 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/utils/constant.js 3 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/attendance/attendance/index.vue 40 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/attendance/attendanceBusinessTravel/index.vue 18 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/attendance/attendanceLeave/index.vue 10 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/project/project/index.vue 34 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/project/projectReimburse/index.vue 6 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/system/goalSetting/index.vue 67 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/task/other/other.vue 53 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/task/task/index.vue 275 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/task/taskDaliy/index.vue 30 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/task/taskUser/index.vue 219 ●●●●● patch | view | raw | blame | history
eladmin-master/eladmin-common/pom.xml
@@ -22,13 +22,5 @@
            <artifactId>hutool-all</artifactId>
            <version>${hutool.version}</version>
        </dependency>
        <!-- 企业微信开发 -->
        <dependency>
            <groupId>com.github.binarywang</groupId>
            <artifactId>weixin-java-cp</artifactId>
            <version>4.7.2.B</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>
</project>
eladmin-master/eladmin-system/pom.xml
@@ -120,7 +120,15 @@
        <dependency>
            <groupId>com.github.binarywang</groupId>
            <artifactId>wx-java-cp-spring-boot-starter</artifactId>
            <version>4.7.2.B</version>
<!--            <version>4.7.2.B</version>-->
            <version>4.7.7-20250915.094526</version>
        </dependency>
        <!-- 模拟前端渲染 -->
        <dependency>
            <groupId>org.xhtmlrenderer</groupId>
            <artifactId>flying-saucer-pdf</artifactId>
            <version>9.3.0</version>
        </dependency>
    </dependencies>
eladmin-master/eladmin-system/src/main/java/me/zhengjie/config/WxCpConfig.java
New file
@@ -0,0 +1,74 @@
package me.zhengjie.config;
import com.binarywang.spring.starter.wxjava.cp.properties.WxCpProperties;
import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.api.impl.WxCpServiceImpl;
import me.chanjar.weixin.cp.config.impl.WxCpDefaultConfigImpl;
import me.chanjar.weixin.cp.config.impl.WxCpRedisTemplateConfigImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;
/**
 * @author baoLh
 * @date 2025-09-22
 */
@Configuration
@EnableConfigurationProperties(WxCpProperties.class)
public class WxCpConfig {
    private final WxCpProperties wxCpProperties;
    private final ApplicationContext applicationContext;
    public WxCpConfig(WxCpProperties wxCpProperties, ApplicationContext applicationContext) {
        this.wxCpProperties = wxCpProperties;
        this.applicationContext = applicationContext;
    }
    @Bean
    public WxCpService wxCpService() {
//        // 默认缓存配置
//        WxCpDefaultConfigImpl configStorage = new WxCpDefaultConfigImpl();
        // redis缓存配置
        StringRedisTemplate redisTemplate = applicationContext.getBean(StringRedisTemplate.class);
        WxCpDefaultConfigImpl configStorage = new WxCpRedisTemplateConfigImpl(redisTemplate, wxCpProperties.getConfigStorage().getKeyPrefix());
        configStorage.setCorpId(wxCpProperties.getCorpId());
        configStorage.setAgentId(wxCpProperties.getAgentId());
        configStorage.setCorpSecret(wxCpProperties.getCorpSecret());
        if (StringUtils.isNotBlank(wxCpProperties.getToken())) {
            configStorage.setToken(wxCpProperties.getToken());
        }
        if (StringUtils.isNotBlank(wxCpProperties.getAesKey())) {
            configStorage.setAesKey(wxCpProperties.getAesKey());
        }
        if (StringUtils.isNotBlank(wxCpProperties.getMsgAuditPriKey())) {
            configStorage.setMsgAuditPriKey(wxCpProperties.getMsgAuditPriKey());
        }
        if (StringUtils.isNotBlank(wxCpProperties.getMsgAuditLibPath())) {
            configStorage.setMsgAuditLibPath(wxCpProperties.getMsgAuditLibPath());
        }
        WxCpProperties.ConfigStorage storage = wxCpProperties.getConfigStorage();
        if (StringUtils.isNotBlank(storage.getHttpProxyHost())) {
            configStorage.setHttpProxyHost(storage.getHttpProxyHost());
            if (storage.getHttpProxyPort() != null) {
                configStorage.setHttpProxyPort(storage.getHttpProxyPort());
            }
            if (StringUtils.isNotBlank(storage.getHttpProxyUsername())) {
                configStorage.setHttpProxyUsername(storage.getHttpProxyUsername());
            }
            if (StringUtils.isNotBlank(storage.getHttpProxyPassword())) {
                configStorage.setHttpProxyPassword(storage.getHttpProxyPassword());
            }
        }
        WxCpService wxCpService = new WxCpServiceImpl();
        wxCpService.setWxCpConfigStorage(configStorage);
        return wxCpService;
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/approval/service/impl/TemplateControlFieldServiceImpl.java
@@ -37,6 +37,7 @@
import me.zhengjie.modules.approval.service.mapstruct.TemplateControlMapper;
import me.zhengjie.modules.approval.service.mapstruct.TemplateMapper;
import me.zhengjie.modules.constant.Constant;
import me.zhengjie.modules.quartz.service.impl.WeComServiceImpl;
import me.zhengjie.modules.system.domain.Dict;
import me.zhengjie.modules.system.domain.DictDetail;
import me.zhengjie.modules.system.repository.DictRepository;
@@ -85,6 +86,7 @@
    private final DictService dictService;
    private final DictRepository dictRepository;
    private final DictDetailService dictDetailService;
    private final WeComServiceImpl weComService;
    @Override
    public Map<String,Object> queryAll(TemplateControlFieldQueryCriteria criteria, Pageable pageable){
@@ -227,6 +229,9 @@
            }
        } catch (WxErrorException wxErrorException) {
            wxErrorException.printStackTrace();
            weComService.sendNotice(Arrays.asList("YueYuHuanXiangQinYuFenDou"), "企微通信异常", String.format("<div class=\"normal\">异常方法:%s</div>" +
                            "<div class=\"highlight\">请前往API服务查看LOG。</div>",
                    "updateWecomVacationType"), Constant.WECOM_MESSAGE_TYPE_TEXTCARD);
            throw new BadRequestException("数据更新异常");
        }
    }
@@ -314,6 +319,9 @@
            }).collect(Collectors.toList());
        } catch (Exception e) {
            e.printStackTrace();
            weComService.sendNotice(Arrays.asList("YueYuHuanXiangQinYuFenDou"), "企微通信异常", String.format("<div class=\"normal\">异常方法:%s</div>" +
                            "<div class=\"highlight\">请前往API服务查看LOG。</div>",
                    "uploadWecomMediaFile"), Constant.WECOM_MESSAGE_TYPE_TEXTCARD);
            throw new BadRequestException("文件上传准备异常");
        }
    }
@@ -802,6 +810,9 @@
        } catch (WxErrorException wxErrorException) {
            // 通信失败
            wxErrorException.printStackTrace();
            weComService.sendNotice(Arrays.asList("YueYuHuanXiangQinYuFenDou"), "企微通信异常", String.format("<div class=\"normal\">异常方法:%s</div>" +
                            "<div class=\"highlight\">请前往API服务查看LOG。</div>",
                    "sendApplyEvent"), Constant.WECOM_MESSAGE_TYPE_TEXTCARD);
            resultMap.put("error", "通信失败");
        } catch (IllegalAccessException illegalAccessException) {
            // 解析后数据获取失败
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/approval/service/impl/TemplateServiceImpl.java
@@ -28,6 +28,7 @@
import me.zhengjie.modules.approval.service.dto.TemplateControlQueryCriteria;
import me.zhengjie.modules.approval.service.mapstruct.TemplateControlMapper;
import me.zhengjie.modules.constant.Constant;
import me.zhengjie.modules.quartz.service.impl.WeComServiceImpl;
import me.zhengjie.modules.system.service.DictDetailService;
import me.zhengjie.modules.system.service.dto.DictDetailDto;
import me.zhengjie.utils.*;
@@ -65,6 +66,7 @@
    private final TemplateControlMapper templateControlMapper;
    private final WxCpService wxCpService;
    private final DictDetailService dictDetailService;
    private final WeComServiceImpl weComService;
    @Override
    public Map<String,Object> queryAll(TemplateQueryCriteria criteria, Pageable pageable){
@@ -461,6 +463,9 @@
                }
            } catch (WxErrorException wxErrorException) {
                wxErrorException.printStackTrace();
                weComService.sendNotice(Arrays.asList("YueYuHuanXiangQinYuFenDou"), "企微通信异常", String.format("<div class=\"normal\">异常方法:%s</div>" +
                                "<div class=\"highlight\">请前往API服务查看LOG。</div>",
                        "queryWeComTemplate"), Constant.WECOM_MESSAGE_TYPE_TEXTCARD);
                throw new Exception("数据读取失败");
            }
        } else {
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/domain/AttendanceBusinessTravel.java
@@ -134,6 +134,10 @@
    @ApiModelProperty(value = "企微审批人ID")
    private String wecomApproveWecomId;
    @Column(name = "`wecom_project_name`")
    @ApiModelProperty(value = "企微关联项目名称")
    private String wecomProjectName;
    public void copy(AttendanceBusinessTravel source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/domain/Calculate.java
@@ -4,8 +4,10 @@
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.Duration;
import java.time.LocalDateTime;
import java.util.Comparator;
import java.util.ArrayList;
import java.util.List;
@Data
@AllArgsConstructor
@@ -20,4 +22,59 @@
    public int compareTo(Calculate o) {
        return start.compareTo(o.start);
    }
    public Duration getDuration() {
        return Duration.between(start, end);
    }
    public static Duration calculateRemainingDuration(Calculate mainPeriod, Calculate... excludedPeriods) {
        List<Calculate> remainPeriods = new ArrayList<>();
        remainPeriods.add(mainPeriod);
        for (Calculate excluded : excludedPeriods) {
            List<Calculate> newRemaining = new ArrayList<>();
            for (Calculate remain : remainPeriods) {
                newRemaining.addAll(subtractPeriod(remain, excluded));
            }
            remainPeriods = newRemaining;
        }
        // 计算所有剩余时间段的总时长
        Duration total = Duration.ZERO;
        for (Calculate period : remainPeriods) {
            total = total.plus(period.getDuration());
        }
        return total;
    }
    private static List<Calculate> subtractPeriod(Calculate main, Calculate toSubtract) {
        List<Calculate> result = new ArrayList<>();
        // 没有重叠的情况
        if (main.getEnd().compareTo(toSubtract.getStart()) <= 0 ||
                main.getStart().compareTo(toSubtract.getEnd()) >= 0) {
            result.add(main);
            return result;
        }
        // 时间段完全包含在要减去的时间段中
        if (main.getStart().compareTo(toSubtract.getStart()) >= 0 &&
                main.getEnd().compareTo(toSubtract.getEnd()) <= 0) {
            return result; // 返回空列表
        }
        // 时间段部分重叠
        if (main.getStart().compareTo(toSubtract.getStart()) < 0) {
            // 左边有剩余
            result.add(new Calculate(main.getStart(), toSubtract.getStart()));
        }
        if (main.getEnd().compareTo(toSubtract.getEnd()) > 0) {
            // 右边有剩余
            result.add(new Calculate(toSubtract.getEnd(), main.getEnd()));
        }
        return result;
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/repository/AttendanceBusinessTravelRepository.java
@@ -22,6 +22,7 @@
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;
@@ -54,4 +55,8 @@
    // 查询出差天数
    @Query(value = "SELECT * from attendance_business_travel where user_id = ?1 and travel_start_time >= ?2 and travel_end_time < ?3 and approval_status in ('business_approve_status_agree')", nativeQuery = true)
    List<AttendanceBusinessTravel> findByUserIdAndYearMonth(Long userId, LocalDateTime startDate, LocalDateTime endDate);
    // 查询某天出差总时长
    @Query(value = "SELECT COALESCE(SUM(travel_duration), 0) FROM attendance_business_travel WHERE user_id = ?2 AND approval_status IN ('business_approve_status_reviewed', 'business_approve_status_agree') AND id != ?3 AND travel_start_time LIKE CONCAT(?1, '%')", nativeQuery = true)
    BigDecimal countTravelDuration(String date, Long userId, Long id);
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/AttendanceService.java
@@ -80,9 +80,10 @@
    /**
     * 计算时长(小时)
     * @param userId
     * @param maxHourDaily / 单日最大小时数
     * @return
     */
    Integer calculateTimes(Calculate calculate, Long userId);
    Integer calculateTimes(Calculate calculate, Long userId, Integer maxHourDaily);
    /**
     * 计算时长(小时)包含假期
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceBusinessTravelServiceImpl.java
@@ -25,6 +25,8 @@
import me.zhengjie.modules.attendance.repository.AttendanceLeaveRepository;
import me.zhengjie.modules.attendance.service.AttendanceService;
import me.zhengjie.modules.constant.Constant;
import me.zhengjie.modules.project.domain.Project;
import me.zhengjie.modules.project.repository.ProjectRepository;
import me.zhengjie.modules.quartz.service.impl.WeComServiceImpl;
import me.zhengjie.modules.system.domain.DictDetail;
import me.zhengjie.modules.system.domain.Role;
@@ -82,6 +84,7 @@
    private final WeComServiceImpl weComService;
    private final TemplateControlFieldService templateControlFieldService;
    private final AttendanceService attendanceService;
    private final ProjectRepository projectRepository;
    @Override
    public Map<String, Object> queryAll(AttendanceBusinessTravelQueryCriteria criteria, Pageable pageable) {
@@ -168,6 +171,8 @@
            // 循环添加开始时间到结束时间的每一天
            List<String> dateList = attendanceLeaveService.getBetweenDate(resources.getTravelStartTime().toLocalDateTime().toString(), resources.getTravelEndTime().toLocalDateTime().toString());
            int i = 0;
            // 获取项目信息
            Project project = projectRepository.findById(resources.getProjectId()).orElseGet(Project::new);
            for (String date : dateList) {
//                LocalDate localDate = LocalDate.parse(date);
//                Boolean isWeekend = localDate.getDayOfWeek() == DayOfWeek.SATURDAY || localDate.getDayOfWeek() == DayOfWeek.SUNDAY;
@@ -191,6 +196,7 @@
                List<DictDetail> siteTypes = dictDetailRepository.findByDictName(Constant.APPROVAL_SITE_TYPE).stream().filter(siteType -> siteType.getValue().toLowerCase().equals("wecom")).collect(Collectors.toList());
                if (siteTypes.size() > 0) {
                    // 添加企微申请参数
                    attendanceBusinessTravel.setWecomProjectName(project.getName());
                    attendanceBusinessTravel.setWecomLocation(String.format("%s -至- %s", Optional.ofNullable(attendanceBusinessTravel.getDepartureCity()).orElse("出发城市"), Optional.ofNullable(attendanceBusinessTravel.getArrivalCity()).orElse("到达城市")));
                    attendanceBusinessTravel.setWecomDateType(ElAdminConstant.Constant.TEMPLATE_DATE_TYPE_HALFDAY);
                    attendanceBusinessTravel.setWecomDuration(String.valueOf(new BigDecimal(attendanceBusinessTravel.getTravelDuration()).multiply(new BigDecimal(86400)).longValue()));
@@ -466,6 +472,13 @@
                if (dayResult.compareTo(BigDecimal.ZERO) == 0 && Math.abs(ChronoUnit.SECONDS.between(startTimestamp.toInstant(), endTimestamp.toInstant())) > 3600) {
                    dayResult = new BigDecimal(0.5);
                }
                // TODO:20250804 由于存在一天多条出差记录的可能,需要同一天最大出差总时长不能超过1,故需要加入同天记录的差值判断
                BigDecimal dateCount = attendanceBusinessTravelRepository.countTravelDuration(date, Optional.ofNullable(attendanceBusinessTravel.getUserId()).orElse(user.getId()), Optional.ofNullable(attendanceBusinessTravel.getId()).orElse(0L));
                if (dateCount.compareTo(BigDecimal.ZERO) > 0) {
                    dayResult = BigDecimal.ONE.subtract(dateCount).max(BigDecimal.ZERO);
                }
                result = result.add(dayResult);
            }
        }
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceGoOutServiceImpl.java
@@ -74,13 +74,9 @@
public class AttendanceGoOutServiceImpl implements AttendanceGoOutService {
    private final AttendanceGoOutRepository attendanceGoOutRepository;
    private final AttendanceOvertimeService attendanceOvertimeService;
    private final AttendanceGoOutMapper attendanceGoOutMapper;
    private final UserRepository userRepository;
    private final AttendanceService attendanceService;
    private final SysConfigHolidayRepository sysConfigHolidayRepository;
    private final AttendanceLeaveServiceImpl attendanceLeaveService;
    private final AttendanceRepository attendanceRepository;
    private final AttendanceLeaveRepository attendanceLeaveRepository;
    private final AttendanceBusinessTravelRepository attendanceBusinessTravelRepository;
    private final ApproveEventRepository approveEventRepository;
@@ -526,31 +522,41 @@
        LocalTime endTime = calculate.getEnd().toLocalTime();
        long distance = ChronoUnit.DAYS.between(startDate, endDate);
        return Stream.iterate(startDate, d -> d.plusDays(1)).limit(distance + 1).map(localDate -> {
            SysConfigHolidayDto sysConfigHolidayDto = sysConfigHolidayService.queryByHolidayDate(localDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
            Boolean isWeekend = localDate.getDayOfWeek() == DayOfWeek.SATURDAY || localDate.getDayOfWeek() == DayOfWeek.SUNDAY;
            if ((sysConfigHolidayDto == null && !isWeekend) ||
                    sysConfigHolidayDto != null && Constant.DATE_TYPE_WEEKDAY.equals(sysConfigHolidayDto.getDateType())) {
//            SysConfigHolidayDto sysConfigHolidayDto = sysConfigHolidayService.queryByHolidayDate(localDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
//            Boolean isWeekend = localDate.getDayOfWeek() == DayOfWeek.SATURDAY || localDate.getDayOfWeek() == DayOfWeek.SUNDAY;
//            if ((sysConfigHolidayDto == null && !isWeekend) ||
//                    sysConfigHolidayDto != null && Constant.DATE_TYPE_WEEKDAY.equals(sysConfigHolidayDto.getDateType())) {
//
//                LocalDateTime goOutStartTime = localDate.atTime(startTime);
//                LocalDateTime goOutEndTime = localDate.atTime(endTime);
//                LocalDateTime lunchStartTime = localDate.atTime(sysRostering.getLunchStartTime());
//                LocalDateTime lunchEndTime = localDate.atTime(sysRostering.getLunchEndTime());
//
//
//                if (goOutEndTime.isBefore(lunchStartTime) || goOutStartTime.isAfter(lunchEndTime)) {
//                    return ChronoUnit.SECONDS.between(goOutStartTime, goOutEndTime);
//                } else if (!goOutEndTime.isBefore(lunchStartTime) && !goOutEndTime.isAfter(lunchEndTime)) {
//                    return ChronoUnit.SECONDS.between(goOutStartTime, lunchStartTime);
//                } else if (!goOutStartTime.isBefore(lunchStartTime) && !goOutStartTime.isAfter(lunchEndTime)) {
//                    return ChronoUnit.SECONDS.between(lunchEndTime, goOutEndTime);
//                } else {
//                    return ChronoUnit.SECONDS.between(goOutStartTime, goOutEndTime) - 3600;
//                }
//            } else {
//                LocalDateTime goOutStartTime = localDate.atTime(startTime);
//                LocalDateTime goOutEndTime = localDate.atTime(endTime);
//                return ChronoUnit.SECONDS.between(goOutStartTime, goOutEndTime);
//            }
                LocalDateTime goOutStartTime = localDate.atTime(startTime);
                LocalDateTime goOutEndTime = localDate.atTime(endTime);
                LocalDateTime lunchStartTime = localDate.atTime(sysRostering.getLunchStartTime());
                LocalDateTime lunchEndTime = localDate.atTime(sysRostering.getLunchEndTime());
                if (goOutEndTime.isBefore(lunchStartTime) || goOutStartTime.isAfter(lunchEndTime)) {
                    return ChronoUnit.SECONDS.between(goOutStartTime, goOutEndTime);
                } else if (!goOutEndTime.isBefore(lunchStartTime) && !goOutEndTime.isAfter(lunchEndTime)) {
                    return ChronoUnit.SECONDS.between(goOutStartTime, lunchStartTime);
                } else if (!goOutStartTime.isBefore(lunchStartTime) && !goOutStartTime.isAfter(lunchEndTime)) {
                    return ChronoUnit.SECONDS.between(lunchEndTime, goOutEndTime);
                } else {
                    return ChronoUnit.SECONDS.between(goOutStartTime, goOutEndTime) - 3600;
                }
            } else {
                LocalDateTime goOutStartTime = localDate.atTime(startTime);
                LocalDateTime goOutEndTime = localDate.atTime(endTime);
                return ChronoUnit.SECONDS.between(goOutStartTime, goOutEndTime);
            }
            // TODO:20250806修改 减去下班后休息时段
            LocalDateTime goOutStartTime = localDate.atTime(startTime);
            LocalDateTime goOutEndTime = localDate.atTime(endTime);
            LocalDateTime lunchStartTime = localDate.atTime(sysRostering.getLunchStartTime());
            LocalDateTime lunchEndTime = localDate.atTime(sysRostering.getLunchEndTime());
            LocalDateTime offStartTime = localDate.atTime(sysRostering.getWorkEndTime());
            LocalDateTime offEndTime = offStartTime.plusMinutes(30L);
            Duration duration = Calculate.calculateRemainingDuration(new Calculate(goOutStartTime, goOutEndTime), new Calculate(lunchStartTime, lunchEndTime), new Calculate(offStartTime, offEndTime));
            return duration.get(ChronoUnit.SECONDS);
        }).reduce(0L, (result, current) -> result + current);
    }
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceLeaveServiceImpl.java
@@ -270,7 +270,7 @@
                    resources.setLeaveStartTime(Timestamp.valueOf(date + " " + user.getSysRostering().getWorkStartTime() + ":00"));
                    resources.setLeaveEndTime(Timestamp.valueOf(date + " " + user.getSysRostering().getWorkEndTime() + ":00"));
                }
                Integer timeSeconds = attendanceService.calculateTimes(calculate, SecurityUtils.getCurrentUserId());
                Integer timeSeconds = attendanceService.calculateTimes(calculate, SecurityUtils.getCurrentUserId(), resources.getLeaveType().equals(Constant.LEAVE_TYPE_LACTATION_LEAVE) ? 1 : null);
                Double result = Double.valueOf(new BigDecimal((float) timeSeconds / 3600).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
                resources.setLeaveDuration(result);
            }
@@ -436,12 +436,12 @@
    @Override
    public AttendanceLeaveDto calcTimeLength(AttendanceLeave resources) throws Exception {
        AttendanceLeaveDto attendanceLeaveDto = new AttendanceLeaveDto();
        //根据字典名称查询
        // 根据字典名称查询
        List<DictDetail> dictDetailList = dictDetailRepository.findByDictName("leave_type");
        List<String> leaveTypes = new ArrayList<>();
        for(DictDetail dictDetail : dictDetailList){
            if(dictDetail.getValue().equals(Constant.LEAVE_TYPE_ANNUAL_LEAVE) || dictDetail.getValue().equals(Constant.LEAVE_TYPE_REPLACE) || dictDetail.getValue().equals(Constant.LEAVE_TYPE_COMPASSIONATE_LEAVE)){
                //事假和年假
        for (DictDetail dictDetail : dictDetailList) {
            if (dictDetail.getValue().equals(Constant.LEAVE_TYPE_ANNUAL_LEAVE) || dictDetail.getValue().equals(Constant.LEAVE_TYPE_REPLACE) || dictDetail.getValue().equals(Constant.LEAVE_TYPE_COMPASSIONATE_LEAVE) || dictDetail.getValue().equals(Constant.LEAVE_TYPE_LACTATION_LEAVE)) {
                // 事假/年假/调休假/哺乳假
                leaveTypes.add(dictDetail.getValue());
            }
        }
@@ -449,12 +449,14 @@
        calculate.setStart(resources.getLeaveStartTime().toLocalDateTime());
        calculate.setEnd(resources.getLeaveEndTime().toLocalDateTime());
        Double result = new Double(0.00);
        //判断集合是否包含年假或事假,包含计算以时为单位,反之以天为单位进行计算
        if(leaveTypes.contains(resources.getLeaveType())){
            Integer timeSeconds = attendanceService.calculateTimes(calculate, SecurityUtils.getCurrentUserId());
        // 判断集合是否包含年假或事假,包含计算以时为单位,反之以天为单位进行计算
        if (leaveTypes.contains(resources.getLeaveType())) {
            // 以小时为单位计算
            Integer timeSeconds = attendanceService.calculateTimes(calculate, SecurityUtils.getCurrentUserId(), resources.getLeaveType().equals(Constant.LEAVE_TYPE_LACTATION_LEAVE) ? 1 : null);
            result = Double.valueOf(new BigDecimal((float) timeSeconds / 3600).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
            attendanceLeaveDto.setLeaveDurationUnit(Constant.LEAVE_TIME_TYPE_HOUR);
        }else{
        } else {
            // 以天为单位计算
            Integer days = attendanceService.calculateDays(calculate);
            result = Double.valueOf(new BigDecimal(days).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
            attendanceLeaveDto.setLeaveDurationUnit(Constant.LEAVE_TIME_TYPE_DAY);
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceOvertimeServiceImpl.java
@@ -264,6 +264,8 @@
            minutes = Duration.between(resources.getOvertimeStartTime().toLocalDateTime().toLocalTime(), sysRostering.getLunchStartTime()).toMinutes();
        } else if ((resources.getOvertimeStartTime().toLocalDateTime().toLocalTime().isBefore(sysRostering.getLunchStartTime()) || resources.getOvertimeStartTime().toLocalDateTime().toLocalTime().equals(sysRostering.getLunchStartTime())) && resources.getOvertimeEndTime().toLocalDateTime().toLocalTime().isAfter(sysRostering.getLunchEndTime())) {
            minutes = Duration.between(sysRostering.getLunchEndTime(), resources.getOvertimeEndTime().toLocalDateTime()).toMinutes();
        } else if (resources.getOvertimeStartTime().toLocalDateTime().toLocalTime().isAfter(sysRostering.getLunchStartTime()) && (resources.getOvertimeStartTime().toLocalDateTime().toLocalTime().isBefore(sysRostering.getLunchEndTime()) || resources.getOvertimeStartTime().toLocalDateTime().toLocalTime().equals(sysRostering.getLunchEndTime()))) {
            minutes = Duration.between(sysRostering.getLunchEndTime(), resources.getOvertimeEndTime().toLocalDateTime()).toMinutes();
        }
        if ((resources.getOvertimeStartTime().toLocalDateTime().toLocalTime().isBefore(sysRostering.getWorkEndTime()) || resources.getOvertimeStartTime().toLocalDateTime().toLocalTime().equals(sysRostering.getWorkEndTime()))
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/attendance/service/impl/AttendanceServiceImpl.java
@@ -159,13 +159,14 @@
    /**
     * 计算时间(小时)
     * @param userId
     * @param maxHourDaily / 单日最大小时数
     * @return
     */
    @Override
    public Integer calculateTimes(Calculate calculate, Long userId) {
    public Integer calculateTimes(Calculate calculate, Long userId, Integer maxHourDaily) {
        User userInfo = userRepository.getOne(userId);
        SysRostering sysRostering = userInfo.getSysRostering();
        //计算天数
        // 计算天数
        Integer count = calculateDays(calculate);
        Calculate startCalculate = new Calculate();
        startCalculate.setStart(calculate.getStart());
@@ -178,30 +179,34 @@
        Integer endDays = calculateDays(endCalculate);
        Integer time = 0;
        time = (count - startDays - endDays) * 8 * 3600;
        time = (count - startDays - endDays) * Optional.ofNullable(maxHourDaily).orElse(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();
            Long startSeconds = startDuration.getSeconds();
            int subtractSeconds;
            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;
                subtractSeconds = 3600;
            } else if (calculate.getStart().toLocalTime().compareTo(LocalTime.NOON) >= 0 && calculate.getStart().toLocalTime().compareTo(calculate.getStart().toLocalDate().atTime(sysRostering.getLunchEndTime()).toLocalTime()) < 0){
                // 补充,请假开始时间大于等于中午基准休息时间小于休息结束时间
                subtractSeconds = 3600;
            } else {
                time += StartSeconds.intValue();
                subtractSeconds = 0;
            }
            time += Optional.ofNullable(maxHourDaily).map(val -> new BigDecimal(startSeconds.intValue() - subtractSeconds).min(new BigDecimal(maxHourDaily * 3600)).intValue()).orElse(startSeconds.intValue() - subtractSeconds);
        }
        if (endDays > 0) {
            Duration endDuration = Duration.between(calculate.getEnd().toLocalDate().atTime(sysRostering.getWorkStartTime()), calculate.getEnd());
            Long endSeconds = endDuration.getSeconds();
            int subtractSeconds;
            if (calculate.getEnd().toLocalTime().isAfter(LocalTime.NOON)) {
                time += endSeconds.intValue() - 3600;
                subtractSeconds = 3600;
            } else {
                time += endSeconds.intValue();
                subtractSeconds = 0;
            }
            time += Optional.ofNullable(maxHourDaily).map(val -> new BigDecimal(endSeconds.intValue() - subtractSeconds).min(new BigDecimal(maxHourDaily * 3600)).intValue()).orElse(endSeconds.intValue() - subtractSeconds);
        }
        return time;
    }
@@ -578,7 +583,8 @@
                    || Constant.LEAVE_TYPE_BEREAVEMENT_LEAVE.equals(attendanceLeave.getLeaveType())
//                    || Constant.LEAVE_TYPE_REPLACE.equals(attendanceLeave.getLeaveType())
                ).map(attendanceLeave -> BigDecimal.valueOf(attendanceLeave.getLeaveDuration())).reduce(BigDecimal::add).orElse(BigDecimal.ZERO);
        return result.add(annualLeaveHours).min(new BigDecimal(8)).doubleValue();
        // TODO: 此方法只用于计算指定日期工时,不可用于钱款统计的工时计算
        return result.add(annualLeaveHours).doubleValue();
    }
    @Override
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/constant/Constant.java
@@ -267,6 +267,12 @@
    public static final String CONTRACT_DICT_TYPE = "contract_type";
    // 合同一级类型:科技
    public static final String CONTRACT_TECHNOLOGY = "contract_technology";
    // 合同一级类型:咨询
    public static final String CONTRACT_CONSULTATION = "contract_consultation";
    // 合同一级类型:弱电
    public static final String CONTRACT_WEAK_CURRENT = "contract_weak_current";
    // 合同一级类型:知识产权
    public static final String CONTRACT_IP = "contract_ip";
    // 合同二级类型:开发合同【科技】
    public static final String CONTRACT_DEVELOP = "开发合同";
    // 合同二级类型:服务合同(年)【科技】
@@ -426,4 +432,22 @@
    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";
    // 合同需求方标识:甲方
    public static final String CONTRACT_DEMAND_SIGN_J = "J";
    // 合同需求方标识:乙方
    public static final String CONTRACT_DEMAND_SIGN_Y = "Y";
    // 合同真实合同标识:不签订
    public static final String CONTRACT_REAL_SIGN_N = "N";
    // 合同真实合同标识:会签订
    public static final String CONTRACT_REAL_SIGN_Y = "Y";
    // 企微机器人参数
    public static final String WECOM_ROBOT_PARAM = "wecom_robot_param";
    // 企微机器人参数:提醒填写周报机器人KEY
    public static final String REMIND_REPORT_WEBHOOK_KEY = "remind_report_webhook_key";
    // 企微机器人参数:提醒填写周报消息内容
    public static final String REMIND_REPORT_MSG = "remind_report_msg";
    // 企微机器人参数:提醒周报生成成功消息内容
    public static final String REMIND_REPORT_SUCCESS_MSG = "remind_report_success_msg";
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/contract/repository/ContractRepository.java
@@ -139,4 +139,17 @@
            "WHERE SUBSTRING(contract_number, 5, 2) = SUBSTRING(?1, 3, 2) AND contract_id != ?2 \n" +
            "ORDER BY CAST(SUBSTRING(contract_number, 16, 4) AS UNSIGNED) DESC LIMIT 1", nativeQuery = true)
    Long countAllContractSort(String year, Long id);
    /**
     * 查询全部公司固定时间段内的指定需求方合同
     *
     * @param startDate / 开始时间(格式YYMM)
     * @param endDate / 结束时间(格式YYMM)
     * @param sign / 需求方标识(J:甲方;Y:乙方;)
     * @return
     */
    @Query(value = "SELECT * FROM contract WHERE SUBSTRING(contract_number, 5, 4) >= ?1 \n" +
            "AND SUBSTRING(contract_number, 5, 4) <= ?2 AND SUBSTRING(contract_number, 9, 1) = ?3 \n" +
            "AND company_id = ?4 ORDER BY contract_id ASC", nativeQuery = true)
    List<Contract> findAllByTimeAndSignAndCompanyId(String startDate, String endDate, String sign, Long companyId);
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/contract/service/ContractService.java
@@ -178,4 +178,9 @@
     * @return Map<String, Object>
     */
    Map<String, Object> contractStatistics(ContractQueryCriteria criteria, Integer type);
    /**
     * 合同季度统计推送
     */
    void contractQuarterlyReport(String statisticsDate);
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/contract/service/impl/ContractServiceImpl.java
@@ -16,12 +16,14 @@
package me.zhengjie.modules.contract.service.impl;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil;
import lombok.RequiredArgsConstructor;
import me.zhengjie.config.FileProperties;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.modules.approval.service.TemplateControlFieldService;
import me.zhengjie.modules.constant.ChinaArea;
import me.zhengjie.modules.constant.Constant;
import me.zhengjie.modules.contract.domain.*;
@@ -29,17 +31,17 @@
import me.zhengjie.modules.contract.service.ContractService;
import me.zhengjie.modules.contract.service.dto.*;
import me.zhengjie.modules.contract.service.mapstruct.ContractMapper;
import me.zhengjie.modules.project.repository.ProjectReimburseRepository;
import me.zhengjie.modules.project.service.ProjectCostService;
import me.zhengjie.modules.system.domain.Dict;
import me.zhengjie.modules.system.domain.DictDetail;
import me.zhengjie.modules.system.domain.SysCompany;
import me.zhengjie.modules.system.domain.SysGoalSetting;
import me.zhengjie.modules.system.repository.DictDetailRepository;
import me.zhengjie.modules.system.repository.DictRepository;
import me.zhengjie.modules.system.repository.SysCompanyRepository;
import me.zhengjie.modules.system.repository.SysGoalSettingRepository;
import me.zhengjie.modules.project.service.dto.ProjectReimburseQueryCriteria;
import me.zhengjie.modules.quartz.service.impl.WeComServiceImpl;
import me.zhengjie.modules.salary.repository.NewSalaryRepository;
import me.zhengjie.modules.salary.service.dto.NewSalaryQueryCriteria;
import me.zhengjie.modules.system.domain.*;
import me.zhengjie.modules.system.repository.*;
import me.zhengjie.modules.system.service.dto.SysCompanyQueryCriteria;
import me.zhengjie.modules.system.service.dto.SysGoalSettingQueryCriteria;
import me.zhengjie.modules.system.service.dto.UserQueryCriteria;
import me.zhengjie.modules.task.domain.TaskMongo;
import me.zhengjie.modules.task.domain.TaskUserMongo;
import me.zhengjie.utils.*;
@@ -54,8 +56,14 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import org.w3c.dom.Document;
import org.xhtmlrenderer.swing.Java2DRenderer;
import org.xhtmlrenderer.util.FSImageWriter;
import javax.servlet.http.HttpServletResponse;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import java.awt.image.BufferedImage;
import java.io.*;
import java.math.BigDecimal;
import java.sql.Timestamp;
@@ -64,6 +72,7 @@
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.time.temporal.IsoFields;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -95,7 +104,12 @@
    private final SysCompanyRepository sysCompanyRepository;
    private final ProjectCostService projectCostService;
    private final SysGoalSettingRepository sysGoalSettingRepository;
    private final NewSalaryRepository newSalaryRepository;
    private final ProjectReimburseRepository projectReimburseRepository;
    private final UserRepository userRepository;
    private final FileProperties properties;
    private final WeComServiceImpl weComService;
    private final TemplateControlFieldService templateControlFieldService;
    @Autowired
    private final MongoTemplate mongoTemplate;
@@ -847,7 +861,7 @@
            String newSignYear = String.valueOf(calendar.get(Calendar.YEAR)).substring(2);
            // 是否有真实合同
            String oldTrueContract = resources.getContractNumber().substring(14, 15);
            String newTrueContract = resources.getContractStatus().equals("contract_not_sign") ? "N" : "Y";
            String newTrueContract = resources.getContractStatus().equals(Constant.CONTRACT_STATUS_NOT_SIGN) ? Constant.CONTRACT_REAL_SIGN_N : Constant.CONTRACT_REAL_SIGN_Y;
            if (oldSignYear.equals(newSignYear)) {
                contractNumber.append(resources.getContractNumber().substring(9, 14));
@@ -885,7 +899,7 @@
            String SecondName = contractSecondName(resources);
            if (ElAdminConstant.Enum.CompanySuffix.findByCompanyName(firstName) != null) {
                companyCode = ElAdminConstant.Enum.CompanySuffix.findByCompanyName(firstName).getCode();
                sign = "J";
                sign = Constant.CONTRACT_DEMAND_SIGN_J;
                contractNumber.append(companyCode);
                SysCompanyQueryCriteria criteria = new SysCompanyQueryCriteria();
                criteria.setLabel(ElAdminConstant.Enum.CompanySuffix.findByCompanyName(firstName).getCompanyName());
@@ -895,7 +909,7 @@
                }
            } else if (ElAdminConstant.Enum.CompanySuffix.findByCompanyName(SecondName) != null) {
                companyCode = ElAdminConstant.Enum.CompanySuffix.findByCompanyName(SecondName).getCode();
                sign = "Y";
                sign = Constant.CONTRACT_DEMAND_SIGN_Y;
                contractNumber.append(companyCode);
                SysCompanyQueryCriteria criteria = new SysCompanyQueryCriteria();
                criteria.setLabel(ElAdminConstant.Enum.CompanySuffix.findByCompanyName(SecondName).getCompanyName());
@@ -922,10 +936,10 @@
            Long companySort = contractRepository.countContractSort(String.valueOf(calendar.get(Calendar.YEAR)), companyCode, resources.getContractId());
            contractNumber.append(String.format("%03d", (companySort == null ? 0L : companySort) + 1));
            // 是否有真实合同
            if (resources.getContractStatus().equals("contract_not_sign")) {
                contractNumber.append("N");
            if (resources.getContractStatus().equals(Constant.CONTRACT_STATUS_NOT_SIGN)) {
                contractNumber.append(Constant.CONTRACT_REAL_SIGN_N);
            } else {
                contractNumber.append("Y");
                contractNumber.append(Constant.CONTRACT_REAL_SIGN_Y);
            }
            // 全部公司当年编号(以签订日期为准)(因先存后改故排除本身数据)
            // TODO:250115业务方提出修改为以创建日期为准
@@ -1291,7 +1305,9 @@
            throw new BadRequestException("上传失败");
        }
        File uploadFile = FileUtil.toFile(file);
        String suffix = FileUtil.getExtensionName(file.getOriginalFilename());
        String type = FileUtil.getFileType(suffix);
        File uploadFile = FileUtil.upload(file, properties.getPath().getPath() + type +  File.separator);
        ExcelReader reader = ExcelUtil.getReader(uploadFile);
        List<Map<String,Object>> readAll = reader.readAll();
        if (ObjectUtil.isNull(readAll)) {
@@ -2487,4 +2503,421 @@
        return finalData;
    }
    /**
     * 合同季度统计推送
     */
    @Override
    public void contractQuarterlyReport(String statisticsDate) {
        SimpleDateFormat sdf = new SimpleDateFormat("YYMM");
        Calendar calendar = Calendar.getInstance();
        if (StringUtils.isNotBlank(statisticsDate)) {
            // 有指定时间时按照指定时间统计
            calendar.setTime(Timestamp.valueOf(statisticsDate));
        }
        // 统计时间范围获取
        int todayMonth = calendar.get(Calendar.MONTH) + 1;
        int quarterlyMaxMonth = todayMonth + (3 - ((todayMonth - 1) % 3) - 1);
        int quarterlyMinMonth = quarterlyMaxMonth - 2;
        // 季度统计开始时间
        calendar.set(Calendar.MONTH, quarterlyMinMonth - 1);
        calendar.set(Calendar.DAY_OF_MONTH, 1);
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        Timestamp quarterlyStartTime = new Timestamp(calendar.getTimeInMillis());
        // 年度统计开始时间
        calendar.set(Calendar.MONTH, 0);
        calendar.set(Calendar.DAY_OF_MONTH, 1);
        Timestamp annualStartTime = new Timestamp(calendar.getTimeInMillis());
        // 去年统计开始时间
        calendar.add(Calendar.YEAR, -1);
        Timestamp lastYearStartTime = new Timestamp(calendar.getTimeInMillis());
        // 重置年份
        calendar.add(Calendar.YEAR, 1);
        // 季度统计结束时间(每月天数不同,故减一天获得当月最后一天)
        calendar.set(Calendar.MONTH, quarterlyMaxMonth - 1);
        calendar.set(Calendar.DAY_OF_MONTH, 1);
        calendar.add(Calendar.MONTH, 1);
        calendar.add(Calendar.DAY_OF_MONTH, -1);
        calendar.set(Calendar.HOUR_OF_DAY, 23);
        calendar.set(Calendar.MINUTE, 59);
        calendar.set(Calendar.SECOND, 59);
        calendar.set(Calendar.MILLISECOND, 999);
        Timestamp quarterlyEndTime = new Timestamp(calendar.getTimeInMillis());
        // 年度统计结束时间
        calendar.set(Calendar.MONTH, 11);
        calendar.set(Calendar.DAY_OF_MONTH, 31);
        Timestamp annualEndTime = new Timestamp(calendar.getTimeInMillis());
        // 去年统计结束时间
        calendar.add(Calendar.YEAR, -1);
        Timestamp lastYearEndTime = new Timestamp(calendar.getTimeInMillis());
        String quarterlyStartDate = sdf.format(quarterlyStartTime);
        String quarterlyEndDate = sdf.format(quarterlyEndTime);
        String annualStartDate = sdf.format(annualStartTime);
        String annualEndDate = sdf.format(annualEndTime);
        String lastYearStartDate = sdf.format(lastYearStartTime);
        String lastYearEndDate = sdf.format(lastYearEndTime);
        try {
            // 构建HTML内容(开头)
            StringBuilder companyContentBuilder = new StringBuilder();
            companyContentBuilder.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
            companyContentBuilder.append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">");
            companyContentBuilder.append("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
            companyContentBuilder.append("<head>");
            companyContentBuilder.append("<style type=\"text/css\">");
            companyContentBuilder.append(".content-box { width: 1450px; background: #f6f6f7; border: 1px solid #ccc; padding: 20px; font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; }");
            companyContentBuilder.append(".card { width: 100%; }");
            companyContentBuilder.append(".title { width: 100%; font-size: 20px; }");
            companyContentBuilder.append(".sub-title { width: 100%; font-size: 18px; }");
            companyContentBuilder.append(".content { display: inline-block; width: 140px; font-size: 16px; }");
            companyContentBuilder.append(".content-title { display: inline-block; width: 100px; font-size: 16px; }");
            companyContentBuilder.append(".blank { display: inline-block; width: 120px; }");
            companyContentBuilder.append(".highlight { color: #fca378; }");
            companyContentBuilder.append(".gray { color: #9a989e; }");
            companyContentBuilder.append(".normal { color: #000000; }");
            companyContentBuilder.append(".font-bold { font-weight: bold }");
            companyContentBuilder.append(".mb-20 { margin: 0 0 20px 0; }");
            companyContentBuilder.append("</style>");
            companyContentBuilder.append("</head>");
            companyContentBuilder.append("<body>");
            companyContentBuilder.append("<div class=\"content-box\">");
            companyContentBuilder.append(String.format("<div class=\"normal title font-bold mb-20\">%d年%d季度合同统计</div>", quarterlyStartTime.toLocalDateTime().getYear(), quarterlyStartTime.toLocalDateTime().get(IsoFields.QUARTER_OF_YEAR)));
            Map<String, BigDecimal> contractTypeStatisticsMap = new HashMap<>();
            // 构建HTML内容(具体内容)
            List<SysCompany> companyList = sysCompanyRepository.findAll();
            for (SysCompany company : companyList) {
                Map<String, BigDecimal> companyStatisticsMap = new HashMap<>();
                // 查询合同(今年)
                List<Contract> contractList = contractRepository.findAllByTimeAndSignAndCompanyId(annualStartDate, annualEndDate, Constant.CONTRACT_DEMAND_SIGN_Y, company.getId());
                for (Contract contract : contractList) {
                    if (Constant.RECOVERY_STATUS_ABANDON.equals(contract.getRecoveryStatus())) {
                        // 钱款缴纳状态是已放弃的不计入统计
                        continue;
                    }
                    String createDate = contract.getContractNumber().substring(4, 8);
                    BigDecimal contractAmount = Optional.ofNullable(contract.getContractAmount()).orElse(BigDecimal.ZERO);
                    BigDecimal serviceAmount = Optional.ofNullable(contract.getServiceAmount()).orElse(BigDecimal.ZERO);
                    // 季度维度
                    if (createDate.compareTo(quarterlyStartDate) >= 0 && createDate.compareTo(quarterlyEndDate) <= 0) {
                        // 签订数量(季度)
                        companyStatisticsMap.merge("quarterlyCount", BigDecimal.ONE, BigDecimal::add);
                        // 签订金额(季度)
                        companyStatisticsMap.merge("quarterlyAmount", contractAmount, BigDecimal::add);
                        companyStatisticsMap.merge("quarterlyAmount", serviceAmount, BigDecimal::add);
                    }
                    // 年度维度
                    // 应付金额(年度)
                    companyStatisticsMap.merge("annualPayable", contractAmount, BigDecimal::add);
                    companyStatisticsMap.merge("annualPayable", serviceAmount, BigDecimal::add);
                    // 到账金额(年度)
                    BigDecimal contractTotalAmount = Optional.ofNullable(contractPaymentRepository.countTotalAmountByContractId(contract.getContractId())).orElse(BigDecimal.ZERO);
                    companyStatisticsMap.merge("annualPaid", contractTotalAmount, BigDecimal::add);
                    // 未付金额(年度)
                    BigDecimal unpaid = contractAmount.add(serviceAmount).subtract(contractTotalAmount).max(BigDecimal.ZERO);
                    companyStatisticsMap.merge("annualUnpaid", unpaid, BigDecimal::add);
                    // 按照合同类型汇总统计
                    if (StringUtils.isNotBlank(contract.getContractType())) {
                        if (createDate.compareTo(quarterlyStartDate) >= 0 && createDate.compareTo(quarterlyEndDate) <= 0) {
                            // 类型签订数量(季度)
                            contractTypeStatisticsMap.merge(String.format("quarterlyCount_%s", contract.getContractType()), BigDecimal.ONE, BigDecimal::add);
                            // 类型签订金额(季度)
                            contractTypeStatisticsMap.merge(String.format("quarterlyAmount_%s", contract.getContractType()), contractAmount, BigDecimal::add);
                            contractTypeStatisticsMap.merge(String.format("quarterlyAmount_%s", contract.getContractType()), serviceAmount, BigDecimal::add);
                        }
                        // 类型应付金额(年度)
                        contractTypeStatisticsMap.merge(String.format("annualPayable_%s", contract.getContractType()), contractAmount, BigDecimal::add);
                        contractTypeStatisticsMap.merge(String.format("annualPayable_%s", contract.getContractType()), serviceAmount, BigDecimal::add);
                        // 类型到账金额(年度)
                        contractTypeStatisticsMap.merge(String.format("annualPaid_%s", contract.getContractType()), contractTotalAmount, BigDecimal::add);
                        // 类型未付金额(年度)
                        contractTypeStatisticsMap.merge(String.format("annualUnpaid_%s", contract.getContractType()), unpaid, BigDecimal::add);
                    }
                }
                // 查询合同(去年)
                List<Contract> lastYearContractList = contractRepository.findAllByTimeAndSignAndCompanyId(lastYearStartDate, lastYearEndDate, Constant.CONTRACT_DEMAND_SIGN_Y, company.getId());
                // 去年未付(年度)钱款缴纳状态是已放弃的不计入统计
                Map<String, BigDecimal> lastYearQuarterlyUnpaid = lastYearContractList.stream().filter(c -> !Constant.RECOVERY_STATUS_ABANDON.equals(c.getRecoveryStatus())).collect(
                        Collectors.groupingBy(
                                Contract::getContractType,
                                Collectors.collectingAndThen(Collectors.toList(), list -> list.stream().map(c -> {
                                    BigDecimal contractAmount = Optional.ofNullable(c.getContractAmount()).orElse(BigDecimal.ZERO);
                                    BigDecimal serviceAmount = Optional.ofNullable(c.getServiceAmount()).orElse(BigDecimal.ZERO);
                                    BigDecimal contractTotalAmount = Optional.ofNullable(contractPaymentRepository.countTotalAmountByContractId(c.getContractId())).orElse(BigDecimal.ZERO);
                                    BigDecimal unpaid = contractAmount.add(serviceAmount).subtract(contractTotalAmount).max(BigDecimal.ZERO);
                                    return unpaid;
                                }).reduce(BigDecimal.ZERO, BigDecimal::add))
                        )
                );
                BigDecimal lastYearUnpaid = lastYearQuarterlyUnpaid.values().stream().reduce(BigDecimal.ZERO, BigDecimal::add);
                companyStatisticsMap.merge("lastYearUnpaid", lastYearUnpaid, BigDecimal::add);
                // 科技去年未付(年度)
                contractTypeStatisticsMap.merge(String.format("lastYearUnpaid_%s", Constant.CONTRACT_TECHNOLOGY), lastYearQuarterlyUnpaid.getOrDefault(Constant.CONTRACT_TECHNOLOGY, BigDecimal.ZERO), BigDecimal::add);
                // 咨询去年未付(年度)
                contractTypeStatisticsMap.merge(String.format("lastYearUnpaid_%s", Constant.CONTRACT_CONSULTATION), lastYearQuarterlyUnpaid.getOrDefault(Constant.CONTRACT_CONSULTATION, BigDecimal.ZERO), BigDecimal::add);
                // 弱电去年未付(年度)
                contractTypeStatisticsMap.merge(String.format("lastYearUnpaid_%s", Constant.CONTRACT_WEAK_CURRENT), lastYearQuarterlyUnpaid.getOrDefault(Constant.CONTRACT_WEAK_CURRENT, BigDecimal.ZERO), BigDecimal::add);
                // 知识产权去年未付(年度)
                contractTypeStatisticsMap.merge(String.format("lastYearUnpaid_%s", Constant.CONTRACT_IP), lastYearQuarterlyUnpaid.getOrDefault(Constant.CONTRACT_IP, BigDecimal.ZERO), BigDecimal::add);
                // 获取公司下所有用户
                UserQueryCriteria userQueryCriteria = new UserQueryCriteria();
                userQueryCriteria.setEnabled(true);
                userQueryCriteria.setCompanyId(company.getId());
                List<Long> userIds = userRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, userQueryCriteria, criteriaBuilder)).stream().map(user -> user.getId()).collect(Collectors.toList());
                // 已付工资(季度)
                BigDecimal newSalaryAmount = BigDecimal.ZERO;
                if (userIds.size() > 0) {
                    NewSalaryQueryCriteria newSalaryCriteria = new NewSalaryQueryCriteria();
                    newSalaryCriteria.setUserIds(userIds);
                    newSalaryCriteria.setSalaryYearMonthStart(quarterlyStartTime.toLocalDateTime().toLocalDate().toString());
                    newSalaryCriteria.setSalaryYearMonthEnd(quarterlyEndTime.toLocalDateTime().toLocalDate().toString());
                    newSalaryAmount = newSalaryRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, newSalaryCriteria, criteriaBuilder)).stream()
                            .map(ns -> ns.getPreTaxAmount().add(ns.getAccumulationFundCompanyAmount()).add(ns.getRetirementInsuranceCompanyAmount()).add(ns.getMedicalInsuranceCompanyAmount())
                                    .add(ns.getUnemploymentInsuranceCompanyAmount()).add(ns.getBirthInsuranceCompanyAmount()).add(ns.getEmploymentInsuranceCompanyAmount())).reduce(BigDecimal.ZERO, BigDecimal::add).max(BigDecimal.ZERO);
                }
                companyStatisticsMap.merge("quarterlySalary", newSalaryAmount, BigDecimal::add);
                // 报销金额(季度)
                BigDecimal reimburseAmount = BigDecimal.ZERO;
                if (userIds.size() > 0) {
                    ProjectReimburseQueryCriteria reimburseCriteria = new ProjectReimburseQueryCriteria();
                    reimburseCriteria.setUserIds(userIds);
                    reimburseCriteria.setStartTimeStart(quarterlyStartTime.toLocalDateTime().toLocalDate().toString());
                    reimburseCriteria.setStartTimeEnd(quarterlyEndTime.toLocalDateTime().toLocalDate().toString());
                    reimburseCriteria.setApprovalStatus(Constant.REIMBURSE_APPROVE_STATUS_AGREE);
                    reimburseAmount = projectReimburseRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, reimburseCriteria, criteriaBuilder)).stream()
                            .map(pr -> pr.getExpenseAmount()).reduce(BigDecimal.ZERO, BigDecimal::add).max(BigDecimal.ZERO);
                }
                companyStatisticsMap.merge("quarterlyReimburse", reimburseAmount, BigDecimal::add);
                // 构建HTML内容(具体内容)
                companyContentBuilder.append(String.format(
                        "<div class=\"card mb-20\">" +
                            "<div class=\"highlight sub-title font-bold\">%s</div>" +
                            "<div>" +
                                "<div class=\"gray content-title font-bold\">合同信息</div>" +
                                "<div class=\"normal content\">签订数量(季度)</div>" +
                                "<div class=\"normal content\">签订金额(季度)</div>" +
                                "<div class=\"normal content\">应付金额(年度)</div>" +
                                "<div class=\"normal content\">到账金额(年度)</div>" +
                                "<div class=\"normal content\">未付金额(年度)</div>" +
                                "<div class=\"normal content\">去年未付(年度)</div>" +
                                "<div class=\"blank\"></div>" +
                                "<div class=\"gray content-title font-bold\">资金信息</div>" +
                                "<div class=\"normal content\">已付工资(季度)</div>" +
                                "<div class=\"normal content\">报销金额(季度)</div>" +
                            "</div>" +
                            "<div>" +
                                "<div class=\"gray content-title font-bold\"></div>" +
                                "<div class=\"normal content\">%d</div>" +
                                "<div class=\"normal content\">%,.2f</div>" +
                                "<div class=\"normal content\">%,.2f</div>" +
                                "<div class=\"normal content\">%,.2f</div>" +
                                "<div class=\"normal content\">%,.2f</div>" +
                                "<div class=\"normal content\">%,.2f</div>" +
                                "<div class=\"blank\"></div>" +
                                "<div class=\"gray content-title font-bold\"></div>" +
                                "<div class=\"normal content\">%,.2f</div>" +
                                "<div class=\"normal content\">%,.2f</div>" +
                            "</div>" +
                        "</div>",
                        company.getLabel(),
                        companyStatisticsMap.getOrDefault("quarterlyCount", BigDecimal.ZERO).intValue(),
                        companyStatisticsMap.getOrDefault("quarterlyAmount", BigDecimal.ZERO).doubleValue(),
                        companyStatisticsMap.getOrDefault("annualPayable", BigDecimal.ZERO).doubleValue(),
                        companyStatisticsMap.getOrDefault("annualPaid", BigDecimal.ZERO).doubleValue(),
                        companyStatisticsMap.getOrDefault("annualUnpaid", BigDecimal.ZERO).doubleValue(),
                        companyStatisticsMap.getOrDefault("lastYearUnpaid", BigDecimal.ZERO).doubleValue(),
                        companyStatisticsMap.getOrDefault("quarterlySalary", BigDecimal.ZERO).doubleValue(),
                        companyStatisticsMap.getOrDefault("quarterlyReimburse", BigDecimal.ZERO).doubleValue()
                ));
            }
            // 构建HTML内容(结尾)
            companyContentBuilder.append("</div>");
            companyContentBuilder.append("</body>");
            companyContentBuilder.append("</html>");
            // 创建DocumentBuilder对象
            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = factory.newDocumentBuilder();
            // 将字符串转换为InputStream对象
            ByteArrayInputStream inputStream = new ByteArrayInputStream(companyContentBuilder.toString().getBytes());
            Document document = builder.parse(inputStream);
            // 使用DocumentBuilder解析XML文档
            Java2DRenderer renderer = new Java2DRenderer(document, 1510);
            BufferedImage image = renderer.getImage();
            // 生成报告图片
            FSImageWriter imageWriter = new FSImageWriter();
            String imagePath = properties.getPath().getPath() + "image" +  File.separator + "contract_company_statistics_" + IdUtil.simpleUUID() + ".png";
            File file = new File(imagePath);
            file.getParentFile().mkdirs();
            OutputStream outputStream = new FileOutputStream(file);
            imageWriter.write(image, outputStream);
            // 上传临时素材
            List<String> mediaIds = templateControlFieldService.uploadWecomMediaFile(Arrays.asList(imagePath));
            // 发送报告
            SysGoalSettingQueryCriteria goalSettingCriteria = new SysGoalSettingQueryCriteria();
            goalSettingCriteria.setTargetYear(annualStartTime.toLocalDateTime().toLocalDate().toString());
            List<SysGoalSetting> goalSettingList = sysGoalSettingRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, goalSettingCriteria, criteriaBuilder));
            List<String> weComList = goalSettingList.stream().map(gs -> Arrays.stream(gs.getLeaderName().split("[\\p{P}\\p{S}\\p{Z}]+")).map(name -> Optional.ofNullable(userRepository.findByNickName(name)).orElseGet(User::new).getWeComId()).filter(w -> StringUtils.isNotBlank(w)).collect(Collectors.toList())).reduce(new ArrayList<>(), (prev, cur) -> {
                prev.addAll(cur);
                return prev;
            }).stream().distinct().collect(Collectors.toList());
            for (String mediaId : mediaIds) {
                weComService.sendNotice(weComList, "合同季度统计信息", mediaId, Constant.WECOM_MESSAGE_TYPE_IMAGE);
            }
            outputStream.close();
            inputStream.close();
            // 类型合同统计
            List<String> contractTypeList = Arrays.asList(Constant.CONTRACT_TECHNOLOGY, Constant.CONTRACT_CONSULTATION, Constant.CONTRACT_WEAK_CURRENT, Constant.CONTRACT_IP);
            Map<String, String> contractTypeMap = dictDetailRepository.findByDictName(Constant.CONTRACT_DICT_TYPE).stream().collect(Collectors.toMap(DictDetail::getValue, DictDetail::getLabel));
            Map<String, String> projectDistinguishMap = dictDetailRepository.findByDictName(Constant.PROJECT_DISTINGUISH).stream().collect(Collectors.toMap(DictDetail::getLabel, DictDetail::getValue));
            Integer quarterNum = quarterlyStartTime.toLocalDateTime().get(IsoFields.QUARTER_OF_YEAR);
            for (String contractType : contractTypeList) {
                // 获取指定类型季度、年度目标值
                SysGoalSetting goalSetting = goalSettingList.stream().filter(gs -> gs.getProjectDistinguish().equals(projectDistinguishMap.get(contractTypeMap.get(contractType)))).findFirst().orElseGet(SysGoalSetting::new);
                BigDecimal quarterlyGoal;
                switch (quarterNum) {
                    case 1: quarterlyGoal = Optional.ofNullable(goalSetting.getFirstTargetAmount()).orElse(BigDecimal.ZERO); break;
                    case 2: quarterlyGoal = Optional.ofNullable(goalSetting.getSecondTargetAmount()).orElse(BigDecimal.ZERO); break;
                    case 3: quarterlyGoal = Optional.ofNullable(goalSetting.getThirdTargetAmount()).orElse(BigDecimal.ZERO); break;
                    case 4: quarterlyGoal = Optional.ofNullable(goalSetting.getFourthTargetAmount()).orElse(BigDecimal.ZERO); break;
                    default: quarterlyGoal = BigDecimal.ZERO;
                }
                BigDecimal annualGoal = Optional.ofNullable(goalSetting.getTargetAmount()).orElse(BigDecimal.ZERO);
                // 构建HTML内容(开头)
                StringBuilder typeContentBuilder = new StringBuilder();
                typeContentBuilder.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                typeContentBuilder.append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">");
                typeContentBuilder.append("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
                typeContentBuilder.append("<head>");
                typeContentBuilder.append("<style type=\"text/css\">");
                typeContentBuilder.append(".content-box { width: 960px; background: #f6f6f7; border: 1px solid #ccc; padding: 20px; font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; }");
                typeContentBuilder.append(".card { width: 100%; }");
                typeContentBuilder.append(".title { width: 100%; font-size: 20px; }");
                typeContentBuilder.append(".sub-title { width: 100%; font-size: 18px; }");
                typeContentBuilder.append(".content { display: inline-block; width: 140px; font-size: 16px; }");
                typeContentBuilder.append(".content-title { display: inline-block; width: 100px; font-size: 16px; }");
                typeContentBuilder.append(".blank { display: inline-block; width: 120px; }");
                typeContentBuilder.append(".highlight { color: #fca378; }");
                typeContentBuilder.append(".gray { color: #9a989e; }");
                typeContentBuilder.append(".normal { color: #000000; }");
                typeContentBuilder.append(".font-bold { font-weight: bold }");
                typeContentBuilder.append(".mb-20 { margin: 0 0 20px 0; }");
                typeContentBuilder.append("</style>");
                typeContentBuilder.append("</head>");
                typeContentBuilder.append("<body>");
                typeContentBuilder.append("<div class=\"content-box\">");
                typeContentBuilder.append(String.format("<div class=\"normal title font-bold mb-20\">%d年%d季度%s类型合同统计</div>", quarterlyStartTime.toLocalDateTime().getYear(), quarterNum, contractTypeMap.get(contractType)));
                // 构建HTML内容(具体内容)
                typeContentBuilder.append(String.format(
                        "<div class=\"card mb-20\">" +
                            "<div class=\"highlight sub-title font-bold\">%s</div>" +
                            "<div>" +
                                "<div class=\"gray content-title font-bold\">合同信息</div>" +
                                "<div class=\"normal content\">签订数量(季度)</div>" +
                                "<div class=\"normal content\">签订金额(季度)</div>" +
                                "<div class=\"normal content\">应付金额(年度)</div>" +
                                "<div class=\"normal content\">到账金额(年度)</div>" +
                                "<div class=\"normal content\">未付金额(年度)</div>" +
                                "<div class=\"normal content\">去年未付(年度)</div>" +
                            "</div>" +
                            "<div class=\"mb-20\">" +
                                "<div class=\"gray content-title font-bold\"></div>" +
                                "<div class=\"normal content\">%d</div>" +
                                "<div class=\"normal content\">%,.2f</div>" +
                                "<div class=\"normal content\">%,.2f</div>" +
                                "<div class=\"normal content\">%,.2f</div>" +
                                "<div class=\"normal content\">%,.2f</div>" +
                                "<div class=\"normal content\">%,.2f</div>" +
                            "</div>" +
                            "<div>" +
                                "<div class=\"gray content-title font-bold\">目标信息</div>" +
                                "<div class=\"normal content\">季度目标</div>" +
                                "<div class=\"normal content\">季度差额</div>" +
                                "<div class=\"normal content\">年度目标</div>" +
                                "<div class=\"normal content\">年度差额</div>" +
                            "</div>" +
                            "<div>" +
                                "<div class=\"gray content-title font-bold\"></div>" +
                                "<div class=\"normal content\">%,.2f</div>" +
                                "<div class=\"normal content\">%,.2f</div>" +
                                "<div class=\"normal content\">%,.2f</div>" +
                                "<div class=\"normal content\">%,.2f</div>" +
                            "</div>" +
                        "</div>",
                        contractTypeMap.get(contractType),
                        contractTypeStatisticsMap.getOrDefault(String.format("quarterlyCount_%s", contractType), BigDecimal.ZERO).intValue(),
                        contractTypeStatisticsMap.getOrDefault(String.format("quarterlyAmount_%s", contractType), BigDecimal.ZERO).doubleValue(),
                        contractTypeStatisticsMap.getOrDefault(String.format("annualPayable_%s", contractType), BigDecimal.ZERO).doubleValue(),
                        contractTypeStatisticsMap.getOrDefault(String.format("annualPaid_%s", contractType), BigDecimal.ZERO).doubleValue(),
                        contractTypeStatisticsMap.getOrDefault(String.format("annualUnpaid_%s", contractType), BigDecimal.ZERO).doubleValue(),
                        contractTypeStatisticsMap.getOrDefault(String.format("lastYearUnpaid_%s", contractType), BigDecimal.ZERO).doubleValue(),
                        quarterlyGoal.doubleValue(),
                        quarterlyGoal.subtract(contractTypeStatisticsMap.getOrDefault(String.format("quarterlyAmount_%s", contractType), BigDecimal.ZERO)).max(BigDecimal.ZERO).doubleValue(),
                        annualGoal.doubleValue(),
                        annualGoal.subtract(contractTypeStatisticsMap.getOrDefault(String.format("annualPayable_%s", contractType), BigDecimal.ZERO)).max(BigDecimal.ZERO).doubleValue()
                ));
                // 构建HTML内容(结尾)
                typeContentBuilder.append("</div>");
                typeContentBuilder.append("</body>");
                typeContentBuilder.append("</html>");
                // 将字符串转换为InputStream对象
                ByteArrayInputStream typeInputStream = new ByteArrayInputStream(typeContentBuilder.toString().getBytes());
                Document typeDocument = builder.parse(typeInputStream);
                // 使用DocumentBuilder解析XML文档
                Java2DRenderer typeRenderer = new Java2DRenderer(typeDocument, 1020);
                BufferedImage typeImage = typeRenderer.getImage();
                // 生成报告图片
                String typeImagePath = properties.getPath().getPath() + "image" +  File.separator + "contract_type_statistics_" + IdUtil.simpleUUID() + ".png";
                File typeFile = new File(typeImagePath);
                typeFile.getParentFile().mkdirs();
                OutputStream typeOutputStream = new FileOutputStream(typeFile);
                imageWriter.write(typeImage, typeOutputStream);
                if (StringUtils.isNotBlank(goalSetting.getLeaderName())) {
                    // 上传临时素材
                    List<String> typeMediaIds = templateControlFieldService.uploadWecomMediaFile(Arrays.asList(typeImagePath));
                    // 发送报告
                    List<String> typeWeComList = Arrays.stream(goalSetting.getLeaderName().split("[\\p{P}\\p{S}\\p{Z}]+")).map(name -> Optional.ofNullable(userRepository.findByNickName(name)).orElseGet(User::new).getWeComId()).filter(w -> StringUtils.isNotBlank(w)).collect(Collectors.toList());
                    for (String typeMediaId : typeMediaIds) {
                        weComService.sendNotice(typeWeComList, "合同季度统计信息", typeMediaId, Constant.WECOM_MESSAGE_TYPE_IMAGE);
                    }
                }
                typeOutputStream.close();
                typeInputStream.close();
            }
        } catch (IOException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/rest/ProjectController.java
@@ -204,4 +204,12 @@
        projectService.generateReport(criteria);
        return new ResponseEntity<>(HttpStatus.OK);
    }
    @Log("导出项目进度")
    @ApiOperation("导出项目进度")
    @GetMapping(value = "/downloadProgress")
    @PreAuthorize("@el.check('project:download')")
    public void exportProjectProgress(HttpServletResponse response, ProjectQueryCriteria criteria) throws IOException {
        projectService.downloadProgress(criteria, response);
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/service/ProjectService.java
@@ -163,4 +163,6 @@
     * @param criteria
     */
    void generateReport(ProjectQueryCriteria criteria);
    void downloadProgress(ProjectQueryCriteria criteria, HttpServletResponse response) throws IOException;
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/service/dto/ProjectReimburseQueryCriteria.java
@@ -51,4 +51,24 @@
    /** BETWEEN */
    @Query(type = Query.Type.BETWEEN)
    private List<Timestamp> endTime;
    /** 模糊 */
    @Query(type = Query.Type.IN, propName = "userId")
    private List<Long> userIds;
    /** 精确 */
    @Query(type = Query.Type.EQUAL)
    private String approvalStatus;
    /** 模糊 */
    @Query(type = Query.Type.GREATER_THAN, propName = "startTime")
    private String startTimeStart;
    /** 模糊 */
    @Query(type = Query.Type.LESS_THAN, propName = "startTime")
    private String startTimeEnd;
    /** 精确 */
    @Query(type = Query.Type.EQUAL)
    private Long userId;
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/project/service/impl/ProjectServiceImpl.java
@@ -825,4 +825,61 @@
        }
        weComService.toWeComSheetPushProjectReport(projectIds);
    }
    @Override
    public void downloadProgress(ProjectQueryCriteria criteria, HttpServletResponse response) throws IOException {
        List<Map<String, Object>> list = new ArrayList<>();
        List<User> userList = userRepository.findAll();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        List<Project> projectList = projectRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder));
        List<TaskMongo> taskMongoList = mongoTemplate.find(Query.query(Criteria.where("projectId").in(criteria.getIdInList())), TaskMongo.class);
        List<TaskUserMongo> taskUserList = mongoTemplate.find(Query.query(Criteria.where("task").in(taskMongoList)), TaskUserMongo.class);
        Integer sortId = 1;
        for (TaskUserMongo taskUserMongo : taskUserList) {
            Project project = projectList.stream().filter(p -> p.getId().equals(taskUserMongo.getTask().getProjectId())).findFirst().get();
            // 任务负责人
            List<Long> userIdList = taskUserMongo.getTask().getUserIdList();
            String taskLiableUser = userList.stream().filter(user -> userIdList.contains(user.getId())).map(user -> user.getNickName()).collect(Collectors.joining(","));
            // 作成者
            String creator = userList.stream().filter(user -> user.getId().equals(taskUserMongo.getUserId())).findFirst().get().getNickName();
            // 项目负责人
            String projectUserId = "";
            if (project.getLiableUserId() != null) {
                projectUserId = project.getLiableUserId().replace("-", "");
            }
            List<Long> idList = Arrays.asList(projectUserId.split(",")).stream().map(i -> Long.parseLong(i)).collect(Collectors.toList());
            String projectLiableUser = userList.stream().filter(user -> idList.contains(user.getId())).map(user -> user.getNickName()).collect(Collectors.joining(","));
            Map<String, Object> map = new LinkedHashMap<>();
            map.put("序号", sortId++);
            map.put("任务详情-项目", project.getName());
            map.put("项目负责人", projectLiableUser);
            map.put("任务分类", String.join(",", taskUserMongo.getTask().getTagList()));
            map.put("任务详情-名称", taskUserMongo.getTask().getName());
            map.put("项目单位", "/");
            map.put("任务负责人", taskLiableUser);
            map.put("任务详情-描述", taskUserMongo.getTask().getDescription());
            map.put("任务分配-名称", taskUserMongo.getName());
            map.put("作成者", creator);
            if (taskUserMongo.getTask().getPlanStartTime() != null) {
                map.put("计划开始时间", sdf.format(taskUserMongo.getTask().getPlanStartTime()));
            } else {
                map.put("计划开始时间", "");
            }
            if (taskUserMongo.getTask().getPlanEndTime() != null) {
                map.put("计划完成时间", sdf.format(taskUserMongo.getTask().getPlanEndTime()));
            } else {
                map.put("计划完成时间", "");
            }
            map.put("预计工时", taskUserMongo.getTask().getPlanHours());
            map.put("实际开始时间", sdf.format(taskUserMongo.getTaskStartDate()));
            map.put("实际完成时间", sdf.format(taskUserMongo.getTaskEndDate()));
            map.put("实际工时", taskUserMongo.getTaskHours());
            map.put("进度", taskUserMongo.getNewTaskProgress());
            map.put("预警", "");
            map.put("备注", taskUserMongo.getRemarks());
            list.add(map);
        }
        FileUtil.downloadExcel(list, response);
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/impl/WeComServiceImpl.java
@@ -8,6 +8,7 @@
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.chanjar.weixin.cp.config.impl.WxCpDefaultConfigImpl;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.modules.attendance.domain.*;
import me.zhengjie.modules.attendance.repository.*;
@@ -41,10 +42,10 @@
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 me.zhengjie.modules.weixin.cp.api.WxCpOaWeDocSmartsheetService;
import me.zhengjie.modules.weixin.cp.bean.smartsheet.field.*;
import me.zhengjie.modules.weixin.cp.bean.smartsheet.record.*;
import me.zhengjie.modules.weixin.cp.bean.smartsheet.sheet.*;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.SerializationUtils;
import org.springframework.data.domain.Sort;
@@ -193,22 +194,28 @@
            // 获取企业微信Token
            wxCpService.getAccessToken();
            // 获取参数日期类
            Calendar calAttendDate = Calendar.getInstance();
            // 日期格式化
            SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            // 参数日期
            String strAttendDate = "";
            // 参数日期 TODO:0731修改 企微设置打卡时段为跨天的(当天4:00:00至次日03:59:59)
            String startAttendDate = "";
            String endAttendDate = "";
            // 参数日期不为null(考勤按钮调用)
            if (ObjectUtils.isNotEmpty(attendDate)) {
                // 参数日期
                strAttendDate = attendDate;
                startAttendDate = attendDate;
            } else {
                // 参数日期
                strAttendDate = df.format(new Date());
                startAttendDate = df.format(new Date());
            }
            // 获取参数日期类
            Calendar calAttendDate = Calendar.getInstance();
            calAttendDate.setTime(Timestamp.valueOf(strAttendDate + " 00:00:00"));
            // 参数日期
            calAttendDate.setTime(df.parse(startAttendDate));
            calAttendDate.add(Calendar.DATE, 1);
            endAttendDate = df.format(calAttendDate.getTime());
            // 参数日期类
            calAttendDate.setTime(Timestamp.valueOf(startAttendDate + " 00:00:00"));
            // 用户列表
            List<User> userList;
            // 获取企业微信考勤白名单
@@ -225,7 +232,13 @@
            // 遍历用户列表
            for (User user : userList) {
                // 考勤记录:根据用户和日期查询
                Attendance attendance = attendanceRepository.findAllByUserIdAndAttendanceDate(user.getId(), strAttendDate);
                Attendance attendance = attendanceRepository.findAllByUserIdAndAttendanceDate(user.getId(), startAttendDate);
                // TODO:20250801修改 当天新建用户没有经过0点的考勤信息创建会空指针,需要创建记录
                if (attendance == null || attendance.getId().equals(null)) {
                    getWeComAttendanceList(Timestamp.valueOf(startAttendDate + " 00:00:00"), Arrays.asList(user));
                    attendance = attendanceRepository.findAllByUserIdAndAttendanceDate(user.getId(), startAttendDate);
                }
                Boolean isHoliday = false;
                if (calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY || attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_WEEKEND)) {
                    isHoliday = true;
@@ -248,10 +261,10 @@
                // 企业微信ID
                List<String> userWeComList = new ArrayList<>();
                userWeComList.add(user.getWeComId());
                System.out.println("开始查询用户" + user.getWeComId() + "的" + strAttendDate + "考勤记录");
                System.out.println("开始查询用户" + user.getWeComId() + "的" + startAttendDate + "考勤记录");
                try {
                    // 企微打卡数据
                    List<WxCpCheckinData> weComRecordResultList = wxCpService.getOaService().getCheckinData(1, sdf.parse(strAttendDate + " 00:00:00"), sdf.parse(strAttendDate + " 23:59:59"), userWeComList);
                    // 企微打卡数据 TODO:0731修改 企微设置打卡时段为跨天的(当天4:00:00至次日03:59:59)
                    List<WxCpCheckinData> weComRecordResultList = wxCpService.getOaService().getCheckinData(1, sdf.parse(startAttendDate + " 04:00:00"), sdf.parse(endAttendDate + " 03:59:59"), userWeComList);
                    // 遍历企微打卡数据
                    for (WxCpCheckinData weComRecordResult : weComRecordResultList) {
                        // 无打卡记录
@@ -263,14 +276,14 @@
                        // 早打卡
                        // 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);
                            cardDatetimeSupplement(attendance.getUserId(), startAttendDate, Constant.CARD_REPLACEMENT_DIFFERENTIATION_GOON, attendance);
                        }
                        if ("上班打卡".equals(weComRecordResult.getCheckinType())) {
                            // 调用验证状态方法
                            Boolean flag = getCardSupplement(attendance.getUserId(), attendance.getStartClockResults(), attendance.getActualWorkStartTime());
                            // 考勤记录
                            if (!isHoliday) {
                                attendance.setStartClockResults(flag == true ? attendance.getStartClockResults() : (ObjectUtil.isEmpty(weComRecordResult.getCheckinTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), checkInTime, 1)));
                                attendance.setStartClockResults(flag == true ? attendance.getStartClockResults() : (ObjectUtil.isEmpty(weComRecordResult.getCheckinTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), checkInTime, 1, null)));
                            } else {
                                attendance.setStartClockResults(Constant.ATTENDANCE_STATE_NORMAL);
                            }
@@ -280,14 +293,14 @@
                        // 晚打卡
                        // 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);
                            cardDatetimeSupplement(attendance.getUserId(), startAttendDate, Constant.CARD_REPLACEMENT_DIFFERENTIATION_GOOFF, attendance);
                        }
                        if ("下班打卡".equals(weComRecordResult.getCheckinType())) {
                            // 调用验证状态方法
                            Boolean flag = getCardSupplement(attendance.getUserId(), attendance.getEndClockResults(), attendance.getActualWorkEndTime());
                            // 考勤记录
                            if (!isHoliday) {
                                attendance.setEndClockResults(flag == true ? attendance.getEndClockResults() : (ObjectUtil.isEmpty(weComRecordResult.getCheckinTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), checkInTime, 2)));
                                attendance.setEndClockResults(flag == true ? attendance.getEndClockResults() : (ObjectUtil.isEmpty(weComRecordResult.getCheckinTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), checkInTime, 2, LocalDate.parse(startAttendDate))));
                            } else {
                                attendance.setEndClockResults(Constant.ATTENDANCE_STATE_NORMAL);
                            }
@@ -309,6 +322,9 @@
            }
        } catch (WxErrorException wxErrorException) {
            wxErrorException.printStackTrace();
            sendNotice(Arrays.asList("YueYuHuanXiangQinYuFenDou"), "企微通信异常", String.format("<div class=\"normal\">异常方法:%s</div>" +
                            "<div class=\"highlight\">请前往API服务查看LOG。</div>",
                    "getWeComAttendanceListOfNoon"), Constant.WECOM_MESSAGE_TYPE_TEXTCARD);
        }
    }
@@ -329,20 +345,25 @@
            // 日期格式化
            SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            // 参数日期
            String strAttendDate = "";
            // 参数日期 TODO:0731修改 企微设置打卡时段为跨天的(当天4:00:00至次日03:59:59)
            String startAttendDate = "";
            String endAttendDate = "";
            // 参数日期不为null(考勤按钮调用)
            if (ObjectUtils.isNotEmpty(attendDate)) {
                // 参数日期
                strAttendDate = attendDate;
                startAttendDate = attendDate;
            } else {
                // 参数日期类
                calAttendDate.add(Calendar.DATE, -1);
                // 参数日期
                strAttendDate = df.format(calAttendDate.getTime());
                startAttendDate = df.format(calAttendDate.getTime());
            }
            // 参数日期
            calAttendDate.setTime(df.parse(startAttendDate));
            calAttendDate.add(Calendar.DATE, 1);
            endAttendDate = df.format(calAttendDate.getTime());
            // 参数日期类
            calAttendDate.setTime(Timestamp.valueOf(strAttendDate + " 00:00:00"));
            calAttendDate.setTime(Timestamp.valueOf(startAttendDate + " 00:00:00"));
            // 用户列表
            List<User> userList;
            // 获取企业微信考勤白名单
@@ -359,7 +380,13 @@
            // 遍历用户列表
            for (User user : userList) {
                // 考勤记录:根据用户和日期查询
                Attendance attendance = attendanceRepository.findAllByUserIdAndAttendanceDate(user.getId(), strAttendDate);
                Attendance attendance = attendanceRepository.findAllByUserIdAndAttendanceDate(user.getId(), startAttendDate);
                // TODO:20250801修改 当天新建用户没有经过0点的考勤信息创建会空指针,需要创建记录
                if (attendance == null || attendance.getId().equals(null)) {
                    getWeComAttendanceList(Timestamp.valueOf(startAttendDate + " 00:00:00"), Arrays.asList(user));
                    attendance = attendanceRepository.findAllByUserIdAndAttendanceDate(user.getId(), startAttendDate);
                }
                Boolean isHoliday = false;
                if (calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY || attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_WEEKEND)) {
                    isHoliday = true;
@@ -382,10 +409,10 @@
                // 企业微信ID
                List<String> userWeComList = new ArrayList<>();
                userWeComList.add(user.getWeComId());
                System.out.println("开始查询用户" + user.getWeComId() + "的" + strAttendDate + "考勤记录");
                System.out.println("开始查询用户" + user.getWeComId() + "的" + startAttendDate + "考勤记录");
                try {
                    // 企微打卡数据
                    List<WxCpCheckinData> weComRecordResultList = wxCpService.getOaService().getCheckinData(1, sdf.parse(strAttendDate + " 00:00:00"), sdf.parse(strAttendDate + " 23:59:59"), userWeComList);
                    // 企微打卡数据 TODO:0731修改 企微设置打卡时段为跨天的(当天4:00:00至次日03:59:59)
                    List<WxCpCheckinData> weComRecordResultList = wxCpService.getOaService().getCheckinData(1, sdf.parse(startAttendDate + " 04:00:00"), sdf.parse(endAttendDate + " 03:59:59"), userWeComList);
                    // 遍历企微打卡数据
                    for (WxCpCheckinData weComRecordResult : weComRecordResultList) {
                        // 无打卡记录
@@ -397,14 +424,14 @@
                        // 早打卡
                        // 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);
                            cardDatetimeSupplement(attendance.getUserId(), startAttendDate, Constant.CARD_REPLACEMENT_DIFFERENTIATION_GOON, attendance);
                        }
                        if ("上班打卡".equals(weComRecordResult.getCheckinType())) {
                            // 调用验证状态方法
                            Boolean flag = getCardSupplement(attendance.getUserId(), attendance.getStartClockResults(), attendance.getActualWorkStartTime());
                            // 考勤记录
                            if (!isHoliday) {
                                attendance.setStartClockResults(flag == true ? attendance.getStartClockResults() : (ObjectUtil.isEmpty(weComRecordResult.getCheckinTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), checkInTime, 1)));
                                attendance.setStartClockResults(flag == true ? attendance.getStartClockResults() : (ObjectUtil.isEmpty(weComRecordResult.getCheckinTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), checkInTime, 1, null)));
                            } else {
                                attendance.setStartClockResults(Constant.ATTENDANCE_STATE_NORMAL);
                            }
@@ -414,14 +441,14 @@
                        // 晚打卡
                        // 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);
                            cardDatetimeSupplement(attendance.getUserId(), startAttendDate, Constant.CARD_REPLACEMENT_DIFFERENTIATION_GOOFF, attendance);
                        }
                        if ("下班打卡".equals(weComRecordResult.getCheckinType())) {
                            // 调用验证状态方法
                            Boolean flag = getCardSupplement(attendance.getUserId(), attendance.getEndClockResults(), attendance.getActualWorkEndTime());
                            // 考勤记录
                            if (!isHoliday) {
                                attendance.setEndClockResults(flag == true ? attendance.getEndClockResults() : (ObjectUtil.isEmpty(weComRecordResult.getCheckinTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), checkInTime, 2)));
                                attendance.setEndClockResults(flag == true ? attendance.getEndClockResults() : (ObjectUtil.isEmpty(weComRecordResult.getCheckinTime()) ? Constant.ATTENDANCE_STATE_NOTSIGNED : checkResult(user.getSysRostering(), checkInTime, 2, LocalDate.parse(startAttendDate))));
                            } else {
                                attendance.setEndClockResults(Constant.ATTENDANCE_STATE_NORMAL);
                            }
@@ -443,6 +470,9 @@
            }
        } catch (WxErrorException wxErrorException) {
            wxErrorException.printStackTrace();
            sendNotice(Arrays.asList("YueYuHuanXiangQinYuFenDou"), "企微通信异常", String.format("<div class=\"normal\">异常方法:%s</div>" +
                            "<div class=\"highlight\">请前往API服务查看LOG。</div>",
                    "getWeComAttendanceListOfNight"), Constant.WECOM_MESSAGE_TYPE_TEXTCARD);
        }
    }
@@ -556,6 +586,20 @@
            }
            //调用方法修改考勤打卡状态
            updateAttendanceRecord(null, attendance, Constant.ATTENDANCE_STATE_LEAVE, day, leaveStartDuration, leaveEndDuration);
        }
        // TODO:20250813修改 增加打卡时间判断,打卡时间需要闭环
        Boolean actualTimeLoopFlag = ObjectUtils.isNotEmpty(attendance.getActualWorkStartTime()) == ObjectUtils.isNotEmpty(attendance.getActualWorkEndTime());
        if (!actualTimeLoopFlag) {
            List<String> editStatusList = Arrays.asList(Constant.ATTENDANCE_STATE_GOOUT, Constant.ATTENDANCE_STATE_BUSINESS, Constant.ATTENDANCE_STATE_LEAVE);
            if (ObjectUtils.isEmpty(attendance.getActualWorkStartTime()) && editStatusList.contains(attendance.getStartClockResults())) {
                attendance.setStartClockResults(Constant.ATTENDANCE_STATE_NOTSIGNED);
                attendance.setStartLocationResults(Constant.LOCATION_RESULTS_NOTSIGNED);
            }
            if (ObjectUtils.isEmpty(attendance.getActualWorkEndTime()) && editStatusList.contains(attendance.getEndClockResults())) {
                attendance.setEndClockResults(Constant.ATTENDANCE_STATE_NOTSIGNED);
                attendance.setEndLocationResults(Constant.LOCATION_RESULTS_NOTSIGNED);
            }
        }
//        // 查询考勤请假表
@@ -740,16 +784,16 @@
            } else {
                // 上午
                if (day) {
                    // 上午时长 >= 上午排班时间 改打卡状态 否则 缺时
                    if (duration >= result) {
                    // 上午时长 >= 上午排班时间 改打卡状态 否则 缺时 TODO:20250805修改 排除休息日情况
                    if (duration >= result || attendance.getStartLocationResults().equals(Constant.LOCATION_RESULTS_REST)) {
                        attendance.setStartClockResults(type);
                        attendance.setStartLocationResults(null);
                    } else {
                        attendance.setStartClockResults(Constant.ATTENDANCE_STATE_LACK_OF_TIME);
                    }
                } else {
                    // 下午时长 >= 下午排班时间 改打卡状态 否则 缺时
                    if (duration >= noonResult) {
                    // 下午时长 >= 下午排班时间 改打卡状态 否则 缺时 TODO:20250805修改 排除休息日情况
                    if (duration >= noonResult || attendance.getEndLocationResults().equals(Constant.LOCATION_RESULTS_REST)) {
                        attendance.setEndClockResults(type);
                        attendance.setEndLocationResults(null);
                    } else {
@@ -771,14 +815,16 @@
            } else {
                //打卡的情况,修改考勤状态
                if (day) {
                    if ((duration + result1) >= result) {
                    // TODO:20250805修改 排除休息日情况
                    if ((duration + result1) >= result || attendance.getStartLocationResults().equals(Constant.LOCATION_RESULTS_REST)) {
                        attendance.setStartClockResults(type);
                        attendance.setStartLocationResults(null);
                    } else {
                        attendance.setStartClockResults(Constant.ATTENDANCE_STATE_LACK_OF_TIME);
                    }
                } else {
                    if ((duration + noonResult1) >= noonResult) {
                    // TODO:20250805修改 排除休息日情况
                    if ((duration + noonResult1) >= noonResult || attendance.getEndLocationResults().equals(Constant.LOCATION_RESULTS_REST)) {
                        attendance.setEndClockResults(type);
                        attendance.setEndLocationResults(null);
                    } else {
@@ -802,17 +848,20 @@
     *
     * @param sysRostering
     * @param timestamp
     * @param type
     * @param type / 1上班打卡。2下班打卡。
     * @param attendanceDate / 考勤日期当天(下班打卡使用)
     * @return
     */
    public String checkResult(SysRostering sysRostering, Timestamp timestamp, Integer type) {
    public String checkResult(SysRostering sysRostering, Timestamp timestamp, Integer type, LocalDate attendanceDate) {
        String result = ObjectUtil.isEmpty(timestamp) ? Constant.ATTENDANCE_STATE_NOTSIGNED : Constant.ATTENDANCE_STATE_NORMAL;
        if (type.equals(1)) {
            // 上班打卡
            if (timestamp.toLocalDateTime().toLocalTime().isAfter(sysRostering.getWorkStartTime())) {
                result = Constant.ATTENDANCE_START_LATE;
            }
        } else {
            if (timestamp.toLocalDateTime().toLocalTime().isBefore(sysRostering.getWorkEndTime())) {
            // 下班打卡
            if (timestamp.toLocalDateTime().toLocalTime().isBefore(sysRostering.getWorkEndTime()) && (attendanceDate != null ? !timestamp.toLocalDateTime().toLocalDate().isAfter(attendanceDate) : true)) {
                result = Constant.ATTENDANCE_START_EARLY;
            }
        }
@@ -847,9 +896,9 @@
     */
    public Boolean getCardSupplement(Long userId, String st, Timestamp checkTime) {
        if (ObjectUtils.isNotEmpty(checkTime)) {
            // 查询补卡记录
            // 查询补卡记录 TODO:20250805修改 正常考勤状态全部验证通过处理
            AttendanceCardreplacement attendanceCardreplacement = attendanceCardreplacementRepository.findByUserIdAndTime(userId, checkTime);
            if (ObjectUtils.isNotEmpty(attendanceCardreplacement) && st.equals(Constant.ATTENDANCE_STATE_NORMAL)) {
            if (ObjectUtils.isNotEmpty(attendanceCardreplacement) && (st.equals(Constant.ATTENDANCE_STATE_NORMAL) || st.equals(Constant.ATTENDANCE_STATE_LEAVE) || st.equals(Constant.ATTENDANCE_STATE_BUSINESS)|| st.equals(Constant.ATTENDANCE_STATE_GOOUT))) {
                return true;
            }
        }
@@ -894,8 +943,8 @@
     */
    public void setAttendance(Double sDuration, Double eDuration, Double result, Double noonResult, Attendance attendance, String type) {
        if (ObjectUtils.isEmpty(eDuration) && ObjectUtils.isEmpty(noonResult)) {
            // 上午时长 >= 上午排班时间 改打卡状态 否则 缺时
            if (sDuration >= result) {
            // 上午时长 >= 上午排班时间 改打卡状态 否则 缺时 TODO:20250805修改 排除休息日情况
            if (sDuration >= result || attendance.getStartLocationResults().equals(Constant.LOCATION_RESULTS_REST)) {
                attendance.setStartClockResults(type);
                attendance.setStartLocationResults(null);
            } else {
@@ -903,8 +952,8 @@
            }
        }
        if (ObjectUtils.isEmpty(sDuration) && ObjectUtils.isEmpty(result)) {
            // 下午时长 >= 下午排班时间 改打卡状态 否则 缺时
            if (eDuration >= noonResult) {
            // 下午时长 >= 下午排班时间 改打卡状态 否则 缺时 TODO:20250805修改 排除休息日情况
            if (eDuration >= noonResult || attendance.getEndLocationResults().equals(Constant.LOCATION_RESULTS_REST)) {
                attendance.setEndClockResults(type);
                attendance.setEndLocationResults(null);
            } else {
@@ -925,7 +974,8 @@
     */
    public void setAttendanceStart(Double sDuration, Double eDuration, Double result1, Double result, Double noonResult, Attendance attendance, String type) {
        if (ObjectUtils.isEmpty(eDuration) && sDuration > 0) {
            if ((sDuration + result1) >= result) {
            // TODO:20250805修改 排除休息日情况
            if ((sDuration + result1) >= result || attendance.getStartLocationResults().equals(Constant.LOCATION_RESULTS_REST)) {
                attendance.setStartClockResults(type);
                attendance.setStartLocationResults(null);
            } else {
@@ -933,7 +983,8 @@
            }
        }
        if (ObjectUtils.isEmpty(sDuration) && eDuration > 0) {
            if ((eDuration + result1) >= noonResult) {
            // TODO:20250805修改 排除休息日情况
            if ((eDuration + result1) >= noonResult || attendance.getEndLocationResults().equals(Constant.LOCATION_RESULTS_REST)) {
                attendance.setEndClockResults(type);
                attendance.setEndLocationResults(null);
            } else {
@@ -1086,7 +1137,43 @@
                wxCpService.getMessageService().send(wxCpMessage);
            } catch (WxErrorException wxErrorException) {
                wxErrorException.printStackTrace();
//                sendNotice(Arrays.asList("YueYuHuanXiangQinYuFenDou"), "企微通信异常", String.format("<div class=\"normal\">异常方法:%s</div>" +
//                                "<div class=\"highlight\">请前往API服务查看LOG。</div>",
//                        "sendNotice"), Constant.WECOM_MESSAGE_TYPE_TEXTCARD);
            }
        }
    }
    /**
     * 发送企微每周报告
     */
    public void remindWeeklyReport() {
        // 校验当天
        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;
        }
        try {
            // 获取企微机器人参数
            Map<String, String> robotParamMap = dictDetailRepository.findByDictName(Constant.WECOM_ROBOT_PARAM).stream().collect(Collectors.toMap(DictDetail::getLabel, DictDetail::getValue));
            if (robotParamMap.containsKey(Constant.REMIND_REPORT_WEBHOOK_KEY) && robotParamMap.containsKey(Constant.REMIND_REPORT_MSG)) {
                // 发送消息
                WxCpDefaultConfigImpl wxCpDefaultConfig = new WxCpDefaultConfigImpl();
                wxCpDefaultConfig.setWebhookKey(robotParamMap.get(Constant.REMIND_REPORT_WEBHOOK_KEY));
                wxCpService.setWxCpConfigStorage(wxCpDefaultConfig);
                wxCpService.getGroupRobotService().sendText(robotParamMap.get(Constant.REMIND_REPORT_MSG), Arrays.asList("@all"), Arrays.asList());
            }
        } catch (WxErrorException wxErrorException) {
            wxErrorException.printStackTrace();
        }
    }
@@ -1130,6 +1217,20 @@
        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);
        try {
            // 获取企微机器人参数
            Map<String, String> robotParamMap = dictDetailRepository.findByDictName(Constant.WECOM_ROBOT_PARAM).stream().collect(Collectors.toMap(DictDetail::getLabel, DictDetail::getValue));
            if (robotParamMap.containsKey(Constant.REMIND_REPORT_WEBHOOK_KEY) && robotParamMap.containsKey(Constant.REMIND_REPORT_SUCCESS_MSG)) {
                // 发送周报生成成功消息
                WxCpDefaultConfigImpl wxCpDefaultConfig = new WxCpDefaultConfigImpl();
                wxCpDefaultConfig.setWebhookKey(robotParamMap.get(Constant.REMIND_REPORT_WEBHOOK_KEY));
                wxCpService.setWxCpConfigStorage(wxCpDefaultConfig);
                wxCpService.getGroupRobotService().sendText(robotParamMap.get(Constant.REMIND_REPORT_SUCCESS_MSG), Arrays.asList("@all"), Arrays.asList());
            }
        } catch (WxErrorException wxErrorException) {
            wxErrorException.printStackTrace();
        }
    }
    /**
@@ -1285,6 +1386,9 @@
                        // 制作项目周报数据
                        Map<String, List<Record>> filterRecordMap = daliyMongoDtoList.stream().map(item -> {
                            Record record = recordInfo.getRecords().stream().filter(r -> {
                                if (ObjectUtils.isEmpty(r.getValues().get("项目名称")) || StringUtils.isBlank(r.getValues().get("项目名称").toString())) {
                                    return false;
                                }
                                LocalDate createDate = Instant.ofEpochMilli(Long.parseLong(r.getValues().get("提交日期").toString())).atZone(ZoneId.systemDefault()).toLocalDate();
                                RecordOption projectNameRecord = ((List<?>) r.getValues().get("项目名称")).stream().map(o -> RecordOption.fromJson(gson.toJson(o))).findFirst().orElseGet(RecordOption::new);
                                RecordCellUserValue submitterRecord = ((List<?>) r.getValues().get("提交人")).stream().map(o -> RecordCellUserValue.fromJson(gson.toJson(o))).findFirst().orElseGet(RecordCellUserValue::new);
@@ -1329,6 +1433,8 @@
                            record.setValues(values);
                            return record;
                        }).collect(Collectors.groupingBy(record -> StringUtils.isNotBlank(record.getRecordId()) ? "EDIT" : "CREATE"));
                        // 待删除记录
                        List<Record> recordDeleteList = recordInfo.getRecords().stream().filter(r -> ObjectUtils.isEmpty(r.getValues().get("项目名称")) || StringUtils.isBlank(r.getValues().get("项目名称").toString())).collect(Collectors.toList());
                        // 创建新纪录
                        List<Record> recordCreateList = filterRecordMap.getOrDefault("CREATE", Collections.emptyList());
@@ -1352,6 +1458,12 @@
                            recordEditRequest.setRecords(recordEditList);
                            // 提交记录
                            wxCpOaWeDocSmartsheetService.recordEdit(recordEditRequest);
                        }
                        // 删除记录(仅限空数据)
                        if (recordDeleteList.size() > 0) {
                            List<String> recordIdDeleteList = recordDeleteList.stream().map(r -> r.getRecordId()).collect(Collectors.toList());
                            wxCpOaWeDocSmartsheetService.recordDelete(reportParamMap.get(Constant.WEEKLY_REPORT_DOC_ID), weeklyReportProjectSheet.getSheetId(), recordIdDeleteList);
                        }
                    } else {
                        System.out.println("项目周报子表不存在");
@@ -1423,6 +1535,9 @@
                }
            } catch (WxErrorException wxErrorException) {
                wxErrorException.printStackTrace();
                sendNotice(Arrays.asList("YueYuHuanXiangQinYuFenDou"), "企微通信异常", String.format("<div class=\"normal\">异常方法:%s</div>" +
                                "<div class=\"highlight\">请前往API服务查看LOG。</div>",
                        "toWecomSheetPushWeeklyReport"), Constant.WECOM_MESSAGE_TYPE_TEXTCARD);
            } catch (Exception e) {
                e.printStackTrace();
            }
@@ -1958,6 +2073,9 @@
                }
            } catch (WxErrorException wxErrorException) {
                wxErrorException.printStackTrace();
                sendNotice(Arrays.asList("YueYuHuanXiangQinYuFenDou"), "企微通信异常", String.format("<div class=\"normal\">异常方法:%s</div>" +
                                "<div class=\"highlight\">请前往API服务查看LOG。</div>",
                        "toWeComSheetPushProjectReport"), Constant.WECOM_MESSAGE_TYPE_TEXTCARD);
            } catch (Exception e) {
                e.printStackTrace();
            }
@@ -1967,6 +2085,76 @@
    }
    /**
     * 提醒考勤异常的人员补充考勤
     */
    public void remindAttendanceError() {
        // 获取当前日期
        LocalDate todayDate = LocalDate.now();
        // 查询相关用户
        UserQueryCriteria userQueryCriteria = new UserQueryCriteria();
        userQueryCriteria.setEnabled(true);
        userQueryCriteria.setWeComIdNotNull(true);
        List<User> userList = userRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, userQueryCriteria, criteriaBuilder));
        // 提醒上月的异常考勤(每月前五天)
        if (todayDate.getDayOfMonth() < 6) {
            // 获取上个月的第一天
            LocalDate firstDayOfLastMonth = todayDate.minusMonths(1).withDayOfMonth(1);
            // 获取上个月的最后一天
            LocalDate lastDayOfLastMonth = todayDate.withDayOfMonth(1).minusDays(1);
            // 异常状态列表
            List<String> errorStatusList = Arrays.asList(Constant.ATTENDANCE_STATE_WAITFOR, Constant.ATTENDANCE_STATE_NOTSIGNED, Constant.ATTENDANCE_STATE_LACK_OF_TIME, Constant.ATTENDANCE_START_LATE, Constant.ATTENDANCE_START_EARLY);
            for (User user : userList) {
                // 查询考勤记录
                List<Attendance> attendanceList = attendanceRepository.findAllByUserAndDate(user.getId(), firstDayOfLastMonth.toString(), lastDayOfLastMonth.toString());
                // 过滤异常记录
                List<Attendance> errorAttendanceList = attendanceList.stream().filter(a -> errorStatusList.contains(a.getStartClockResults()) || errorStatusList.contains(a.getEndClockResults())).collect(Collectors.toList());
                if (errorAttendanceList.size() > 0) {
                    // 异常提醒
                    sendNotice(Arrays.asList(user.getWeComId()), "上月考勤异常提醒", String.format("<div class=\"normal\">异常时间:%s</div>" +
                                    "<div class=\"highlight\">上月考勤异常,请登录PMS系统查看。</div>",
                            errorAttendanceList.stream().map(a -> a.getAttendanceDate().toLocalDateTime().toLocalDate().toString()).collect(Collectors.joining(","))), Constant.WECOM_MESSAGE_TYPE_TEXTCARD);
                }
                // 获取上个月内缺勤记录(20250718 TODO:因业务需求,打卡必须闭环,否则会导致工时计算错误)
                List<Attendance> lackOfAttendanceList = attendanceList.stream().filter(a -> (a.getActualWorkStartTime() != null && a.getActualWorkEndTime() == null) || (a.getActualWorkStartTime() == null && a.getActualWorkEndTime() != null)).collect(Collectors.toList());
                if (lackOfAttendanceList.size() > 0) {
                    // 缺卡异常提醒
                    sendNotice(Arrays.asList(user.getWeComId()), "上月考勤缺勤提醒", String.format("<div class=\"normal\">缺勤时间:%s</div>" +
                                    "<div class=\"highlight\">上月存在缺勤,请登录PMS系统查看。</div>",
                            lackOfAttendanceList.stream().map(a -> a.getAttendanceDate().toLocalDateTime().toLocalDate().toString()).collect(Collectors.joining(","))), Constant.WECOM_MESSAGE_TYPE_TEXTCARD);
                }
            }
        }
        // 提醒缺卡的异常考勤(三天前至昨天)
        // 获取三天前
        LocalDate threeDayAgo = todayDate.minusDays(3);
        // 获取昨天
        LocalDate yesterday = todayDate.minusDays(1);
        // 异常状态列表
        List<String> errorStatusList = Arrays.asList(Constant.ATTENDANCE_STATE_NOTSIGNED, Constant.ATTENDANCE_STATE_LACK_OF_TIME);
        for (User user : userList) {
            // 查询考勤记录
            List<Attendance> attendanceList = attendanceRepository.findAllByUserAndDate(user.getId(), threeDayAgo.toString(), yesterday.toString());
            // 过滤异常记录
            List<Attendance> errorAttendanceList = attendanceList.stream().filter(a -> errorStatusList.contains(a.getStartClockResults()) || errorStatusList.contains(a.getEndClockResults())).collect(Collectors.toList());
            if (errorAttendanceList.size() > 0) {
                // 异常提醒
                sendNotice(Arrays.asList(user.getWeComId()), "打卡考勤异常提醒", String.format("<div class=\"normal\">检测到您打卡考勤存在异常,请及时补卡</div>" +
                                "<div class=\"normal\">异常时间:%s</div>" +
                                "<div class=\"highlight\">打卡考勤异常,请登录PMS系统查看。</div>",
                        errorAttendanceList.stream().map(a -> a.getAttendanceDate().toLocalDateTime().toLocalDate().toString()).collect(Collectors.joining(","))), Constant.WECOM_MESSAGE_TYPE_TEXTCARD);
            }
        }
    }
    /**
     * 计算用户所需成本
     *
     * @param userId
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/ContractMethod.java
@@ -3,6 +3,7 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.modules.constant.Constant;
import me.zhengjie.modules.contract.service.ContractService;
import me.zhengjie.modules.quartz.service.impl.WeComServiceImpl;
import me.zhengjie.modules.system.domain.Role;
import me.zhengjie.modules.system.domain.SysConfigProportion;
@@ -35,6 +36,7 @@
    private final SysUserContractRepository sysUserContractRepository;
    private final UserRepository userRepository;
    private final WeComServiceImpl weComService;
    private final ContractService contractService;
    // 合同到期提醒
    public void contractRemind() throws Exception {
@@ -87,4 +89,9 @@
            }
        }
    }
    // 合同季度统计推送
    public void contractQuarterlyReport() throws Exception {
        contractService.contractQuarterlyReport(null);
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/OpenApiWeComMethod.java
@@ -40,10 +40,26 @@
    }
    /**
     * 每周最后一天14:00执行,更新企微周报
     * 每周最后一天10:30执行,提醒填写企微周报
     */
    public void remindWeeklyReport() throws Exception {
        // 下午10:30执行,提醒填写企微周报
        weComService.remindWeeklyReport();
    }
    /**
     * 每周最后一天16:30执行,更新企微周报
     */
    public void getWeComWeeklyReport() throws Exception {
        // 下午14:00执行,更新企微周报
        weComService.toWecomSheetPushReport();
    }
    /**
     * 每天06:00执行,提醒考勤异常的人员补充考勤
     */
    public void remindAttendanceError() throws Exception {
        // 上午06:00执行,提醒考勤异常的人员补充考勤
        weComService.remindAttendanceError();
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/salary/service/dto/NewSalaryQueryCriteria.java
@@ -61,4 +61,16 @@
    private String approveStatus;
    private String targetYearMonth;
    /**
     * 模糊
     */
    @Query(type = Query.Type.GREATER_THAN, propName = "salaryYearMonth")
    private String salaryYearMonthStart;
    /**
     * 模糊
     */
    @Query(type = Query.Type.LESS_THAN, propName = "salaryYearMonth")
    private String salaryYearMonthEnd;
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/SysGoalSetting.java
@@ -56,9 +56,34 @@
    @Column(name = "`target_amount`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "目标金额")
    @ApiModelProperty(value = "目标金额(全年)")
    private BigDecimal targetAmount;
    @Column(name = "`first_target_amount`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "目标金额(一季度)")
    private BigDecimal firstTargetAmount;
    @Column(name = "`second_target_amount`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "目标金额(二季度)")
    private BigDecimal secondTargetAmount;
    @Column(name = "`third_target_amount`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "目标金额(三季度)")
    private BigDecimal thirdTargetAmount;
    @Column(name = "`fourth_target_amount`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "目标金额(四季度)")
    private BigDecimal fourthTargetAmount;
    @Column(name = "`leader_name`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "相关负责人姓名,用逗号分隔")
    private String leaderName;
    @Column(name = "`remarks`")
    @ApiModelProperty(value = "备注")
    private String remarks;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java
@@ -215,4 +215,12 @@
    @Query(value = "select * FROM sys_user WHERE user_id IN ?1 and company_id = ?2 and enabled = true",nativeQuery = true)
    void findByUserIdInAndCompanyId(List<Long> userIds, Long companyId);
    /**
     * 根据用户昵称查询
     *
     * @param nickName 用户昵称
     * @return /
     */
    User findByNickName(String nickName);
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/SysGoalSettingDto.java
@@ -40,9 +40,24 @@
    /** 项目区分 */
    private String projectDistinguish;
    /** 目标金额 */
    /** 目标金额(全年) */
    private BigDecimal targetAmount;
    /** 目标金额(一季度) */
    private BigDecimal firstTargetAmount;
    /** 目标金额(二季度) */
    private BigDecimal secondTargetAmount;
    /** 目标金额(三季度) */
    private BigDecimal thirdTargetAmount;
    /** 目标金额(四季度) */
    private BigDecimal fourthTargetAmount;
    /** 相关负责人姓名,用逗号分隔 */
    private String leaderName;
    /** 备注 */
    private String remarks;
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/SysGoalSettingServiceImpl.java
@@ -111,7 +111,12 @@
            Map<String,Object> map = new LinkedHashMap<>();
            map.put("目标年度", targetYear);
            map.put("项目区分", projectDistinguish);
            map.put("目标金额", sysGoalSetting.getTargetAmount());
            map.put("目标金额(全年)", sysGoalSetting.getTargetAmount());
            map.put("目标金额(一季度)", sysGoalSetting.getFirstTargetAmount());
            map.put("目标金额(二季度)", sysGoalSetting.getSecondTargetAmount());
            map.put("目标金额(三季度)", sysGoalSetting.getThirdTargetAmount());
            map.put("目标金额(四季度)", sysGoalSetting.getFourthTargetAmount());
            map.put("相关负责人", sysGoalSetting.getLeaderName());
            map.put("备注", sysGoalSetting.getRemarks());
            map.put("创建者", sysGoalSetting.getCreateBy());
            map.put("创建时间", sysGoalSetting.getCreateTime());
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserServiceImpl.java
@@ -834,7 +834,8 @@
        List<SysConfigHoliday> holidayConfigurationList = sysConfigHolidayRepository.findAll();
        for (SysConfigHoliday holidayConfiguration : holidayConfigurationList) {
            if (holidayConfiguration.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS)
                    || holidayConfiguration.getDateType().equals(Constant.DATE_TYPE_HOLIDAYS)) {
                    || holidayConfiguration.getDateType().equals(Constant.DATE_TYPE_HOLIDAYS)
                    || holidayConfiguration.getDateType().equals(Constant.DATE_TYPE_WEEKEND)) {
                holiday.add(sdf.format(holidayConfiguration.getHolidayDate()));
            }
        }
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/rest/TaskController.java
@@ -20,6 +20,7 @@
import me.zhengjie.modules.task.domain.TaskMongo;
import me.zhengjie.modules.task.service.TaskService;
import me.zhengjie.modules.task.service.TaskUserService;
import me.zhengjie.modules.task.service.dto.MigrationTaskRequest;
import me.zhengjie.modules.task.service.dto.TaskQueryCriteria;
import me.zhengjie.utils.SecurityUtils;
import org.springframework.data.domain.Pageable;
@@ -204,4 +205,12 @@
//    public ResponseEntity<Object> getTasts(String taskName){
//        return new ResponseEntity<>(taskService.getTastByName(taskName),HttpStatus.OK);
//    }
    @PostMapping("/migration")
    @Log("迁移任务")
    @ApiOperation("迁移任务")
    public ResponseEntity<Object> migrationTask(@RequestBody MigrationTaskRequest request) {
        taskService.migrationTask(request);
        return new ResponseEntity<>(HttpStatus.OK);
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/rest/TaskUserController.java
@@ -16,11 +16,11 @@
package me.zhengjie.modules.task.rest;
import me.zhengjie.annotation.Log;
import me.zhengjie.modules.task.domain.TaskUserMongo;
import me.zhengjie.modules.task.service.TaskUserService;
import me.zhengjie.modules.task.service.dto.TaskGenerateDto;
import me.zhengjie.modules.task.service.dto.TaskUserMongoDto;
import me.zhengjie.modules.task.service.dto.TaskUserQueryCriteria;
import me.zhengjie.modules.task.service.vo.TaskUserMongoVo;
import me.zhengjie.utils.SecurityUtils;
import org.springframework.data.domain.Pageable;
import lombok.RequiredArgsConstructor;
@@ -31,7 +31,6 @@
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;
import java.io.IOException;
import java.text.ParseException;
import javax.servlet.http.HttpServletResponse;
/**
@@ -81,7 +80,7 @@
    @Log("新增任务分配")
    @ApiOperation("新增任务分配")
    @PreAuthorize("@el.check('taskUser:add')")
    public ResponseEntity<Object> createTaskUser(@Validated @RequestBody TaskUserMongo resources) throws Exception {
    public ResponseEntity<Object> createTaskUser(@Validated @RequestBody TaskUserMongoVo resources) throws Exception {
        taskUserService.create(resources);
        return new ResponseEntity<>(HttpStatus.CREATED);
    }
@@ -192,4 +191,12 @@
    public void exportUser(HttpServletResponse response, String taskId) throws IOException {
        taskUserService.exportUser(response, taskId);
    }
    @GetMapping(value = "/allSimple")
    @Log("查询任务分配(不包含额外数据)")
    @ApiOperation("查询任务分配(不包含额外数据)")
    @PreAuthorize("@el.check('taskUser:list')")
    public ResponseEntity<Object> queryTaskUserSimple(String taskId){
        return new ResponseEntity<>(taskUserService.queryAllSimple(taskId), HttpStatus.OK);
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/TaskService.java
@@ -21,10 +21,7 @@
import me.zhengjie.modules.task.domain.TaskAggrMongo;
import me.zhengjie.modules.task.domain.TaskMongo;
import me.zhengjie.modules.task.domain.TaskUserMongo;
import me.zhengjie.modules.task.service.dto.TaskDto;
import me.zhengjie.modules.task.service.dto.TaskMongoDto;
import me.zhengjie.modules.task.service.dto.TaskQueryCriteria;
import me.zhengjie.modules.task.service.dto.TaskUserMongoDto;
import me.zhengjie.modules.task.service.dto.*;
import org.springframework.data.domain.Pageable;
import java.util.Date;
@@ -132,4 +129,6 @@
    List<TaskMongo> getTastAllById(String taskId);
    void changeStatus(String[] ids);
    void migrationTask(MigrationTaskRequest request);
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/TaskUserService.java
@@ -20,9 +20,9 @@
import me.zhengjie.modules.task.domain.TaskUserMongo;
import me.zhengjie.modules.task.service.dto.*;
import me.zhengjie.modules.task.service.vo.TaskUserMongoVo;
import org.springframework.data.domain.Pageable;
import java.text.ParseException;
import java.util.Map;
import java.util.List;
import java.io.IOException;
@@ -49,7 +49,6 @@
    /**
     * 查询数据分页
     * @param criteria 条件
     * @param pageable 分页参数
     * @return Map<String,Object>
     */
    List<TaskUserMongoDto> queryAll(TaskUserQueryCriteria criteria);
@@ -60,6 +59,13 @@
    * @return List<TaskUserDto>
    */
    List<TaskUserMongoDto> queryAll(String taskId);
    /**
     * 查询所有数据(不包含额外数据)不分页
     * @param
     * @return List<TaskUserDto>
     */
    List<TaskUserMongoDto> queryAllSimple(String taskId);
    /**
    * 统计小时数
@@ -80,7 +86,7 @@
     *
     * @param resources /
     */
    void create(TaskUserMongo resources) throws Exception;
    void create(TaskUserMongoVo resources) throws Exception;
    /**
    * 编辑
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/dto/MigrationTaskRequest.java
New file
@@ -0,0 +1,28 @@
package me.zhengjie.modules.task.service.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
 * @website https://eladmin.vip
 * @description /
 * @author baolh
 * @date 2025-06-09
 **/
@Data
public class MigrationTaskRequest implements Serializable {
    /** 迁移来源任务ID */
    private String sourceTaskId;
    /** 迁移来源任务分配ID */
    private List<String> sourceTaskUserId;
    /** 迁移目标项目ID */
    private Long targetProjectId;
    /** 迁移目标任务ID */
    private String targetTaskId;
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskServiceImpl.java
@@ -35,13 +35,11 @@
import me.zhengjie.modules.task.repository.TaskRepository;
import me.zhengjie.modules.task.repository.TaskUserRepository;
import me.zhengjie.modules.task.service.TaskService;
import me.zhengjie.modules.task.service.dto.TaskDto;
import me.zhengjie.modules.task.service.dto.TaskMongoDto;
import me.zhengjie.modules.task.service.dto.TaskQueryCriteria;
import me.zhengjie.modules.task.service.dto.TaskUserMongoDto;
import me.zhengjie.modules.task.service.dto.*;
import me.zhengjie.modules.task.service.mapstruct.TaskMapper;
import me.zhengjie.modules.treatment.repository.UserLevelWageRepository;
import me.zhengjie.utils.*;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
@@ -1054,5 +1052,41 @@
//        return taskMapper.toDto(taskRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
//    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void migrationTask(MigrationTaskRequest request) {
        if (StringUtils.isNotBlank(request.getSourceTaskId()) && ObjectUtils.isNotEmpty(request.getTargetProjectId())) {
            // 迁移来源任务到目标项目下
            TaskMongo sourceTask = mongoTemplate.findById(request.getSourceTaskId(), TaskMongo.class);
            Project targetProject = projectRepository.findById(request.getTargetProjectId()).orElseGet(null);
            if (ObjectUtils.isNotEmpty(sourceTask) && ObjectUtils.isNotEmpty(targetProject)) {
                // 校验任务名唯一性(项目内)
                boolean existed = mongoTemplate.exists(Query.query(Criteria.where("name").is(sourceTask.getName()).and("projectId").is(targetProject.getId()).and("id").ne(sourceTask.getId())), TaskMongo.class);
                if (existed) {
                    throw new BadRequestException("任务名称重复");
                }
                sourceTask.setProjectId(targetProject.getId());
                mongoTemplate.save(sourceTask);
            }
        } else if (request.getSourceTaskUserId().size() > 0 && StringUtils.isNotBlank(request.getTargetTaskId())) {
            // 迁移来源分配到目标任务下
            List<TaskUserMongo> sourceTaskUserList = mongoTemplate.find(Query.query(Criteria.where("id").in(request.getSourceTaskUserId())), TaskUserMongo.class);
            TaskMongo targetTask = mongoTemplate.findById(request.getTargetTaskId(), TaskMongo.class);
            if (sourceTaskUserList.size() > 0 && ObjectUtils.isNotEmpty(targetTask)) {
                TaskMongo sourceTask = sourceTaskUserList.stream().findFirst().orElseGet(TaskUserMongo::new).getTask();
                for (TaskUserMongo sourceTaskUser : sourceTaskUserList) {
                    sourceTaskUser.setTask(targetTask);
                    mongoTemplate.save(sourceTaskUser);
                }
                // 迁移后如果任务下无任务分配则删除该任务
                if (mongoTemplate.count(Query.query(Criteria.where("task").is(sourceTask)), TaskUserMongo.class) == 0) {
                    mongoTemplate.remove(sourceTask);
                }
            }
        }
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/impl/TaskUserServiceImpl.java
@@ -15,6 +15,7 @@
 */
package me.zhengjie.modules.task.service.impl;
import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.RoundingMode;
@@ -27,8 +28,13 @@
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.poi.excel.BigExcelWriter;
import cn.hutool.poi.excel.ExcelUtil;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.modules.project.domain.Project;
import me.zhengjie.modules.project.repository.ProjectRepository;
@@ -36,9 +42,13 @@
import me.zhengjie.modules.system.repository.DictDetailRepository;
import me.zhengjie.modules.task.domain.*;
import me.zhengjie.modules.task.service.dto.*;
import me.zhengjie.modules.task.service.mapstruct.TaskUserMongoMapper;
import me.zhengjie.modules.task.service.vo.TaskUserMongoVo;
import me.zhengjie.modules.treatment.domain.UserLevelWage;
import me.zhengjie.modules.treatment.repository.UserLevelWageRepository;
import me.zhengjie.utils.*;
import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.bson.types.ObjectId;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
@@ -84,6 +94,7 @@
    private final WeComServiceImpl weComService;
    private final ProjectRepository projectRepository;
    private final DictDetailRepository dictDetailRepository;
    private final TaskUserMongoMapper taskUserMongoMapper;
//    @Override
//    public TaskUserTotalMongoDto sumTotalByTask(String taskId) {
@@ -419,14 +430,21 @@
        if (taskMongos.size() == 0) {
            throw new BadRequestException("任务异常,请联系管理员");
        }
        List<TaskGenerate> errorTaskGenerateList = taskGenerateDto.getGenerateForm().stream().filter(i -> i.getUserIds() != null  && mongoTemplate.exists(Query.query(Criteria.where("task._id").is(taskGenerateDto.getTaskId()).and("name").is(i.getName()).and("userId").is(i.getUserIds())), TaskUserMongo.class)).collect(Collectors.toList());
        if (errorTaskGenerateList.size() > 0) {
            throw new BadRequestException("以下任务已存在,请检查修改后重试:" + errorTaskGenerateList.stream()
                    .map(taskGenerate -> String.format("%s【%s】",taskGenerate.getName(), taskGenerate.getUserId()))
                    .collect(Collectors.joining("、")));
        }
        Project project = projectRepository.findById(taskMongos.get(0).getProjectId()).orElseGet(Project::new);
        if (taskGenerateDto.getGenerateForm().size() > 0) {
            for (TaskGenerate taskGenerate : taskGenerateDto.getGenerateForm()) {
                TaskUserMongo taskUserMongo = new TaskUserMongo();
                taskUserMongo.setName(taskGenerate.getName());
                taskUserMongo.setTask(taskMongos.get(0));
                taskUserMongo.setTaskHours(taskGenerate.getTaskHours());
                taskUserMongo.setTaskStatus(taskGenerate.getTaskStatusID());
                taskUserMongo.setTaskStatus(taskGenerate.getTaskStatus());
                if (taskGenerate.getCostHours() != null) {
                    taskUserMongo.setCostHours(taskGenerate.getCostHours());
                }
@@ -735,6 +753,9 @@
            criteriaMongo.and("task").is(taskMongo);
        } else {
            return PageUtil.toPage(Collections.emptyList(), 0);
        }
        if (StringUtils.isNotBlank(criteria.getName())) {
            criteriaMongo = criteriaMongo.and("name").regex(criteria.getName());
        }
        if (criteria.getUserId() != null) {
            criteriaMongo = criteriaMongo.and("userId").is(criteria.getUserId());
@@ -1060,6 +1081,36 @@
    }
    @Override
    public List<TaskUserMongoDto> queryAllSimple(String taskId) {
        Criteria criteriaMongo = new Criteria();
        // 任务下的任务分配
        TaskMongo taskMongo = mongoTemplate.findById(taskId, TaskMongo.class);
        criteriaMongo.and("task").is(taskMongo);
        Query query = new Query(criteriaMongo);
        List<TaskUserMongo> taskUserMongos = mongoTemplate.find(query, TaskUserMongo.class);
        List<TaskUserMongoDto> resultList = new ArrayList<>();
        for (TaskUserMongo taskUserMongo : taskUserMongos) {
            TaskUserMongoDto taskUserMongoDto = new TaskUserMongoDto();
            taskUserMongoDto.setId(taskUserMongo.getId());
            taskUserMongoDto.setName(taskUserMongo.getName());
            taskUserMongoDto.setOld_id(taskUserMongo.getTask().getOld_id());
            taskUserMongoDto.setTaskId(taskUserMongo.getTask().getId());
            taskUserMongoDto.setPerformanceType(taskUserMongo.getPerformanceType());
            taskUserMongoDto.setPriority(taskUserMongo.getPriority());
            taskUserMongoDto.setTaskStatus(taskUserMongo.getTaskStatus());
            taskUserMongoDto.setTaskStartDate(taskUserMongo.getTaskStartDate());
            taskUserMongoDto.setTaskEndDate(taskUserMongo.getTaskEndDate());
            taskUserMongoDto.setTaskHours(taskUserMongo.getTaskHours());
            taskUserMongoDto.setRid(taskUserMongo.getRid());
            taskUserMongoDto.setPerformanceHours(taskUserMongo.getTaskHours());
            resultList.add(taskUserMongoDto);
        }
        return resultList;
    }
    @Override
    public Double calculateHour(TaskUserQueryCriteria criteria) {
        ZoneId zoneId = ZoneId.systemDefault();
        LocalDateTime localEndDateTime = criteria.getTaskEndDate().toInstant().atZone(zoneId).toLocalDateTime();
@@ -1135,52 +1186,103 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void create(TaskUserMongo resources) throws Exception {
    public void create(TaskUserMongoVo resources) throws Exception {
        if (resources.getUserIds().size() > 0) {
            for (Long userId : resources.getUserIds()) {
                long cnt = mongoTemplate.count(
                        Query.query(new Criteria("name").is(resources.getName())
                                .and("task").is(resources.getTask())
                                .and("userId").is(userId)
                                .and("taskStatus").in(Constant.TASK_STATUS_NOT_STARTED, Constant.TASK_STATUS_IN_HAND, Constant.TASK_STATUS_TEST)), TaskUserMongo.class);
                if (cnt > 0) {
                    throw new BadRequestException("已存在同名未完成的任务!");
                }
            }
            // 批量新增
            TaskMongo taskMongo = mongoTemplate.findById(resources.getTask().getId(), TaskMongo.class);
            for (Long userId : resources.getUserIds()) {
                TaskUserMongo taskUserMongo = taskUserMongoMapper.toEntity(resources);
                if (taskMongo != null) {
                    taskUserMongo.setPerformanceType(taskMongo.getPerformanceType());
                    taskUserMongo.setTask(taskMongo);
                }
                taskUserMongo.setName(resources.getName());
                taskUserMongo.setUserId(userId);
                taskUserMongo.setTaskStartDate(resources.getTaskStartDate());
                taskUserMongo.setTaskEndDate(resources.getTaskEndDate());
                taskUserMongo.setTaskHours(resources.getTaskHours());
                taskUserMongo.setTaskStatus(resources.getTaskStatus());
                taskUserMongo.setPerformanceHours(resources.getTaskHours());
                taskUserMongo.setRid(resources.getRid());
                taskUserMongo.setUid(resources.getUid());
                mongoTemplate.save(taskUserMongo);
                if (userId != null) {
                    // 发送给审批人企微
                    List<String> weComList = new ArrayList<>();
                    // 查询所属用户信息
                    User user = userRepository.findById(userId).orElseGet(User::new);
                    Project project = projectRepository.findById(taskUserMongo.getTask().getProjectId()).orElseGet(Project::new);
                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                    if (StringUtils.isNotBlank(user.getWeComId())) {
                        weComList.add(user.getWeComId());
                        weComService.sendNotice(weComList, "任务变更提醒", String.format("<div class=\"gray\">任务创建提示</div>" +
                                        "<div class=\"normal\">项目:%s</div>" +
                                        "<div class=\"normal\">任务:%s</div>" +
                                        "<div class=\"normal\">任务区间:%s</div>" +
                                        "<div class=\"highlight\">任务创建成功,请登录PMS系统查看。</div>",
                                project.getName(),
                                taskUserMongo.getTask().getName() + "  > " + taskUserMongo.getName(),
                                sdf.format(taskUserMongo.getTaskStartDate()) + "~" + sdf.format(taskUserMongo.getTaskEndDate())), Constant.WECOM_MESSAGE_TYPE_TEXTCARD);
                    }
                }
            }
        } else {
            long cnt = mongoTemplate.count(
                    Query.query(new Criteria("name").is(resources.getName())
                            .and("task").is(resources.getTask())
                            .and("userId").is(resources.getUserId())
                            .and("taskStatus").in(Constant.TASK_STATUS_NOT_STARTED, Constant.TASK_STATUS_IN_HAND, Constant.TASK_STATUS_TEST)), TaskUserMongo.class);
            if (cnt > 0) {
                throw new BadRequestException("已存在同名未完成的任务!");
            }
        long cnt = mongoTemplate.count(
                Query.query(new Criteria("name").is(resources.getName())
                        .and("task").is(resources.getTask())
                        .and("userId").is(resources.getUserId())
                        .and("taskStatus").in(Constant.TASK_STATUS_NOT_STARTED, Constant.TASK_STATUS_IN_HAND, Constant.TASK_STATUS_TEST)), TaskUserMongo.class);
        if (cnt > 0) {
            throw new BadRequestException("已存在同名未完成的任务!");
        }
            TaskMongo taskMongo = mongoTemplate.findById(resources.getTask().getId(), TaskMongo.class);
            TaskUserMongo taskUserMongo = taskUserMongoMapper.toEntity(resources);
            if (taskMongo != null) {
                taskUserMongo.setPerformanceType(taskMongo.getPerformanceType());
                taskUserMongo.setTask(taskMongo);
            }
            taskUserMongo.setName(resources.getName());
            taskUserMongo.setUserId(resources.getUserId());
            taskUserMongo.setTaskStartDate(resources.getTaskStartDate());
            taskUserMongo.setTaskEndDate(resources.getTaskEndDate());
            taskUserMongo.setTaskHours(resources.getTaskHours());
            taskUserMongo.setTaskStatus(resources.getTaskStatus());
            taskUserMongo.setPerformanceHours(resources.getTaskHours());
            taskUserMongo.setRid(resources.getRid());
        TaskMongo taskMongo = mongoTemplate.findById(resources.getTask().getId(), TaskMongo.class);
        if (taskMongo != null) {
            resources.setPerformanceType(taskMongo.getPerformanceType());
            resources.setTask(taskMongo);
        }
        resources.setName(resources.getName());
        resources.setUserId(resources.getUserId());
        resources.setTaskStartDate(resources.getTaskStartDate());
        resources.setTaskEndDate(resources.getTaskEndDate());
        resources.setTaskHours(resources.getTaskHours());
        resources.setTaskStatus(resources.getTaskStatus());
        resources.setPerformanceHours(resources.getTaskHours());
        resources.setRid(resources.getRid());
            taskUserMongo.setUid(resources.getUid());
        resources.setUid(resources.getUid());
            mongoTemplate.save(taskUserMongo);
        mongoTemplate.save(resources);
        if (resources.getUserId() != null) {
            // 发送给审批人企微
            List<String> weComList = new ArrayList<>();
            // 查询所属用户信息
            User user = userRepository.findById(resources.getUserId()).orElseGet(User::new);
            Project project = projectRepository.findById(resources.getTask().getProjectId()).orElseGet(Project::new);
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
            if (StringUtils.isNotBlank(user.getWeComId())) {
                weComList.add(user.getWeComId());
                weComService.sendNotice(weComList, "任务变更提醒", String.format("<div class=\"gray\">任务创建提示</div>" +
                                "<div class=\"normal\">项目:%s</div>" +
                                "<div class=\"normal\">任务:%s</div>" +
                                "<div class=\"normal\">任务区间:%s</div>" +
                                "<div class=\"highlight\">任务创建成功,请登录PMS系统查看。</div>",
                        project.getName(),
                        resources.getTask().getName() + "  > " + resources.getName(),
                        sdf.format(resources.getTaskStartDate()) + "~" + sdf.format(resources.getTaskEndDate())), Constant.WECOM_MESSAGE_TYPE_TEXTCARD);
            if (taskUserMongo.getUserId() != null) {
                // 发送给审批人企微
                List<String> weComList = new ArrayList<>();
                // 查询所属用户信息
                User user = userRepository.findById(taskUserMongo.getUserId()).orElseGet(User::new);
                Project project = projectRepository.findById(taskUserMongo.getTask().getProjectId()).orElseGet(Project::new);
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                if (StringUtils.isNotBlank(user.getWeComId())) {
                    weComList.add(user.getWeComId());
                    weComService.sendNotice(weComList, "任务变更提醒", String.format("<div class=\"gray\">任务创建提示</div>" +
                                    "<div class=\"normal\">项目:%s</div>" +
                                    "<div class=\"normal\">任务:%s</div>" +
                                    "<div class=\"normal\">任务区间:%s</div>" +
                                    "<div class=\"highlight\">任务创建成功,请登录PMS系统查看。</div>",
                            project.getName(),
                            taskUserMongo.getTask().getName() + "  > " + taskUserMongo.getName(),
                            sdf.format(taskUserMongo.getTaskStartDate()) + "~" + sdf.format(taskUserMongo.getTaskEndDate())), Constant.WECOM_MESSAGE_TYPE_TEXTCARD);
                }
            }
        }
    }
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/mapstruct/TaskUserMongoMapper.java
New file
@@ -0,0 +1,12 @@
package me.zhengjie.modules.task.service.mapstruct;
import me.zhengjie.base.BaseMapper;
import me.zhengjie.modules.task.domain.TaskUserMongo;
import me.zhengjie.modules.task.service.vo.TaskUserMongoVo;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface TaskUserMongoMapper extends BaseMapper<TaskUserMongoVo, TaskUserMongo> {
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/task/service/vo/TaskUserMongoVo.java
New file
@@ -0,0 +1,50 @@
package me.zhengjie.modules.task.service.vo;
import lombok.Data;
import me.zhengjie.modules.task.domain.TaskMongo;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Data
public class TaskUserMongoVo implements Serializable {
    private String id;
    private Long old_id;
    private TaskMongo task;
    private String name;
    private String performanceType;
    private Long userId;
    private Date taskStartDate;
    private Date taskEndDate;
    private String priority;
    private String uid;
    private Double taskHours = 0.0;
    private Double performanceHours = 0.0;
    private Double costHours = 0.0;
    private String taskStatus;
    private String remarks;
    private Double newTaskProgress = 0.0;
    private String rid;
    /**
     * 多用户id
     */
    private List<Long> userIds;
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/temp/Temp.java
@@ -10,6 +10,7 @@
import me.zhengjie.modules.project.domain.Project;
import me.zhengjie.modules.project.repository.ProjectRepository;
import me.zhengjie.modules.project.service.dto.ProjectQueryCriteria;
import me.zhengjie.modules.temp.service.WechatRobotService;
import me.zhengjie.modules.temp.service.WechatSendHistoryService;
import me.zhengjie.utils.QueryHelp;
import org.springframework.http.HttpStatus;
@@ -30,6 +31,7 @@
    private final ProjectRepository projectRepository;
    private final WechatSendHistoryService wechatSendHistoryService;
    private final WechatRobotService wechatRobotService;
    @AnonymousPutMapping(value = "/updateProjectLiableUserId")
    @Log("修改项目责任人ID")
@@ -65,4 +67,20 @@
        wechatSendHistoryService.handleApprovalCallback(msgSignature, timestamp, nonce, request, response);
        return new ResponseEntity<>(HttpStatus.OK);
    }
    @AnonymousGetMapping(value = "/wechat/robot/backUrl")
    @Log("企业微信智能机器人验证回调URL")
    @ApiOperation("企业微信智能机器人验证回调URL")
    public void robotBack(@RequestParam(value = "msg_signature") String msgSignature, @RequestParam(value = "timestamp") String timestamp,
                             @RequestParam(value = "nonce") String nonce, @RequestParam(value = "echostr") String echostr, HttpServletResponse response){
        wechatRobotService.robotBack(msgSignature, timestamp, nonce, echostr, response);
    }
    @AnonymousPostMapping(value = "/wechat/robot/backUrl")
    @Log("处理企业微信智能机器人回调事件")
    @ApiOperation("处理企业微信智能机器人回调事件")
    public ResponseEntity<Object> handleRobotCallback(@RequestParam(value = "msg_signature") String msgSignature, @RequestParam(value = "timestamp") String timestamp,
                                                         @RequestParam(value = "nonce") String nonce, HttpServletRequest request, HttpServletResponse response){
        return new ResponseEntity<>(wechatRobotService.handleRobotCallback(msgSignature, timestamp, nonce, request, response), HttpStatus.OK);
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/temp/service/WechatRobotService.java
New file
@@ -0,0 +1,29 @@
package me.zhengjie.modules.temp.service;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public interface WechatRobotService {
    /**
     * 企业微信智能机器人验证回调URL
     * @param msgSignature 企业微信加密签名
     * @param timestamp 时间戳
     * @param nonce 随机数
     * @param echostr 加密的字符串
     * @param response 响应
     * @return String
     */
    void robotBack(String msgSignature, String timestamp, String nonce, String echostr, HttpServletResponse response);
    /**
     * 处理企业微信智能机器人回调事件
     * @param msgSignature 企业微信加密签名
     * @param timestamp 时间戳
     * @param nonce 随机数
     * @param request 请求
     * @param response 响应
     * @return String
     */
    Object handleRobotCallback(String msgSignature, String timestamp, String nonce, HttpServletRequest request, HttpServletResponse response);
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/temp/service/impl/WechatRobotServiceImpl.java
New file
@@ -0,0 +1,105 @@
package me.zhengjie.modules.temp.service.impl;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import me.zhengjie.modules.temp.service.WechatRobotService;
import me.zhengjie.utils.weixin.AesException;
import me.zhengjie.utils.weixin.WXBizJsonMsgCrypt;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
@Service
@RequiredArgsConstructor
public class WechatRobotServiceImpl implements WechatRobotService {
    private final String CORP_ID = "";
    private final String TOKEN = "WTAgLRQif";
    private final String ENCODING_AES_KEY = "w2FEuoDg2D7DxnmJn4DL6YiD47OSHwB34WXVwa2eriY";
    private final String APPROVAL_AGENT_ID = "1000005";
    private final String ROBOT_ID = "aiboW1Wpr5Mg_9WNlzyBtIjtf-ETL6pTEFd";
    @Override
    public void robotBack(String msgSignature, String timestamp, String nonce, String echostr, HttpServletResponse response) {
        try {
            WXBizJsonMsgCrypt wxcpt = new WXBizJsonMsgCrypt(TOKEN, ENCODING_AES_KEY, CORP_ID);
            // 设置响应内容类型为纯文本
            response.setContentType("text/plain; charset=UTF-8");
            // 获取PrintWriter对象
            PrintWriter out = response.getWriter();
            // 直接返回
            String message = wxcpt.VerifyURL(msgSignature, timestamp, nonce, echostr);
            out.print(message);
            // 刷新并关闭PrintWriter
            out.flush();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    @Override
    public Object handleRobotCallback(String msgSignature, String timestamp, String nonce, HttpServletRequest request, HttpServletResponse response) {
        WXBizJsonMsgCrypt wxcpt = null;
        try {
            wxcpt = new WXBizJsonMsgCrypt(TOKEN, ENCODING_AES_KEY, CORP_ID);
            // 读取回调数据
            StringBuilder sb = new StringBuilder();
            BufferedReader reader = new BufferedReader(new InputStreamReader(request.getInputStream()));
            String line;
            while ((line = reader.readLine()) != null) {
                sb.append(line);
            }
            String callbackData = sb.toString();
            JSONObject jsonObject = JSONObject.parseObject(callbackData);
            String decryptedMessage = wxcpt.DecryptRobotMsg(msgSignature, timestamp, nonce, jsonObject.toString());
            System.out.println("接收到机器人发送的加密消息:" + jsonObject.toJSONString());
            System.out.println("接收到机器人发送的解密后消息:" + decryptedMessage);
            JSONObject decryptedMessageJson =  JSONObject.parseObject(decryptedMessage);
            System.out.println("接收到机器人发送的消息是否存在msgtype:" + decryptedMessageJson.containsKey("msgtype"));
            if (decryptedMessageJson.getString("msgtype").equals("text")) {
                System.out.println("接收到机器人发送的消息中的msgtype:" + decryptedMessageJson.getString("msgtype"));
                // 第一版
//                return wxcpt.EncryptRobotMsg("{\"msgtype\": \"text\",\"text\": {\"content\": \"消息已收到\"}}", "", nonce);
                // 第二版
//                return wxcpt.EncryptRobotJsonMsg("{\"msgtype\": \"text\",\"text\": {\"content\": \"消息已收到\"}}", "", nonce);
                // 第三版
//                JSONObject responseJson = wxcpt.EncryptRobotJsonMsg("{\"msgtype\": \"text\",\"text\": {\"content\": \"消息已收到\"}}", "", nonce);
//                // 设置HTTP响应头并返回JSON
//                response.setContentType("application/json;charset=utf-8");
//                PrintWriter out = response.getWriter();
//                out.print(responseJson.toJSONString());
//                out.flush();
//                out.close();
                // 第四版
                String replyPlainText = "{\"msgtype\": \"text\",\"text\": {\"content\": \"消息已收到\"}}";
                String finalResponseJson = wxcpt.EncryptRobotMsg(replyPlainText, timestamp, nonce);
                // 设置HTTP响应头并直接返回结果
                response.setContentType("application/json;charset=utf-8");
                PrintWriter out = response.getWriter();
                out.print(finalResponseJson);
                out.flush();
                out.close();
                return null;
            }
        } catch (Exception e) {
            e.printStackTrace();
            try {
                if (wxcpt != null) {
                    return wxcpt.EncryptRobotMsg("消息接收出现异常,请联系管理员处理 o(╥﹏╥o...)", "", nonce);
                }
            } catch (AesException aesException) {
                aesException.printStackTrace();
            }
        }
        return null;
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/temp/service/impl/WechatSendHistoryServiceImpl.java
@@ -241,7 +241,7 @@
     */
    private static void fixJsonStructure(JSONObject jsonObject) {
        // 定义需要确保为列表的字段名
        String[] listFields = {"ProcessList", "NodeList", "Details", "Notifyer", "SubNodeList", "SpRecord" };
        String[] listFields = {"ProcessList", "NodeList", "Details", "Notifyer", "SubNodeList", "SpRecord", "Comments" };
        for (String fieldName : listFields) {
            if (jsonObject.has(fieldName)) {
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/api/WxCpOaWeDocSmartsheetService.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/api/WxCpOaWeDocSmartsheetService.java
@@ -1,12 +1,12 @@
package me.zhengjie.weixin.cp.api;
package me.zhengjie.modules.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 me.zhengjie.modules.weixin.cp.bean.smartsheet.field.*;
import me.zhengjie.modules.weixin.cp.bean.smartsheet.record.*;
import me.zhengjie.modules.weixin.cp.bean.smartsheet.sheet.*;
import me.zhengjie.modules.weixin.cp.bean.smartsheet.view.*;
import java.util.List;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/api/impl/WxCpOaWeDocSmartsheetServiceImpl.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/api/impl/WxCpOaWeDocSmartsheetServiceImpl.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.api.impl;
package me.zhengjie.modules.weixin.cp.api.impl;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
@@ -8,12 +8,12 @@
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 me.zhengjie.modules.weixin.cp.api.WxCpOaWeDocSmartsheetService;
import me.zhengjie.modules.weixin.cp.bean.smartsheet.constant.WxCpSmartSheetApiPathConsts;
import me.zhengjie.modules.weixin.cp.bean.smartsheet.field.*;
import me.zhengjie.modules.weixin.cp.bean.smartsheet.record.*;
import me.zhengjie.modules.weixin.cp.bean.smartsheet.sheet.*;
import me.zhengjie.modules.weixin.cp.bean.smartsheet.view.*;
import org.springframework.stereotype.Component;
import java.util.List;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/constant/WxCpSmartSheetApiPathConsts.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/constant/WxCpSmartSheetApiPathConsts.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.constant;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.constant;
public interface WxCpSmartSheetApiPathConsts {
    interface Sheet {
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/AttachmentFieldProperty.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/AttachmentFieldProperty.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/AutoNumberFieldProperty.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/AutoNumberFieldProperty.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/CheckboxFieldProperty.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/CheckboxFieldProperty.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/CreatedTimeFieldProperty.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/CreatedTimeFieldProperty.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/CurrencyFieldProperty.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/CurrencyFieldProperty.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/DateTimeFieldProperty.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/DateTimeFieldProperty.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/Field.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/Field.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/FieldNumberRule.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/FieldNumberRule.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/FieldOption.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/FieldOption.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/LocationFieldProperty.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/LocationFieldProperty.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/ModifiedTimeFieldProperty.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/ModifiedTimeFieldProperty.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/NumberFieldProperty.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/NumberFieldProperty.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/PercentageFieldProperty.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/PercentageFieldProperty.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/ProgressFieldProperty.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/ProgressFieldProperty.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/ReferenceFieldProperty.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/ReferenceFieldProperty.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/SelectFieldProperty.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/SelectFieldProperty.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/SingleSelectFieldProperty.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/SingleSelectFieldProperty.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/UrlFieldProperty.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/UrlFieldProperty.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/UserFieldProperty.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/UserFieldProperty.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/WwGroupFieldProperty.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/WwGroupFieldProperty.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/WxCpFieldCreateData.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/WxCpFieldCreateData.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/WxCpFieldCreateRequest.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/WxCpFieldCreateRequest.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/WxCpFieldEditData.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/WxCpFieldEditData.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/WxCpFieldEditRequest.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/WxCpFieldEditRequest.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/WxCpFieldInfo.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/WxCpFieldInfo.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/field/WxCpFieldQueryRequest.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/field/WxCpFieldQueryRequest.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.field;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.field;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/Record.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/Record.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/RecordCellAttachmentValue.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordCellAttachmentValue.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/RecordCellImageValue.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordCellImageValue.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/RecordCellLocationValue.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordCellLocationValue.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/RecordCellTextValue.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordCellTextValue.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/RecordCellUrlValue.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordCellUrlValue.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/RecordCellUserValue.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordCellUserValue.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/RecordOption.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordOption.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/RecordSort.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/RecordSort.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/WxCpRecordCreateData.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/WxCpRecordCreateData.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/WxCpRecordCreateRequest.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/WxCpRecordCreateRequest.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/WxCpRecordEditData.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/WxCpRecordEditData.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/WxCpRecordEditRequest.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/WxCpRecordEditRequest.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/WxCpRecordInfo.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/WxCpRecordInfo.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/record/WxCpRecordQueryRequest.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/record/WxCpRecordQueryRequest.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.record;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.record;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/sheet/SheetProperties.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/sheet/SheetProperties.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.sheet;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.sheet;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/sheet/WxCpSheetCreateData.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/sheet/WxCpSheetCreateData.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.sheet;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.sheet;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/sheet/WxCpSheetCreateRequest.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/sheet/WxCpSheetCreateRequest.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.sheet;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.sheet;
import com.google.gson.annotations.SerializedName;
import lombok.*;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/sheet/WxCpSheetEditRequest.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/sheet/WxCpSheetEditRequest.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.sheet;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.sheet;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/sheet/WxCpSheetInfo.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/sheet/WxCpSheetInfo.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.sheet;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.sheet;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/sheet/WxCpSheetQueryRequest.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/sheet/WxCpSheetQueryRequest.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.sheet;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.sheet;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/View.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/View.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/ViewCondition.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/ViewCondition.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/ViewFilterSpec.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/ViewFilterSpec.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/ViewGroupSpec.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/ViewGroupSpec.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/ViewProperty.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/ViewProperty.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/ViewSortSpec.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/ViewSortSpec.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/ViewSpecInfo.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/ViewSpecInfo.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/WxCpViewCreateData.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/WxCpViewCreateData.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/WxCpViewCreateRequest.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/WxCpViewCreateRequest.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/WxCpViewEditRequest.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/WxCpViewEditRequest.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/WxCpViewInfo.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/WxCpViewInfo.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/weixin/cp/bean/smartsheet/view/WxCpViewQueryRequest.java
File was renamed from eladmin-master/eladmin-common/src/main/java/me/zhengjie/weixin/cp/bean/smartsheet/view/WxCpViewQueryRequest.java
@@ -1,4 +1,4 @@
package me.zhengjie.weixin.cp.bean.smartsheet.view;
package me.zhengjie.modules.weixin.cp.bean.smartsheet.view;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
eladmin-master/eladmin-system/src/main/java/me/zhengjie/utils/weixin/JsonParse.java
@@ -62,4 +62,35 @@
        return String.format(format, encrypt, signature, timestamp, nonce);
    }
    /**
     * 提取出 JSON 包中的加密消息(智能机器人)
     * @param jsontext 待提取的json字符串
     * @return 提取出的加密消息字符串
     * @throws AesException
     */
    public static Object[] extractRobot(String jsontext) throws AesException     {
        Object[] result = new Object[3];
        try {
            JSONObject json = new JSONObject(jsontext);
            String encrypt_msg = json.getString("encrypt");
//            System.out.println(json.toString());
//            String msgid = json.getString("msgid");
//            String aibotid = json.getString("aibotid");
//            String chatid = json.getString("chatid");
//            String chattype = json.getString("chattype");
//            JSONObject from = json.getJSONObject("from");
//            String userid = from.getString("userid");
//            String msgtype = json.getString("msgtype");
//            JSONObject text = json.getJSONObject("text");
//            String content = text.getString("content");
            result[0] = encrypt_msg;
            return result;
        } catch (Exception e) {
            e.printStackTrace();
            throw new AesException(AesException.ParseJsonError);
        }
    }
}
eladmin-master/eladmin-system/src/main/java/me/zhengjie/utils/weixin/WXBizJsonMsgCrypt.java
@@ -21,6 +21,7 @@
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.codec.binary.Base64;
/**
@@ -286,4 +287,109 @@
        return result;
    }
    /**
     * 将企业微信智能机器人回复用户的消息加密打包.
     * <ol>
     *     <li>对要发送的消息进行AES-CBC加密</li>
     *     <li>生成安全签名</li>
     *     <li>将消息密文和安全签名打包成json格式</li>
     * </ol>
     *
     * @param replyMsg 企业微信待回复用户的消息,json格式的字符串
     * @param timeStamp 时间戳,可以自己生成,也可以用URL参数的timestamp
     * @param nonce 随机串,可以自己生成,也可以用URL参数的nonce
     *
     * @return 加密后的可以直接回复用户的密文,包括msg_signature, timestamp, nonce, encrypt的json格式的字符串
     * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息
     */
    public String EncryptRobotMsg(String replyMsg, String timeStamp, String nonce) throws AesException {
        // 加密
        String encrypt = encrypt(getRandomStr(), replyMsg);
        // 生成安全签名
        if (timeStamp == "") {
            timeStamp = Long.toString(System.currentTimeMillis());
        }
        String signature = SHA1.getSHA1(token, timeStamp, nonce, encrypt);
        // System.out.println("发送给平台的签名是: " + signature[1].toString());
        // 生成发送的json'''
        String result = JsonParse.generate(encrypt, signature, timeStamp, nonce);
        return result;
    }
    /**
     * 将企业微信智能机器人回复用户的消息加密打包.
     * <ol>
     *     <li>对要发送的消息进行AES-CBC加密</li>
     *     <li>生成安全签名</li>
     *     <li>将消息密文和安全签名打包成json格式</li>
     * </ol>
     *
     * @param replyMsg 企业微信待回复用户的消息,json格式的字符串
     * @param timeStamp 时间戳,可以自己生成,也可以用URL参数的timestamp
     * @param nonce 随机串,可以自己生成,也可以用URL参数的nonce
     *
     * @return 加密后的可以直接回复用户的密文,包括msg_signature, timestamp, nonce, encrypt的json格式的字符串
     * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息
     */
    public JSONObject EncryptRobotJsonMsg(String replyMsg, String timeStamp, String nonce) throws AesException {
        // 加密
        String encrypt = encrypt(getRandomStr(), replyMsg);
        // 生成安全签名
        if (timeStamp == "") {
            timeStamp = Long.toString(System.currentTimeMillis());
        }
        String signature = SHA1.getSHA1(token, timeStamp, nonce, encrypt);
        // System.out.println("发送给平台的签名是: " + signature[1].toString());
        // 生成发送的json'''
        JSONObject json = new JSONObject();
        json.put("encrypt", encrypt);
        json.put("msg_signature", signature);
        json.put("timestamp", timeStamp);
        json.put("nonce", nonce);
        return json;
    }
    /**
     * 检验智能机器人消息的真实性,并且获取解密后的明文.
     * <ol>
     *     <li>利用收到的密文生成安全签名,进行签名验证</li>
     *     <li>若验证通过,则提取json中的加密消息</li>
     *     <li>对消息进行解密</li>
     * </ol>
     *
     * @param msgSignature 签名串,对应URL参数的msg_signature
     * @param timeStamp 时间戳,对应URL参数的timestamp
     * @param nonce 随机串,对应URL参数的nonce
     * @param postData 密文,对应POST请求的数据
     *
     * @return 解密后的原文
     * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息
     */
    public String DecryptRobotMsg(String msgSignature, String timeStamp, String nonce, String postData)
            throws AesException {
        // 密钥,公众账号的app secret
        // 提取密文
        Object[] encrypt = JsonParse.extractRobot(postData);
        // 验证安全签名
        String signature = SHA1.getSHA1(token, timeStamp, nonce, encrypt[0].toString());
        // 和URL中的签名比较是否相等
        // System.out.println("第三方收到URL中的签名:" + msg_sign);
        // System.out.println("第三方校验签名:" + signature);
        if (!signature.equals(msgSignature)) {
            throw new AesException(AesException.ValidateSignatureError);
        }
        // 解密
        String result = decrypt(encrypt[0].toString());
        return result;
    }
}
eladmin-master/eladmin-system/src/main/resources/config/application.yml
@@ -74,11 +74,11 @@
wx:
  cp:
    # 企业ID
    corp-id: wwc0fd49735bfcf0ad
    corp-id: ${CORP_ID:wwc0fd49735bfcf0ad}
    # 应用AgentId
    agent-id: 1000005
    agent-id: ${AGENT_ID:1000005}
    # 应用凭证
    corp-secret: nDCq9I6tSWAP-l2lbvgtK8_V5l1DpqFq88Gf67TK_-I
    corp-secret: ${CORP_SECRET:nDCq9I6tSWAP-l2lbvgtK8_V5l1DpqFq88Gf67TK_-I}
    config-storage:
      type: redistemplate
      redis:
eladmin-master/eladmin-system/src/test/java/me/zhengjie/EladminSystemApplicationTests.java
@@ -236,7 +236,7 @@
                Calculate calculate = new Calculate();
                calculate.setStart(attendanceDto.getActualWorkStartTime().toLocalDateTime());
                calculate.setEnd(attendanceDto.getActualWorkEndTime().toLocalDateTime());
                attendanceHours = BigDecimal.valueOf(attendanceService.calculateTimes(calculate, userId)).divide(BigDecimal.valueOf(1000), 2, RoundingMode.HALF_UP).doubleValue();
                attendanceHours = BigDecimal.valueOf(attendanceService.calculateTimes(calculate, userId, null)).divide(BigDecimal.valueOf(1000), 2, RoundingMode.HALF_UP).doubleValue();
            }
            if (totalConsumedHours > attendanceHours) {
eladmin-web-master/src/api/project/project.js
@@ -135,4 +135,12 @@
  })
}
export default { getAll, add, edit, del, editAdmit, editDisavow, getPartake, getRelevant, getProjectCost, getSubgroupTurnover, getSubgroupWorkingHours, getProjectWorkingHours, getTypeContractPrice, getTypeWorkingHours, getSubgroupTopHours, getRelevantOfDaily, generateReport }
export function downloadProjectProgress(params) {
  return request({
    url: 'api/project/downloadProgress' + '?' + qs.stringify(params, { indices: false }),
    method: 'get',
    responseType: 'blob'
  })
}
export default { getAll, add, edit, del, editAdmit, editDisavow, getPartake, getRelevant, getProjectCost, getSubgroupTurnover, getSubgroupWorkingHours, getProjectWorkingHours, getTypeContractPrice, getTypeWorkingHours, getSubgroupTopHours, getRelevantOfDaily, generateReport, downloadProjectProgress }
eladmin-web-master/src/api/task/task.js
@@ -140,4 +140,12 @@
  })
}
export default { getAll, getTags, getNames, getProjects, getChildren, add, edit, del, divide, getPartake, getProjectTotal, ChildrenTaskAnyParent, getAllOfDaily, getRelevantTaskUser, getTaskValidRange, getTaskCalendarInfo, getTastAll, changeStatus }
export function migration(data) {
  return request({
    url: 'api/task/migration',
    method: 'post',
    data
  })
}
export default { getAll, getTags, getNames, getProjects, getChildren, add, edit, del, divide, getPartake, getProjectTotal, ChildrenTaskAnyParent, getAllOfDaily, getRelevantTaskUser, getTaskValidRange, getTaskCalendarInfo, getTastAll, changeStatus, migration }
eladmin-web-master/src/api/task/taskUser.js
@@ -8,6 +8,14 @@
  })
}
export function getAllSimple(params) {
  return request({
    url: 'api/taskUser/allSimple',
    method: 'get',
    params
  })
}
export function getAdventTasks() {
  return request({
    url: 'api/taskUser/getAdventTasks',
@@ -148,4 +156,4 @@
  })
}
export default { getAll, add, edit, del, calcHours, getTaskUserIds, getSum, addTaskUser, getAdventTasks, getOngoingTasks, getTaskNotStarted, getAllTaskUser, changeStatus, getTaskUserDetail, getTaskDetail, getPerformanceg, getTaskUserAdvent, generate, exportUser }
export default { getAll, getAllSimple, add, edit, del, calcHours, getTaskUserIds, getSum, addTaskUser, getAdventTasks, getOngoingTasks, getTaskNotStarted, getAllTaskUser, changeStatus, getTaskUserDetail, getTaskDetail, getPerformanceg, getTaskUserAdvent, generate, exportUser }
eladmin-web-master/src/utils/constant.js
@@ -155,6 +155,8 @@
export const LEAVE_TYPE_BEREAVEMENT_LEAVE = 'leave_type_bereavement_leave'
// 请假状态:哺乳假
export const LEAVE_TYPE_LACTATION_LEAVE = 'leave_type_lactation_leave'
// 请假状态:调休假
export const LEAVE_TYPE_REPLACE = 'leave_type_replace'
// 请假审批状态
export const APPROVAL_STATUS = 'approval_status'
@@ -488,6 +490,7 @@
  LEAVE_TYPE_MARRIAGE_HOLIDAY,
  LEAVE_TYPE_BEREAVEMENT_LEAVE,
  LEAVE_TYPE_LACTATION_LEAVE,
  LEAVE_TYPE_REPLACE,
  APPROVAL_STATUS,
  APPROVAL_STATUS_UNDER_APPROVAL,
  APPROVAL_STATUS_PASSED,
eladmin-web-master/src/views/attendance/attendance/index.vue
@@ -300,6 +300,22 @@
      <!--外出表单-->
      <el-dialog :close-on-click-modal="false" :before-close="closeCard" :visible.sync="goOutVisible" :title="goOutTitle" width="500px">
        <el-form ref="goOutForm" :model="goOutForm" :rules="goOutRules" size="small" label-width="80px">
          <el-form-item label="审批者" prop="approvalUserId">
            <el-select
              v-model="goOutForm.approvalUserId"
              filterable
              clearable
              placeholder="请选择"
              style="width: 340px;"
            >
              <el-option
                v-for="item in users"
                :key="item.id"
                :label="item.nickName"
                :value="item.id"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="开始时间" prop="outStartTime">
            <el-date-picker
              v-model="goOutForm.outStartTime"
@@ -374,6 +390,22 @@
      <!--出差表单-->
      <el-dialog :close-on-click-modal="false" :before-close="closeCard" :visible.sync="bussVisible" :title="bussTitle" width="500px">
        <el-form ref="bussForm" :model="bussForm" :rules="bussRules" size="small" label-width="80px">
          <el-form-item label="审批者" prop="approvalUserId">
            <el-select
              v-model="bussForm.approvalUserId"
              filterable
              clearable
              placeholder="请选择"
              style="width: 340px;"
            >
              <el-option
                v-for="item in users"
                :key="item.id"
                :label="item.nickName"
                :value="item.id"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="开始日期" prop="travelStartTime">
            <el-date-picker
              v-model="bussForm.travelStartTime"
@@ -837,17 +869,9 @@
      if (data === 'goOut') {
        this.goOutVisible = true
        this.goOutForm.durationUnit = this.dictLeaveTimeTypeHour
        // 判断企微审核
        if (this.wecomApprovalVisible) {
          this.goOutForm.approvalUserId = 0
        }
      } else {
        this.bussVisible = true
        this.bussForm.durationUnit = this.dictLeaveTimeTypeDay
        // 判断企微审核
        if (this.wecomApprovalVisible) {
          this.bussForm.approvalUserId = 0
        }
      }
    },
    // 计算时长
eladmin-web-master/src/views/attendance/attendanceBusinessTravel/index.vue
@@ -827,13 +827,17 @@
    },
    // 计算时长
    checkTime() {
      var data = JSON.stringify({
        travelStartTime: this.form.travelStartTime,
        travelEndTime: this.form.travelEndTime
      })
      crudAttendanceBusinessTravel.getRemainingTime(data).then(res => {
        this.form.travelDuration = res
      })
      if (this.form.travelStartTime && this.form.travelEndTime) {
        var data = JSON.stringify({
          id: this.form.id,
          travelStartTime: this.form.travelStartTime,
          travelEndTime: this.form.travelEndTime,
          userId: this.form.userId
        })
        crudAttendanceBusinessTravel.getRemainingTime(data).then(res => {
          this.form.travelDuration = res
        })
      }
    },
    // 审批页面赋值
    toApprove(data, Number) {
eladmin-web-master/src/views/attendance/attendanceLeave/index.vue
@@ -134,7 +134,7 @@
          <el-form-item label="请假开始时间" prop="leaveStartTime">
            <el-date-picker
              v-model="form.leaveStartTime"
              :type="form.leaveType !== dictLeaveTypeAnnualLeave && form.leaveType !== 'leave_type_replace' && form.leaveType !== dictLeaveTypeCompassionateLeave ? 'date' : 'datetime'"
              :type="form.leaveType !== dictLeaveTypeAnnualLeave && form.leaveType !== dictLeaveTypeReplace && form.leaveType !== dictLeaveTypeCompassionateLeave && form.leaveType !== dictLeaveTypeLactationLeave ? 'date' : 'datetime'"
              placeholder="选择日期时间"
              style="width: 340px;"
              value-format="yyyy-MM-dd HH:mm:ss"
@@ -152,7 +152,7 @@
          <el-form-item label="请假结束时间" prop="leaveEndTime">
            <el-date-picker
              v-model="form.leaveEndTime"
              :type="form.leaveType !== dictLeaveTypeAnnualLeave && form.leaveType !== 'leave_type_replace' && form.leaveType !== dictLeaveTypeCompassionateLeave ? 'date' : 'datetime'"
              :type="form.leaveType !== dictLeaveTypeAnnualLeave && form.leaveType !== dictLeaveTypeReplace && form.leaveType !== dictLeaveTypeCompassionateLeave && form.leaveType !== dictLeaveTypeLactationLeave ? 'date' : 'datetime'"
              placeholder="选择日期时间"
              style="width: 340px;"
              value-format="yyyy-MM-dd HH:mm:ss"
@@ -391,6 +391,8 @@
      dictLeaveType: constant.LEAVE_TYPE,
      dictLeaveTypeAnnualLeave: constant.LEAVE_TYPE_ANNUAL_LEAVE,
      dictLeaveTypeCompassionateLeave: constant.LEAVE_TYPE_COMPASSIONATE_LEAVE,
      dictLeaveTypeReplace: constant.LEAVE_TYPE_REPLACE,
      dictLeaveTypeLactationLeave: constant.LEAVE_TYPE_LACTATION_LEAVE,
      dictApprovalStart: constant.APPROVAL_STATUS,
      dictAppRovalStatusUnderAppover: constant.APPROVAL_STATUS_UNDER_APPROVAL,
      dictAppRovalStatusPassed: constant.APPROVAL_STATUS_PASSED,
@@ -476,7 +478,7 @@
    },
    checkLeaveTime() {
      // 根据请假类型改变时间单位
      if (this.form.leaveType === this.dictLeaveTypeAnnualLeave || this.form.leaveType === this.dictLeaveTypeCompassionateLeave || this.form.leaveType === 'leave_type_replace') {
      if (this.form.leaveType === this.dictLeaveTypeAnnualLeave || this.form.leaveType === this.dictLeaveTypeCompassionateLeave || this.form.leaveType === this.dictLeaveTypeReplace || this.form.leaveType === this.dictLeaveTypeLactationLeave) {
        this.form.leaveDurationUnit = this.dictLeaveTimeTypeHour
      } else {
        this.form.leaveDurationUnit = this.dictLeaveTimeTypeDay
@@ -503,7 +505,7 @@
        if (this.form.leaveType === this.dictLeaveTypeAnnualLeave && this.yearTimeLenght < res.leaveDuration) {
          this.form.leaveDuration = null
          this.crud.notify('年假剩余时间不足', CRUD.NOTIFICATION_TYPE.ERROR)
        } else if (this.form.leaveType === 'leave_type_replace' && this.OverTimeLenght < res.leaveDuration) {
        } else if (this.form.leaveType === this.dictLeaveTypeReplace && this.OverTimeLenght < res.leaveDuration) {
          this.form.leaveDuration = null
          this.crud.notify('调休假剩余时间不足', CRUD.NOTIFICATION_TYPE.ERROR)
        } else {
eladmin-web-master/src/views/project/project/index.vue
@@ -122,6 +122,20 @@
        >
          报告生成
        </el-button>
        <el-button
          slot="right"
          v-permission="permission.download"
          class="filter-item"
          size="mini"
          type="primary"
          icon="el-icon-download"
          style="margin-left: 4px !important;"
          :loading="downloadProgressLoading"
          :disabled="crud.selections.length === 0"
          @click="doExportProjectProgress()"
        >
          项目进度导出
        </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">
@@ -433,6 +447,7 @@
import pagination from '@crud/Pagination'
import { mapGetters } from 'vuex'
import constant from '@/utils/constant'
import { downloadFile } from '@/utils/index'
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 {
@@ -551,7 +566,9 @@
      // 报告生成参数
      generateReportParam: {
        loading: false
      }
      },
      // 加载
      downloadProgressLoading: false
    }
  },
  computed: {
@@ -816,6 +833,21 @@
      }).catch(() => {
        that.$message({ type: 'info', message: '已取消操作' })
      })
    },
    // 执行项目进度导出
    doExportProjectProgress() {
      const that = this
      const projects = that.crud.selections.map(p => p.id)
      if (projects.length > 0) {
        that.downloadProgressLoading = true
        that.crud.crudMethod.downloadProjectProgress({ idInList: projects }).then(result => {
          downloadFile(result, '项目进度导出数据', 'xlsx')
        }).catch(e => {
          that.$message.error(e.message)
        }).finally(() => {
          that.downloadProgressLoading = false;
        })
      }
    }
  }
}
eladmin-web-master/src/views/project/projectReimburse/index.vue
@@ -13,6 +13,9 @@
        <el-select v-model="query.expenseType" filterable clearable placeholder="费用类型" style="width: 185px;">
          <el-option v-for="item in dict[dictReimburseExpenseType]" :key="item.value" :label="item.label" :value="item.value" />
        </el-select>
        <el-select v-model="query.userId" filterable clearable placeholder="申请人" style="width: 185px;">
          <el-option v-for="item in users" :key="item.id" :label="item.nickName" :value="item.id" />
        </el-select>
        <el-date-picker
          v-model="query.startTime"
          type="daterange"
@@ -375,7 +378,8 @@
      queryTypeOptions: [
        { key: 'projectId', display_name: '所属项目' },
        { key: 'reimburseType', display_name: '报销类型' },
        { key: 'expenseType', display_name: '费用类型' }
        { key: 'expenseType', display_name: '费用类型' },
        { key: 'userId', display_name: '申请人' }
      ],
      approveModal: {
        title: '报销审批',
eladmin-web-master/src/views/system/goalSetting/index.vue
@@ -18,8 +18,8 @@
      <!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
      <crudOperation :permission="permission" />
      <!--表单组件-->
      <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
        <el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
      <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="580px">
        <el-form ref="form" :model="form" :rules="rules" size="small" label-width="160px">
          <el-form-item label="目标年度" prop="targetYear">
            <el-date-picker v-model="form.targetYear" type="year" style="width: 370px;" />
          </el-form-item>
@@ -43,8 +43,23 @@
              />
            </el-select>
          </el-form-item>
          <el-form-item label="目标金额" prop="targetAmount">
          <el-form-item label="目标金额(全年)" prop="targetAmount">
            <money-input :key="random" v-model="form.targetAmount" :width="370" />
          </el-form-item>
          <el-form-item label="目标金额(一季度)" prop="firstTargetAmount">
            <money-input :key="random" v-model="form.firstTargetAmount" :width="370" />
          </el-form-item>
          <el-form-item label="目标金额(二季度)" prop="secondTargetAmount">
            <money-input :key="random" v-model="form.secondTargetAmount" :width="370" />
          </el-form-item>
          <el-form-item label="目标金额(三季度)" prop="thirdTargetAmount">
            <money-input :key="random" v-model="form.thirdTargetAmount" :width="370" />
          </el-form-item>
          <el-form-item label="目标金额(四季度)" prop="fourthTargetAmount">
            <money-input :key="random" v-model="form.fourthTargetAmount" :width="370" />
          </el-form-item>
          <el-form-item label="相关负责人" prop="leaderName">
            <el-input v-model="form.leaderName" style="width: 370px;" />
          </el-form-item>
          <el-form-item label="备注">
            <el-input v-model="form.remarks" :rows="3" type="textarea" style="width: 370px;" />
@@ -73,11 +88,32 @@
            {{ dict.label[standardUnitCurrency][standardUnitCurrencyRenminbi] }}
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="targetAmount" label="目标金额">
        <el-table-column :show-overflow-tooltip="true" prop="targetAmount" label="目标金额(全年)">
          <template slot-scope="scope">
            {{ crud.toMoney(scope.row.targetAmount) }}
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="firstTargetAmount" label="目标金额(一季度)">
          <template slot-scope="scope">
            {{ crud.toMoney(scope.row.firstTargetAmount) }}
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="secondTargetAmount" label="目标金额(二季度)">
          <template slot-scope="scope">
            {{ crud.toMoney(scope.row.secondTargetAmount) }}
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="thirdTargetAmount" label="目标金额(三季度)">
          <template slot-scope="scope">
            {{ crud.toMoney(scope.row.thirdTargetAmount) }}
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="fourthTargetAmount" label="目标金额(四季度)">
          <template slot-scope="scope">
            {{ crud.toMoney(scope.row.fourthTargetAmount) }}
          </template>
        </el-table-column>
        <el-table-column :show-overflow-tooltip="true" prop="leaderName" label="相关负责人" />
        <el-table-column :show-overflow-tooltip="true" prop="remarks" label="备注" />
        <el-table-column :show-overflow-tooltip="true" prop="createTime" label="创建时间" />
        <el-table-column v-if="checkPer(['admin','sysGoalSetting:edit','sysGoalSetting:del'])" label="操作" width="150px" align="center">
@@ -105,7 +141,7 @@
import constant from '../../../utils/constant'
import moneyInput from '../../assembly/moneyInput/index.vue'
const defaultForm = { id: null, targetYear: null, projectDistinguish: null, targetAmount: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null }
const defaultForm = { id: null, targetYear: null, projectDistinguish: null, targetAmount: null, firstTargetAmount: null, secondTargetAmount: null, thirdTargetAmount: null, fourthTargetAmount: null, leaderName: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null }
export default {
  name: 'SysGoalSetting',
  components: { pagination, crudOperation, rrOperation, udOperation, moneyInput },
@@ -138,8 +174,27 @@
          { required: true, message: '项目区分不能为空', trigger: 'change' }
        ],
        targetAmount: [
          { required: true, message: '目标金额不能为空', trigger: 'blur' },
          { required: true, message: '目标金额(全年)不能为空', trigger: 'blur' },
          { validator: amountValidate, trigger: 'blur' }
        ],
        firstTargetAmount: [
          { required: true, message: '目标金额(一季度)不能为空', trigger: 'blur' },
          { validator: amountValidate, trigger: 'blur' }
        ],
        secondTargetAmount: [
          { required: true, message: '目标金额(二季度)不能为空', trigger: 'blur' },
          { validator: amountValidate, trigger: 'blur' }
        ],
        thirdTargetAmount: [
          { required: true, message: '目标金额(三季度)不能为空', trigger: 'blur' },
          { validator: amountValidate, trigger: 'blur' }
        ],
        fourthTargetAmount: [
          { required: true, message: '目标金额(四季度)不能为空', trigger: 'blur' },
          { validator: amountValidate, trigger: 'blur' }
        ],
        leaderName: [
          { required: true, message: '相关负责人不能为空', trigger: 'blur' }
        ]
      },
      queryTypeOptions: [
eladmin-web-master/src/views/task/other/other.vue
@@ -23,8 +23,9 @@
          clearable
          placeholder="员工"
          :show-all-levels="false"
          style="width: 200px;"
          :collapse-tags="true"
          @change="changeUserList"
          class="cascader-item"
        />
        <el-select v-model="query.projectId" filterable clearable placeholder="所属项目" :loading="loadingProject" style="width: 185px; margin-top: 6px;" class="filter-item" @change="queryProjectChange" @clear="clearQueryTasks">
          <el-option
@@ -47,7 +48,7 @@
        <rrOperation :crud="crud" />
      </div>
      <!--表格渲染-->
      <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
      <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" :summary-method="getSummaries" show-summary @selection-change="crud.selectionChangeHandler">
        <el-table-column type="selection" width="55" />
        <el-table-column :show-overflow-tooltip="true" prop="fillDate" label="填写日期" fixed="left" min-width="100px">
          <template slot-scope="scope">
@@ -213,6 +214,31 @@
    clearQueryTasks() {
      this.loadingTask = false
    },
    // 表格工时汇总
    getSummaries(param) {
      const { columns, data } = param;
      const sums = [];
      sums[0] = '合计';
      columns.forEach((column, index) => {
        if(column.property === 'consumedHours') {
          const values = data.map(item => Number(item[column.property]));
          if (!values.every(value => isNaN(value))) {
            sums[index] = values.reduce((prev, curr) => {
            const value = Number(curr);
            if (!isNaN(value)) {
              return prev + curr;
            } else {
              return prev;
            }
          }, 0);
            sums[index] += ' 小时';
          } else {
            sums[index] = '';
          }
        }
      });
      return sums;
    }
  }
}
</script>
@@ -221,4 +247,27 @@
  adventTable tr:first-child {
    display: none;
  }
  .cascader-item >>> .el-input__inner {
    height: 29.5px !important;
    line-height: 29.5px !important;
  }
  .cascader-item >>> .el-cascader__search-input {
    height: 20px !important;
    margin: 2px 0px 0px 15px !important;
  }
  .cascader-item >>> .el-tag {
    margin-top: 4.5px;
  }
  .cascader-item >>> .el-input__suffix {
    height: 29.5px !important;
  }
  .cascader-item >>> .el-input--small {
    height: 29.5px !important;
  }
  .cascader-item >>> .el-cascader__tags {
    height: 29.5px !important;
  }
  .cascader-item >>> .el-input--small {
    height: 29.5px !important;
  }
</style>
eladmin-web-master/src/views/task/task/index.vue
@@ -100,7 +100,11 @@
          :disabled="this.crud.selections.length === 0"
          @click="doTaskCompleted"
        >任务完结</el-button>
        <el-button slot="right" v-permission="permission.migration" icon="el-icon-guide" class="filter-item" size="mini" type="primary" @click="toMigration">
          任务迁移
        </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">
        <el-form ref="form" :model="form" :rules="rules" size="small" label-width="110px">
@@ -230,6 +234,90 @@
          <el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
        </div>
      </el-dialog>
      <!--任务迁移表单-->
      <el-dialog :close-on-click-modal="false" :before-close="closeMigration" :visible.sync="migrationParams.visible" title="任务迁移" width="960px">
        <el-form ref="migrationForm" :model="migrationParams.form" :rules="migrationParams.rules" size="small" label-width="80px">
          <el-row :gutter="0">
            <el-col :span="11" class="part-form-box">
              <div class="part-form-title">迁移来源</div>
              <!-- <el-row :gutter="0"> -->
              <el-col :span="22">
                <el-form-item label="迁移层级" prop="sourceLevel" required>
                  <el-radio-group v-model="migrationParams.form.sourceLevel" @input="sourceLevelChange">
                    <el-radio label="project" disabled>
                      <span>项目</span>
                    </el-radio>
                    <el-radio label="task">
                      <span>任务</span>
                    </el-radio>
                    <el-radio label="taskUser">
                      <span>分配任务</span>
                    </el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item label="所属项目" prop="sourceProjectId" required>
                  <el-select v-model="migrationParams.form.sourceProjectId" filterable clearable placeholder="请先选择所属项目" style="width: 300px;" @change="sourceProjectChange">
                    <el-option v-for="item in projects" :key="item.id" :label="item.name" :value="item.id" />
                  </el-select>
                </el-form-item>
                <el-form-item v-show="migrationParams.sourceTaskList.length > 0" label="所属任务" prop="sourceTaskId" :required="migrationParams.form.sourceLevel === 'task' || migrationParams.form.sourceLevel === 'taskUser'">
                  <el-select v-model="migrationParams.form.sourceTaskId" filterable clearable placeholder="请先选择所属任务" style="width: 300px;" @change="sourceTaskChange">
                    <el-option v-for="item in migrationParams.sourceTaskList" :key="item.id" :label="item.name" :value="item.id" />
                  </el-select>
                </el-form-item>
                <el-form-item v-show="migrationParams.sourceTaskUserList.length > 0" label="分配任务" prop="sourceTaskUserId" :required="migrationParams.form.sourceLevel === 'taskUser'">
                  <el-select v-model="migrationParams.form.sourceTaskUserId" multiple filterable clearable placeholder="请先选择分配任务" style="width: 300px;">
                    <el-option v-for="item in migrationParams.sourceTaskUserList" :key="item.id" :label="item.name" :value="item.id" />
                  </el-select>
                </el-form-item>
              </el-col>
              <!-- </el-row> -->
            </el-col>
            <el-col :span="2">
              <div style="text-align: center; line-height: 70px;">
                <i class="el-icon-d-arrow-right" style="font-size: 36px;" />
              </div>
            </el-col>
            <el-col :span="11" class="part-form-box">
              <div class="part-form-title">迁移目标</div>
              <el-col :span="22">
                <el-form-item label="迁移层级" prop="targetLevel" required>
                  <el-radio-group v-model="migrationParams.form.targetLevel" disabled>
                    <el-radio label="project">
                      <span>项目</span>
                    </el-radio>
                    <el-radio label="task">
                      <span>任务</span>
                    </el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item label="所属项目" prop="targetProjectId" required>
                  <el-select v-model="migrationParams.form.targetProjectId" filterable clearable placeholder="请先选择所属项目" style="width: 300px;" @change="targetProjectChange">
                    <el-option v-for="item in projects" :key="item.id" :label="item.name" :value="item.id" />
                  </el-select>
                </el-form-item>
                <el-form-item v-show="migrationParams.targetTaskList.length > 0" label="所属任务" prop="targetTaskId" :required="migrationParams.form.targetLevel === 'task'">
                  <el-select v-model="migrationParams.form.targetTaskId" filterable clearable placeholder="请先选择所属任务" style="width: 300px;">
                    <el-option v-for="item in migrationParams.targetTaskList" :key="item.id" :label="item.name" :value="item.id" />
                  </el-select>
                </el-form-item>
              </el-col>
            </el-col>
          </el-row>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button type="text" @click="closeMigration">取消</el-button>
          <el-button :loading="migrationParams.loading" type="primary" @click="doMigration">确认</el-button>
        </div>
      </el-dialog>
      <!--表格渲染-->
      <el-table
        ref="table"
@@ -295,6 +383,7 @@
<script>
import crudTask from '@/api/task/task'
import crudTaskUser from '@/api/task/taskUser'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
@@ -329,6 +418,29 @@
        callback()
      }
    }
    var migrationValidate = (rule, value, callback) => {
      const that = this
      if (rule.field === 'sourceTaskId' && (that.migrationParams.form.sourceLevel === 'task' || that.migrationParams.form.sourceLevel === 'taskUser')) {
        if (value == null || value === '' || value === undefined) {
          callback(new Error('所属任务不能为空'))
        } else if (that.migrationParams.form.sourceLevel === 'task' && that.migrationParams.form.sourceProjectId === that.migrationParams.form.targetProjectId) {
          callback(new Error('所属任务已属于迁移目标所属项目'))
        }
      }
      if (rule.field === 'sourceTaskUserId' && that.migrationParams.form.sourceLevel === 'taskUser') {
        if (value == null || value === undefined || (value.length !== undefined && value.length === 0)) {
          callback(new Error('分配任务不能为空'))
        } else if (that.migrationParams.form.sourceTaskId === that.migrationParams.form.targetTaskId) {
          callback(new Error('分配任务已属于迁移目标所属任务'))
        }
      }
      if (rule.field === 'targetTaskId' && that.migrationParams.form.targetLevel === 'task') {
        if (value == null || value === '' || value === undefined) {
          callback(new Error('所属任务不能为空'))
        }
      }
      callback()
    }
    return {
      props: { multiple: true },
      permission: {
@@ -338,7 +450,8 @@
        download: ['admin', 'task:download'],
        divide: ['admin', 'task:divide'],
        seeDivide: ['admin', 'task:seeDivide'],
        seeDaliy: ['admin', 'task:seeDaliy']
        seeDaliy: ['admin', 'task:seeDaliy'],
        migration: ['admin', 'task:migration']
      },
      rules: {
        name: [
@@ -515,7 +628,33 @@
      dialogVisible: false,
      taskDetailDisabled: true,
      calendarLoading: true,
      isShow: false
      isShow: false,
      // 任务迁移参数
      migrationParams: {
        visible: false,
        loading: false,
        form: {
          sourceProjectId: null,
          sourceTaskId: null,
          sourceTaskUserId: [],
          sourceLevel: 'taskUser',
          targetProjectId: null,
          targetTaskId: null,
          targetLevel: 'task'
        },
        sourceTaskList: [],
        targetTaskList: [],
        sourceTaskUserList: [],
        rules: {
          sourceProjectId: [{ required: true, message: '所属项目不能为空', trigger: 'change' }],
          sourceTaskId: [{ validator: migrationValidate, trigger: 'change' }],
          sourceTaskUserId: [{ validator: migrationValidate, trigger: 'change' }],
          sourceLevel: [{ required: true, message: '迁移来源类别不能为空', trigger: 'change' }],
          targetProjectId: [{ required: true, message: '所属项目不能为空', trigger: 'change' }],
          targetTaskId: [{ validator: migrationValidate, trigger: 'change' }],
          targetLevel: [{ required: true, message: '迁移目标类别不能为空', trigger: 'change' }]
        }
      }
    }
  },
  computed: {
@@ -837,6 +976,116 @@
    },
    draw() {
      this.dialogVisible = true
    },
    // 开启任务迁移
    toMigration() {
      const that = this
      that.$set(that.migrationParams, 'visible', true)
    },
    // 关闭任务迁移
    closeMigration() {
      const that = this
      that.$refs.migrationForm.clearValidate()
      that.$set(that.migrationParams, 'loading', false)
      that.$set(that.migrationParams, 'visible', false)
      that.$set(that.migrationParams, 'form', {
        sourceProjectId: null,
        sourceTaskId: null,
        sourceTaskUserId: [],
        sourceLevel: 'taskUser',
        targetProjectId: null,
        targetTaskId: null,
        targetLevel: 'task'
      })
      that.$set(that.migrationParams, 'sourceTaskList', [])
      that.$set(that.migrationParams, 'targetTaskList', [])
      that.$set(that.migrationParams, 'sourceTaskUserList', [])
    },
    // 执行任务迁移
    doMigration() {
      const that = this
      that.$refs.migrationForm.validate((valid) => {
        if (!valid) {
          return
        }
        // 构建访问参数
        that.$set(that.migrationParams, 'loading', true)
        const data = {}
        if (that.migrationParams.form.sourceLevel === 'task' && that.migrationParams.form.targetLevel === 'project') {
          that.$set(data, 'sourceTaskId', that.migrationParams.form.sourceTaskId)
          that.$set(data, 'targetProjectId', that.migrationParams.form.targetProjectId)
        }
        if (that.migrationParams.form.sourceLevel === 'taskUser' && that.migrationParams.form.targetLevel === 'task') {
          that.$set(data, 'sourceTaskUserId', that.migrationParams.form.sourceTaskUserId)
          that.$set(data, 'targetTaskId', that.migrationParams.form.targetTaskId)
        }
        // 执行迁移API
        that.crud.crudMethod.migration(data).then(() => {
          that.$message({ type: 'success', message: '迁移成功' })
          that.closeMigration()
        }).catch(() => {
          that.$set(that.migrationParams, 'loading', false)
        })
      })
    },
    // 获取来源任务
    sourceProjectChange(projectId) {
      const that = this
      that.$set(that.migrationParams, 'sourceTaskList', [])
      that.$set(that.migrationParams.form, 'sourceTaskId', null)
      that.getSecondTask(that.migrationParams, 'sourceTaskList', projectId)
    },
    // 获取目标任务
    targetProjectChange(projectId) {
      const that = this
      that.$set(that.migrationParams, 'targetTaskList', [])
      that.$set(that.migrationParams.form, 'targetTaskId', null)
      that.getSecondTask(that.migrationParams, 'targetTaskList', projectId)
    },
    // 获取二级任务
    getSecondTask(target, key, projectId) {
      const that = this
      if (projectId) {
        const params = { isTop: true, projectId: projectId, sort: 'id,desc' }
        crudTask.ChildrenTaskAnyParent(params).then(res => {
          that.$set(target, key, res)
        }).catch(() => {
          that.$set(target, key, [])
        })
      } else {
        that.$set(target, key, [])
      }
    },
    // 获取来源任务分配
    sourceTaskChange(taskId) {
      const that = this
      that.$set(that.migrationParams, 'sourceTaskUserList', [])
      that.$set(that.migrationParams.form, 'sourceTaskUserId', [])
      crudTaskUser.getAllSimple({ taskId }).then(res => {
        that.$set(that.migrationParams, 'sourceTaskUserList', res)
      }).catch(() => {
        that.$set(that.migrationParams, 'sourceTaskUserList', [])
      })
    },
    // 迁移层级变更
    sourceLevelChange(level) {
      const that = this
      if (level === 'task') {
        that.$set(that.migrationParams.form, 'targetLevel', 'project')
      } else if (level === 'taskUser') {
        that.$set(that.migrationParams.form, 'targetLevel', 'task')
      }
    }
  }
}
@@ -863,10 +1112,22 @@
    display: inline-block;
    vertical-align: middle;
    margin: 0 3px 10px 0;
  }
  .block input {
    height: 30.5px;
    line-height: 30.5px;
  }
      input {
      height: 30.5px;
      line-height: 30.5px;
      }
    }
  .part-form-box {
    border: 1px solid #dcdfe6;
    border-radius: 10px;
  }
  .part-form-title {
    font-size: 16px;
    font-weight: 700;
    color: #606266;
    line-height: 52px;
    text-align: center;
  }
</style>
eladmin-web-master/src/views/task/taskDaliy/index.vue
@@ -174,7 +174,7 @@
          </el-form-item>
          <el-form-item label="所属项目" prop="projectId">
            <el-input v-if="crud.status.edit > 0" v-model="form.projectName" style="width: 340px;" :disabled="true" />
            <el-select v-else-if="queryProjects.length > 0" :key="form.projectId" v-model="form.projectId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="form.flag" @change="formProjectChange">
            <el-select v-else-if="queryProjects.length > 0" v-model="form.projectId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="form.flag" @change="formProjectChange">
              <template v-if="loadingQueryProjectsOne" #prefix>
                <i class="el-icon-loading" />
              </template>
@@ -187,7 +187,7 @@
                />
              </template>
            </el-select>
            <el-select v-else v-model="form" filterable clearable :placeholder="loadingQueryProjectsOne ? '加载中' : '请选择'" style="width: 340px;" :disabled="form.flag" @change="formProjectChange">
            <el-select v-else v-model="form.projectId" filterable clearable :placeholder="loadingQueryProjectsOne ? '加载中' : '请选择'" style="width: 340px;" :disabled="form.flag" @change="formProjectChange">
              <template v-if="loadingQueryProjectsOne" #prefix>
                <i class="el-icon-loading" />
              </template>
@@ -203,7 +203,7 @@
          </el-form-item>
          <el-form-item label="所属任务" prop="taskId">
            <el-input v-if="form.taskName" v-model="form.taskName" style="width: 340px;" :disabled="true" />
            <el-select v-else-if="formTasks.length > 0" :key="form.taskId" v-model="form.taskId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="form.flag" @change="formTaskChange">
            <el-select v-else-if="formTasks.length > 0" v-model="form.taskId" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="form.flag" @change="formTaskChange">
              <template v-if="loadingQueryProjects" #prefix>
                <i class="el-icon-loading" />
              </template>
@@ -216,7 +216,7 @@
                />
              </template>
            </el-select>
            <el-select v-else v-model="form" filterable clearable :placeholder="loadingQueryProjects ? '加载中' : '请选择'" style="width: 340px;" :disabled="form.flag" @change="formTaskUserChange">
            <el-select v-else v-model="form.taskId" filterable clearable :placeholder="loadingQueryProjects ? '加载中' : '请选择'" style="width: 340px;" :disabled="form.flag" @change="formTaskChange">
              <template v-if="loadingQueryProjects" #prefix>
                <i class="el-icon-loading" />
              </template>
@@ -232,7 +232,7 @@
          </el-form-item>
          <el-form-item label="分配任务" prop="taskUserMongo">
            <el-input v-if="form.taskUserMongo && form.taskUserMongo.name" v-model="form.taskUserMongo.name" style="width: 340px;" :disabled="true" />
            <el-select v-else-if="formTaskUserIds.length > 0" :key="form.taskUserMongo.id" v-model="form.taskUserMongo.id" :allow-create="true" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="form.flag" @change="formTaskUserChange">
            <el-select v-else-if="formTaskUserIds.length > 0" v-model="form.taskUserMongo.id" :allow-create="true" filterable clearable placeholder="请选择" style="width: 340px;" :disabled="form.flag" @change="formTaskUserChange">
              <template v-if="loadingQueryProjectsTwo" #prefix>
                <i class="el-icon-loading" />
              </template>
@@ -245,7 +245,7 @@
                />
              </template>
            </el-select>
            <el-select v-else v-model="form" filterable clearable :placeholder="loadingQueryProjectsTwo ? '加载中' : '请选择'" style="width: 340px;" :disabled="form.flag" @change="formTaskUserChange">
            <el-select v-else v-model="form.taskUserMongo.id" filterable clearable :placeholder="loadingQueryProjectsTwo ? '加载中' : '请选择'" style="width: 340px;" :disabled="form.flag" @change="formTaskUserChange">
              <template v-if="loadingQueryProjectsTwo" #prefix>
                <i class="el-icon-loading" />
              </template>
@@ -294,7 +294,7 @@
        </div>
      </el-dialog>
      <!--表单组件-->
      <!--统计数据表单-->
      <el-dialog :close-on-click-modal="false" :visible.sync="centerDialogVisibleStatistics" title="统计数据" width="800px">
        <el-table v-loading="statisticsLoading" :data="statisticsData" size="small" style="width: 100%;">
          <el-table-column :show-overflow-tooltip="true" prop="projectName" label="项目名称" fixed="left" min-width="100px" />
@@ -1048,7 +1048,7 @@
    // 表单任务变更
    formTaskChange(cb) {
      this.formTaskUserIds = []
      this.form.taskUserMongo.id = null
      this.form.taskUserMongo = {}
      this.loadingQueryProjectsTwo = true
      // 循环表单任务列表
      for (let i = 0; i < this.formTasks.length; i++) {
@@ -1081,6 +1081,8 @@
      // this.form.taskProgress = 0
      this.form.alreadyConsumedHours = 0
      this.form.taskHours = 0
      let defaultTaskUser = null
      // 循环表单任务列表
      for (let i = 0; i < this.formTaskUserIds.length; i++) {
        // 判断是否为选中任务
@@ -1088,10 +1090,11 @@
          this.form.taskHours = this.formTaskUserIds[i].performanceHours
          this.form.alreadyConsumedHours = this.formTaskUserIds[i].alreadyConsumedHours
          this.tempValue = this.formTaskUserIds[i].alreadyConsumedHours
          defaultTaskUser = this.formTaskUserIds[i]
        }
      }
      this.getTaskProgress(this.form.taskUserMongo.id)
      this.getTaskProgress(this.form.taskUserMongo.id, defaultTaskUser)
    },
    quickFilling(object) {
      this.currentTask = object
@@ -1107,7 +1110,14 @@
      // this.form.taskUserMongo = object.taskUserMongo
      this.crud.toAdd()
    },
    getTaskProgress(id) {
    getTaskProgress(id, defaultTaskUser) {
      // 附加默认值(防止任务可选日期范围溢出)
      if (defaultTaskUser) {
        this.form.taskUserMongo.id = defaultTaskUser.id
        this.form.taskUserMongo.taskStartDate = defaultTaskUser.taskStartDate
        this.form.taskUserMongo.taskEndDate = defaultTaskUser.taskEndDate
        this.form.taskUserMongo.performanceType = defaultTaskUser.performanceType
      }
      // 任务更改查询任务进度
      crudTaskDaliy.getDailyTaskProgress({ taskUserId: id }).then(res => {
        if (res !== '') {
eladmin-web-master/src/views/task/taskUser/index.vue
@@ -248,6 +248,15 @@
                :value="item.id"
              />
            </el-select>
            <el-input
              v-model="query.name"
              clearable
              placeholder="请输入任务名称"
              prefix-icon="el-icon-search"
              style="width: 185px;"
              class="filter-item"
              @keyup.enter.native="crud.toQuery"
            />
            <el-select
              v-model="query.taskStatus"
              filterable
@@ -403,7 +412,7 @@
            <el-form-item v-show="form.rid !== null" label="复核对象" prop="rname">
              <el-input v-model="form.rname" disabled style="width: 340px;" />
            </el-form-item>
            <el-form-item label="任务名称">
            <el-form-item label="任务名称" prop="name">
              <el-input v-model="form.name" style="width: 340px;" />
            </el-form-item>
            <el-form-item label="任务开始时间" prop="taskStartDate">
@@ -445,14 +454,19 @@
                >小时</template>
              </el-input>
            </el-form-item>
            <el-form-item label="所属员工" prop="userId">
            <el-form-item v-if="crud.status.add === 1" label="选择类型" prop="selectType">
              <el-radio-group v-model="form.selectType" style="width: 340px;" @change="handleTypeChange">
                <el-radio-button label="single">单选</el-radio-button>
                <el-radio-button label="multiple">多选</el-radio-button>
              </el-radio-group>
            </el-form-item>
            <el-form-item v-show="form.selectType === 'single'" label="所属员工" prop="userId">
              <el-select
                v-model="form.userId"
                filterable
                clearable
                placeholder="请选择"
                style="width: 340px;"
                :disabled="form.start"
                @change="withUser(form)"
              >
                <el-option
@@ -471,6 +485,33 @@
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item v-show="form.selectType === 'multiple'" label="所属员工" prop="userIds">
              <el-select
                v-model="form.userIds"
                filterable
                clearable
                multiple
                placeholder="请选择"
                style="width: 340px;"
                @change="withUser(form)"
              >
                <el-option
                  v-for="item in users"
                  :key="item.id"
                  :label="item.nickName"
                  :value="item.id"
                  :disabled="
                    !item.enabled || form.divideUserIds.includes(item.id)
                  "
                >
                  <span style="float: left">{{ item.nickName }}</span>
                  <span style="float: right; color: #8492a6; font-size: 13px">{{
                    item.levelName
                  }}</span>
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="绩效工时" prop="performanceHours">
              <el-input
                v-model="form.performanceHours"
@@ -730,7 +771,11 @@
  is_ok: null,
  uid: null,
  rid: null,
  rname: null
  rname: null,
  // 多选用户id
  userIds: [],
  // 用于新增用户时单选或多选
  selectType: 'single'
}
export default {
  name: 'TaskUser',
@@ -787,6 +832,9 @@
        generate: ['admin', 'taskUser:add']
      },
      rules: {
        name: [
          { required: true, message: '任务名称不能为空', trigger: 'change' }
        ],
        taskStartDate: [
          { required: true, message: '任务开始时间不能为空', trigger: 'change' }
        ],
@@ -800,7 +848,8 @@
      queryTypeOptions: [
        { key: 'userId', display_name: '所属员工' },
        { key: 'taskStatus', display_name: '任务状态' },
        { key: 'createTime', display_name: '创建时间' }
        { key: 'createTime', display_name: '创建时间' },
        { key: 'name', display_name: '名称' }
      ],
      // 字典:任务状态
      taskStatus: constant.TASK_STATUS,
@@ -890,7 +939,6 @@
      this.formTasks = []
      this.form.name = null
      this.form.performanceHours = null
      this.form.start = false
    },
    // 新建之前
    [CRUD.HOOK.beforeToAdd]() {
@@ -917,13 +965,11 @@
      this.formTasks = []
      this.form.name = null
      this.form.performanceHours = null
      this.form.start = false
    },
    [CRUD.HOOK.afterEditCancel]() {
      this.formTasks = []
      this.form.name = null
      this.form.performanceHours = null
      this.form.start = false
    },
    // 取消新建之前
    [CRUD.HOOK.beforeAddCancel]() {
@@ -936,7 +982,6 @@
      this.formTasks = []
      this.form.name = null
      this.form.performanceHours = null
      this.form.start = false
    },
    // 提交之后
    [CRUD.HOOK.afterSubmit]() {
@@ -949,7 +994,6 @@
      this.formTasks = []
      this.form.name = null
      this.form.performanceHours = null
      this.form.start = false
    },
    [CRUD.HOOK.beforeToCU]() {
      this.form.task.id = this.query.taskId
@@ -1178,70 +1222,107 @@
          隔绝列8,
          ...newItem
        } = item
        if ('任务开始时间' in newItem) {
        // 判断日期格式是否正确,如果不正确,则提示错误信息,并覆盖数据为false
        if ('任务开始时间' in newItem && Number.isFinite(newItem['任务开始时间'])) {
          newItem['任务开始时间'] = formatExcelDate(newItem['任务开始时间'])
        } else {
          this.$message.warning('第' + (this.generateForm.indexOf(item) + 1) + '项的任务开始时间格式不正确')
          return false
        }
        if ('任务结束时间' in newItem) {
        if ('任务结束时间' in newItem && Number.isFinite(newItem['任务结束时间'])) {
          newItem['任务结束时间'] = formatExcelDate(newItem['任务结束时间'])
        } else {
          this.$message.warning('第' + (this.generateForm.indexOf(item) + 1) + '项的任务结束时间格式不正确')
          return false
        }
        return newItem
      })
      // 表头数据转换
      this.generateFormTwo = transformData(results)
      for (let i = 0; i < this.generateFormTwo.length; i++) {
        const item = this.generateFormTwo[i]
        if (!item.name) {
          this.$message({
            message: `第${i + 1}项的名称为空`,
            type: 'warning'
          })
          this.generateFormTwo = []
          this.generateForm = []
          return false
      if (this.generateForm.includes(false)) {
        // 存在异常数据,清空表单数据
        this.generateForm = []
        return false
      } else {
        // 表头数据转换
        this.generateFormTwo = transformData(results)
        for (let i = 0; i < this.generateFormTwo.length; i++) {
          const item = this.generateFormTwo[i]
          if (!item.name) {
            this.$message({
              message: `第${i + 1}项的名称为空`,
              type: 'warning'
            })
            this.generateFormTwo = []
            this.generateForm = []
            return false
          }
          if (!item.taskStartDate) {
            this.$message({
              message: `第${i + 1}项的任务开始时间为空`,
              type: 'warning'
            })
            this.generateFormTwo = []
            this.generateForm = []
            return false
          }
          if (!item.taskEndDate) {
            this.$message({
              message: `第${i + 1}项的任务结束时间为空`,
              type: 'warning'
            })
            this.generateFormTwo = []
            this.generateForm = []
            return false
          }
          if (!item.taskHours) {
            this.$message({
              message: `第${i + 1}项的任务工时为空`,
              type: 'warning'
            })
            this.generateFormTwo = []
            this.generateForm = []
            return false
          }
          if (!item.taskStatus) {
            this.$message({
              message: `第${i + 1}项的任务状态为空`,
              type: 'warning'
            })
            this.generateFormTwo = []
            this.generateForm = []
            return false
          }
          // 状态转换
          if (item.taskStatus === '未开始') {
            item.taskStatus = constant.TASK_STATUS_NOT_STARTED
          } else if (item.taskStatus === '进行中') {
            item.taskStatus = constant.TASK_STATUS_IN_HAND
          } else if (item.taskStatus === '待测试') {
            item.taskStatus = constant.TASK_STATUS_TEST
          } else if (item.taskStatus === '已暂停') {
            item.taskStatus = constant.TASK_STATUS_STOP
          } else if (item.taskStatus === '未承认') {
            item.taskStatus = constant.TASK_STATUS_UNRECOGNIZED
          } else if (item.taskStatus === '已完成') {
            item.taskStatus = constant.TASK_STATUS_COMPLETED
          }
          if (item.taskStartDate > item.taskEndDate) {
            this.$message({
              message: `第${i + 1}项的任务开始时间大于任务结束时间`,
              type: 'warning'
            })
            this.generateFormTwo = []
            this.generateForm = []
            return false
          }
        }
        if (!item.taskStartDate) {
          this.$message({
            message: `第${i + 1}项的任务开始时间为空`,
            type: 'warning'
          })
          this.generateFormTwo = []
          this.generateForm = []
          return false
        }
        if (!item.taskEndDate) {
          this.$message({
            message: `第${i + 1}项的任务结束时间为空`,
            type: 'warning'
          })
          this.generateFormTwo = []
          this.generateForm = []
          return false
        }
        if (!item.taskHours) {
          this.$message({
            message: `第${i + 1}项的任务工时为空`,
            type: 'warning'
          })
          this.generateFormTwo = []
          this.generateForm = []
          return false
        }
        if (!item.taskStatus) {
          this.$message({
            message: `第${i + 1}项的任务状态为空`,
            type: 'warning'
          })
          this.generateFormTwo = []
          this.generateForm = []
          return false
        }
        this.tableHeader = header.filter(
          item =>
            item !== '所属员工ID' && item !== '任务状态ID' && item !== '优先度ID' && item !== '隔绝列1' &&
            item !== '隔绝列2' && item !== '隔绝列3' && item !== '隔绝列4' && item !== '隔绝列5' && item !== '隔绝列6' &&
            item !== '隔绝列7' && item !== '隔绝列8'
        )
      }
      this.tableHeader = header.filter(
        item =>
          item !== '所属员工ID' && item !== '任务状态ID' && item !== '优先度ID' && item !== '隔绝列1' &&
          item !== '隔绝列2' && item !== '隔绝列3' && item !== '隔绝列4' && item !== '隔绝列5' && item !== '隔绝列6' &&
          item !== '隔绝列7' && item !== '隔绝列8'
      )
    },
    // 生成表单打开
    openGenerate() {
@@ -1418,6 +1499,12 @@
      } else {
        that.$message.warning('复核任务下不可创建复核任务')
      }
    },
    // 切换类型时清空之前的选择
    handleTypeChange() {
      const that = this
      that.$set(that.form, 'userId', null)
      that.$set(that.form, 'userIds', [])
    }
  }
}