|
|
|
@ -72,18 +72,10 @@ public class BsGasClassGroupTaskController { |
|
|
|
|
if (body == null || body.getLong("gasClassGroupId") == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Long gasId = null; |
|
|
|
|
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) { |
|
|
|
|
gasId = userInfoModel.getAccount().getObjectId(); |
|
|
|
|
|
|
|
|
|
} else if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) { |
|
|
|
|
// 查询油站工作人员
|
|
|
|
|
BsGasStaff gasStaff = gasStaffService.getStaffDetailById(userInfoModel.getAccount().getObjectId()); |
|
|
|
|
if (gasStaff == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
|
} |
|
|
|
|
gasId = gasStaff.getMerId(); |
|
|
|
|
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode()) |
|
|
|
|
|| userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) { |
|
|
|
|
gasId = userInfoModel.getMerchant().getId(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
gasClassGroupTaskService.startGroupTask(gasId, body.getLong("gasClassGroupId")); |
|
|
|
@ -102,22 +94,10 @@ public class BsGasClassGroupTaskController { |
|
|
|
|
public ResponseData endGroupTask() { |
|
|
|
|
try { |
|
|
|
|
SecUserSessionObject userInfoModel = userCenter.getSessionModel(SecUserSessionObject.class); |
|
|
|
|
if (userInfoModel == null || |
|
|
|
|
(!userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode()) |
|
|
|
|
&& !userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode()))) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS); |
|
|
|
|
} |
|
|
|
|
Long gasId = null; |
|
|
|
|
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) { |
|
|
|
|
gasId = userInfoModel.getAccount().getObjectId(); |
|
|
|
|
|
|
|
|
|
} else if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) { |
|
|
|
|
// 查询油站工作人员
|
|
|
|
|
BsGasStaff gasStaff = gasStaffService.getStaffDetailById(userInfoModel.getAccount().getObjectId()); |
|
|
|
|
if (gasStaff == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
|
} |
|
|
|
|
gasId = gasStaff.getMerId(); |
|
|
|
|
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode()) |
|
|
|
|
|| userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) { |
|
|
|
|
gasId = userInfoModel.getMerchant().getId(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
gasClassGroupTaskService.endGroupTask(gasId); |
|
|
|
@ -138,24 +118,11 @@ public class BsGasClassGroupTaskController { |
|
|
|
|
if (body == null || body.getLong("gasClassGroupId") == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
SecUserSessionObject userInfoModel = userCenter.getSessionModel(SecUserSessionObject.class); |
|
|
|
|
if (userInfoModel == null || |
|
|
|
|
(!userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode()) |
|
|
|
|
&& !userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode()))) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS); |
|
|
|
|
} |
|
|
|
|
Long gasId = null; |
|
|
|
|
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) { |
|
|
|
|
gasId = userInfoModel.getAccount().getObjectId(); |
|
|
|
|
|
|
|
|
|
} else if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) { |
|
|
|
|
// 查询油站工作人员
|
|
|
|
|
BsGasStaff gasStaff = gasStaffService.getStaffDetailById(userInfoModel.getAccount().getObjectId()); |
|
|
|
|
if (gasStaff == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
|
} |
|
|
|
|
gasId = gasStaff.getMerId(); |
|
|
|
|
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode()) |
|
|
|
|
|| userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) { |
|
|
|
|
gasId = userInfoModel.getMerchant().getId(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
gasClassGroupTaskService.swapGroupTask(gasId, body.getLong("gasClassGroupId")); |
|
|
|
@ -178,18 +145,12 @@ public class BsGasClassGroupTaskController { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS); |
|
|
|
|
} |
|
|
|
|
Map<String,Object> param = new HashMap<>(); |
|
|
|
|
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) { |
|
|
|
|
gasId = userInfoModel.getAccount().getObjectId(); |
|
|
|
|
|
|
|
|
|
} else if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) { |
|
|
|
|
// 查询油站工作人员
|
|
|
|
|
BsGasStaff gasStaff = gasStaffService.getStaffDetailById(userInfoModel.getAccount().getObjectId()); |
|
|
|
|
if (gasStaff == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
|
} |
|
|
|
|
gasId = gasStaff.getMerId(); |
|
|
|
|
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode()) |
|
|
|
|
|| userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) { |
|
|
|
|
gasId = userInfoModel.getMerchant().getId(); |
|
|
|
|
} else { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
GasClassGroupTaskDataCount dataCount; |
|
|
|
|
|
|
|
|
|
param.put("merId", gasId); |
|
|
|
@ -253,15 +214,9 @@ public class BsGasClassGroupTaskController { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, ""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) { |
|
|
|
|
param.put("merchantStoreId", userInfoModel.getAccount().getObjectId()); |
|
|
|
|
} else if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) { |
|
|
|
|
// 查询油站工作人员
|
|
|
|
|
BsGasStaff gasStaff = gasStaffService.getStaffDetailById(userInfoModel.getAccount().getObjectId()); |
|
|
|
|
if (gasStaff == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
|
} |
|
|
|
|
param.put("merchantStoreId", gasStaff.getMerId()); |
|
|
|
|
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode()) |
|
|
|
|
|| userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) { |
|
|
|
|
param.put("merId", userInfoModel.getMerchant().getId()); |
|
|
|
|
} else { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); |
|
|
|
|
} |
|
|
|
|