DilNoticeController.java 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. package com.steerinfo.dil.controller;
  2. import com.alibaba.fastjson.JSON;
  3. import com.steerinfo.dil.feign.ESFeign;
  4. import com.steerinfo.dil.model.DilNotice;
  5. import com.steerinfo.dil.service.IDilNoticeService;
  6. import com.steerinfo.dil.util.BaseRESTfulController;
  7. import com.steerinfo.dil.util.ColumnDataUtil;
  8. import com.steerinfo.dil.util.PageListAdd;
  9. import com.steerinfo.framework.controller.RESTfulResult;
  10. import com.steerinfo.framework.service.pagehelper.PageHelper;
  11. import io.swagger.annotations.ApiImplicitParam;
  12. import io.swagger.annotations.ApiImplicitParams;
  13. import io.swagger.annotations.ApiOperation;
  14. import org.springframework.beans.factory.annotation.Autowired;
  15. import org.springframework.web.bind.annotation.*;
  16. import java.lang.reflect.Parameter;
  17. import java.util.*;
  18. import java.math.BigDecimal;
  19. /**
  20. * DilNotice RESTful接口:
  21. * @author generator
  22. * @version 1.0-SNAPSHORT 2021-12-08 02:21
  23. * 类描述
  24. * 修订历史:
  25. * 日期:2021-12-08
  26. * 作者:generator
  27. * 参考:
  28. * 描述:DilNotice RESTful接口
  29. * @see null
  30. * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
  31. */
  32. @RestController
  33. @RequestMapping("/${api.version}/dilnotices")
  34. public class DilNoticeController extends BaseRESTfulController {
  35. @Autowired
  36. IDilNoticeService dilNoticeService;
  37. @Autowired
  38. ColumnDataUtil columnDataUtil;
  39. @Autowired
  40. ESFeign esFeign;
  41. /**
  42. * 展示公告信息
  43. * @param mapVal
  44. * @param pageNum
  45. * @param pageSize
  46. * @param apiId
  47. * @return
  48. */
  49. @ApiOperation(value="获取列表", notes="分页查询")
  50. @ApiImplicitParams({
  51. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  52. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  53. @ApiImplicitParam(name = "apiId", value = "359", required = false, dataType = "BigDecimal"),
  54. })
  55. //获取整个的通知日期,标题,发布人
  56. @PostMapping(value = "/getNoticeList")
  57. public RESTfulResult getNoticeList(@RequestBody(required = false) Map<String,Object> mapVal,
  58. Integer pageNum,
  59. Integer pageSize,
  60. Integer apiId){
  61. PageHelper.startPage(pageNum, pageSize);
  62. //分页查询数据
  63. List<Map<String, Object>> columnList = dilNoticeService.getNoticeList(mapVal);
  64. PageListAdd data = columnDataUtil.tableColumnData(apiId, null, columnList);
  65. return success(data);
  66. }
  67. @ApiOperation(value="获取销售公司通知列表", notes="分页查询")
  68. @ApiImplicitParams({
  69. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  70. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  71. @ApiImplicitParam(name = "apiId", value = "414", required = false, dataType = "BigDecimal"),
  72. })
  73. //获取整个的通知日期,标题,发布人
  74. @PostMapping(value = "/getMarketingNoticeList")
  75. public RESTfulResult getMarketingNoticeList(@RequestBody(required = false) Map<String,Object> mapVal,
  76. Integer pageNum,
  77. Integer pageSize,
  78. Integer apiId){
  79. PageHelper.startPage(pageNum, pageSize);
  80. //分页查询数据
  81. List<Map<String, Object>> columnList = dilNoticeService.getMarketingNoticeList(mapVal);
  82. PageListAdd data = columnDataUtil.tableColumnData(apiId, null, columnList);
  83. return success(data);
  84. }
  85. @ApiOperation(value="获取承运商通知列表", notes="分页查询")
  86. @ApiImplicitParams({
  87. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  88. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  89. @ApiImplicitParam(name = "apiId", value = "414", required = false, dataType = "BigDecimal"),
  90. })
  91. //获取整个的通知日期,标题,发布人
  92. @PostMapping(value = "/getCarrierNoticeList")
  93. public RESTfulResult getCarrierNoticeList(@RequestBody(required = false) Map<String,Object> mapVal,
  94. Integer pageNum,
  95. Integer pageSize,
  96. Integer apiId){
  97. PageHelper.startPage(pageNum, pageSize);
  98. //分页查询数据
  99. List<Map<String, Object>> columnList = dilNoticeService.getCarrierNoticeList(mapVal);
  100. PageListAdd data = columnDataUtil.tableColumnData(apiId, null, columnList);
  101. return success(data);
  102. }
  103. @ApiOperation(value="获取收获客户通知列表", notes="分页查询")
  104. @ApiImplicitParams({
  105. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  106. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  107. @ApiImplicitParam(name = "apiId", value = "414", required = false, dataType = "BigDecimal"),
  108. })
  109. //获取整个的通知日期,标题,发布人
  110. @PostMapping(value = "/getClientNoticeList")
  111. public RESTfulResult getClientNoticeList(@RequestBody(required = false) Map<String,Object> mapVal,
  112. Integer pageNum,
  113. Integer pageSize,
  114. Integer apiId){
  115. PageHelper.startPage(pageNum, pageSize);
  116. //分页查询数据
  117. List<Map<String, Object>> columnList = dilNoticeService.getClientNoticeList(mapVal);
  118. PageListAdd data = columnDataUtil.tableColumnData(apiId, null, columnList);
  119. return success(data);
  120. }
  121. /**
  122. * 创建通知信息
  123. * @param dilNotice
  124. * @return
  125. */
  126. @ApiOperation(value="创建", notes="根据DilNotice对象创建")
  127. @ApiImplicitParam(name = "dilNotice", value = "详细实体dilNotice", required = true, dataType = "DilNotice")
  128. @PostMapping(value = "/insertNotice")
  129. public RESTfulResult insertNotice(@RequestBody DilNotice dilNotice){
  130. int result = dilNoticeService.insertNotice(dilNotice);
  131. return success(result);
  132. }
  133. /**
  134. * 根据id更新通知信息
  135. * @param dilNotice
  136. * @return
  137. */
  138. @ApiOperation(value="更新通知信息", notes="根据url的id来指定更新对象,并根据传过来的dilNotice信息来更新详细信息")
  139. @ApiImplicitParams({
  140. @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "Short"),
  141. @ApiImplicitParam(name = "dilNotice", value = "详细实体dilNotice", required = true, dataType = "DilNotice")
  142. })
  143. @PostMapping(value = "/updateNotice", produces = "application/json;charset=UTF-8")
  144. public RESTfulResult updateNotice( @RequestBody DilNotice dilNotice){
  145. int result = dilNoticeService.updateNotice(dilNotice);
  146. return success(result);
  147. }
  148. /**
  149. * 根据id删除通知信息
  150. * @param id
  151. * @return
  152. */
  153. @ApiOperation(value="删除", notes="根据url的id来指定删除对象")
  154. @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "Short")
  155. @PostMapping(value = "/deleteNotice/{id}")
  156. public RESTfulResult deleteNotice(@PathVariable("id") BigDecimal id){
  157. return success(dilNoticeService.deleteNotice(id));
  158. }
  159. /**
  160. * 根据id获取通知信息
  161. * @param id
  162. * @return
  163. */
  164. @ApiOperation(value="获取通知详细信息", notes="根据url的id来获取详细信息")
  165. @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "BigDecimal")
  166. @PostMapping(value = "/getNoticeById/{id}")
  167. public RESTfulResult getNoticeById(@PathVariable("id") BigDecimal id){
  168. List<Map<String,Object>> list= dilNoticeService.getNoticeById(id);
  169. return success(list);
  170. }
  171. /**
  172. * 根据permissions获取最新通知信息
  173. * @param permissions
  174. * @return
  175. */
  176. @ApiOperation(value="获取通知详细信息", notes="根据url的id来获取详细信息")
  177. @ApiImplicitParam(paramType = "path", name = "permission", value = "permission", required = true, dataType = "String")
  178. @PostMapping(value = "/getNewNoticeByPermission/{permissions}")
  179. public RESTfulResult getNewNoticeByPermission(@PathVariable("permissions")String permissions){
  180. BigDecimal permission=new BigDecimal(permissions);
  181. List<Map<String,Object>> list= dilNoticeService.getNewNoticeByPermission(permission);
  182. return success(list);
  183. }
  184. @ApiOperation(value = "模糊查询通知信息", notes = "分页查询")
  185. @ApiImplicitParams({
  186. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  187. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  188. @ApiImplicitParam(name = "apiId", value = "196", required = false, dataType = "BigDecimal"),
  189. })
  190. @PostMapping(value = "/getNoticeResultList")
  191. public RESTfulResult getNoticeResultList(@RequestBody(required = false) Map<String, Object> mapValue,
  192. Integer apiId,
  193. Integer pageNum,
  194. Integer pageSize,
  195. String con) {
  196. if (mapValue==null){
  197. mapValue=new HashMap<>();
  198. }
  199. PageHelper.startPage(pageNum, pageSize);
  200. //分页查询数据
  201. List<Map<String, Object>> columnList = dilNoticeService.getNoticeList(mapValue);
  202. PageListAdd data = columnDataUtil.tableColumnData(apiId, null, columnList);
  203. return success(data);
  204. }
  205. /**
  206. * @author:zyf
  207. * @version:1.0
  208. * @Date:
  209. * @Description:获取通知数据
  210. */
  211. @ApiOperation(value = "查询通知信息", notes = "根据传过来的orgcode查询")
  212. @PostMapping(value = "/getNotice")
  213. public RESTfulResult getNotice(@RequestBody(required = false) Map<String, Object> mapValue){
  214. /*String orgcode= (String) mapValue.get("orgcodezs");
  215. List<Map<String, Object>> noticeData = dilNoticeService.getNoticeData(orgcode);
  216. return success(noticeData);*/
  217. return null;
  218. }
  219. }