Commit 498529a5 authored by 赵啸非's avatar 赵啸非

重新调整统计线程实现

parent 997c7807
package com.mortals.xhx.module.stat.service.impl; package com.mortals.xhx.module.stat.service.impl;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
...@@ -37,12 +38,12 @@ import java.util.Date; ...@@ -37,12 +38,12 @@ import java.util.Date;
import java.util.List; import java.util.List;
/** /**
* StatService * StatService
* 汇总统计 service实现 * 汇总统计 service实现
* *
* @author zxfei * @author zxfei
* @date 2024-07-02 * @date 2024-07-02
*/ */
@Service("statService") @Service("statService")
@Slf4j @Slf4j
public class StatServiceImpl extends AbstractCRUDServiceImpl<StatDao, StatEntity, Long> implements StatService { public class StatServiceImpl extends AbstractCRUDServiceImpl<StatDao, StatEntity, Long> implements StatService {
...@@ -111,22 +112,21 @@ public class StatServiceImpl extends AbstractCRUDServiceImpl<StatDao, StatEntity ...@@ -111,22 +112,21 @@ public class StatServiceImpl extends AbstractCRUDServiceImpl<StatDao, StatEntity
StatEntity.setSiteId(entity.getSiteId()); StatEntity.setSiteId(entity.getSiteId());
StatEntity.setSiteCode(entity.getSiteCode()); StatEntity.setSiteCode(entity.getSiteCode());
StatEntity.setSiteName(entity.getSiteName()); StatEntity.setSiteName(entity.getSiteName());
StatEntity.setCount(pjcount+phcount); StatEntity.setCount(pjcount + phcount);
StatEntity.setYear(entity.getYear()); StatEntity.setYear(entity.getYear());
StatEntity.setMonth(entity.getMonth()); StatEntity.setMonth(entity.getMonth());
StatEntity.setDay(entity.getDay()); StatEntity.setDay(entity.getDay());
StatEntity.setCreateTime(new Date()); StatEntity.setCreateTime(new Date());
StatEntity.setCreateUserId(1L); StatEntity.setCreateUserId(1L);
this.save(StatEntity); this.save(StatEntity);
} else { return Rest.ok();
StatEntity.setCount(pjcount+phcount);
StatEntity.setYear(entity.getYear());
StatEntity.setMonth(entity.getMonth());
StatEntity.setDay(entity.getDay());
StatEntity.setUpdateTime(new Date());
StatEntity.setUpdateUserId(1L);
this.update(StatEntity);
} }
StatEntity.setSiteCode(entity.getSiteCode());
StatEntity.setSiteName(entity.getSiteName());
StatEntity.setCount(pjcount + phcount);
StatEntity.setUpdateTime(new Date());
StatEntity.setUpdateUserId(1L);
this.update(StatEntity);
return Rest.ok(); return Rest.ok();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment