package com.steerinfo.dil.controller; import com.steerinfo.dil.model.AmsContractTransportPrice; import com.steerinfo.dil.service.impl.AmsContractTransportPriceServiceImpl; 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 com.steerinfo.framework.service.pagehelper.PageHelper; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.math.BigDecimal; import java.util.List; import java.util.Map; /** * @Description: * @Author:HuJianGuo * @GreateTime:2021/9/3 9:06 * @Version:V2.0 */ @RestController @RequestMapping("/${api.version}/amscontracttransportprice") public class AmsContractTransportPriceController extends BaseRESTfulController { @Autowired AmsContractTransportPriceServiceImpl amsContractTransportPriceService; @Autowired ColumnDataUtil columnDataUtil; /** * 展示水运单价 * @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 = "83", required = false, dataType = "BigDecimal") }) @PostMapping("/getShipPriceList") public RESTfulResult getShipPriceList(@RequestBody(required = false) Map mapValue, Integer pageNum, Integer pageSize, Integer apiId) { List> list = amsContractTransportPriceService.getShipPriceList(mapValue); PageHelper.startPage(pageNum, pageSize); //分页查询数据 List> columnList = amsContractTransportPriceService.getShipPriceList(mapValue); PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList); return success(data); } /** * 新增水运单价 * @param amsContractTransportPrice * @return */ @ApiModelProperty(value = "新增水运单价") @ApiImplicitParams({ @ApiImplicitParam(name = "amsContractTransportPrice", value = "运价实体", required = false, dataType = "AmsContractTransportPrice"), }) @PostMapping("/addShipPrice") public RESTfulResult addShipPrice(@RequestBody AmsContractTransportPrice amsContractTransportPrice) { System.out.println(amsContractTransportPrice); int result = amsContractTransportPriceService.insertShip(amsContractTransportPrice); return success(result); } /** * 逻辑删除水运单价 * @param priceId * @return */ @ApiModelProperty(value = "逻辑删除水运单价") @ApiImplicitParams({ @ApiImplicitParam(name = "priceId", value = "价格编号", required = false, dataType = "BigDecimal"), }) @PostMapping("/deleteShipPrice/{priceId}") public RESTfulResult deleteShipPrice(@PathVariable("priceId") BigDecimal priceId) { int result = amsContractTransportPriceService.delete(priceId); return success(result); } /** * 修改水运单价 * @param amsContractTransportPrice * @return */ @ApiModelProperty(value = "修改水运单价") @ApiImplicitParams({ @ApiImplicitParam(name = "amsContractTransportPrice", value = "运价实体", required = false, dataType = "AmsContractTransportPrice"), }) @PostMapping("/updateShipPrice") public RESTfulResult updateShipPrice(@RequestBody AmsContractTransportPrice amsContractTransportPrice) { int result = amsContractTransportPriceService.updateByPrimaryKeySelective(amsContractTransportPrice); return success(result); } /** * 得到修改渲染 * @param priceId * @return */ @ApiModelProperty(value = "得到修改渲染") @ApiImplicitParams({ @ApiImplicitParam(name = "priceId", value = "价格编号", required = false, dataType = "BigDecimal"), }) @PostMapping("/selectPriceToUpdate/{priceId}") public RESTfulResult selectPriceToUpdate(@PathVariable("priceId") BigDecimal priceId) { List> result = amsContractTransportPriceService.selectPriceToUpdate(priceId); return success(result); } /** * 展示汽运单价 * @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 = "139", required = false, dataType = "BigDecimal") }) @PostMapping("/getTruckPriceList") public RESTfulResult getTruckPriceList(@RequestBody(required = false) Map mapValue, Integer pageNum, Integer pageSize, Integer apiId) { List> list = amsContractTransportPriceService.getAmsContractTransportPrice(mapValue); PageHelper.startPage(pageNum, pageSize); //分页查询数据 List> columnList = amsContractTransportPriceService.getAmsContractTransportPrice(mapValue); PageListAdd data = columnDataUtil.tableColumnData(apiId, list, 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 = "139", required = false, dataType = "BigDecimal") }) @PostMapping("/getSaleTruckPriceList") public RESTfulResult getSaleTruckPriceList(@RequestBody(required = false) Map mapValue, Integer pageNum, Integer pageSize, Integer apiId) { List> list = amsContractTransportPriceService.getSaleTruckPriceList(mapValue); PageHelper.startPage(pageNum, pageSize); //分页查询数据 List> columnList = amsContractTransportPriceService.getSaleTruckPriceList(mapValue); PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList); return success(data); } /** * 新增汽运单价 * @param amsContractTransportPrice * @return */ @ApiOperation(value="新增汽运单价") @ApiImplicitParams({ @ApiImplicitParam(name = "amsContractTransportPrice", value = "汽运单价对象", required = false, dataType = "AmsContractTransportPrice") }) @PostMapping(value = "/addAmsContractTransportPrice") public RESTfulResult addAmsContractTransportPrice(@RequestBody(required = false) AmsContractTransportPrice amsContractTransportPrice){ int i = amsContractTransportPriceService.insertTruck(amsContractTransportPrice); return success(i); } /** * 通过主键修改汽运单价 * @param amsContractTransportPrice * @return */ @ApiOperation(value="通过主键修改汽运单价") @ApiImplicitParams({ @ApiImplicitParam(name = "amsContractTransportPrice", value = "销售订单对象", required = false, dataType = "AmsContractTransportPrice") }) @PostMapping(value = "/updateAmsContractTransportPrice") public RESTfulResult updateAmsContractTransportPrice(@RequestBody(required = false) AmsContractTransportPrice amsContractTransportPrice){ int i = amsContractTransportPriceService.updateByPrimaryKeySelective(amsContractTransportPrice); return success(i); } /** * 油价联动导致运价变动,批量修改运价 * @param * @return */ @ApiOperation(value="油价联动导致运价变动,批量修改运价") @ApiImplicitParams({ }) @PostMapping(value = "/batchUpdateTransportPriceByOilPrice") public RESTfulResult batchUpdateTransportPriceByOilPrice(){ int i = amsContractTransportPriceService.batchUpdateTransportPriceByOilPrice(); return success(i); } /** * 获取收货地址 * @param * @return */ @ApiOperation(value="获取收货地址") @ApiImplicitParams({ }) @GetMapping(value = "/getAddressDeliveryAddress") public RESTfulResult getAddressDeliveryAddress(){ return success(amsContractTransportPriceService.getAddressDeliveryAddress()); } /** * 得到托运人id * @param * @return */ @ApiModelProperty(value = "得到托运人id") @GetMapping("/getShipperId") public RESTfulResult getShipperId() { List> result = amsContractTransportPriceService.getShipperId(); return success(result); } /** * 得到承运商id * @param * @return */ @ApiModelProperty(value = "得到承运商id") @GetMapping("/getCarrierId") public RESTfulResult getCarrierId() { List> result = amsContractTransportPriceService.getCarrierId(); return success(result); } /** * 得到船运运力id * @param * @return */ @ApiModelProperty(value = "得到船运运力id") @GetMapping("/getCapacityId") public RESTfulResult getCapacityId() { List> result = amsContractTransportPriceService.getCapacityId(); return success(result); } /** * 得到汽运运力id * @param * @return */ @ApiModelProperty(value = "得到汽运运力id") @GetMapping("/getTruckCapacityId") public RESTfulResult getTruckCapacityId() { List> result = amsContractTransportPriceService.getTruckCapacityId(); return success(result); } /** * 得到物资id * @param * @return */ @ApiModelProperty(value = "得到物资id") @GetMapping("/getMaterialId") public RESTfulResult getMaterialId() { List> result = amsContractTransportPriceService.getMaterialId(); return success(result); } /** * 得到线路id * @param * @return */ @ApiModelProperty(value = "得到线路id") @GetMapping("/getLineId") public RESTfulResult getLineId() { List> result = amsContractTransportPriceService.getLineId(); return success(result); } }