Commit e47eddd4 authored by 赵啸非's avatar 赵啸非

添加照片海康下载

parent ba5c1535
......@@ -24,6 +24,9 @@ import com.mortals.xhx.module.check.service.*;
import com.mortals.xhx.module.perform.model.PerformAttendAppealEntity;
import com.mortals.xhx.module.perform.model.PerformAttendAppealQuery;
import com.mortals.xhx.module.perform.service.PerformAttendAppealService;
import com.mortals.xhx.module.staff.model.StaffPerformStatEntity;
import com.mortals.xhx.module.staff.model.StaffPerformStatQuery;
import com.mortals.xhx.module.staff.service.StaffPerformStatService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -72,6 +75,8 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
@Autowired
private CheckAllRecordDao checkAllRecordDao;
@Autowired
private StaffPerformStatService staffPerformStatService;
/**
* 个人当天绩效统计
......@@ -88,18 +93,41 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
log.info("【{}】【请求体】--> 用户:{}", busiDesc, context.getUser().getRealName());
try {
//todo
CheckAllRecordQuery checkAllRecordQuery = new CheckAllRecordQuery();
checkAllRecordQuery.setSubAddType(SubAddTypeEnum.扣除.getValue());
checkAllRecordQuery.setStaffId(context.getUser().getCustomerId());
int totalTimes = checkAllRecordDao.getCount(checkAllRecordQuery);
checkAllRecordQuery.setCheckTimeStart(DateUtil.today());
checkAllRecordQuery.setCheckTimeEnd(DateUtil.today());
int todayTimes = checkAllRecordDao.getCount(checkAllRecordQuery);
StaffPerformStatQuery staffPerformStatQuery = new StaffPerformStatQuery();
staffPerformStatQuery.setStaffId(context.getUser().getCustomerId());
staffPerformStatQuery.setYear(DateUtil.year(new Date()));
staffPerformStatQuery.setMonth(DateUtil.month(new Date())+1);
List<StaffPerformStatEntity> staffPerformStatEntities = staffPerformStatService.find(staffPerformStatQuery);
BigDecimal totalScore=new BigDecimal(0.0);
if(ObjectUtils.isEmpty(staffPerformStatEntities)){
// staffPerformStatEntities.stream().map(item->item.getTotalSubScore().doubleValue()).
}
staffPerformStatQuery.setDay(DateUtil.dayOfMonth(new Date()));
//今日得分
StaffPerformStatEntity staffPerformStatEntity = staffPerformStatService.selectOne(staffPerformStatQuery);
BigDecimal todayScore=new BigDecimal(0.0);
if(!ObjectUtils.isEmpty(staffPerformStatEntity)){
todayScore=staffPerformStatEntity.getTotalSubScore();
}
PerformStatInfo performStatInfo = new PerformStatInfo();
performStatInfo.setTotalScore(RandomUtil.randomBigDecimal(new BigDecimal("15"),new BigDecimal("45")).setScale(1,BigDecimal.ROUND_HALF_UP));
performStatInfo.setTotalScore(totalScore.setScale(1, BigDecimal.ROUND_HALF_UP));
performStatInfo.setTotalTimes(totalTimes);
performStatInfo.setTodayScore(RandomUtil.randomBigDecimal(new BigDecimal("2"),new BigDecimal("10")).setScale(1,BigDecimal.ROUND_HALF_UP));
performStatInfo.setTodayTimes(RandomUtil.randomInt(10));
performStatInfo.setTodayScore(todayScore.setScale(1, BigDecimal.ROUND_HALF_UP));
performStatInfo.setTodayTimes(todayTimes);
rest.setData(performStatInfo);
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
......@@ -142,7 +170,8 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
query.setStaffId(context.getUser().getCustomerId());
Result<CheckAllRecordVo> result = checkAllRecordService.getAllCheckRecord(query, pageInfo);
List<CheckAllRecordVo> allCheckRecord = result.getList();List<PerformInfo> collect = allCheckRecord.stream().map(item -> {
List<CheckAllRecordVo> allCheckRecord = result.getList();
List<PerformInfo> collect = allCheckRecord.stream().map(item -> {
PerformInfo performInfo = new PerformInfo();
BeanUtils.copyProperties(item, performInfo, BeanUtil.getNullPropertyNames(item));
return performInfo;
......
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