|
|
@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.xunmei.common.core.constant.Constants;
|
|
|
+import com.xunmei.common.core.constant.SecurityConstants;
|
|
|
import com.xunmei.common.core.domain.iot.domain.IotServerInfo;
|
|
|
import com.xunmei.common.core.domain.work.domain.IotDayWork;
|
|
|
import com.xunmei.common.core.domain.work.domain.IotDayWorkOperation;
|
|
|
@@ -27,6 +28,8 @@ import com.xunmei.iot.service.IotDayWorkOperationService;
|
|
|
import com.xunmei.iot.service.IotDayWorkService;
|
|
|
import com.xunmei.iot.service.IotServerInfoService;
|
|
|
import com.xunmei.system.api.RemoteHostService;
|
|
|
+import com.xunmei.system.api.RemoteOrgService;
|
|
|
+import com.xunmei.system.api.domain.SysOrg;
|
|
|
import com.xunmei.system.api.domain.SysUser;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -60,6 +63,9 @@ public class IotDayWorkServiceImpl extends ServiceImpl<IotDayWorkMapper, IotDayW
|
|
|
@Resource
|
|
|
IotServerInfoService iotServerInfoService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private RemoteOrgService orgService;
|
|
|
+
|
|
|
@Override
|
|
|
public WorkVo getRealWorkData(WorkDayDto workDayDto) {
|
|
|
final SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
|
|
@@ -161,6 +167,11 @@ public class IotDayWorkServiceImpl extends ServiceImpl<IotDayWorkMapper, IotDayW
|
|
|
|
|
|
@Override
|
|
|
public WorkHistoryVo getHistoryList(WorkDayDto workDayDto) {
|
|
|
+ final SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
|
|
+ // 页面端目前没有加机构树,先默认查询登录机构以及下级机构的 记录
|
|
|
+ SysOrg sysOrg= orgService.selectSysOrgById(sysUser.getOrgId(), SecurityConstants.INNER);
|
|
|
+ workDayDto.setOrgPath(sysOrg.getPath());
|
|
|
+
|
|
|
String workDate = workDayDto.getWorkDate();
|
|
|
if (StringUtils.isEmpty(workDate)) {
|
|
|
throw new RuntimeException("请选择日期");
|
|
|
@@ -171,11 +182,12 @@ public class IotDayWorkServiceImpl extends ServiceImpl<IotDayWorkMapper, IotDayW
|
|
|
Date endTime = DateUtil.endOfMonth(parse);
|
|
|
|
|
|
//获取有记录的天数
|
|
|
- List<String> dates = operationService.selectWorkDayList(startTime, endTime);
|
|
|
+ List<String> dates = operationService.selectWorkDayList(startTime, endTime,workDayDto.getOrgId(),workDayDto.getOrgPath());
|
|
|
|
|
|
//获取当天的工作记录
|
|
|
QueryWrapper<IotDayWork> qw = new QueryWrapper<>();
|
|
|
qw.lambda().eq(IotDayWork::getWorkDate, workDate)
|
|
|
+ .likeRight(IotDayWork::getOrgPath,workDayDto.getOrgPath())
|
|
|
.orderByDesc(IotDayWork::getCreateTime);
|
|
|
List<IotDayWork> list = baseMapper.selectList(qw);
|
|
|
|