|
|
@@ -32,6 +32,7 @@ import com.goafanti.achievement.service.AchievementService;
|
|
|
import com.goafanti.common.bo.Error;
|
|
|
import com.goafanti.common.bo.MyCollection;
|
|
|
import com.goafanti.common.bo.PolicyEntity;
|
|
|
+import com.goafanti.common.bo.fieldGlossoryBo;
|
|
|
import com.goafanti.common.constant.AFTConstants;
|
|
|
import com.goafanti.common.constant.PageConstants;
|
|
|
import com.goafanti.common.dao.AchievementDemandCountMapper;
|
|
|
@@ -41,6 +42,8 @@ import com.goafanti.common.dao.AchievementMapper;
|
|
|
import com.goafanti.common.dao.AchievementPublishMapper;
|
|
|
import com.goafanti.common.dao.BranchInformationMapper;
|
|
|
import com.goafanti.common.dao.DemandKeywordMapper;
|
|
|
+import com.goafanti.common.dao.FieldGlossoryMapper;
|
|
|
+import com.goafanti.common.dao.IndustryCategoryMapper;
|
|
|
import com.goafanti.common.dao.JtCollectSearchMapper;
|
|
|
import com.goafanti.common.dao.NoticeMapper;
|
|
|
import com.goafanti.common.dao.OrganizationIdentityMapper;
|
|
|
@@ -63,6 +66,8 @@ import com.goafanti.common.model.AchievementDemandCount;
|
|
|
import com.goafanti.common.model.AchievementKeyword;
|
|
|
import com.goafanti.common.model.AchievementPublish;
|
|
|
import com.goafanti.common.model.Admin;
|
|
|
+import com.goafanti.common.model.FieldGlossory;
|
|
|
+import com.goafanti.common.model.IndustryCategory;
|
|
|
import com.goafanti.common.model.JtCollectSearch;
|
|
|
import com.goafanti.common.model.Notice;
|
|
|
import com.goafanti.common.model.OrganizationIdentity;
|
|
|
@@ -104,6 +109,8 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
|
|
|
@Autowired
|
|
|
private UserMapper userMapper;
|
|
|
@Autowired
|
|
|
+ private IndustryCategoryMapper industryCategoryMapper;
|
|
|
+ @Autowired
|
|
|
BranchInformationMapper branchInformationMapper;
|
|
|
@Autowired
|
|
|
AchievementPublishMapper achievementPublishMapper;
|
|
|
@@ -895,7 +902,7 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
|
|
|
//获得当前sheet的开始行
|
|
|
int firstRowNum = sheet.getFirstRowNum();
|
|
|
//获得当前sheet最后一行
|
|
|
- int lastRowNum=sheet.getLastRowNum();
|
|
|
+ int lastRowNum= FileUtils.rowDisposeNotBlank(sheet, firstRowNum);
|
|
|
//循环除了第2行的所有行
|
|
|
Date date=new Date();
|
|
|
//获取技淘网的id
|
|
|
@@ -912,6 +919,7 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
|
|
|
int lastCellNum = row.getLastCellNum();
|
|
|
//循环当前行 cellNum = (firstCellNum+1) 则是除开第一例
|
|
|
Achievement in=new Achievement();
|
|
|
+ String str1=null,str2=null;
|
|
|
for(int cellNum = (firstCellNum); cellNum < lastCellNum;cellNum++){
|
|
|
Cell cell = row.getCell(cellNum);
|
|
|
try {
|
|
|
@@ -946,11 +954,34 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
|
|
|
case 9:
|
|
|
in.setIsHot(Integer.valueOf(FileUtils.getCellValue(cell)));
|
|
|
break;
|
|
|
+ case 10:
|
|
|
+ str1=FileUtils.getCellValue(cell);
|
|
|
+ break;
|
|
|
+ case 11:
|
|
|
+ str2=FileUtils.getCellValue(cell);
|
|
|
+ break;
|
|
|
+ case 12:
|
|
|
+ in.setMaturity(Integer.valueOf(FileUtils.getCellValue(cell)));
|
|
|
+ break;
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
throw new BusinessException(new Error("表格第"+(rowNum+1)+"行输入内容不正确。"));
|
|
|
}
|
|
|
}
|
|
|
+ if(StringUtils.isNotBlank(str1)) {
|
|
|
+ List<IndustryCategory> fg=industryCategoryMapper.listByPid(null);
|
|
|
+ boolean flag1=true,flag2=true;
|
|
|
+ for (IndustryCategory f : fg) {
|
|
|
+ if (flag1==true&&f.getName().equals(str1)) {
|
|
|
+ in.setFieldA(f.getId());
|
|
|
+ flag1=false;
|
|
|
+ }
|
|
|
+ if (flag2==true&&f.getName().equals(str2)) {
|
|
|
+ in.setFieldB(f.getId());
|
|
|
+ flag2=false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
in.setDeletedSign(DeleteStatus.UNDELETE.getCode());
|
|
|
in.setOrgId(TokenManager.getAdminId());
|
|
|
in.setOwnerId(TokenManager.getAdminId());
|
|
|
@@ -960,73 +991,76 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
|
|
|
in.setAuditStatus(0);
|
|
|
in.setId(UUID.randomUUID().toString());
|
|
|
in.setInfoSources(1);
|
|
|
- list.add(in);
|
|
|
- //关键字处理
|
|
|
- if(in.getKeyword()!=null) {
|
|
|
- String [] keywords=null;
|
|
|
- boolean flag= false;
|
|
|
- if (in.getKeyword().contains(",")) {
|
|
|
- keywords=in.getKeyword().split(",");
|
|
|
- flag=true;
|
|
|
- }else if (in.getKeyword().contains(",")) {
|
|
|
- keywords=in.getKeyword().split(",");
|
|
|
- flag=true;
|
|
|
- }else {
|
|
|
- AchievementKeyword ak = new AchievementKeyword();
|
|
|
- ak.setId(UUID.randomUUID().toString());
|
|
|
- ak.setAchievementId(in.getId());
|
|
|
- ak.setKeyword(in.getKeyword());
|
|
|
- keyword.add(ak);
|
|
|
- }
|
|
|
- if (flag) {
|
|
|
- for (String string : keywords) {
|
|
|
- AchievementKeyword ak = new AchievementKeyword();
|
|
|
+ if (StringUtils.isNotBlank(in.getName())) {
|
|
|
+ list.add(in);
|
|
|
+
|
|
|
+ //关键字处理
|
|
|
+ if(in.getKeyword()!=null) {
|
|
|
+ String [] keywords=null;
|
|
|
+ boolean flag= false;
|
|
|
+ if (in.getKeyword().contains(",")) {
|
|
|
+ keywords=in.getKeyword().split(",");
|
|
|
+ flag=true;
|
|
|
+ }else if (in.getKeyword().contains(",")) {
|
|
|
+ keywords=in.getKeyword().split(",");
|
|
|
+ flag=true;
|
|
|
+ }else {
|
|
|
+ AchievementKeyword ak = new AchievementKeyword();
|
|
|
ak.setId(UUID.randomUUID().toString());
|
|
|
ak.setAchievementId(in.getId());
|
|
|
- ak.setKeyword(string);
|
|
|
+ ak.setKeyword(in.getKeyword());
|
|
|
keyword.add(ak);
|
|
|
}
|
|
|
+ if (flag) {
|
|
|
+ for (String string : keywords) {
|
|
|
+ AchievementKeyword ak = new AchievementKeyword();
|
|
|
+ ak.setId(UUID.randomUUID().toString());
|
|
|
+ ak.setAchievementId(in.getId());
|
|
|
+ ak.setKeyword(string);
|
|
|
+ keyword.add(ak);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ AchievementPublish ap = null;
|
|
|
+ List<String> webpages = new ArrayList<>();
|
|
|
+ webpages.add("web_achievement_main");
|
|
|
+ webpages.add("web_index");
|
|
|
+ webpages.add("web_achievement_list");
|
|
|
+ for(String page: webpages){
|
|
|
+ ap = new AchievementPublish();
|
|
|
+ ap.setId(UUID.randomUUID().toString());
|
|
|
+ ap.setAchievementId((in.getId()));
|
|
|
+ ap.setPublisher(TokenManager.getUserId());
|
|
|
+ ap.setPublisher("1");
|
|
|
+ ap.setPublishTime(date);
|
|
|
+ ap.setPublishClient(PageConstants.WEB_PLATFORM);
|
|
|
+ ap.setPublishPage(page);
|
|
|
+ ap.setPublishPlatform(defaultPlatformId);
|
|
|
+ ap.setIfTop(AFTConstants.NO);
|
|
|
+ ap.setTopNumber(PageConstants.DEFAULT_TOP_NUMBER);
|
|
|
+ ap.setShowNumber(PageConstants.DEFAULT_SHOW_NUMBER);
|
|
|
+ publish.add(ap);
|
|
|
+ }
|
|
|
+ AchievementPublish ap2 = new AchievementPublish();
|
|
|
+ ap2.setId(UUID.randomUUID().toString());
|
|
|
+ ap2.setAchievementId(in.getId());
|
|
|
+ ap2.setPublisher(TokenManager.getUserId());
|
|
|
+ ap2.setPublishTime(date);
|
|
|
+ ap2.setPublishClient(PageConstants.APP_PLATFORM);
|
|
|
+ ap2.setPublishPage("ap2p_achievement_list");
|
|
|
+ ap2.setPublishPlatform(defaultPlatformId);
|
|
|
+ ap2.setIfTop(AFTConstants.NO);
|
|
|
+ ap2.setTopNumber(PageConstants.DEFAULT_TOP_NUMBER);
|
|
|
+ ap2.setShowNumber(PageConstants.DEFAULT_SHOW_NUMBER);
|
|
|
+ publish.add(ap2);
|
|
|
}
|
|
|
-
|
|
|
- AchievementPublish ap = null;
|
|
|
- List<String> webpages = new ArrayList<>();
|
|
|
- webpages.add("web_achievement_main");
|
|
|
- webpages.add("web_index");
|
|
|
- webpages.add("web_achievement_list");
|
|
|
- for(String page: webpages){
|
|
|
- ap = new AchievementPublish();
|
|
|
- ap.setId(UUID.randomUUID().toString());
|
|
|
- ap.setAchievementId((in.getId()));
|
|
|
- ap.setPublisher(TokenManager.getUserId());
|
|
|
- ap.setPublisher("1");
|
|
|
- ap.setPublishTime(date);
|
|
|
- ap.setPublishClient(PageConstants.WEB_PLATFORM);
|
|
|
- ap.setPublishPage(page);
|
|
|
- ap.setPublishPlatform(defaultPlatformId);
|
|
|
- ap.setIfTop(AFTConstants.NO);
|
|
|
- ap.setTopNumber(PageConstants.DEFAULT_TOP_NUMBER);
|
|
|
- ap.setShowNumber(PageConstants.DEFAULT_SHOW_NUMBER);
|
|
|
- publish.add(ap);
|
|
|
- }
|
|
|
- AchievementPublish ap2 = new AchievementPublish();
|
|
|
- ap2.setId(UUID.randomUUID().toString());
|
|
|
- ap2.setAchievementId(in.getId());
|
|
|
- ap2.setPublisher(TokenManager.getUserId());
|
|
|
- ap2.setPublishTime(date);
|
|
|
- ap2.setPublishClient(PageConstants.APP_PLATFORM);
|
|
|
- ap2.setPublishPage("ap2p_achievement_list");
|
|
|
- ap2.setPublishPlatform(defaultPlatformId);
|
|
|
- ap2.setIfTop(AFTConstants.NO);
|
|
|
- ap2.setTopNumber(PageConstants.DEFAULT_TOP_NUMBER);
|
|
|
- ap2.setShowNumber(PageConstants.DEFAULT_SHOW_NUMBER);
|
|
|
- publish.add(ap2);
|
|
|
-
|
|
|
}
|
|
|
achievementMapper.insertBatch(list);
|
|
|
achievementKeywordMapper.insertBatch(keyword);
|
|
|
achievementPublishMapper.insertBatch(publish);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|