|
@@ -120,26 +120,39 @@ public class UserArchivesServiceImpl extends BaseMybatisDao< UserArchivesMapper>
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
public UserArchives update(UserArchives userArchives) {
|
|
public UserArchives update(UserArchives userArchives) {
|
|
|
|
|
+ if (userArchives.getAppearancePatentCount()!=null||
|
|
|
|
|
+ userArchives.getInventionPatentCount()!=null||
|
|
|
|
|
+ userArchives.getUtilityModelCount() !=null||
|
|
|
|
|
+ userArchives.getSoftwareWorksCount()!=null||
|
|
|
|
|
+ userArchives.getOtherCount()!=null
|
|
|
|
|
+ ){
|
|
|
|
|
+ int count = getCount(userArchives);
|
|
|
|
|
+ userArchives.setPatentCount(count);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(userArchives.getId()==null){
|
|
|
|
|
+ return insert(userArchives);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ this.userArchivesMapper.update(userArchives);
|
|
|
|
|
+ return this.queryById(userArchives.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private int getCount(UserArchives userArchives) {
|
|
|
int count = 0;
|
|
int count = 0;
|
|
|
if (userArchives.getAppearancePatentCount()!=null){
|
|
if (userArchives.getAppearancePatentCount()!=null){
|
|
|
- count+=userArchives.getAppearancePatentCount();
|
|
|
|
|
|
|
+ count+= userArchives.getAppearancePatentCount();
|
|
|
}
|
|
}
|
|
|
if (userArchives.getInventionPatentCount()!=null){
|
|
if (userArchives.getInventionPatentCount()!=null){
|
|
|
- count+=userArchives.getInventionPatentCount();
|
|
|
|
|
|
|
+ count+= userArchives.getInventionPatentCount();
|
|
|
}
|
|
}
|
|
|
if (userArchives.getUtilityModelCount() !=null){
|
|
if (userArchives.getUtilityModelCount() !=null){
|
|
|
- count+=userArchives.getUtilityModelCount();
|
|
|
|
|
|
|
+ count+= userArchives.getUtilityModelCount();
|
|
|
}
|
|
}
|
|
|
if (userArchives.getOtherCount()!=null){
|
|
if (userArchives.getOtherCount()!=null){
|
|
|
- count+=userArchives.getOtherCount();
|
|
|
|
|
- }
|
|
|
|
|
- userArchives.setPatentCount(count);
|
|
|
|
|
- if(userArchives.getId()==null){
|
|
|
|
|
- return insert(userArchives);
|
|
|
|
|
- }else {
|
|
|
|
|
- this.userArchivesMapper.update(userArchives);
|
|
|
|
|
- return this.queryById(userArchives.getId());
|
|
|
|
|
|
|
+ count+= userArchives.getOtherCount();
|
|
|
}
|
|
}
|
|
|
|
|
+ return count;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|