|
|
@@ -4,6 +4,7 @@ import java.math.BigDecimal;
|
|
|
import java.text.ParseException;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Calendar;
|
|
|
+import java.util.Collection;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
@@ -16,12 +17,17 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.goafanti.achievement.bo.AchievementDemandListBo;
|
|
|
+import com.goafanti.achievement.bo.AchievementInterestBo;
|
|
|
import com.goafanti.common.constant.AFTConstants;
|
|
|
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.DemandKeywordMapper;
|
|
|
import com.goafanti.common.dao.DemandMapper;
|
|
|
+import com.goafanti.common.dao.FieldGlossoryMapper;
|
|
|
+import com.goafanti.common.dao.IndustryCategoryMapper;
|
|
|
+import com.goafanti.common.dao.NewsMapper;
|
|
|
import com.goafanti.common.dao.NoticeMapper;
|
|
|
import com.goafanti.common.dao.OrganizationIdentityMapper;
|
|
|
import com.goafanti.common.dao.UserIdentityMapper;
|
|
|
@@ -34,6 +40,7 @@ import com.goafanti.common.enums.DemandPortalSearchSignType;
|
|
|
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;
|
|
|
import com.goafanti.common.enums.UserType;
|
|
|
@@ -50,16 +57,19 @@ 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.DemandImportBo;
|
|
|
+import com.goafanti.demand.bo.DemandInterestBo;
|
|
|
import com.goafanti.demand.bo.DemandListBo;
|
|
|
import com.goafanti.demand.bo.DemandManageDetailBo;
|
|
|
import com.goafanti.demand.bo.DemandManageListBo;
|
|
|
import com.goafanti.demand.bo.DemandPartnerListBo;
|
|
|
import com.goafanti.demand.service.DemandService;
|
|
|
+import com.goafanti.news.bo.newsInterestBo;
|
|
|
import com.goafanti.portal.bo.BoutiqueListBo;
|
|
|
import com.goafanti.portal.bo.DemandPortalDetailBo;
|
|
|
import com.goafanti.portal.bo.DemandPortalSimilarListBo;
|
|
|
import com.goafanti.portal.bo.DemandSearchDetailBo;
|
|
|
import com.goafanti.portal.bo.DemandSearchListBo;
|
|
|
+import com.goafanti.user.bo.UserInterestBo;
|
|
|
|
|
|
@Service
|
|
|
public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements DemandService {
|
|
|
@@ -68,6 +78,8 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
|
|
|
@Autowired
|
|
|
private UserMapper userMapper;
|
|
|
@Autowired
|
|
|
+ private NewsMapper newsMapper;
|
|
|
+ @Autowired
|
|
|
private UserRoleMapper userRoleMapper;
|
|
|
@Autowired
|
|
|
private NoticeMapper noticeMapper;
|
|
|
@@ -83,6 +95,10 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
|
|
|
private UserIdentityMapper userIdentityMapper;
|
|
|
@Autowired
|
|
|
private OrganizationIdentityMapper organizationIdentityMapper;
|
|
|
+ @Autowired
|
|
|
+ AchievementMapper achievementMapper;
|
|
|
+ @Autowired
|
|
|
+ FieldGlossoryMapper fieldGlossoryMapper;
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
@@ -736,8 +752,20 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Demand selectDemandDetail(String id) {
|
|
|
- return demandMapper.selectByPrimaryKey(id);
|
|
|
+ public DemandListBo selectDemandDetail(String id) {
|
|
|
+ Demand d1=demandMapper.selectByPrimaryKey(id);
|
|
|
+ DemandListBo d=new DemandListBo();
|
|
|
+ BeanUtils.copyProperties(d1, d);
|
|
|
+ if (null!=d.getIndustryCategoryA()) {
|
|
|
+ d.setIndustryCategory1(fieldGlossoryMapper.selectByPrimaryKey(d.getIndustryCategoryA()).getName());
|
|
|
+ }
|
|
|
+ if (null!=d.getIndustryCategoryB()) {
|
|
|
+ d.setIndustryCategory2(String.valueOf(fieldGlossoryMapper.selectByPrimaryKey(d.getIndustryCategoryB()).getName()));
|
|
|
+ }
|
|
|
+ if (null!=d.getIndustryCategoryC()) {
|
|
|
+ d.setIndustryCategory3(String.valueOf(fieldGlossoryMapper.selectByPrimaryKey(d.getIndustryCategoryB()).getName()));
|
|
|
+ }
|
|
|
+ return d;
|
|
|
}
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@@ -759,4 +787,77 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
|
|
|
return demandMapper.selectCsutomerLike(TokenManager.getUserId());
|
|
|
}
|
|
|
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ @Override
|
|
|
+ public Pagination<DemandSearchListBo> listAppDemand(Integer auditStatus, Integer serialNumber, String name,
|
|
|
+ String keyword, Integer demandType, String validityPeriodStartDate, String validityPeriodEndDate,
|
|
|
+ Integer status, Integer releaseStatus, String releaseDateStartDate, String releaseDateEndDate, Integer pNo,
|
|
|
+ Integer pSize) {
|
|
|
+ Map<String, Object> params = disposeParams(auditStatus, null, serialNumber, name, keyword, null, demandType,
|
|
|
+ validityPeriodStartDate, validityPeriodEndDate, null, status, releaseStatus, releaseDateStartDate,
|
|
|
+ releaseDateEndDate, null, null);
|
|
|
+
|
|
|
+ params.put("employerId", TokenManager.getUserId());
|
|
|
+
|
|
|
+ if (pNo == null || pNo < 0) {
|
|
|
+ pNo = 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (pSize == null || pSize < 0) {
|
|
|
+ pSize = 10;
|
|
|
+
|
|
|
+ }
|
|
|
+ Pagination<DemandSearchListBo> p=(Pagination<DemandSearchListBo>) findPage("findAppDemandListByPage", "findAppDemandCount", params, pNo, pSize);
|
|
|
+ List<DemandListBo> list=(List<DemandListBo>) p.getList();
|
|
|
+ for (DemandListBo d : list) {
|
|
|
+ if (null!=d.getIndustryCategoryA()) {
|
|
|
+ d.setIndustryCategory1(fieldGlossoryMapper.selectByPrimaryKey(d.getIndustryCategoryA()).getName());
|
|
|
+ }
|
|
|
+ if (null!=d.getIndustryCategoryB()) {
|
|
|
+ d.setIndustryCategory2(String.valueOf(fieldGlossoryMapper.selectByPrimaryKey(d.getIndustryCategoryB()).getName()));
|
|
|
+ }
|
|
|
+ if (null!=d.getIndustryCategoryC()) {
|
|
|
+ d.setIndustryCategory3(String.valueOf(fieldGlossoryMapper.selectByPrimaryKey(d.getIndustryCategoryB()).getName()));
|
|
|
+ }
|
|
|
+ int i=demandMapper.countInterest(d.getId());
|
|
|
+ d.setCountInterest(String.valueOf(i));
|
|
|
+ }
|
|
|
+ return p;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<Object> selectinterest(String uid,Integer type) {
|
|
|
+ List<Object> list=new ArrayList<>();
|
|
|
+ if (null==type||type==InterestType.POLICY.getCode()) {
|
|
|
+ List<newsInterestBo>nm=newsMapper.newsInterest(uid);
|
|
|
+ for (newsInterestBo n : nm) {
|
|
|
+ n.setType(InterestType.POLICY.getCode());
|
|
|
+ list.add(n);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (null==type||type==InterestType.EXPERTS.getCode()) {
|
|
|
+ List<UserInterestBo>um=userMapper.userInterest(uid);
|
|
|
+ for (UserInterestBo u : um) {
|
|
|
+ u.setType(InterestType.EXPERTS.getCode());
|
|
|
+ list.add(u);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (null==type||type==InterestType.DEMAND.getCode()) {
|
|
|
+ List<DemandInterestBo> dm=demandMapper.demandInterest(uid);
|
|
|
+ for (DemandInterestBo d : dm) {
|
|
|
+ d.setType(InterestType.DEMAND.getCode());
|
|
|
+ list.add(d);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (null==type||type==InterestType.ACHIEVEMENT.getCode()) {
|
|
|
+ List<AchievementInterestBo> am=achievementMapper.achievementInterest(uid);
|
|
|
+ for (AchievementInterestBo a : am) {
|
|
|
+ a.setType(InterestType.ACHIEVEMENT.getCode());
|
|
|
+ list.add(a);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|