TmstrainPleaseApproveResultController.java 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. package com.steerinfo.dil.controller;
  2. import com.steerinfo.dil.model.TmstrainPleaseApproveResult;
  3. import com.steerinfo.dil.service.ITmstrainPleaseApproveResultService;
  4. import com.steerinfo.dil.util.BaseRESTfulController;
  5. import com.steerinfo.dil.util.ColumnDataUtil;
  6. import com.steerinfo.dil.util.DataChange;
  7. import com.steerinfo.dil.util.PageListAdd;
  8. import com.steerinfo.framework.controller.RESTfulResult;
  9. import com.steerinfo.framework.service.pagehelper.PageHelper;
  10. import io.swagger.annotations.ApiImplicitParam;
  11. import io.swagger.annotations.ApiImplicitParams;
  12. import io.swagger.annotations.ApiOperation;
  13. import org.springframework.beans.factory.annotation.Autowired;
  14. import org.springframework.web.bind.annotation.*;
  15. import java.math.BigDecimal;
  16. import java.util.Date;
  17. import java.util.HashMap;
  18. import java.util.List;
  19. import java.util.Map;
  20. /**
  21. * TmstrainPleaseApproveResult RESTful接口:
  22. * @author generator
  23. * @version 1.0-SNAPSHORT 2021-08-30 02:27
  24. * 类描述
  25. * 修订历史:
  26. * 日期:2021-08-30
  27. * 作者:generator
  28. * 参考:
  29. * 描述:TmstrainPleaseApproveResult RESTful接口
  30. * @see null
  31. * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
  32. */
  33. @RestController
  34. @RequestMapping("/${api.version}/tmstrainpleaseapproveresults")
  35. public class TmstrainPleaseApproveResultController extends BaseRESTfulController {
  36. @Autowired
  37. ITmstrainPleaseApproveResultService tmstrainPleaseApproveResultService;
  38. @Autowired
  39. ColumnDataUtil columnDataUtil;
  40. @ApiOperation(value="查询请车作业")
  41. @ApiImplicitParams({
  42. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  43. @ApiImplicitParam(name = "apiId(57)", value = "动态表头", required = false, dataType = "Integer"),
  44. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  45. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  46. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  47. })
  48. @PostMapping("/getAllWagonPlease")
  49. public RESTfulResult getAllWagonPlease(@RequestBody(required=false) Map<String,Object> mapValue,
  50. Integer apiId,
  51. Integer pageNum,
  52. Integer pageSize,
  53. Integer status,
  54. Integer resultType){
  55. mapValue.put("status", status);
  56. mapValue.put("resultType", resultType);
  57. //不分页筛选数据
  58. List<Map<String, Object>> wagonPleaseTotal = tmstrainPleaseApproveResultService.getAllWagonPlease(mapValue);
  59. PageHelper.startPage(pageNum,pageSize);
  60. //分页数据
  61. List<Map<String, Object>> wagonPlease = tmstrainPleaseApproveResultService.getAllWagonPlease(mapValue);
  62. DataChange.changeDateToDayDate(wagonPlease, "resultPleaseDate", "resultPlanDate");
  63. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, wagonPleaseTotal,wagonPlease);
  64. return success(pageList);
  65. }
  66. @ApiOperation(value="通过Id查询请车作业")
  67. @PostMapping ("/getWagonPleaseById/{resultId}")
  68. public RESTfulResult getWagonPleaseById(@PathVariable("resultId")Integer resultId){
  69. List<Map<String, Object>> wagonPleaseById = tmstrainPleaseApproveResultService.getWagonPleaseById(resultId);
  70. return success(wagonPleaseById);
  71. }
  72. @ApiOperation(value="新增请车作业")
  73. @ApiImplicitParams({
  74. @ApiImplicitParam(name = "amstrainWagonPlease", value = "请车作业对象", required = false, dataType = "AmstrainWagonPlease"),
  75. })
  76. @PostMapping("/addWagonPlease")
  77. public RESTfulResult addWagonPlease(@RequestBody TmstrainPleaseApproveResult tmstrainPleaseApproveResult){
  78. int i = tmstrainPleaseApproveResultService.insertSelective(tmstrainPleaseApproveResult);
  79. return success(i);
  80. }
  81. @ApiOperation(value="修改请车作业")
  82. @ApiImplicitParams({
  83. @ApiImplicitParam(name = "tmstrainPleaseApproveResult", value = "请车作业实绩对象", required = false, dataType = "TmstrainPleaseApproveResult"),
  84. })
  85. @PostMapping("/updateWagonPlease")
  86. public RESTfulResult updateWagonPlease(@RequestBody TmstrainPleaseApproveResult tmstrainPleaseApproveResult){
  87. tmstrainPleaseApproveResult.setUpdateTime(new Date());
  88. int i = tmstrainPleaseApproveResultService.updateByPrimaryKeySelective(tmstrainPleaseApproveResult);
  89. return success(i);
  90. }
  91. @ApiOperation(value="逻辑删除请车作业 设置状态码为 3")
  92. @ApiImplicitParams({
  93. @ApiImplicitParam(name = "tmstrainPleaseApproveResult", value = "请车作业实绩对象", required = false, dataType = "TmstrainPleaseApproveResult"),
  94. })
  95. @PostMapping("/deleteWagonPlease/{resultId}")
  96. public RESTfulResult deleteWagonPlease(@PathVariable("resultId") Integer resultId){
  97. TmstrainPleaseApproveResult tmstrainPleaseApproveResult = new TmstrainPleaseApproveResult();
  98. tmstrainPleaseApproveResult.setResultId(new BigDecimal(resultId));
  99. tmstrainPleaseApproveResult.setStatus(new BigDecimal(3));
  100. int i = tmstrainPleaseApproveResultService.updateByPrimaryKeySelective(tmstrainPleaseApproveResult);
  101. return success(i);
  102. }
  103. @ApiOperation(value="下发请车作业 设置状态码为 1")
  104. @ApiImplicitParams({
  105. @ApiImplicitParam(name = "resultId", value = "请车作业实绩对象", required = false, dataType = "Integer"),
  106. })
  107. @PostMapping("/sendWagonPlease/{resultId}")
  108. public RESTfulResult sendWagonPlease(@PathVariable("resultId") Integer resultId){
  109. TmstrainPleaseApproveResult tmstrainPleaseApproveResult = new TmstrainPleaseApproveResult();
  110. tmstrainPleaseApproveResult.setResultId(new BigDecimal(resultId));
  111. tmstrainPleaseApproveResult.setStatus(new BigDecimal(1));
  112. int i = tmstrainPleaseApproveResultService.updateByPrimaryKeySelective(tmstrainPleaseApproveResult);
  113. return success(i);
  114. }
  115. //********************************下拉框******************************************
  116. @ApiOperation(value="查询所有发货单位")
  117. @GetMapping("/getShipper")
  118. public RESTfulResult getShipper(){
  119. List<Map<String, Object>> shipper = tmstrainPleaseApproveResultService.getShipper();
  120. return success(shipper);
  121. }
  122. @ApiOperation(value="查询所有发运计划")
  123. @GetMapping("/getRailPlan")
  124. public RESTfulResult getRailPlan(){
  125. List<Map<String, Object>> shipper = tmstrainPleaseApproveResultService.getRailPlan();
  126. return success(shipper);
  127. }
  128. //内转物流
  129. @ApiOperation(value="查询所有发站/到站")
  130. @GetMapping("/getArrivalSend")
  131. public RESTfulResult getArrivalSend(){
  132. List<Map<String, Object>> send = tmstrainPleaseApproveResultService.getArrivalSend();
  133. return success(send);
  134. }
  135. //查询请车计划号
  136. @ApiOperation(value="查询请车计划号")
  137. @GetMapping("/getPleasePlanNo")
  138. public RESTfulResult getPleasePlanNo(){
  139. List<Map<String, Object>> PlanNo = tmstrainPleaseApproveResultService.getPleasePlanNo();
  140. return success(PlanNo);
  141. }
  142. //******************************批车作业**************************************
  143. @ApiOperation(value="查询批车作业")
  144. @ApiImplicitParams({
  145. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  146. @ApiImplicitParam(name = "apiId(70)", value = "动态表头", required = false, dataType = "Integer"),
  147. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  148. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  149. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  150. })
  151. @PostMapping("/getApproveAllWagonPlease")
  152. public RESTfulResult getApproveAllWagonPlease(@RequestBody(required=false) Map<String,Object> mapValue,
  153. Integer apiId,
  154. Integer pageNum,
  155. Integer pageSize,
  156. Integer resultType){
  157. mapValue.put("resultType", resultType);
  158. //不分页筛选数据
  159. List<Map<String, Object>> wagonPleaseTotal = tmstrainPleaseApproveResultService.getAllApproveWagonPlease(mapValue);
  160. PageHelper.startPage(pageNum,pageSize);
  161. //分页数据
  162. List<Map<String, Object>> wagonPlease = tmstrainPleaseApproveResultService.getAllApproveWagonPlease(mapValue);
  163. DataChange.changeDateToDayDate(wagonPlease, "resultApproveDate");
  164. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, wagonPleaseTotal,wagonPlease);
  165. return success(pageList);
  166. }
  167. @ApiOperation(value="通过Id查询批车作业")
  168. @PostMapping ("/getApproveWagonPleaseById/{resultId}")
  169. public RESTfulResult getApproveWagonPleaseById(@PathVariable("resultId")Integer resultId){
  170. List<Map<String, Object>> approveWagonPleaseById = tmstrainPleaseApproveResultService.getApproveWagonPleaseById(resultId);
  171. return success(approveWagonPleaseById);
  172. }
  173. @ApiOperation(value="新增批车作业")
  174. @ApiImplicitParams({
  175. @ApiImplicitParam(name = "tmstrainPleaseApproveResult", value = "请车作业实绩对象", required = false, dataType = "TmstrainPleaseApproveResult"),
  176. })
  177. @PostMapping("/addApproveWagonPlease")
  178. public RESTfulResult addApproveWagonPlease(@RequestBody TmstrainPleaseApproveResult tmstrainPleaseApproveResult){
  179. tmstrainPleaseApproveResult.setStatus(new BigDecimal(2));
  180. int i = tmstrainPleaseApproveResultService.updateByPrimaryKeySelective(tmstrainPleaseApproveResult);
  181. return success(i);
  182. }
  183. @ApiOperation(value="修改批车作业")
  184. @ApiImplicitParams({
  185. @ApiImplicitParam(name = "tmstrainPleaseApproveResult", value = "请车作业实绩对象", required = false, dataType = "TmstrainPleaseApproveResult"),
  186. })
  187. @PostMapping("/updateApproveWagonPlease")
  188. public RESTfulResult updateApproveWagonPlease(@RequestBody TmstrainPleaseApproveResult tmstrainPleaseApproveResult){
  189. tmstrainPleaseApproveResult.setUpdateTime(new Date()); //设置更新时间
  190. int i = tmstrainPleaseApproveResultService.updateByPrimaryKeySelective(tmstrainPleaseApproveResult);
  191. return success(i);
  192. }
  193. @ApiOperation(value="逻辑删除批车作业")
  194. @ApiImplicitParams({
  195. @ApiImplicitParam(name = "resultId", value = "请车作业实绩对象", required = false, dataType = "Integer"),
  196. })
  197. @PostMapping("/deleteApproveWagonPlease/{resultId}")
  198. public RESTfulResult deleteApproveWagonPlease(@PathVariable("resultId") Integer resultId){
  199. TmstrainPleaseApproveResult tmstrainPleaseApproveResult = new TmstrainPleaseApproveResult();
  200. tmstrainPleaseApproveResult.setStatus(new BigDecimal(3));
  201. tmstrainPleaseApproveResult.setResultId(new BigDecimal(resultId));
  202. int i = tmstrainPleaseApproveResultService.updateByPrimaryKeySelective(tmstrainPleaseApproveResult);
  203. return success(i);
  204. }
  205. /********************************************内转物流***************************************************
  206. /**
  207. * 内转物流,新增请车作业
  208. * @param map
  209. * @return
  210. */
  211. @ApiOperation(value="新增请车作业")
  212. @ApiImplicitParams({
  213. @ApiImplicitParam(name = "amstrainWagonPlease", value = "请车作业对象", required = false, dataType = "AmstrainWagonPlease"),
  214. })
  215. @PostMapping("/addWagonApprove")
  216. public RESTfulResult addWagonApprove(@RequestBody Map<String,Object> map){
  217. int i = tmstrainPleaseApproveResultService.addPleaseApprove(map);
  218. return success(i);
  219. }
  220. /**
  221. * 内转查询请车实绩
  222. * @return
  223. */
  224. @ApiOperation(value="查询请车作业")
  225. @ApiImplicitParams({
  226. @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
  227. @ApiImplicitParam(name = "apiId(199)", value = "动态表头", required = false, dataType = "Integer"),
  228. @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
  229. @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
  230. @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
  231. })
  232. @PostMapping("/getAllWagonPleaseForConverted")
  233. public RESTfulResult getAllWagonPleaseForConverted(@RequestBody(required=false) Map<String,Object> mapValue,
  234. Integer apiId,
  235. Integer pageNum,
  236. Integer pageSize,
  237. Integer status){
  238. if(mapValue == null){
  239. mapValue = new HashMap<>();
  240. }
  241. mapValue.put("status", status);
  242. //不分页筛选数据
  243. List<Map<String, Object>> wagonPleaseTotal = tmstrainPleaseApproveResultService.selectPleaseApprovePlanForConverted(mapValue);
  244. PageHelper.startPage(pageNum,pageSize);
  245. //分页数据
  246. List<Map<String, Object>> wagonPlease = tmstrainPleaseApproveResultService.selectPleaseApprovePlanForConverted(mapValue);
  247. DataChange.changeDateToDayDate(wagonPlease, "resultPleaseDate", "resultPlanDate");
  248. PageListAdd pageList = columnDataUtil.tableColumnData(apiId, wagonPleaseTotal,wagonPlease);
  249. return success(pageList);
  250. }
  251. /**
  252. * 通过id查询请车作业
  253. * @param resultId
  254. * @return
  255. */
  256. @ApiOperation(value="通过Id查询请车作业")
  257. @PostMapping ("/getPleasePlanByResultId/{resultId}")
  258. public RESTfulResult getPleasePlanByResultId(@PathVariable("resultId")Integer resultId){
  259. List<Map<String, Object>> WagonPleaseById = tmstrainPleaseApproveResultService.selectPleasePlanByResultId(resultId);
  260. return success(WagonPleaseById);
  261. }
  262. /**
  263. * 通过id查询批车作业
  264. * @param resultId
  265. * @return
  266. */
  267. @ApiOperation(value="通过id查询批车作业")
  268. @PostMapping ("/getApproveByResultId/{resultId}")
  269. public RESTfulResult getApproveByResultId(@PathVariable("resultId")Integer resultId){
  270. List<Map<String, Object>> ApproveBYResultId = tmstrainPleaseApproveResultService.selectApproveBYResultId(resultId);
  271. return success(ApproveBYResultId);
  272. }
  273. }