| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- package cn.com.lzt.overtimestats.service.impl;
- import org.jeecgframework.core.common.service.impl.CommonServiceImpl;
- import org.jeecgframework.core.constant.Globals;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- import org.springframework.transaction.annotation.Transactional;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- import java.util.UUID;
- import java.io.Serializable;
- import org.jeecgframework.core.util.ApplicationContextUtil;
- import org.jeecgframework.core.util.JeecgDataAutorUtils;
- import org.jeecgframework.core.util.LogUtil;
- import org.jeecgframework.core.util.MyClassLoader;
- import org.jeecgframework.core.util.StringUtil;
- import org.jeecgframework.minidao.pojo.MiniDaoPage;
- import org.jeecgframework.web.cgform.enhance.CgformEnhanceJavaInter;
- import cn.com.lzt.common.util.DataUtil;
- import cn.com.lzt.distributionstats.entity.ProjDistributionStatsEntity;
- import cn.com.lzt.overtimestats.dao.OvertimeStatsMinidaoDao;
- import cn.com.lzt.overtimestats.entity.DeptOvertimeStatsEntity;
- import cn.com.lzt.overtimestats.entity.ProjOvertimeStatsEntity;
- import cn.com.lzt.overtimestats.entity.UserOvertimeStatsEntity;
- import cn.com.lzt.overtimestats.service.OvertimeStatsServiceI;
- import cn.com.lzt.wageStats.service.WageStatsServiceI;
- @Service("overtimeStatsService")
- @Transactional
- public class OvertimeStatsServiceImpl extends CommonServiceImpl implements OvertimeStatsServiceI {
- @Autowired
- private OvertimeStatsMinidaoDao overtimeStatsMinidaoDao;
-
- @Override
- public void overtimeStatsTaskData() {
- overtimeStatsTaskData(null);
- }
- @Override
- public void overtimeStatsTaskData(String attmonth) {
- LogUtil.info("===============人员统计定时任务开始=================");
- //String authSql = JeecgDataAutorUtils.loadDataSearchConditonSQLString();
- String beforeMonth = DataUtil.getBeforeMonth();
- if(StringUtil.isNotEmpty(attmonth)){
- beforeMonth = attmonth;
- }
- Map<String,Object> params = new HashMap<String, Object>();
- params.put("yearmonth", beforeMonth);
- params.put("basepay", Globals.BASE_PAY);
- //查询上个月的员工月度考勤
- MiniDaoPage<UserOvertimeStatsEntity> userOvertimelist = new MiniDaoPage<UserOvertimeStatsEntity>();
- userOvertimelist = overtimeStatsMinidaoDao.userOvertimeStatsData(params,null);
- List<UserOvertimeStatsEntity> userOverList = findByProperty(UserOvertimeStatsEntity.class, "yearmonth", beforeMonth);
- try {
- deleteAllEntitie(userOverList);
- super.batchSave(userOvertimelist.getResults());
- LogUtil.info("===============员工加班统计表保存成功=================");
- } catch (Exception e) {
- LogUtil.info("===============员工加班统计表保存失败=================");
- }
- //查询上个月的部门月度考勤
- MiniDaoPage<DeptOvertimeStatsEntity> deptOvertimelist = new MiniDaoPage<DeptOvertimeStatsEntity>();
- deptOvertimelist = overtimeStatsMinidaoDao.deptOvertimeStatsData(params,null);
- List<DeptOvertimeStatsEntity> deptOverList = findByProperty(DeptOvertimeStatsEntity.class, "yearmonth",beforeMonth);
- try {
- deleteAllEntitie(deptOverList);
- super.batchSave(deptOvertimelist.getResults());
- LogUtil.info("===============部门加班统计表保存成功=================");
- } catch (Exception e) {
- LogUtil.info("===============部门加班统计表保存失败=================");
- }
-
- //查询上个月的项目月度考勤
- MiniDaoPage<ProjOvertimeStatsEntity> projOvertimelist = new MiniDaoPage<ProjOvertimeStatsEntity>();
- projOvertimelist = overtimeStatsMinidaoDao.projOvertimeStatsData(params,null);
- List<ProjOvertimeStatsEntity> projOverList = findByProperty(ProjOvertimeStatsEntity.class, "yearmonth",beforeMonth);
- try {
- deleteAllEntitie(projOverList);
- super.batchSave(projOvertimelist.getResults());
- LogUtil.info("===============项目加班统计表保存成功=================");
- } catch (Exception e) {
- LogUtil.info("===============项目加班统计表保存失败=================");
- }
- LogUtil.info("===============加班统计定时任务开始=================");
-
- }
-
-
- }
|