Bläddra i källkod

项目上报 跟随省站调整所属区县关系。
项目组成员调整获取方式 以及去重

徐滕 2 veckor sedan
förälder
incheckning
0798bdc7bf

+ 9 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageNewService.java

@@ -3127,6 +3127,15 @@ public class RuralProjectMessageNewService extends CrudService<RuralProjectMessa
                     }
                 }
             }
+            // name相同的只保留第一个
+            Set<String> seenNames = new LinkedHashSet<>();
+            Iterator<WorkStaffCertificate> dupIt = list.iterator();
+            while(dupIt.hasNext()){
+                WorkStaffCertificate w = dupIt.next();
+                if(!seenNames.add(w.getName())){
+                    dupIt.remove();
+                }
+            }
         }
         return list;
     }

+ 3 - 14
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectMessageService.java

@@ -3933,17 +3933,6 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
             //获取专业类型
             List<MainDictDetail> certificateMajor = DictUtils.getMainDictList("certificate_major");
             for (WorkStaffCertificate certificateInfo: userCertificateList) {
-                //如果consultantInfoList中已经存在该负责人则跳过
-                boolean alreadyExists = false;
-                for (RuralReportConsultant c : consultantInfoList) {
-                    if (projectRecords.getProjectMasterId().equals(c.getZixunyuan())) {
-                        alreadyExists = true;
-                        break;
-                    }
-                }
-                if (alreadyExists) {
-                    continue;
-                }
                 currentConsultant.setZhucezigezhID(certificateInfo.getNum());
                 currentConsultant.setZhucezigezhKey(certificateInfo.getName());
                 for (MainDictDetail type : certificateMajor) {
@@ -4083,14 +4072,14 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                         //判定区是否为空
                         if(StringUtils.isNotBlank(records.getCounty())){
                             //判定区县级是否含有如下三个地区如果有则将该地区放入市级地区获取该地区的子集放到区级地区
-                            if("沭阳县".equals(records.getCounty()) || "昆山市".equals(records.getCounty()) || "泰兴市".equals(records.getCounty())){
+                            /*if("沭阳县".equals(records.getCounty()) || "昆山市".equals(records.getCounty()) || "泰兴市".equals(records.getCounty())){
                                 Area district = this.getProjectReportedAreaByName(records.getCounty(), null);
                                 if(null != district) {
                                     reported.setS2(district.getId());
                                     List<Area> projectReportedAreaByParentId = this.getProjectReportedAreaByParentId(district.getId());
                                     reported.setS3(projectReportedAreaByParentId.get(0).getId());
                                 }
-                            }else{
+                            }else{*/
                                 Area district = this.getProjectReportedAreaByName(records.getCounty(), areaCity.getId());
                                 if(null != district){
                                     reported.setS3(district.getId());
@@ -4100,7 +4089,7 @@ public class RuralProjectMessageService extends CrudService<RuralProjectMessageD
                                         reported.setS3(areaList.get(0).getId());
                                     }
                                 }
-                            }
+                            /*}*/
                         }
                     }
                 }

+ 1 - 1
src/main/resources/mappings/modules/projectcontentinfo/ProjectcontentinfoDao.xml

@@ -626,7 +626,7 @@
 	<select id="getCertificateByUser" resultType="com.jeeplus.modules.workstaff.entity.WorkStaffCertificate">
 		select a.name,a.num,a.major from work_staff_certificate a
 		left join work_staff_achives wsa on a.staff_id = wsa.id
-		where wsa.user_id = #{userId} and a.del_flag=0 order by a.name
+		where wsa.user_id = #{userId} and a.del_flag=0 order by a.name, a.update_date desc
 	</select>
 
 	<insert id="insertContentBasedInfo">