123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- package com.steerinfo.dil.controller;
- 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.RmsCargodep;
- import com.steerinfo.dil.service.IRmsCargodepService;
- import io.swagger.annotations.ApiImplicitParam;
- import io.swagger.annotations.ApiImplicitParams;
- import io.swagger.annotations.ApiOperation;
- 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;
- /**
- * RmsCargodep RESTful接口:
- * @author generator
- * @version 1.0-SNAPSHORT 2022-05-07 12:00
- * 类描述
- * 修订历史:
- * 日期:2022-05-07
- * 作者:generator
- * 参考:
- * 描述:RmsCargodep RESTful接口
- * @see null
- * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
- */
- @RestController
- @RequestMapping("/${api.version}/rmscargodeps")
- public class RmsCargodepController extends BaseRESTfulController {
- @Autowired
- IRmsCargodepService rmsCargodepService;
- @Autowired
- ColumnDataUtil columnDataUtil;
- @ApiOperation(value="创建", notes="根据RmsCargoDep对象创建")
- @ApiImplicitParam(name = "RmsCargoDep", value = "详细实体RmsCargoDep", required = true, dataType = "RmsCargoDep")
- @PostMapping(value = "/insertCargoDep")
- public RESTfulResult insertCargoDep(@RequestBody(required = false) Map<String,Object> mapValue){
- int result = rmsCargodepService.insetCargoDep(mapValue);
- if (result == -1){
- return failed("系统已经存在该送达单位,请仔细查找");
- }
- return success(result);
- }
- @ApiOperation(value="获取详细信息", notes="根据url的id来获取详细信息")
- @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "BigDecimal")
- @PostMapping(value = "/getCargoDepById/{id}")
- public RESTfulResult getCargoDepById(@PathVariable("id") BigDecimal id){
- List<Map<String,Object>> list= rmsCargodepService.getCargoDepById(id);
- return success(list);
- }
- @ApiOperation(value="更新", notes="根据RmsCargoDep对象更新")
- @ApiImplicitParam(name = "RmsCargoDep", value = "详细实体RmsCargoDep", required = true, dataType = "RmsCargoDep")
- @PostMapping(value = "/updateCargoDep")
- public RESTfulResult updateCargoDep(@RequestBody(required = false) Map<String,Object> mapValue){
- int result = rmsCargodepService.updateCargoDep(mapValue);
- return success(result);
- }
- @ApiOperation(value="删除", notes="根据RmsCargoDep对象删除")
- @ApiImplicitParam(name = "RmsCargoDep", value = "详细实体RmsCargoDep", required = true, dataType = "RmsCargoDep")
- @PostMapping(value = "/deleteCargoDep")
- public RESTfulResult deleteCargoDep(@RequestBody(required = false) Map<String,Object> map){
- int result=rmsCargodepService.deleteCargoDep(map);
- return success(result);
- }
- @ApiImplicitParams({
- @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "apiId", value = "487", required = false, dataType = "BigDecimal"),
- })
- @PostMapping(value = "/getCargoDep")
- public RESTfulResult getCargoDep(@RequestBody(required = false) Map<String, Object> mapValue,
- Integer apiId,
- Integer pageNum,
- Integer pageSize,
- String con) {
- if (mapValue == null) {
- mapValue = new HashMap<>();
- }
- if (con != null && (con.equals("") || con.equals("undefined")) ) {
- con = null;
- }
- if (con != null && con.length() != 0) {
- mapValue.put("con","%" + con + "%");
- }
- PageHelper.startPage(pageNum, pageSize);
- //初始化过滤
- List<Map<String, Object>> columnList = rmsCargodepService.getCargoDepList(mapValue);
- PageListAdd data = columnDataUtil.tableColumnData(apiId, null, columnList);
- return success(data);
- }
- }
|