123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258 |
- package com.steerinfo.dil.controller;
- import com.github.pagehelper.PageHelper;
- import com.steerinfo.dil.feign.ESFeign;
- import com.steerinfo.dil.service.impl.BmstruckDetailsOrderServiceImpl;
- import com.steerinfo.dil.util.BaseRESTfulController;
- import com.steerinfo.dil.util.ColumnDataUtil;
- import com.steerinfo.dil.util.PageListAdd;
- import com.steerinfo.framework.controller.RESTfulResult;
- import io.swagger.annotations.ApiImplicitParam;
- import io.swagger.annotations.ApiImplicitParams;
- import io.swagger.annotations.ApiModelProperty;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.beans.factory.annotation.Required;
- import org.springframework.web.bind.annotation.*;
- import java.math.BigDecimal;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- /**
- * @Description:
- * @Author:HuJianGuo
- * @GreateTime:2021/9/24 17:29
- * @Version:V2.0
- */
- @RestController
- @RequestMapping("/${api.version}/bmstruckdetailsorder")
- public class BmstruckDetailsOrderController extends BaseRESTfulController {
- @Autowired
- BmstruckDetailsOrderServiceImpl bmstruckDetailsOrderService;
- @Autowired
- ColumnDataUtil columnDataUtil;
- @Autowired
- ESFeign esFeign;
- /**
- * 展示汽运详单信息
- *
- * @param mapValue
- * @param pageNum
- * @param pageSize
- * @param apiId
- * @return
- */
- @ApiModelProperty(value = "展示汽运详单信息")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "apiId", value = "销售:176/采购:140", required = false, dataType = "BigDecimal"),
- @ApiImplicitParam(name = "orderType", value = "1:销售,3:采购", required = false, dataType = "Integer")
- })
- @PostMapping("/getTruckDetailsOrderList")
- public RESTfulResult getTruckDetailsOrderList(@RequestBody(required = false) Map<String, Object> mapValue,
- Integer pageNum,
- Integer pageSize,
- Integer apiId,
- Integer orderType,
- String carrierSsoId) {
- if (mapValue == null) {
- mapValue = new HashMap<>();
- }
- if (carrierSsoId != null && carrierSsoId.equals("undefined")) {
- carrierSsoId = null;
- }
- if (carrierSsoId != null) {
- BigDecimal carrierId = bmstruckDetailsOrderService.getCarrierIdBySSO(carrierSsoId);
- mapValue.put("carrierId",carrierId);
- }
- mapValue.put("orderType",orderType);
- //初始化过滤
- List<Map<String, Object>> truckDetailList = bmstruckDetailsOrderService.getTruckDetailsOrderList(mapValue);
- PageHelper.startPage(pageNum, pageSize);
- //分页查询数据
- List<Map<String, Object>> columnList = bmstruckDetailsOrderService.getTruckDetailsOrderList(mapValue);
- PageListAdd data = columnDataUtil.tableColumnData(apiId, truckDetailList, columnList);
- return success(data);
- }
- /**
- * 展示汽运未生成账单的详单信息
- *
- * @param mapValue
- * @param pageNum
- * @param pageSize
- * @param apiId
- * @return
- */
- @ApiModelProperty(value = "展示汽运未生成账单的详单信息")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "apiId", value = "销售:176", required = false, dataType = "BigDecimal"),
- @ApiImplicitParam(name = "orderType", value = "1:销售", required = false, dataType = "Integer")
- })
- @PostMapping("/getUnFinishedTruckDetailsOrderList")
- public RESTfulResult getUnFinishedTruckDetailsOrderList(@RequestBody(required = false) Map<String, Object> mapValue,
- Integer pageNum,
- Integer pageSize,
- Integer apiId,
- Integer orderType,
- String carrierSsoId) {
- if (carrierSsoId != null && carrierSsoId.equals("undefined")) {
- carrierSsoId = null;
- }
- if (carrierSsoId != null) {
- BigDecimal carrierId = bmstruckDetailsOrderService.getCarrierIdBySSO(carrierSsoId);
- mapValue.put("carrierId",carrierId);
- }
- List<Map<String, Object>> truckDetailList = bmstruckDetailsOrderService.getUnFinishedTruckDetailsOrderList(mapValue, orderType);
- PageHelper.startPage(pageNum, pageSize);
- //分页查询数据
- List<Map<String, Object>> columnList = bmstruckDetailsOrderService.getUnFinishedTruckDetailsOrderList(mapValue, orderType);
- PageListAdd data = columnDataUtil.tableColumnData(apiId, truckDetailList, columnList);
- return success(data);
- }
- /*
- 内转计重计费详单
- */
- @PostMapping("/getInwardWeightDetailsOrder")
- public RESTfulResult getInwardWeightDetailsOrder(@RequestBody(required = false) Map<String,Object>mapValue,
- Integer pageNum,
- Integer pageSize,
- Integer apiId,
- String carrierSsoId,
- Integer detailStatus,
- Integer orderType,
- String userId){
- if (carrierSsoId != null && carrierSsoId.equals("undefined")) {
- carrierSsoId = null;
- }
- if (carrierSsoId != null) {
- BigDecimal carrierId = bmstruckDetailsOrderService.getCarrierIdBySSO(carrierSsoId);
- mapValue.put("carrierId",carrierId);
- }
- if(userId != null){
- mapValue.put("userId",userId);
- }
- mapValue.put("detailStatus",detailStatus);
- List<Map<String, Object>> truckDetailList = bmstruckDetailsOrderService.getInwardWeightDetailsOrder(mapValue,orderType);
- PageHelper.startPage(pageNum, pageSize);
- //分页查询数据
- List<Map<String, Object>> columnList = bmstruckDetailsOrderService.getInwardWeightDetailsOrder(mapValue,orderType);
- PageListAdd data = columnDataUtil.tableColumnData(apiId, truckDetailList, columnList);
- return success(data);
- }
- /**
- * 展示汽运实绩信息
- *
- * @param mapVal
- * @param pageNum
- * @param pageSize
- * @param apiId
- * @return
- */
- @ApiModelProperty(value = "展示汽运实绩信息")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "apiId", value = "销售:177/采购:142", required = false, dataType = "BigDecimal")
- })
- @PostMapping("/getTruckResultList")
- public RESTfulResult getTruckResultList(@RequestBody(required = false) Map<String, Object> mapVal,
- Integer pageNum,
- Integer pageSize,
- Integer apiId,
- BigDecimal orderId) {
- if (mapVal == null) {
- mapVal = new HashMap<>();
- }
- mapVal.put("orderId", orderId);
- List<Map<String, Object>> list = bmstruckDetailsOrderService.getTruckResultList(mapVal);
- PageHelper.startPage(pageNum, pageSize);
- //分页查询数据
- List<Map<String, Object>> columnList = bmstruckDetailsOrderService.getTruckResultList(mapVal);
- PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
- return success(data);
- }
- /**
- * 新增详单
- *
- * @param orderId
- * @return
- */
- @ApiModelProperty(value = "新增详单")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "orderId", value = "汽运计量实绩id", required = false, dataType = "BigDecimal"),
- })
- @PostMapping("/addDetailsOrder/{orderId}")
- public RESTfulResult addDetailsOrder(@PathVariable("orderId") BigDecimal orderId) throws Exception {
- int code = bmstruckDetailsOrderService.insertSelective(orderId);
- return success(code);
- }
- @ApiModelProperty(value = "新增内转计费详单")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "orderId", value = "汽运计量实绩id", required = false, dataType = "BigDecimal"),
- })
- @PostMapping("/addInwardDetailsOrder")
- public RESTfulResult addInwardDetailsOrder(@RequestBody(required = false) Map<String, Object> mapVal) {
- int code = bmstruckDetailsOrderService.inserInwardOrder(mapVal);
- return success(code);
- }
- /**
- * 修改详单
- *
- * @param mapValue
- * @return
- */
- @ApiModelProperty(value = "修改详单")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "detailsId,priceId", value = "详单id,价格id", required = false, dataType = "BigDecimal"),
- })
- @PostMapping("/updateDetailsOrder")
- public RESTfulResult updateDetailsOrder(@RequestBody Map<String,Object> mapValue) throws Exception {
- int code = bmstruckDetailsOrderService.updateDetailsOrder(mapValue);
- return success(code);
- }
- /**addLossFeeOfCoke
- * 增加焦炭途损费
- *
- * @param map
- * @return
- */
- @ApiModelProperty(value = "增加焦炭途损费")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "detailsId", value = "详单id", required = false, dataType = "BigDecimal"),
- })
- @PostMapping("/addLossFeeOfCoke")
- public RESTfulResult addLossFeeOfCoke(@RequestBody Map<String,Object> map) {
- int code = bmstruckDetailsOrderService.addLossFeeOfCoke(map);
- return success(code);
- }
- /**
- * 查询价格和地址
- *
- * @param priceId
- * @return
- */
- @ApiModelProperty(value = "查询价格和地址")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "priceId", value = "价格id", required = false, dataType = "BigDecimal"),
- })
- @PostMapping("/findAddressAndPrice")
- public RESTfulResult findAddressAndPrice(@RequestParam Integer priceId) {
- Map<String,Object> map = bmstruckDetailsOrderService.findAddressAndPrice(priceId);
- return success(map);
- }
- }
|