|
|
@@ -15,13 +15,10 @@ import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import com.goafanti.achievement.bo.AchievementDemandListBo;
|
|
|
-
|
|
|
import com.goafanti.common.constant.AFTConstants;
|
|
|
import com.goafanti.common.constant.PageConstants;
|
|
|
import com.goafanti.common.dao.AchievementDemandCountMapper;
|
|
|
import com.goafanti.common.dao.AchievementDemandMapper;
|
|
|
-
|
|
|
import com.goafanti.common.dao.AchievementKeywordMapper;
|
|
|
import com.goafanti.common.dao.AchievementMapper;
|
|
|
import com.goafanti.common.dao.BranchInformationMapper;
|
|
|
@@ -32,7 +29,6 @@ import com.goafanti.common.dao.DemandMapper;
|
|
|
import com.goafanti.common.dao.DemandPublishMapper;
|
|
|
import com.goafanti.common.dao.FieldGlossoryMapper;
|
|
|
import com.goafanti.common.dao.NewsInterestMapper;
|
|
|
-
|
|
|
import com.goafanti.common.dao.NoticeMapper;
|
|
|
import com.goafanti.common.dao.OrganizationIdentityMapper;
|
|
|
import com.goafanti.common.dao.ProjectInterestMapper;
|
|
|
@@ -45,7 +41,6 @@ import com.goafanti.common.enums.DemandAuditStatus;
|
|
|
import com.goafanti.common.enums.DemandInfoSourceStatus;
|
|
|
import com.goafanti.common.enums.DemandReleaseStatus;
|
|
|
import com.goafanti.common.enums.DemandStatus;
|
|
|
-import com.goafanti.common.enums.DemandSwitchSign;
|
|
|
import com.goafanti.common.enums.InterestType;
|
|
|
import com.goafanti.common.enums.NoticeReadStatus;
|
|
|
import com.goafanti.common.enums.NoticeStatus;
|
|
|
@@ -63,17 +58,11 @@ import com.goafanti.common.utils.DateUtils;
|
|
|
import com.goafanti.core.mybatis.BaseMybatisDao;
|
|
|
import com.goafanti.core.mybatis.page.Pagination;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
+import com.goafanti.demand.bo.DemandDetailBo;
|
|
|
import com.goafanti.demand.bo.DemandImportBo;
|
|
|
-
|
|
|
import com.goafanti.demand.bo.DemandListBo;
|
|
|
-import com.goafanti.demand.bo.DemandManageDetailBo;
|
|
|
-import com.goafanti.demand.bo.DemandPartnerListBo;
|
|
|
-import com.goafanti.demand.bo.DemandPublishBo;
|
|
|
import com.goafanti.demand.bo.ObjectInterestListBo;
|
|
|
import com.goafanti.demand.service.DemandService;
|
|
|
-
|
|
|
-import com.goafanti.portal.bo.DemandPortalDetailBo;
|
|
|
-import com.goafanti.portal.bo.DemandPortalSimilarListBo;
|
|
|
import com.goafanti.portal.bo.DemandSearchDetailBo;
|
|
|
import com.goafanti.portal.bo.DemandSearchListBo;
|
|
|
|
|
|
@@ -118,42 +107,11 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
|
|
|
BranchInformationMapper branchInformationMapper;
|
|
|
@Autowired
|
|
|
DemandPublishMapper demandPublishMapper;
|
|
|
- @Override
|
|
|
- public void saveUserDemand(Demand d, String validityPeriodFormattedDate, String[] keywords) {
|
|
|
- Date validityPeriod = null;
|
|
|
- if (!StringUtils.isBlank(validityPeriodFormattedDate)) {
|
|
|
- try {
|
|
|
- validityPeriod = DateUtils.parseDate(validityPeriodFormattedDate, AFTConstants.YYYYMMDD);
|
|
|
- } catch (ParseException e) {
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- d.setValidityPeriod(validityPeriod);
|
|
|
- d.setId(UUID.randomUUID().toString());
|
|
|
- d.setTechBrokerId(TokenManager.getAdminId());
|
|
|
-
|
|
|
- d.setDeletedSign(DeleteStatus.UNDELETE.getCode());
|
|
|
|
|
|
- Calendar now = Calendar.getInstance();
|
|
|
- now.set(Calendar.MILLISECOND, 0);
|
|
|
- d.setStatus(DemandStatus.UNRESOLVED.getCode());
|
|
|
- d.setReleaseStatus(DemandReleaseStatus.UNRELEASE.getCode());
|
|
|
-
|
|
|
- d.setPrincipalId(TokenManager.getAdminId());
|
|
|
- if (DemandAuditStatus.SUBMIT.getCode().equals(d.getAuditStatus())) {
|
|
|
- d.setAuditStatus(DemandAuditStatus.INAUDIT.getCode());
|
|
|
- createAuditorNotice(d);
|
|
|
- } else {
|
|
|
- d.setAuditStatus(DemandAuditStatus.CREATE.getCode());
|
|
|
- }
|
|
|
-
|
|
|
- d.setCreateTime(now.getTime());
|
|
|
- demandMapper.insert(d);
|
|
|
- disposeDemandKeyword(keywords, d, false);
|
|
|
- }
|
|
|
+ private final int source_platform = 0;
|
|
|
|
|
|
@Override
|
|
|
- public int updateUserDemand(Demand d, String validityPeriodFormattedDate, String[] keywords, Integer switchSign) {
|
|
|
+ public int updateUserDemand(Demand d, String validityPeriodFormattedDate, String[] keywords,List<String> webPages,List<String> appPages) {
|
|
|
Date validityPeriod = null;
|
|
|
if (!StringUtils.isBlank(validityPeriodFormattedDate)) {
|
|
|
try {
|
|
|
@@ -162,21 +120,14 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
|
|
|
}
|
|
|
}
|
|
|
d.setValidityPeriod(validityPeriod);
|
|
|
-
|
|
|
- if (DemandAuditStatus.SUBMIT.getCode().equals(d.getAuditStatus())) {
|
|
|
- d.setAuditStatus(DemandAuditStatus.INAUDIT.getCode());
|
|
|
- createAuditorNotice(d);
|
|
|
- }
|
|
|
disposeDemandKeyword(keywords, d, true);
|
|
|
+ disposeDemandPublish(d,webPages,appPages,true);
|
|
|
demandMapper.updateByPrimaryKeySelective(d);
|
|
|
- if (null != switchSign && DemandSwitchSign.CLOSE.getCode().equals(switchSign)) {
|
|
|
- demandMapper.updateEmployerId(d.getId());
|
|
|
- }
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public DemandManageDetailBo selectUserDemandDetail(String id) {
|
|
|
+ public DemandDetailBo selectUserDemandDetail(String id) {
|
|
|
return demandMapper.selectUserDemandDetail(id);
|
|
|
}
|
|
|
|
|
|
@@ -202,7 +153,7 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public DemandManageDetailBo selectOrgDemandDetail(String id) {
|
|
|
+ public DemandDetailBo selectOrgDemandDetail(String id) {
|
|
|
|
|
|
return demandMapper.selectOrgDemandDetail(id);
|
|
|
}
|
|
|
@@ -303,8 +254,8 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
|
|
|
now.set(Calendar.MILLISECOND, 0);
|
|
|
d.setStatus(DemandStatus.UNRESOLVED.getCode());
|
|
|
d.setReleaseStatus(DemandReleaseStatus.UNRELEASE.getCode());
|
|
|
- if (DemandAuditStatus.SUBMIT.getCode().equals(d.getAuditStatus())) {
|
|
|
- d.setAuditStatus(DemandAuditStatus.INAUDIT.getCode());
|
|
|
+ d.setInfoSources(source_platform);
|
|
|
+ if (DemandAuditStatus.INAUDIT.getCode().equals(d.getAuditStatus())) {
|
|
|
createAuditorNotice(d);
|
|
|
} else {
|
|
|
d.setAuditStatus(DemandAuditStatus.CREATE.getCode());
|
|
|
@@ -312,50 +263,7 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
|
|
|
d.setCreateTime(now.getTime());
|
|
|
demandMapper.insert(d);
|
|
|
disposeDemandKeyword(keywords, d, false);
|
|
|
- disposeDemandPublish(d,webPages,appPages);
|
|
|
- }
|
|
|
-
|
|
|
- private void disposeDemandPublish(Demand d, List<String> webPages, List<String> appPages) {
|
|
|
- DemandPublish dp = null;
|
|
|
- String defaultPlatformId = branchInformationMapper.selectByDomain(PageConstants.DEFAULT_DOMAIN).getId();
|
|
|
- if(webPages.size()>0){
|
|
|
- for(String page: webPages){
|
|
|
- dp = new DemandPublish();
|
|
|
- dp.setId(UUID.randomUUID().toString());
|
|
|
- dp.setDemandId(d.getId());
|
|
|
- dp.setPublisher(TokenManager.getUserId());
|
|
|
- dp.setPublishTime(d.getCreateTime());
|
|
|
- dp.setPublishClient(PageConstants.WEB_PLATFORM);
|
|
|
- dp.setPublishPage(page);
|
|
|
- dp.setPublishPlatform(defaultPlatformId);
|
|
|
- dp.setIfTop(AFTConstants.NO);
|
|
|
- dp.setTopNumber(PageConstants.DEFAULT_TOP_NUMBER);
|
|
|
- dp.setShowNumber(PageConstants.DEFAULT_SHOW_NUMBER);
|
|
|
- demandPublishMapper.insert(dp);
|
|
|
- }
|
|
|
- }
|
|
|
- if(appPages.size()>0){
|
|
|
- for(String page: webPages){
|
|
|
- dp = new DemandPublish();
|
|
|
- dp.setId(UUID.randomUUID().toString());
|
|
|
- dp.setDemandId(d.getId());
|
|
|
- dp.setPublisher(TokenManager.getUserId());
|
|
|
- dp.setPublishTime(d.getCreateTime());
|
|
|
- dp.setPublishClient(PageConstants.APP_PLATFORM);
|
|
|
- dp.setPublishPage(page);
|
|
|
- dp.setPublishPlatform(defaultPlatformId);
|
|
|
- dp.setIfTop(AFTConstants.NO);
|
|
|
- dp.setTopNumber(PageConstants.DEFAULT_TOP_NUMBER);
|
|
|
- dp.setShowNumber(PageConstants.DEFAULT_SHOW_NUMBER);
|
|
|
- demandPublishMapper.insert(dp);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public List<AchievementDemandListBo> selectAchievementDemandListByDemandId(String id) {
|
|
|
- return achievementDemandMapper.selectAchievementDemandListByDemandId(id);
|
|
|
+ disposeDemandPublish(d,webPages,appPages,false);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -574,16 +482,58 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
|
|
|
} else {
|
|
|
n.setAid(aid);
|
|
|
if (UserType.PERSONAL.getCode().equals(d.getDataCategory())) {
|
|
|
- n.setContent(NoticeStatus.PERSONALDEMAND.getDesc() + " " + DemandAuditStatus.SUBMIT.getDesc());
|
|
|
+ n.setContent(NoticeStatus.PERSONALDEMAND.getDesc() + " " + DemandAuditStatus.INAUDIT.getDesc());
|
|
|
n.setNoticeType(NoticeStatus.PERSONALDEMAND.getCode());
|
|
|
} else if (UserType.ORGANIZATION.getCode().equals(d.getDataCategory())) {
|
|
|
- n.setContent(NoticeStatus.ORGANIZATIONDEMAND.getDesc() + " " + DemandAuditStatus.SUBMIT.getDesc());
|
|
|
+ n.setContent(NoticeStatus.ORGANIZATIONDEMAND.getDesc() + " " + DemandAuditStatus.INAUDIT.getDesc());
|
|
|
n.setNoticeType(NoticeStatus.ORGANIZATIONDEMAND.getCode());
|
|
|
}
|
|
|
}
|
|
|
return n;
|
|
|
}
|
|
|
|
|
|
+ private void disposeDemandPublish(Demand d,List<String> webPages,List<String> appPages,boolean delete){
|
|
|
+ if(delete){
|
|
|
+ if(null != webPages && webPages.size()>0){
|
|
|
+ demandPublishMapper.batchDeleteByDemandId(d.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ DemandPublish dp = null;
|
|
|
+ String defaultPlatformId = branchInformationMapper.selectByDomain(PageConstants.DEFAULT_DOMAIN).getId();
|
|
|
+ if(webPages.size()>0){
|
|
|
+ for(String page: webPages){
|
|
|
+ dp = new DemandPublish();
|
|
|
+ dp.setId(UUID.randomUUID().toString());
|
|
|
+ dp.setDemandId(d.getId());
|
|
|
+ dp.setPublisher(TokenManager.getUserId());
|
|
|
+ dp.setPublishTime(d.getCreateTime());
|
|
|
+ dp.setPublishClient(PageConstants.WEB_PLATFORM);
|
|
|
+ dp.setPublishPage(page);
|
|
|
+ dp.setPublishPlatform(defaultPlatformId);
|
|
|
+ dp.setIfTop(AFTConstants.NO);
|
|
|
+ dp.setTopNumber(PageConstants.DEFAULT_TOP_NUMBER);
|
|
|
+ dp.setShowNumber(PageConstants.DEFAULT_SHOW_NUMBER);
|
|
|
+ demandPublishMapper.insert(dp);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(appPages.size()>0){
|
|
|
+ for(String page: webPages){
|
|
|
+ dp = new DemandPublish();
|
|
|
+ dp.setId(UUID.randomUUID().toString());
|
|
|
+ dp.setDemandId(d.getId());
|
|
|
+ dp.setPublisher(TokenManager.getUserId());
|
|
|
+ dp.setPublishTime(d.getCreateTime());
|
|
|
+ dp.setPublishClient(PageConstants.APP_PLATFORM);
|
|
|
+ dp.setPublishPage(page);
|
|
|
+ dp.setPublishPlatform(defaultPlatformId);
|
|
|
+ dp.setIfTop(AFTConstants.NO);
|
|
|
+ dp.setTopNumber(PageConstants.DEFAULT_TOP_NUMBER);
|
|
|
+ dp.setShowNumber(PageConstants.DEFAULT_SHOW_NUMBER);
|
|
|
+ demandPublishMapper.insert(dp);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void disposeDemandKeyword(String[] keywords, Demand d, boolean delete) {
|
|
|
if (null != keywords && keywords.length > 0) {
|
|
|
if (delete) {
|
|
|
@@ -624,47 +574,13 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
- @SuppressWarnings("unchecked")
|
|
|
- @Override
|
|
|
- public Pagination<DemandPartnerListBo> lisePartnerDemand(String employerId, Integer pNo, Integer pSize) {
|
|
|
- Map<String, Object> params = new HashMap<>();
|
|
|
-
|
|
|
- params.put("employerId", employerId);
|
|
|
-
|
|
|
- if (pNo == null || pNo < 0) {
|
|
|
- pNo = 1;
|
|
|
- }
|
|
|
-
|
|
|
- if (pSize == null || pSize < 0 || pSize > 10) {
|
|
|
- pSize = 10;
|
|
|
- }
|
|
|
-
|
|
|
- return (Pagination<DemandPartnerListBo>) findPage("findPartnerDemandListByPage", "findPartnerDemandCount",
|
|
|
- params, pNo, pSize);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public DemandPortalDetailBo findUserPortalDemandDetail(String id) {
|
|
|
- return demandMapper.findUserPortalDemandDetail(id, TokenManager.getUserId());
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public DemandPortalDetailBo findOrgPortalDemandDetail(String id) {
|
|
|
- return demandMapper.findOrgPortalDemandDetail(id, TokenManager.getUserId());
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public List<DemandPortalSimilarListBo> findByIndustryCategoryA(Integer industryCategoryA, String id) {
|
|
|
- return demandMapper.findByIndustryCategoryA(industryCategoryA, id);
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public int updateByPrimaryKeySelective(Demand d) {
|
|
|
return demandMapper.updateByPrimaryKeySelective(d);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public DemandListBo selectDemandDetail(String id ) {
|
|
|
+ public DemandListBo selectAppDemandDetail(String id ) {
|
|
|
DemandListBo d=demandMapper.selectAppByPrimaryKey(id);
|
|
|
|
|
|
if (null!=d.getIndustryCategoryA()) {
|
|
|
@@ -908,4 +824,22 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
|
|
|
Pagination<DemandSearchListBo> p=(Pagination<DemandSearchListBo>) findPage("findAppDemandListByPage", "findAppDemandCount", params, pNo, pSize);
|
|
|
return p;
|
|
|
}
|
|
|
+
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ @Override
|
|
|
+ public Pagination<DemandSearchListBo> listMyDemand(String name, String startDate, String endDate,
|
|
|
+ Integer pageNo, Integer pageSize) {
|
|
|
+ Map<String,Object> params = new HashMap<String,Object>();
|
|
|
+ if(StringUtils.isNotBlank(name)) params.put("name", name);
|
|
|
+ if(StringUtils.isNotBlank(startDate)) params.put("startDate", startDate);
|
|
|
+ if(StringUtils.isNotBlank(endDate)) params.put("endDate", endDate);
|
|
|
+ return (Pagination<DemandSearchListBo>) findPage("selectDemandListByPage", "selectDemandListCount", params, pageNo, pageSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public DemandDetailBo selectDemandDetail(String id) {
|
|
|
+ DemandDetailBo bo = demandMapper.selectDemandDetail(id);
|
|
|
+ bo.setPublishPages(demandPublishMapper.selectPublishPages(id));
|
|
|
+ return bo;
|
|
|
+ }
|
|
|
}
|