瀏覽代碼

成果新增、修改

liliang4869 7 年之前
父節點
當前提交
d7f177f7e8

+ 6 - 232
src/main/java/com/goafanti/achievement/bo/InputAchievement.java

@@ -51,38 +51,18 @@ public class InputAchievement {
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer		maturity;
 
-	@Size(min = 0, max = 500, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String		maturityPictureUrl;
-
-	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String		maturityTextFileUrl;
 
-	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String		maturityVideoUrl;
 
 	@Max(value = 5, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer		innovation;
 
-	@Size(min = 0, max = 256, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String		ownerName;
 
-	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	private Integer		ownerType;
 
 	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String		ownerId;
 
-	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String		ownerIdNumber;
-
-	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String		ownerMobile;
-
-	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String		ownerEmail;
-
+	
 	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String		ownerPostalAddress;
 
@@ -102,17 +82,10 @@ public class InputAchievement {
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private BigDecimal	transferPrice;
 
-	@Size(min = 0, max = 300, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String		technicalScene;
-
-	@Size(min = 0, max = 1024, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String		breakthrough;
 
 	@Size(min = 0, max = 300, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String		patentCase;
 
-	@Size(min = 0, max = 300, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String		awards;
 
 	@Size(min = 0, max = 300, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String		teamDes;
@@ -123,27 +96,8 @@ public class InputAchievement {
 	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String		techPlanUrl;
 
-	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String		businessPlanUrl;
-
-	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String		orgId;
-
-	@Size(min = 0, max = 45, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String		orgName;
-
-	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String		orgAddress;
-
-	@Size(min = 0, max = 255, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String		orgEmail;
-
-	@Size(min = 0, max = 45, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String		orgContacts;
-
-	@Size(min = 0, max = 45, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String		orgContactsMobile;
 
+	
 	@Max(value = 9, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer		status;
@@ -156,46 +110,20 @@ public class InputAchievement {
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer		auditStatus;
 
-	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String		techBrokerId;
 
-	
-	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	private Integer     jmrhFlag;
-	
+
 	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
 	private Integer    boutique;
 	
-	@Max(value = 1, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	@Min(value = 0, message = "{" + ErrorConstants.PARAM_ERROR + "}")
-	private Integer internationalFlag;
-	
+
 	@Size(min = 0, max = 500, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
 	private String remark;
 	
-	@Size(min = 0, max = 256, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String contacts;
-	
-	@Size(min = 0, max = 36, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
-	private String contactMobile ;
-	
-	public String getContacts() {
-		return contacts;
-	}
 
-	public void setContacts(String contacts) {
-		this.contacts = contacts;
-	}
 
-	public String getContactMobile() {
-		return contactMobile;
-	}
+	
 
-	public void setContactMobile(String contactMobile) {
-		this.contactMobile = contactMobile;
-	}
 
 	public String getRemark() {
 		return remark;
@@ -205,13 +133,7 @@ public class InputAchievement {
 		this.remark = remark;
 	}
 
-	public Integer getInternationalFlag() {
-		return internationalFlag;
-	}
 
-	public void setInternationalFlag(Integer internationalFlag) {
-		this.internationalFlag = internationalFlag;
-	}
 
 	public String getId() {
 		return id;
@@ -309,29 +231,7 @@ public class InputAchievement {
 		this.maturity = maturity;
 	}
 
-	public String getMaturityPictureUrl() {
-		return maturityPictureUrl;
-	}
-
-	public void setMaturityPictureUrl(String maturityPictureUrl) {
-		this.maturityPictureUrl = maturityPictureUrl;
-	}
 
-	public String getMaturityTextFileUrl() {
-		return maturityTextFileUrl;
-	}
-
-	public void setMaturityTextFileUrl(String maturityTextFileUrl) {
-		this.maturityTextFileUrl = maturityTextFileUrl;
-	}
-
-	public String getMaturityVideoUrl() {
-		return maturityVideoUrl;
-	}
-
-	public void setMaturityVideoUrl(String maturityVideoUrl) {
-		this.maturityVideoUrl = maturityVideoUrl;
-	}
 
 	public Integer getInnovation() {
 		return innovation;
@@ -341,45 +241,8 @@ public class InputAchievement {
 		this.innovation = innovation;
 	}
 
-	public String getOwnerName() {
-		return ownerName;
-	}
-
-	public void setOwnerName(String ownerName) {
-		this.ownerName = ownerName;
-	}
-
-	public Integer getOwnerType() {
-		return ownerType;
-	}
-
-	public void setOwnerType(Integer ownerType) {
-		this.ownerType = ownerType;
-	}
-
-	public String getOwnerIdNumber() {
-		return ownerIdNumber;
-	}
-
-	public void setOwnerIdNumber(String ownerIdNumber) {
-		this.ownerIdNumber = ownerIdNumber;
-	}
-
-	public String getOwnerMobile() {
-		return ownerMobile;
-	}
-
-	public void setOwnerMobile(String ownerMobile) {
-		this.ownerMobile = ownerMobile;
-	}
-
-	public String getOwnerEmail() {
-		return ownerEmail;
-	}
+	
 
-	public void setOwnerEmail(String ownerEmail) {
-		this.ownerEmail = ownerEmail;
-	}
 
 	public String getOwnerPostalAddress() {
 		return ownerPostalAddress;
@@ -421,21 +284,7 @@ public class InputAchievement {
 		this.transferPrice = transferPrice;
 	}
 
-	public String getTechnicalScene() {
-		return technicalScene;
-	}
-
-	public void setTechnicalScene(String technicalScene) {
-		this.technicalScene = technicalScene;
-	}
 
-	public String getBreakthrough() {
-		return breakthrough;
-	}
-
-	public void setBreakthrough(String breakthrough) {
-		this.breakthrough = breakthrough;
-	}
 
 	public String getPatentCase() {
 		return patentCase;
@@ -445,13 +294,6 @@ public class InputAchievement {
 		this.patentCase = patentCase;
 	}
 
-	public String getAwards() {
-		return awards;
-	}
-
-	public void setAwards(String awards) {
-		this.awards = awards;
-	}
 
 	public String getTeamDes() {
 		return teamDes;
@@ -477,62 +319,6 @@ public class InputAchievement {
 		this.techPlanUrl = techPlanUrl;
 	}
 
-	public String getBusinessPlanUrl() {
-		return businessPlanUrl;
-	}
-
-	public void setBusinessPlanUrl(String businessPlanUrl) {
-		this.businessPlanUrl = businessPlanUrl;
-	}
-
-	public String getOrgId() {
-		return orgId;
-	}
-
-	public void setOrgId(String orgId) {
-		this.orgId = orgId;
-	}
-
-	public String getOrgName() {
-		return orgName;
-	}
-
-	public void setOrgName(String orgName) {
-		this.orgName = orgName;
-	}
-
-	public String getOrgAddress() {
-		return orgAddress;
-	}
-
-	public void setOrgAddress(String orgAddress) {
-		this.orgAddress = orgAddress;
-	}
-
-	public String getOrgEmail() {
-		return orgEmail;
-	}
-
-	public void setOrgEmail(String orgEmail) {
-		this.orgEmail = orgEmail;
-	}
-
-	public String getOrgContacts() {
-		return orgContacts;
-	}
-
-	public void setOrgContacts(String orgContacts) {
-		this.orgContacts = orgContacts;
-	}
-
-	public String getOrgContactsMobile() {
-		return orgContactsMobile;
-	}
-
-	public void setOrgContactsMobile(String orgContactsMobile) {
-		this.orgContactsMobile = orgContactsMobile;
-	}
-
 	public Integer getStatus() {
 		return status;
 	}
@@ -557,13 +343,7 @@ public class InputAchievement {
 		this.auditStatus = auditStatus;
 	}
 
-	public String getTechBrokerId() {
-		return techBrokerId;
-	}
 
-	public void setTechBrokerId(String techBrokerId) {
-		this.techBrokerId = techBrokerId;
-	}
 
 	public String getOwnerId() {
 		return ownerId;
@@ -575,13 +355,7 @@ public class InputAchievement {
 
 
 
-	public Integer getJmrhFlag() {
-		return jmrhFlag;
-	}
 
-	public void setJmrhFlag(Integer jmrhFlag) {
-		this.jmrhFlag = jmrhFlag;
-	}
 
 	public Integer getBoutique() {
 		return boutique;

+ 38 - 21
src/main/java/com/goafanti/achievement/controller/UserAchievementApiController.java

@@ -1,5 +1,6 @@
 package com.goafanti.achievement.controller;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
@@ -22,6 +23,7 @@ import com.goafanti.admin.service.AftFileService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.constant.PageConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.enums.AchievementAuditStatus;
 import com.goafanti.common.enums.AchievementFields;
@@ -34,7 +36,7 @@ import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.shiro.token.TokenManager;
 
 @RestController
-@RequestMapping(value = "/api/user/achievement")
+@RequestMapping(value = "/open/api/user/achievement")
 public class UserAchievementApiController extends CertifyApiController {
 	@Resource
 	private AchievementService		achievementService;
@@ -103,9 +105,10 @@ public class UserAchievementApiController extends CertifyApiController {
 	 * 成果列表
 	 */
 	@RequestMapping(value = "/list", method = RequestMethod.GET)
-	private Result list(Integer auditStatus, Integer serialNumber, String name, String keyword, Integer category,
-			Integer ownerType, Integer status, String releaseDateStartDate, String releaseDateEndDate,String createDateStartDate, String createDateEndDate,
-			Integer releaseStatus, String pageNo, String pageSize) {
+	private Result list(Integer auditStatus, String name, Integer dataCategory,
+		 String releaseDateStartDate, String releaseDateEndDate,
+		 String pageNo, String pageSize) {
+		System.out.println("、list *-*-");
 		Result res = new Result();
 		Integer pNo = 1;
 		Integer pSize = 10;
@@ -116,8 +119,8 @@ public class UserAchievementApiController extends CertifyApiController {
 		if (StringUtils.isNumeric(pageNo)) {
 			pNo = Integer.parseInt(pageNo);
 		}
-		res.setData(achievementService.listUserAchievement(auditStatus, serialNumber, name, keyword, category,
-				ownerType, status, releaseDateStartDate, releaseDateEndDate, createDateStartDate,  createDateEndDate, releaseStatus, pNo, pSize));
+		res.setData(achievementService.listUserAchievement(auditStatus, name, dataCategory,
+				 releaseDateStartDate, releaseDateEndDate, pNo, pSize));
 		return res;
 	}
 
@@ -126,24 +129,30 @@ public class UserAchievementApiController extends CertifyApiController {
 	 */
 	@RequestMapping(value = "/apply", method = RequestMethod.POST)
 	private Result apply(@Valid InputAchievement ia, BindingResult bindingResult,
-			@RequestParam(name = "keywords[]", required = false) String[] keywords) {
+			@RequestParam(name = "keywords[]", required = false) String[] keywords,
+			@RequestParam(name = "publishPages[]", required = false)  String[] publishPages) {
 		Result res = new Result();
-
 		if (bindingResult.hasErrors()) {
 			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
 					AchievementFields.getFieldDesc(bindingResult.getFieldError().getField())));
 			return res;
 		}
 
-		res = disposeInputAchievement(res, ia, keywords);
+		res = disposeInputAchievement(res, ia, keywords,publishPages);
 		if (!res.getError().isEmpty()) {
 			return res;
 		}
 
+		if(TokenManager.getUserId()==null) {
+			res.getError().add(buildError(ErrorConstants.NON_LOGIN, "", ""));return res;
+		}
 		Achievement a = new Achievement();
 		BeanUtils.copyProperties(ia, a);
 		a.setOwnerId(TokenManager.getUserId());
-		achievementService.saveAchievement(a, keywords);
+		List<String> webPages = new ArrayList<String>();
+		List<String> appPages = new ArrayList<String>();
+		PageConstants.putAchievement(publishPages, webPages, appPages);
+		achievementService.saveAchievement(a, keywords,webPages,appPages);
 		return res;
 	}
 
@@ -180,7 +189,8 @@ public class UserAchievementApiController extends CertifyApiController {
 	 */
 	@RequestMapping(value = "/update", method = RequestMethod.POST)
 	public Result update(@Valid InputAchievement ia, BindingResult bindingResult,
-			@RequestParam(name = "keywords[]", required = false) String[] keywords) {
+			@RequestParam(name = "keywords[]", required = false) String[] keywords,
+			@RequestParam(name = "publishPages[]", required = false)  String[] publishPages) {
 		Result res = new Result();
 		if (bindingResult.hasErrors()) {
 			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
@@ -199,15 +209,25 @@ public class UserAchievementApiController extends CertifyApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "当前状态无法提交审核!"));
 			return res;
 		}
-
-		res = disposeInputAchievement(res, ia, keywords);
+		List<String> webPages = new ArrayList<String>();
+		List<String> appPages = new ArrayList<String>();
+		PageConstants.putAchievement(publishPages, webPages, appPages);
+		res = disposeInputAchievement(res, ia, keywords,publishPages);
 		if (!res.getError().isEmpty()) {
 			return res;
 		}
+		if(webPages.size()==0 && appPages.size() == 0){
 
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "页面参数错误","页面参数"));
+			return res;
+		}
+		if(TokenManager.getUserId() ==null) {
+			res.getError().add(buildError(ErrorConstants.NON_LOGIN, "", ""));return res;
+		}
 		Achievement a = new Achievement();
 		BeanUtils.copyProperties(ia, a);
-		achievementService.updateAchievement(a, keywords, null);
+		a.setOwnerId(TokenManager.getUserId());
+		res.setData(achievementService.updateAchievement(a, keywords, null,webPages,appPages));
 		return res;
 	}
 
@@ -302,7 +322,7 @@ public class UserAchievementApiController extends CertifyApiController {
 		return res;
 	}
 
-	private Result disposeInputAchievement(Result res, InputAchievement ia, String[] keywords) {
+	private Result disposeInputAchievement(Result res, InputAchievement ia, String[] keywords,String[] publishPages) {
 		if (StringUtils.isBlank(ia.getName())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果名称", "成果名称"));
 			return res;
@@ -314,19 +334,16 @@ public class UserAchievementApiController extends CertifyApiController {
 		}
 
 		if (StringUtils.isBlank(ia.getKeyword())) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到关键词", "关键词"));
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到关键词", "关键词1"));
 			return res;
 		}
 
 		if (null == keywords || keywords.length < 1) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到关键词", "关键词"));
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到关键词", "关键词2"));
 			return res;
 		}
 
-		if (null == ia.getOwnerType()) {
-			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到所有人类型", "所有人类型"));
-			return res;
-		}
+	
 
 		if (null == ia.getCooperationMode()) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到合作方式", "合作方式"));

+ 5 - 5
src/main/java/com/goafanti/achievement/service/AchievementService.java

@@ -25,17 +25,17 @@ public interface AchievementService {
 			String name, String keyword, Integer category, Integer status, String releaseDateStartDate,
 			String releaseDateEndDate,String createDateStartDate, String createDateEndDate, Integer releaseStatus, Integer pNo, Integer pSize,Integer boutique,Integer effective);
 
-	void saveAchievement(Achievement a, String[] keywords);
+	void saveAchievement(Achievement a, String[] keywords,List<String>webPages,List<String>appPages);
 
-	int updateAchievement(Achievement a, String[] keywords, Integer switchSign);
+	int updateAchievement(Achievement a, String[] keywords, Integer sIgnin,List<String>webPages,List<String>appPages);
 
 	Achievement selectByPrimaryKey(String id);
 
 	int deleteByPrimaryKey(List<String> asList);
 
-	Pagination<AchievementListBo> listUserAchievement(Integer auditStatus, Integer serialNumber, String name,
-			String keyword, Integer category, Integer ownerType, Integer status, String releaseDateStartDate,
-			String releaseDateEndDate,String createDateStartDate, String createDateEndDate, Integer releaseStatus, Integer pNo, Integer pSize);
+	Pagination<AchievementListBo> listUserAchievement(Integer auditStatus, String name,
+		 Integer dataCategory,  String releaseDateStartDate,
+			String releaseDateEndDate,  Integer pNo, Integer pSize);
 
 	int updateAuditAchievement(Achievement a, String techBroderId, Integer auditStatus);
 

+ 125 - 21
src/main/java/com/goafanti/achievement/service/impl/AchievementServiceImpl.java

@@ -26,11 +26,14 @@ import com.goafanti.achievement.bo.AchievementUserOwnerDetailBo;
 import com.goafanti.achievement.service.AchievementService;
 import com.goafanti.common.bo.PolicyEntity;
 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.AchievementInterestMapper;
 import com.goafanti.common.dao.AchievementKeywordMapper;
 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.NoticeMapper;
@@ -50,7 +53,10 @@ import com.goafanti.common.model.Achievement;
 import com.goafanti.common.model.AchievementDemand;
 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.Demand;
+import com.goafanti.common.model.DemandPublish;
 import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.OrganizationIdentity;
 import com.goafanti.common.model.User;
@@ -94,7 +100,10 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 	private AchievementInterestMapper	achievementInterestMapper;
 	@Autowired
 	private UserMapper					userMapper;
-
+	@Autowired
+	BranchInformationMapper		branchInformationMapper;
+	@Autowired
+	AchievementPublishMapper	achievementPublishMapper;
 	private static final Logger				logger	= LoggerFactory.getLogger(AchievementServiceImpl.class);
 
 	@SuppressWarnings("unchecked")
@@ -144,7 +153,7 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 	}
 
 	@Override
-	public void saveAchievement(Achievement a, String[] keywords) {
+	public void saveAchievement(Achievement a, String[] keywords,List<String >webPages,List<String>appPages) {
 		a.setId(UUID.randomUUID().toString());
 		a.setDeletedSign(DeleteStatus.UNDELETE.getCode());
 		Calendar now = Calendar.getInstance();
@@ -153,48 +162,82 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 			a.setTechBrokerId(TokenManager.getAdminId());
 		}
 		a.setReleaseStatus(AchievementReleaseStatus.UNRELEASE.getCode());
-
+		a.setAuditStatus(0);
 		if (AchievementAuditStatus.SUBMIT.getCode().equals(a.getAuditStatus())) {
 			
 			createAuditorNotice(a);
 		} else {
 			a.setAuditStatus(AchievementAuditStatus.CREATE.getCode());
 		}
-		Integer ownerType = a.getOwnerType();
-		String ownerMobile = a.getOwnerMobile();
-		String ownerName = a.getOwnerName();
 		String ownerId = "";
 		if (TokenManager.getToken() instanceof User) {
 			a.setOwnerId(TokenManager.getUserId());
 			User u=userMapper.selectByPrimaryKey(TokenManager.getUserId());
 			if (null != u) {
 				ownerId = u.getId();
-				if(ownerType == null) ownerType = u.getType();
-				if(StringUtils.isBlank(ownerMobile)) ownerMobile = u.getMobile();
-				if(StringUtils.isBlank(ownerName)) ownerName = u.getNickname();
-				// 如果是单位客户 -查询单位客户的邮件 和通讯地址、证件号码
-				//TODO
 			}
 		} 
 		a.setCreateTime(now.getTime());
-		a.setOwnerType(ownerType);
-		a.setOwnerMobile(ownerMobile);
-		a.setOwnerName(ownerName);
 		a.setOrgId(ownerId);		
 		achievementMapper.insert(a);
 		disposeAchievementKeyword(keywords, a, false);
+		disposeAchievementPublish(a,webPages,appPages,false);
+		
 	}
 
+	private void disposeAchievementPublish(Achievement a,List<String> webPages,List<String> appPages,boolean delete){
+		if(delete){
+			if(null != webPages && webPages.size()>0){
+				achievementPublishMapper.batchDeleteByAchievementId(a.getId());
+			}
+		}
+		AchievementPublish ap = null;
+		String defaultPlatformId = branchInformationMapper.selectByDomain(PageConstants.DEFAULT_DOMAIN).getId();
+		if(webPages != null && webPages.size()>0){
+			for(String page: webPages){
+				ap = new AchievementPublish();
+				ap.setId(UUID.randomUUID().toString());
+				ap.setAchievementId((a.getId()));
+				ap.setPublisher(TokenManager.getUserId());
+				ap.setPublishTime(a.getReleaseDate()==null?new Date():a.getReleaseDate());
+				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);
+				achievementPublishMapper.insert(ap);
+			}
+		}
+		if(appPages != null && appPages.size()>0){
+			for(String page: appPages){
+				ap = new AchievementPublish();
+				ap.setId(UUID.randomUUID().toString());
+				ap.setAchievementId(a.getId());
+				ap.setPublisher(TokenManager.getUserId());
+				ap.setPublishTime(a.getReleaseDate()==null?new Date():a.getReleaseDate());
+				ap.setPublishClient(PageConstants.APP_PLATFORM);
+				ap.setPublishPage(page);
+				ap.setPublishPlatform(defaultPlatformId);
+				ap.setIfTop(AFTConstants.NO);
+				ap.setTopNumber(PageConstants.DEFAULT_TOP_NUMBER);
+				ap.setShowNumber(PageConstants.DEFAULT_SHOW_NUMBER);
+				achievementPublishMapper.insert(ap);
+			}
+		}
+	}
 	@Override
-	public int updateAchievement(Achievement a, String[] keywords, Integer switchSign) {
+	public int updateAchievement(Achievement a, String[] keywords, Integer switchSign,List<String>webPages,List<String>appPages) {
 		if (AchievementAuditStatus.SUBMIT.getCode().equals(a.getAuditStatus())) {
 			createAuditorNotice(a);
 		}
 		disposeAchievementKeyword(keywords, a, true);
+		disposeAchievementPublish(a,webPages,appPages,true);
 		achievementMapper.updateByPrimaryKeySelective(a);
 		if (null != switchSign && AchievementSwitchSign.CLOSE.getCode().equals(switchSign)) {
 			achievementMapper.updateOwnerId(a.getId());
 		}
+
 		return 1;
 	}
 
@@ -226,9 +269,9 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<AchievementListBo> listUserAchievement(Integer auditStatus, Integer serialNumber, String name,
-			String keyword, Integer category, Integer ownerType, Integer status, String releaseDateStartDate,
-			String releaseDateEndDate,String createDateStartDate, String createDateEndDate, Integer releaseStatus, Integer pNo, Integer pSize) {
+	public Pagination<AchievementListBo> listUserAchievement(Integer auditStatus, String name,
+		Integer dataCategory,  String releaseDateStartDate,
+			String releaseDateEndDate, Integer pNo, Integer pSize) {
 		if (pNo == null || pNo < 0) {
 			pNo = 1;
 		}
@@ -236,11 +279,72 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 		if (pSize == null || pSize < 0 || pSize > 10) {
 			pSize = 10;
 		}
-		return (Pagination<AchievementListBo>) findPage("findAchievementListByPage", "findAchievementCount",
-				disposeParams(ownerType,null, null, TokenManager.getUserId(), auditStatus, serialNumber, name, keyword, category,
-						status, releaseDateStartDate, releaseDateEndDate,createDateStartDate,createDateEndDate, releaseStatus, null, null,null, null,null),
+		return (Pagination<AchievementListBo>) findPage("ListMyAchievement", "findAchievementCount",
+				disposeParams( TokenManager.getUserId(), auditStatus,   dataCategory,name,
+						releaseDateStartDate, releaseDateEndDate),
 				pNo, pSize);
 	}
+	
+	
+	//sixParam
+	private Map<String, Object> disposeParams( String ownerId,Integer auditStatus,Integer dataCategory,
+			 String name, 
+			String releaseDateStartDate, String releaseDateEndDate
+		) {
+		Map<String, Object> params = new HashMap<>();
+
+		Date rStart = null;
+		Date rEnd = null;
+		Date cStart = null;
+		Date cEnd = null;
+	
+
+		if (null != dataCategory) {
+			params.put("dataCategory", dataCategory);
+		}
+
+		if (!StringUtils.isBlank(releaseDateStartDate)) {
+			try {
+				rStart = DateUtils.parseDate(releaseDateStartDate, AFTConstants.YYYYMMDD);
+			} catch (ParseException e) {
+			}
+		}
+
+		if (!StringUtils.isBlank(releaseDateEndDate)) {
+			try {
+				rEnd = DateUtils.addDays(DateUtils.parseDate(releaseDateEndDate, AFTConstants.YYYYMMDD), 1);
+			} catch (ParseException e) {
+			}
+		}
+		
+
+		if (!StringUtils.isBlank(ownerId)) {
+			params.put("ownerId", ownerId);
+		}
+		if (null != rStart) {
+			params.put("rStart", rStart);
+		}
+
+		if (null != rEnd) {
+			params.put("rEnd", rEnd);
+		}
+		
+
+		if (null != auditStatus) {
+			params.put("auditStatus", auditStatus);
+		}
+
+		
+		if (!StringUtils.isBlank(name)) {
+			params.put("name", name);
+		}
+
+		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN) && !TokenManager.hasRole(AFTConstants.AUDITORADMIN)) {
+			params.put("techBrokerId", TokenManager.getAdminId());
+		}
+		
+		return params;
+	}
 
 	private Map<String, Object> disposeParams(Integer ownerType,String username, String ownerName, String ownerId, Integer auditStatus,
 			Integer serialNumber, String name, String keyword, Integer category, Integer status,

+ 2 - 0
src/main/java/com/goafanti/common/dao/AchievementPublishMapper.java

@@ -95,4 +95,6 @@ public interface AchievementPublishMapper {
     int updateByPrimaryKey(AchievementPublish record);
 
 	int checkExisting(AchievementPublish a);
+	
+	int batchDeleteByAchievementId(String id) ;
 }

+ 40 - 102
src/main/java/com/goafanti/common/mapper/AchievementMapper.xml

@@ -86,38 +86,24 @@
       name, keyword, category, 
       summary, introduction, technical_picture_url, 
       field_a, field_b, field_c, 
-      maturity, maturity_picture_url, maturity_text_file_url, 
-      maturity_video_url, innovation, owner_id, owner_name, 
-      owner_type, owner_id_number, owner_mobile, 
-      owner_email, owner_postal_address, cooperation_mode, 
-      transfer_mode, bargaining_mode, transfer_price, 
-      technical_scene, breakthrough, patent_case, 
-      awards, team_des, parameter, 
-      tech_plan_url, business_plan_url, org_id, 
-      org_name, org_address, org_email, 
-      org_contacts, org_contacts_mobile,  
-      manager_id, salesman_id, status, 
+      maturity, innovation, owner_id, owner_postal_address, cooperation_mode, 
+      transfer_mode, bargaining_mode, transfer_price,  patent_case, 
+      awards, team_des, parameter,  status, 
       create_time, release_status, release_date, 
-      deleted_sign, audit_status, tech_broker_id,
-      country_name_zh,international_flag,jmrh_flag,boutique,remark,contacts,contact_mobile )
+      deleted_sign, audit_status,international_flag,boutique)
     values (#{id,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER}, #{dataCategory,jdbcType=INTEGER}, 
       #{name,jdbcType=VARCHAR}, #{keyword,jdbcType=VARCHAR}, #{category,jdbcType=INTEGER}, 
       #{summary,jdbcType=VARCHAR}, #{introduction,jdbcType=LONGVARCHAR}, #{technicalPictureUrl,jdbcType=VARCHAR}, 
       #{fieldA,jdbcType=INTEGER}, #{fieldB,jdbcType=INTEGER}, #{fieldC,jdbcType=INTEGER}, 
-      #{maturity,jdbcType=INTEGER}, #{maturityPictureUrl,jdbcType=LONGVARCHAR}, #{maturityTextFileUrl,jdbcType=VARCHAR}, 
-      #{maturityVideoUrl,jdbcType=VARCHAR}, #{innovation,jdbcType=INTEGER}, #{ownerId,jdbcType=VARCHAR}, #{ownerName,jdbcType=VARCHAR},
-      #{ownerType,jdbcType=INTEGER}, #{ownerIdNumber,jdbcType=VARCHAR}, #{ownerMobile,jdbcType=VARCHAR}, 
-      #{ownerEmail,jdbcType=VARCHAR}, #{ownerPostalAddress,jdbcType=VARCHAR}, #{cooperationMode,jdbcType=INTEGER}, 
+      #{maturity,jdbcType=INTEGER}, #{innovation,jdbcType=INTEGER}, #{ownerId,jdbcType=VARCHAR}
+      , #{ownerPostalAddress,jdbcType=VARCHAR}, #{cooperationMode,jdbcType=INTEGER}, 
       #{transferMode,jdbcType=INTEGER}, #{bargainingMode,jdbcType=INTEGER}, #{transferPrice,jdbcType=DECIMAL}, 
-      #{technicalScene,jdbcType=VARCHAR}, #{breakthrough,jdbcType=VARCHAR}, #{patentCase,jdbcType=VARCHAR}, 
+     #{patentCase,jdbcType=VARCHAR}, 
       #{awards,jdbcType=VARCHAR}, #{teamDes,jdbcType=VARCHAR}, #{parameter,jdbcType=VARCHAR}, 
-      #{techPlanUrl,jdbcType=VARCHAR}, #{businessPlanUrl,jdbcType=VARCHAR}, #{orgId,jdbcType=VARCHAR}, 
-      #{orgName,jdbcType=VARCHAR}, #{orgAddress,jdbcType=VARCHAR}, #{orgEmail,jdbcType=VARCHAR}, 
-      #{orgContacts,jdbcType=VARCHAR}, #{orgContactsMobile,jdbcType=VARCHAR}, 
-      #{managerId,jdbcType=VARCHAR}, #{salesmanId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
+    #{status,jdbcType=INTEGER}, 
       #{createTime,jdbcType=TIMESTAMP}, #{releaseStatus,jdbcType=INTEGER}, #{releaseDate,jdbcType=TIMESTAMP}, 
-      #{deletedSign,jdbcType=INTEGER}, #{auditStatus,jdbcType=INTEGER}, #{techBrokerId,jdbcType=VARCHAR},
-      #{countryNameZh,jdbcType=VARCHAR}, #{internationalFlag,jdbcType=INTEGER},#{jmrhFlag,jdbcType=INTEGER},#{boutique,jdbcType=INTEGER},#{remark,jdbcType=VARCHAR},#{contacts,jdbcType=VARCHAR},#{contactMobile,jdbcType=VARCHAR})
+      #{deletedSign,jdbcType=INTEGER}, #{auditStatus,jdbcType=INTEGER},
+       #{internationalFlag,jdbcType=INTEGER},#{boutique,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.Achievement">
     insert into achievement
@@ -501,36 +487,12 @@
       <if test="maturity != null">
         maturity = #{maturity,jdbcType=INTEGER},
       </if>
-      <if test="maturityPictureUrl != null">
-        maturity_picture_url = #{maturityPictureUrl,jdbcType=LONGVARCHAR},
-      </if>
-      <if test="maturityTextFileUrl != null">
-        maturity_text_file_url = #{maturityTextFileUrl,jdbcType=VARCHAR},
-      </if>
-      <if test="maturityVideoUrl != null">
-        maturity_video_url = #{maturityVideoUrl,jdbcType=VARCHAR},
-      </if>
       <if test="innovation != null">
         innovation = #{innovation,jdbcType=INTEGER},
       </if>
       <if test="ownerId != null">
         owner_id = #{ownerId,jdbcType=VARCHAR},
       </if>
-      <if test="ownerName != null">
-        owner_name = #{ownerName,jdbcType=VARCHAR},
-      </if>
-      <if test="ownerType != null">
-        owner_type = #{ownerType,jdbcType=INTEGER},
-      </if>
-      <if test="ownerIdNumber != null">
-        owner_id_number = #{ownerIdNumber,jdbcType=VARCHAR},
-      </if>
-      <if test="ownerMobile != null">
-        owner_mobile = #{ownerMobile,jdbcType=VARCHAR},
-      </if>
-      <if test="ownerEmail != null">
-        owner_email = #{ownerEmail,jdbcType=VARCHAR},
-      </if>
       <if test="ownerPostalAddress != null">
         owner_postal_address = #{ownerPostalAddress,jdbcType=VARCHAR},
       </if>
@@ -546,12 +508,6 @@
       <if test="transferPrice != null">
         transfer_price = #{transferPrice,jdbcType=DECIMAL},
       </if>
-      <if test="technicalScene != null">
-        technical_scene = #{technicalScene,jdbcType=VARCHAR},
-      </if>
-      <if test="breakthrough != null">
-        breakthrough = #{breakthrough,jdbcType=VARCHAR},
-      </if>
       <if test="patentCase != null">
         patent_case = #{patentCase,jdbcType=VARCHAR},
       </if>
@@ -564,39 +520,6 @@
       <if test="parameter != null">
         parameter = #{parameter,jdbcType=VARCHAR},
       </if>
-      <if test="techPlanUrl != null">
-        tech_plan_url = #{techPlanUrl,jdbcType=VARCHAR},
-      </if>
-      <if test="businessPlanUrl != null">
-        business_plan_url = #{businessPlanUrl,jdbcType=VARCHAR},
-      </if>
-      <if test="orgId != null">
-        org_id = #{orgId,jdbcType=VARCHAR},
-      </if>
-      <if test="orgName != null">
-        org_name = #{orgName,jdbcType=VARCHAR},
-      </if>
-      <if test="orgAddress != null">
-        org_address = #{orgAddress,jdbcType=VARCHAR},
-      </if>
-      <if test="orgEmail != null">
-        org_email = #{orgEmail,jdbcType=VARCHAR},
-      </if>
-      <if test="orgContacts != null">
-        org_contacts = #{orgContacts,jdbcType=VARCHAR},
-      </if>
-      <if test="orgContactsMobile != null">
-        org_contacts_mobile = #{orgContactsMobile,jdbcType=VARCHAR},
-      </if>
-      <if test="contacts != null">
-        contacts = #{contacts,jdbcType=INTEGER},
-      </if>
-      <if test="managerId != null">
-        manager_id = #{managerId,jdbcType=VARCHAR},
-      </if>
-      <if test="salesmanId != null">
-        salesman_id = #{salesmanId,jdbcType=VARCHAR},
-      </if>
       <if test="status != null">
         status = #{status,jdbcType=INTEGER},
       </if>
@@ -615,30 +538,15 @@
       <if test="auditStatus != null">
         audit_status = #{auditStatus,jdbcType=INTEGER},
       </if>
-      <if test="techBrokerId != null">
-        tech_broker_id = #{techBrokerId,jdbcType=VARCHAR},
-      </if>
       <if test="countryNameZh != null">
       	country_name_zh = #{countryNameZh,jdbcType=VARCHAR},
       </if>
        <if test="internationalFlag != null">
       	international_flag = #{internationalFlag,jdbcType=INTEGER},
       </if>
-     <if test="jmrhFlag != null">
-      	jmrh_flag = #{jmrhFlag,jdbcType=INTEGER},
-      </if>
        <if test="boutique != null">
         boutique = #{boutique,jdbcType=INTEGER},
       </if>
-      <if test="remark != null">
-        remark = #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="contacts != null">
-        contacts  = #{contacts,jdbcType=VARCHAR},
-      </if>
-      <if test="contactMobile != null">
-        contact_mobile  = #{contactMobile ,jdbcType=VARCHAR},
-      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -2363,4 +2271,34 @@ audit_status=2
 and info_sources=1
 order by release_date limit #{0}
 </select>
+<select id="ListMyAchievement"   resultType="com.goafanti.demand.bo.DemandAchievementListBo">
+select 
+  		a.id, a.serial_number as serialNumber, a.data_category as dataCategory,
+  		a.name, a.release_date as releaseDate, a.audit_status as auditStatus 
+  	from achievement a
+  	where deleted_sign = 0 
+	<if test="ownerId != null">
+  	and a.owner_id = #{ownerId,jdbcType=VARCHAR}
+  	</if>
+	<if test="auditStatus != null">
+		and  a.audit_status = #{auditStatus,jdbcType=INTEGER}
+	</if>
+	<if test="name != null">
+		and a.name like "%"#{name,jdbcType=VARCHAR}"%"
+	</if>
+
+	<if test="dataCategory != null and dataCategory != ''">
+  		and a.data_category = #{dataCategory,jdbcType=INTEGER}
+  	</if>
+	<if test="rStart != null">
+       and	a.release_date <![CDATA[ >= ]]> #{rStart,jdbcType=TIMESTAMP}
+	</if>
+	<if test="rEnd != null">
+	   and  a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
+	</if>
+	order by serial_number desc
+	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+</select>
 </mapper>

+ 4 - 0
src/main/java/com/goafanti/common/mapper/AchievementPublishMapper.xml

@@ -435,4 +435,8 @@ where 1=1
 	 	and publish_client= #{publishClient,jdbcType=INTEGER}
 	 	and publish_page= #{publishPage,jdbcType=VARCHAR}
 	 </select>
+	 
+	  <delete id="batchDeleteByAchievementId" parameterType="java.lang.String">
+	 	delete from achievement_publish where achievement_id = #{id,jdbcType=VARCHAR}
+	 </delete>
 </mapper>

+ 1 - 0
src/main/java/com/goafanti/demand/controller/UserDemandApiController.java

@@ -92,6 +92,7 @@ public class UserDemandApiController extends CertifyApiController {
 			@RequestParam(name = "publishPages[]", required = false) String[] publishPages,
 			String validityPeriodFormattedDate) {
 		Result res = new Result();
+		System.out.println("a1");
 		if (bindingResult.hasErrors()) {
 			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
 					DemandFields.getFieldDesc(bindingResult.getFieldError().getField())));

+ 1 - 8
src/main/java/com/goafanti/portal/bo/AchievementObject.java

@@ -146,14 +146,7 @@ public class AchievementObject extends InputAchievement {
 		setMaturityS(Maturity.find(maturity.intValue()).getName());
 	}
 	
-	@Override
-	public void setOwnerType(Integer ownerType) {
-		// TODO Auto-generated method stub
-		super.setOwnerType(ownerType);
-		if(ownerType==null)return;
-		if(ownerType.intValue()==1)setOwnerTypeS("组织所有");
-		else setOwnerTypeS("个人所有");
-	}
+
 	
 	
 }

+ 1 - 3
src/main/webapp/WEB-INF/views/portal/technologyTrading/achievementDetail.html

@@ -118,9 +118,7 @@
 								<p >
 									名称:<span th:text="${reachievementlist.name}?${reachievementlist.name}:未知"></span>
 								</p>
-							    <p >
-									类型:<span th:text="${reachievementlist.ownerTypeS}?${reachievementlist.ownerTypeS}:个人所有"></span>
-								</p> 
+							   
 								<p >
 									交易方式:<span th:text="${reachievementlist.transferModeS}?${reachievementlist.transferModeS}:暂无"></span>
 								</p>