提交代码

dev
胡锐 5 months ago
parent 80bb643c6c
commit 44a8924439
  1. 8
      bweb/src/main/java/com/bweb/controller/BsGasClassGroupController.java
  2. 94
      bweb/src/main/java/com/bweb/controller/BsGasClassGroupTaskController.java
  3. 4
      service/src/main/java/com/hfkj/dao/BsGasClassGroupTaskMapperExt.java
  4. 4
      service/src/main/java/com/hfkj/service/gas/impl/BsGasClassGroupTaskServiceImpl.java

@ -64,8 +64,8 @@ public class BsGasClassGroupController {
try {
SecUserSessionObject userInfoModel = userCenter.getSessionModel(SecUserSessionObject.class);
if (userInfoModel == null
|| userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR);
|| !userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS);
}
if (body == null
|| StringUtils.isBlank(body.getString("name"))
@ -163,7 +163,7 @@ public class BsGasClassGroupController {
Map<String,Object> param = new HashMap<>();
if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) {
param.put("merchantStoreId", userInfoModel.getAccount().getObjectId());
param.put("merId", userInfoModel.getAccount().getObjectId());
} else if (userInfoModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type3.getCode())) {
// 查询油站工作人员
@ -171,7 +171,7 @@ public class BsGasClassGroupController {
if (gasStaff == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
param.put("merchantStoreId", gasStaff.getMerId());
param.put("merId", gasStaff.getMerId());
}
param.put("name", name);
param.put("principalName", principalName);

@ -62,11 +62,31 @@ public class BsGasClassGroupTaskController {
@ApiOperation(value = "开启班组任务")
public ResponseData startGroupTask(@RequestBody JSONObject body) {
try {
if (body == null || body.getLong("gasId") == null || body.getLong("gasClassGroupId") == null) {
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);
}
if (body == null || body.getLong("gasClassGroupId") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
gasClassGroupTaskService.startGroupTask(body.getLong("gasId"), body.getLong("gasClassGroupId"));
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();
}
gasClassGroupTaskService.startGroupTask(gasId, body.getLong("gasClassGroupId"));
return ResponseMsgUtil.success("操作成功");
@ -79,13 +99,28 @@ public class BsGasClassGroupTaskController {
@RequestMapping(value = "/endGroupTask", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "结束班组任务")
public ResponseData endGroupTask(@RequestBody JSONObject body) {
public ResponseData endGroupTask() {
try {
if (body == null || body.getLong("gasId") == 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();
gasClassGroupTaskService.endGroupTask(body.getLong("gasId"));
} 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);
return ResponseMsgUtil.success("操作成功");
@ -100,11 +135,30 @@ public class BsGasClassGroupTaskController {
@ApiOperation(value = "交换班组任务")
public ResponseData swapGroupTask(@RequestBody JSONObject body) {
try {
if (body == null || body.getLong("gasId") == null || body.getLong("gasClassGroupId") == null) {
if (body == null || body.getLong("gasClassGroupId") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
gasClassGroupTaskService.swapGroupTask(body.getLong("gasId"), body.getLong("gasClassGroupId"));
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();
}
gasClassGroupTaskService.swapGroupTask(gasId, body.getLong("gasClassGroupId"));
return ResponseMsgUtil.success("操作成功");
@ -117,15 +171,31 @@ public class BsGasClassGroupTaskController {
@RequestMapping(value = "/getCurrentClassGroupTask", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询当前班次")
public ResponseData getCurrentClassGroupTask(@RequestParam(name = "gasId", required = true) Long gasId) {
public ResponseData getCurrentClassGroupTask(@RequestParam(name = "gasId", required = false) Long gasId) {
try {
SecUserSessionObject userInfoModel = userCenter.getSessionModel(SecUserSessionObject.class);
if (userInfoModel == null) {
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();
}
GasClassGroupTaskDataCount dataCount;
Map<String,Object> param = new HashMap<>();
param.put("merchantStoreId", gasId);
param.put("merId", gasId);
param.put("status", GasClassGroupTaskStatus.status1.getStatus());
List<BsGasClassGroupTask> list = gasClassGroupTaskService.getGroupTaskList(param);
if (list.size() > 0) {
if (!list.isEmpty()) {
dataCount = gasClassGroupTaskService.countGroupTaskData(gasId,
list.get(0).getClassNum(),
list.get(0).getId(),

@ -49,11 +49,11 @@ public interface BsGasClassGroupTaskMapperExt {
" from bs_gas_order a" +
" where a.gas_class_group_task_id = #{gasClassGroupTaskId} and a.status in (4)" +
" GROUP BY a.gas_oil_no) b on b.gas_oil_no = a.oil_no" +
" WHERE a.merchant_store_id = #{gasId} and <![CDATA[ `status` <> 0 ]]> " +
" WHERE a.mer_id = #{gasId} and <![CDATA[ `status` <> 0 ]]> " +
"</script>")
List<Map<String, Object>> countOilData(@Param("gasId") Long gasId, @Param("gasClassGroupTaskId") Long gasClassGroupTaskId);
@Select("select count(1) from bs_gas_class_group_task where merchant_store_id = #{gasId} and `status` <> 0")
@Select("select count(1) from bs_gas_class_group_task where mer_id = #{gasId} and `status` <> 0")
int getLatestClassNum(@Param("gasId") Long gasId);
}

@ -55,7 +55,7 @@ public class BsGasClassGroupTaskServiceImpl implements BsGasClassGroupTaskServic
// 查询进行中的任务
Map<String, Object> param = new HashMap<>();
param.put("merchantStoreId", merchant.getId());
param.put("merId", merchant.getId());
param.put("status", GasClassGroupTaskStatus.status1.getStatus());
List<BsGasClassGroupTask> list = getGroupTaskList(param);
if (!list.isEmpty()) {
@ -82,7 +82,7 @@ public class BsGasClassGroupTaskServiceImpl implements BsGasClassGroupTaskServic
public void endGroupTask(Long gasId) {
// 查询进行中的任务
Map<String, Object> param = new HashMap<>();
param.put("merchantStoreId", gasId);
param.put("merId", gasId);
param.put("status", GasClassGroupTaskStatus.status1.getStatus());
List<BsGasClassGroupTask> list = getGroupTaskList(param);
if (!list.isEmpty()) {

Loading…
Cancel
Save