|
|
@@ -8,20 +8,23 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import com.goafanti.admin.service.AdminService;
|
|
|
import com.goafanti.common.bo.Result;
|
|
|
+import com.goafanti.common.constant.ErrorConstants;
|
|
|
import com.goafanti.common.controller.CertifyApiController;
|
|
|
+import com.goafanti.common.enums.DemandAuditStatus;
|
|
|
+import com.goafanti.common.model.Demand;
|
|
|
+import com.goafanti.common.utils.StringUtils;
|
|
|
import com.goafanti.demand.service.DemandService;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping(value = "/api/admin/audit")
|
|
|
public class AdminAuditApiController extends CertifyApiController {
|
|
|
@Resource
|
|
|
- private AdminService adminService;
|
|
|
+ private AdminService adminService;
|
|
|
@Resource
|
|
|
- private DemandService demandService;
|
|
|
-
|
|
|
+ private DemandService demandService;
|
|
|
|
|
|
/**
|
|
|
- * 审核员--获取技术经纪人
|
|
|
+ * 审核员--获取技术经纪人下拉
|
|
|
*/
|
|
|
@RequestMapping(value = "/techBroders", method = RequestMethod.GET)
|
|
|
public Result getTechBroders() {
|
|
|
@@ -31,11 +34,56 @@ public class AdminAuditApiController extends CertifyApiController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 科技需求详情
|
|
|
+ * 审核员--需求详情技术经纪人
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/techBroder", method = RequestMethod.GET)
|
|
|
+ public Result demandDetail(String id) {
|
|
|
+ Result res = new Result();
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(id)) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ res.setData(demandService.selectByPrimaryKey(id).getTechBrokerId());
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 审核员--审核科技需求
|
|
|
*/
|
|
|
- @RequestMapping(value = "/demandDetail", method = RequestMethod.GET)
|
|
|
- public Result demandDetail() {
|
|
|
+ @RequestMapping(value = "/demand", method = RequestMethod.POST)
|
|
|
+ public Result demand(String id, String techBroderId, Integer auditStatus) {
|
|
|
Result res = new Result();
|
|
|
+ if (StringUtils.isBlank(id)) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (null == auditStatus){
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到审核状态", "审核状态"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!DemandAuditStatus.AUDITED.getCode().equals(auditStatus)
|
|
|
+ && !DemandAuditStatus.UNAUDITED.getCode().equals(auditStatus)){
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "审核状态"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (DemandAuditStatus.AUDITED.getCode().equals(auditStatus)){
|
|
|
+ if (StringUtils.isBlank(techBroderId)){
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到技术经纪人", "技术经纪人"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Demand d = demandService.selectByPrimaryKey(id);
|
|
|
+ if (null == d){
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "需求ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ res.setData(demandService.updateAuditDemand(d, techBroderId, auditStatus));
|
|
|
return res;
|
|
|
}
|
|
|
}
|