luowei 2 роки тому
батько
коміт
11ce7200b5

+ 1 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/controller/TMonitoringRetrievalPlanController.java

@@ -70,6 +70,7 @@ public class TMonitoringRetrievalPlanController extends BaseController {
         }
         ajax.put("check", admin);
         ajax.put("isEdit", sysOrg.getId());
+        ajax.put("xf",sysOrg.getType());
         return ajax;
     }
 

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

@@ -156,56 +156,24 @@ 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");
-                }
-                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");
-                if (!tMonitoringRetrievalPlan.getPlanCycle().equals(ZERO.toString()) && tMonitoringRetrievalPlan.getImmediately().equals("1")) {
-                    plan.setStartTime(new Date());
+        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()) {
@@ -234,9 +202,70 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
                     cal.setTime(new Date());
                     cal.add(Calendar.DATE, amount);
                     Date time = cal.getTime();
-                    plan.setEndTime(time);
+                    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);
                 }
-                tMonitoringRetrievalPlans.add(plan);
             }
         }
         if ((tMonitoringRetrievalPlan.getImmediately().equals("1") || tMonitoringRetrievalPlan.getPlanCycle().equals(ZERO.toString())) && CollectionUtils.isNotEmpty(tMonitoringRetrievalPlans)) {
@@ -309,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);
     }
 

+ 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
         # 配置文件格式