|
@@ -1,21 +1,10 @@
|
|
package com.hjy.quartz.task;
|
|
package com.hjy.quartz.task;
|
|
|
|
|
|
-import cn.hutool.core.bean.BeanUtil;
|
|
|
|
-import com.hjy.common.core.domain.entity.SysDept;
|
|
|
|
-import com.hjy.common.core.text.Convert;
|
|
|
|
-import com.hjy.common.utils.DateUtils;
|
|
|
|
-import com.hjy.common.utils.StringUtils;
|
|
|
|
-import com.hjy.module.domain.gether.CbGather;
|
|
|
|
import com.hjy.module.service.gather.ICbGatherService;
|
|
import com.hjy.module.service.gather.ICbGatherService;
|
|
-import com.hjy.system.mapper.SysDeptMapper;
|
|
|
|
-import com.hjy.system.service.ISysDeptService;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
-import org.apache.commons.compress.utils.Lists;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import java.util.List;
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 定时任务调度测试
|
|
* 定时任务调度测试
|
|
*
|
|
*
|
|
@@ -25,33 +14,13 @@ import java.util.List;
|
|
@Component("geneTask")
|
|
@Component("geneTask")
|
|
public class ZhbsqTask {
|
|
public class ZhbsqTask {
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private ICbGatherService gatherService;
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private SysDeptMapper deptMapper;
|
|
|
|
|
|
+ // @Autowired
|
|
|
|
+ // private ICbGatherService gatherService;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 生成数据采集列表数据
|
|
* 生成数据采集列表数据
|
|
*/
|
|
*/
|
|
public void generateGatherData(){
|
|
public void generateGatherData(){
|
|
- SysDept dept = new SysDept();
|
|
|
|
- dept.setDeptName("保税区");
|
|
|
|
- List<SysDept> sysDeptList = deptMapper.selectDeptList(dept);
|
|
|
|
- List<CbGather> saveEntity = Lists.newArrayList();
|
|
|
|
- for (SysDept sysDept : sysDeptList) {
|
|
|
|
- CbGather gather = new CbGather();
|
|
|
|
- gather.setMonth(DateUtils.dateTimeNow(DateUtils.YYYY_MM_DD_HH_MM_SS_CND).substring(5, 8));
|
|
|
|
- gather.setCollStatus("0");
|
|
|
|
- gather.setReportStatus("0");
|
|
|
|
- gather.setApproveStatus("0");
|
|
|
|
- gather.setType("0");
|
|
|
|
- gather.setCreateBy("admin");
|
|
|
|
- gather.setDeptId(Convert.toStr(sysDept.getDeptId()));
|
|
|
|
- saveEntity.add(gather);
|
|
|
|
- saveEntity.add(BeanUtil.toBean(gather, CbGather.class).setType("1"));
|
|
|
|
- }
|
|
|
|
- gatherService.saveBatch(saveEntity);
|
|
|
|
log.info("自动创建数据采集列表数据");
|
|
log.info("自动创建数据采集列表数据");
|
|
}
|
|
}
|
|
}
|
|
}
|