Explorar el Código

履职未完成的任务生成空的PDF, 问题整改 待整改、已逾期分开查询

zhulu hace 1 año
padre
commit
5a47c97371
Se han modificado 22 ficheros con 395 adiciones y 81 borrados
  1. 2 0
      project_data/sql/0.0.6/quartz/quartz.sql
  2. 11 0
      project_data/sql/0.0.6/soc/soc.sql
  3. 3 0
      soc-api/soc-api-system/src/main/java/com/xunmei/system/api/RemoteWeatherTaskService.java
  4. 5 0
      soc-api/soc-api-system/src/main/java/com/xunmei/system/api/factory/RemoteWeatherFallbackFactory.java
  5. 3 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/dto/web/WebSyntheticQuestionDto.java
  6. 6 4
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/service/impl/CockpitServiceImpl.java
  7. 6 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/vo/web/QuestionStatisticVo.java
  8. 6 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/QuestionReformEnum.java
  9. 4 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/service/impl/AppQuestionServiceImpl.java
  10. 10 2
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/service/impl/QuestionReformServiceImpl.java
  11. 4 3
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/controller/ResumptionController.java
  12. 4 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/mapper/ResumptionMapper.java
  13. 3 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/IResumptionRecordService.java
  14. 136 40
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppPlanServiceImpl.java
  15. 83 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/ResumptionRecordServiceImpl.java
  16. 5 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/ResumptionServiceImpl.java
  17. 4 4
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/CoreSafetyTaskServiceImpl.java
  18. 5 2
      soc-modules/soc-modules-core/src/main/resources/mapper/board/CockpitMapper.xml
  19. 65 17
      soc-modules/soc-modules-core/src/main/resources/mapper/question/QuestionMapper.xml
  20. 16 2
      soc-modules/soc-modules-core/src/main/resources/mapper/resumption/ResumptionMapper.xml
  21. 4 4
      soc-modules/soc-modules-file/src/main/java/com/xunmei/file/utils/PdfUtil.java
  22. 10 0
      soc-modules/soc-modules-job/src/main/java/com/xunmei/job/task/WeatherTask.java

+ 2 - 0
project_data/sql/0.0.6/quartz/quartz.sql

@@ -0,0 +1,2 @@
+-- 每天更新履职任务状态 调整为没小时执行一次,解决营业前、中、后的任务 到时间后任务状态变为已逾期的问题
+UPDATE `sys_job` SET `cron_expression` = '0 0 * * * ?' WHERE `job_name` = '每天更新履职任务状态';

+ 11 - 0
project_data/sql/0.0.6/soc/soc.sql

@@ -41,3 +41,14 @@ DELETE FROM `sys_dict_data` WHERE `dict_type`='drill_task_rec_status' AND `dict_
 INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (6, '不推荐(保留普通案例)', '6', 'drill_task_rec_status', NULL, 'default', 'N', '0', '超级管理员', '2024-01-24 16:29:52', '超级管理员', '2024-01-24 16:42:49', NULL);
 INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (7, '不推荐(保留行社优秀案例)', '7', 'drill_task_rec_status', NULL, 'default', 'N', '0', '超级管理员', '2024-01-24 16:30:53', '超级管理员', '2024-01-24 16:42:56', NULL);
 INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (8, '不推荐(保留地区优秀案例)', '8', 'drill_task_rec_status', NULL, 'default', 'N', '0', '超级管理员', '2024-01-24 16:36:35', '超级管理员', '2024-01-24 16:43:02', NULL);
+
+DELETE FROM `sys_dict_data` WHERE `dict_type`='app_question_status' AND `dict_label` = '逾期整改';
+INSERT INTO `sys_dict_data` ( `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (12, '逾期整改', '13', 'app_question_status', NULL, 'default', 'N', '0', '超级管理员', '2024-01-29 10:21:47', '', NULL, NULL);
+
+DELETE FROM `sys_dict_data` WHERE `dict_type`='question_reform_status' AND `dict_label` = '逾期整改';
+INSERT INTO `sys_dict_data` (`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2, '逾期整改', '13', 'question_reform_status', NULL, 'default', 'N', '0', '超级管理员', '2024-01-29 11:12:41', '超级管理员', '2024-01-29 11:12:53', NULL);
+
+-- 刷新隐患问题状态 已关闭只待办 异议提出的已关闭
+UPDATE core_question set confirm_status =2 WHERE confirm_status =3 AND reform_status =11;
+
+

+ 3 - 0
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/RemoteWeatherTaskService.java

@@ -22,4 +22,7 @@ public interface RemoteWeatherTaskService {
     @GetMapping("/weatherWarning/getDataFromApi")
     AjaxResult getDataFromApi(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
 
+    @GetMapping("/weatherWarning/getDataFromAliyun")
+    AjaxResult getDataFromAliyun(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
+
 }

+ 5 - 0
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/factory/RemoteWeatherFallbackFactory.java

@@ -22,6 +22,11 @@ public class RemoteWeatherFallbackFactory implements FallbackFactory<RemoteWeath
             public AjaxResult getDataFromApi(String source) {
                 return AjaxResult.error();
             }
+
+            @Override
+            public AjaxResult getDataFromAliyun(String source) {
+                return AjaxResult.error();
+            }
         };
     }
 }

+ 3 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/dto/web/WebSyntheticQuestionDto.java

@@ -22,6 +22,9 @@ public class WebSyntheticQuestionDto {
     @ApiModelProperty("已整改")
     private int reformedCount;
 
+    @ApiModelProperty("逾期整改")
+    private int overDueReformedCount;
+
     @ApiModelProperty("已逾期")
     private int overdueCount;
 }

+ 6 - 4
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/service/impl/CockpitServiceImpl.java

@@ -257,13 +257,15 @@ public class CockpitServiceImpl implements CockpitService {
 //        Map<String, Object> overdueCount = cockpitMapper.selectOverDueQuestionCount(org.getPath(), range.getStartTime(), range.getEndTime());
 
         QuestionStatisticVo vo = new QuestionStatisticVo();
-        vo.setTotal(questionDto.getTotal());
+        int reformTotal=questionDto.getTotal()-questionDto.getUnconfirmedCount()- questionDto.getDissentCount()-questionDto.getClosedCount();
+        vo.setTotal(reformTotal);
         vo.setUnconfirm(NumberUtils.computeRate(questionDto.getTotal(), questionDto.getUnconfirmedCount()));
         vo.setDissent(NumberUtils.computeRate(questionDto.getTotal(), questionDto.getDissentCount()));
         vo.setClosed(NumberUtils.computeRate(questionDto.getTotal(), questionDto.getClosedCount()));
-        vo.setUnreform(NumberUtils.computeRate(questionDto.getTotal(), questionDto.getWaitReformCount()));
-        vo.setReformed(NumberUtils.computeRate(questionDto.getTotal(), questionDto.getReformedCount()));
-        vo.setOverdue(NumberUtils.computeRate(questionDto.getTotal(), questionDto.getOverdueCount()));
+        vo.setUnreform(NumberUtils.computeRate(reformTotal, questionDto.getWaitReformCount()));
+        vo.setReformed(NumberUtils.computeRate(reformTotal, questionDto.getReformedCount()));
+        vo.setOverdueReformed(NumberUtils.computeRate(reformTotal, questionDto.getOverDueReformedCount()));
+        vo.setOverdue(NumberUtils.computeRate(reformTotal, questionDto.getOverdueCount()));
 //        if (overdueCount.size() == 2) {
 //            Long count = (Long) overdueCount.get("count");
 //            BigDecimal overdue = (BigDecimal) overdueCount.get("overdueCount");

+ 6 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/vo/web/QuestionStatisticVo.java

@@ -29,6 +29,12 @@ public class QuestionStatisticVo {
      * 已整改
      */
     private float reformed;
+
+    /**
+     * 逾期整改
+     */
+    private float overdueReformed;
+
     /**
      * 已逾期
      */

+ 6 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/QuestionReformEnum.java

@@ -6,7 +6,12 @@ public enum QuestionReformEnum {
     /**
      * 已逾期
      */
-    OverDue(12);
+    OverDue(12),
+
+    /**
+     * 逾期整改
+     */
+    OverReformed(13);
 
     private final Integer value;
 

+ 4 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/service/impl/AppQuestionServiceImpl.java

@@ -85,7 +85,10 @@ public class AppQuestionServiceImpl extends ServiceImpl<QuestionMapper, Question
         //获取数据
         page = baseMapper.pageApp(page, query, DateUtil.beginOfDay(new Date()));
         page.getRecords().forEach(r -> {
-            if (ObjectUtil.notEqual(r.getConfirmStatus(), QuestionConfirmEnum.Closed.getValue()) &&
+            if ((ObjectUtil.notEqual(r.getConfirmStatus(), QuestionConfirmEnum.Closed.getValue()) &&
+                ObjectUtil.notEqual(r.getReformStatus(), QuestionReformEnum.Reformed.getValue()) &&
+                ObjectUtil.notEqual(r.getReformStatus(), QuestionReformEnum.OverReformed.getValue()))
+                    &&
                     r.getReformDeadline().before(DateUtil.beginOfDay(new Date()))) {
                 //任务未结束并且过了整改结束日期
                 r.setOverdueStatus(QuestionReformEnum.OverDue.getValue());

+ 10 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/service/impl/QuestionReformServiceImpl.java

@@ -160,8 +160,16 @@ public class QuestionReformServiceImpl extends ServiceImpl<QuestionMapper, Quest
 
         LambdaUpdateWrapper<Question> updateWrapper = new LambdaUpdateWrapper();
         updateWrapper.eq(Question::getId, reformDto.getId());
-        updateWrapper.set(Question::getReformStatus, QuestionReformEnum.Reformed.getValue())
-                .set(Question::getConfirmStatus, QuestionConfirmEnum.Closed.getValue());
+//        updateWrapper.set(Question::getReformStatus, QuestionReformEnum.Reformed.getValue());
+//                .set(Question::getConfirmStatus, QuestionConfirmEnum.Closed.getValue());
+
+        if (question.getReformDeadline().before(DateUtil.beginOfDay(new Date()))) {
+            updateWrapper.set(Question::getReformStatus, QuestionReformEnum.OverReformed.getValue());
+        }
+        else
+        {
+            updateWrapper.set(Question::getReformStatus, QuestionReformEnum.Reformed.getValue());
+        }
 
         QuestionFlow flow = new QuestionFlow();
         flow.setQuestionId(reformDto.getId());

+ 4 - 3
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/controller/ResumptionController.java

@@ -95,13 +95,14 @@ public class ResumptionController {
                 } else if (r.getStatus() == 4) {
                     all.getDay().get("3").add(r);
                 } else {
-                    if (DateUtil.beginOfDay(request.getDateTime()).compareTo(DateUtil.beginOfDay(r.getPlanStartTime())) == 0) {
+//                    if (DateUtil.beginOfDay(request.getDateTime()).compareTo(DateUtil.beginOfDay(r.getPlanStartTime())) == 0) {
                         //未开始和进行中视为待完成
 //                        if (r.getStatus() == 1 || r.getStatus() == 2) {
-                        all.getDay().get("1").add(r);
+                    if (DateUtil.date().compareTo(r.getPlanEndTime())>0) {
+                        all.getDay().get("3").add(r);
 //                        }
                     } else {
-                        all.getDay().get("3").add(r);
+                        all.getDay().get("1").add(r);
                     }
                 }
                 //当前时间等于开始时间

+ 4 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/mapper/ResumptionMapper.java

@@ -96,6 +96,10 @@ public interface ResumptionMapper extends BaseMapper<Resumption> {
 
     List<Resumption> selectBySubmitTimeAndPlanType(@Param("date") Date date, @Param("planType") List<Integer> planType, @Param("orgId") Long orgId);
 
+    List<Resumption> selectByEndDateAndPlanType(@Param("startDate") Date startDate,@Param("endDate") Date endDate, @Param("planType") List<Integer> planType, @Param("orgId") Long orgId);
+
+
+
     void batchInsertResumptionData(@Param("list") List<AppResumptionData> list);
 
     void batchInsertResumptionQuestion(@Param("list") List<Question> list);

+ 3 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/IResumptionRecordService.java

@@ -5,6 +5,7 @@ import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.core.resumption.dto.resumptionRecord.ResumptionNFCDto;
 import com.xunmei.core.resumption.dto.resumptionRecord.ResumptionRecordPageDto;
 import com.xunmei.core.resumption.dto.resumptionRecord.ResumptionRoleDto;
+import com.xunmei.core.resumption.vo.resumptionRecord.AppResumptionDataInfoVo;
 import com.xunmei.core.resumption.vo.resumptionRecord.NFCRecordVo;
 import com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordItemVo;
 import com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordVo;
@@ -26,6 +27,8 @@ public interface IResumptionRecordService {
 
     ResumptionRecordVo selectInfo(Long resumptionId);
 
+    List<AppResumptionDataInfoVo> getResumptionDataById(Long resumptionId,Integer status,Long planId,Long orgId);
+
     List<IdNameVo> selectResumptionRole(ResumptionRoleDto roleDto);
 
     List<NFCRecordVo> selectNFCRecord(ResumptionNFCDto dto);

+ 136 - 40
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppPlanServiceImpl.java

@@ -35,6 +35,7 @@ import com.xunmei.common.security.utils.SecurityUtils;
 import com.xunmei.core.question.QuestionSrcType;
 import com.xunmei.core.question.domain.Question;
 import com.xunmei.core.question.service.IQuestionService;
+import com.xunmei.core.registerbook.mapper.CoreRegisterBookPdfMapper;
 import com.xunmei.core.registerbook.service.ICoreRegisterBookPdfService;
 import com.xunmei.core.resumption.domain.*;
 import com.xunmei.core.resumption.dto.DistributeDto;
@@ -68,6 +69,8 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
+import java.time.LocalDate;
 import java.util.*;
 import java.util.concurrent.CompletableFuture;
 import java.util.stream.Collectors;
@@ -116,6 +119,11 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
     @Autowired
     private RemoteOrgService remoteOrgService;
 
+    @Autowired
+    private CoreRegisterBookPdfMapper coreRegisterBookPdfMapper;
+
+
+
     @Override
     public List<Long> selectItemIdsByPlanId(Long id) {
         return appPlanToItemMapper.selectItemIdsByPlanId(id);
@@ -1094,15 +1102,30 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
                 throw new SystemException(ErrorMsgConstants.GENERATE_PDF_ERROR);
             }*/
             String pdfUrl = r.getData();
-            CoreRegisterBookPdf registerBookPdf = new CoreRegisterBookPdf();
-            registerBookPdf.setId(IdWorker.getId());
-            registerBookPdf.setRegisterBookType(RegisterBookType.ON_DUTY_USER.getNum());
-            registerBookPdf.setDate(date);
-            registerBookPdf.setOrgId(orgId);
-            registerBookPdf.setOrgName(sysOrg.getShortName());
-            registerBookPdf.setOrgPath(sysOrg.getPath());
-            registerBookPdf.setFileUrl(pdfUrl);
-            registerBookPdf.setFileName(fileName);
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            String dateStr = sdf.format(date);
+            LambdaQueryWrapper<CoreRegisterBookPdf> wrapper = new LambdaQueryWrapper<>();
+            wrapper.eq(CoreRegisterBookPdf::getOrgId,orgId)
+                    .eq(CoreRegisterBookPdf::getDate,dateStr)
+                    .eq(CoreRegisterBookPdf::getRegisterBookType,RegisterBookType.ON_DUTY_USER.getNum())
+                    .like(CoreRegisterBookPdf::getFileName,sysOrg.getName() + "_" + RegisterBookType.ON_DUTY_USER.getText() + "_");
+            CoreRegisterBookPdf registerBookPdf = coreRegisterBookPdfMapper.selectOne(wrapper);
+            if(ObjectUtil.isEmpty(registerBookPdf))
+            {
+                registerBookPdf = new CoreRegisterBookPdf();
+                registerBookPdf.setId(IdWorker.getId());
+                registerBookPdf.setRegisterBookType(RegisterBookType.ON_DUTY_USER.getNum());
+                registerBookPdf.setDate(date);
+                registerBookPdf.setOrgId(orgId);
+                registerBookPdf.setOrgName(sysOrg.getShortName());
+                registerBookPdf.setOrgPath(sysOrg.getPath());
+                registerBookPdf.setFileUrl(pdfUrl);
+                registerBookPdf.setFileName(fileName);
+            }
+            else{
+                registerBookPdf.setFileUrl(pdfUrl);
+                registerBookPdf.setFileName(fileName);
+            }
             if (StringUtils.isEmpty(registerBookPdf.getFileName()) || StringUtils.isEmpty(pdfUrl)) {
                 throw new SystemException(ErrorMsgConstants.GENERATE_PDF_ERROR);
             }
@@ -1136,16 +1159,32 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
             if (ObjectUtil.isNull(id)) {
                 throw new SystemException(ErrorMsgConstants.GENERATE_PDF_ERROR);
             }*/
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            String dateStr = sdf.format(date);
+
             String pdfUrl = r.getData();
-            CoreRegisterBookPdf registerBookPdf = new CoreRegisterBookPdf();
-            registerBookPdf.setId(IdWorker.getId());
-            registerBookPdf.setRegisterBookType(RegisterBookType.SECURITY_PERFORMANCE.getNum());
-            registerBookPdf.setDate(date);
-            registerBookPdf.setOrgId(orgId);
-            registerBookPdf.setOrgName(sysOrg.getShortName());
-            registerBookPdf.setOrgPath(sysOrg.getPath());
-            registerBookPdf.setFileUrl(pdfUrl);
-            registerBookPdf.setFileName(fileName);
+            LambdaQueryWrapper<CoreRegisterBookPdf> wrapper = new LambdaQueryWrapper<>();
+            wrapper.eq(CoreRegisterBookPdf::getOrgId,orgId)
+                    .eq(CoreRegisterBookPdf::getDate, dateStr)
+                    .eq(CoreRegisterBookPdf::getRegisterBookType,RegisterBookType.SECURITY_PERFORMANCE.getNum())
+                    .like(CoreRegisterBookPdf::getFileName,sysOrg.getName() + "_" + RegisterBookType.SECURITY_PERFORMANCE.getText() + "_");
+            CoreRegisterBookPdf registerBookPdf = coreRegisterBookPdfMapper.selectOne(wrapper);
+            if(ObjectUtil.isEmpty(registerBookPdf))
+            {
+                registerBookPdf = new CoreRegisterBookPdf();
+                registerBookPdf.setId(IdWorker.getId());
+                registerBookPdf.setRegisterBookType(RegisterBookType.SECURITY_PERFORMANCE.getNum());
+                registerBookPdf.setDate(date);
+                registerBookPdf.setOrgId(orgId);
+                registerBookPdf.setOrgName(sysOrg.getShortName());
+                registerBookPdf.setOrgPath(sysOrg.getPath());
+                registerBookPdf.setFileUrl(pdfUrl);
+                registerBookPdf.setFileName(fileName);
+            }
+            else{
+                registerBookPdf.setFileUrl(pdfUrl);
+                registerBookPdf.setFileName(fileName);
+            }
             if (StringUtils.isEmpty(registerBookPdf.getFileName()) || StringUtils.isEmpty(pdfUrl)) {
                 throw new SystemException(ErrorMsgConstants.GENERATE_PDF_ERROR);
             }
@@ -1158,8 +1197,8 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
     public void buildPdf(Date date) {
 
         List<Resumption> resumptions = resumptionMapper.selectList(new LambdaQueryWrapper<Resumption>()
-                .like(Resumption::getSubmitTime, DateUtils.toLocalDate(date))
-                .eq(Resumption::getStatus, 3)
+                .like(Resumption::getYmdDate, DateUtils.toLocalDate(date))
+//                .eq(Resumption::getStatus, 3)
                 .select(Resumption::getOrgId));
         List<Long> orgIds = resumptions.stream().map(Resumption::getOrgId).distinct().collect(Collectors.toList());
         for (Long orgId : orgIds) {
@@ -1201,15 +1240,31 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
                     throw new SystemException(ErrorMsgConstants.GENERATE_PDF_ERROR);
                 }*/
                 String pdfUrl = r.getData();
-                CoreRegisterBookPdf registerBookPdf = new CoreRegisterBookPdf();
-                registerBookPdf.setId(IdWorker.getId());
-                registerBookPdf.setRegisterBookType(RegisterBookType.getEnums((Integer) data.get("planType")).getNum());
-                registerBookPdf.setDate(date);
-                registerBookPdf.setOrgId(orgId);
-                registerBookPdf.setOrgName(sysOrg.getShortName());
-                registerBookPdf.setOrgPath(sysOrg.getPath());
-                registerBookPdf.setFileUrl(pdfUrl);
-                registerBookPdf.setFileName(data.get("fileName").toString());
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+                String dateStr = sdf.format(date);
+                LambdaQueryWrapper<CoreRegisterBookPdf> wrapper = new LambdaQueryWrapper<>();
+                wrapper.eq(CoreRegisterBookPdf::getOrgId,orgId)
+                        .eq(CoreRegisterBookPdf::getDate,dateStr)
+                        .eq(CoreRegisterBookPdf::getRegisterBookType,RegisterBookType.getEnums((Integer) data.get("planType")).getNum())
+                        .like(CoreRegisterBookPdf::getFileName,sysOrg.getName() + "_" + RegisterBookType.getEnums((Integer) data.get("planType")).getText() + "_");
+                CoreRegisterBookPdf registerBookPdf = coreRegisterBookPdfMapper.selectOne(wrapper);
+                if(ObjectUtil.isEmpty(registerBookPdf))
+                {
+                    registerBookPdf = new CoreRegisterBookPdf();
+                    registerBookPdf.setId(IdWorker.getId());
+                    registerBookPdf.setRegisterBookType(RegisterBookType.getEnums((Integer) data.get("planType")).getNum());
+                    registerBookPdf.setDate(date);
+                    registerBookPdf.setOrgId(orgId);
+                    registerBookPdf.setOrgName(sysOrg.getShortName());
+                    registerBookPdf.setOrgPath(sysOrg.getPath());
+                    registerBookPdf.setFileUrl(pdfUrl);
+                    registerBookPdf.setFileName(data.get("fileName").toString());
+                }
+                else{
+                    registerBookPdf.setFileUrl(pdfUrl);
+                    registerBookPdf.setFileName(data.get("fileName").toString());
+                }
+
                 if (StringUtils.isEmpty(registerBookPdf.getFileName()) || StringUtils.isEmpty(pdfUrl)) {
                     throw new SystemException(ErrorMsgConstants.GENERATE_PDF_ERROR);
                 }
@@ -1223,6 +1278,12 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
     private List<Map<String, Object>> getFtlResumptionAllDay(SysOrg sysOrg, Date date) {
         //查询执行时刻为全天的的履职数据
         List<Resumption> allDayDataList = resumptionMapper.selectBySubmitTimeAndPlanType(date, Arrays.asList(4, 5, 6), sysOrg.getId());
+        // 获取未完成且任务结束时间在当天
+        List<Resumption> dataList2 = resumptionMapper.selectByEndDateAndPlanType(DateUtil.beginOfDay(date),DateUtil.endOfDay(date), Arrays.asList(4, 5, 6), sysOrg.getId());
+        if(dataList2.size()>0)
+        {
+            allDayDataList.addAll(dataList2);
+        }
         //全天的的履职数据需要生成三种登记簿,所以还需要跟根据任务类型来分组 // 4:“110”入侵报警系统测试 5:不间断电源(UPS)维护 6:离行式自助银行巡检
         final Map<Integer, List<Resumption>> listMap = allDayDataList.stream().filter(res -> Arrays.asList(4, 5, 6).contains(res.getPlanType())).collect(Collectors.groupingBy(Resumption::getPlanType));
         List<Map<String, Object>> maps = new ArrayList<>();
@@ -1233,8 +1294,13 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
             List<AppResumptionDataInfoVo> allDayInfo = getItems(allDayDataList);
             Map<Long, List<AppResumptionDataInfoVo>> afterf = allDayInfo.stream().collect(Collectors.groupingBy(AppResumptionDataInfoVo::getItemId));
             data.put(DictUtils.getDictLabel(DictConstants.RESUMPTION_PLAN_EXEC, 1), getResult(afterf));
+            String tempSubmitNames=  allDayDataList.stream().map(Resumption::getSubmitorName).distinct().collect(Collectors.joining(","));
+            if("null".equals(tempSubmitNames))
+            {
+                tempSubmitNames=StringUtils.EMPTY;
+            }
             // 提交人
-            data.put("submiterNames", allDayDataList.stream().map(Resumption::getSubmitorName).distinct().collect(Collectors.joining(",")));
+            data.put("submiterNames", tempSubmitNames);
             // 获取任务相关问题
             data.put("questions", getListQuestionPdfVo(allDayDataList.stream().map(Resumption::getId).collect(Collectors.toList())));
             data.put("title", RegisterBookType.getEnums(planType).getText());
@@ -1249,12 +1315,24 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
 
     private Map<String, Object> getFtlResumptionNotWorkTime(Long orgId, Date date) {
         Map<String, Object> data = new HashMap<>();
+        // 获取当天提交已完成的履职任务
         List<Resumption> dataList = resumptionMapper.selectBySubmitTimeAndPlanType(date, Arrays.asList(7), orgId);
+        // 获取未完成且任务结束时间在当天
+        List<Resumption> dataList2 = resumptionMapper.selectByEndDateAndPlanType(DateUtil.beginOfDay(date),DateUtil.endOfDay(date), Arrays.asList(7), orgId);
+        if(dataList2.size()>0)
+        {
+            dataList.addAll(dataList2);
+        }
         List<AppResumptionDataInfoVo> notWorkTimeInfo = getItems(dataList);
         Map<Long, List<AppResumptionDataInfoVo>> afterf = notWorkTimeInfo.stream().collect(Collectors.groupingBy(AppResumptionDataInfoVo::getItemId));
         data.put(DictUtils.getDictLabel(DictConstants.RESUMPTION_PLAN_EXEC, 5), getResult(afterf));
+        String tempSubmitNames= dataList.stream().map(Resumption::getSubmitorName).distinct().collect(Collectors.joining(","));
+        if("null".equals(tempSubmitNames))
+        {
+            tempSubmitNames=StringUtils.EMPTY;
+        }
         // 提交人
-        data.put("submiterNames", dataList.stream().map(Resumption::getSubmitorName).distinct().collect(Collectors.joining(",")));
+        data.put("submiterNames", tempSubmitNames);
         // 获取任务相关问题
         data.put("questions", getListQuestionPdfVo(dataList.stream().map(Resumption::getId).collect(Collectors.toList())));
         return data;
@@ -1299,7 +1377,12 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
         submiterNames.addAll(ing.stream().map(x -> x.getSubmitorName()).collect(Collectors.toList()));
         submiterNames.addAll(after.stream().map(x -> x.getSubmitorName()).collect(Collectors.toList()));
         submiterNames = submiterNames.stream().distinct().collect(Collectors.toList());
-        data.put("submiterNames", String.join(",", submiterNames));
+        String tempSubmitNames= String.join(",", submiterNames);
+        if("null".equals(tempSubmitNames))
+        {
+            tempSubmitNames=StringUtils.EMPTY;
+        }
+        data.put("submiterNames", tempSubmitNames);
         // 获取任务相关问题
         List<Long> taskIds = before.stream().map(x -> x.getId()).collect(Collectors.toList());
         taskIds.addAll(ing.stream().map(x -> x.getId()).collect(Collectors.toList()));
@@ -1311,11 +1394,11 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
     public List<AppResumptionDataInfoVo> getItems(List<Resumption> resumptions) {
         List<AppResumptionDataInfoVo> vos = new ArrayList<>();
         for (Resumption r : resumptions) {
-            ResumptionRecordVo resumptionRecordVo = resumptionRecordService.selectInfo(r.getId());
-            List<ResumptionRecordItemVo> items = resumptionRecordVo.getItems();
-            for (ResumptionRecordItemVo v : items) {
-                vos.addAll(v.getDataInfoList());
-            }
+            vos.addAll(resumptionRecordService.getResumptionDataById(r.getId(),r.getStatus(),r.getPlanId(),r.getOrgId()));
+//            List<ResumptionRecordItemVo> items = resumptionRecordVo.getItems();
+//            for (ResumptionRecordItemVo v : items) {
+//                vos.addAll(v.getDataInfoList());
+//            }
         }
         return vos;
     }
@@ -1326,11 +1409,22 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
         for (Map.Entry<Long, List<AppResumptionDataInfoVo>> map : bef.entrySet()) {
             String pointName = "";
             StringBuilder submitName = new StringBuilder();
-            int result = 0;
+
+            //null:未执行  0:正常 1:异常
+            Integer result = null;
             // for (AppResumptionDataInfoVo vo :bef.get(l)) {
             for (AppResumptionDataInfoVo vo : map.getValue()) {
                 pointName = vo.getPointName();
-                result += vo.getResValue();
+                if(ObjectUtil.isNotNull(vo.getResValue()))
+                {
+                    if(vo.getResValue()>0)
+                    {
+                        result=1;
+                    }
+                    else {
+                        result=0;
+                    }
+                }
                 if (!(submitName.toString().contains(vo.getSubmitName()))) {
                     submitName.append(vo.getSubmitName());
                 }
@@ -1338,7 +1432,9 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
             ResumptionPdf tem = new ResumptionPdf();
             tem.setPointName(pointName);
             tem.setSubmitName(String.valueOf(submitName));
-            tem.setResValue(result > 0 ? 1 : 0);
+            //null:未执行  0:正常 1:异常
+            tem.setResValue(result);
+//            tem.setResValue(result > 0 ? 1 : 0);
             befs.add(tem);
         }
         return befs;

+ 83 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/ResumptionRecordServiceImpl.java

@@ -16,6 +16,9 @@ import com.xunmei.core.resumption.domain.Resumption;
 import com.xunmei.core.resumption.dto.resumptionRecord.ResumptionNFCDto;
 import com.xunmei.core.resumption.dto.resumptionRecord.ResumptionRecordPageDto;
 import com.xunmei.core.resumption.dto.resumptionRecord.ResumptionRoleDto;
+import com.xunmei.core.resumption.enums.ResumptionStatus;
+import com.xunmei.core.resumption.gx.vo.ResumptionPlanVo;
+import com.xunmei.core.resumption.mapper.AppPlanMapper;
 import com.xunmei.core.resumption.mapper.AppPlanToRoleMapper;
 import com.xunmei.core.resumption.mapper.AppResumptionDataRemarkimgMapper;
 import com.xunmei.core.resumption.mapper.ResumptionRecordMapper;
@@ -69,6 +72,9 @@ public class ResumptionRecordServiceImpl extends ServiceImpl<ResumptionRecordMap
     @Resource
     private AppPlanToRoleMapper appPlanToRoleMapper;
 
+    @Autowired
+    private AppPlanMapper appPlanMapper;
+
     @Override
     public TableDataInfo selectList(ResumptionRecordPageDto pageDto) {
         Page<ResumptionRecordPageVo> page = pageDto.getPageDto();
@@ -213,6 +219,83 @@ public class ResumptionRecordServiceImpl extends ServiceImpl<ResumptionRecordMap
     }
 
     @Override
+    public List<AppResumptionDataInfoVo> getResumptionDataById(Long resumptionId,Integer status,Long planId,Long orgId) {
+
+//        Resumption resumption= baseMapper.selectById(resumptionId);
+
+        //履职状态:1 待履职,2 进行中,3 已完成,4 已过期
+        List<ResumptionPlanVo> resumptionPlanVos = new ArrayList<>();
+        //待履职 和已过期的数据是没有保存过数据的只能根据计划获取
+        if (ResumptionStatus.NO_START.getCode().equals(status) || ResumptionStatus.OUT_DATE.getCode().equals(status)) {
+            resumptionPlanVos = appPlanMapper.selectResumptionPlan(planId, orgId);
+            return ResumptionPlanVoConvertToAppResumptionDataInfoVo(resumptionPlanVos);
+        }
+        else{
+            return getSubmitedResumptionDataById(resumptionId);
+        }
+    }
+
+    private List<AppResumptionDataInfoVo> ResumptionPlanVoConvertToAppResumptionDataInfoVo(List<ResumptionPlanVo> resumptionPlanVos)
+    {
+        List<AppResumptionDataInfoVo> result=new ArrayList<>();
+        resumptionPlanVos.stream().forEach(x->{
+            AppResumptionDataInfoVo temp=new AppResumptionDataInfoVo();
+            temp.setPointName(x.getPointName());
+            temp.setAreaName(x.getAreaName());
+            temp.setItemId(x.getItemId());
+            temp.setExecuteResult(StringUtils.EMPTY);
+            temp.setSubmitName(StringUtils.EMPTY);
+            result.add(temp);
+        });
+
+        return result;
+    }
+
+    /**
+     * 已经提交数据的履职任务  根据任务id 获取 任务数据
+     * @param resumptionId
+     * @return
+     */
+    private List<AppResumptionDataInfoVo> getSubmitedResumptionDataById(Long resumptionId)
+    {
+        List<ResumptionRecordItemVo> arrayList = new ArrayList<>();
+        List<Long> ItemidList = baseMapper.selectItemIdList(resumptionId);
+        List<Long> ruleItemIdList = new ArrayList<>();
+        if (CollectionUtil.isNotEmpty(ItemidList)) {
+            ruleItemIdList = baseMapper.selectRuleItemIdListNew(ItemidList);
+        }
+        for (Long ruleItemId : ruleItemIdList) {
+            ResumptionRecordItemVo info = baseMapper.selectRuleItemInfo(ruleItemId);
+            arrayList.add(info);
+            List<AppResumptionDataInfoVo> dataInfoList = baseMapper.selectDataInfo(ruleItemId, resumptionId);
+            info.setDataInfoList(dataInfoList);
+        }
+        List<ResumptionDataProtectionVo> protectionVos = coreResumptionDataProtectionService.selectProtection(resumptionId);
+        final ArrayList<Long> list = new ArrayList<>();
+        for (ResumptionRecordItemVo infoVo : arrayList) {
+            infoVo.getDataInfoList().stream().map(AppResumptionDataInfoVo::getDataId).forEach(list::add);
+        }
+
+        if (list.size() > 0) {
+            //  final List<AppResumptionDataImg> dataImgList = dataImgMapper.selectList(new LambdaQueryWrapper<AppResumptionDataImg>().in(AppResumptionDataImg::getDataId, list));
+            final List<AppResumptionDataRemarkimg> taskDataRemarkimgList = taskDataRemarkimgMapper.selectList(new LambdaQueryWrapper<AppResumptionDataRemarkimg>().in(AppResumptionDataRemarkimg::getResumptionDataId, list));
+
+            for (ResumptionRecordItemVo infoVo : arrayList) {
+                for (AppResumptionDataInfoVo dataInfoVo : infoVo.getDataInfoList()) {
+                    final List<AppResumptionDataRemarkimg> imgList = taskDataRemarkimgList.stream().filter(appResumptionDataImg -> appResumptionDataImg.getResumptionDataId().equals(dataInfoVo.getDataId())).collect(Collectors.toList());
+                    dataInfoVo.setAppResumptionDataImgList(imgList);
+
+                    List<ResumptionDataProtectionVo> dataProtectionVos = protectionVos.stream().filter(p -> ObjectUtil.equal(dataInfoVo.getDataId(), p.getResumptionDataId())).collect(Collectors.toList());
+                    dataInfoVo.setProtections(dataProtectionVos);
+                }
+            }
+        }
+        List<AppResumptionDataInfoVo> result=new ArrayList<>();
+        arrayList.stream().forEach(x->result.addAll(x.getDataInfoList()));
+        return result;
+    }
+
+    @Override
     public List<IdNameVo> selectResumptionRole(ResumptionRoleDto query) {
         if (ObjectUtil.isNotNull(query.getOrgId())) {
             List<Long> upOrgIds = orgService.getUpOrgs(query.getOrgId());

+ 5 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/ResumptionServiceImpl.java

@@ -37,6 +37,7 @@ import com.xunmei.system.api.Eto.RoleConditionEto;
 import com.xunmei.system.api.RemoteOrgService;
 import com.xunmei.system.api.RemoteRoleService;
 import com.xunmei.system.api.domain.SysRole;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
@@ -223,7 +224,10 @@ public class ResumptionServiceImpl extends ServiceImpl<ResumptionMapper, Resumpt
 
     @Override
     public List<PanelListVo> selectCurUserTaskList(PanelListDto panelListDto) {
-        List<PanelListVo> list = resumptionMapper.selectCurUserTaskList(panelListDto);
+        PanelListDto request=new PanelListDto();
+        BeanUtils.copyProperties(panelListDto,request);
+        request.setStartTime(DateUtil.date());
+        List<PanelListVo> list = resumptionMapper.selectCurUserTaskList(request);
 //        Date endLimit = DateUtil.beginOfDay(new Date());
 //        list.removeIf(item -> DateUtil.compare(endLimit, item.getEndTime()) >0);
         list.forEach(item -> {

+ 4 - 4
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/CoreSafetyTaskServiceImpl.java

@@ -81,7 +81,7 @@ public class CoreSafetyTaskServiceImpl extends ServiceImpl<CoreSafetyTaskMapper,
             page = new Page<>();
         }
         //查询条件
-        QueryWrapper<CoreSafetyTask> query = new QueryWrapper<>(coreSafetyTask);
+//        QueryWrapper<CoreSafetyTask> query = new QueryWrapper<>(coreSafetyTask);
         //下穿
 //        if (coreSafetyTask.getCheckSub()){
 //            List<Long> ids = orgService.selectCheckSubOrgIdList(coreSafetyTask.getOrgId());
@@ -91,9 +91,9 @@ public class CoreSafetyTaskServiceImpl extends ServiceImpl<CoreSafetyTaskMapper,
 //            query.in("org_id",ids);
 //        }
         //时间范围查询
-        if (coreSafetyTask.getParams().get("beginTime") != null && coreSafetyTask.getParams().get("endTime") != null) {
-            query.between("create_time", coreSafetyTask.getParams().get("beginTime"), coreSafetyTask.getParams().get("endTime"));
-        }
+//        if (coreSafetyTask.getParams().get("beginTime") != null && coreSafetyTask.getParams().get("endTime") != null) {
+//            query.between("create_time", coreSafetyTask.getParams().get("beginTime"), coreSafetyTask.getParams().get("endTime"));
+//        }
         if (CollectionUtil.isNotEmpty(coreSafetyTask.getRange()) && coreSafetyTask.getRange().size() == 2) {
             coreSafetyTask.getRange().set(0, DateUtil.beginOfDay(coreSafetyTask.getRange().get(0)));
             coreSafetyTask.getRange().set(1, DateUtil.endOfDay(coreSafetyTask.getRange().get(1)));

+ 5 - 2
soc-modules/soc-modules-core/src/main/resources/mapper/board/CockpitMapper.xml

@@ -221,11 +221,14 @@
                            (q.confirm_status = 3 AND q.reform_status IS NULL, 1, 0)) AS closedCount,
                sum(
                        IF
-                           (q.confirm_status = 2, 1, 0))                                 AS waitReformCount,
+                           (q.reform_status = 10 and q.reform_deadline > #{today}, 1, 0))                                 AS waitReformCount,
                sum(
                        IF
                            (q.reform_status = 11, 1, 0))                                 AS reformedCount,
-               sum(if(q.confirm_status != 3 and q.reform_deadline &lt;= #{today}, 1, 0)) as overdueCount
+               sum(
+                       IF
+                           (q.reform_status = 13, 1, 0))                                 AS overDueReformedCount,
+               sum(if(q.confirm_status != 3 and q.reform_status!=11 and q.reform_status!=13 and q.reform_deadline &lt;= #{today}, 1, 0)) as overdueCount
         FROM core_question q
         WHERE ((
                            #{startDate}   <![CDATA[<=]]> q.submit_time

+ 65 - 17
soc-modules/soc-modules-core/src/main/resources/mapper/question/QuestionMapper.xml

@@ -291,10 +291,22 @@
             and q.org_id=#{params.orgId}
         </if>
         <if test="params.confirmStatus!=null">
-            <if test="params.confirmStatus==4">
+<!--            <if test="params.confirmStatus==4">-->
+<!--                and (q.confirm_status!=3) and q.reform_deadline &lt; #{today}-->
+<!--            </if>-->
+<!--            <if test="params.confirmStatus!=4">-->
+<!--                and q.confirm_status=#{params.confirmStatus}-->
+<!--            </if>-->
+            <if test="params.confirmStatus==12">
                 and (q.confirm_status!=3) and q.reform_deadline &lt; #{today}
             </if>
-            <if test="params.confirmStatus!=4">
+            <if test="params.confirmStatus==13">
+                and q.reform_status=#{params.confirmStatus}
+            </if>
+            <if test="params.confirmStatus>=10 and params.confirmStatus &lt;12">
+                and q.reform_status=#{params.confirmStatus}
+            </if>
+            <if test="params.confirmStatus &lt; 10">
                 and q.confirm_status=#{params.confirmStatus}
             </if>
         </if>
@@ -317,15 +329,36 @@
             and q.org_id=#{params.orgId}
         </if>
         <if test="params.status!=null">
-            <if test="params.status==12">
-                and (q.confirm_status!=3) and q.reform_deadline &lt; #{today}
-            </if>
-            <if test="params.status>=10 and params.status &lt;12">
-                and q.reform_status=#{params.status}
-            </if>
-            <if test="params.status &lt; 10">
-                and q.confirm_status=#{params.status}
-            </if>
+            <choose>
+                <!--已关闭 confirm_status ==3 , 逾期整改 q.reform_status==13  -->
+                <when test="params.status &lt; 10">
+                    and q.confirm_status=#{params.status}
+                </when>
+                <when test="params.status==10">
+                    and q.reform_status=#{params.status}
+                </when>
+                <when test="params.status==11 or params.status==13">
+                    and q.reform_status=#{params.status}
+                </when>
+                <when test="params.reformStatus==12">
+                    and (q.confirm_status!=3) and q.reform_status!=11 and q.reform_status!=13  and q.reform_deadline &lt; #{today}
+                </when>
+                <otherwise>
+                    and q.reform_status=#{params.status}
+                </otherwise>
+            </choose>
+<!--            <if test="params.status==12">-->
+<!--                and (q.confirm_status!=3) and q.reform_status!=11 and q.reform_status!=13  and q.reform_deadline &lt; #{today}-->
+<!--            </if>-->
+<!--            <if test="params.status==13">-->
+<!--                and q.reform_status=#{params.status}-->
+<!--            </if>-->
+<!--            <if test="params.status>=10 and params.status &lt;12">-->
+<!--                and q.reform_status=#{params.status}-->
+<!--            </if>-->
+<!--            <if test="params.status &lt; 10">-->
+<!--                and q.confirm_status=#{params.status}-->
+<!--            </if>-->
         </if>
         <if test="params.reformDate!=null">
             and q.reform_deadline>= #{params.reformDate} and q.submit_time&lt;=#{params.reformDateEnd}
@@ -353,12 +386,27 @@
             and q.org_id=#{params.orgId}
         </if>
         <if test="params.reformStatus!=null">
-            <if test="params.reformStatus==12">
-                and q.confirm_status!=3 and q.reform_deadline &lt; #{today}
-            </if>
-            <if test="params.reformStatus!=12">
-                and q.reform_status=#{params.reformStatus}
-            </if>
+            <choose>
+                <!--已关闭 confirm_status ==3 , 逾期整改 q.reform_status==13  -->
+                <when test="params.reformStatus==12">
+                    and q.confirm_status!=3 and q.reform_status!=13 and q.reform_status!=11 and  q.reform_deadline &lt; #{today}
+                </when>
+                <when test="params.reformStatus!=12 and params.reformStatus==10">
+                    and q.reform_status=#{params.reformStatus} and  q.reform_deadline > #{today}
+                </when>
+                <otherwise>
+                    and q.reform_status=#{params.reformStatus}
+                </otherwise>
+            </choose>
+<!--            <if test="params.reformStatus==12">-->
+<!--                and q.confirm_status!=3 and q.reform_status!=13 and  q.reform_deadline &lt; #{today}-->
+<!--            </if>-->
+<!--            <if test="params.reformStatus!=12 and params.reformStatus==10">-->
+<!--                and q.reform_status=#{params.reformStatus} and  q.reform_deadline > #{today}-->
+<!--            </if>-->
+<!--            <if test="params.reformStatus!=12">-->
+<!--                and q.reform_status=#{params.reformStatus}-->
+<!--            </if>-->
         </if>
         <if test="params.reformRange!=null and params.reformRange.length==2">
             and q.reform_deadline between #{params.reformRange[0]} and #{params.reformRange[1]}

+ 16 - 2
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/ResumptionMapper.xml

@@ -345,9 +345,9 @@
         from core_resumption res
                  left join core_resumption_plan pl on res.plan_id = pl.id
         where pl.plan_exec = #{exec}
-          and DATE(res.ymd_date) = DATE(#{date})
+          and res.ymd_date = DATE(#{date})
           and res.org_id = #{orgId}
-          and res.status = 3
+<!--          and res.status = 3-->
     </select>
 
     <select id="selectByYmdDateAndExecList" resultType="com.xunmei.core.resumption.domain.Resumption">
@@ -376,6 +376,20 @@
         </foreach>
     </select>
 
+    <select id="selectByEndDateAndPlanType" resultType="com.xunmei.core.resumption.domain.Resumption">
+        select res.*,pl.plan_exec as planExec,pl.plan_type as planType
+        from core_resumption res
+        left join core_resumption_plan pl on res.plan_id = pl.id
+        where  #{startDate} <![CDATA[<=]]> res.plan_end_time
+        and #{endDate} >= res.plan_end_time
+        and res.org_id = #{orgId}
+        and res.status != 3
+        and  pl.plan_type in
+        <foreach collection="planType" item="item" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+    </select>
+
 
 
 

+ 4 - 4
soc-modules/soc-modules-file/src/main/java/com/xunmei/file/utils/PdfUtil.java

@@ -209,7 +209,7 @@ public class PdfUtil {
         PdfUtil.createPDFCell(tableFont, table, "单位名称", Element.ALIGN_MIDDLE, 2, 0);
         PdfUtil.createPDFCell(tableFont, table, data.get("orgName").toString(), Element.ALIGN_MIDDLE, 3, 0);
         PdfUtil.createPDFCell(tableFont, table, "检查时间", Element.ALIGN_MIDDLE, 2, 0);
-        PdfUtil.createPDFCell(tableFont, table, data.get("dateStr").toString(), Element.ALIGN_MIDDLE, 3, 0);
+        PdfUtil.createPDFCell(tableFont, table,ObjectUtil.isNotEmpty(data.get("submiterNames"))? data.get("dateStr").toString():"", Element.ALIGN_MIDDLE, 3, 0);
         // 第二行
         PdfUtil.createPDFCell(tableFont, table, "检查人", Element.ALIGN_MIDDLE, 2, 0);
         PdfUtil.createPDFCell(tableFont, table, data.get("submiterNames").toString(), Element.ALIGN_MIDDLE, 8, 0);
@@ -243,7 +243,7 @@ public class PdfUtil {
                 String rowContent = o + "、" + listVo.get("pointName");
                 PdfUtil.createPDFCell(tableFont, table, rowContent, Element.ALIGN_LEFT, 6, 0);
                 // 检查情况
-                PdfUtil.createPDFCell(tableFont, table, ((Integer) listVo.get("resValue")) == 0 ? "正常" : "异常", Element.ALIGN_MIDDLE, 2, 0);
+                PdfUtil.createPDFCell(tableFont, table, ObjectUtil.isEmpty(listVo.get("resValue"))? "" : (((Integer) listVo.get("resValue")) == 0 ? "正常" : "异常"), Element.ALIGN_MIDDLE, 2, 0);
                 // 检查人
                 //PdfUtil.createPDFCell(tableFont, table, String.valueOf(listVo.get("submitName")), Element.ALIGN_CENTER, 0, 0);
                 o++;
@@ -258,7 +258,7 @@ public class PdfUtil {
 
         final List<LinkedHashMap> questionPdfVoList = (List<LinkedHashMap>) data.get("questions");
         if (ObjectUtil.isEmpty(questionPdfVoList)) {
-            PdfUtil.createPDFCell(tableFont, table, "1", Element.ALIGN_MIDDLE, 2, 1);
+            PdfUtil.createPDFCell(tableFont, table, "", Element.ALIGN_MIDDLE, 2, 1);
             PdfUtil.createPDFCell(tableFont, table, StringUtil.EMPTY_STRING, Element.ALIGN_LEFT, 4, 1);
             PdfUtil.createPDFCell(tableFont, table, StringUtil.EMPTY_STRING, Element.ALIGN_MIDDLE, 4, 1);
             document.add(table);
@@ -603,7 +603,7 @@ public class PdfUtil {
         PdfUtil.createPDFCell(tableFont, table, "存在问题", Element.ALIGN_MIDDLE, 6, 1);
         final Optional<CheckDataVo> optional = data.getCheckDatas().stream().filter(res -> ObjectUtil.isNotEmpty(res.getResRemark())).findAny();
         if (!optional.isPresent()) {
-            PdfUtil.createPDFCell(tableFont, table, "1", Element.ALIGN_MIDDLE, 2, 1);
+            PdfUtil.createPDFCell(tableFont, table, "", Element.ALIGN_MIDDLE, 2, 1);
             PdfUtil.createPDFCell(tableFont, table, StringUtil.EMPTY_STRING, Element.ALIGN_MIDDLE, 6, 1);
             PdfUtil.createPDFCell(tableFont, table, StringUtil.EMPTY_STRING, Element.ALIGN_MIDDLE, 6, 1);
             document.add(table);

+ 10 - 0
soc-modules/soc-modules-job/src/main/java/com/xunmei/job/task/WeatherTask.java

@@ -34,4 +34,14 @@ public class WeatherTask {
         AjaxResult result = remoteWeatherTaskService.getDataFromApi( SecurityConstants.INNER);
         log.info("获取天气预警数据的任务执行结束,当前任务 id:{},当前时间:{},结果:{}", id, new Date(), JSON.toJSONString(result));
     }
+
+    /**
+     * 每天定时获取天气预警数据
+     */
+    public void getDataFromAliyun()
+    {   String id = UUID.fastUUID().toString();
+        log.info("开始执行获取天气预警数据的任务,当前任务 id:{},当前时间:{}", id, new Date());
+        AjaxResult result = remoteWeatherTaskService.getDataFromAliyun( SecurityConstants.INNER);
+        log.info("获取天气预警数据的任务执行结束,当前任务 id:{},当前时间:{},结果:{}", id, new Date(), JSON.toJSONString(result));
+    }
 }