| | |
| | | import cc.mrbird.febs.common.controller.BaseController; |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.utils.FebsUtil; |
| | | import cc.mrbird.febs.dapp.entity.DataDictionaryCustom; |
| | | import cc.mrbird.febs.dapp.entity.IgtOnHookPlanOrder; |
| | | import cc.mrbird.febs.dapp.entity.MallNewsInfo; |
| | | import cc.mrbird.febs.dapp.enumerate.DataDictionaryEnum; |
| | | import cc.mrbird.febs.dapp.mapper.DataDictionaryCustomMapper; |
| | | import cc.mrbird.febs.dapp.service.AdminOnHookPlanService; |
| | | import cc.mrbird.febs.dapp.service.IMallNewsInfoService; |
| | | import cc.mrbird.febs.dapp.vo.AdminPlanSetVo; |
| | | import cc.mrbird.febs.dapp.vo.AdminTransferInsideSetVo; |
| | | import cc.mrbird.febs.system.entity.User; |
| | | import cc.mrbird.febs.system.service.IUserService; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | |
| | | public class AdminOnHookPlanController extends BaseController { |
| | | |
| | | private final AdminOnHookPlanService adminOnHookPlanService; |
| | | private final IUserService userService; |
| | | private final DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | |
| | | /** |
| | | * 挂机-列表 |
| | |
| | | */ |
| | | @GetMapping("getplanList") |
| | | public FebsResponse getplanList(IgtOnHookPlanOrder igtOnHookPlanOrder, QueryRequest request) { |
| | | User currentUser = FebsUtil.getCurrentUser(); |
| | | User currentUserDetail = userService.findByName(currentUser.getUsername()); |
| | | if(ObjectUtil.isNotEmpty(currentUserDetail.getDescription())){ |
| | | igtOnHookPlanOrder.setDescription(currentUser.getDescription()); |
| | | } |
| | | Map<String, Object> data = getDataTable(adminOnHookPlanService.getplanList(igtOnHookPlanOrder, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * 挂机-列表-流水详情 |
| | | * @return |
| | | */ |
| | | @GetMapping("getFlowList") |
| | | public FebsResponse getFlowList(IgtOnHookPlanOrder igtOnHookPlanOrder, QueryRequest request, Integer parentId) { |
| | | if (parentId == null) { |
| | | ViewOnHookPlanController.idOrderFlow = 0; |
| | | } |
| | | User currentUser = FebsUtil.getCurrentUser(); |
| | | User currentUserDetail = userService.findByName(currentUser.getUsername()); |
| | | if(ObjectUtil.isNotEmpty(currentUserDetail.getDescription())){ |
| | | igtOnHookPlanOrder.setDescription(currentUser.getDescription()); |
| | | } |
| | | Map<String, Object> data = getDataTable(adminOnHookPlanService.getFlowList(ViewOnHookPlanController.idOrderFlow, request)); |
| | | return new FebsResponse().success().data(data); |
| | | } |
| | | |
| | | /** |
| | | * IGT挂机时间规则 -- 更新 |
| | | */ |
| | | @PostMapping(value = "/setPlan") |
| | | public FebsResponse setPlan(AdminPlanSetVo adminPlanSetVo) { |
| | | if(StrUtil.isEmpty(adminPlanSetVo.getMaxHours())){ |
| | | return new FebsResponse().fail().message("请输入持续挂机时长"); |
| | | } |
| | | if(StrUtil.isEmpty(adminPlanSetVo.getStartTime())){ |
| | | return new FebsResponse().fail().message("请输入挂机开始时间"); |
| | | } |
| | | if(StrUtil.isEmpty(adminPlanSetVo.getEndTime())){ |
| | | return new FebsResponse().fail().message("请输入挂机结束时间"); |
| | | } |
| | | String maxHours = adminPlanSetVo.getMaxHours(); |
| | | DataDictionaryCustom maxHoursDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.MAX_HOURS.getType(), DataDictionaryEnum.MAX_HOURS.getCode()); |
| | | maxHoursDic.setValue(maxHours); |
| | | dataDictionaryCustomMapper.updateById(maxHoursDic); |
| | | |
| | | String startTime = adminPlanSetVo.getStartTime(); |
| | | DataDictionaryCustom startTimeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.START_TIME.getType(), DataDictionaryEnum.START_TIME.getCode()); |
| | | startTimeDic.setValue(startTime); |
| | | dataDictionaryCustomMapper.updateById(startTimeDic); |
| | | |
| | | String endTime = adminPlanSetVo.getEndTime(); |
| | | DataDictionaryCustom endTimeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.END_TIME.getType(), DataDictionaryEnum.END_TIME.getCode()); |
| | | endTimeDic.setValue(endTime); |
| | | dataDictionaryCustomMapper.updateById(endTimeDic); |
| | | |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | } |