|
@@ -19,10 +19,7 @@ import org.dromara.mapper.CheckPointRecordMapper;
|
|
import org.dromara.service.ICheckPointRecordService;
|
|
import org.dromara.service.ICheckPointRecordService;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.Collection;
|
|
|
|
-import java.util.HashMap;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
import static org.dromara.common.core.constant.Constants.TWO;
|
|
import static org.dromara.common.core.constant.Constants.TWO;
|
|
|
|
|
|
@@ -45,7 +42,7 @@ public class CheckPointRecordServiceImpl implements ICheckPointRecordService {
|
|
* @return 巡更点记录
|
|
* @return 巡更点记录
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public CheckPointRecordVo queryById(Long checkPointRecordId){
|
|
|
|
|
|
+ public CheckPointRecordVo queryById(Long checkPointRecordId) {
|
|
return baseMapper.selectVoById(checkPointRecordId);
|
|
return baseMapper.selectVoById(checkPointRecordId);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -77,6 +74,7 @@ public class CheckPointRecordServiceImpl implements ICheckPointRecordService {
|
|
|
|
|
|
private LambdaQueryWrapper<CheckPointRecord> buildQueryWrapper(CheckPointRecordBo bo) {
|
|
private LambdaQueryWrapper<CheckPointRecord> buildQueryWrapper(CheckPointRecordBo bo) {
|
|
LambdaQueryWrapper<CheckPointRecord> lqw = Wrappers.lambdaQuery();
|
|
LambdaQueryWrapper<CheckPointRecord> lqw = Wrappers.lambdaQuery();
|
|
|
|
+ Map<String, Object> params = bo.getParams();
|
|
lqw.orderByAsc(CheckPointRecord::getCheckPointRecordId);
|
|
lqw.orderByAsc(CheckPointRecord::getCheckPointRecordId);
|
|
lqw.eq(bo.getCheckPointManageId() != null, CheckPointRecord::getCheckPointManageId, bo.getCheckPointManageId());
|
|
lqw.eq(bo.getCheckPointManageId() != null, CheckPointRecord::getCheckPointManageId, bo.getCheckPointManageId());
|
|
lqw.eq(StringUtils.isNotBlank(bo.getDateTimeNum()), CheckPointRecord::getDateTimeNum, bo.getDateTimeNum());
|
|
lqw.eq(StringUtils.isNotBlank(bo.getDateTimeNum()), CheckPointRecord::getDateTimeNum, bo.getDateTimeNum());
|
|
@@ -94,6 +92,10 @@ public class CheckPointRecordServiceImpl implements ICheckPointRecordService {
|
|
lqw.eq(StringUtils.isNotBlank(bo.getCheckResultPhoto()), CheckPointRecord::getCheckResultPhoto, bo.getCheckResultPhoto());
|
|
lqw.eq(StringUtils.isNotBlank(bo.getCheckResultPhoto()), CheckPointRecord::getCheckResultPhoto, bo.getCheckResultPhoto());
|
|
lqw.eq(bo.getCheckResultTime() != null, CheckPointRecord::getCheckResultTime, bo.getCheckResultTime());
|
|
lqw.eq(bo.getCheckResultTime() != null, CheckPointRecord::getCheckResultTime, bo.getCheckResultTime());
|
|
lqw.eq(StringUtils.isNotBlank(bo.getCheckStatus()), CheckPointRecord::getCheckStatus, bo.getCheckStatus());
|
|
lqw.eq(StringUtils.isNotBlank(bo.getCheckStatus()), CheckPointRecord::getCheckStatus, bo.getCheckStatus());
|
|
|
|
+ Object createTime = params.get("createTime");
|
|
|
|
+ if (createTime != null) {
|
|
|
|
+ lqw.apply("date_format(check_result_time,'%Y-%m-%d')= '" + createTime + "'");
|
|
|
|
+ }
|
|
return lqw;
|
|
return lqw;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -126,7 +128,7 @@ public class CheckPointRecordServiceImpl implements ICheckPointRecordService {
|
|
//获取当前登录人的员工信息
|
|
//获取当前登录人的员工信息
|
|
StaffManageDTO staffManage = LoginHelper.getLoginUser().getStaffManage();
|
|
StaffManageDTO staffManage = LoginHelper.getLoginUser().getStaffManage();
|
|
bo.setUpdateTime(DateUtils.getNowDate());
|
|
bo.setUpdateTime(DateUtils.getNowDate());
|
|
- if (staffManage != null){
|
|
|
|
|
|
+ if (staffManage != null) {
|
|
bo.setCheckUserName(staffManage.getStaffName());
|
|
bo.setCheckUserName(staffManage.getStaffName());
|
|
bo.setCheckUsePhone(staffManage.getPhoneNumber());
|
|
bo.setCheckUsePhone(staffManage.getPhoneNumber());
|
|
bo.setCheckStaffId(staffManage.getStaffId());
|
|
bo.setCheckStaffId(staffManage.getStaffId());
|
|
@@ -139,7 +141,7 @@ public class CheckPointRecordServiceImpl implements ICheckPointRecordService {
|
|
/**
|
|
/**
|
|
* 保存前的数据校验
|
|
* 保存前的数据校验
|
|
*/
|
|
*/
|
|
- private void validEntityBeforeSave(CheckPointRecord entity){
|
|
|
|
|
|
+ private void validEntityBeforeSave(CheckPointRecord entity) {
|
|
//TODO 做一些数据校验,如唯一约束
|
|
//TODO 做一些数据校验,如唯一约束
|
|
}
|
|
}
|
|
|
|
|
|
@@ -152,7 +154,7 @@ public class CheckPointRecordServiceImpl implements ICheckPointRecordService {
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
- if(isValid){
|
|
|
|
|
|
+ if (isValid) {
|
|
//TODO 做一些业务上的校验,判断是否需要校验
|
|
//TODO 做一些业务上的校验,判断是否需要校验
|
|
}
|
|
}
|
|
return baseMapper.deleteByIds(ids) > 0;
|
|
return baseMapper.deleteByIds(ids) > 0;
|
|
@@ -160,19 +162,19 @@ public class CheckPointRecordServiceImpl implements ICheckPointRecordService {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public R<Map<String, Object>> getCheckPointRecordCount(CheckPointRecordBo bo) {
|
|
public R<Map<String, Object>> getCheckPointRecordCount(CheckPointRecordBo bo) {
|
|
- Map<String,Object> resultMap = new HashMap<>(3);
|
|
|
|
- resultMap.put("checkPoint",0);
|
|
|
|
- resultMap.put("yCheckPoint",0);
|
|
|
|
- resultMap.put("wCheckPoint",0);
|
|
|
|
|
|
+ Map<String, Object> resultMap = new HashMap<>(3);
|
|
|
|
+ resultMap.put("checkPoint", 0);
|
|
|
|
+ resultMap.put("yCheckPoint", 0);
|
|
|
|
+ resultMap.put("wCheckPoint", 0);
|
|
bo.setCreateTime(DateUtils.getNowDate());
|
|
bo.setCreateTime(DateUtils.getNowDate());
|
|
//查询出今日所有巡更点记录
|
|
//查询出今日所有巡更点记录
|
|
List<CheckPointRecordVo> checkPointRecords = queryList(bo);
|
|
List<CheckPointRecordVo> checkPointRecords = queryList(bo);
|
|
- if (checkPointRecords != null && !checkPointRecords.isEmpty()){
|
|
|
|
|
|
+ if (checkPointRecords != null && !checkPointRecords.isEmpty()) {
|
|
//判断巡更时间不为null的代表已经巡更
|
|
//判断巡更时间不为null的代表已经巡更
|
|
- resultMap.put("checkPoint",checkPointRecords.size());
|
|
|
|
|
|
+ resultMap.put("checkPoint", checkPointRecords.size());
|
|
long checkCount = checkPointRecords.stream().filter(e -> TWO.equals(e.getCheckStatus())).count();
|
|
long checkCount = checkPointRecords.stream().filter(e -> TWO.equals(e.getCheckStatus())).count();
|
|
- resultMap.put("yCheckPoint",checkCount);
|
|
|
|
- resultMap.put("wCheckPoint",checkPointRecords.size()-checkCount);
|
|
|
|
|
|
+ resultMap.put("yCheckPoint", checkCount);
|
|
|
|
+ resultMap.put("wCheckPoint", checkPointRecords.size() - checkCount);
|
|
}
|
|
}
|
|
return R.ok(resultMap);
|
|
return R.ok(resultMap);
|
|
}
|
|
}
|