123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206 |
- package com.steerinfo.dil.controller;
- import com.alibaba.fastjson.JSON;
- import com.steerinfo.dil.feign.ESFeign;
- 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 com.steerinfo.framework.service.pagehelper.PageList;
- import com.steerinfo.framework.utils.collection.ListUtils;
- import com.steerinfo.dil.model.DilBatch;
- import com.steerinfo.dil.service.IDilBatchService;
- import io.swagger.annotations.ApiImplicitParam;
- import io.swagger.annotations.ApiImplicitParams;
- import io.swagger.annotations.ApiOperation;
- import org.apache.commons.lang3.AnnotationUtils;
- import org.apache.commons.lang3.StringUtils;
- import org.apache.shiro.authz.annotation.RequiresPermissions;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import java.util.*;
- import java.math.BigDecimal;
- /**
- * DilBatch RESTful接口:
- * @author generator
- * @version 1.0-SNAPSHORT 2021-11-06 10:22
- * 类描述
- * 修订历史:
- * 日期:2021-11-06
- * 作者:generator
- * 参考:
- * 描述:DilBatch RESTful接口
- * @see null
- * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
- */
- @RestController
- @RequestMapping("/${api.version}/dilbatchs")
- public class DilBatchController extends BaseRESTfulController {
- @Autowired
- IDilBatchService dilBatchService;
- @Autowired
- ESFeign esFeign;
- @Autowired
- ColumnDataUtil columnDataUtil;
- @ApiOperation(value="批次展示列表", notes="分页查询")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "apiId", value = "375", required = false, dataType = "Integer")
- })
- @PostMapping("/getBatchList")
- public RESTfulResult getBatchList(@RequestBody(required = false) Map<String, Object> mapValue,
- Integer pageNum,
- Integer pageSize,
- Integer apiId) {
- List<Map<String, Object>> listTotal = dilBatchService.getBatchList(mapValue);
- PageHelper.startPage(pageNum, pageSize);
- //分页查询数据
- List<Map<String, Object>> columnList = dilBatchService.getBatchList(mapValue);
- PageListAdd data = columnDataUtil.tableColumnData(apiId, listTotal, columnList);
- return success(data);
- }
- @ApiOperation(value="为提货委托查询批次展示列表", notes="分页查询")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "apiId", value = "375", required = false, dataType = "Integer")
- })
- @PostMapping("/getBatchListForAttorney")
- public RESTfulResult getBatchListForAttorney(@RequestBody(required = false) Map<String, Object> mapValue,
- Integer pageNum,
- Integer pageSize,
- Integer apiId,
- String con) {
- if (mapValue==null){
- mapValue=new HashMap<>();
- }
- mapValue.put("con",con);
- List<Map<String, Object>> listTotal = dilBatchService.getBatchListFortTransfer(mapValue);
- PageHelper.startPage(pageNum, pageSize);
- //分页查询数据
- List<Map<String, Object>> columnList = dilBatchService.getBatchListFortTransfer(mapValue);
- PageListAdd data = columnDataUtil.tableColumnData(apiId, listTotal, columnList);
- return success(data);
- }
- @PostMapping("/getBatchListForInstruction")
- public RESTfulResult getBatchListForInstruction(@RequestBody(required = false) Map<String, Object> mapValue,
- Integer pageNum,
- Integer pageSize,
- Integer apiId,
- String con) {
- if (mapValue==null){
- mapValue=new HashMap<>();
- }
- mapValue.put("con",con);
- List<Map<String, Object>> listTotal = dilBatchService.getBatchListForInstruction(mapValue);
- PageHelper.startPage(pageNum, pageSize);
- //分页查询数据
- List<Map<String, Object>> columnList = dilBatchService.getBatchListForInstruction(mapValue);
- PageListAdd data = columnDataUtil.tableColumnData(apiId, listTotal, columnList);
- return success(data);
- }
- @ApiOperation(value="查询批次列表", notes="分页查询")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "apiId", value = "489", required = false, dataType = "Integer")
- })
- @PostMapping("/getBatchIdByForeign")
- public RESTfulResult getBatchIdByForeign(@RequestBody(required = false) Map<String, Object> mapValue,
- Integer pageNum,
- Integer pageSize,
- Integer apiId,
- String con) {
- if (mapValue==null){
- mapValue=new HashMap<>();
- }
- if (con!=null&&!"null".equals(con)){
- mapValue.put("con",con);
- }
- List<Map<String, Object>> listTotal = dilBatchService.getBatchIdByForeign(mapValue);
- PageHelper.startPage(pageNum, pageSize);
- //分页查询数据
- List<Map<String, Object>> columnList = dilBatchService.getBatchIdByForeign(mapValue);
- PageListAdd data = columnDataUtil.tableColumnData(apiId, listTotal, columnList);
- return success(data);
- }
- // 根据索引模糊查询外轮船名
- @ApiOperation(value="根据用户输入输出船名", notes="模糊查询")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "con",value = "用户输入的江船名", required = false, dataType = "String")
- })
- @PostMapping("/getShipNameList")
- public RESTfulResult getShipNameList(@RequestParam(value ="state") String state){
- return success(dilBatchService.getShipNameList(state));
- }
- //根据用户输入提货联系人模糊查询提货联系人、提货人身份证号、联系电话
- @ApiOperation(value="根据用户输入提货联系人模糊查询提货联系人", notes="模糊查询")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "con",value = "用户输入的联系人", required = false, dataType = "String")
- })
- @PostMapping("/getPersonByName")
- public RESTfulResult getPersonByName(@RequestParam(value ="personName")String personName){
- return success(dilBatchService.getPersonByName(personName));
- }
- //根据用户输入提货联系人模糊查询提货联系人、提货人身份证号、联系电话
- @ApiOperation(value="根据用户在发货通知输入的提货联系人模糊查询提货联系人", notes="模糊查询")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "con",value = "用户输入的联系人", required = false, dataType = "String")
- })
- @PostMapping("/getNoticeContactNumberByPerson")
- public RESTfulResult getNoticeContactNumberByPerson(@RequestParam(value ="personName")String personName){
- return success(dilBatchService.getNoticeContactNumberByPerson(personName));
- }
- @ApiOperation(value="采购绑定批次查询", notes="模糊查询")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "apiId",value = "用户输入的联系人", required = false, dataType = "Integer")
- })
- @PostMapping("/findBatchForBind")
- public RESTfulResult findBatchForBind(@RequestBody(required = false) Map<String, Object> map,
- Integer pageNum,
- Integer pageSize,
- Integer apiId,
- String materialName,
- String foreignShipName
- ){
- if(materialName!=null)
- map.put("materialName",materialName);
- if(foreignShipName!=null)
- map.put("foreignShipName",foreignShipName);
- List<Map<String, Object>> listTotal = dilBatchService.findBatchForBind(map);
- PageHelper.startPage(pageNum, pageSize);
- //分页查询数据
- List<Map<String, Object>> columnList = dilBatchService.findBatchForBind(map);
- PageListAdd data = columnDataUtil.tableColumnData(apiId, listTotal, columnList);
- return success(data);
- }
- @ApiOperation(value="修改绑定批次", notes="模糊查询")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "apiId",value = "用户输入的联系人", required = false, dataType = "Integer")
- })
- @PostMapping("/bindBatch")
- public RESTfulResult bindBatch(@RequestBody(required = false) Map<String, Object> map) throws Exception {
- return success(dilBatchService.bindBatch(map));
- }
- }
|