|
|
@ -1,6 +1,4 @@ |
|
|
|
package com.bweb.controller.item; |
|
|
|
package com.bweb.controller.item; |
|
|
|
|
|
|
|
|
|
|
|
import com.bweb.config.SysConst; |
|
|
|
|
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.hfkj.common.QRCodeGenerator; |
|
|
|
import com.hfkj.common.QRCodeGenerator; |
|
|
@ -9,12 +7,10 @@ import com.hfkj.common.exception.ErrorHelp; |
|
|
|
import com.hfkj.common.exception.SysCode; |
|
|
|
import com.hfkj.common.exception.SysCode; |
|
|
|
import com.hfkj.common.security.UserCenter; |
|
|
|
import com.hfkj.common.security.UserCenter; |
|
|
|
import com.hfkj.common.utils.ResponseMsgUtil; |
|
|
|
import com.hfkj.common.utils.ResponseMsgUtil; |
|
|
|
import com.hfkj.entity.EnTransportCompany; |
|
|
|
|
|
|
|
import com.hfkj.entity.EnTransportCompanyCar; |
|
|
|
import com.hfkj.entity.EnTransportCompanyCar; |
|
|
|
import com.hfkj.model.ResponseData; |
|
|
|
import com.hfkj.model.ResponseData; |
|
|
|
import com.hfkj.model.SecUserSessionObject; |
|
|
|
import com.hfkj.model.SecUserSessionObject; |
|
|
|
import com.hfkj.service.item.EnTransportCompanyCarService; |
|
|
|
import com.hfkj.service.item.EnTransportCompanyCarService; |
|
|
|
import com.hfkj.service.item.EnTransportCompanyService; |
|
|
|
|
|
|
|
import com.hfkj.sysenum.SecUserObjectTypeEnum; |
|
|
|
import com.hfkj.sysenum.SecUserObjectTypeEnum; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
@ -23,7 +19,6 @@ import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.stereotype.Controller; |
|
|
|
import org.springframework.stereotype.Controller; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
@ -33,6 +28,7 @@ import java.util.Map; |
|
|
|
@RequestMapping(value="/enTransportCompanyCar") |
|
|
|
@RequestMapping(value="/enTransportCompanyCar") |
|
|
|
@Api(value="运输公司车辆管理") |
|
|
|
@Api(value="运输公司车辆管理") |
|
|
|
public class EnTransportCompanyCarController { |
|
|
|
public class EnTransportCompanyCarController { |
|
|
|
|
|
|
|
|
|
|
|
Logger log = LoggerFactory.getLogger(EnTransportCompanyCarController.class); |
|
|
|
Logger log = LoggerFactory.getLogger(EnTransportCompanyCarController.class); |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private UserCenter userCenter; |
|
|
|
private UserCenter userCenter; |
|
|
@ -63,6 +59,24 @@ public class EnTransportCompanyCarController { |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询车牌号是否相同
|
|
|
|
|
|
|
|
Map<String , Object> map = new HashMap<>(); |
|
|
|
|
|
|
|
map.put("carNo" , body.getCarNo()); |
|
|
|
|
|
|
|
EnTransportCompanyCar car = enTransportCompanyCarService.queryDetailByMap(map); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (car != null) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "车牌号已存在"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询设备编号是否相同
|
|
|
|
|
|
|
|
Map<String , Object> map2 = new HashMap<>(); |
|
|
|
|
|
|
|
map2.put("deviceCode", body.getDeviceCode()); |
|
|
|
|
|
|
|
EnTransportCompanyCar car2 = enTransportCompanyCarService.queryDetailByMap(map2); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (car2 != null) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "设备编号已存在"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
body.setUpdateTime(new Date()); |
|
|
|
body.setUpdateTime(new Date()); |
|
|
|
body.setCreateTime(new Date()); |
|
|
|
body.setCreateTime(new Date()); |
|
|
|
body.setCreateUser(sessionModel.getAccount().getId()); |
|
|
|
body.setCreateUser(sessionModel.getAccount().getId()); |
|
|
|