BmstruckDetailsOrderController.java 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. package com.steerinfo.dil.controller;
  2. import com.github.pagehelper.PageHelper;
  3. import com.steerinfo.dil.feign.ESFeign;
  4. import com.steerinfo.dil.service.impl.BmstruckDetailsOrderServiceImpl;
  5. import com.steerinfo.dil.util.BaseRESTfulController;
  6. import com.steerinfo.dil.util.ColumnDataUtil;
  7. import com.steerinfo.dil.util.PageListAdd;
  8. import com.steerinfo.framework.controller.RESTfulResult;
  9. import io.swagger.annotations.ApiImplicitParam;
  10. import io.swagger.annotations.ApiImplicitParams;
  11. import io.swagger.annotations.ApiModelProperty;
  12. import org.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.beans.factory.annotation.Required;
  14. import org.springframework.web.bind.annotation.*;
  15. import java.math.BigDecimal;
  16. import java.util.HashMap;
  17. import java.util.List;
  18. import java.util.Map;
  19. /**
  20. * @Description:
  21. * @Author:HuJianGuo
  22. * @GreateTime:2021/9/24 17:29
  23. * @Version:V2.0
  24. */
  25. @RestController
  26. @RequestMapping("/${api.version}/bmstruckdetailsorder")
  27. public class BmstruckDetailsOrderController extends BaseRESTfulController {
  28. @Autowired
  29. BmstruckDetailsOrderServiceImpl bmstruckDetailsOrderService;
  30. @Autowired
  31. ColumnDataUtil columnDataUtil;
  32. @Autowired
  33. ESFeign esFeign;
  34. /**
  35. * 展示汽运详单信息
  36. *
  37. * @param mapValue
  38. * @param pageNum
  39. * @param pageSize
  40. * @param apiId
  41. * @return
  42. */
  43. @ApiModelProperty(value = "展示汽运详单信息")
  44. @ApiImplicitParams({
  45. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  46. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  47. @ApiImplicitParam(name = "apiId", value = "销售:176/采购:140", required = false, dataType = "BigDecimal"),
  48. @ApiImplicitParam(name = "orderType", value = "1:销售,3:采购", required = false, dataType = "Integer")
  49. })
  50. @PostMapping("/getTruckDetailsOrderList")
  51. public RESTfulResult getTruckDetailsOrderList(@RequestBody(required = false) Map<String, Object> mapValue,
  52. Integer pageNum,
  53. Integer pageSize,
  54. Integer apiId,
  55. Integer orderType,
  56. String carrierSsoId) {
  57. if (mapValue == null) {
  58. mapValue = new HashMap<>();
  59. }
  60. if (carrierSsoId != null && carrierSsoId.equals("undefined")) {
  61. carrierSsoId = null;
  62. }
  63. if (carrierSsoId != null) {
  64. BigDecimal carrierId = bmstruckDetailsOrderService.getCarrierIdBySSO(carrierSsoId);
  65. mapValue.put("carrierId",carrierId);
  66. }
  67. mapValue.put("orderType",orderType);
  68. //初始化过滤
  69. List<Map<String, Object>> truckDetailList = bmstruckDetailsOrderService.getTruckDetailsOrderList(mapValue);
  70. PageHelper.startPage(pageNum, pageSize);
  71. //分页查询数据
  72. List<Map<String, Object>> columnList = bmstruckDetailsOrderService.getTruckDetailsOrderList(mapValue);
  73. PageListAdd data = columnDataUtil.tableColumnData(apiId, truckDetailList, columnList);
  74. return success(data);
  75. }
  76. /**
  77. * 展示汽运未生成账单的详单信息
  78. *
  79. * @param mapValue
  80. * @param pageNum
  81. * @param pageSize
  82. * @param apiId
  83. * @return
  84. */
  85. @ApiModelProperty(value = "展示汽运未生成账单的详单信息")
  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 = "销售:176", required = false, dataType = "BigDecimal"),
  90. @ApiImplicitParam(name = "orderType", value = "1:销售", required = false, dataType = "Integer")
  91. })
  92. @PostMapping("/getUnFinishedTruckDetailsOrderList")
  93. public RESTfulResult getUnFinishedTruckDetailsOrderList(@RequestBody(required = false) Map<String, Object> mapValue,
  94. Integer pageNum,
  95. Integer pageSize,
  96. Integer apiId,
  97. Integer orderType,
  98. String carrierSsoId) {
  99. if (carrierSsoId != null && carrierSsoId.equals("undefined")) {
  100. carrierSsoId = null;
  101. }
  102. if (carrierSsoId != null) {
  103. BigDecimal carrierId = bmstruckDetailsOrderService.getCarrierIdBySSO(carrierSsoId);
  104. mapValue.put("carrierId",carrierId);
  105. }
  106. List<Map<String, Object>> truckDetailList = bmstruckDetailsOrderService.getUnFinishedTruckDetailsOrderList(mapValue, orderType);
  107. PageHelper.startPage(pageNum, pageSize);
  108. //分页查询数据
  109. List<Map<String, Object>> columnList = bmstruckDetailsOrderService.getUnFinishedTruckDetailsOrderList(mapValue, orderType);
  110. PageListAdd data = columnDataUtil.tableColumnData(apiId, truckDetailList, columnList);
  111. return success(data);
  112. }
  113. /*
  114. 内转计重计费详单
  115. */
  116. @PostMapping("/getInwardWeightDetailsOrder")
  117. public RESTfulResult getInwardWeightDetailsOrder(@RequestBody(required = false) Map<String,Object>mapValue,
  118. Integer pageNum,
  119. Integer pageSize,
  120. Integer apiId,
  121. String carrierSsoId,
  122. Integer detailStatus,
  123. Integer orderType,
  124. String userId){
  125. if (carrierSsoId != null && carrierSsoId.equals("undefined")) {
  126. carrierSsoId = null;
  127. }
  128. if (carrierSsoId != null) {
  129. BigDecimal carrierId = bmstruckDetailsOrderService.getCarrierIdBySSO(carrierSsoId);
  130. mapValue.put("carrierId",carrierId);
  131. }
  132. if(userId != null){
  133. mapValue.put("userId",userId);
  134. }
  135. mapValue.put("detailStatus",detailStatus);
  136. List<Map<String, Object>> truckDetailList = bmstruckDetailsOrderService.getInwardWeightDetailsOrder(mapValue,orderType);
  137. PageHelper.startPage(pageNum, pageSize);
  138. //分页查询数据
  139. List<Map<String, Object>> columnList = bmstruckDetailsOrderService.getInwardWeightDetailsOrder(mapValue,orderType);
  140. PageListAdd data = columnDataUtil.tableColumnData(apiId, truckDetailList, columnList);
  141. return success(data);
  142. }
  143. /**
  144. * 展示汽运实绩信息
  145. *
  146. * @param mapVal
  147. * @param pageNum
  148. * @param pageSize
  149. * @param apiId
  150. * @return
  151. */
  152. @ApiModelProperty(value = "展示汽运实绩信息")
  153. @ApiImplicitParams({
  154. @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
  155. @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
  156. @ApiImplicitParam(name = "apiId", value = "销售:177/采购:142", required = false, dataType = "BigDecimal")
  157. })
  158. @PostMapping("/getTruckResultList")
  159. public RESTfulResult getTruckResultList(@RequestBody(required = false) Map<String, Object> mapVal,
  160. Integer pageNum,
  161. Integer pageSize,
  162. Integer apiId,
  163. BigDecimal orderId) {
  164. if (mapVal == null) {
  165. mapVal = new HashMap<>();
  166. }
  167. mapVal.put("orderId", orderId);
  168. List<Map<String, Object>> list = bmstruckDetailsOrderService.getTruckResultList(mapVal);
  169. PageHelper.startPage(pageNum, pageSize);
  170. //分页查询数据
  171. List<Map<String, Object>> columnList = bmstruckDetailsOrderService.getTruckResultList(mapVal);
  172. PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
  173. return success(data);
  174. }
  175. /**
  176. * 新增详单
  177. *
  178. * @param orderId
  179. * @return
  180. */
  181. @ApiModelProperty(value = "新增详单")
  182. @ApiImplicitParams({
  183. @ApiImplicitParam(name = "orderId", value = "汽运计量实绩id", required = false, dataType = "BigDecimal"),
  184. })
  185. @PostMapping("/addDetailsOrder/{orderId}")
  186. public RESTfulResult addDetailsOrder(@PathVariable("orderId") BigDecimal orderId) throws Exception {
  187. int code = bmstruckDetailsOrderService.insertSelective(orderId);
  188. return success(code);
  189. }
  190. @ApiModelProperty(value = "新增内转计费详单")
  191. @ApiImplicitParams({
  192. @ApiImplicitParam(name = "orderId", value = "汽运计量实绩id", required = false, dataType = "BigDecimal"),
  193. })
  194. @PostMapping("/addInwardDetailsOrder")
  195. public RESTfulResult addInwardDetailsOrder(@RequestBody(required = false) Map<String, Object> mapVal) {
  196. int code = bmstruckDetailsOrderService.inserInwardOrder(mapVal);
  197. return success(code);
  198. }
  199. /**
  200. * 修改详单
  201. *
  202. * @param mapValue
  203. * @return
  204. */
  205. @ApiModelProperty(value = "修改详单")
  206. @ApiImplicitParams({
  207. @ApiImplicitParam(name = "detailsId,priceId", value = "详单id,价格id", required = false, dataType = "BigDecimal"),
  208. })
  209. @PostMapping("/updateDetailsOrder")
  210. public RESTfulResult updateDetailsOrder(@RequestBody Map<String,Object> mapValue) throws Exception {
  211. int code = bmstruckDetailsOrderService.updateDetailsOrder(mapValue);
  212. return success(code);
  213. }
  214. /**addLossFeeOfCoke
  215. * 增加焦炭途损费
  216. *
  217. * @param map
  218. * @return
  219. */
  220. @ApiModelProperty(value = "增加焦炭途损费")
  221. @ApiImplicitParams({
  222. @ApiImplicitParam(name = "detailsId", value = "详单id", required = false, dataType = "BigDecimal"),
  223. })
  224. @PostMapping("/addLossFeeOfCoke")
  225. public RESTfulResult addLossFeeOfCoke(@RequestBody Map<String,Object> map) {
  226. int code = bmstruckDetailsOrderService.addLossFeeOfCoke(map);
  227. return success(code);
  228. }
  229. /**
  230. * 查询价格和地址
  231. *
  232. * @param priceId
  233. * @return
  234. */
  235. @ApiModelProperty(value = "查询价格和地址")
  236. @ApiImplicitParams({
  237. @ApiImplicitParam(name = "priceId", value = "价格id", required = false, dataType = "BigDecimal"),
  238. })
  239. @PostMapping("/findAddressAndPrice")
  240. public RESTfulResult findAddressAndPrice(@RequestParam Integer priceId) {
  241. Map<String,Object> map = bmstruckDetailsOrderService.findAddressAndPrice(priceId);
  242. return success(map);
  243. }
  244. }