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 mapValue, Integer pageNum, Integer pageSize, Integer apiId) { List> listTotal = dilBatchService.getBatchList(mapValue); PageHelper.startPage(pageNum, pageSize); //分页查询数据 List> 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 mapValue, Integer pageNum, Integer pageSize, Integer apiId, String con) { if (mapValue==null){ mapValue=new HashMap<>(); } mapValue.put("con",con); List> listTotal = dilBatchService.getBatchListFortTransfer(mapValue); PageHelper.startPage(pageNum, pageSize); //分页查询数据 List> columnList = dilBatchService.getBatchListFortTransfer(mapValue); PageListAdd data = columnDataUtil.tableColumnData(apiId, listTotal, columnList); return success(data); } @PostMapping("/getBatchListForInstruction") public RESTfulResult getBatchListForInstruction(@RequestBody(required = false) Map mapValue, Integer pageNum, Integer pageSize, Integer apiId, String con) { if (mapValue==null){ mapValue=new HashMap<>(); } mapValue.put("con",con); List> listTotal = dilBatchService.getBatchListForInstruction(mapValue); PageHelper.startPage(pageNum, pageSize); //分页查询数据 List> 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 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> listTotal = dilBatchService.getBatchIdByForeign(mapValue); PageHelper.startPage(pageNum, pageSize); //分页查询数据 List> 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 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> listTotal = dilBatchService.findBatchForBind(map); PageHelper.startPage(pageNum, pageSize); //分页查询数据 List> 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 map) throws Exception { return success(dilBatchService.bindBatch(map)); } }