| | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.google.common.collect.ImmutableMap; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | |
| | | import com.ruoyi.system.model.TTemplateDetail; |
| | | import com.ruoyi.system.query.TemplateListQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.task.base.QuartzManager; |
| | | import com.ruoyi.system.task.base.TimeJobType; |
| | | import com.ruoyi.system.task.jobs.CreateInspectionJob; |
| | | import com.ruoyi.system.vo.system.TemplateDetailVO; |
| | | import com.ruoyi.system.vo.system.TemplateListVO; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | public R<PageInfo<TemplateListVO>> pageList(@RequestBody TemplateListQuery query) { |
| | | return R.ok(templateService.pageList(query)); |
| | | } |
| | | @ApiOperation(value = "任务模板不分页列表") |
| | | @PostMapping(value = "/listAllTemplate") |
| | | public R<List<TTemplate>> listAllTemplate() { |
| | | return R.ok(templateService.list()); |
| | | } |
| | | @ApiOperation(value = "点位类型不分页列表") |
| | | @PostMapping(value = "/listAll") |
| | | public R<List<TLocationType>> pageList() { |
| | |
| | | tTemplateDetail.setTemplateId(dto.getId()); |
| | | } |
| | | templateDetailService.saveBatch(list); |
| | | |
| | | // 计算定时任务时间周期 |
| | | |
| | | // 添加定时任务 |
| | | // Map<String, ? extends Object> maps = |
| | | // new ImmutableMap.Builder<String, String>(). |
| | | // put("id", dto.getId()) |
| | | // .build(); |
| | | // QuartzManager.addJob( |
| | | // CreateInspectionJob.class, |
| | | // (CreateInspectionJob.name+dto.getId()).toUpperCase(), |
| | | // TimeJobType.CREATE_INSPECTION, |
| | | // new Date(new Date().getTime()+48*60*60*1000L), |
| | | // maps |
| | | // ); |
| | | |
| | | return R.ok(); |
| | | } |
| | | @Log(title = "编辑任务模板", businessType = BusinessType.UPDATE) |
| | |
| | | templateDetailService.remove(new LambdaQueryWrapper<TTemplateDetail>() |
| | | .eq(TTemplateDetail::getTemplateId, dto.getId())); |
| | | templateDetailService.saveBatch(dto.getList()); |
| | | |
| | | // 先删除定时任务 |
| | | // QuartzManager.removeJob((CreateInspectionJob.name+dto.getId()).toUpperCase(),TimeJobType.CREATE_INSPECTION); |
| | | |
| | | // 添加定时任务 |
| | | // Map<String, ? extends Object> maps = |
| | | // new ImmutableMap.Builder<String, String>(). |
| | | // put("id", dto.getId()) |
| | | // .build(); |
| | | // QuartzManager.addJob( |
| | | // CreateInspectionJob.class, |
| | | // (CreateInspectionJob.name+dto.getId()).toUpperCase(), |
| | | // TimeJobType.CREATE_INSPECTION, |
| | | // new Date(new Date().getTime()+48*60*60*1000L), |
| | | // maps |
| | | // ); |
| | | |
| | | return R.ok(); |
| | | } |
| | | @Log(title = "批量删除任务模板", businessType = BusinessType.DELETE) |
| | |
| | | res.add(jsonObject); |
| | | } |
| | | String num4 = tTemplateDetail.getNum4(); |
| | | JSONObject jsonObject = JSONObject.parseObject(num4); |
| | | JSONArray num5Array = jsonObject.getJSONArray("num5"); |
| | | JSONArray num5Array = JSONArray.parseArray(num4); |
| | | for (Object o : num5Array) { |
| | | JSONObject jsonObject1 = (JSONObject) o; |
| | | String string = jsonObject1.getString("id"); |