فهرست منبع

修改---企业未审核时,数据和企业需要限制导入。

zhouhaijun 1 هفته پیش
والد
کامیت
c1f25a06b5

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 444 - 1300
log/cic-data-reportin.out


+ 49 - 33
src/main/java/com/bootdo/datas/service/impl/GyDataServiceImpl.java

@@ -309,31 +309,39 @@ public class GyDataServiceImpl implements GyDataService {
                 continue;
             }
 
-            GyUnitDO tmpGyUnitDO = gyUnitDao.getGyUnitByCreditCode(row.getCell(17).getStringCellValue());
-
-            if (ObjectUtils.isEmpty(tmpGyUnitDO) || !"1".equals(tmpGyUnitDO.getAuditStatus())) {
-                unitNoAudit++;
-                continue;
-            }
 
             // 企业单位
             GyUnitDO gyUnitDO = new GyUnitDO();
             // 数据信息
             GyDataDO gyDataDO = new GyDataDO();
 
+            GyUnitDO tmpGyUnitDO = gyUnitDao.getGyUnitByCreditCode(row.getCell(17).getStringCellValue());
+            //判断是否已经在gu_unit表中添加企业信息
+            if (ObjectUtils.isEmpty(tmpGyUnitDO) ) {
+                //没有添加企业信息,   需要进行企业信息的添加,审核状态为【未审核】
+                try {
+                    this.createGyUnitDO(gyUnitDO, row);
+                    gyUnitDO.setCreateTime(new Date());
+                    gyUnitDO.setStatus("0");
+                    gyUnitDO.setAuditStatus("0");
+                    gyUnitDao.save(gyUnitDO);
+                    log.info("========first_load_data======create_gy_unit======sucess:"+gyUnitDO.toString());
+                } catch (Exception e) {
+                    log.error("error enterprise-only : {}", e.getMessage());
+                }
+                unitNoAudit++;
+                break;
+            } else {
+                if ( !"1".equals(tmpGyUnitDO.getAuditStatus()) ){
+                    unitNoAudit++;
+                    break;
+                }
+            }
+
             //无数据导出
             if ("/".equals(row.getCell(1).getStringCellValue()) && row.getCell(16).getStringCellValue() !=null && !"/".equals(row.getCell(16).getStringCellValue())) {
-                gyUnitDO.setReporterUnit(row.getCell(16).getStringCellValue());// 数据处理者名称
-                gyUnitDO.setCreditCode(row.getCell(17).getStringCellValue());// 统一社会信用代码(机构代码 )
-                gyUnitDO.setUnitProvince(dataProvince);//所在地区(省)
-                gyUnitDO.setUnitCity(row.getCell(19).getStringCellValue());//所在地区(市)
-                gyUnitDO.setUnitCharacter(row.getCell(20).getStringCellValue());//数据处理者性质
-                gyUnitDO.setIndustryTypeOne(row.getCell(21).getStringCellValue());//所属行业
-                gyUnitDO.setIndustryTypeTwo(row.getCell(22).getStringCellValue());//主营业务范围
-                gyUnitDO.setDataSecurityMan(row.getCell(23).getStringCellValue());//数据安全负责人姓名
-                gyUnitDO.setDataSecurityOffice(row.getCell(24).getStringCellValue());//数据安全负责人职务
-                gyUnitDO.setDataSecurityWay(row.getCell(25).getStringCellValue());//数据安全负责人联系方式
-                int count = gyUnitDao.getGyUnit(gyUnitDO);
+
+                int count = gyUnitDao.getGyUnit(this.createGyUnitDO(gyUnitDO,row));
                 if (count == 0) {
                     try {
                         gyUnitDO.setCreateTime(new Date());
@@ -361,17 +369,10 @@ public class GyDataServiceImpl implements GyDataService {
             gyDataDO.setDataProportion(row.getCell(13).getStringCellValue());//覆盖占比
             gyDataDO.setDataPrecision(row.getCell(14).getStringCellValue());//数据精度
             gyDataDO.setDataPrecisionDes(row.getCell(15).getStringCellValue());//数据精度描述
-            gyUnitDO.setReporterUnit(row.getCell(16).getStringCellValue());// 数据处理者名称
-            gyUnitDO.setCreditCode(row.getCell(17).getStringCellValue());// 统一社会信用代码(机构代码 )
-            gyUnitDO.setUnitProvince(dataProvince);//所在地区(省)
-            gyUnitDO.setUnitCity(row.getCell(19).getStringCellValue());//所在地区(市)
-            gyUnitDO.setUnitCharacter(row.getCell(20).getStringCellValue());//数据处理者性质
-            gyUnitDO.setIndustryTypeOne(row.getCell(21).getStringCellValue());//所属行业
-            gyUnitDO.setIndustryTypeTwo(row.getCell(22).getStringCellValue());//主营业务范围
-            gyUnitDO.setDataSecurityMan(row.getCell(23).getStringCellValue());//数据安全负责人姓名
-            gyUnitDO.setDataSecurityOffice(row.getCell(24).getStringCellValue());//数据安全负责人职务
-            gyUnitDO.setDataSecurityWay(row.getCell(25).getStringCellValue());//数据安全负责人联系方式
-            gyUnitList.add(gyUnitDO);
+
+            //添加企业信息
+            gyUnitList.add(this.createGyUnitDO(gyUnitDO,row));
+
             gyDataDO.setDataHandleType(row.getCell(26).getStringCellValue());//数据处理方式
             gyDataDO.setDataResult(row.getCell(27).getStringCellValue());//数据目的
             gyDataDO.setIsAlgorithmHandle(row.getCell(28).getStringCellValue());//是否涉及算法处理
@@ -519,6 +520,21 @@ public class GyDataServiceImpl implements GyDataService {
     }
 
 
+    private GyUnitDO createGyUnitDO(GyUnitDO gyUnitDO, Row row){
+        gyUnitDO.setReporterUnit(row.getCell(16).getStringCellValue());// 数据处理者名称
+        gyUnitDO.setCreditCode(row.getCell(17).getStringCellValue());// 统一社会信用代码(机构代码 )
+        gyUnitDO.setUnitProvince(row.getCell(18).getStringCellValue());//所在地区(省)
+        gyUnitDO.setUnitCity(row.getCell(19).getStringCellValue());//所在地区(市)
+        gyUnitDO.setUnitCharacter(row.getCell(20).getStringCellValue());//数据处理者性质
+        gyUnitDO.setIndustryTypeOne(row.getCell(21).getStringCellValue());//所属行业
+        gyUnitDO.setIndustryTypeTwo(row.getCell(22).getStringCellValue());//主营业务范围
+        gyUnitDO.setDataSecurityMan(row.getCell(23).getStringCellValue());//数据安全负责人姓名
+        gyUnitDO.setDataSecurityOffice(row.getCell(24).getStringCellValue());//数据安全负责人职务
+        gyUnitDO.setDataSecurityWay(row.getCell(25).getStringCellValue());//数据安全负责人联系方式
+        return gyUnitDO;
+    }
+
+
     @Override
     public GyDataImportDTO get(Long id) {
         return gyDataDao.get(id);
@@ -573,24 +589,24 @@ public class GyDataServiceImpl implements GyDataService {
                 //通过数据id,查询数据信息
                 GyDataImportDTO importDTO = gyDataDao.get(data.getId());
                 if(Objects.nonNull(importDTO)){
-                    log.error("=====================发送短信了===数据信息查询==="+importDTO.toString());
+                    log.info("=====================发送短信了===数据信息查询==="+importDTO.toString());
                     //发送短息
                     if("1".equals(importDTO.getAuditStage())){
                         //审核阶段:   1:市级,2:省级
                         GyUnitDO gyUnitDO = gyUnitDao.getGyUnitByCreditCode(importDTO.getGyUnitId());
-                        log.error("=====================发送短信了===企业信息查询==="+gyUnitDO.toString());
+                        log.info("=====================发送短信了===企业信息查询==="+gyUnitDO.toString());
                         if(Objects.nonNull(gyUnitDO)){
                             try {
-                                log.error("=====================发送短信了===start==="+gyUnitDO.toString());
+                                log.info("=====================发送短信了===start==="+gyUnitDO.toString());
                                 messageService.importance(gyUnitDO.getDataSecurityWay()+","+gyUnitDO.getMobilePhone(),
                                         importDTO.getDataName());
-                                log.error("=====================发送短信了===end==="+gyUnitDO.toString());
+                                log.info("=====================发送短信了===end==="+gyUnitDO.toString());
                             } catch (Exception e) {
                                 log.error("=============messageService.importance=======error======="+e.getMessage());
                                 e.printStackTrace();
                             }
                         }else {
-                            log.error("=========企业的组织机构代码:"+importDTO.getGyUnitId()+",查询不到对应的企业信息===========");
+                            log.info("=========企业的组织机构代码:"+importDTO.getGyUnitId()+",查询不到对应的企业信息===========");
                         }
                     }
                 }else {

+ 1 - 0
src/main/resources/application-prod.yml

@@ -90,6 +90,7 @@ api-allow-ip: 127.0.0.1,172.18.105.10,172.18.105.11,218.89.240.185
 
 #登录页地址
 login.url: http://218.89.240.185:19087/login
+#login.url: http://172.18.105.20:8080/
 
 #短信网关
 message_gateway:

+ 2 - 2
src/main/resources/application.yml

@@ -21,9 +21,9 @@ spring:
 #    开发环境
 #  active: dev
 #    测试环境
-#   active: test
+   active: test
 #    #生产环境
-    active: prod
+#    active: prod
   servlet:
     multipart:
       max-file-size: 30Mb

+ 2 - 2
src/main/resources/mybatis/datas/UnitMapper.xml

@@ -68,7 +68,7 @@
             a.UPDATE_TIME as updateTime
         from gy_unit a
         <where>
-            a.STATUS = '0'
+            a.STATUS = '0' and a.audit_status = '1'
             <if test="reporterUnit != null and reporterUnit != ''">and REPORTER_UNIT like
                 CONCAT('%',#{reporterUnit},'%')
             </if>
@@ -150,7 +150,7 @@
     <update id="remove">
         update gy_unit
         set status = '1',
-        del_unigue_key = ID,
+        del_unigue_key = ID
         where ID = #{value}
     </update>