|
@@ -1,34 +1,32 @@
|
|
package com.ims.eval.service.impl;
|
|
package com.ims.eval.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.ims.common.utils.Constant;
|
|
import com.ims.common.utils.Constant;
|
|
-import com.ims.common.utils.StringUtils;
|
|
|
|
import com.ims.eval.config.CustomException;
|
|
import com.ims.eval.config.CustomException;
|
|
-import com.ims.eval.entity.DataDictionary;
|
|
|
|
-import com.ims.eval.entity.Myuser;
|
|
|
|
-import com.ims.eval.entity.ResponsibilityIndicatorInfo;
|
|
|
|
import com.ims.eval.dao.ResponsibilityIndicatorInfoMapper;
|
|
import com.ims.eval.dao.ResponsibilityIndicatorInfoMapper;
|
|
-import com.ims.eval.entity.dto.request.IndicatorDictionaryDTO;
|
|
|
|
|
|
+import com.ims.eval.entity.ResponsibilityIndicatorInfo;
|
|
import com.ims.eval.entity.dto.request.ResponsibilityIndicatorInfoUpdateDTO;
|
|
import com.ims.eval.entity.dto.request.ResponsibilityIndicatorInfoUpdateDTO;
|
|
import com.ims.eval.entity.dto.response.MyuserResDTO;
|
|
import com.ims.eval.entity.dto.response.MyuserResDTO;
|
|
import com.ims.eval.entity.dto.response.ResponsibilityIndicatorInfoResDTO;
|
|
import com.ims.eval.entity.dto.response.ResponsibilityIndicatorInfoResDTO;
|
|
import com.ims.eval.service.IResponsibilityIndicatorInfoService;
|
|
import com.ims.eval.service.IResponsibilityIndicatorInfoService;
|
|
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
import com.ims.eval.service.IUserService;
|
|
import com.ims.eval.service.IUserService;
|
|
-import com.sun.org.apache.xpath.internal.operations.Bool;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
-import java.util.*;
|
|
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
* 责任书指标明细
|
|
* 责任书指标明细
|
|
-
|
|
|
|
- 服务实现类
|
|
|
|
|
|
+ * <p>
|
|
|
|
+ * 服务实现类
|
|
* </p>
|
|
* </p>
|
|
*
|
|
*
|
|
* @author wang
|
|
* @author wang
|
|
@@ -42,10 +40,10 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
private IUserService userService;
|
|
private IUserService userService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Map<String ,List<ResponsibilityIndicatorInfoResDTO>> planValueList(List<String> deptResponsibilityIds, String dept, HttpServletRequest request) {
|
|
|
|
|
|
+ public Map<String, List<ResponsibilityIndicatorInfoResDTO>> planValueList(List<String> deptResponsibilityIds, String dept, HttpServletRequest request) {
|
|
|
|
|
|
MyuserResDTO myuser = userService.getSysUser(request);
|
|
MyuserResDTO myuser = userService.getSysUser(request);
|
|
- if(null == myuser){
|
|
|
|
|
|
+ if (null == myuser) {
|
|
throw new CustomException("暂无权限");
|
|
throw new CustomException("暂无权限");
|
|
}
|
|
}
|
|
String organizationId = "";
|
|
String organizationId = "";
|
|
@@ -59,17 +57,17 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
dept = "";
|
|
dept = "";
|
|
} else if (myuser.getLoginName().equals("admin")) {
|
|
} else if (myuser.getLoginName().equals("admin")) {
|
|
dept = "";
|
|
dept = "";
|
|
- updateMark= true;
|
|
|
|
|
|
+ updateMark = true;
|
|
} else {
|
|
} else {
|
|
throw new CustomException("暂无权限");
|
|
throw new CustomException("暂无权限");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- List<ResponsibilityIndicatorInfoResDTO> list = baseMapper.listByresponsibilityId(deptResponsibilityIds,dept,"ZRMB",organizationId);//默认获取指定的怎目标
|
|
|
|
|
|
+ List<ResponsibilityIndicatorInfoResDTO> list = baseMapper.listByresponsibilityId(deptResponsibilityIds, dept, "ZRMB", organizationId);//默认获取指定的怎目标
|
|
boolean finalUpdateMark = updateMark;
|
|
boolean finalUpdateMark = updateMark;
|
|
- list.stream().forEach(i->{
|
|
|
|
|
|
+ list.stream().forEach(i -> {
|
|
i.setUpdateMark(i.getDeptName().equals(myuser.getDeptName()));
|
|
i.setUpdateMark(i.getDeptName().equals(myuser.getDeptName()));
|
|
});
|
|
});
|
|
- Map<String ,List<ResponsibilityIndicatorInfoResDTO>> map = list.stream().collect(Collectors.groupingBy(ResponsibilityIndicatorInfoResDTO::getIsQuantified));
|
|
|
|
|
|
+ Map<String, List<ResponsibilityIndicatorInfoResDTO>> map = list.stream().collect(Collectors.groupingBy(ResponsibilityIndicatorInfoResDTO::getIsQuantified));
|
|
map.put("quantifiedList", map.remove("是"));
|
|
map.put("quantifiedList", map.remove("是"));
|
|
map.put("nonQuantifiedList", map.remove("否"));
|
|
map.put("nonQuantifiedList", map.remove("否"));
|
|
return map;
|
|
return map;
|
|
@@ -83,6 +81,15 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public Map<String, List<ResponsibilityIndicatorInfoResDTO>> selectResponsibilityIndicatorInfoList(String deptResponsibilityId, String isQuantified, String dataState) {
|
|
|
|
+ List<ResponsibilityIndicatorInfoResDTO> list = baseMapper.selectResponsibilityIndicatorInfoList(deptResponsibilityId, isQuantified, dataState);
|
|
|
|
+ Map<String, List<ResponsibilityIndicatorInfoResDTO>> map = list.stream().collect(Collectors.groupingBy(ResponsibilityIndicatorInfoResDTO::getIsQuantified));
|
|
|
|
+ map.put("quantifiedList", map.remove("是"));
|
|
|
|
+ map.put("nonQuantifiedList", map.remove("否"));
|
|
|
|
+ return map;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
@Override
|
|
@Override
|
|
@@ -112,10 +119,10 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
indicatorInfo.setRemark(entity.getRemark());//备注
|
|
indicatorInfo.setRemark(entity.getRemark());//备注
|
|
indicatorInfo.setState(entity.getState());//状态
|
|
indicatorInfo.setState(entity.getState());//状态
|
|
boolean b = super.saveOrUpdate(indicatorInfo);
|
|
boolean b = super.saveOrUpdate(indicatorInfo);
|
|
- if(!b){
|
|
|
|
|
|
+ if (!b) {
|
|
throw new CustomException("更新失败");
|
|
throw new CustomException("更新失败");
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
ResponsibilityIndicatorInfo addInfo = new ResponsibilityIndicatorInfo();
|
|
ResponsibilityIndicatorInfo addInfo = new ResponsibilityIndicatorInfo();
|
|
addInfo.setDeptResponsibilityId(entity.getDeptResponsibilityId());
|
|
addInfo.setDeptResponsibilityId(entity.getDeptResponsibilityId());
|
|
addInfo.setOrganizationEvaluationRuleId(entity.getOrganizationEvaluationRuleId());
|
|
addInfo.setOrganizationEvaluationRuleId(entity.getOrganizationEvaluationRuleId());
|
|
@@ -129,7 +136,7 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
addInfo.setCreateTime(new Date());
|
|
addInfo.setCreateTime(new Date());
|
|
addInfo.setState("-1");//状态
|
|
addInfo.setState("-1");//状态
|
|
boolean b = super.saveOrUpdate(addInfo);
|
|
boolean b = super.saveOrUpdate(addInfo);
|
|
- if(!b){
|
|
|
|
|
|
+ if (!b) {
|
|
throw new CustomException("新增失败");
|
|
throw new CustomException("新增失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -142,13 +149,31 @@ public class ResponsibilityIndicatorInfoServiceImpl extends ServiceImpl<Responsi
|
|
public Map<String, Object> getResponsibilityIdMap(String deptResponsibilityId) {
|
|
public Map<String, Object> getResponsibilityIdMap(String deptResponsibilityId) {
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
QueryWrapper<ResponsibilityIndicatorInfo> qw = new QueryWrapper<>();
|
|
QueryWrapper<ResponsibilityIndicatorInfo> qw = new QueryWrapper<>();
|
|
- qw.lambda().eq(ResponsibilityIndicatorInfo::getDeptResponsibilityId,deptResponsibilityId);
|
|
|
|
|
|
+ qw.lambda().eq(ResponsibilityIndicatorInfo::getDeptResponsibilityId, deptResponsibilityId);
|
|
List<ResponsibilityIndicatorInfo> list = baseMapper.selectList(qw);
|
|
List<ResponsibilityIndicatorInfo> list = baseMapper.selectList(qw);
|
|
- list.stream().forEach(i->{
|
|
|
|
- map.put(i.getIndicatorId(),i.getIsQuantified().equals("是")?i.getQuantifiedValue():i.getQuantifiedValue());
|
|
|
|
|
|
+ list.stream().forEach(i -> {
|
|
|
|
+ map.put(i.getIndicatorId(), i.getIsQuantified().equals("是") ? i.getQuantifiedValue() : i.getQuantifiedValue());
|
|
});
|
|
});
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public boolean saveOrUpdateBatch(List<ResponsibilityIndicatorInfo> responsibilityIndicatorInfoList) {
|
|
|
|
+ boolean b = false;
|
|
|
|
+ for (ResponsibilityIndicatorInfo responsibilityIndicatorInfo : responsibilityIndicatorInfoList) {
|
|
|
|
+ responsibilityIndicatorInfo.setDataState("失效");
|
|
|
|
+ b = super.updateById(responsibilityIndicatorInfo);
|
|
|
|
+ if (b) {
|
|
|
|
+ responsibilityIndicatorInfo.setDataState("有效");
|
|
|
|
+ b = super.save(responsibilityIndicatorInfo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return b;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public List<ResponsibilityIndicatorInfoResDTO> selectPopUpData(String deptResponsibilityId, String isQuantified, String dataState) {
|
|
|
|
+ List<ResponsibilityIndicatorInfoResDTO> list = baseMapper.selectResponsibilityIndicatorInfoList(deptResponsibilityId, isQuantified, dataState);
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
}
|
|
}
|