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 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> 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 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 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 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> columnList = rmsCargodepService.getCargoDepList(mapValue); PageListAdd data = columnDataUtil.tableColumnData(apiId, null, columnList); return success(data); } }