123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258 |
- package com.steerinfo.dil.controller;
- import com.steerinfo.dil.mapper.UniversalMapper;
- import com.steerinfo.dil.service.impl.UniversalServiceImpl;
- 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.PostMapping;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- /**
- * @ author :TXF
- * @ time :2021/10/19 18:06
- * 通用接口
- */
- @RequestMapping("${api.version}/uc")
- @RestController
- public class UniversalController extends BaseRESTfulController {
- @Autowired
- UniversalServiceImpl selfServiceMachineService;
- @Autowired
- UniversalMapper universalMapper;
- @Autowired
- ColumnDataUtil columnDataUtil;
- @ApiOperation(value="查询数据打印提货单接口")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "mapValue", value = "运输订单号", required = false, dataType = "Map"),
- })
- @PostMapping("/printTHD")
- public RESTfulResult printTiHuoDan(@RequestBody(required=false) Map<String, Object> mapValue){
- Map<String, Object> tiHuoDan = selfServiceMachineService.printTiHuoDan((String) mapValue.get("orderNumber"));
- return success(tiHuoDan);
- }
- @ApiModelProperty(value = "模糊查询发货单位")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "apiId", value = "247", required = false, dataType = "BigDecimal")
- })
- @PostMapping("/querySupplierByLike")
- public RESTfulResult querySupplierByLike(@RequestBody(required = false) Map<String,Object> mapValue,
- Integer pageNum,
- Integer pageSize,
- Integer apiId,
- String index) {
- if(mapValue == null) {
- mapValue = new HashMap<>();
- }
- if(index != null){
- mapValue.put("index","%" + index + "%");
- }
- List<Map<String, Object>> list = universalMapper.querySupplierByLike(mapValue);
- PageHelper.startPage(pageNum, pageSize);
- //分页查询数据
- List<Map<String, Object>> columnList = universalMapper.querySupplierByLike(mapValue);
- PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
- return success(data);
- }
- @ApiModelProperty(value = "通过物资ID查询该物资的发货单位信息")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "apiId", value = "247", required = false, dataType = "BigDecimal")
- })
- @PostMapping("/getSupplierMesByMaterialId")
- public RESTfulResult getSupplierMesByMaterialId(@RequestBody(required = false) Map<String,Object> mapValue,
- Integer pageNum,
- Integer pageSize,
- Integer apiId,
- String index, String materialId) {
- if(mapValue == null)
- mapValue = new HashMap<>();
- if(!"null".equals(materialId))
- mapValue.put("materialId",materialId);
- if(index != null){
- mapValue.put("index","%" + index + "%");
- }
- List<Map<String, Object>> list = universalMapper.getSupplierMesByMaterialId(mapValue);
- PageHelper.startPage(pageNum, pageSize);
- //分页查询数据
- List<Map<String, Object>> columnList = universalMapper.getSupplierMesByMaterialId(mapValue);
- PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
- return success(data);
- }
- @ApiOperation(value="查询所有空闲的运力信息")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
- @ApiImplicitParam(name = "apiId()", value = "动态表头", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
- })
- @PostMapping("/getAllCapacityByCarrierLike")
- public RESTfulResult getAllCapacityByCarrierLike(@RequestBody(required=false) Map<String,Object> mapValue,
- Integer apiId,
- Integer pageNum,
- Integer pageSize,
- String index
- ){
- if(mapValue == null){
- mapValue = new HashMap<>();
- }
- if(index != null){
- mapValue.put("index", index + "%");
- }
- //不分页筛选数据
- List<Map<String, Object>> allCapacity = universalMapper.getAllCapacityByCarrierLike(mapValue);
- PageHelper.startPage(pageNum,pageSize);
- //分页数据
- List<Map<String, Object>> capacity = universalMapper.getAllCapacityByCarrierLike(mapValue);
- PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allCapacity,capacity);
- return success(pageList);
- }
- @ApiOperation(value="通过订单ID查询订单下所有物资")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
- @ApiImplicitParam(name = "apiId(248)", value = "动态表头", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
- })
- @PostMapping("/getMaterialMesByOrderId")
- public RESTfulResult getMaterialMesByOrderId(@RequestBody(required=false) Map<String,Object> mapValue,
- Integer apiId,
- Integer pageNum,
- Integer pageSize,
- String orderId
- ){
- if(mapValue == null){
- mapValue = new HashMap<>();
- }
- if(orderId != null){
- mapValue.put("orderId", orderId);
- }
- //不分页筛选数据
- List<Map<String, Object>> allCapacity = universalMapper.getMaterialMesByOrderId(mapValue);
- PageHelper.startPage(pageNum,pageSize);
- //分页数据
- List<Map<String, Object>> capacity = universalMapper.getMaterialMesByOrderId(mapValue);
- PageListAdd pageList = columnDataUtil.tableColumnData(apiId, allCapacity,capacity);
- return success(pageList);
- }
- @ApiModelProperty(value = "模糊查询物资")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "apiId", value = "244", required = false, dataType = "BigDecimal")
- })
- @PostMapping("/queryAPOMaterialByLike")
- public RESTfulResult queryMaterialByLike(@RequestBody(required = false) Map<String,Object> mapValue,
- Integer pageNum,
- Integer pageSize,
- Integer apiId,
- String index) {
- if(mapValue == null) {
- mapValue = new HashMap<>();
- }
- if(index != null){
- mapValue.put("index", "%" + index + "%");
- }
- List<Map<String, Object>> list = universalMapper.queryAPOMaterialByLike(mapValue);
- PageHelper.startPage(pageNum, pageSize);
- //分页查询数据
- List<Map<String, Object>> columnList = universalMapper.queryAPOMaterialByLike(mapValue);
- PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
- return success(data);
- }
- @ApiModelProperty(value = "模糊查询卸货点")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "apiId", value = "374", required = false, dataType = "BigDecimal")
- })
- @PostMapping("/getUnloadingMesByLike")
- public RESTfulResult getUnloadingMesByLike(@RequestBody(required = false) Map<String,Object> mapValue,
- Integer pageNum,
- Integer pageSize,
- Integer apiId,
- Integer type,
- String index) {
- if(mapValue == null) {
- mapValue = new HashMap<>();
- }
- if(type != null){
- mapValue.put("type", type);
- }
- if(index != null){
- mapValue.put("index", "%" + index + "%");
- }
- List<Map<String, Object>> list = universalMapper.getUnloadingMesByLike(mapValue);
- PageHelper.startPage(pageNum, pageSize);
- //分页查询数据
- List<Map<String, Object>> columnList = universalMapper.getUnloadingMesByLike(mapValue);
- PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
- return success(data);
- }
- @ApiModelProperty(value = "模糊查询物资")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "apiId", value = "244", required = false, dataType = "BigDecimal")
- })
- @PostMapping("/queryMaterialByLike")
- public RESTfulResult queryMaterialByLike(@RequestBody(required = false) Map<String,Object> mapValue,
- Integer pageNum,
- Integer pageSize,
- Integer apiId,
- String index,
- String startNum) {
- if(mapValue == null) {
- mapValue = new HashMap<>();
- }
- if(startNum != null){
- mapValue.put("startNum", startNum + "%");
- }
- if(index != null){
- mapValue.put("index", "%" + index + "%");
- }
- List<Map<String, Object>> list = universalMapper.queryMaterialByLike(mapValue);
- PageHelper.startPage(pageNum, pageSize);
- //分页查询数据
- List<Map<String, Object>> columnList = universalMapper.queryMaterialByLike(mapValue);
- PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
- return success(data);
- }
- }
|