Parcourir la source

修改部分逻辑

gaoxiong il y a 2 ans
Parent
commit
4786d73db1

+ 2 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/domain/AppResumptionDataNfc.java

@@ -1,5 +1,6 @@
 package com.xunmei.core.resumption.domain;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
@@ -38,6 +39,7 @@ public class AppResumptionDataNfc extends Model<AppResumptionDataNfc> implements
      */
     private Long nfcId;
 
+
     /**
      * 提交时间
      */

+ 1 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/domain/AppResumptionDataRemarkimg.java

@@ -43,4 +43,5 @@ public  class AppResumptionDataRemarkimg extends Model<AppResumptionDataRemarkim
      */
     private String imgPath;
 
+
 }

+ 7 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/AppResumptionDataNfcService.java

@@ -30,4 +30,11 @@ public interface AppResumptionDataNfcService extends IService<AppResumptionDataN
     List<ResumptionNfcInfoVo> findPointNfcData(Long taskid, Long orgId);
 
     List<ResumptionNfcVo> findNfcByAreaIdAndOrgId(Set<Long> nfcBindIdList, Long orgId, Long planId);
+
+    /**
+     * 根据履职任务获取数nfc扫描数据
+     * @param taskId
+     * @return
+     */
+    List<AppResumptionDataNfc> findDataByResumptionId(Long taskId);
 }

+ 32 - 6
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/ResumptionBusiness.java

@@ -432,12 +432,36 @@ public class ResumptionBusiness {
                 r.setPointdataid(IDHelper.id());
             }
         });
+        List<AppResumptionDataNfc> nfcData = appResumptionDataNfcService.findDataByResumptionId(resumption.getId());
+
         //获取nfc
-        List<ResumptionNfcVo> nfclists = appResumptionDataNfcService.findNfcByAreaIdAndOrgId(nfcBindIdList, resumption.getOrgId(), resumption.getPlanId());
+        List<ResumptionNfcVo> nfclists = appResumptionDataNfcService.findNfcByAreaIdAndOrgId(nfcBindIdList,
+                resumption.getOrgId(), resumption.getPlanId());
 
         //对nfc进行去重
         List<ResumptionNfcVo> nfclist = nfclists.stream().collect(Collectors.collectingAndThen
                 (Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(ResumptionNfcVo -> ResumptionNfcVo.getNfccdoe()))), ArrayList::new));
+
+
+        //如果数据存在则填充数据
+        for (ResumptionNfcVo nfcVo : nfclist) {
+            Long nfcid = nfcVo.getNfcId();
+            nfcVo.setStatus(0);
+            if (nfcData.size() > 0) {
+                for (AppResumptionDataNfc nfcDatum : nfcData) {
+                    Long pId = nfcDatum.getNfcId();
+                    if (nfcid.equals(pId)) {
+                        if (nfcDatum.getStatus() != null) {
+                            nfcVo.setStatus(nfcDatum.getStatus());
+                        }
+                        nfcVo.setScanMethod(nfcDatum.getScanMethod().longValue());
+                        nfcVo.setImg(nfcDatum.getImg());
+                    }
+                }
+            }
+        }
+
+
         List<AppResumptionDataRemarkimg> allImgs = appResumptionTaskDataRemarkimgService
                 .list(new LambdaUpdateWrapper<AppResumptionDataRemarkimg>()
                         .eq(AppResumptionDataRemarkimg::getResumptionId, request.getTaskId()));
@@ -511,7 +535,9 @@ public class ResumptionBusiness {
         Date time = new Date();
         List<AppResumptionDataNfc> nfcList = request.getNfcData();
         //传值的时候,要新增nfcId(页面取checkId)pointId
-        nfcList.stream().forEach(n -> n.setResumptionId(request.getResumptionId()).setId(IDHelper.id()));
+        nfcList.stream().forEach(n -> {
+            n.setResumptionId(request.getResumptionId()).setId(IDHelper.id());
+        });
         //传值的时候,要新增nfcId(页面取checkId)pointId
         appResumptionDataNfcService.saveBatch(nfcList);
         //获取未扫描的nfc数据
@@ -520,7 +546,7 @@ public class ResumptionBusiness {
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         sdf.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
         List<CoreResumptionDataProtection> resumptionProtections = new ArrayList<>();
-        SysOrg org=  remoteOrgService.selectSysOrgById(resumption.getOrgId(), SecurityConstants.INNER);
+        SysOrg org = remoteOrgService.selectSysOrgById(resumption.getOrgId(), SecurityConstants.INNER);
 //        List<AppResumptionTaskDataRemark> remarkDtoList = new ArrayList<>();
         for (AppResumptionDataDto appResumptionDataDto : resumptionDataList) {
             AppResumptionData data = new AppResumptionData();
@@ -577,9 +603,9 @@ public class ResumptionBusiness {
             }
 
             if (ObjectUtil.equal(request.getIsSubmit(), 1) && ObjectUtil.equal(appResumptionDataDto.getResValue(), 1)) {
-               if(! NumberUtil.isNumber(appResumptionDataDto.getRectificationDeadline())){
-                   throw new ServerException(String.format("履职内容‘%s’的整改期限值错误",appResumptionDataDto.getPointname()));
-               }
+                if (!NumberUtil.isNumber(appResumptionDataDto.getRectificationDeadline())) {
+                    throw new ServerException(String.format("履职内容‘%s’的整改期限值错误", appResumptionDataDto.getPointname()));
+                }
 
                 Question question = Question.builder()
                         .srcTaskId(resumption.getId())

+ 8 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppResumptionDataNfcServiceImpl.java

@@ -1,5 +1,6 @@
 package com.xunmei.core.resumption.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.xunmei.core.resumption.domain.AppResumptionDataNfc;
 import com.xunmei.core.resumption.mapper.AppResumptionDataNfcMapper;
@@ -76,4 +77,11 @@ public class AppResumptionDataNfcServiceImpl extends ServiceImpl<AppResumptionDa
         param.put("planId", planId);
         return baseMapper.findNfcByAreaIdAndOrgId(param);
     }
+
+    @Override
+    public List<AppResumptionDataNfc> findDataByResumptionId(Long taskId) {
+        QueryWrapper<AppResumptionDataNfc> qw = new QueryWrapper<>();
+        qw.lambda().eq(AppResumptionDataNfc::getResumptionId,taskId);
+        return baseMapper.selectList(qw);
+    }
 }

+ 2 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/resumptionRegister/ResumptionNfcVo.java

@@ -32,7 +32,8 @@ public class ResumptionNfcVo {
     @JsonSerialize(using = ToStringSerializer.class)
     private Long areaId;
     @JsonSerialize(using = ToStringSerializer.class)
-    private Long nfcid;
+    private Long nfcId;
+
     private Long scanMethod;
     private String img;
 

+ 4 - 4
soc-modules/soc-modules-core/src/main/resources/bootstrap.yml

@@ -1,9 +1,9 @@
 # Tomcat
 server:
-  port: 9002
+  port: 9009
 
 # Spring
-spring: 
+spring:
   application:
     # 应用名称
     name: soc-core
@@ -13,11 +13,11 @@ spring:
   cloud:
     nacos:
       discovery:
-        namespace: 34306a91-1bb7-45ce-b80d-4092dd08ea64
+        namespace: 489e15c5-b16f-4c78-87f8-f398f73b6103
         # 服务注册地址
         server-addr: 10.87.10.54:8848
       config:
-        namespace: 34306a91-1bb7-45ce-b80d-4092dd08ea64
+        namespace: 489e15c5-b16f-4c78-87f8-f398f73b6103
         # 配置中心地址
         server-addr: 10.87.10.54:8848
         # 配置文件格式

+ 5 - 4
soc-modules/soc-modules-core/src/main/resources/mapper/edu/CoreEduTrainingPlanMapper.xml

@@ -447,8 +447,9 @@
         p.plan_status,
         p.issue,
         p.standard,
-        P.belong_org_id,
-        P.belong_org_name from core_edu_training_plan p left join sys_user u on p.update_by=u.id
+        p.belong_org_id,
+        p.belong_org_name
+        from core_edu_training_plan p left join sys_user u on p.update_by=u.id
         where p.deleted = 0 and p.parent_id is null
         and p.standard=1 and p.issue=1
         <if test="request.planRoleId!=null">
@@ -488,8 +489,8 @@
         p.plan_status,
         p.issue,
         p.standard,
-        P.belong_org_id as belongOrgId,
-        P.belong_org_name as belongOrgName
+        p.belong_org_id as belongOrgId,
+        p.belong_org_name as belongOrgName
         from core_edu_training_plan p
         left join sys_user u on p.update_by = u.id
         <if test="request.planRoleId!=null">

+ 2 - 8
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/AppResumptionDataNfcMapper.xml

@@ -52,22 +52,16 @@
         a.CODE AS nfccdoe,
         d.id AS pointId,
         a.area_id AS areaId,
-        a.id AS nfcid,
-        e.point_scan as mustScan,
-        if(dnf.STATUS is null,0,dnf.STATUS) as status,
-        dnf.scan_method,
-        dnf.img
+        a.id AS nfcId,
+        e.point_scan as mustScan
         FROM
         sys_nfc_bind a
         LEFT JOIN sys_area_check c ON a.check_id = c.id
         LEFT JOIN core_resumption_rule_point d ON a.area_id = d.area_id
         LEFT JOIN core_resumption_plan_to_point e ON e.point_id = d.id
-        LEFT JOIN core_resumption_data_nfc dnf ON dnf.nfc_id = a.id
         where
         a.org_id = #{orgId}
-
         AND e.plan_id = #{planId}
-
         AND a.check_id IS NOT NULL
         AND a.ENABLE = 0
         AND e.point_scan = 1