Explorar el Código

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

jingyuanchao hace 1 año
padre
commit
3306e24575
Se han modificado 16 ficheros con 219 adiciones y 96 borrados
  1. 8 2
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/edu/dto/CoreEduTrainingTaskReportDto.java
  2. 4 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/service/impl/AppCockpitServiceImpl.java
  3. 5 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/vo/app/AppBaseInfoVo.java
  4. 2 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/service/impl/CoreDrillTaskServiceImpl.java
  5. 8 4
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/edu/service/impl/CoreEduTrainingTaskServiceImpl.java
  6. 21 14
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/controller/ResumptionReportController.java
  7. 2 2
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/service/impl/ResumptionReportServiceImpl.java
  8. 4 4
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/ResumptionRecordServiceImpl.java
  9. 11 11
      soc-modules/soc-modules-file/src/main/java/com/xunmei/file/utils/PdfUtil.java
  10. 5 0
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/domain/SysPhysicalDefenseConstruction.java
  11. 10 1
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysDeptServiceImpl.java
  12. 19 0
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysOrgServiceImpl.java
  13. 11 0
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysPhysicalDefenseConstructionServiceImpl.java
  14. 9 3
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/ComplianceStatusConverter.java
  15. 99 53
      soc-modules/soc-modules-system/src/main/resources/mapper/system/SysOrgMapper.xml
  16. 1 1
      soc-modules/soc-modules-system/src/main/resources/mapper/system/SysPhysicalDefenseConstructionMapper.xml

+ 8 - 2
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/edu/dto/CoreEduTrainingTaskReportDto.java

@@ -25,9 +25,9 @@ public class CoreEduTrainingTaskReportDto {
 
     private String orgPath;
 
-    @NotEmpty(message = "请选择月份范围!")
+    @NotNull(message = "请选择月份!")
     @ApiModelProperty(value = "统计月份")
-    private List<Date> date;
+    private Date date;
 
     @ApiModelProperty(value = "统计月份开始日期")
     private Date startTime;
@@ -35,4 +35,10 @@ public class CoreEduTrainingTaskReportDto {
     @ApiModelProperty(value = "统计月份结束日期")
     private Date endTime;
 
+    @ApiModelProperty(value = "web统计范围月份")
+    private List<Date> monthDate;
+
+    @ApiModelProperty(value = "提交来源:1.web")
+    private Integer sourceType;
+
 }

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

@@ -124,6 +124,10 @@ public class AppCockpitServiceImpl implements AppCockpitService {
         if (ObjectUtil.isNull(baseInfoDto)) {
             baseInfoDto = new AppOrgBaseInfoDto();
         }
+
+        vo.setOnlineATMCount(baseInfoDto.getOnlineATMCount());
+        vo.setOfflineATMCount(baseInfoDto.getOffATMCount());
+
         vo.setSecurityFacilities(new AppBaseInfoSecurityFacilitiesVo());
         vo.getSecurityFacilities().setGa382015(baseInfoDto.getBankingGA382015() + baseInfoDto.getOffATMGA382015());
         vo.getSecurityFacilities().setGa382021(baseInfoDto.getBankingGA382021() + baseInfoDto.getOffATMGA382021());

+ 5 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/board/vo/app/AppBaseInfoVo.java

@@ -31,6 +31,11 @@ public class AppBaseInfoVo {
     private AppGa38RateVo offlineGa38;
      private AppGa38RateVo bankingGa38;
 
+    @ApiModelProperty("在行式自动银行数量")
+    private  int onlineATMCount;
+    @ApiModelProperty("离行式自动银行数量")
+    private int offlineATMCount;
+
     @ApiModelProperty("网点业务库总览(一、二、三、四类库)")
     private Map<String,Integer> businessStoreInfo;
 

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

@@ -644,7 +644,8 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
             response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(baseHeaderName, "utf-8"));
             response.setContentType("application/octet-stream;charset=UTF-8");
             response.setCharacterEncoding("utf-8");
-            String header = baseHeaderName + "(" + DateUtil.format(request.getStartTime(), "yyyy-MM") + "~" + DateUtil.format(request.getEndTime(), "yyyy-MM") + ")";
+            String header = baseHeaderName + "(" + DateUtil.year(request.getStartTime()) + "Q" + DateUtil.quarter(request.getStartTime())
+                    + "~" + DateUtil.year(request.getEndTime()) + "Q" + DateUtil.quarter(request.getEndTime()) + ")";
             // 数据导出
             EasyExcel.write(response.getOutputStream(), CoreDrillTaskReportVo.class)
                     .registerWriteHandler(new ValueCellWriteHandler(header)).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).sheet(baseHeaderName).doWrite(list);

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

@@ -661,8 +661,7 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
             response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(baseHeaderName, "utf-8"));
             response.setContentType("application/octet-stream;charset=UTF-8");
             response.setCharacterEncoding("utf-8");
-            request.setStartTime(DateUtil.beginOfMonth(request.getDate().get(0)));
-            request.setEndTime(DateUtil.endOfMonth(request.getDate().get(1)));
+
             String header=baseHeaderName+"("+DateUtil.format( request.getStartTime(),"yyyy-MM")+"至"+ DateUtil.format( request.getEndTime(),"yyyy-MM") +")";
             // 数据导出
             EasyExcel.write(response.getOutputStream(), CoreEduTrainingTaskReportVo.class)
@@ -691,8 +690,13 @@ public class CoreEduTrainingTaskServiceImpl extends ServiceImpl<CoreEduTrainingT
         if (ObjectUtil.isAllEmpty(planId, planIdList)) {
             return new ArrayList<>();
         }
-        request.setStartTime(DateUtil.beginOfMonth(request.getDate().get(0)));
-        request.setEndTime(DateUtil.endOfMonth(request.getDate().get(1)));
+        if (ObjectUtil.equal(request.getSourceType(),1)){
+            request.setStartTime(DateUtil.beginOfMonth(request.getMonthDate().get(0)));
+            request.setEndTime(DateUtil.endOfMonth(request.getMonthDate().get(1)));
+        }else {
+            request.setStartTime(DateUtil.beginOfMonth(request.getDate()));
+            request.setEndTime(DateUtil.endOfMonth(request.getDate()));
+        }
 
         Long orgId = request.getOrgId();
         SysOrg sysOrg = RemoteCallHandlerExecutor.executeRemoteCall(() -> orgService.selectOrgById(orgId, SecurityConstants.INNER), ErrorMsgConstants.QUERY_ORG_DATA_ERROR);

+ 21 - 14
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/controller/ResumptionReportController.java

@@ -125,6 +125,8 @@ public class ResumptionReportController {
 //            request.setStartTime(beginOfQuarter);
 //            request.setEndTime(endOfQuarter);
 //        }
+        request.setStartTime(DateUtil.beginOfMonth(DateUtils.parseDate(request.getDate().get(0))));
+        request.setEndTime(DateUtil.endOfMonth(DateUtils.parseDate(request.getDate().get(1))));
         String dateTitle=getStandbyPowerExportTitle(request);
         request.setExportDateTitle(dateTitle);
         resumptionReportService.standbyPowerExport(request, response);
@@ -134,6 +136,8 @@ public class ResumptionReportController {
     @RequiresPermissions("core:resumptionReport:list")
     @GetMapping("/standbyPower")
     public AjaxResult standbyPower(ResumptionDTO resumptionDTO) throws ExecutionException, InterruptedException, TimeoutException {
+        resumptionDTO.setStartTime(DateUtil.beginOfMonth(DateUtils.parseDate(resumptionDTO.getDate().get(0))));
+        resumptionDTO.setEndTime(DateUtil.endOfMonth(DateUtils.parseDate(resumptionDTO.getDate().get(1))));
         String time=getStandbyPowerExportTitle(resumptionDTO);
         AjaxResult ajaxResult = AjaxResult.success();
         List<IntrusionTestReportVO> intrusionTestReportVOList = resumptionReportService.standbyPower(resumptionDTO);
@@ -146,20 +150,23 @@ public class ResumptionReportController {
 
     private String getStandbyPowerExportTitle(ResumptionDTO resumptionDTO)
     {
-        if (null == resumptionDTO.getSearchTime()) {
-            DateTime beginOfQuarter = DateUtil.beginOfQuarter(new java.util.Date());
-            DateTime endOfQuarter = DateUtil.endOfQuarter(new Date());
-            resumptionDTO.setStartTime(beginOfQuarter);
-            resumptionDTO.setEndTime(endOfQuarter);
-            LocalDate currentDate = LocalDate.now();
-            int month = currentDate.getMonthValue();
-            int quarter = (month - 1) / 3 + 1;
-            return currentDate.getYear() + "年第" + quarter + "季度";
-        } else {
-            String[] split = resumptionDTO.getSearchTime().split("-");
-            Integer month = (Integer.valueOf(split[1]) - 1) / 3 + 1;
-            return  split[0] + "年第" + month + "季度";
-        }
+//        if (null == resumptionDTO.getSearchTime()) {
+//            DateTime beginOfQuarter = DateUtil.beginOfQuarter(new java.util.Date());
+//            DateTime endOfQuarter = DateUtil.endOfQuarter(new Date());
+//            resumptionDTO.setStartTime(beginOfQuarter);
+//            resumptionDTO.setEndTime(endOfQuarter);
+//            LocalDate currentDate = LocalDate.now();
+//            int month = currentDate.getMonthValue();
+//            int quarter = (month - 1) / 3 + 1;
+//            return currentDate.getYear() + "年第" + quarter + "季度";
+//        } else {
+//            String[] split = resumptionDTO.getSearchTime().split("-");
+//            Integer month = (Integer.valueOf(split[1]) - 1) / 3 + 1;
+//            return  split[0] + "年第" + month + "季度";
+//        }
+        String title = DateUtil.year(resumptionDTO.getStartTime()) + "Q" + DateUtil.quarter(resumptionDTO.getStartTime())
+                + "~" + DateUtil.year(resumptionDTO.getEndTime()) + "Q" + DateUtil.quarter(resumptionDTO.getEndTime()) + ")";
+        return title;
     }
 
     @ApiOperation(value = "离行式自助银行巡检报表导出")

+ 2 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/reportForms/resumption/service/impl/ResumptionReportServiceImpl.java

@@ -493,7 +493,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
 
     @Override
     public List<IntrusionTestReportVO> standbyPower(ResumptionDTO resumptionDTO) throws ExecutionException, InterruptedException, TimeoutException{
-        if (null != resumptionDTO.getSearchTime()) {
+/*        if (null != resumptionDTO.getSearchTime()) {
             String[] split = resumptionDTO.getSearchTime().split("-");
             Integer s = Integer.valueOf(split[1]);
             String end = split[0] + "-" + (s + 2) + "-01";
@@ -508,7 +508,7 @@ public class ResumptionReportServiceImpl implements ResumptionReportService {
             }
             resumptionDTO.setStartTime(startTime);
             resumptionDTO.setEndTime(endTime);
-        }
+        }*/
         if (null == resumptionDTO.getOrgId()) {
             resumptionDTO.setOrgId(SecurityUtils.getLoginUser().getOrgId());
         }

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

@@ -337,19 +337,19 @@ public class ResumptionRecordServiceImpl extends ServiceImpl<ResumptionRecordMap
             throw new ServiceException("请选择机构再导出数据");
         }
         pageDto.setPageNum(1L);
-        pageDto.setPageSize(10001L);
+        pageDto.setPageSize(200001L);
         final List<ResumptionRecordPageVo> data = this.selectList(pageDto).getRows();
         if (CollectionUtil.isEmpty(data)) {
             throw new ServiceException("暂无可用数据导出!");
         }
 
-        if (data.size() > 10000) {
-            throw new ServiceException("每次最多导出10000条");
+        if (data.size() > 200000) {
+            throw new ServiceException("每次最多导出200000条");
         }
 
         Map<String, SysDictData> dicts = remoteDictDataService.selectDictByeType("resumption_status", SecurityConstants.INNER)
                 .stream().collect(Collectors.toMap(SysDictData::getDictValue, v -> v));
-        List<ResumptionRecordPageVo> limit = data.stream().limit(10000).collect(Collectors.toList());
+        List<ResumptionRecordPageVo> limit = data.stream().limit(200000).collect(Collectors.toList());
         int index = 1;
         for (ResumptionRecordPageVo r : limit) {
             r.setIndex(index++);

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

@@ -230,18 +230,18 @@ public class PdfUtil {
             }
         }
 
-        //日常登记簿-布撤防数据
-        PdfUtil.createPDFCell(tableFont, table, "布撤防情况", Element.ALIGN_MIDDLE, 10, 1);
-
-        PdfUtil.createPDFCell(tableFont, table, "控制器", Element.ALIGN_MIDDLE, 4, 1);
-        PdfUtil.createPDFCell(tableFont, table, "状态", Element.ALIGN_MIDDLE, 3, 1);
-        PdfUtil.createPDFCell(tableFont, table, "时间", Element.ALIGN_MIDDLE, 3, 1);
         List<Map<String, List<Map<String, Object>>>> protectionList = (List<Map<String, List<Map<String, Object>>>>) data.get("protection");
-        if (ObjectUtil.isEmpty(protectionList)) {
-            PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 4, 1);
-            PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 3, 1);
-            PdfUtil.createPDFCell(tableFont, table, "/", Element.ALIGN_MIDDLE, 3, 1);
-        } else {
+
+        if (ObjectUtil.isNotEmpty(protectionList)) {
+
+            //日常登记簿-布撤防数据
+            PdfUtil.createPDFCell(tableFont, table, "布撤防情况", Element.ALIGN_MIDDLE, 10, 1);
+
+            PdfUtil.createPDFCell(tableFont, table, "控制器", Element.ALIGN_MIDDLE, 4, 1);
+            PdfUtil.createPDFCell(tableFont, table, "状态", Element.ALIGN_MIDDLE, 3, 1);
+            PdfUtil.createPDFCell(tableFont, table, "时间", Element.ALIGN_MIDDLE, 3, 1);
+
+
             for (Map<String, List<Map<String, Object>>> listMap : protectionList) {
                 for (Map.Entry<String, List<Map<String, Object>>> listEntry : listMap.entrySet()) {
                     IotAlarmSubsystem subsystem = JSON.parseObject(listEntry.getKey(), IotAlarmSubsystem.class);

+ 5 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/domain/SysPhysicalDefenseConstruction.java

@@ -2,6 +2,8 @@ package com.xunmei.system.domain;
 
 import java.util.Date;
 
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@@ -48,11 +50,13 @@ public class SysPhysicalDefenseConstruction extends BaseEntity {
      */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @ApiModelProperty(value = "达标日期")
+    @TableField(fill = FieldFill.UPDATE)
     private Date dateOfCompliance;
 
 
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     @ApiModelProperty(value = "计划达标日期")
+    @TableField(fill = FieldFill.UPDATE)
     private Date dateOfComplete;
 
     /**
@@ -85,6 +89,7 @@ public class SysPhysicalDefenseConstruction extends BaseEntity {
     private Long orgId;
 
     @ApiModelProperty(value = "未达标原因")
+    @TableField(fill = FieldFill.UPDATE)
     private String reason;
 
 

+ 10 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysDeptServiceImpl.java

@@ -396,7 +396,16 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
         List<SysOrgVO> cacheList = null;
         Boolean isOk = RedisUtils.hasKey(CacheConstants.ORG_CACHE_LIST_KEY);
         if (!isOk) {
-            cacheList = orgService.loadingOrgCache();
+            synchronized (SysDeptServiceImpl.class){
+                Boolean isOk2 = RedisUtils.hasKey(CacheConstants.ORG_CACHE_LIST_KEY);
+                if(!isOk2){
+                    cacheList = orgService.loadingOrgCache();
+                }
+                else {
+                    cacheList = RedisUtils.getCacheList(CacheConstants.ORG_CACHE_LIST_KEY);
+                }
+            }
+
         } else {
             cacheList = RedisUtils.getCacheList(CacheConstants.ORG_CACHE_LIST_KEY);
         }

+ 19 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysOrgServiceImpl.java

@@ -27,10 +27,12 @@ import com.xunmei.common.security.utils.DictUtils;
 import com.xunmei.common.security.utils.SecurityUtils;
 import com.xunmei.system.api.domain.SysDictData;
 import com.xunmei.system.api.domain.SysOrg;
+import com.xunmei.system.api.domain.SysOrgExtend;
 import com.xunmei.system.api.vo.FindOrgTypes;
 import com.xunmei.system.api.vo.SysOrgVO;
 import com.xunmei.system.dto.SysOrgDto;
 import com.xunmei.system.dto.SysPhysicalDefenseConstructionDTO;
+import com.xunmei.system.mapper.SysOrgExtendMapper;
 import com.xunmei.system.mapper.SysOrgMapper;
 import com.xunmei.system.mapper.SysPhysicalDefenseConstructionMapper;
 import com.xunmei.system.mapper.SysUserMapper;
@@ -68,6 +70,9 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
     @Autowired
     private SysPhysicalDefenseConstructionMapper sysPhysicalDefenseConstructionMapper;
 
+    @Autowired
+    private SysOrgExtendMapper sysOrgExtendMapper;
+
     private static List<SysOrg> handleTree(Map<Long, List<SysOrg>> map, Long parentId) {
         List<SysOrg> orgList = map.get(parentId);
         if (ObjectUtil.isNotEmpty(orgList)) {
@@ -825,6 +830,15 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
                 org.setAffiliatedArea(hsAndDqOrgNames.get(1));
             }
 
+            // 机构类型 变化后 需删除 机构扩展新和 GA38 达标信息
+            if(!ObjectUtil.equal(originalOrg.getType(),org.getType()))
+            {
+                // 删除GA38 信息
+                sysPhysicalDefenseConstructionMapper.delete(new LambdaQueryWrapper<SysPhysicalDefenseConstruction>().eq(SysPhysicalDefenseConstruction::getOrgId,org.getId()));
+                // 删除机构扩展信息
+                sysOrgExtendMapper.delete(new LambdaQueryWrapper<SysOrgExtend>().eq(SysOrgExtend::getOrgId,org.getId()));
+            }
+
             isOk = this.updateById(org);
 
         } else {
@@ -889,8 +903,13 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public boolean removeOrg(Long orgId) {
         boolean rel = this.removeById(orgId);
+        // 删除机构扩展信息,GA38 信息
+        sysPhysicalDefenseConstructionMapper.delete(new LambdaQueryWrapper<SysPhysicalDefenseConstruction>().eq(SysPhysicalDefenseConstruction::getOrgId,orgId));
+        sysOrgExtendMapper.delete(new LambdaQueryWrapper<SysOrgExtend>().eq(SysOrgExtend::getOrgId,orgId));
+
         /*
          * 重置缓存
          */

+ 11 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysPhysicalDefenseConstructionServiceImpl.java

@@ -2,6 +2,7 @@ package com.xunmei.system.service.impl;
 
 import java.util.List;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.xunmei.common.core.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -112,6 +113,16 @@ public class SysPhysicalDefenseConstructionServiceImpl extends ServiceImpl<SysPh
     @Override
     public int updateSysPhysicalDefenseConstruction(SysPhysicalDefenseConstruction sysPhysicalDefenseConstruction) {
         sysPhysicalDefenseConstruction.setUpdateTime(DateUtils.getNowDate());
+        // 未达标需要将达标日期置为空
+        if(ObjectUtil.equal(sysPhysicalDefenseConstruction.getStandard(),"3"))
+        {
+            sysPhysicalDefenseConstruction.setDateOfCompliance(null);
+        }
+        else //达标后清空计划达标时间
+        {
+            sysPhysicalDefenseConstruction.setDateOfComplete(null);
+            sysPhysicalDefenseConstruction.setReason("");
+        }
         return sysPhysicalDefenseConstructionMapper.updateById(sysPhysicalDefenseConstruction);
     }
 

+ 9 - 3
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/ComplianceStatusConverter.java

@@ -28,10 +28,16 @@ public class ComplianceStatusConverter implements Converter<String> {
 
     @Override
     public CellData convertToExcelData(String s, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception {
-        if ("1".equals(s)) {
-            return new CellData("达标");
-        }else {
+        if ("2021".equals(s)) {
+            return new CellData("2021");
+        }
+        else if ("2015".equals(s)) {
+            return new CellData("2015");
+        }
+        else if ("1".equals(s)) {
             return new CellData("未达标");
+        }else {
+            return new CellData("未上传");
         }
     }
 }

+ 99 - 53
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysOrgMapper.xml

@@ -814,45 +814,79 @@ and
 
     </select>
     <select id="selectConstructionDetail" resultType="com.xunmei.system.util.ConstructionDetailExport">
+<!--        SELECT-->
+<!--            a.org_id AS orgId,-->
+<!--            IFNULL( b.ownership, 0 ) AS ownership,-->
+<!--            IF-->
+<!--                (-->
+<!--                            IF-->
+<!--                                ( LOCATE( 1, GROUP_CONCAT( a.standard ))> 0, 1, 0 )+-->
+<!--                            IF-->
+<!--                                ( LOCATE( 2, GROUP_CONCAT( a.standard ))> 0, 1, 0 )>= 1,-->
+<!--                            1,-->
+<!--                            0-->
+<!--                ) AS complianceStatus,-->
+<!--            IFNULL(SUBSTR( a.date_of_compliance, 1, 10 ), '' ) AS complianceDate,-->
+<!--            IF-->
+<!--                (-->
+<!--                            IF-->
+<!--                                ( LOCATE( 1, GROUP_CONCAT( a.standard ))> 0, 1, 0 )+-->
+<!--                            IF-->
+<!--                                ( LOCATE( 2, GROUP_CONCAT( a.standard ))> 0, 1, 0 )>= 1,-->
+<!--                            NULL,-->
+<!--                            a.reason-->
+<!--                ) AS reason,-->
+<!--            IFNULL(SUBSTR( a.date_of_complete, 1, 10 ), '' ) AS completeDate,-->
+<!--            c.address as address,-->
+<!--            c.affiliated_area as city,-->
+<!--            c.affiliated_bank as orgName,-->
+<!--            c.short_name as networkName-->
+<!--        FROM-->
+<!--            sys_org c-->
+<!--            LEFT JOIN sys_org_physical_defense_construction a ON c.id=a.org_id-->
+<!--            LEFT JOIN sys_org_extend b ON a.org_id = b.org_id-->
+<!--        WHERE c.type=4-->
+<!--          and c.deleted = 0-->
+<!--          and c.is_lock = 0-->
+<!--          and a.type =1-->
+<!--          and c.path like concat(#{orgPath}, '%')-->
+<!--        GROUP BY-->
+<!--            a.org_id-->
         SELECT
-            a.org_id AS orgId,
-            IFNULL( b.ownership, 0 ) AS ownership,
-            IF
-                (
-                            IF
-                                ( LOCATE( 1, GROUP_CONCAT( a.standard ))> 0, 1, 0 )+
-                            IF
-                                ( LOCATE( 2, GROUP_CONCAT( a.standard ))> 0, 1, 0 )>= 1,
-                            1,
-                            0
-                ) AS complianceStatus,
-            IFNULL(SUBSTR( a.date_of_compliance, 1, 10 ), '' ) AS complianceDate,
-<!--            a.date_of_compliance AS complianceDate,-->
-            IF
-                (
-                            IF
-                                ( LOCATE( 1, GROUP_CONCAT( a.standard ))> 0, 1, 0 )+
-                            IF
-                                ( LOCATE( 2, GROUP_CONCAT( a.standard ))> 0, 1, 0 )>= 1,
-                            NULL,
-                            a.reason
-                ) AS reason,
-            IFNULL(SUBSTR( a.date_of_complete, 1, 10 ), '' ) AS completeDate,
-<!--            a.date_of_complete AS completeDate,-->
-            c.address as address,
-            c.affiliated_area as city,
-            c.affiliated_bank as orgName,
-            c.short_name as networkName
+        c.id AS orgId,
+        IFNULL( b.ownership, 0 ) AS ownership,
+        case when a.banking2021=1 then 2021 when a.banking2015=1 then 2015 when a.unGA38=1 then 1  else 0 end as complianceStatus,
+        IFNULL(SUBSTR( a.date_of_compliance, 1, 10 ), '' ) AS complianceDate,
+        IF
+        (
+        a.unGA38=1,
+        a.reason,
+        ''
+        ) AS reason,
+        IF( a.unGA38=1, IFNULL(SUBSTR( a.date_of_complete, 1, 10 ), '' ),'') AS completeDate,
+        c.address as address,
+        c.address as address,
+        c.affiliated_area as city,
+        c.affiliated_bank as orgName,
+        c.short_name as networkName
         FROM
-            sys_org_physical_defense_construction a
-                INNER JOIN sys_org c ON c.id=a.org_id
-                LEFT JOIN sys_org_extend b ON a.org_id = b.org_id
+        sys_org c
+        LEFT JOIN (select org_id,date_of_compliance,reason,date_of_complete,
+                        banking2021,
+                        if(banking2015 > 0 and banking2021 = 0, 1, 0) as banking2015,
+                        if(unGA38 >0 and banking2015 = 0 and banking2021 = 0, 1, 0) as unGA38
+                        from (SELECT org_id,Max(date_of_compliance) as date_of_compliance,reason,date_of_complete,
+                        sum(standard = 1) banking2021,
+                        sum(standard = 2) banking2015,
+                        sum(standard = 3) unGA38
+                        FROM sys_org_physical_defense_construction
+                        WHERE type = 1
+                        GROUP BY org_id) t1) a ON c.id = a.org_id
+        LEFT JOIN sys_org_extend b ON c.id = b.org_id
         WHERE c.type=4
-          and c.deleted = 0
-          and c.is_lock = 0
-          and c.path like concat(#{orgPath}, '%')
-        GROUP BY
-            a.org_id
+        and c.deleted = 0
+        and c.is_lock = 0
+        and c.path like concat(#{orgPath}, '%')
     </select>
     <select id="getReachNumber" resultType="java.lang.Integer">
         select SUM(a.size) from (select org_id,if(count(*) > 0,1,0) as size from  sys_org_physical_defense_construction where standard in (1,2) and type = 1 GROUP BY org_id) a
@@ -860,6 +894,7 @@ and
         where 1=1
           AND b.deleted = 0
           and b.is_lock = 0
+          and b.type=4
           AND b.path LIKE concat(#{orgPath}, '%')
     </select>
     <select id="getOwnership" resultType="java.lang.Integer">
@@ -884,19 +919,29 @@ and
     </select>
     <select id="getLibrary" resultType="java.util.Map">
         SELECT
-            COUNT( a.business_library_type ) AS total,
-            IFNULL( sum( IF ( a.business_library_type = 1, 1, 0 )), 0 ) AS one,
-            IFNULL( SUM( IF ( a.business_library_type = 2, 1, 0 )), 0 ) AS two,
-            IFNULL( SUM( IF ( a.business_library_type = 3, 1, 0 )), 0 ) AS three,
-            IFNULL( SUM( IF ( a.business_library_type = 4, 1, 0 )), 0 ) AS four
+            sum( a.yywd + a.zxywk ) AS total,
+            a.one,
+            a.two,
+            a.three,
+            a.four
         FROM
-            sys_org_extend a
-                LEFT JOIN sys_org b ON a.org_id = b.id
-        where
-        1=1
-        and    b.path LIKE concat(#{orgPath}, '%')
-        and b.is_lock = 0
-        and b.deleted = 0
+            (
+                SELECT
+                    IFNULL( sum( IF ( b.type = 6, 1, 0 )), 0 ) AS yywd,
+                    IFNULL( sum( IF ( b.type = 4 AND a.business_library = 1, 1, 0 )), 0 ) AS zxywk,
+                    IFNULL( sum( IF ( a.business_library_type = 1, 1, 0 )), 0 ) AS one,
+                    IFNULL( SUM( IF ( a.business_library_type = 2, 1, 0 )), 0 ) AS two,
+                    IFNULL( SUM( IF ( a.business_library_type = 3, 1, 0 )), 0 ) AS three,
+                    IFNULL( SUM( IF ( a.business_library_type = 4, 1, 0 )), 0 ) AS four
+                FROM
+                    sys_org b
+                        LEFT JOIN sys_org_extend a ON a.org_id = b.id
+                WHERE
+                  b.is_lock = 0
+                  and b.path LIKE concat(#{orgPath}, '%')
+                  and b.deleted = 0
+                  AND (b.type = 4 OR b.type = 5 OR b.type = 6)
+            ) a
     </select>
     <select id="getCollectLibrary" resultType="java.lang.Integer">
         SELECT
@@ -970,10 +1015,10 @@ and
         from (
 
                  select
-                     (select IFNULL( SUM( a.lobby_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 4 and b.is_lock = 0 and b.deleted = 0 and b.path  LIKE concat(#{orgPath}, '%')) as onLineThroughWalls,
-                     (select IFNULL( SUM( a.wall_penetrating_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 4 and b.is_lock = 0 and b.deleted = 0 and b.path LIKE concat(#{orgPath}, '%')) as onLineLobbyImplement,
-                     (select IFNULL( SUM( a.lobby_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 5 and b.is_lock = 0 and b.deleted = 0 and b.path LIKE concat(#{orgPath}, '%')) as departureThroughWalls,
-                     (select IFNULL( SUM( a.wall_penetrating_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 5 and b.is_lock = 0 and b.deleted = 0 and b.path LIKE concat(#{orgPath}, '%')) as departureLobbyImplement
+                     (select IFNULL( SUM( a.lobby_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 4 and b.is_lock = 0 and b.deleted = 0 and b.path  LIKE concat(#{orgPath}, '%')) as onLineLobbyImplement,
+                     (select IFNULL( SUM( a.wall_penetrating_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 4 and b.is_lock = 0 and b.deleted = 0 and b.path LIKE concat(#{orgPath}, '%')) as onLineThroughWalls,
+                     (select IFNULL( SUM( a.lobby_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 5 and b.is_lock = 0 and b.deleted = 0 and b.path LIKE concat(#{orgPath}, '%')) as departureLobbyImplement,
+                     (select IFNULL( SUM( a.wall_penetrating_equipment ), 0 )  from sys_org_extend a LEFT JOIN sys_org b on a.org_id = b.id WHERE 1=1 and b.type = 5 and b.is_lock = 0 and b.deleted = 0 and b.path LIKE concat(#{orgPath}, '%')) as departureThroughWalls
                  from dual
              ) t
     </select>
@@ -1240,9 +1285,10 @@ and
         select count(*) from  sys_org a
         LEFT JOIN sys_org_extend b  on a.id = b.org_id
         WHERE 1=1
-          and (b.inner_count > 0 or b.outside_count > 0)
           and a.deleted = 0
           and a.is_lock = 0
+          and a.type = 4
+          and b.askari = 1
           and a.path LIKE concat( #{orgPath}, '%' )
     </select>
     <select id="getHeadSafeCheckNumber" resultType="java.lang.Integer">

+ 1 - 1
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysPhysicalDefenseConstructionMapper.xml

@@ -50,7 +50,7 @@
 
     <select id="selectListByPath" resultType="com.xunmei.system.dto.SysPhysicalDefenseConstructionDTO">
         select op.*,o.path as orgPath from sys_org o INNER JOIN sys_org_physical_defense_construction op ON o.id = op.org_id
-        where o.is_lock != 1 and o.deleted = 0
+        where o.is_lock != 1 and o.deleted = 0 and o.type = 4
         <if test="type != null  and type != ''">
             and op.type = #{type}
         </if>