|
@@ -1,23 +1,26 @@
|
|
|
package com.steerinfo.baseinfo.meterbasedriver.controller;
|
|
package com.steerinfo.baseinfo.meterbasedriver.controller;
|
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
+import com.steerinfo.baseinfo.meterbasecussupcar.model.MeterBaseCusSupCar;
|
|
|
import com.steerinfo.framework.controller.BaseRESTfulController;
|
|
import com.steerinfo.framework.controller.BaseRESTfulController;
|
|
|
import com.steerinfo.framework.controller.RESTfulResult;
|
|
import com.steerinfo.framework.controller.RESTfulResult;
|
|
|
import com.steerinfo.framework.service.pagehelper.PageList;
|
|
import com.steerinfo.framework.service.pagehelper.PageList;
|
|
|
|
|
+import com.steerinfo.framework.user.UserPayload;
|
|
|
import com.steerinfo.framework.utils.collection.ListUtils;
|
|
import com.steerinfo.framework.utils.collection.ListUtils;
|
|
|
import com.steerinfo.baseinfo.meterbasedriver.model.MeterBaseDriver;
|
|
import com.steerinfo.baseinfo.meterbasedriver.model.MeterBaseDriver;
|
|
|
import com.steerinfo.baseinfo.meterbasedriver.service.IMeterBaseDriverService;
|
|
import com.steerinfo.baseinfo.meterbasedriver.service.IMeterBaseDriverService;
|
|
|
|
|
+import com.steerinfo.util.StringUtils;
|
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
-import java.util.Arrays;
|
|
|
|
|
-import java.util.HashMap;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
|
|
|
+import java.util.*;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -35,6 +38,7 @@ import java.math.BigDecimal;
|
|
|
*/
|
|
*/
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("/${api.version}/meterbasedrivers")
|
|
@RequestMapping("/${api.version}/meterbasedrivers")
|
|
|
|
|
+@Api(value = "/${api.version}/meterbasedrivers", tags = "司机信息 - MeterBaseDriverController")
|
|
|
public class MeterBaseDriverController extends BaseRESTfulController {
|
|
public class MeterBaseDriverController extends BaseRESTfulController {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -66,11 +70,22 @@ public class MeterBaseDriverController extends BaseRESTfulController {
|
|
|
|
|
|
|
|
@ApiOperation(value="创建", notes="根据MeterBaseDriver对象创建")
|
|
@ApiOperation(value="创建", notes="根据MeterBaseDriver对象创建")
|
|
|
@ApiImplicitParam(name = "meterBaseDriver", value = "详细实体meterBaseDriver", required = true, dataType = "MeterBaseDriver")
|
|
@ApiImplicitParam(name = "meterBaseDriver", value = "详细实体meterBaseDriver", required = true, dataType = "MeterBaseDriver")
|
|
|
|
|
+ @Transactional
|
|
|
//@RequiresPermissions("meterbasedriver:create")
|
|
//@RequiresPermissions("meterbasedriver:create")
|
|
|
@PostMapping(value = "/")
|
|
@PostMapping(value = "/")
|
|
|
public RESTfulResult add(@ModelAttribute MeterBaseDriver model){
|
|
public RESTfulResult add(@ModelAttribute MeterBaseDriver model){
|
|
|
- MeterBaseDriver meterBaseDriver = meterBaseDriverService.add(model);
|
|
|
|
|
- return success(meterBaseDriver);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ String msg = meterBaseDriverService.checkandadd(model);
|
|
|
|
|
+ if (StringUtils.isNotEmpty(msg)) {
|
|
|
|
|
+ return failed(null, msg);
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
|
|
+ return failed(null, "操作异常,请确认!");
|
|
|
|
|
+ }
|
|
|
|
|
+ return success();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@ApiOperation(value="获取详细信息", notes="根据url的id来获取详细信息")
|
|
@ApiOperation(value="获取详细信息", notes="根据url的id来获取详细信息")
|