RmsPersonnelController.java 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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.RmsPersonnel;
  5. import com.steerinfo.dil.service.impl.RmsPersonnelServiceImpl;
  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.math.BigDecimal;
  17. import java.util.HashMap;
  18. import java.util.List;
  19. import java.util.Map;
  20. /**
  21. * RmsPersonnel RESTful接口:
  22. * @author generator
  23. * @version 1.0-SNAPSHORT 2021-11-06 02:47
  24. * 类描述
  25. * 修订历史:
  26. * 日期:2021-11-06
  27. * 作者:hujiehuan
  28. * 参考:
  29. * 描述:RmsPersonnel RESTful接口
  30. * @see null
  31. * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
  32. */
  33. @RestController
  34. @RequestMapping("/${api.version}/rmspersonnel")
  35. public class RmsPersonnelController extends BaseRESTfulController {
  36. @Autowired
  37. RmsPersonnelServiceImpl rmsPersonnelService;
  38. @Autowired
  39. ColumnDataUtil columnDataUtil;
  40. @Autowired
  41. ESFeign esFeign;
  42. /**
  43. * 展示人员信息
  44. * @param mapValue
  45. * @param pageNum
  46. * @param pageSize
  47. * @param apiId
  48. * @return
  49. */
  50. @ApiOperation(value="展示人员信息", notes="分页查询")
  51. @ApiImplicitParams({
  52. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  53. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  54. @ApiImplicitParam(name = "apiId", value = "341", required = false, dataType = "BigDecimal"),
  55. })
  56. //@RequiresPermissions("rmspersonnel:view")
  57. @PostMapping(value = "/getPersonnelList")
  58. public RESTfulResult getPersonnelList(@RequestBody(required = false) Map<String,Object> mapValue,
  59. Integer apiId,
  60. Integer pageNum,
  61. Integer pageSize,
  62. String con){
  63. PageHelper.startPage(pageNum, pageSize);
  64. //分页查询数据
  65. List<Map<String, Object>> columnList = rmsPersonnelService.getPersonnelList(mapValue);
  66. PageListAdd data = columnDataUtil.tableColumnData(apiId,null,columnList);
  67. return success(data);
  68. }
  69. /**
  70. * 添加人员信息
  71. * @param map
  72. * @return
  73. */
  74. @ApiOperation(value="创建", notes="根据RmsPersonnel对象创建")
  75. @ApiImplicitParam(name = "rmsPersonnel", value = "详细实体rmsPersonnel", required = false, dataType = "RmsPersonnel")
  76. @PostMapping(value = "/insertPersonnel")
  77. public RESTfulResult insertPersonnel(@RequestBody(required = false) Map<String,Object> map){
  78. int result=rmsPersonnelService.insertPersonnel(map);
  79. if (result <= 0){
  80. return failed();
  81. }
  82. return success(result);
  83. }
  84. /**
  85. * 更新人员信息
  86. * @param rmsPersonnel
  87. * @return
  88. */
  89. @ApiOperation(value="更新详细信息", notes="根据url的id来指定更新对象,并根据传过来的rmsPersonnel信息来更新详细信息")
  90. @ApiImplicitParams({
  91. @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "BigDecimal"),
  92. @ApiImplicitParam(name = "rmsPersonnel", value = "详细实体rmsPersonnel", required = true, dataType = "RmsPersonnel")
  93. })
  94. @PostMapping(value = "/updatePersonnel", produces = "application/json;charset=UTF-8")
  95. public RESTfulResult updatePersonnel(@RequestBody RmsPersonnel rmsPersonnel){
  96. int result=rmsPersonnelService.updatePersonnel(rmsPersonnel);
  97. return success(result);
  98. }
  99. /**
  100. * 删除人员信息
  101. * @param id
  102. * @return
  103. */
  104. @ApiOperation(value="删除", notes="根据url的id来指定删除对象")
  105. @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "BigDecimal")
  106. //@RequiresPermissions("rmspersonnel:delete")
  107. @PostMapping(value = "/deletePersonnel/{id}")//BigDecimal
  108. public RESTfulResult deletePeronnel(@PathVariable ("id") BigDecimal id ){
  109. return success(rmsPersonnelService.deletePersonnel(id));
  110. }
  111. /**根据id值详细获取人员信息
  112. *
  113. */
  114. @ApiOperation(value="获取详细信息", notes="根据url的id来获取详细信息")
  115. @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "BigDecimal")
  116. @PostMapping(value = "/getPersonnelById/{id}")
  117. public RESTfulResult getPersonnelById(@PathVariable("id") BigDecimal id){
  118. List<Map<String, Object>> list= rmsPersonnelService.getPersonnelById(id);
  119. System.out.println(list);
  120. return success(list);
  121. }
  122. /**
  123. * 下拉框获得托运人信息
  124. */
  125. @GetMapping("/getShipperId")
  126. public RESTfulResult getShipperId(){
  127. return success(rmsPersonnelService.getShipperId());
  128. }
  129. /**
  130. * 得到二级部门的下拉
  131. * @return
  132. */
  133. @GetMapping("/getSecondShipper")
  134. public RESTfulResult getSecondShipper() {
  135. return success(rmsPersonnelService.getSecondShipper());
  136. }
  137. /**
  138. * 得到三级部门的下拉
  139. * @return
  140. */
  141. @GetMapping("/getThirdShipper")
  142. public RESTfulResult getThirdShipper(@RequestParam Integer shipperId) {
  143. return success(rmsPersonnelService.getThirdShipper(new BigDecimal(shipperId)));
  144. }
  145. /**
  146. * 查询SSO主键和机构编码
  147. * @return
  148. */
  149. @PostMapping("/getShipperMap")
  150. public RESTfulResult getShipperMap(@RequestParam Integer shipperId) {
  151. return success(rmsPersonnelService.getShipperMap(new BigDecimal(shipperId)));
  152. }
  153. @PostMapping("/isInHere")
  154. public Integer isInHere(@RequestParam String personnelJobNumber) {
  155. Integer result = rmsPersonnelService.isInHere(personnelJobNumber);
  156. if (result != null && result.toString().length() != 0) {
  157. return 0;
  158. }
  159. else {
  160. return -1;
  161. }
  162. }
  163. /**
  164. * 新增人员权限
  165. * @param map
  166. * @return
  167. */
  168. @ApiOperation(value="创建", notes="RmsPersonnel对象创建")
  169. @PostMapping(value = "/addPersonnel")
  170. public RESTfulResult addPersonnel(@RequestBody(required = false) Map<String,Object> map){
  171. int result = rmsPersonnelService.addPersonnel(map);
  172. if (result <= 0){
  173. return failed();
  174. }
  175. return success(result);
  176. }
  177. }