Kaynağa Gözat

Merge branch 'V0.0.2' of http://10.87.10.227:4000/jzyd_yyds/soc into V0.0.2

jiawuxian 2 yıl önce
ebeveyn
işleme
b555185bbf

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

@@ -207,6 +207,7 @@ INSERT INTO `sys_dict_data`( `dict_sort`, `dict_label`, `dict_value`, `dict_type
 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 ( 0, '已发布', '1', 'message_status', NULL, 'default', 'N', '0', '超级管理员', '2023-09-13 17:09:19', '', NULL, NULL);
 
 delete from sys_menu where menu_name in('公告通知','公告通知详情','公告通知编辑','新增公告通知','删除公告通知','发布公告通知','取消发布');
+delete from sys_menu where menu_name in(2208,2209,2210,2211,2212,2213,2196);
 INSERT INTO `sys_menu`(`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2196, '公告通知', 2207, 1, 'core/message', 'core/message/index', NULL, 1, 0, 'C', '0', '0', 'core:notification:list', '1', 'dashboard', NULL, '超级管理员', '2023-09-13 17:50:26', '超级管理员', '2023-09-15 16:47:45', '');
 INSERT INTO `sys_menu`(`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2208, '公告通知详情', 2196, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:notification:query', '1', '#', NULL, '超级管理员', '2023-09-19 15:17:27', '', NULL, '');
 INSERT INTO `sys_menu`(`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2209, '公告通知编辑', 2196, 2, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:notification:edit', '1', '#', NULL, '超级管理员', '2023-09-19 15:17:56', '', NULL, '');

+ 9 - 0
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/Eto/SysOrgTreeRequestDto.java

@@ -6,10 +6,19 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
+import java.util.List;
+
 @Data
 public class SysOrgTreeRequestDto {
 
     private Long orgId;
 
     private Boolean includeSub=false;
+
+    // 排查指定机构名称
+    private String excludeOrgName;
+
+    // 排查指定机构编码
+    private String excludeOrgCode;
+
 }

+ 7 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/drill/dto/CoreDrillTaskEditDto.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.xunmei.common.core.domain.drill.domain.CoreDrillTaskToUser;
+import com.xunmei.common.core.domain.edu.domain.CoreEduTrainingTaskToUser;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -49,4 +50,10 @@ public class CoreDrillTaskEditDto {
     @ApiModelProperty(value = "任务用户信息", notes = "1:参与人员,2:缺席人员")
     private List<CoreDrillTaskToUser> taskUserList;
 
+    @ApiModelProperty(value = "任务用户信息", notes = "参与人员")
+    private List<CoreDrillTaskToUser> absenceList;
+
+    @ApiModelProperty(value = "任务用户信息", notes = "缺席人员")
+    private List<CoreDrillTaskToUser> absentList;
+
 }

+ 7 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/drill/vo/CoreDrillTaskDetailVo.java

@@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.xunmei.common.core.domain.drill.domain.CoreDrillTaskToUser;
+import com.xunmei.common.core.domain.edu.domain.CoreEduTrainingTaskToUser;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -100,6 +101,12 @@ public class CoreDrillTaskDetailVo {
     @ApiModelProperty(value = "任务用户信息", notes = "1:参与人员,2:缺席人员")
     private List<CoreDrillTaskToUser> taskUserList;
 
+    @ApiModelProperty(value = "任务用户信息", notes = "参与人员")
+    private List<CoreDrillTaskToUser> absenceList;
+
+    @ApiModelProperty(value = "任务用户信息", notes = "缺席人员")
+    private List<CoreDrillTaskToUser> absentList;
+
 
     @ApiModelProperty(value = "登记簿地址")
     private String pdfUrl;

+ 14 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/service/impl/CoreDrillTaskServiceImpl.java

@@ -20,6 +20,7 @@ import com.xunmei.common.core.domain.R;
 import com.xunmei.common.core.domain.drill.domain.*;
 import com.xunmei.common.core.domain.drill.dto.*;
 import com.xunmei.common.core.domain.drill.vo.*;
+import com.xunmei.common.core.domain.edu.domain.CoreEduTrainingTaskToUser;
 import com.xunmei.common.core.domain.edu.vo.CoreEduTrainingTaskReportVo;
 import com.xunmei.common.core.enums.ExportPdfType;
 import com.xunmei.common.core.enums.OrgTypeEnum;
@@ -63,6 +64,7 @@ import java.time.LocalDateTime;
 import java.util.*;
 import java.util.concurrent.CompletableFuture;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 import static com.xunmei.common.core.utils.StringUtils.calculatePercent;
 
@@ -195,6 +197,9 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
         }
         if (ObjectUtil.isNotEmpty(userList)) {
             detailVo.setTaskUserList(userList);
+            Map<Integer, List<CoreDrillTaskToUser>> collect = userList.stream().collect(Collectors.groupingBy(CoreDrillTaskToUser::getType));
+            detailVo.setAbsenceList(collect.get(1));
+            detailVo.setAbsentList(collect.get(2));
         }
         final List<SysDictData> drillTypeDictList = DictUtils.getDictCache(DictConstants.CORE_DRILL_TYPE);
         if (ObjectUtil.isNotEmpty(drillTypeDictList) && ObjectUtil.isNotEmpty(detailVo.getType())) {
@@ -255,7 +260,12 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
         } else {
             coreDrillTask.setHostId(SecurityUtils.getUserId());
         }
-        List<CoreDrillTaskToUser> taskUserList = request.getTaskUserList();
+        List<CoreDrillTaskToUser> taskUserList;
+        if (ObjectUtil.isNotEmpty(request.getTaskUserList())) {
+            taskUserList = request.getTaskUserList();
+        } else {
+            taskUserList = Stream.of(request.getAbsenceList(), request.getAbsentList()).flatMap(Collection::stream).collect(Collectors.toList());
+        }
         if (ObjectUtil.isNotEmpty(taskUserList)) {
             checkTheSameUser(taskUserList);
             for (CoreDrillTaskToUser taskToUser : taskUserList) {
@@ -519,7 +529,7 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
             this.update(updateWrapper);
         });
 
-        return AjaxResult.error("正在生成pdf,请稍后刷新页面查看!");
+        return AjaxResult.success("正在生成pdf,请稍后刷新页面查看!");
     }
 
     private Map<String, Object> getFtlDrill(CoreDrillTaskDetailVo task) {
@@ -527,6 +537,7 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
 
         String orgName = task.getOrgName();
         String drillSite = task.getDrillSite();
+        String imageData = task.getImageList();
         String drillTime = DateUtil.format(task.getDrillTime(), "yyyy-MM-dd HH:mm:ss");
         String hostName = task.getHostName() == null ? StringUtil.EMPTY_STRING : task.getHostName();
         String typeText = task.getTypeText() == null ? StringUtil.EMPTY_STRING : task.getTypeText();
@@ -539,6 +550,7 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
         data.put("drillTime", StringUtils.isNotEmpty(drillTime) ? drillTime : StringUtil.EMPTY_STRING);
         data.put("hostName", StringUtils.isNotEmpty(hostName) ? hostName : StringUtil.EMPTY_STRING);
         data.put("typeText", StringUtils.isNotEmpty(typeText) ? typeText : StringUtil.EMPTY_STRING);
+        data.put("imageData", StringUtils.isNotEmpty(imageData) ? Arrays.asList(imageData.split(",")) : StringUtil.EMPTY_STRING);
         data.put("recorderName", StringUtils.isNotEmpty(recorderName) ? recorderName : StringUtil.EMPTY_STRING);
         data.put("presetCase", StringUtils.isNotEmpty(presetCase) ? "预设案由: " + presetCase : StringUtil.EMPTY_STRING);
         data.put("drillSituation", StringUtils.isNotEmpty(drillSituation) ? "演练情况: " + drillSituation : StringUtil.EMPTY_STRING);

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/edu/service/impl/CoreEduTrainingTaskServiceImpl.java

@@ -521,7 +521,7 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
         } catch (Exception e) {
             throw new RuntimeException(e);
         }*/
-        return AjaxResult.error("正在生成pdf,请稍后刷新页面查看!");
+        return AjaxResult.success("正在生成pdf,请稍后刷新页面查看!");
     }
 
     private Map<String, Object> getFtlEdu(CoreEduTrainingTaskDetailVo task) {

+ 1 - 1
soc-modules/soc-modules-file/src/main/java/com/xunmei/file/service/LocalSysFileServiceImpl.java

@@ -201,7 +201,7 @@ public class LocalSysFileServiceImpl implements ISysFileService {
         final PdfPTable table = pdfTableVo.getTable();
         final BaseFont fs = pdfTableVo.getFs();
         final Font tableFont = pdfTableVo.getTableFont();
-        PdfUtil.dealHeader(document, fs, "学 习 教 育 记 录", 24);
+        PdfUtil.dealHeader(document, fs, "预 案 演 练 记 录", 24);
         PdfUtil.dealDrillBody(document, table, tableFont, data);
         document.close();
         writer.close();

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

@@ -20,13 +20,7 @@ import java.util.Map;
 public class PdfUtil {
 
 
-    public static void main(String[] args) throws Exception {
-        //Itext4Pdf();
-        long start = System.currentTimeMillis();
-        // createPdf("d:/test.pdf");
-        long end = System.currentTimeMillis();
-        System.out.println(end - start);
-    }
+
 
     public static ItextPdfTableVo createTable(String filename, int numColumns, int fontSize) throws Exception {
         Document document = new Document(PageSize.A4, 0, 0, 50, 0);//SUPPRESS
@@ -223,7 +217,7 @@ public class PdfUtil {
         createPDFCell(tableFont, table, "演练项目", Element.ALIGN_CENTER, 1, 1);
         createPDFCell(tableFont, table, data.get("typeText").toString(), Element.ALIGN_CENTER, 5, 1);
 
-        //内容
+        //预设案由
         PdfPCell contentCell = new PdfPCell();
         contentCell.setColspan(6);
         Paragraph content = new Paragraph();
@@ -233,15 +227,28 @@ public class PdfUtil {
         contentCell.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
         table.addCell(contentCell);
 
-        //总结
+        //演练情况
         PdfPCell noteCell = new PdfPCell();
         noteCell.setColspan(6);
         Paragraph paragraph = new Paragraph();
         String noteText = data.get("drillSituation").toString();
         paragraph.add(new Chunk(noteText, tableFont));
         noteCell.addElement(paragraph);
-        noteCell.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
+        noteCell.setBorder(Rectangle.LEFT | Rectangle.RIGHT);
         table.addCell(noteCell);
+        //演练情况 图片填充
+        final PdfPTable imageTable1 = getImage((List<String>) data.get("imageData"), 6);
+        final PdfPCell cell1 = new PdfPCell();
+        cell1.setNoWrap(false);
+        cell1.setPaddingLeft(8f);
+        cell1.setPaddingRight(8f);
+        cell1.setPaddingBottom(8f);
+        cell1.setPaddingTop(8f);
+        cell1.setColspan(6);
+        cell1.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
+        cell1.addElement(imageTable1);
+        table.addCell(cell1);
+
         //签字区域
         PdfPCell signCell = new PdfPCell();
         signCell.setColspan(6);
@@ -251,7 +258,7 @@ public class PdfUtil {
         signCell.setBorder(Rectangle.LEFT | Rectangle.RIGHT);
         table.addCell(signCell);
         //图片填充
-        final PdfPTable imageTable = getImage((List<String>) data.get("image"), 12);
+        final PdfPTable imageTable = getImage((List<String>) data.get("image"), 6);
         final PdfPCell cell = new PdfPCell();
         cell.setNoWrap(false);
         cell.setPaddingLeft(8f);

+ 5 - 0
soc-modules/soc-modules-sync/src/main/java/com/xunmei/sync/config/ThirdPartySystemConfig.java

@@ -32,6 +32,11 @@ public class ThirdPartySystemConfig {
     private String fjnxSyncOrgCustomRootOrgCode;
 
     /**
+     * 同步机构时原因省联社机构更改的新名称
+     */
+    private String fjnxSyncOrgOriginalRootOrgNewName;
+
+    /**
      * 同步用户默认密码
      */
     private String fjnxSyncUserDefaultPassword;

+ 7 - 6
soc-modules/soc-modules-sync/src/main/java/com/xunmei/sync/service/impl/FJNXSyncServiceImpl.java

@@ -1038,9 +1038,10 @@ public class FJNXSyncServiceImpl implements IFJNXSyncService {
                 log.error("没有机构编码,机构名称:{}", item.getOrgName());
                 return;
             }
-            if(ObjectUtil.equal(item.getShortName(),"省联社"))
+            if(ObjectUtil.equal(item.getShortName(),"省联社") && !StringUtil.isNullOrEmpty(thirdPartySystemConfig.getFjnxSyncOrgOriginalRootOrgNewName()) )
             {
-                item.setShortName("省联社职能部门");
+                item.setOrgName(thirdPartySystemConfig.getFjnxSyncOrgOriginalRootOrgNewName());
+                item.setShortName(thirdPartySystemConfig.getFjnxSyncOrgOriginalRootOrgNewName());
             }
 
             FjnxOrg tempOrg = new FjnxOrg();
@@ -1049,10 +1050,10 @@ public class FJNXSyncServiceImpl implements IFJNXSyncService {
             tempOrg.setLastSyncTime(syncDateTime);
             tempOrg.setBusinessParentCode(tempOrg.getOrgParent());
             tempOrg.setTreeShowParentCode(tempOrg.getOrgParent());
-            if(item.getOrgCode().equals("M33000000"))
-            {
-                String a="M33000000";
-            }
+//            if(item.getOrgCode().equals("M33000000"))
+//            {
+//                String a="M33000000";
+//            }
 
             Optional<FjnxOrgBusinessRelation> first = fjnxOrgBusinessRelationList.stream().filter(b -> b.getOrgCode().equals(item.getOrgCode())).findFirst();
             if (first.isPresent()) {

+ 11 - 6
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysDeptController.java

@@ -157,12 +157,17 @@ public class SysDeptController extends BaseController {
     }
 
     @PostMapping("/deptTree/business")
-    public AjaxResult businessDeptTree(@RequestBody String excludeOrgCode) {
-        if(StringUtils.isEmpty(excludeOrgCode))
-        {
-            excludeOrgCode="900000000";
-        }
-        return success(deptService.selectBusinessTreeList(excludeOrgCode));
+    public AjaxResult businessDeptTree(@RequestBody SysOrgTreeRequestDto request) {
+//        if(ObjectUtil.isEmpty(request) )
+//        {
+//            request=new SysOrgTreeRequestDto();
+//        }
+//        if(StringUtils.isEmpty(request.getExcludeOrgCode()))
+//        {
+//            // 默认排查省联社
+//            request.setExcludeOrgCode("900000000");
+//        }
+        return success(deptService.selectBusinessTreeList(request));
     }
 
     /**

+ 1 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/ISysDeptService.java

@@ -38,7 +38,7 @@ public interface ISysDeptService extends IService<SysDept> {
      */
     List<SysOrgVO> selectHangsheTreeList();
 
-    List<SysOrgVO> selectBusinessTreeList(String excludeOrgCode);
+    List<SysOrgVO> selectBusinessTreeList(SysOrgTreeRequestDto request);
 
     /**
      * 获取缓存的行社及行社上级机构

+ 44 - 5
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysDeptServiceImpl.java

@@ -149,14 +149,14 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
     }
 
     @Override
-    public List<SysOrgVO> selectBusinessTreeList(String excludeOrgCode) {
+    public List<SysOrgVO> selectBusinessTreeList(SysOrgTreeRequestDto request) {
         SysOrg sysOrg = null;
         SysOrgVO excludeOrg = null;
         sysOrg = getLoginUserOrg();
         List<SysOrgVO> cacheList = getOrgCache();
         List<SysOrgVO> orgs = new ArrayList<>();
-        if(StringUtils.isNotEmpty(excludeOrgCode)){
-            final Optional<SysOrgVO> first = cacheList.stream().filter(x -> ObjectUtil.equal(x.getCode(), excludeOrgCode)).findFirst();
+        if(StringUtils.isNotEmpty(request.getExcludeOrgCode())){
+            final Optional<SysOrgVO> first = cacheList.stream().filter(x -> ObjectUtil.equal(x.getCode(), request.getExcludeOrgCode())).findFirst();
             if(first.isPresent())
             {
                 excludeOrg=first.get();
@@ -181,10 +181,40 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
             }
             orgs.add(org);
         }
+        if(!StringUtils.isEmpty(request.getExcludeOrgName()))
+        {
+            orgs= excludeOrgByOrgName(orgs,request.getExcludeOrgName());
+        }
+
         return generateTree(orgs, sysOrg);
     }
 
     /**
+     * 排除指定机构名称的机构以及该机构的下级机构
+     * @param orgs 待排出机构列表
+     * @param excludeOrgName 需排出机构的名称
+     * @return
+     */
+    private List<SysOrgVO> excludeOrgByOrgName(List<SysOrgVO> orgs,String excludeOrgName)
+    {
+        List<SysOrgVO> result = new ArrayList<>();
+
+        final List<SysOrgVO> excludeOrgList = orgs.stream().filter(x -> ObjectUtil.equal(x.getName(), excludeOrgName)).collect(Collectors.toList());
+        if(ObjectUtil.isEmpty(excludeOrgList))
+        {
+            return orgs;
+        }
+        for (SysOrgVO org : orgs) {
+            if(excludeOrgList.stream().anyMatch(e-> org.getPath().startsWith(e.getPath())))
+            {
+                continue;
+            }
+            result.add(org);
+        }
+        return result;
+    }
+
+    /**
      * 获取缓存的行社及行社上级机构
      *
      * @param path
@@ -265,7 +295,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
             return new ArrayList<>();
         }
 
-        final List<SysOrgVO> orgList = getWholePathTreeOrgFromCache(sysOrg, cacheList,request.getIncludeSub());
+        final List<SysOrgVO> orgList = getWholePathTreeOrgFromCache(sysOrg, cacheList,request.getIncludeSub(),request.getExcludeOrgName());
 
         return generateTree(orgList,null);
     }
@@ -276,7 +306,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
      * @param cacheList
      * @return
      */
-    public List<SysOrgVO> getWholePathTreeOrgFromCache(SysOrgVO orgVO,List<SysOrgVO> cacheList,Boolean includeSub) {
+    public List<SysOrgVO> getWholePathTreeOrgFromCache(SysOrgVO orgVO,List<SysOrgVO> cacheList,Boolean includeSub,String excludeOrgName) {
         List<SysOrgVO> selfAndAllChildOrglist =null;
         if(includeSub)
         {
@@ -286,6 +316,8 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
             selfAndAllChildOrglist=cacheList.stream().filter(c ->ObjectUtil.equal(orgVO.getId(),c.getId())).collect(Collectors.toList());
         }
 
+
+
         Set<Long> parentIds = new HashSet<>();
             Arrays.stream(orgVO.getPath().split("-")).map(p -> Long.parseLong(p))
                     .collect(Collectors.toList())
@@ -298,6 +330,13 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
                 .filter(o -> parentIds.contains(o.getId()))
                 .collect(Collectors.toList()));
 
+        // 排除指定机构名称的机构以及该机构的下级机构
+        if(StringUtils.isNotEmpty(excludeOrgName))
+        {
+            selfAndAllChildOrglist= excludeOrgByOrgName(selfAndAllChildOrglist,excludeOrgName);
+        }
+
+
         return selfAndAllChildOrglist;
     }