Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/V0.0.2' into V0.0.2

jingyuanchao 2 rokov pred
rodič
commit
0814f17123
19 zmenil súbory, kde vykonal 291 pridanie a 128 odobranie
  1. 7 0
      project_data/sql/0.0.2/soc/soc.sql
  2. 10 10
      soc-api/soc-api-system/src/main/java/com/xunmei/system/api/domain/SysOrgExtend.java
  3. 5 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/SocCoreApplication.java
  4. 5 2
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/controller/TMonitoringRetrievalPlanController.java
  5. 5 3
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/domain/TMonitoringRetrievalPlan.java
  6. 12 7
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/mapper/TMonitoringRetrievalPlanMapper.java
  7. 2 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/service/ITMonitoringRetrievalPlanService.java
  8. 142 69
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/service/impl/TMonitoringRetrievalPlanServiceImpl.java
  9. 1 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/vo/TMonitoringRetrievalPlanVO.java
  10. 6 6
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/controller/QuestionController.java
  11. 2 2
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/dto/QuestionPageDto.java
  12. 7 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/service/impl/QuestionServiceImpl.java
  13. 39 2
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/retrieval/service/impl/CoreMonitoringRetrievalTaskServiceImpl.java
  14. 28 13
      soc-modules/soc-modules-core/src/main/resources/mapper/access/TMonitoringRetrievalPlanMapper.xml
  15. 8 1
      soc-modules/soc-modules-core/src/main/resources/mapper/retrieval/CoreMonitoringRetrievalTaskMapper.xml
  16. 1 1
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysUserController.java
  17. 5 5
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/dto/SysOrgExtendDto.java
  18. 4 4
      soc-modules/soc-modules-system/src/main/resources/bootstrap.yml
  19. 2 2
      soc-visual/soc-monitor/src/main/resources/bootstrap.yml

+ 7 - 0
project_data/sql/0.0.2/soc/soc.sql

@@ -1027,6 +1027,13 @@ IF
         ALTER TABLE `core_safecheck_plan` ADD COLUMN `distribute` VARCHAR ( 2 ) DEFAULT NULL COMMENT '是否已下发';
 
     END IF;
+
+	-- 调阅计划是否立即生成任务
+    IF
+NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'core_monitoring_retrieval_plan' AND COLUMN_NAME = 'immediately' ) THEN
+ALTER TABLE `core_monitoring_retrieval_plan` ADD COLUMN `immediately` VARCHAR ( 2 ) DEFAULT NULL COMMENT '是否立即生成任务1是2否';
+
+END IF;
 	-- 履职计划是否下发标识
     IF
         NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'core_resumption_plan' AND COLUMN_NAME = 'distribute' ) THEN

+ 10 - 10
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/domain/SysOrgExtend.java

@@ -81,8 +81,8 @@ public class SysOrgExtend extends BaseEntity {
      */
     @ApiModelProperty(value = "有无保安")
 //    @JsonSerialize(using = ToStringSerializer.class)
-    private Long askari;
-    private Long businessLibrary;
+    private Integer askari;
+    private Integer businessLibrary;
 
     /**
      * 保安证
@@ -101,46 +101,46 @@ public class SysOrgExtend extends BaseEntity {
      * 值守方式
      */
     @ApiModelProperty(value = "值守方式")
-    private Long dutyMode;
+    private Integer dutyMode;
 
     /**
      * 业务库出入口远程控制
      */
     @ApiModelProperty(value = "业务库出入口远程控制")
-    private Long remoteControl;
+    private Integer remoteControl;
     /**
      * 离行式大堂设备
      */
     @ApiModelProperty(value = "离行式大堂设备")
-    private Long detachedLobbyEquipment;
+    private Integer detachedLobbyEquipment;
     /**
      * 离行式穿墙设备
      */
     @ApiModelProperty(value = "离行式穿墙设备")
-    private Long detachedWallPenetratingEquipment;
+    private Integer detachedWallPenetratingEquipment;
     /**
      * 加钞间远程控制
      */
     @ApiModelProperty(value = "加钞间远程控制")
-    private Long cashAddingRoomRemoteControl;
+    private Integer cashAddingRoomRemoteControl;
     /**
      * 是否有在行自助银行
      */
     @ApiModelProperty(value = "是否有在行自助银行")
 //    @JsonSerialize(using = ToStringSerializer.class)
-    private Long selfServiceBank;
+    private Integer selfServiceBank;
 
     /**
      * 在行式大堂设备
      */
     @ApiModelProperty(value = "在行式大堂设备")
-    private Long lobbyEquipment;
+    private Integer lobbyEquipment;
 
     /**
      * 在行式穿墙设备
      */
     @ApiModelProperty(value = "在行式穿墙设备")
-    private Long wallPenetratingEquipment;
+    private Integer wallPenetratingEquipment;
 
     /**
      * 银行物防建设id

+ 5 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/SocCoreApplication.java

@@ -8,6 +8,11 @@ import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 
+import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.util.Calendar;
+import java.util.Date;
+
 
 @MapperScan("com.xunmei.core.**.mapper")
 @EnableCustomConfig

+ 5 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/controller/TMonitoringRetrievalPlanController.java

@@ -19,6 +19,7 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.text.ParseException;
 import java.util.Set;
 
 /**
@@ -37,6 +38,7 @@ public class TMonitoringRetrievalPlanController extends BaseController {
     private RemoteRoleService remoteRoleService;
     @Autowired
     private RemoteOrgService remoteOrgService;
+
     /**
      * 查询监控调阅计划列表
      */
@@ -67,7 +69,8 @@ public class TMonitoringRetrievalPlanController extends BaseController {
             admin = true;
         }
         ajax.put("check", admin);
-        ajax.put("isEdit",sysOrg.getId());
+        ajax.put("isEdit", sysOrg.getId());
+        ajax.put("xf",sysOrg.getType());
         return ajax;
     }
 
@@ -77,7 +80,7 @@ public class TMonitoringRetrievalPlanController extends BaseController {
     @ApiOperation(value = "下发")
     @RequiresPermissions("core:accessPlan:add")
     @GetMapping(value = "/distribute/{id}")
-    public AjaxResult distribute(@PathVariable(value = "id", required = false) Long id) {
+    public AjaxResult distribute(@PathVariable(value = "id", required = false) Long id) throws ParseException {
         return success(tMonitoringRetrievalPlanService.distribute(id));
     }
 

+ 5 - 3
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/domain/TMonitoringRetrievalPlan.java

@@ -50,7 +50,9 @@ public class TMonitoringRetrievalPlan extends BaseEntity {
     @ApiModelProperty(value = "计划名称")
     private String planName;
     @ApiModelProperty(value = "是否显示下发")
-private String isDistribute;
+    private String isDistribute;
+    @ApiModelProperty(value = "是否立即下发")
+    private String immediately;
     /**
      * 计划归属机构
      */
@@ -58,10 +60,10 @@ private String isDistribute;
     @JsonSerialize(using = ToStringSerializer.class)
     private Long orgId;
     @ApiModelProperty(value = "开始时间")
-   // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date startTime;
     @ApiModelProperty(value = "结束时间")
-   // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date endTime;
     @ApiModelProperty(value = "下发类型0不能做任务1可以直接做任务")
     private Integer createType;

+ 12 - 7
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/mapper/TMonitoringRetrievalPlanMapper.java

@@ -26,15 +26,17 @@ public interface TMonitoringRetrievalPlanMapper extends BaseMapper<TMonitoringRe
      * @param id 监控调阅计划主键
      * @return 监控调阅计划
      */
-     TMonitoringRetrievalPlan selectTMonitoringRetrievalPlanById(Long id);
+    TMonitoringRetrievalPlan selectTMonitoringRetrievalPlanById(Long id);
+
     Page<TMonitoringRetrievalPlanVO> selectPageList(@Param("page") Page<TMonitoringRetrievalPlanVO> page, @Param("request") TMonitoringRetrievalPlan request);
+
     /**
      * 查询监控调阅计划列表
      *
      * @param tMonitoringRetrievalPlan 监控调阅计划
      * @return 监控调阅计划集合
      */
-     List<TMonitoringRetrievalPlan> selectTMonitoringRetrievalPlanList(TMonitoringRetrievalPlan tMonitoringRetrievalPlan);
+    List<TMonitoringRetrievalPlan> selectTMonitoringRetrievalPlanList(TMonitoringRetrievalPlan tMonitoringRetrievalPlan);
 
     /**
      * 新增监控调阅计划
@@ -42,7 +44,7 @@ public interface TMonitoringRetrievalPlanMapper extends BaseMapper<TMonitoringRe
      * @param tMonitoringRetrievalPlan 监控调阅计划
      * @return 结果
      */
-     int insertTMonitoringRetrievalPlan(TMonitoringRetrievalPlan tMonitoringRetrievalPlan);
+    int insertTMonitoringRetrievalPlan(TMonitoringRetrievalPlan tMonitoringRetrievalPlan);
 
     /**
      * 修改监控调阅计划
@@ -50,10 +52,11 @@ public interface TMonitoringRetrievalPlanMapper extends BaseMapper<TMonitoringRe
      * @param tMonitoringRetrievalPlan 监控调阅计划
      * @return 结果
      */
-     int updateTMonitoringRetrievalPlan(TMonitoringRetrievalPlan tMonitoringRetrievalPlan);
+    int updateTMonitoringRetrievalPlan(TMonitoringRetrievalPlan tMonitoringRetrievalPlan);
 
     /**
      * 逻辑删除计划以及下面所有的子计划
+     *
      * @param tMonitoringRetrievalPlan
      * @return
      */
@@ -61,18 +64,20 @@ public interface TMonitoringRetrievalPlanMapper extends BaseMapper<TMonitoringRe
 
     /**
      * 根据父id修改状态
+     *
      * @param status
      * @param parentId
      * @return
      */
-    int updatePlanStatus(@Param("status") Integer status,@Param("parentId") Long parentId);
+    int updatePlanStatus(@Param("status") Integer status, @Param("parentId") Long parentId);
+
     /**
      * 删除监控调阅计划
      *
      * @param id 监控调阅计划主键
      * @return 结果
      */
-     int deleteTMonitoringRetrievalPlanById(Long id);
+    int deleteTMonitoringRetrievalPlanById(Long id);
 
     /**
      * 批量删除监控调阅计划
@@ -80,5 +85,5 @@ public interface TMonitoringRetrievalPlanMapper extends BaseMapper<TMonitoringRe
      * @param ids 需要删除的数据主键集合
      * @return 结果
      */
-     int deleteTMonitoringRetrievalPlanByIds(Long[] ids);
+    int deleteTMonitoringRetrievalPlanByIds(Long[] ids);
 }

+ 2 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/service/ITMonitoringRetrievalPlanService.java

@@ -5,6 +5,7 @@ import com.xunmei.common.core.web.page.TableDataInfo;
 import com.xunmei.core.access.domain.TMonitoringRetrievalPlan;
 import com.xunmei.core.access.vo.TMonitoringRetrievalPlanVO;
 
+import java.text.ParseException;
 import java.util.List;
 
 
@@ -29,7 +30,7 @@ public interface ITMonitoringRetrievalPlanService extends IService<TMonitoringRe
      * @param id
      * @return
      */
-    int distribute(Long id);
+    int distribute(Long id) throws ParseException;
 
     /**
      * 查询监控调阅计划列表

+ 142 - 69
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/service/impl/TMonitoringRetrievalPlanServiceImpl.java

@@ -38,7 +38,12 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.LocalDate;
 import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
 import java.util.List;
 
 import java.util.stream.Collectors;
@@ -81,7 +86,7 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
         }
         //查询条件
         String planName = tMonitoringRetrievalPlan.getPlanName();
-       // tMonitoringRetrievalPlan.setPlanName(null);
+        // tMonitoringRetrievalPlan.setPlanName(null);
 
         QueryWrapper<TMonitoringRetrievalPlan> query = new QueryWrapper<>(tMonitoringRetrievalPlan);
         //下穿
@@ -107,18 +112,6 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
         //获取数据
 
         page = tMonitoringRetrievalPlanMapper.selectPageList(page, tMonitoringRetrievalPlan);
-       /* List<TMonitoringRetrievalPlan> records = page.getRecords();
-        List<TMonitoringRetrievalPlanVO>tMonitoringRetrievalPlanVOS = null;
-        SysOrg sysOrg = remoteOrgService.selectSysOrgById(SecurityUtils.getLoginUser().getOrgId(), SecurityConstants.INNER);*/
-  /*      for (TMonitoringRetrievalPlan r:records){
-            TMonitoringRetrievalPlanVO tMonitoringRetrievalPlanVO=new TMonitoringRetrievalPlanVO();
-            BeanUtils.copyProperties(r,tMonitoringRetrievalPlanVO);
-            if (r.getOrgId().equals(sysOrg.getId())||r.getParentId().equals(sysOrg.getId())){
-                tMonitoringRetrievalPlanVO.setIsEdit(Boolean.TRUE);
-            }
-            tMonitoringRetrievalPlanVOS.add(tMonitoringRetrievalPlanVO);
-        }*/
-      //  page.setRecords(tMonitoringRetrievalPlanVOS);
         return TableDataInfo.build(page);
     }
 
@@ -134,11 +127,8 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
         TMonitoringRetrievalPlanVO tMonitoringRetrievalPlanVO = new TMonitoringRetrievalPlanVO();
         TMonitoringRetrievalPlan plan = tMonitoringRetrievalPlanMapper.selectById(id);
         BeanUtils.copyProperties(plan, tMonitoringRetrievalPlanVO);
-        //1:
-        SysOrg sysOrg = remoteOrgService.selectSysOrgById(plan.getOrgId(), SecurityConstants.INNER);
-        SysOrg sysOrg1 = remoteOrgService.selectSysOrgById(SecurityUtils.getLoginUser().getOrgId(), SecurityConstants.INNER);
         boolean isEdit = false;
-        if (plan.getParentId()!=null) {
+        if (plan.getParentId() != null) {
             isEdit = true;
         }
         tMonitoringRetrievalPlanVO.setIsEdit(isEdit);
@@ -147,7 +137,7 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
 
     @Transactional
     @Override
-    public int distribute(Long id) {
+    public int distribute(Long id) throws ParseException {
         //查询
         TMonitoringRetrievalPlan tMonitoringRetrievalPlan = tMonitoringRetrievalPlanMapper.selectById(id);
         tMonitoringRetrievalPlan.setIsDistribute("1");
@@ -166,59 +156,119 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
         //如果顶级
         List<TMonitoringRetrievalPlan> tMonitoringRetrievalPlans = new ArrayList<>();
         Integer i = ZERO;
-        if (topOrg.getType() == 1) {
-            SysOrg org = new SysOrg();
-            org.setType(3);
-            org.setPath(topOrg.getPath());
-            //查询符合的机构,需求是先把行社加入
-            List<SysOrg> list = remoteOrgService.listByParentIdAndType(org, SecurityConstants.INNER);
-            for (SysOrg l : list) {
-                TMonitoringRetrievalPlan tMonitoringRetrievalPlan1 = new TMonitoringRetrievalPlan();
-                BeanUtils.copyProperties(tMonitoringRetrievalPlan, tMonitoringRetrievalPlan1);
-                tMonitoringRetrievalPlan1.setOrgId(l.getId());
-                tMonitoringRetrievalPlan1.setOrgPath(l.getPath());
-                tMonitoringRetrievalPlan1.setParentId(id);
-                if (tMonitoringRetrievalPlan.getOrgType().equals("3")) {
-                    tMonitoringRetrievalPlan1.setIsDistribute("1");
+        SysOrg org = new SysOrg();
+        org.setType(3);
+        org.setPath(topOrg.getPath());
+        //查询符合的机构,需求是先把行社加入
+        List<SysOrg> list = remoteOrgService.listByParentIdAndType(org, SecurityConstants.INNER);
+        for (SysOrg l : list) {
+            TMonitoringRetrievalPlan tMonitoringRetrievalPlan1 = new TMonitoringRetrievalPlan();
+            BeanUtils.copyProperties(tMonitoringRetrievalPlan, tMonitoringRetrievalPlan1);
+            tMonitoringRetrievalPlan1.setOrgId(l.getId());
+            tMonitoringRetrievalPlan1.setOrgPath(l.getPath());
+            tMonitoringRetrievalPlan1.setParentId(id);
+            tMonitoringRetrievalPlan1.setIsDistribute("1");
+            tMonitoringRetrievalPlan1.setCreateType(1);
+            i = insertTMonitoringRetrievalPlan(tMonitoringRetrievalPlan1);
+            if (tMonitoringRetrievalPlan.getOrgType().equals("3")) {
+                if (!tMonitoringRetrievalPlan.getPlanCycle().equals(ZERO.toString()) &&
+                        tMonitoringRetrievalPlan.getImmediately().equals("1")) {
+                    tMonitoringRetrievalPlan1.setStartTime(new Date());
+                    int amount = 0;
+                    LocalDate lastDayOfMonth;
+                    switch (tMonitoringRetrievalPlan.getPlanCycle()) {
+                        case "1":
+                            amount = 1;
+                            break;
+                        case "2":
+                            amount = 7;
+                            break;
+                        case "3":
+                            LocalDate currentDate = LocalDate.now();
+                            lastDayOfMonth = currentDate.withDayOfMonth(currentDate.lengthOfMonth());
+                            amount = lastDayOfMonth.getDayOfMonth() - currentDate.getDayOfMonth();
+                            break;
+                        case "4":
+                            amount = getDayNum(3);
+                            break;
+                        case "5":
+                            amount = getDayNum(6);
+                            break;
+                        case "6":
+                            amount = getDayNum(12);
+                            break;
+                    }
+                    Calendar cal = Calendar.getInstance();
+                    cal.setTime(new Date());
+                    cal.add(Calendar.DATE, amount);
+                    Date time = cal.getTime();
+                    tMonitoringRetrievalPlan1.setEndTime(time);
+                }
+                tMonitoringRetrievalPlans.add(tMonitoringRetrievalPlan1);
+            } else {
+                SysOrg sysOrg = new SysOrg();
+                sysOrg.setPath(l.getPath());
+                sysOrg.setType(Integer.valueOf(tMonitoringRetrievalPlan.getOrgType()));
+                List<SysOrg> sysOrgs = remoteOrgService.listByParentIdAndType(sysOrg, SecurityConstants.INNER);
+                for (SysOrg s : sysOrgs) {
+                    TMonitoringRetrievalPlan plan = new TMonitoringRetrievalPlan();
+                    BeanUtils.copyProperties(tMonitoringRetrievalPlan, plan);
+                    plan.setPlanName(tMonitoringRetrievalPlan.getPlanName());
+                    plan.setOrgId(s.getId());
+                    plan.setOrgName(s.getShortName());
+                    plan.setRoleId(tMonitoringRetrievalPlan.getRoleId());
+                    plan.setRoleName(tMonitoringRetrievalPlan.getRoleName());
+                    plan.setOrgPath(s.getPath());
+                    plan.setOrgType(tMonitoringRetrievalPlan.getOrgType());
+                    plan.setPlanCycle(tMonitoringRetrievalPlan.getPlanCycle());
+                    plan.setPlanFrequency(tMonitoringRetrievalPlan.getPlanFrequency());
+                    plan.setPlanStatus(ZERO);
+                    plan.setCreateBy(SecurityUtils.getUsername());
+                    plan.setUpdateTime(DateUtils.getNowDate());
+                    plan.setUpdateBy(SecurityUtils.getUsername());
+                    plan.setCreateTime(DateUtils.getNowDate());
+                    plan.setDescription(tMonitoringRetrievalPlan.getDescription());
+                    plan.setCreateType(1);
+                    plan.setParentId(tMonitoringRetrievalPlan.getId());
+                    plan.setIsDistribute("1");
+                    if (!tMonitoringRetrievalPlan.getPlanCycle().equals(ZERO.toString()) &&
+                            tMonitoringRetrievalPlan.getImmediately().equals("1")) {
+                        plan.setStartTime(new Date());
+                        int amount = 0;
+                        LocalDate lastDayOfMonth;
+                        switch (tMonitoringRetrievalPlan.getPlanCycle()) {
+                            case "1":
+                                amount = 1;
+                                break;
+                            case "2":
+                                amount = 7;
+                                break;
+                            case "3":
+                                LocalDate currentDate = LocalDate.now();
+                                lastDayOfMonth = currentDate.withDayOfMonth(currentDate.lengthOfMonth());
+                                amount = lastDayOfMonth.getDayOfMonth() - currentDate.getDayOfMonth();
+                                break;
+                            case "4":
+                                amount = getDayNum(3);
+                                break;
+                            case "5":
+                                amount = getDayNum(6);
+                                break;
+                            case "6":
+                                amount = getDayNum(12);
+                                break;
+                        }
+                        Calendar cal = Calendar.getInstance();
+                        cal.setTime(new Date());
+                        cal.add(Calendar.DATE, amount);
+                        Date time = cal.getTime();
+                        plan.setEndTime(time);
+                    }
+                    tMonitoringRetrievalPlans.add(plan);
                 }
-                tMonitoringRetrievalPlan1.setCreateType(1);
-                i = insertTMonitoringRetrievalPlan(tMonitoringRetrievalPlan1);
-            }
-        } else {
-            SysOrg sysOrg = new SysOrg();
-            sysOrg.setPath(tMonitoringRetrievalPlan.getOrgPath());
-            sysOrg.setType(Integer.valueOf(tMonitoringRetrievalPlan.getOrgType()));
-            List<SysOrg> sysOrgs = remoteOrgService.listByParentIdAndType(sysOrg, SecurityConstants.INNER);
-            tMonitoringRetrievalPlan.setIsDistribute("1");
-            tMonitoringRetrievalPlan.setCreateType(1);
-            tMonitoringRetrievalPlanMapper.updateById(tMonitoringRetrievalPlan);
-            for (SysOrg s : sysOrgs) {
-                TMonitoringRetrievalPlan plan = new TMonitoringRetrievalPlan();
-                BeanUtils.copyProperties(tMonitoringRetrievalPlan, plan);
-                plan.setPlanName(tMonitoringRetrievalPlan.getPlanName());
-                plan.setOrgId(s.getId());
-                plan.setOrgName(s.getShortName());
-                plan.setRoleId(tMonitoringRetrievalPlan.getRoleId());
-                plan.setRoleName(tMonitoringRetrievalPlan.getRoleName());
-                plan.setOrgPath(s.getPath());
-                plan.setOrgType(tMonitoringRetrievalPlan.getOrgType());
-                plan.setPlanCycle(tMonitoringRetrievalPlan.getPlanCycle());
-                plan.setPlanFrequency(tMonitoringRetrievalPlan.getPlanFrequency());
-                plan.setPlanStatus(ZERO);
-                plan.setCreateBy(SecurityUtils.getUsername());
-                plan.setUpdateTime(DateUtils.getNowDate());
-                plan.setUpdateBy(SecurityUtils.getUsername());
-                plan.setCreateTime(DateUtils.getNowDate());
-                plan.setDescription(tMonitoringRetrievalPlan.getDescription());
-                plan.setCreateType(1);
-                plan.setId(tMonitoringRetrievalPlan.getId());
-                plan.setParentId(tMonitoringRetrievalPlan.getId());
-                plan.setIsDistribute("1");
-                //   i = tMonitoringRetrievalPlanMapper.insert(plan);
-                tMonitoringRetrievalPlans.add(plan);
             }
         }
-        if (tMonitoringRetrievalPlan.getPlanCycle().equals(ZERO.toString()) && CollectionUtils.isNotEmpty(tMonitoringRetrievalPlans)) {
+        if ((tMonitoringRetrievalPlan.getImmediately().equals("1") || tMonitoringRetrievalPlan.getPlanCycle().equals(ZERO.toString())) && CollectionUtils.isNotEmpty(tMonitoringRetrievalPlans)) {
             try {
                 iCoreMonitoringRetrievalTaskService.noCycleTask(tMonitoringRetrievalPlans);
             } catch (Exception e) {
@@ -228,6 +278,26 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
         return i;
     }
 
+    private int getDayNum(int monthsToAdd) {
+        LocalDate lastDayOfMonth;
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        LocalDate localDate = LocalDate.now();
+        LocalDate nextMonthFirstDay = null;
+        nextMonthFirstDay = localDate.plusMonths(monthsToAdd).withDayOfMonth(1);
+        lastDayOfMonth = nextMonthFirstDay.minusDays(1);
+        int dayNum = 0;
+        try {
+            Date d1 = sdf.parse(lastDayOfMonth.toString());
+            Date d2 = sdf.parse(localDate.toString());
+            long date_interval = Math.abs(d1.getTime() - d2.getTime());//绝对值
+            long day = 1000 * 24 * 60 * 60;//1000*24*60*60毫秒是一天
+            dayNum = new Long(date_interval / day).intValue();
+        } catch (Exception e) {
+            e.getMessage();
+        }
+        return dayNum;
+    }
+
     /**
      * 查询监控调阅计划列表
      *
@@ -268,12 +338,15 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
         tMonitoringRetrievalPlan.setId(id);
         tMonitoringRetrievalPlan.setOrgPath(data.getPath());
         SysOrg sysOrg1 = remoteOrgService.selectSysOrgById(sysUser.getOrgId(), SecurityConstants.INNER);
+        //如果是行社新增就没有下发的按钮
         if (sysOrg1.getType() == 3) {
             tMonitoringRetrievalPlan.setCreateType(1);
+            tMonitoringRetrievalPlan.setIsDistribute("1");
+
         } else {
             tMonitoringRetrievalPlan.setCreateType(ZERO);
+            tMonitoringRetrievalPlan.setIsDistribute(ZERO.toString());
         }
-        tMonitoringRetrievalPlan.setIsDistribute(ZERO.toString());
         return tMonitoringRetrievalPlanMapper.insert(tMonitoringRetrievalPlan);
     }
 

+ 1 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/vo/TMonitoringRetrievalPlanVO.java

@@ -14,4 +14,5 @@ import java.util.List;
 public class TMonitoringRetrievalPlanVO extends TMonitoringRetrievalPlan {
     @ApiModelProperty(value = "是否可以编辑")
     private Boolean isEdit;
+    private Long parentOrgId;
 }

+ 6 - 6
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/controller/QuestionController.java

@@ -47,12 +47,12 @@ public class QuestionController extends BaseController {
     @RequiresPermissions("question:list")
     @GetMapping("/list")
     public TableDataInfo<Question> list(QuestionPageDto query) {
-        if (ObjectUtil.isNotNull(query.getSubmitTime())) {
-            Date[] range = {
-                query.getSubmitTime(), query.getSubmitTime()
-            } ;
-            query.setSubmitRange(range);
-        }
+//        if (ObjectUtil.isNotNull(query.getSubmitTime())) {
+//            Date[] range = {
+//                query.getSubmitTime(), query.getSubmitTime()
+//            } ;
+//            query.setSubmitRange(range);
+//        }
 
         return questionService.selectPage(query);
     }

+ 2 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/dto/QuestionPageDto.java

@@ -21,9 +21,9 @@ public class QuestionPageDto extends PageDto<QuestionPageVo> {
     @ApiModelProperty(value = "整改状态")
     private Integer reformStatus;
 
-    @ApiModelProperty(value = "提交日期范围,与submitTime二选一,优先submitTime")
+    @ApiModelProperty(value = "提交日期范围")
     private Date[] submitRange;
 
-    @ApiModelProperty(value = "提交日期,与submitRange二选一,优先submitTime")
+    @ApiModelProperty(value = "整改日期")
     private Date submitTime;
 }

+ 7 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/service/impl/QuestionServiceImpl.java

@@ -86,6 +86,13 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
             Date end = DateUtil.endOfDay(query.getSubmitRange()[1]);
             wrapper.between(Question::getSubmitTime, start, end);
         }
+        if(ObjectUtil.isNotNull(query.getSubmitTime())){
+            Date start = DateUtil.beginOfDay(query.getSubmitTime());
+            wrapper.ge(Question::getReformDeadline,start);
+
+            Date end = DateUtil.endOfDay(query.getSubmitTime());
+            wrapper.le(Question::getSubmitTime,end);
+        }
         if (ObjectUtil.isNotEmpty(query.getSearchKey())) {
             wrapper.and(w ->
                     w.like(Question::getCheckContent, query.getSearchKey()).or().like(Question::getSrcTaskName, query.getSearchKey())

+ 39 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/retrieval/service/impl/CoreMonitoringRetrievalTaskServiceImpl.java

@@ -41,6 +41,7 @@ import com.xunmei.system.api.domain.SysDictData;
 import com.xunmei.system.api.domain.SysOrg;
 import com.xunmei.system.api.function.RemoteCallHandlerExecutor;
 import com.xunmei.system.api.model.LoginUser;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.scheduling.annotation.Async;
@@ -77,6 +78,8 @@ public class CoreMonitoringRetrievalTaskServiceImpl extends ServiceImpl<CoreMoni
     private ITMonitoringRetrievalPlanService itMonitoringRetrievalPlanService;
     @Autowired
     private CoreMonitoringTaskRegistrationMapper coreMonitoringTaskRegistrationMapper;
+    @Autowired
+    private RemoteOrgService remoteOrgService;
 
     @Override
     public TableDataInfo selectPage(RetrievalTaskPageDto request) {
@@ -400,7 +403,37 @@ public class CoreMonitoringRetrievalTaskServiceImpl extends ServiceImpl<CoreMoni
         queryWrapper.lambda().eq(TMonitoringRetrievalPlan::getPlanStatus, 0);
         queryWrapper.lambda().eq(TMonitoringRetrievalPlan::getIsDeleted, 0);
         queryWrapper.lambda().eq(TMonitoringRetrievalPlan::getCreateType, 1);
-        List<TMonitoringRetrievalPlan> planList = itMonitoringRetrievalPlanService.list(queryWrapper);
+        List<TMonitoringRetrievalPlan> plans = itMonitoringRetrievalPlanService.list(queryWrapper);
+        List<TMonitoringRetrievalPlan> planList = new ArrayList<>(16);
+        for (TMonitoringRetrievalPlan p : plans) {
+            SysOrg sysOrg = new SysOrg();
+            sysOrg.setPath(p.getOrgPath());
+            sysOrg.setType(Integer.valueOf(p.getOrgType()));
+            List<SysOrg> sysOrgs = remoteOrgService.listByParentIdAndType(sysOrg, SecurityConstants.INNER);
+            for (SysOrg s : sysOrgs) {
+                TMonitoringRetrievalPlan plan = new TMonitoringRetrievalPlan();
+                BeanUtils.copyProperties(p, plan);
+                plan.setPlanName(p.getPlanName());
+                plan.setOrgId(s.getId());
+                plan.setOrgName(s.getShortName());
+                plan.setRoleId(p.getRoleId());
+                plan.setRoleName(p.getRoleName());
+                plan.setOrgPath(s.getPath());
+                plan.setOrgType(p.getOrgType());
+                plan.setPlanCycle(p.getPlanCycle());
+                plan.setPlanFrequency(p.getPlanFrequency());
+                plan.setPlanStatus(0);
+                plan.setCreateBy(SecurityUtils.getUsername());
+                plan.setUpdateTime(DateUtils.getNowDate());
+                plan.setUpdateBy(SecurityUtils.getUsername());
+                plan.setCreateTime(DateUtils.getNowDate());
+                plan.setDescription(p.getDescription());
+                plan.setCreateType(1);
+                plan.setParentId(p.getId());
+                plan.setIsDistribute("1");
+                planList.add(plan);
+            }
+        }
         //按计划生成任务
         for (TMonitoringRetrievalPlan plan : planList) {
             //获取计划关联的机构
@@ -468,7 +501,11 @@ public class CoreMonitoringRetrievalTaskServiceImpl extends ServiceImpl<CoreMoni
         }*/
         CoreMonitoringRetrievalTask task = new CoreMonitoringRetrievalTask();
         task.setId(IdWorker.getId());
-        task.setTaskName(plan.getPlanName() + "第" + frequency + "次调阅");
+        if (frequency>1){
+            task.setTaskName(plan.getPlanName() + "第" + frequency + "次调阅");
+        }else {
+            task.setTaskName(plan.getPlanName() +"调阅任务");
+        }
         task.setCycle(plan.getPlanCycle());
         task.setOrgId(sysOrg.getId());
         task.setOrgPath(sysOrg.getPath());

+ 28 - 13
soc-modules/soc-modules-core/src/main/resources/mapper/access/TMonitoringRetrievalPlanMapper.xml

@@ -27,7 +27,7 @@
     </resultMap>
 
     <sql id="selectTMonitoringRetrievalPlanVo">
-        select id,create_type,start_time,end_time, plan_name, org_id, org_path, org_name, org_type, role_id, plan_cycle, plan_frequency, plan_status, create_time, create_by, update_time, update_by, description, is_deleted
+        select id,create_type,start_time,end_time, plan_name, org_id, org_path, org_name, org_type, role_id, plan_cycle, plan_frequency, plan_status, create_time, create_by, update_time, update_by, description, is_deleted,immediately
         from core_monitoring_retrieval_plan
     </sql>
 
@@ -78,35 +78,50 @@
     </select>
     <select id="selectPageList" resultType="com.xunmei.core.access.vo.TMonitoringRetrievalPlanVO">
         SELECT
-            *
+        IFNULL( b.org_id, a.org_id ) AS parentOrgId,
+        a.id,
+        a.plan_name,
+        a.org_id,
+        a.org_name,
+        a.org_type,
+        a.role_id,
+        a.role_name,
+        a.plan_cycle,
+        a.start_time,
+        a.plan_frequency,
+        a.plan_status,
+        a.end_time,
+        a.description,
+        a.is_distribute
         FROM
-            core_monitoring_retrieval_plan
+        core_monitoring_retrieval_plan a
+        LEFT JOIN core_monitoring_retrieval_plan b ON a.parent_id = b.id
         WHERE
-            is_deleted=0
+        a.is_deleted =0
         <if test="request.planName != null  and request.planName != ''">
-            AND    plan_name like concat('%', #{request.planName}, '%')
+            AND        a.plan_name like concat('%', #{request.planName}, '%')
         </if>
         <if test="request.orgId != null  and request.orgId != ''">
-            AND    org_id = #{request.orgId}
+            AND        a.org_id = #{request.orgId}
         </if>
 
         <if test="request.orgPath != null  and request.orgPath != ''">
-            and  org_path like concat( #{request.orgPath}, '%')
+            and      a.org_path like concat( #{request.orgPath}, '%')
         </if>
         <if test="request.orgType != null  and request.orgType != ''">
-            AND    org_type = #{request.orgType}
+            AND        a.org_type = #{request.orgType}
         </if>
         <if test="request.roleId != null  and request.roleId != ''">
-            AND    role_id = #{request.roleId}
+            AND        a.role_id = #{request.roleId}
         </if>
         <if test="request.planCycle != null  and request.planCycle != ''">
-            AND    plan_cycle = #{request.planCycle}
+            AND        a.plan_cycle = #{request.planCycle}
         </if>
         <if test="request.planStatus != null  and request.planStatus != ''">
-            AND    plan_status = #{request.planStatus}
+            AND        a.plan_status = #{request.planStatus}
         </if>
-        ORDER BY parent_id ASC,
-        create_time desc
+        ORDER BY     a.parent_id ASC,
+        a.create_time desc
     </select>
 
     <insert id="insertTMonitoringRetrievalPlan" parameterType="com.xunmei.core.access.domain.TMonitoringRetrievalPlan">

+ 8 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/retrieval/CoreMonitoringRetrievalTaskMapper.xml

@@ -110,10 +110,17 @@
         <if test="request.cycle != null ">
             and a.cycle = #{request.cycle}
         </if>
-        <if test="request.dateRange != null and request.dateRange.length>0">
+<!--        <if test="request.dateRange != null and request.dateRange.length>0">
             and a.ymd_date >= #{request.dateRange[0]}
             and #{request.dateRange[1]}>=a.ymd_date
+        </if>-->
+        <if test="request.dateRange != null and request.dateRange.length>0">
+            and a.plan_start_time BETWEEN #{request.dateRange[0]}
+            and #{request.dateRange[1]}
+           OR a.plan_end_time BETWEEN #{request.dateRange[0]}
+            and #{request.dateRange[1]}
         </if>
+
         <if test="request.status != null ">
             and a.status = #{request.status}
         </if>

+ 1 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysUserController.java

@@ -483,7 +483,7 @@ public class SysUserController extends BaseController {
     public void export(SysUser user, HttpServletResponse response) {
         List<UserExport> list=null;
         //如果导出模板
-        if(user.getTemplate()){
+        if(user.getTemplate()!=null&&user.getTemplate()){
             list = new ArrayList<>();
         }else{
             list= userService.down(user);

+ 5 - 5
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/dto/SysOrgExtendDto.java

@@ -46,7 +46,7 @@ public class SysOrgExtendDto  {
     @TableField(value = "name")
     private String name;
     @JsonSerialize(using = ToStringSerializer.class)
-    private Long businessLibrary;
+    private Integer businessLibrary;
 
     @ApiModelProperty(value = "上级nh")
     @JsonSerialize(using = ToStringSerializer.class)
@@ -108,20 +108,20 @@ public class SysOrgExtendDto  {
      * 业务库出入口远程控制
      */
     @ApiModelProperty(value = "业务库出入口远程控制")
-    private Long remoteControl;
+    private Integer remoteControl;
     /**
      * 离行式大堂设备
      */
     @ApiModelProperty(value = "离行式大堂设备")
-    private Long detachedLobbyEquipment;
+    private Integer detachedLobbyEquipment;
     /**
      * 离行式穿墙设备
      */
     @ApiModelProperty(value = "离行式穿墙设备")
-    private Long detachedWallPenetratingEquipment;
+    private Integer detachedWallPenetratingEquipment;
     /**
      * 加钞间远程控制
      */
     @ApiModelProperty(value = "加钞间远程控制")
-    private Long cashAddingRoomRemoteControl;
+    private Integer cashAddingRoomRemoteControl;
 }

+ 4 - 4
soc-modules/soc-modules-system/src/main/resources/bootstrap.yml

@@ -3,7 +3,7 @@ server:
   port: 9901
 
 # Spring
-spring:
+spring: 
   application:
     # 应用名称
     name: soc-system
@@ -13,11 +13,11 @@ spring:
   cloud:
     nacos:
       discovery:
-        namespace: 489e15c5-b16f-4c78-87f8-f398f73b6103
+        namespace: 13d6af5d-c288-40d6-b1ee-4fc370665aba
         # 服务注册地址
         server-addr: 10.87.10.54:8848
       config:
-        namespace: 489e15c5-b16f-4c78-87f8-f398f73b6103
+        namespace: 13d6af5d-c288-40d6-b1ee-4fc370665aba
         # 配置中心地址
         server-addr: 10.87.10.54:8848
         # 配置文件格式
@@ -27,4 +27,4 @@ spring:
           - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
 logging:
   file:
-    name: logs/${spring.application.name}/info.log
+    name: logs/${spring.application.name}/info.log

+ 2 - 2
soc-visual/soc-monitor/src/main/resources/bootstrap.yml

@@ -13,11 +13,11 @@ spring:
   cloud:
     nacos:
       discovery:
-        namespace: 34306a91-1bb7-45ce-b80d-4092dd08ea64
+        namespace: 13d6af5d-c288-40d6-b1ee-4fc370665aba
         # 服务注册地址
         server-addr: 10.87.10.54:8848
       config:
-        namespace: 34306a91-1bb7-45ce-b80d-4092dd08ea64
+        namespace: 13d6af5d-c288-40d6-b1ee-4fc370665aba
         # 配置中心地址
         server-addr: 10.87.10.54:8848
         # 配置文件格式