Bläddra i källkod

GA38填写信息导出修改

xujie 1 år sedan
förälder
incheckning
1090526c59

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

@@ -1375,6 +1375,64 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
         List<OrgPhysicalDefenseConstructionDetailExport> detailExports= null;
         detailExports = baseMapper.exportDefenseDetailExtend(dept, typeList);
 
+        try {
+            //营业网点需要单独处理:机构类型为营业网点,GA38没有营业网点数据的需要单独生成一条空的数据
+            List<OrgPhysicalDefenseConstructionDetailExport> yywdList = new ArrayList<>();
+            yywdList.addAll(detailExports);
+            Iterator<OrgPhysicalDefenseConstructionDetailExport> yywdIterator = yywdList.iterator();
+            while (yywdIterator.hasNext()){
+                OrgPhysicalDefenseConstructionDetailExport next = yywdIterator.next();
+                if (next.getOrgType() != 4){
+                    yywdIterator.remove();
+                }
+            }
+            List<OrgPhysicalDefenseConstructionDetailExport> needCreateList = yywdList;
+            if (needCreateList != null && needCreateList.size() > 0) {
+                //ga38信息根据机构分组
+                HashMap<Long, List<OrgPhysicalDefenseConstructionDetailExport>> map = new HashMap<>();
+                for (OrgPhysicalDefenseConstructionDetailExport e : needCreateList) {
+                    List<OrgPhysicalDefenseConstructionDetailExport> list = map.get(e.getOrgId());
+                    if (list == null) {
+                        list = new ArrayList<>();
+                    }
+                    list.add(e);
+                    map.put(e.getOrgId(), list);
+                }
+
+                Iterator<Map.Entry<Long, List<OrgPhysicalDefenseConstructionDetailExport>>> iterator = map.entrySet().iterator();
+                while (iterator.hasNext()) {
+                    Map.Entry<Long, List<OrgPhysicalDefenseConstructionDetailExport>> next = iterator.next();
+                    List<OrgPhysicalDefenseConstructionDetailExport> exports = next.getValue();
+                    for (OrgPhysicalDefenseConstructionDetailExport e : exports) {
+                        if (e.getGa38Type() == null || e.getGa38Type() == 1) {
+                            iterator.remove();
+                            break;
+                        }
+                    }
+                }
+
+                if (!map.isEmpty()) {
+                    Iterator<Map.Entry<Long, List<OrgPhysicalDefenseConstructionDetailExport>>> createIterator = map.entrySet().iterator();
+                    while (createIterator.hasNext()) {
+                        Map.Entry<Long, List<OrgPhysicalDefenseConstructionDetailExport>> next = createIterator.next();
+                        List<OrgPhysicalDefenseConstructionDetailExport> exports = next.getValue();
+                        if (exports != null && exports.size() > 0) {
+                            OrgPhysicalDefenseConstructionDetailExport detail = new OrgPhysicalDefenseConstructionDetailExport();
+                            BeanUtils.copyProperties(exports.get(0), detail);
+                            detail.setExtendTypeName(null);
+                            detail.setStandard(null);
+                            detail.setDateOfComplete(null);
+                            detail.setDateOfCompliance(null);
+                            detail.setReason(null);
+                            detailExports.add(detail);
+                        }
+                    }
+                }
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+
         AtomicInteger xh = new AtomicInteger();
         xh.getAndIncrement();
         detailExports.forEach(e -> {

+ 6 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/OrgPhysicalDefenseConstructionDetailExport.java

@@ -60,4 +60,10 @@ public class OrgPhysicalDefenseConstructionDetailExport {
 
 //    @ExcelProperty(value = "证书", index = 11,converter = ImgUrlConverter.class)
 //    private String certificate;
+
+    @ExcelIgnore
+    private Integer orgType;
+
+    @ExcelIgnore
+    private Integer ga38Type;
 }

+ 2 - 0
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysOrgMapper.xml

@@ -1396,9 +1396,11 @@ and a.org_path LIKE concat(#{orgPath}, '%')
             b.affiliated_area AS city,
             b.affiliated_bank AS affiliatedBank,
             b.short_name AS shortName,
+            b.type AS orgType,
             ( SELECT dict_label FROM sys_dict_data WHERE dict_type = 'sys_org_type' AND dict_value = b.type ) AS typeName,
             ( CASE b.is_lock WHEN 1 THEN '停用' ELSE '正常' END ) AS status,
             b.address AS address,
+            a.type AS ga38Type,
             ( SELECT dict_label FROM sys_dict_data WHERE dict_type = 'org_extend_type' AND dict_value = a.type ) AS extendTypeName,
             ( SELECT dict_label FROM sys_dict_data WHERE dict_type = 'org_extend_standard' AND dict_value = a.standard ) AS standard,
             IFNULL(SUBSTR( a.date_of_compliance, 1, 10 ), '' ) AS dateOfCompliance,