Browse Source

成果、需求、专家、顾问、项目撤销开发

anderx 7 years ago
parent
commit
627d10a959

+ 14 - 0
src/main/java/com/goafanti/achievement/controller/AdminAchievementApiController.java

@@ -23,6 +23,7 @@ import com.goafanti.common.enums.AchievementAuditStatus;
 import com.goafanti.common.enums.AttachmentType;
 import com.goafanti.common.model.Achievement;
 import com.goafanti.common.model.AchievementPublish;
+import com.goafanti.common.model.UserIdentity;
 import com.goafanti.common.service.BranchInformationService;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.portal.bo.AchievementResultObject;
@@ -95,6 +96,19 @@ public class AdminAchievementApiController extends CertifyApiController {
     	achievementService.updateAuditAchievement( id,auditResult,auditInfo);
     	return result; 
     }
+    
+  //撤销成果
+  		@RequestMapping(value="/annul", method = RequestMethod.POST)
+  		public Result annul(String id){
+  			Result res = new Result();
+  			if (StringUtils.isBlank(id)) {
+  				res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"","撤销"));
+  				return res;
+  			}
+  			achievementService.updateAuditAchievement( id,0,null);
+  			res.setData(1);
+  			return res;
+  		}
 	@RequestMapping(value = "/achievementDetail",method=RequestMethod.GET)
 	private Result Detail(String id) {
 		Result result=new Result();

+ 14 - 10
src/main/java/com/goafanti/achievement/service/impl/AchievementServiceImpl.java

@@ -789,23 +789,27 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 		int auditStatus=AchievementAuditStatus.AUDITED.getCode().intValue();
 		if(auditResult.intValue() == 0) {
 			auditStatus=AchievementAuditStatus.UNAUDITED.getCode().intValue();
+			if(collectFlag)jtCollectSearchMapper.deleteByrowId(id);
+		}
+		else {
+			auditStatus=AchievementAuditStatus.AUDITED.getCode().intValue();
+			if(collectFlag){
+				Achievement a=achievementMapper.selectByPrimaryKey(id);
+				JtCollectSearch r=new JtCollectSearch();
+				r.setFromTable(collectType.ACHIEVEMENT.getDesc());
+				r.setKeyword(a.getKeyword());
+				r.setTitle(a.getName());
+				r.setRowId(a.getId());
+				jtCollectSearchMapper.insertSelective(r);
+			}
 		}
-		else auditStatus=AchievementAuditStatus.AUDITED.getCode().intValue();
 		Achievement achievement=new Achievement();
 		achievement.setId(id);
 		achievement.setAuditStatus(auditStatus);
 		achievement.setAuditInfo(auditInfo);
 		achievement.setReleaseDate(new Date());
 		achievementMapper.updateByPrimaryKeySelective(achievement);
-		if(collectFlag){
-			Achievement a=achievementMapper.selectByPrimaryKey(id);
-			JtCollectSearch r=new JtCollectSearch();
-			r.setFromTable(collectType.ACHIEVEMENT.getDesc());
-			r.setKeyword(a.getKeyword());
-			r.setTitle(a.getName());
-			r.setRowId(a.getId());
-			jtCollectSearchMapper.insertSelective(r);
-		}
+		
 		return auditStatus;
 	}
 

+ 3 - 2
src/main/java/com/goafanti/admin/controller/AdminApiController.java

@@ -47,7 +47,7 @@ import com.goafanti.user.service.UserIdentityService;
 import com.goafanti.user.service.UserService;
 
 @Controller
-@RequestMapping(value = "/open/api/admin")
+@RequestMapping(value = "/api/admin")
 public class AdminApiController extends CertifyApiController {
 	@Resource
 	private UserService						userService;
@@ -420,10 +420,11 @@ public class AdminApiController extends CertifyApiController {
 		@RequestMapping(value="/annul", method = RequestMethod.POST)
 		public Result annul(UserIdentity identity){
 			Result res = new Result();
-			if (StringUtils.isBlank(identity.getId())||null==identity.getAuditStatus()) {
+			if (StringUtils.isBlank(identity.getId())) {
 				res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"","撤销"));
 				return res;
 			}
+			identity.setAuditStatus(3);
 			res.setData(userIdentityService.updateAuditing(identity));
 			return res;
 		}

+ 14 - 1
src/main/java/com/goafanti/business/controller/AdminJtBusinessController.java

@@ -22,7 +22,7 @@ import com.goafanti.common.model.JtTag;
 import com.goafanti.common.utils.StringUtils;
 
 @RestController
-@RequestMapping(value = "/api/admin/jtBusiness")
+@RequestMapping(value = "/open/api/admin/jtBusiness")
 public class AdminJtBusinessController extends CertifyApiController{
 	
 	@Resource 
@@ -272,6 +272,19 @@ public class AdminJtBusinessController extends CertifyApiController{
     	return result; 
 	}
 	
+	@RequestMapping(value="/project/annul" ,method=RequestMethod.POST)
+    private Result projectAnnul(JtBusinessProject jtBusinessProject) {
+    	Result result=new Result();
+    	if (StringUtils.isBlank(jtBusinessProject.getId())) {
+    		result.getError().add(buildError(ErrorConstants.PARAM_ERROR,"","撤销"));
+			return result;
+		}
+    	jtBusinessProject.setAuditStatus(3);
+    	jtBusinessService.updateJtCollectSearch(jtBusinessProject.getId());
+    	result.setData(jtBusinessService.updateProject(jtBusinessProject));
+    	return result; 
+	}
+	
 	/*
 	 * 新增标签
 	 * */

+ 2 - 3
src/main/java/com/goafanti/common/mapper/JtBusinessProjectMapper.xml

@@ -655,17 +655,16 @@
 	  ifnull(dct.dealCount,0) as dealCount,
 	  ifnull(x.count,0) as interestCount,
 	  u.nickname as companyName,u.id as companyId,
+	  jtbc1.module,
 	  u.`type` as type
   from jt_business_project jtbp
   left join user u on u.id=jtbp.owner_id
   left join (select project_id as id,count(*) as count from project_interest group by project_id)x on jtbp.id=x.id
   left join (select sum(commodity_quantity) as dealCount ,commodity_id from jt_order_detail group by commodity_id) dct on jtbp.id=dct.commodity_id
+  left join jt_business_category jtbc1 on jtbc1.id = jtbp.category_id
   <if test="topId!=null">
   left join jt_business_category jtbc on jtbc.super_id =#{topId,jdbcType=VARCHAR}
   </if>
-  <if test="module!=null">
-  left join jt_business_category jtbc1 on jtbc1.id = jtbp.category_id
-  </if>
   <if test="tag != null">
   left join jt_business_project_tag x on x.project_id=jtbp.id
   left join jt_tag y on x.tag_id=y.id

+ 19 - 0
src/main/java/com/goafanti/demand/controller/AdminDemandApiController.java

@@ -172,6 +172,25 @@ public class AdminDemandApiController extends CertifyApiController {
 		return res;
 	}
 	
+
+	/**
+	 * 撤销需求
+	 * @param id
+	 * @param auditResult
+	 * @return
+	 */
+	
+	@RequestMapping(value = "/annul", method = RequestMethod.POST)
+	public Result annul(Demand d){
+		Result res = new Result();
+		if (StringUtils.isBlank(d.getId())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"","撤销"));
+			return res;
+		}
+		d.setAuditStatus(3);
+		res.setData(demandService.updateByPrimaryKeySelective(d));
+		return res;
+	}
 	/**
 	 * 需求管理--获取个人用户下拉
 	 */

+ 1 - 1
src/main/java/com/goafanti/demand/service/impl/DemandServiceImpl.java

@@ -605,7 +605,7 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 				r.setRowId(d.getId());
 				jtCollectSearchMapper.insertSelective(r);				
 			}
-			if (d.getAuditStatus()==4) {
+			if (d.getAuditStatus()==4||d.getAuditStatus()==3) {
 				if(collectFlag)jtCollectSearchMapper.deleteByrowId(d.getId());
 			}
 		}

+ 1 - 1
src/main/webapp/WEB-INF/views/portal/facilitator.html

@@ -14,7 +14,7 @@
 <body>
     <div th:replace="common::nav('','index')"></div>
     <!--主体部分-->
-    <div id="facili" class="container">
+    <div id="facili" >
     	<div class="facImg">
     		<div>
     			<div><img th:src="${org.companyLogoUrl}==null or ${org.companyLogoUrl}==''?${portalHost+'/img/fac/fea1.png'}:${avatarUploadHost+org.companyLogoUrl}" alt=""></div>

File diff suppressed because it is too large
+ 1 - 1
src/main/webapp/WEB-INF/views/portal/service/serviceDetails.html