PmPurchaseExecutionController.java 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  1. package com.ozs.web.controller.pm;
  2. import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  3. import com.baomidou.mybatisplus.core.metadata.IPage;
  4. import com.ozs.base.domain.BaseAgency;
  5. import com.ozs.base.domain.BaseExpert;
  6. import com.ozs.base.service.BaseAgencyService;
  7. import com.ozs.base.service.BaseExpertService;
  8. import com.ozs.common.annotation.Log;
  9. import com.ozs.common.constant.ModularConstans;
  10. import com.ozs.common.core.controller.BaseController;
  11. import com.ozs.common.core.domain.AjaxResult;
  12. import com.ozs.common.enums.BusinessType;
  13. import com.ozs.common.enums.NameListType;
  14. import com.ozs.common.enums.PmProjectStatus;
  15. import com.ozs.common.enums.SysFileRefEnum;
  16. import com.ozs.common.utils.RandomUtil;
  17. import com.ozs.common.utils.StringUtils;
  18. import com.ozs.pm.doman.PmBidOpening;
  19. import com.ozs.pm.doman.PmBidWinning;
  20. import com.ozs.pm.doman.PmDemand;
  21. import com.ozs.pm.doman.PmDemandExpertRef;
  22. import com.ozs.pm.doman.vo.requestVo.*;
  23. import com.ozs.pm.doman.vo.responseVo.PmDemandResVo;
  24. import com.ozs.pm.service.IPmDemandService;
  25. import com.ozs.pm.service.PmBidOpeningService;
  26. import com.ozs.pm.service.PmBidWinningService;
  27. import com.ozs.pm.service.PmDemandExpertRefService;
  28. import com.ozs.system.domain.SysFileRef;
  29. import io.swagger.annotations.Api;
  30. import io.swagger.annotations.ApiOperation;
  31. import org.springframework.security.access.prepost.PreAuthorize;
  32. import org.springframework.util.ObjectUtils;
  33. import org.springframework.beans.factory.annotation.Autowired;
  34. import org.springframework.web.bind.annotation.*;
  35. import javax.validation.constraints.NotEmpty;
  36. import java.util.*;
  37. /**
  38. * 采购执行Controller
  39. *
  40. * @author ruoyi
  41. * @date 2023-01-16
  42. */
  43. @Api(tags = "采购执行")
  44. @RestController
  45. @RequestMapping("/pm/purchaseExecution")
  46. public class PmPurchaseExecutionController extends BaseController {
  47. @Autowired
  48. private IPmDemandService pmDemandService;
  49. @Autowired
  50. private BaseAgencyService baseAgencyService;
  51. @Autowired
  52. private BaseExpertService baseExpertService;
  53. @Autowired
  54. private PmDemandExpertRefService pmDemandExpertRefService;
  55. @Autowired
  56. private PmBidOpeningService pmBidOpeningService;
  57. /**
  58. * 采购执行查询列表
  59. */
  60. @ApiOperation(value = "采购执行查询列表", notes = "参数非必传")
  61. @PostMapping("/list")
  62. public AjaxResult list(@RequestBody PmDemandReqVo pmDemandReqVo) {
  63. IPage<PmDemandResVo> page = pmDemandService.selectPmDemandList(pmDemandReqVo,3);
  64. return success(page);
  65. }
  66. /**
  67. * 查询代理机构列表
  68. */
  69. @ApiOperation(value = "查询代理机构列表", notes = "采购需求ID必传")
  70. @GetMapping("/getAgencyList")
  71. public AjaxResult getAgencyList(@NotEmpty(message = "采购需求ID不能为空")
  72. @RequestParam(value = "demandId", required = true) Long demandId) {
  73. PmDemand pmDemand = pmDemandService.getById(demandId);
  74. if(ObjectUtils.isEmpty(pmDemand)){
  75. return error("参数错误");
  76. }
  77. LambdaQueryWrapper<BaseAgency> lw = new LambdaQueryWrapper<>();
  78. lw.eq(BaseAgency::getCompanyType,pmDemand.getProjectType());
  79. lw.eq(BaseAgency::getStatus,0);//白名单
  80. List<BaseAgency> agencyList = baseAgencyService.list(lw);
  81. return success(agencyList);
  82. }
  83. /**
  84. * 选取代理-选择填写招标代理机构信息
  85. */
  86. @ApiOperation(value = "选取代理-选择填写招标代理机构信息",notes = "采购需求ID和代理机构ID必传")
  87. @GetMapping("/selectAgency")
  88. public AjaxResult selectAgency(@NotEmpty(message = "采购需求ID不能为空")
  89. @RequestParam(value = "demandId", required = true) Long demandId,
  90. @NotEmpty(message = "代理机构ID不能为空")
  91. @RequestParam(value = "agencyId", required = true) Long agencyId) {
  92. PmDemand pmDemand = pmDemandService.getById(demandId);
  93. if(ObjectUtils.isEmpty(pmDemand)){
  94. return error("参数错误");
  95. }
  96. BaseAgency baseAgency = baseAgencyService.getById(agencyId);
  97. if(ObjectUtils.isEmpty(baseAgency)){
  98. return error("参数错误");
  99. }
  100. PmDemand pmDemandUpdate = new PmDemand();
  101. pmDemandUpdate.setDemandId(demandId);
  102. pmDemandUpdate.setProjectStatus(PmProjectStatus.WAIT_UPLOAD_BID_FILE.getCode());
  103. pmDemandUpdate.setAgencyId(agencyId);
  104. pmDemandUpdate.setExtractAgencyTime(new Date());
  105. pmDemandUpdate.setUpdateTime(pmDemandUpdate.getExtractAgencyTime());
  106. pmDemandUpdate.setUpdateBy(getUserId().toString());
  107. return success(pmDemandService.updateById(pmDemandUpdate));
  108. }
  109. /**
  110. * 选取代理-抽取招标代理机构信息
  111. */
  112. @ApiOperation(value = "选取代理-抽取招标代理机构信息",notes = "采购需求ID必传")
  113. @GetMapping("/extractAgency")
  114. public AjaxResult extractAgency(@NotEmpty(message = "采购需求id不能为空")
  115. @RequestParam(value = "demandId", required = true) Long demandId) {
  116. PmDemand pmDemand = pmDemandService.getById(demandId);
  117. if(ObjectUtils.isEmpty(pmDemand)){
  118. return error("参数错误");
  119. }
  120. LambdaQueryWrapper<BaseAgency> lw = new LambdaQueryWrapper<>();
  121. lw.eq(BaseAgency::getCompanyType,pmDemand.getProjectType());
  122. lw.eq(BaseAgency::getStatus,0); //白名单
  123. List<BaseAgency> baseAgencyList = baseAgencyService.list(lw);
  124. if (ObjectUtils.isEmpty(baseAgencyList)){
  125. return error("没有符合的招标代理机构,抽取失败!");
  126. }
  127. BaseAgency any = (BaseAgency)(RandomUtil.getRandomList(baseAgencyList,1).get(0));
  128. PmDemand pmDemandUpdate = new PmDemand();
  129. pmDemandUpdate.setDemandId(demandId);
  130. pmDemandUpdate.setProjectStatus(PmProjectStatus.WAIT_UPLOAD_BID_FILE.getCode());
  131. pmDemandUpdate.setAgencyId(any.getId());
  132. pmDemandUpdate.setExtractAgencyTime(new Date());
  133. pmDemandUpdate.setUpdateTime(pmDemandUpdate.getExtractAgencyTime());
  134. pmDemandUpdate.setUpdateBy(getUserId().toString());
  135. return success(pmDemandService.updateById(pmDemandUpdate));
  136. }
  137. @ApiOperation(value = "上传招标文件",notes = "采购需求ID和上传附件必传")
  138. @PostMapping("/uploadBidFile")
  139. public AjaxResult uploadBidFile(@NotEmpty(message = "数据为空") @RequestBody PmPurchaseExecutionReqVo pmPurchaseExecutionReqVo) {
  140. Long demandId = pmPurchaseExecutionReqVo.getDemandId();
  141. if(ObjectUtils.isEmpty(demandId)){
  142. return error("参数错误");
  143. }
  144. PmDemand pmDemand = pmDemandService.getById(demandId);
  145. if(ObjectUtils.isEmpty(pmDemand)){
  146. return error("参数错误");
  147. }
  148. List<SysFileRef> sysFileRefs = pmPurchaseExecutionReqVo.getSysFileRefs();
  149. if(ObjectUtils.isEmpty(sysFileRefs)){
  150. return error("参数错误");
  151. }
  152. if (pmDemandService.uploadFile(demandId, SysFileRefEnum.PM_BID_FILE.getType(),sysFileRefs,getUserId().toString())) {
  153. PmDemand pmDemandUpdate = new PmDemand();
  154. pmDemandUpdate.setDemandId(demandId);
  155. pmDemandUpdate.setProjectStatus(PmProjectStatus.WAIT_ANNOUNCEMENT.getCode());
  156. pmDemandUpdate.setUpdateTime(new Date());
  157. pmDemandUpdate.setUpdateBy(getUserId().toString());
  158. return success(pmDemandService.updateById(pmDemandUpdate));
  159. } else {
  160. return error("保存上传附件失败");
  161. }
  162. }
  163. @ApiOperation(value = "发布公告")
  164. @PostMapping("/insertPmReleaseAnnouncement")
  165. public AjaxResult insertPmReleaseAnnouncement(@NotEmpty(message = "数据为空")
  166. @RequestBody PmReleaseAnnouncementReqVo pmReleaseAnnouncementReqVo) {
  167. try {
  168. Long demandId = pmReleaseAnnouncementReqVo.getDemandId();
  169. if(ObjectUtils.isEmpty(demandId)){
  170. return error("参数错误");
  171. }
  172. pmReleaseAnnouncementReqVo.setCreateBy(getUserId().toString());
  173. pmReleaseAnnouncementReqVo.setCreateTime(new Date());
  174. pmReleaseAnnouncementReqVo.setUpdateBy(pmReleaseAnnouncementReqVo.getCreateBy());
  175. pmReleaseAnnouncementReqVo.setUpdateTime(pmReleaseAnnouncementReqVo.getCreateTime());
  176. return toAjax(pmDemandService.insertPmReleaseAnnouncement(pmReleaseAnnouncementReqVo));
  177. } catch (Exception e) {
  178. return error(e.getMessage());
  179. }
  180. }
  181. @ApiOperation(value = "获取专家身份证号列表")
  182. @GetMapping("/getExpertIdNumberList")
  183. public AjaxResult getExpertIdNumberList(@NotEmpty(message = "采购需求id不能为空")
  184. @RequestParam(value = "demandId", required = true) Long demandId) {
  185. PmDemand pmDemand = pmDemandService.getById(demandId);
  186. if(ObjectUtils.isEmpty(pmDemand)){
  187. return error("参数错误");
  188. }
  189. LambdaQueryWrapper<BaseExpert> lw = new LambdaQueryWrapper<BaseExpert>();
  190. lw.eq(BaseExpert::getVarietyPurchase,pmDemand.getProjectType())
  191. .eq(BaseExpert::getStatus,NameListType.WHITE.getCode());
  192. List<BaseExpert> baseExpertList = baseExpertService.list(lw);
  193. List<String> idNumberList = new ArrayList<>();
  194. if (!ObjectUtils.isEmpty(baseExpertList)) {
  195. for(BaseExpert baseExpert :baseExpertList ){
  196. idNumberList.add(baseExpert.getIdNumber());
  197. }
  198. }
  199. return success(idNumberList);
  200. }
  201. @ApiOperation(value = "根据身份证号查询专家", notes = "必传 查询条件:身份证号")
  202. @GetMapping("/findExpertWithIdNumber")
  203. public AjaxResult findExpertWithIdNumber(@NotEmpty(message = "采购需求id不能为空")
  204. @RequestParam(value = "demandId", required = true) Long demandId,
  205. @NotEmpty(message = "身份证号不能为空")
  206. @RequestParam(value = "idNumber", required = true) String idNumber) {
  207. PmDemand pmDemand = pmDemandService.getById(demandId);
  208. if(ObjectUtils.isEmpty(pmDemand)){
  209. return error("参数错误");
  210. }
  211. LambdaQueryWrapper<BaseExpert> lw = new LambdaQueryWrapper<BaseExpert>();
  212. lw.eq(BaseExpert::getIdNumber,idNumber);
  213. BaseExpert baseExpert = baseExpertService.getOne(lw);
  214. if(baseExpert != null){
  215. if(baseExpert.getStatus().equals(NameListType.WHITE.getCode())){
  216. return error("该专家属于黑名单");
  217. }
  218. if(pmDemand.getProjectType().equals(baseExpert.getVarietyPurchase())){
  219. return error("该专家所属采购品种和项目类型不匹配");
  220. }
  221. }
  222. return success(baseExpert);
  223. }
  224. @ApiOperation(value = "填写专家信息批量提交", notes = "必传 采购需求ID和专家信息列表,注意:若该专家已经在库里存在,需要传专家对象BaseExpert的ID")
  225. @PostMapping("/insertExpertBatch")
  226. @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:insertExpertBatch')")
  227. @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.INSERT)
  228. public AjaxResult insertExpertBatch(@NotEmpty(message = "参数不能为空") @RequestBody PmBaseExpertFillReqVo pmBaseExpertFillReqVo) {
  229. try {
  230. if (ObjectUtils.isEmpty(pmBaseExpertFillReqVo)
  231. || ObjectUtils.isEmpty(pmBaseExpertFillReqVo.getDemandId())
  232. || ObjectUtils.isEmpty(pmBaseExpertFillReqVo.getAccessTime())
  233. || ObjectUtils.isEmpty(pmBaseExpertFillReqVo.getBaseExpertList())) {
  234. return error("参数错误");
  235. }
  236. pmBaseExpertFillReqVo.setCreateBy(getUserId().toString());
  237. pmBaseExpertFillReqVo.setUpdateBy(pmBaseExpertFillReqVo.getCreateBy());
  238. return toAjax(pmDemandService.insertExpertBatch(pmBaseExpertFillReqVo));
  239. } catch (Exception e) {
  240. return error(e.getMessage());
  241. }
  242. }
  243. @ApiOperation(value = "获取回避单位下拉列表")
  244. @GetMapping("/getExpertUnitList")
  245. public AjaxResult getExpertUnitList() {
  246. List<BaseExpert> baseExperts = baseExpertService.list();
  247. if(ObjectUtils.isEmpty(baseExperts)){
  248. return error("专家列表是空的");
  249. }
  250. Set<String> set = new HashSet<>();
  251. for(BaseExpert baseExpert : baseExperts) {
  252. set.add(baseExpert.getUnitInformation());
  253. }
  254. return success(set);
  255. }
  256. /**
  257. * 抽取专家
  258. */
  259. @ApiOperation(value = "抽取专家",notes = "采购需求ID必传")
  260. @PostMapping("/extractExpertBatch")
  261. public AjaxResult extractExpertBatch(@NotEmpty(message = "参数不能为空")
  262. @RequestBody PmBaseExpertExtractReqVo pmBaseExpertExtractReqVo) {
  263. try {
  264. if (ObjectUtils.isEmpty(pmBaseExpertExtractReqVo)
  265. || ObjectUtils.isEmpty(pmBaseExpertExtractReqVo.getDemandId())
  266. || ObjectUtils.isEmpty(pmBaseExpertExtractReqVo.getAccessTime())) {
  267. return error("参数错误");
  268. }
  269. return toAjax(pmDemandService.extractExpertBatch(pmBaseExpertExtractReqVo));
  270. } catch (Exception e) {
  271. return error(e.getMessage());
  272. }
  273. }
  274. @ApiOperation(value = "填写开标信息",notes = "采购需求ID必传")
  275. @PostMapping("/insertBidOpeningBatch")
  276. public AjaxResult insertBidOpeningBatch(@NotEmpty(message = "数据为空")
  277. @RequestBody PmBidOpeningFillReqVo pmBidOpeningFillReqVo) {
  278. try {
  279. if (ObjectUtils.isEmpty(pmBidOpeningFillReqVo)
  280. || ObjectUtils.isEmpty(pmBidOpeningFillReqVo.getDemandId())
  281. || ObjectUtils.isEmpty(pmBidOpeningFillReqVo.getPmBidOpeningList())) {
  282. return error("参数错误");
  283. }
  284. pmBidOpeningFillReqVo.setCreateBy(getUserId().toString());
  285. pmBidOpeningFillReqVo.setUpdateBy(getUserId().toString());
  286. return toAjax(pmDemandService.insertBidOpeningBatch(pmBidOpeningFillReqVo));
  287. } catch (Exception e) {
  288. return error(e.getMessage());
  289. }
  290. }
  291. /**
  292. * 中标基本情况填制-开标信息下拉列表
  293. */
  294. @ApiOperation(value = "中标基本情况填制-开标信息下拉列表", notes = "必传选需求ID")
  295. @GetMapping("/getPullDownBidOpeningList")
  296. public AjaxResult getPullDownBidOpeningList(@NotEmpty(message = "需求ID不能为空")
  297. @RequestParam(value = "demandId", required = true) Long demandId) {
  298. LambdaQueryWrapper<PmBidOpening> pmBidOpeningLambdaQueryWrapper = new LambdaQueryWrapper<>();
  299. pmBidOpeningLambdaQueryWrapper.eq(PmBidOpening::getDemandId,demandId)
  300. .orderByDesc(PmBidOpening::getScore)
  301. ;
  302. List<PmBidOpening> pmBidOpeningList = pmBidOpeningService.list(pmBidOpeningLambdaQueryWrapper);
  303. return success(pmBidOpeningList);
  304. }
  305. @ApiOperation(value = "中标基本情况填制-中标情况填制提交",notes = "采购需求ID必传")
  306. @PostMapping("/insertPmBidWinning")
  307. public AjaxResult insertPmBidWinning(@NotEmpty(message = "数据为空")
  308. @RequestBody PmBidWinningReqVo pmBidWinningReqVo) {
  309. try {
  310. Long demandId = pmBidWinningReqVo.getDemandId();
  311. if(ObjectUtils.isEmpty(demandId)){
  312. return error("采购需求ID不能为空");
  313. }
  314. pmBidWinningReqVo.setCreateBy(getUserId().toString());
  315. pmBidWinningReqVo.setCreateTime(new Date());
  316. pmBidWinningReqVo.setUpdateBy(pmBidWinningReqVo.getCreateBy());
  317. pmBidWinningReqVo.setUpdateTime(pmBidWinningReqVo.getCreateTime());
  318. return toAjax(pmDemandService.insertPmBidWinning(pmBidWinningReqVo));
  319. } catch (Exception e) {
  320. return error(e.getMessage());
  321. }
  322. }
  323. @ApiOperation(value = "中标基本情况填制-更换中标人提交",notes = "采购需求ID必传")
  324. @PostMapping("/updatePmBidWinning")
  325. public AjaxResult updatePmBidWinning(@NotEmpty(message = "数据为空")
  326. @RequestBody PmBidWinningReqVo pmBidWinningReqVo) {
  327. try {
  328. Long demandId = pmBidWinningReqVo.getDemandId();
  329. if(ObjectUtils.isEmpty(demandId)){
  330. return error("采购需求ID不能为空");
  331. }
  332. pmBidWinningReqVo.setUpdateBy(getUserId().toString());
  333. pmBidWinningReqVo.setUpdateTime(new Date());
  334. return toAjax(pmDemandService.updatePmBidWinning(pmBidWinningReqVo));
  335. } catch (Exception e) {
  336. return error(e.getMessage());
  337. }
  338. }
  339. @ApiOperation(value = "流标情况填制",notes = "采购需求ID必传")
  340. @PostMapping("/insertPmBidFailure")
  341. public AjaxResult insertPmBidFailure(@NotEmpty(message = "数据为空")
  342. @RequestBody PmBidFailureReqVo pmBidFailureReqVo) {
  343. try {
  344. Long demandId = pmBidFailureReqVo.getDemandId();
  345. if(ObjectUtils.isEmpty(demandId)){
  346. return error("参数错误");
  347. }
  348. pmBidFailureReqVo.setCreateBy(getUserId().toString());
  349. pmBidFailureReqVo.setCreateTime(new Date());
  350. pmBidFailureReqVo.setUpdateBy(pmBidFailureReqVo.getCreateBy());
  351. pmBidFailureReqVo.setUpdateTime(pmBidFailureReqVo.getCreateTime());
  352. return toAjax(pmDemandService.insertPmBidFailure(pmBidFailureReqVo));
  353. } catch (Exception e) {
  354. return error(e.getMessage());
  355. }
  356. }
  357. @ApiOperation(value = "质疑处理",notes = "采购需求ID必传")
  358. @PostMapping("/handleCallQuestion")
  359. public AjaxResult handleCallQuestion(@NotEmpty(message = "数据为空")
  360. @RequestBody PmCallQuestionReqVo pmCallQuestionReqVo) {
  361. try {
  362. Long demandId = pmCallQuestionReqVo.getDemandId();
  363. if(ObjectUtils.isEmpty(demandId)){
  364. return error("参数错误");
  365. }
  366. PmDemand pmDemand = pmDemandService.getById(demandId);
  367. if(ObjectUtils.isEmpty(pmDemand)){
  368. return error("参数错误");
  369. }
  370. List<SysFileRef> sysFileRefs = pmCallQuestionReqVo.getSysFileRefs();
  371. pmDemandService.uploadFile(demandId, SysFileRefEnum.PM_BID_CALL_QEUSTION_FILE.getType(),sysFileRefs,getUserId().toString());
  372. pmDemand.setCallQuestion(pmCallQuestionReqVo.getCallQuestion());
  373. pmDemand.setUpdateBy(getUserId().toString());
  374. pmDemand.setUpdateTime(new Date());
  375. return toAjax(pmDemandService.updateById(pmDemand));
  376. } catch (Exception e) {
  377. return error(e.getMessage());
  378. }
  379. }
  380. @ApiOperation(value = "上传中标通知书",notes = "采购需求ID和上传附件必传")
  381. @PostMapping("/uploadBidWinningNotification")
  382. public AjaxResult uploadBidWinningNotification(@NotEmpty(message = "数据为空") @RequestBody PmPurchaseExecutionReqVo pmPurchaseExecutionReqVo) {
  383. Long demandId = pmPurchaseExecutionReqVo.getDemandId();
  384. if(ObjectUtils.isEmpty(demandId)){
  385. return error("参数错误");
  386. }
  387. PmDemand pmDemand = pmDemandService.getById(demandId);
  388. if(ObjectUtils.isEmpty(pmDemand)){
  389. return error("参数错误");
  390. }
  391. List<SysFileRef> sysFileRefs = pmPurchaseExecutionReqVo.getSysFileRefs();
  392. if(ObjectUtils.isEmpty(sysFileRefs)){
  393. return error("参数错误");
  394. }
  395. if (pmDemandService.uploadFile(demandId, SysFileRefEnum.PM_BID_WINNING_NOTIFICATION.getType(),sysFileRefs,getUserId().toString())) {
  396. PmDemand pmDemandUpdate = new PmDemand();
  397. pmDemandUpdate.setDemandId(demandId);
  398. pmDemandUpdate.setProjectStatus(PmProjectStatus.CONTRACT_WAIT_FILL.getCode());
  399. pmDemandUpdate.setUpdateTime(new Date());
  400. pmDemandUpdate.setUpdateBy(getUserId().toString());
  401. return success(pmDemandService.updateById(pmDemandUpdate));
  402. } else {
  403. return error("保存上传附件失败");
  404. }
  405. }
  406. /**
  407. * 查看详情
  408. */
  409. @ApiOperation(value = "查看详情", notes = "必传demandId和详情类型(1项目计划,2需求建档,3任务下达,4中标信息,5合同信息,6建设情况),其他字段不传")
  410. @PostMapping("/view")
  411. public AjaxResult view(@RequestBody PmDemandReqVo pmDemandReqVo) {
  412. if(pmDemandReqVo.getDemandId() == null){
  413. return AjaxResult.error("demandId不能为空");
  414. }
  415. if(StringUtils.isEmpty(pmDemandReqVo.getDetailType())){
  416. return AjaxResult.error("详情的类型不能为空");
  417. }
  418. return success(pmDemandService.selectPmDemandByDemandId(pmDemandReqVo.getDemandId(),pmDemandReqVo.getDetailType()));
  419. }
  420. /**
  421. * 专家信息查看详情列表
  422. */
  423. @ApiOperation(value = "专家信息查看详情列表", notes = "必传需求ID和选取时间(yyyy-MM-dd)")
  424. @GetMapping("/getBaseExpertList")
  425. public AjaxResult getBaseExpertList(@NotEmpty(message = "需求ID不能为空")
  426. @RequestParam(value = "demandId", required = true) Long demandId,
  427. @NotEmpty(message = "选取时间不能为空")
  428. @RequestParam(value = "accessTime", required = true) String accessTime) {
  429. LambdaQueryWrapper<PmDemandExpertRef> pmDemandExpertRefLambdaQueryWrapper = new LambdaQueryWrapper<>();
  430. pmDemandExpertRefLambdaQueryWrapper.eq(PmDemandExpertRef::getDemandId,demandId);
  431. pmDemandExpertRefLambdaQueryWrapper.eq(PmDemandExpertRef::getAccessTime,accessTime);
  432. List<PmDemandExpertRef> pmDemandExpertRefList = pmDemandExpertRefService.list(pmDemandExpertRefLambdaQueryWrapper);
  433. List<BaseExpert> list = new ArrayList<>();
  434. if(!ObjectUtils.isEmpty(pmDemandExpertRefList)) {
  435. for(PmDemandExpertRef pmDemandExpertRef : pmDemandExpertRefList) {
  436. BaseExpert baseExpert = baseExpertService.getById(pmDemandExpertRef.getExpertId());
  437. if(baseExpert != null){
  438. list.add(baseExpert);
  439. }
  440. }
  441. }
  442. return success(list);
  443. }
  444. /**
  445. * 开标信息查看详情列表
  446. */
  447. @ApiOperation(value = "开标信息查看详情列表", notes = "必传选需求ID和开标时间(yyyy-MM-dd)")
  448. @GetMapping("/getBidOpeningList")
  449. public AjaxResult getBidOpeningList(@NotEmpty(message = "需求ID不能为空")
  450. @RequestParam(value = "demandId", required = true) Long demandId,
  451. @NotEmpty(message = "开标时间不能为空")
  452. @RequestParam(value = "openBidTime", required = true) String openBidTime) {
  453. LambdaQueryWrapper<PmBidOpening> pmBidOpeningLambdaQueryWrapper = new LambdaQueryWrapper<>();
  454. pmBidOpeningLambdaQueryWrapper.eq(PmBidOpening::getDemandId,demandId)
  455. .eq(PmBidOpening::getOpenBidTime,openBidTime).orderByDesc(PmBidOpening::getScore)
  456. ;
  457. List<PmBidOpening> pmBidOpeningList = pmBidOpeningService.list(pmBidOpeningLambdaQueryWrapper);
  458. return success(pmBidOpeningList);
  459. }
  460. }