| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248 |
- package cn.com.goldenwater.dcproj.service.impl.tac;
- import cn.com.goldenwater.core.service.AbstractCrudService;
- import cn.com.goldenwater.dcproj.dao.TacEvaluationExternalExpertDao;
- import cn.com.goldenwater.dcproj.dao.TacInspYearBatchGroupPersDao;
- import cn.com.goldenwater.dcproj.dao.TacPawpRgstrDao;
- import cn.com.goldenwater.dcproj.model.TacEvaluationExternalExpert;
- import cn.com.goldenwater.dcproj.model.TacInspYearBatchGroupPers;
- import cn.com.goldenwater.dcproj.param.TacEvaluationExternalExpertParam;
- import cn.com.goldenwater.dcproj.param.TacInspYearBatchGroupPersParam;
- import cn.com.goldenwater.dcproj.param.TacPawpRgstrParam;
- import cn.com.goldenwater.dcproj.service.TacEvaluationExternalExpertService;
- import cn.com.goldenwater.dcproj.utils.StringUtils;
- import cn.com.goldenwater.dcproj.utils.expExcel.ExportUtil;
- import cn.com.goldenwater.dcproj.vo.TacEvaluationExternalExpertVo;
- import cn.com.goldenwater.id.util.UuidUtil;
- import cn.com.goldenwater.target.CheckException;
- import com.github.pagehelper.PageHelper;
- import com.github.pagehelper.PageInfo;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- import org.springframework.transaction.annotation.Transactional;
- import javax.servlet.http.HttpServletResponse;
- import java.util.ArrayList;
- import java.util.Date;
- import java.util.List;
- /**
- * 稽查专家测评Service业务层处理
- *
- * @author ruoyi
- * @date 2023-03-06
- */
- @Service
- @Transactional
- public class TacEvaluationExternalExpertServiceImpl extends AbstractCrudService<TacEvaluationExternalExpert, TacEvaluationExternalExpertParam> implements TacEvaluationExternalExpertService
- {
- private Logger logger = LoggerFactory.getLogger(getClass());
- @Autowired
- private TacEvaluationExternalExpertDao tacEvaluationExternalExpertDao;
- @Autowired
- private TacInspYearBatchGroupPersDao tacInspYearBatchGroupPersDao;
- @Autowired
- private TacPawpRgstrDao pawpRgstrDao;
- public TacEvaluationExternalExpertServiceImpl(TacEvaluationExternalExpertDao tacEvaluationExternalExpertDao) {
- super(tacEvaluationExternalExpertDao);
- this.tacEvaluationExternalExpertDao = tacEvaluationExternalExpertDao;
- }
- /**
- * 增加稽查专家测评
- *
- * @return 稽查专家测评
- */
- @Override
- public int insert(TacEvaluationExternalExpert tacEvaluationExternalExpert) {
- logger.debug("TacEvaluationExternalExpert 新增");
- // 判断 外聘专家是否提交问题
- // 1 判定当前专家在组、项目 中有几个角色
- TacInspYearBatchGroupPersParam batchGroupPersParam = new TacInspYearBatchGroupPersParam();
- batchGroupPersParam.setGroupId(tacEvaluationExternalExpert.getGroupId());
- batchGroupPersParam.setPersId(tacEvaluationExternalExpert.getExpertId());
- List<TacInspYearBatchGroupPers> groupPersList = this.tacInspYearBatchGroupPersDao.findList(batchGroupPersParam);
- if(null != groupPersList){
- TacPawpRgstrParam pawpRgstrParam = new TacPawpRgstrParam();
- pawpRgstrParam.setGroupId(tacEvaluationExternalExpert.getGroupId());
- pawpRgstrParam.setObjId(tacEvaluationExternalExpert.getProjId());
- for(TacInspYearBatchGroupPers batchGroupPers : groupPersList){
- pawpRgstrParam.setPersId(batchGroupPers.getRoleType());
- Integer num = pawpRgstrDao.findExpertSubmitCount(pawpRgstrParam);
- if(null == num || num.intValue()<1){
- throw new CheckException(null == tacEvaluationExternalExpert.getExpertName()?"":tacEvaluationExternalExpert.getExpertName()+"专家未提交问题,不能打分");
- }
- }
- }else {
- throw new CheckException(null == tacEvaluationExternalExpert.getExpertName()?"":tacEvaluationExternalExpert.getExpertName()+"专家信息错误,不能打分");
- }
- String uuid = UuidUtil.uuid(); // 生成uuid
- tacEvaluationExternalExpert.setId(uuid);
- tacEvaluationExternalExpert.setIntm(new Date());
- tacEvaluationExternalExpert.setUptm(new Date());
- return this.tacEvaluationExternalExpertDao.insert(tacEvaluationExternalExpert);
- }
- /**
- * 更新 稽查专家测评
- * 主键更新
- * @param tacEvaluationExternalExpert 稽查专家测评
- * @return 稽查专家测评
- */
- @Override
- public int update(TacEvaluationExternalExpert tacEvaluationExternalExpert) {
- logger.debug("TacEvaluationExternalExpert 更新");
- tacEvaluationExternalExpert.setUptm(new Date());
- return this.tacEvaluationExternalExpertDao.update(tacEvaluationExternalExpert);
- }
- /**
- * 主键删除 稽查专家测评
- *
- * @param id 稽查专家测评主键
- * @return 稽查专家测评
- */
- @Override
- public int delete(String id) {
- logger.debug("TacEvaluationExternalExpert 删除");
- return this.tacEvaluationExternalExpertDao.delete(id);
- }
- /**
- * 导出 稽查专家测评
- *
- * @param tacEvaluationExternalExpertParam 筛选查询参数
- * @param response
- */
- @Override
- public void export(TacEvaluationExternalExpertParam tacEvaluationExternalExpertParam, HttpServletResponse response) {
- logger.debug("TacEvaluationExternalExpert 导出");
- List<TacEvaluationExternalExpert> tacEvaluationExternalExpertList = findList(tacEvaluationExternalExpertParam);
- List<String> columns = new ArrayList<String>() {{
- add("id");
- add("orgId");
- add("adCode");
- add("groupId");
- add("projId");
- add("expertId");
- add("expertName");
- add("expertProf");
- add("businessLevel");
- add("qualityResults");
- add("workStyle");
- add("oneVeto");
- add("score");
- add("evalLevel");
- add("note");
- add("persId");
- add("intm");
- add("uptm");
- }};
- ExportUtil.exportExcel2(tacEvaluationExternalExpertList, response, "稽查专家测评列表", columns, TacEvaluationExternalExpert.class);
- }
- /**
- * 批量添加
- * @param tacEvaluationExternalExpertList
- * @return
- */
- @Override
- public int insertBatchFile(List<TacEvaluationExternalExpert> tacEvaluationExternalExpertList){
- return this.tacEvaluationExternalExpertDao.insertBatchFile(tacEvaluationExternalExpertList);
- }
- /**
- * 待测评的稽查外聘专家列表
- * @param externalExpertParam
- * @return
- */
- @Override
- public List<TacEvaluationExternalExpertVo> selectEavlPersListByGroupId(TacEvaluationExternalExpertParam externalExpertParam){
- return this.tacEvaluationExternalExpertDao.selectEavlPersListByGroupId(externalExpertParam);
- }
- /**
- * 稽查外聘专家测评结果
- * @param externalExpertParam
- * @return
- */
- @Override
- public PageInfo<TacEvaluationExternalExpertVo> findEvaluationResult(TacEvaluationExternalExpertParam externalExpertParam) {
- PageHelper.startPage(externalExpertParam);
- List<TacEvaluationExternalExpertVo> list = this.tacEvaluationExternalExpertDao.findEvaluationResult2(externalExpertParam);
- PageInfo<TacEvaluationExternalExpertVo> pageInfo = new PageInfo(list);
- return pageInfo;
- }
- /**
- * 稽查外聘专家测评结果详情类别
- * @param externalExpertParam
- * @return
- */
- @Override
- public PageInfo<TacEvaluationExternalExpertVo> findEvaluationResultDetails(TacEvaluationExternalExpertParam externalExpertParam){
- PageHelper.startPage(externalExpertParam);
- List<TacEvaluationExternalExpertVo> list = this.tacEvaluationExternalExpertDao.findEvaluationResultDetails(externalExpertParam);
- PageInfo<TacEvaluationExternalExpertVo> pageInfo = new PageInfo(list);
- return pageInfo;
- }
- /**
- * 修改评分
- * @param externalExpertParam
- * @return
- */
- @Override
- public int updateScoreById(TacEvaluationExternalExpert externalExpertParam){
- return this.tacEvaluationExternalExpertDao.updateScoreById(externalExpertParam);
- }
- /**
- * 恢复评分
- * @param id
- * @return
- */
- @Override
- public int revertScoreById(String id){
- TacEvaluationExternalExpert externalExpert = this.tacEvaluationExternalExpertDao.get(id);
- if(null != externalExpert){
- String backup = externalExpert.getBackUp();
- if(StringUtils.isNotBlank(backup)){
- String[] strs = backup.split(",");
- TacEvaluationExternalExpert externalExpertParam = new TacEvaluationExternalExpertParam();
- externalExpertParam.setId(id);
- externalExpertParam.setBusinessLevel(Double.parseDouble(strs[0]));
- externalExpertParam.setQualityResults(Double.parseDouble(strs[1]));
- externalExpertParam.setWorkStyle(Double.parseDouble(strs[2]));
- externalExpertParam.setScore(Double.parseDouble(strs[3]));
- externalExpertParam.setEvalLevel(strs[4]);
- if(strs.length==6){
- externalExpertParam.setNote(strs[5]);
- }
- return this.tacEvaluationExternalExpertDao.revertScoreById(externalExpertParam);
- }
- }
- return 0;
- }
- @Override
- public TacEvaluationExternalExpert selectOneDetailByProjIdAndExpertId(String projId,String expertId){
- return this.tacEvaluationExternalExpertDao.selectOneDetailByProjIdAndExpertId(projId,expertId);
- }
- @Override
- public TacEvaluationExternalExpert selectHjScoreByProjIdAndExpertId(String projId,String expertId){
- return this.tacEvaluationExternalExpertDao.selectHjScoreByProjIdAndExpertId(projId,expertId);
- }
- @Override
- public int insertHjScoreByProjIdAndExpertId(TacEvaluationExternalExpert vo){
- return this.tacEvaluationExternalExpertDao.insert(vo);
- }
- @Override
- public List<TacEvaluationExternalExpertVo> findEvaluationResultDetails2(String expertId,String projId){
- return this.tacEvaluationExternalExpertDao.findEvaluationResultDetails2(expertId,projId);
- }
- }
|