소스 검색

修改用户数据,没有时新增判定新增

anderx 1 년 전
부모
커밋
fd242aba51
1개의 변경된 파일1개의 추가작업 그리고 24개의 파일을 삭제
  1. 1 24
      src/main/java/com/goafanti/customer/service/impl/UserArchivesServiceImpl.java

+ 1 - 24
src/main/java/com/goafanti/customer/service/impl/UserArchivesServiceImpl.java

@@ -120,48 +120,25 @@ public class UserArchivesServiceImpl extends BaseMybatisDao< UserArchivesMapper>
      */
     @Override
     public UserArchives update(UserArchives userArchives) {
-        UserArchives use =  this.queryById(userArchives.getId());
         int count = 0;
         if (userArchives.getAppearancePatentCount()!=null){
             count+=userArchives.getAppearancePatentCount();
-            use.setAppearancePatentCount(userArchives.getAppearancePatentCount());
-        }else {
-            count+=use.getAppearancePatentCount();
         }
         if (userArchives.getInventionPatentCount()!=null){
             count+=userArchives.getInventionPatentCount();
-            use.setInventionPatentCount(userArchives.getInventionPatentCount());
-        }else {
-            count+=use.getInventionPatentCount();
         }
         if (userArchives.getUtilityModelCount() !=null){
             count+=userArchives.getUtilityModelCount();
-            use.setUtilityModelCount(userArchives.getUtilityModelCount());
-        }else {
-            count+=use.getSoftwareWorksCount();
         }
         if (userArchives.getOtherCount()!=null){
             count+=userArchives.getOtherCount();
-            use.setOtherCount(userArchives.getOtherCount());
-        }else {
-            count+=use.getOtherCount();
         }
         userArchives.setPatentCount(count);
-        use.setPatentCount(count);
-        if (userArchives.getFinancialData()!=null){
-            use.setFinancialData(userArchives.getFinancialData());
-        }
-        if (userArchives.getInterviewIdeas()!=null){
-            use.setInterviewIdeas(userArchives.getInterviewIdeas());
-        }
-        if (userArchives.getEarlyCommunication()!=null){
-            use.setEarlyCommunication(userArchives.getEarlyCommunication());
-        }
         if(userArchives.getId()==null){
             return insert(userArchives);
         }else {
             this.userArchivesMapper.update(userArchives);
-            return use;
+            return this.queryById(userArchives.getId());
         }
     }