|
|
|
@ -5,7 +5,11 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
|
import com.ruoyi.kaohe.domain.KhPcEmp;
|
|
|
|
import com.ruoyi.kaohe.domain.KhPcEmp;
|
|
|
|
|
|
|
|
import com.ruoyi.kaohe.domain.KhVote;
|
|
|
|
|
|
|
|
import com.ruoyi.kaohe.domain.KhVoteEmp;
|
|
|
|
import com.ruoyi.kaohe.mapper.KhPcEmpMapper;
|
|
|
|
import com.ruoyi.kaohe.mapper.KhPcEmpMapper;
|
|
|
|
|
|
|
|
import com.ruoyi.kaohe.mapper.KhVoteEmpMapper;
|
|
|
|
|
|
|
|
import com.ruoyi.kaohe.mapper.KhVoteMapper;
|
|
|
|
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 com.ruoyi.kaohe.mapper.KhPingceMapper;
|
|
|
|
import com.ruoyi.kaohe.mapper.KhPingceMapper;
|
|
|
|
@ -26,6 +30,11 @@ public class KhPingceServiceImpl implements IKhPingceService
|
|
|
|
private KhPingceMapper khPingceMapper;
|
|
|
|
private KhPingceMapper khPingceMapper;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private KhPcEmpMapper khPcEmpMapper;
|
|
|
|
private KhPcEmpMapper khPcEmpMapper;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private KhVoteMapper khVoteMapper;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private KhVoteEmpMapper khVoteEmpMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询考核评测
|
|
|
|
* 查询考核评测
|
|
|
|
@ -100,6 +109,42 @@ public class KhPingceServiceImpl implements IKhPingceService
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return r;
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
@Transactional
|
|
|
|
|
|
|
|
public int deleteKhPingceByIds2(Long[] ids)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int r = khPingceMapper.deleteKhPingceByIds(ids);
|
|
|
|
|
|
|
|
for (Long id : ids) {
|
|
|
|
|
|
|
|
//删除原来关联的pcemp
|
|
|
|
|
|
|
|
KhPcEmp query = new KhPcEmp();
|
|
|
|
|
|
|
|
query.setPcId(id);
|
|
|
|
|
|
|
|
List<KhPcEmp> temItems = khPcEmpMapper.selectKhPcEmpList(query);
|
|
|
|
|
|
|
|
List<Long> pcEmpIds = temItems.stream().map(KhPcEmp::getId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
if (pcEmpIds != null && pcEmpIds.size() > 0) {
|
|
|
|
|
|
|
|
khPcEmpMapper.deleteKhPcEmpByIds(pcEmpIds.toArray(new Long[pcEmpIds.size()]));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//删除原来关联的vote及voteemp
|
|
|
|
|
|
|
|
KhVote vote = new KhVote();
|
|
|
|
|
|
|
|
vote.setPingceId(id);
|
|
|
|
|
|
|
|
List<KhVote> votes = khVoteMapper.selectKhVoteList(vote);
|
|
|
|
|
|
|
|
List<Long> vIds = votes.stream().map(KhVote::getId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
if (vIds != null && vIds.size() > 0) {
|
|
|
|
|
|
|
|
//清除vote
|
|
|
|
|
|
|
|
khVoteMapper.deleteKhVoteByIds(vIds.toArray(new Long[vIds.size()]));
|
|
|
|
|
|
|
|
//清除voteemp
|
|
|
|
|
|
|
|
for (Long vId : vIds) {
|
|
|
|
|
|
|
|
KhVoteEmp vemp = new KhVoteEmp();
|
|
|
|
|
|
|
|
vemp.setVoteId(vId);
|
|
|
|
|
|
|
|
List<KhVoteEmp> vEmps = khVoteEmpMapper.selectKhVoteEmpList(vemp);
|
|
|
|
|
|
|
|
List<Long> veIds = vEmps.stream().map(KhVoteEmp::getId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
if(veIds != null && veIds.size() > 0){
|
|
|
|
|
|
|
|
khVoteEmpMapper.deleteKhVoteEmpByIds(veIds.toArray(new Long[veIds.size()]));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return r;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 删除考核评测信息
|
|
|
|
* 删除考核评测信息
|
|
|
|
|