|
|
@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
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.controller.CertifyApiController;
|
|
|
import com.goafanti.common.enums.AttachmentType;
|
|
|
@@ -15,8 +16,6 @@ import com.goafanti.common.enums.DeleteStatus;
|
|
|
import com.goafanti.common.enums.DemandAuditStatus;
|
|
|
import com.goafanti.common.model.AftFile;
|
|
|
import com.goafanti.common.model.Demand;
|
|
|
-import com.goafanti.common.model.DemandFollow;
|
|
|
-import com.goafanti.common.model.DemandFollowDetail;
|
|
|
import com.goafanti.common.model.DemandPublish;
|
|
|
import com.goafanti.common.utils.StringUtils;
|
|
|
import com.goafanti.demand.service.DemandFollowService;
|
|
|
@@ -110,6 +109,20 @@ public class AdminDemandApiController extends CertifyApiController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 需求列表
|
|
|
+ * @param pageNo
|
|
|
+ * @param pageSize
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
|
+ public Result list(String name,String employerName,Integer demandType,
|
|
|
+ Integer auditStatus,Integer status,String startDate, String endDate,Integer pageNo, Integer pageSize){
|
|
|
+ Result res = new Result();
|
|
|
+ res.setData(demandService.listDemand(name, employerName, demandType, auditStatus, status,startDate,endDate, pageNo, pageSize));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 个人需求详情
|
|
|
*/
|
|
|
@RequestMapping(value = "/userDemandDetail", method = RequestMethod.GET)
|
|
|
@@ -119,7 +132,6 @@ public class AdminDemandApiController extends CertifyApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
res.setData(demandService.selectUserDemandDetail(id));
|
|
|
return res;
|
|
|
}
|
|
|
@@ -144,7 +156,57 @@ public class AdminDemandApiController extends CertifyApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 需求详情
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/demandDetail", 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.selectDemandDetail(id));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 审核需求
|
|
|
+ * @param id
|
|
|
+ * @param auditResult
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+
|
|
|
+ @RequestMapping(value = "/auditDemand", method = RequestMethod.GET)
|
|
|
+ public Result auditDemand(String id, Integer auditResult,String auditInfo){
|
|
|
+ Result res = new Result();
|
|
|
+ if (StringUtils.isBlank(id)) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ Demand d = demandService.selectByPrimaryKey(id);
|
|
|
+ if (null == d) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "需求ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if(d.getAuditStatus() != DemandAuditStatus.INAUDIT.getCode()){
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "需求未达审核条件"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if(AFTConstants.NO == auditResult && StringUtils.isBlank(auditInfo)){
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "需填写审核意见"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if(AFTConstants.YES == auditResult || AFTConstants.NO == auditResult){
|
|
|
+ d.setAuditStatus(auditResult);
|
|
|
+ }
|
|
|
+ demandService.updateByPrimaryKeySelective(d);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 需求管理--获取个人用户下拉
|
|
|
*/
|
|
|
@@ -320,124 +382,5 @@ public class AdminDemandApiController extends CertifyApiController {
|
|
|
Result res=new Result();
|
|
|
return res.data(DemandPublishPageService.getBranchInformation());
|
|
|
}
|
|
|
- /**
|
|
|
- * 新增匹配跟进保存
|
|
|
- */
|
|
|
- @RequestMapping(value = "/addDemandFollow", method = RequestMethod.POST)
|
|
|
- private Result addDemandFollow(DemandFollow d) {
|
|
|
- Result res = new Result();
|
|
|
- if (StringUtils.isBlank(d.getDemandId())) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求", "需求"));
|
|
|
- return res;
|
|
|
- }
|
|
|
- if (StringUtils.isBlank(d.getContactMobile())) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到联系人电话", "联系人电话"));
|
|
|
- return res;
|
|
|
- }
|
|
|
- if (StringUtils.isBlank(d.getContacts())) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到联系人", "联系人"));
|
|
|
- return res;
|
|
|
- }
|
|
|
- if (StringUtils.isBlank(d.getOrganization())) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到机构", "机构"));
|
|
|
- return res;
|
|
|
- }
|
|
|
- res.data(demandFollowService.insertDemandFollow(d));
|
|
|
- return res;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 修改匹配跟进
|
|
|
- */
|
|
|
- @RequestMapping(value = "/updateDemandFollow", method = RequestMethod.POST)
|
|
|
- private Result DemandFollow(DemandFollow d) {
|
|
|
- Result res = new Result();
|
|
|
- if (StringUtils.isBlank(d.getId())) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求匹配", "匹配跟进"));
|
|
|
- return res;
|
|
|
- }
|
|
|
- res.setData(demandFollowService.updateDemandFollow(d));
|
|
|
- return res;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 新增跟进情况
|
|
|
- */
|
|
|
- @RequestMapping(value = "/addDemandFollowDetail", method = RequestMethod.POST)
|
|
|
- private Result addDemandFollowDetail(DemandFollowDetail d,String createTimeFormattedDate) {
|
|
|
- Result res = new Result();
|
|
|
- if (StringUtils.isBlank(d.getDemandFollowId())) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求匹配跟进", "需求匹配跟进"));
|
|
|
- return res;
|
|
|
- }
|
|
|
- if (StringUtils.isBlank(d.getRemarks())) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到跟进情况", "跟进情况"));
|
|
|
- return res;
|
|
|
- }
|
|
|
- if (null==d.getResult()) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到跟进结果", "跟进结果"));
|
|
|
- return res;
|
|
|
- }
|
|
|
- if (StringUtils.isBlank(createTimeFormattedDate)) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到跟进时间", "跟进时间"));
|
|
|
- return res;
|
|
|
- }
|
|
|
- res.data(demandFollowService.insertDemandFollowDetail(d,createTimeFormattedDate));
|
|
|
- return res;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 跟进列表
|
|
|
- */
|
|
|
- @RequestMapping(value = "/listDemandFollow", method = RequestMethod.GET)
|
|
|
- private Result listDemandFollow(String id,Integer pNo,Integer pSize) {
|
|
|
- Result res = new Result();
|
|
|
- if (StringUtils.isBlank(id)) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求匹配跟进", "需求匹配跟进"));
|
|
|
- return res;
|
|
|
- }
|
|
|
- res.data(demandFollowService.selectDemandFollow( id, pNo, pSize));
|
|
|
- return res;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 删除跟进
|
|
|
- */
|
|
|
- @RequestMapping(value = "/deleteDemandFollow", method = RequestMethod.GET)
|
|
|
- private Result deleteDemandFollow(String id) {
|
|
|
- Result res = new Result();
|
|
|
- if (StringUtils.isBlank(id)) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求匹配跟进", "需求匹配跟进"));
|
|
|
- return res;
|
|
|
- }
|
|
|
- res.data(demandFollowService.deleteDemandFollow( id));
|
|
|
- return res;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 跟进情况列表
|
|
|
- */
|
|
|
- @RequestMapping(value = "/listDemandFollowDetail", method = RequestMethod.GET)
|
|
|
- private Result listDemandFollowDetail(String id,Integer pNo, Integer pSize) {
|
|
|
- Result res = new Result();
|
|
|
- if (StringUtils.isBlank(id)) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求跟进", "需求跟进"));
|
|
|
- return res;
|
|
|
- }
|
|
|
- res.data(demandFollowService.selectDemandFollowDetail( id,pNo, pSize));
|
|
|
- return res;
|
|
|
- }
|
|
|
- /**
|
|
|
- * 匹配跟进
|
|
|
- */
|
|
|
- @RequestMapping(value = "/DemandFollowDetails", method = RequestMethod.GET)
|
|
|
- private Result DemandFollowDetails(String id) {
|
|
|
- Result res = new Result();
|
|
|
- if (StringUtils.isBlank(id)) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求跟进", "需求跟进"));
|
|
|
- return res;
|
|
|
- }
|
|
|
- res.data(demandService.DemandFollowDetails(id));
|
|
|
- return res;
|
|
|
- }
|
|
|
+
|
|
|
}
|