Browse Source

Merge branch 'dev' of chenweida/patient-co-management into dev

chenweida 7 năm trước cách đây
mục cha
commit
e863a73527

+ 2 - 2
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/controller/JobController.java

@ -110,10 +110,10 @@ public class JobController extends BaseController {
    @RequestMapping(value = "productDataByDayToDayAndId", method = RequestMethod.GET)
    public String productDataByDayToDayAndId( @ApiParam(name = "start", value = "yyyy-MM-dd")@RequestParam(value = "start", required = true)String start,
                                         @ApiParam(name = "end", value = "yyyy-MM-dd")@RequestParam(value = "end", required = true)String end,
                                              @ApiParam(name = "id", value = "任务id")@RequestParam(value = "id", required = true)String id) {
                                         @ApiParam(name = "ids", value = "任务ids多个逗号分割")@RequestParam(value = "ids", required = true)String ids) {
        try {
            
            jobService.productDataByDayToDayAndId(start,end,id);
            jobService.productDataByDayToDayAndId(start,end,ids);
            return success("启动成功!");
        } catch (Exception e) {
            error(e);

+ 5 - 2
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/service/JobService.java

@ -307,7 +307,7 @@ public class JobService {
    }
    public void productDataByDayToDayAndId(String start, String end, String id) throws Exception {
    public void productDataByDayToDayAndId(String start, String end, String ids) throws Exception {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Date startDate = sdf.parse(start);
        Date endDate = sdf.parse(end);
@ -315,9 +315,12 @@ public class JobService {
            throw new Exception("日期参数错误");
        }
        int day = daysBetween(startDate, endDate);
        String [] idStr=ids.split(",");
        for (int i = 0; i < day; i++) {
            Cache.cleanCache();//清空缓存
            productDataByOneDayWithId(getYesterday(i, startDate), id);
            for(String id:idStr){
                productDataByOneDayWithId(getYesterday(i, startDate), id);
            }
        }
    }