|
|
|
@ -29,6 +29,7 @@ import javax.annotation.Resource; |
|
|
|
|
import java.math.BigDecimal; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
@Controller |
|
|
|
@ -50,6 +51,7 @@ public class EnOilManagementController { |
|
|
|
|
public ResponseData oilInOutRecord(@RequestBody EnOilManagement body) { |
|
|
|
|
try { |
|
|
|
|
if (body == null |
|
|
|
|
|| body.getNum() == null |
|
|
|
|
|| body.getType() == null |
|
|
|
|
|| body.getOilType() == null |
|
|
|
|
|| StringUtils.isBlank(body.getRemark()) |
|
|
|
@ -67,9 +69,7 @@ public class EnOilManagementController { |
|
|
|
|
|
|
|
|
|
// 当类型为出库
|
|
|
|
|
if (body.getType() == 1) { |
|
|
|
|
if (body.getOutQuantity() == null |
|
|
|
|
|| body.getOutQuantity().compareTo(BigDecimal.ZERO) <= 0 |
|
|
|
|
|| body.getTransportCarId() == null |
|
|
|
|
if ( body.getTransportCarId() == null |
|
|
|
|
){ |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
|
} |
|
|
|
@ -80,9 +80,7 @@ public class EnOilManagementController { |
|
|
|
|
|
|
|
|
|
// 当类型为入库
|
|
|
|
|
if (body.getType() == 2) { |
|
|
|
|
if (body.getInQuantity() == null |
|
|
|
|
|| body.getInQuantity().compareTo(BigDecimal.ZERO) <= 0 |
|
|
|
|
|| body.getTransportCarNo() == null |
|
|
|
|
if ( body.getTransportCarNo() == null |
|
|
|
|
|| StringUtils.isBlank(body.getSupplier()) |
|
|
|
|
){ |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
@ -131,7 +129,7 @@ public class EnOilManagementController { |
|
|
|
|
param.put("status", status); |
|
|
|
|
|
|
|
|
|
PageHelper.startPage(pageNum, pageSize); |
|
|
|
|
return ResponseMsgUtil.success(new PageInfo<>(enTransportCompanyCarService.getList(param))); |
|
|
|
|
return ResponseMsgUtil.success(new PageInfo<>(enOilManagementService.getList(param))); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
@ -139,4 +137,29 @@ public class EnOilManagementController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/queryCarList",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "查询车辆列表") |
|
|
|
|
public ResponseData queryCarList(@RequestParam(value = "carNo" , required = false) String carNo) { |
|
|
|
|
try { |
|
|
|
|
SecUserSessionObject sessionModel = userCenter.getSessionModel(SecUserSessionObject.class); |
|
|
|
|
if (sessionModel == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, ""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Map<String,Object> param = new HashMap<>(); |
|
|
|
|
param.put("carNo", carNo); |
|
|
|
|
param.put("status", 1); |
|
|
|
|
|
|
|
|
|
List<EnTransportCompanyCar> list = enTransportCompanyCarService.getList(param); |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(list); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("error!",e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|