123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523 |
- 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.apache.ibatis.annotations.Param;
- 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 org.springframework.web.bind.annotation.*;
- import java.math.BigDecimal;
- 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 universalService;
- @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 = universalService.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 = "查询所有发货单位")
- @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("/queryAllSupplierByLike")
- public RESTfulResult queryAllSupplierByLike(@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.queryAllSupplierByLike(mapValue);
- PageHelper.startPage(pageNum, pageSize);
- //分页查询数据
- List<Map<String, Object>> columnList = universalMapper.queryAllSupplierByLike(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(248)", 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 carrierSsoId,
- String index
- ){
- if(mapValue == null){
- mapValue = new HashMap<>();
- }
- if(index != null){
- mapValue.put("index", index);
- }
- if (carrierSsoId != null && carrierSsoId.equals("undefined")) {
- carrierSsoId = null;
- }
- if (carrierSsoId != null) {
- BigDecimal carrierId = universalMapper.getCarrierIdBySSO(carrierSsoId);
- mapValue.put("carrierId",carrierId);
- }
- //不分页筛选数据
- 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(395)", 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 = "边输边查发货单位")
- @PostMapping("/getSupplierMesByLike")
- public RESTfulResult getSupplierMesByLike(@RequestParam("index") String index) {
- List<Map<String, Object>> list = universalMapper.getSupplierMesByLike(index == null ? "" : index);
- return success(list);
- }
- @ApiModelProperty(value = "边输边查收货单位")
- @PostMapping("/getConsigneeByLike")
- public RESTfulResult getConsigneeByLike(@RequestParam("index") String index) {
- List<Map<String, Object>> list = universalMapper.getConsigneeByLike(index == null ? "" : index);
- return success(list);
- }
- @ApiModelProperty(value = "通过订单ID查询订单下物资信息")
- @PostMapping("/getOrderMaterialMesByOrderId/{orderId}")
- public RESTfulResult getMaterialMesByOrderId(@PathVariable("orderId") Integer orderId){
- List<Map<String, Object>> mes = universalMapper.getOrderMaterialMesByOrderId(new BigDecimal(orderId));
- return success(mes);
- }
- @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);
- }
- @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("/queryBatchByLike")
- public RESTfulResult queryBatchByLike(@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.getBatchAndOrderMes(mapValue);
- PageHelper.startPage(pageNum, pageSize);
- //分页查询数据
- List<Map<String, Object>> columnList = universalMapper.getBatchAndOrderMes(mapValue);
- PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
- return success(data);
- }
- @ApiModelProperty(value = "边输边查承运商")
- @PostMapping("/getCarrierMesByLike")
- public RESTfulResult getCarrierMesByLike(@RequestParam("index") String index) {
- List<Map<String, Object>> list = universalMapper.getCarrierMesByLike(index == null ? "" : index);
- return success(list);
- }
- @ApiModelProperty(value = "模糊查询收货单位")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "apiId", value = "396", required = false, dataType = "BigDecimal")
- })
- @PostMapping("/queryConsigneeByLike")
- public RESTfulResult queryConsigneeByLike(@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.queryConsigneeByLike(mapValue);
- PageHelper.startPage(pageNum, pageSize);
- //分页查询数据
- List<Map<String, Object>> columnList = universalMapper.queryConsigneeByLike(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 = "395", required = false, dataType = "BigDecimal")
- })
- @PostMapping("/selectAllMaterialName")
- public RESTfulResult selectAllMaterialName(@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.selectAllMaterialName(mapValue);
- PageHelper.startPage(pageNum, pageSize);
- //分页查询数据
- List<Map<String, Object>> columnList = universalMapper.selectAllMaterialName(mapValue);
- PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
- return success(data);
- }
- @ApiModelProperty(value = "返回sha1加密字符串")
- @RequestMapping(value = "/sha1DigestUtils", method = {RequestMethod.GET,RequestMethod.POST})
- public String sha1DigestUtils(String text){
- return universalService.sha1DigestUtils(text);
- }
- @ApiModelProperty(value = "查装货卸货点")
- @PostMapping("/selectUnloadingPoint")
- public List<Map<String, Object>> selectUnloadingPoint() {
- return universalMapper.selectUnloadingPoint();
- }
- @ApiModelProperty(value = "模糊查询承运商")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "apiId", value = "412", required = false, dataType = "BigDecimal")
- })
- @PostMapping("/getCarrierListByLike")
- public RESTfulResult getCarrierListByLike(@RequestBody(required = false) Map<String,Object> mapValue,
- Integer apiId,
- Integer pageNum,
- Integer pageSize,
- String index) {
- if(index != null){
- if(index.length() == 0){
- index = null;
- }else {
- index = "%" + index + "%";
- }
- }
- if (mapValue == null) {
- mapValue = new HashMap<>();
- }
- mapValue.put("index",index);
- List<Map<String, Object>> list = universalMapper.getCarrierListByLike(mapValue);
- PageHelper.startPage(pageNum, pageSize);
- //分页查询数据
- List<Map<String, Object>> columnList = universalMapper.getCarrierListByLike(mapValue);
- PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
- return success(data);
- }
- @ApiModelProperty(value = "所有门岗下拉框")
- @GetMapping("/getAllGatepost")
- public List<Map<String,Object>> getAllGatepost(){
- return universalMapper.getAllGatepost();
- }
- //通过承运商id获取userId
- @PostMapping("/getUserIdByCarrierId")
- public String getUserIdByCarrierId(@RequestBody Map<String,Object> map){
- //获取承运商id
- Integer carrierId =(Integer) map.get("carrierId");
- return universalMapper.getUserIdbyCarrierId(carrierId);
- }
- @ApiModelProperty(value = "已经在sso权限模块承运商下拉框")
- @GetMapping("/getAllCarrierIdForSso")
- public List<Map<String,Object>> getAllCarrierIdForSso(){
- return universalMapper.getAllCarrierIdForSso();
- }
- @ApiModelProperty(value = "模糊查询收货单位")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "apiId", value = "418", required = false, dataType = "BigDecimal")
- })
- @PostMapping("/getConsigneeListByLike")
- public RESTfulResult getConsigneeListByLike(@RequestBody(required = false) Map<String,Object> mapValue,
- Integer apiId,
- Integer pageNum,
- Integer pageSize,
- String index) {
- if(index != null){
- if(index.length() == 0){
- index = null;
- }else {
- index = "%" + index + "%";
- }
- }
- if (mapValue == null) {
- mapValue = new HashMap<>();
- }
- mapValue.put("index",index);
- List<Map<String, Object>> list = universalMapper.getConsigneeListByLike(mapValue);
- PageHelper.startPage(pageNum, pageSize);
- //分页查询数据
- List<Map<String, Object>> columnList = universalMapper.getConsigneeListByLike(mapValue);
- PageListAdd data = columnDataUtil.tableColumnData(apiId, list, columnList);
- return success(data);
- }
- @ApiOperation("通过运输订单id查询销售订单审核状态")
- @PostMapping("/getSaleOrderStatus")
- public Integer getSaleOrderStatus(@RequestParam Integer orderId) {
- Integer saleStatus = universalMapper.getSaleOrderStatus(new BigDecimal(orderId));
- return saleStatus;
- }
- @ApiOperation("查询所有的汽车衡")
- @GetMapping("/getAllCalculateMes")
- public List<Map<String, Object>> getAllCalculateMes() {
- return universalMapper.getAllCalculateMes();
- }
- @ApiOperation("查询所有的焦炭子类")
- @GetMapping("/getAllMaterialCoke")
- public List<Map<String, Object>> getAllMaterialCoke() {
- return universalMapper.getAllMaterialCoke();
- }
- }
|