|
|
@@ -86,14 +86,14 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
|
|
|
@Autowired
|
|
|
private OrganizationIdentityMapper organizationIdentityMapper;
|
|
|
|
|
|
- private static final Logger logger = LoggerFactory.getLogger(AchievementServiceImpl.class);
|
|
|
-
|
|
|
+ private static final Logger logger = LoggerFactory.getLogger(AchievementServiceImpl.class);
|
|
|
+
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
public Pagination<AchievementListBo> listUserOwnerAchievement(String username, String ownerName, String ownerId,
|
|
|
Integer auditStatus, Integer serialNumber, String name, String keyword, Integer category, Integer status,
|
|
|
- String releaseDateStartDate, String releaseDateEndDate, Integer releaseStatus, Integer pNo, Integer pSize
|
|
|
- ,Integer boutique,Integer hot) {
|
|
|
+ String releaseDateStartDate, String releaseDateEndDate, Integer releaseStatus, Integer pNo, Integer pSize,
|
|
|
+ Integer boutique, Integer hot) {
|
|
|
if (pNo == null || pNo < 0) {
|
|
|
pNo = 1;
|
|
|
}
|
|
|
@@ -104,7 +104,8 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
|
|
|
return (Pagination<AchievementListBo>) findPage("findUserOwnerAchievementListByPage",
|
|
|
"findUserOwnerAchievementCount",
|
|
|
disposeParams(username, ownerName, ownerId, auditStatus, serialNumber, name, keyword, category, status,
|
|
|
- releaseDateStartDate, releaseDateEndDate, releaseStatus, UserType.PERSONAL.getCode(),boutique,hot),
|
|
|
+ releaseDateStartDate, releaseDateEndDate, releaseStatus, UserType.PERSONAL.getCode(), boutique,
|
|
|
+ hot),
|
|
|
pNo, pSize);
|
|
|
}
|
|
|
|
|
|
@@ -113,7 +114,7 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
|
|
|
public Pagination<AchievementListBo> listOrgOwnerAchievement(String unitName, String ownerName, String ownerId,
|
|
|
Integer auditStatus, Integer serialNumber, String name, String keyword, Integer category, Integer status,
|
|
|
String releaseDateStartDate, String releaseDateEndDate, Integer releaseStatus, Integer pNo, Integer pSize,
|
|
|
- Integer boutique,Integer hot) {
|
|
|
+ Integer boutique, Integer hot) {
|
|
|
if (pNo == null || pNo < 0) {
|
|
|
pNo = 1;
|
|
|
}
|
|
|
@@ -124,7 +125,8 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
|
|
|
return (Pagination<AchievementListBo>) findPage("findOrgOwnerAchievementListByPage",
|
|
|
"findOrgOwnerAchievementCount",
|
|
|
disposeParams(unitName, ownerName, ownerId, auditStatus, serialNumber, name, keyword, category, status,
|
|
|
- releaseDateStartDate, releaseDateEndDate, releaseStatus, UserType.ORGANIZATION.getCode(),boutique,hot),
|
|
|
+ releaseDateStartDate, releaseDateEndDate, releaseStatus, UserType.ORGANIZATION.getCode(),
|
|
|
+ boutique, hot),
|
|
|
pNo, pSize);
|
|
|
}
|
|
|
|
|
|
@@ -204,15 +206,16 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
|
|
|
if (pSize == null || pSize < 0 || pSize > 10) {
|
|
|
pSize = 10;
|
|
|
}
|
|
|
- return (Pagination<AchievementListBo>) findPage("findAchievementListByPage",
|
|
|
- "findAchievementCount", disposeParams(null, null, TokenManager.getUserId(), auditStatus, serialNumber,
|
|
|
- name, keyword, category, status, releaseDateStartDate, releaseDateEndDate, releaseStatus, null,null,null),
|
|
|
+ return (Pagination<AchievementListBo>) findPage("findAchievementListByPage", "findAchievementCount",
|
|
|
+ disposeParams(null, null, TokenManager.getUserId(), auditStatus, serialNumber, name, keyword, category,
|
|
|
+ status, releaseDateStartDate, releaseDateEndDate, releaseStatus, null, null, null),
|
|
|
pNo, pSize);
|
|
|
}
|
|
|
|
|
|
private Map<String, Object> disposeParams(String username, String ownerName, String ownerId, Integer auditStatus,
|
|
|
Integer serialNumber, String name, String keyword, Integer category, Integer status,
|
|
|
- String releaseDateStartDate, String releaseDateEndDate, Integer releaseStatus, Integer type,Integer boutique,Integer hot) {
|
|
|
+ String releaseDateStartDate, String releaseDateEndDate, Integer releaseStatus, Integer type,
|
|
|
+ Integer boutique, Integer hot) {
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
|
|
|
Date rStart = null;
|
|
|
@@ -237,7 +240,7 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
|
|
|
}
|
|
|
|
|
|
if (null != type && StringUtils.isNotBlank(username)) {
|
|
|
- if (UserType.PERSONAL.getCode().equals(type) ) {
|
|
|
+ if (UserType.PERSONAL.getCode().equals(type)) {
|
|
|
params.put("username", username);
|
|
|
} else {
|
|
|
params.put("unitName", username);
|
|
|
@@ -283,10 +286,10 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
|
|
|
if (null != releaseStatus) {
|
|
|
params.put("releaseStatus", releaseStatus);
|
|
|
}
|
|
|
- if (null != boutique){
|
|
|
+ if (null != boutique) {
|
|
|
params.put("boutique", boutique);
|
|
|
}
|
|
|
- if(null != hot){
|
|
|
+ if (null != hot) {
|
|
|
params.put("hot", hot);
|
|
|
}
|
|
|
if (TokenManager.hasRole(AFTConstants.TECHBROKER)) {
|
|
|
@@ -388,6 +391,7 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
|
|
|
List<AchievementKeyword> AchievementKeywordList = new ArrayList<>();
|
|
|
Calendar now = Calendar.getInstance();
|
|
|
now.set(Calendar.MILLISECOND, 0);
|
|
|
+ String techBrokerId = TokenManager.hasRole(AFTConstants.TECHBROKER) ? TokenManager.getAdminId() : null;
|
|
|
for (AchievementImportBo bo : data) {
|
|
|
a = new Achievement();
|
|
|
BeanUtils.copyProperties(bo, a);
|
|
|
@@ -396,6 +400,7 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
|
|
|
a.setCreateTime(now.getTime());
|
|
|
a.setAuditStatus(AchievementAuditStatus.INAUDIT.getCode());
|
|
|
a.setReleaseStatus(AchievementReleaseStatus.UNRELEASE.getCode());
|
|
|
+ a.setTechBrokerId(techBrokerId);
|
|
|
List<String> keywordsList = bo.getKeywords();
|
|
|
if (null != keywordsList && keywordsList.size() > 0) {
|
|
|
for (String s : keywordsList) {
|
|
|
@@ -417,35 +422,35 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
- public Pagination<AchievementSearchListBo> listAchievementSearchList(
|
|
|
- String keyword,Integer dataCategory, Integer category,Integer fieldA, String transferMode,Integer pNo, Integer pSize,
|
|
|
- Integer dateSort,String upperPrice,String lowerPrice) {
|
|
|
+ public Pagination<AchievementSearchListBo> listAchievementSearchList(String keyword, Integer dataCategory,
|
|
|
+ Integer category, Integer fieldA, String transferMode, Integer pNo, Integer pSize, Integer dateSort,
|
|
|
+ String upperPrice, String lowerPrice) {
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
if (!StringUtils.isBlank(keyword)) {
|
|
|
params.put("keyword", keyword);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (null != dataCategory) {
|
|
|
params.put("dataCategory", dataCategory);
|
|
|
}
|
|
|
-
|
|
|
- if(null!= category){
|
|
|
+
|
|
|
+ if (null != category) {
|
|
|
params.put("category", category);
|
|
|
}
|
|
|
if (null != fieldA) {
|
|
|
params.put("fieldA", fieldA);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (!StringUtils.isBlank(transferMode)) {
|
|
|
params.put("transferMode", transferMode);
|
|
|
}
|
|
|
- if(dateSort != null){
|
|
|
+ if (dateSort != null) {
|
|
|
params.put("dateSort", dateSort);
|
|
|
}
|
|
|
- if(upperPrice != null){
|
|
|
+ if (upperPrice != null) {
|
|
|
params.put("upperPrice", upperPrice);
|
|
|
}
|
|
|
- if(lowerPrice != null){
|
|
|
+ if (lowerPrice != null) {
|
|
|
params.put("lowerPrice", lowerPrice);
|
|
|
}
|
|
|
if (pNo == null || pNo < 0) {
|
|
|
@@ -455,12 +460,13 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
|
|
|
if (pSize == null || pSize < 0 || pSize > 20) {
|
|
|
pSize = 20;
|
|
|
}
|
|
|
- Pagination<AchievementSearchListBo> result = (Pagination<AchievementSearchListBo>) findPage("findSearchAchievementListByPage","findSearchAchievementCount", params, pNo, pSize);
|
|
|
+ Pagination<AchievementSearchListBo> result = (Pagination<AchievementSearchListBo>) findPage(
|
|
|
+ "findSearchAchievementListByPage", "findSearchAchievementCount", params, pNo, pSize);
|
|
|
List<AchievementSearchListBo> AchievementSearchList = (List<AchievementSearchListBo>) result.getList();
|
|
|
for (int i = 0; i < AchievementSearchList.size(); i++) {
|
|
|
String introduction = AchievementSearchList.get(i).getIntroduction();
|
|
|
- if(introduction != null)
|
|
|
- introduction=introduction.length()>20?introduction.substring(0, 20)+"... ...":introduction;
|
|
|
+ if (introduction != null)
|
|
|
+ introduction = introduction.length() > 20 ? introduction.substring(0, 20) + "... ..." : introduction;
|
|
|
|
|
|
}
|
|
|
return result;
|
|
|
@@ -608,13 +614,12 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
|
|
|
return achievementMapper.updateByPrimaryKey(a);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
@Cacheable(value = "internationalAchievementList", key = "'internationalAchievementList:'+#internationalAchievementCacheKey")
|
|
|
public List<InternationalListBo> selectInternationalAchievement(Integer internationalAchievementCacheKey) {
|
|
|
return achievementMapper.selectInternationalAchievement();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@CacheEvict(value = "internationalAchievementList", allEntries = true)
|
|
|
public void cleanInternationalAchievement() {
|
|
|
LoggerUtils.debug(logger, "清除国际化技术列表");
|
|
|
@@ -630,16 +635,16 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
|
|
|
public Pagination<BoutiqueListBo> boutiqueSearchList(Integer dataCategory, Integer category, Integer fieldA,
|
|
|
Integer pNo, Integer pSize) {
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
- if(null != dataCategory){
|
|
|
+ if (null != dataCategory) {
|
|
|
params.put("dataCategory", dataCategory);
|
|
|
}
|
|
|
- if(null != category){
|
|
|
+ if (null != category) {
|
|
|
params.put("category", category);
|
|
|
}
|
|
|
- if(null != fieldA){
|
|
|
+ if (null != fieldA) {
|
|
|
params.put("fieldA", fieldA);
|
|
|
}
|
|
|
- return (Pagination<BoutiqueListBo>)findPage("findBoutiqueListByPage","findBoutiqueCount",params, pNo, pSize);
|
|
|
+ return (Pagination<BoutiqueListBo>) findPage("findBoutiqueListByPage", "findBoutiqueCount", params, pNo, pSize);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -657,6 +662,4 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
|
|
|
return achievementMapper.findPartnerAchievementListByPage(uid);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
}
|