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