|
|
@@ -1,16 +1,20 @@
|
|
|
package com.aoyang.tms.controller;
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.aoyang.tms.common.ErrCodeEnum;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.*;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+
|
|
|
import java.util.*;
|
|
|
import javax.annotation.Resource;
|
|
|
-import com.aoyang.tms.service.TruckDeptService;
|
|
|
-import com.aoyang.tms.entity.TruckDept;
|
|
|
+
|
|
|
+import com.aoyang.tms.service.TruckDeptService;
|
|
|
+import com.aoyang.tms.entity.TruckDept;
|
|
|
import com.aoyang.common.result.Result;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
@@ -20,8 +24,8 @@ import com.aoyang.common.param.PageParam;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
|
- * 运力部门管理表 控制器
|
|
|
- * </p>
|
|
|
+ * 运力部门管理表 控制器
|
|
|
+ * </p>
|
|
|
*
|
|
|
* @author guoyong
|
|
|
* @since 2022-04-20
|
|
|
@@ -35,25 +39,31 @@ public class TruckDeptController {
|
|
|
@Resource
|
|
|
private TruckDeptService truckDeptService;
|
|
|
|
|
|
- @ApiOperation(value = "获取truck_dept列表",notes="")
|
|
|
- @PostMapping("/list")
|
|
|
- public Result list(@RequestBody PageParam<TruckDept> pageParam) {
|
|
|
- Page<TruckDept> page = new Page<>(pageParam.getPage(), pageParam.getSize());
|
|
|
- IPage<TruckDept> records = truckDeptService.page(page, Wrappers.query(pageParam.getParam()));
|
|
|
- return new Result<>(records);
|
|
|
+ @ApiOperation(value = "获取运力部门管理分页列表", notes = "")
|
|
|
+ @PostMapping("/page_list")
|
|
|
+ public Result pageList(@RequestBody PageParam<TruckDept> pageParam) {
|
|
|
+ log.info("获取运力部门管理分页列表,调用/tms/truck_dept/page_list,参数:{}", JSON.toJSONString(pageParam));
|
|
|
+ if (pageParam == null || pageParam.getParam() == null || pageParam.getParam().getOrgId() == null) {
|
|
|
+ return new Result<>(ErrCodeEnum.BAD_PARAM.getCode(), ErrCodeEnum.BAD_PARAM.getMessage());
|
|
|
+ }
|
|
|
+ return new Result<>(truckDeptService.findPage(pageParam));
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "修改truck_dept",notes="根据id修改truck_dept")
|
|
|
+ @ApiOperation(value = "修改truck_dept", notes = "根据id修改truck_dept")
|
|
|
@PostMapping("/update")
|
|
|
public Result update(@RequestBody TruckDept truckDept) {
|
|
|
Boolean flag = truckDeptService.updateById(truckDept);
|
|
|
return new Result<>(flag);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "添加truck_dept",notes="新增一条truck_dept")
|
|
|
+ @ApiOperation(value = "新增运力部门", notes = "新增一条truck_dept")
|
|
|
@PostMapping("/add")
|
|
|
- public Result add(@RequestBody TruckDept truckDept) {
|
|
|
- Boolean flag = truckDeptService.save(truckDept);
|
|
|
+ public Result add(@RequestBody TruckDept param) {
|
|
|
+ log.info("新增运力部门,调用/tms/truck_dept/add,参数:{}", JSON.toJSONString(param));
|
|
|
+ if (param == null || param.getOrgId() == null || param.getName() == null || param.getOrgName() == null || param.getOrgShortName() == null) {
|
|
|
+ return new Result<>(ErrCodeEnum.BAD_PARAM.getCode(), ErrCodeEnum.BAD_PARAM.getMessage());
|
|
|
+ }
|
|
|
+ Boolean flag = truckDeptService.save(param);
|
|
|
return new Result<>(flag);
|
|
|
}
|
|
|
}
|