软件适配器-定时适配任务

yun-zuoyi
汪云昊 6 years ago
parent c73e81234f
commit 4d4b977f13

@ -77,4 +77,12 @@ public interface ISysTaskService {
*/
@ApiOperation(value = "任务管理复杂查询,分页,排序",notes = "任务管理复杂查询,分页,排序")
ListPager<SysTask> querySysTaskByPager(SysTask sysTask, Pager pager);
/**
* code
* @param code
* @return
*/
@ApiOperation(value = "根据code查询任务",notes = "根据code查询任务")
SysTask getSysTaskByCode(String code);
}

@ -245,4 +245,25 @@ public class SysTaskController extends CoreBaseController {
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
/**
* code
* @return
*/
@GetMapping(value = "/get-code")
@ApiOperation(value = "根据code查询任务", notes = "根据code查询任务")
public ResultBean<SysTask> getSysTaskByCode(String code) {
try {
ValidatorBean.checkNotNull(code, "任务代码不能为空");
SysTask sysTask = sysTaskService.getSysTaskByCode(code);
return ResultBean.success("操作成功")
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode())
.setResultObject(sysTask);
} catch (ImppBusiException busExcep) {
return ResultBean.fail(busExcep);
} catch (Exception e) {
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
}

@ -231,7 +231,7 @@ public class SysTaskCycleController extends CoreBaseController {
*/
@GetMapping(value = "/list")
@ApiOperation(value = "查询所有任务周期信息", notes = "查询所有任务周期信息")
public ResultBean findSysTaskCycle() {
public ResultBean<SysTaskCycle> findSysTaskCycle() {
try {
List<SysTaskCycle> list = sysTaskCycleService.listSysTaskCycle();
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultList(list);

@ -30,13 +30,8 @@ import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
@ -115,7 +110,7 @@ public class SysTaskPlanController extends CoreBaseController {
*/
@PostMapping(value = "/insert")
@ApiOperation(value = "新增任务计划", notes = "任务计划")
public ResultBean insertSysTaskTime(SysTaskPlan sysTaskPlan, Integer isExecute) {
public ResultBean<SysTaskPlan> insertSysTaskTime(@RequestBody SysTaskPlan sysTaskPlan, Integer isExecute) {
try {
startMultiService();
@ -184,6 +179,7 @@ public class SysTaskPlanController extends CoreBaseController {
.build();
}
}
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultObject(sysTaskPlan);
} catch (ImppBusiException busExcep) {
return ResultBean.fail(busExcep);
@ -201,7 +197,7 @@ public class SysTaskPlanController extends CoreBaseController {
*/
@PutMapping(value = "/update")
@ApiOperation(value = "修改任务计划", notes = "任务计划")
public ResultBean updateSysTaskTime(SysTaskPlan sysTaskPlan, Integer isExecute) {
public ResultBean<SysTaskPlan> updateSysTaskTime(@RequestBody SysTaskPlan sysTaskPlan, Integer isExecute) {
try {
startMultiService();

@ -18,6 +18,7 @@ import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.fastdfs.FastDFSClient;
import cn.estsh.impp.framework.boot.fastdfs.FastDFSFile;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -51,7 +52,7 @@ public class SysFileServiceImpl implements ISysFileService {
@ApiOperation(value = "新增资源信息")
public SysFile insertSysFile(SysFile sysFile) {
LOGGER.info("文件资源 SYS_FILE :{}", sysFile);
if (sysFile.getFileCode() != null) {
if (StringUtils.isNotBlank(sysFile.getFileCode())) {
SysFile fileCode = sysFileRDao.getByProperty("fileCode", sysFile.getFileCode());
if (fileCode != null) {
throw ImppExceptionBuilder.newInstance()
@ -81,7 +82,7 @@ public class SysFileServiceImpl implements ISysFileService {
}
// 文件代码唯一校验
if (sysFile.getFileCode() != null) {
if (StringUtils.isNotBlank(sysFile.getFileCode())) {
List list = sysFileRDao.findByHqlWhere(CoreHqlPack.packHqlSysFileCode(sysFile));
if (list != null && list.size() > 0) {
throw ImppExceptionBuilder.newInstance()

@ -135,4 +135,9 @@ public class SysTaskService implements ISysTaskService {
return new ListPager(sysTaskRDao.findByHqlWherePage(hqlPack + sysTask.orderBy(),pager),pager);
}
}
@Override
public SysTask getSysTaskByCode(String code) {
return sysTaskRDao.getByProperty("taskCode",code);
}
}

Loading…
Cancel
Save