|
@@ -0,0 +1,98 @@
|
|
|
+package com.dgtly.member.controller;
|
|
|
+
|
|
|
+import com.dgtly.common.annotation.ApiNoCheckSign;
|
|
|
+import com.dgtly.common.annotation.ApiPassToken;
|
|
|
+import com.dgtly.common.core.controller.ApiBaseController;
|
|
|
+import com.dgtly.common.core.domain.AjaxResult;
|
|
|
+import com.dgtly.common.core.domain.ParameterObject;
|
|
|
+import com.dgtly.common.core.domain.ResultType;
|
|
|
+import com.dgtly.common.utils.DateUtils;
|
|
|
+import com.dgtly.notice.domain.NoticeDemand;
|
|
|
+import com.dgtly.notice.service.INoticeDemandService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @descption: 需求、供应相关接口API
|
|
|
+ * @author LiuLingChao
|
|
|
+ * @version 1.0
|
|
|
+ * @company 神州数码通用软件(洛阳)有限公司
|
|
|
+ * @copyright (c) 2019 LuoYang DGT Co'Ltd Inc. All rights reserved.
|
|
|
+ * @date 2020-2-25 10:12
|
|
|
+ * @since JDK1.8
|
|
|
+ */
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequestMapping("/demand/info")
|
|
|
+@ApiPassToken/* 不用验证token 方法上可用*/
|
|
|
+@ApiNoCheckSign/* 不用验证 签名 方法上可用*/
|
|
|
+public class DemandInfoController extends ApiBaseController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private INoticeDemandService noticeDemandService;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @descption: 首页获取需求列表前10条
|
|
|
+ * @param:
|
|
|
+ * @return: 最新的需求信息前10条
|
|
|
+ * @auther: LiuLingChao
|
|
|
+ * @date: 2020-2-25 10:11
|
|
|
+ */
|
|
|
+ @PostMapping("/getDemandInfoTenList")
|
|
|
+ public Object getDemandInfoTenList(){
|
|
|
+ List<NoticeDemand> noticeDemandList = noticeDemandService.getDemandInfoTenList();
|
|
|
+ return AjaxResult.success().putKV("demandList",noticeDemandList);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @descption: 获取需求信息详情
|
|
|
+ * @param: 需求id
|
|
|
+ * @return:
|
|
|
+ * @auther: LiuLingChao
|
|
|
+ * @date: 2020-2-25 10:54
|
|
|
+ */
|
|
|
+ @PostMapping("/getDemandInfo")
|
|
|
+ public Object getDemandInfo(){
|
|
|
+ ParameterObject obj = getParameterObject();
|
|
|
+ NoticeDemand noticeDemand = obj.parseBean(NoticeDemand.class);
|
|
|
+ NoticeDemand noticeDemand1 = noticeDemandService.selectNoticeDemandById(noticeDemand.getId());
|
|
|
+ return AjaxResult.success().putKV("demandInfo",noticeDemand1);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @descption: 获取全部需求信息分页列表
|
|
|
+ * @param:
|
|
|
+ * @return:
|
|
|
+ * @auther: LiuLingChao
|
|
|
+ * @date: 2020-2-25 11:02
|
|
|
+ */
|
|
|
+ @PostMapping("/getDemandInfoAllList")
|
|
|
+ public Object getDemandInfoAllList(){
|
|
|
+ ParameterObject obj = getParameterObject();
|
|
|
+ NoticeDemand noticeDemand = obj.parseBean(NoticeDemand.class);
|
|
|
+ startPage(obj);/*向分页传递 分页参数*/
|
|
|
+ List<NoticeDemand> noticeDemandList = noticeDemandService.selectNoticeDemandList(noticeDemand);
|
|
|
+ return AjaxResult.success(getDataTable(noticeDemandList));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/insertDemandInfo")
|
|
|
+ public Object insertDemandInfo(){
|
|
|
+ ParameterObject obj = getParameterObject();
|
|
|
+ NoticeDemand noticeDemand = obj.parseBean(NoticeDemand.class);
|
|
|
+ noticeDemand.setCreateTime(DateUtils.getNowDate());
|
|
|
+ noticeDemand.setReleaseTime(DateUtils.getNowDate());
|
|
|
+ int flag = noticeDemandService.insertNoticeDemand(noticeDemand);
|
|
|
+ return toAjax(flag);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|