修改未执行日计划接口
This commit is contained in:
parent
a77b66d801
commit
21ab1dbd4f
|
|
@ -13,4 +13,6 @@ public class WorkDetailsVo {
|
|||
|
||||
private String workType;
|
||||
|
||||
private String riskLevel;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.xxl.job.executor.inter.mapper;
|
|||
|
||||
import com.xxl.job.executor.inter.entity.BallUpDownVo;
|
||||
import com.xxl.job.executor.inter.entity.DictVo;
|
||||
import com.xxl.job.executor.inter.entity.WorkDetailsVo;
|
||||
import com.xxl.job.executor.inter.vo.*;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -157,6 +158,9 @@ public interface JjBusinessMapper {
|
|||
*/
|
||||
List<String> getAddWarnByClass(JjBusinessInfoVo vo);
|
||||
|
||||
|
||||
List<String> getAddWarnByTicket(JjBusinessInfoVo vo);
|
||||
|
||||
/**
|
||||
* 删除告警
|
||||
* @param vo
|
||||
|
|
@ -299,7 +303,7 @@ public interface JjBusinessMapper {
|
|||
*/
|
||||
List<JjBusinessInfoVo> getTodayWorkInfo();
|
||||
|
||||
List<String> getClassRisk();
|
||||
List<JjBusinessInfoVo> getClassRisk(@Param("ticketId") String ticketId);
|
||||
|
||||
/**
|
||||
* 查询作业票的班组长及人员数据
|
||||
|
|
@ -310,12 +314,25 @@ public interface JjBusinessMapper {
|
|||
|
||||
/**
|
||||
* 查询工序信息
|
||||
* @param riskId
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
JjBusinessInfoVo getWorkInfo(@Param("id") String riskId);
|
||||
List<WorkDetailsVo> getWorkInfo(@Param("list") List<String> list,@Param("type") String type);
|
||||
|
||||
List<JjBusinessInfoVo> getWarnInfoByType(@Param("type") String datatype);
|
||||
|
||||
String getClassUserId(JjBusinessInfoVo vo);
|
||||
|
||||
/**
|
||||
* 删除施工班组
|
||||
* @param vo
|
||||
*/
|
||||
void delWarnByTeamId(JjBusinessInfoVo vo);
|
||||
|
||||
/**
|
||||
* 查询今日未施工的的是否有这个班组
|
||||
* @param jjBusinessInfoVo
|
||||
* @return
|
||||
*/
|
||||
Integer getTodayWarnInfo(JjBusinessInfoVo jjBusinessInfoVo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.xxl.job.executor.inter.service;
|
|||
import com.xxl.job.core.util.DateUtil;
|
||||
import com.xxl.job.executor.inter.entity.BallUpDownVo;
|
||||
import com.xxl.job.executor.inter.entity.DictVo;
|
||||
import com.xxl.job.executor.inter.entity.WorkDetailsVo;
|
||||
import com.xxl.job.executor.inter.mapper.JjBusinessMapper;
|
||||
import com.xxl.job.executor.inter.utils.StringHelper;
|
||||
import com.xxl.job.executor.inter.vo.FpUserVo;
|
||||
|
|
@ -241,14 +242,12 @@ public class JjBusinessService {
|
|||
vo.setAddGx(String.join(";",addGx));
|
||||
}
|
||||
}
|
||||
if(yRiskIds_copy!=null){
|
||||
//减少的工序
|
||||
yRiskIds_copy.removeAll(riskIds);
|
||||
if(!yRiskIds_copy.isEmpty()){
|
||||
List<String> delGx=mapper.getWorkGxList(yRiskIds_copy);
|
||||
if(delGx!=null &&!delGx.isEmpty()){
|
||||
vo.setDelGx(String.join(";",delGx));
|
||||
}
|
||||
//减少的工序
|
||||
yRiskIds_copy.removeAll(riskIds);
|
||||
if(!yRiskIds_copy.isEmpty()){
|
||||
List<String> delGx=mapper.getWorkGxList(yRiskIds_copy);
|
||||
if(delGx!=null &&!delGx.isEmpty()){
|
||||
vo.setDelGx(String.join(";",delGx));
|
||||
}
|
||||
}
|
||||
List<String> isAdd=mapper.getAddWarnByClass(vo);
|
||||
|
|
@ -359,8 +358,6 @@ public class JjBusinessService {
|
|||
needfpList.add("1");
|
||||
//七日无施工
|
||||
needfpList.add("3");
|
||||
//未执行日计划
|
||||
needfpList.add("11");
|
||||
//新进巴纳祖
|
||||
noNeedList.add("2");
|
||||
//人数变化大
|
||||
|
|
@ -377,6 +374,8 @@ public class JjBusinessService {
|
|||
noNeedList.add("9");
|
||||
//球机时长不足
|
||||
noNeedList.add("10");
|
||||
//未执行日计划
|
||||
noNeedList.add("11");
|
||||
|
||||
//需要平准分配的 预警
|
||||
for (String datatype:needfpList){
|
||||
|
|
@ -746,49 +745,112 @@ public class JjBusinessService {
|
|||
*/
|
||||
public void getWorkGxNoWork() {
|
||||
try{
|
||||
List<String> riskIds=mapper.getClassRisk();
|
||||
List<String> allRiskList=new ArrayList<>();
|
||||
for (String id:riskIds){
|
||||
String[] ids=id.split(",");
|
||||
allRiskList.addAll( Arrays.asList(ids));
|
||||
//
|
||||
JjBusinessInfoVo param=new JjBusinessInfoVo();
|
||||
param.setType("11");
|
||||
param.setWarnDay(DateUtil.getNowDate());
|
||||
List<JjBusinessInfoVo> allList=mapper.getNoWorkList(param);
|
||||
for (JjBusinessInfoVo jjBusinessInfoVo:allList){
|
||||
Integer num=mapper.getTodayWarnInfo(jjBusinessInfoVo);
|
||||
if(num==null || num==0){
|
||||
mapper.delWarnByTeamId(jjBusinessInfoVo);
|
||||
}
|
||||
}
|
||||
//查询今日施工日计划
|
||||
|
||||
// 查询今日作业票未执行的日计划
|
||||
List<JjBusinessInfoVo> list=mapper.getTodayWorkInfo();
|
||||
for (JjBusinessInfoVo vo:list){
|
||||
vo.setType("11");
|
||||
vo.setWarnType("未执行日计划");
|
||||
vo.setWarnDay(DateUtil.getNowDate());
|
||||
if(!allRiskList.contains(vo.getRiskId())){
|
||||
JjBusinessInfoVo ticket=mapper.getTicketData(vo.getTicketId());
|
||||
if(ticket!=null){
|
||||
vo.setRelName(ticket.getRelName());
|
||||
vo.setPhone(ticket.getPhone());
|
||||
vo.setIdCard(ticket.getIdCard());
|
||||
vo.setStartTime(ticket.getStartTime());
|
||||
vo.setVoltageLevel(ticket.getVoltageLevel());
|
||||
vo.setTicketNo(ticket.getTicketNo());
|
||||
vo.setEndTime(ticket.getEndTime());
|
||||
vo.setWorkTeam(ticket.getWorkTeam());
|
||||
vo.setProName(ticket.getProName());
|
||||
JjBusinessInfoVo workInfo=mapper.getWorkInfo(vo.getTClassId());
|
||||
if(workInfo!=null){
|
||||
vo.setTGx(workInfo.getTGx());
|
||||
vo.setYGx(workInfo.getYGx());
|
||||
vo.setWorkContent(workInfo.getWorkContent());
|
||||
vo.setAddGx(workInfo.getAddGx());
|
||||
vo.setRiskLevel(workInfo.getRiskLevel());
|
||||
//今日工序未执行
|
||||
List<String> isAdd=mapper.getAddWarnByClass(vo);
|
||||
if(isAdd==null || isAdd.isEmpty()) {
|
||||
mapper.insertWarnInfo(vo);
|
||||
}else{
|
||||
vo.setKeyId(isAdd.get(0));
|
||||
mapper.updateWarnInfo(vo);
|
||||
}
|
||||
if(StringHelper.isNotEmpty(vo.getRiskId())){
|
||||
String[] str=vo.getRiskId().split(",");
|
||||
List<String> data=Arrays.asList(str);
|
||||
List<String> riskList = new ArrayList<>(data);
|
||||
//已执行的风险作业
|
||||
List<JjBusinessInfoVo> dataList=mapper.getClassRisk(vo.getTicketId());
|
||||
|
||||
|
||||
if(dataList!=null && !dataList.isEmpty()){
|
||||
List<String> classRisk=new ArrayList<>();
|
||||
for (JjBusinessInfoVo riskIds: dataList) {
|
||||
List<String> strings = Arrays.asList(riskIds.getRiskId().split(","));
|
||||
classRisk.addAll(strings);
|
||||
//找到执行中的站班会
|
||||
vo.setTClassId(riskIds.getId());
|
||||
}
|
||||
riskList.removeAll(classRisk);
|
||||
//未执行的风险作业
|
||||
if(!riskList.isEmpty()){
|
||||
JjBusinessInfoVo ticket=mapper.getTicketData(vo.getTicketId());
|
||||
if(ticket!=null){
|
||||
vo.setRelName(ticket.getRelName());
|
||||
vo.setPhone(ticket.getPhone());
|
||||
vo.setIdCard(ticket.getIdCard());
|
||||
vo.setStartTime(ticket.getStartTime());
|
||||
vo.setVoltageLevel(ticket.getVoltageLevel());
|
||||
vo.setTicketNo(ticket.getTicketNo());
|
||||
vo.setEndTime(ticket.getEndTime());
|
||||
vo.setWorkTeam(ticket.getWorkTeam());
|
||||
vo.setProName(ticket.getProName());
|
||||
//-未执行日计划-2,三及
|
||||
WorkDetailsVo twoDetailsVo=getMettingInfo(riskList,"1");
|
||||
if(twoDetailsVo!=null){
|
||||
vo.setRiskLevel("2");
|
||||
//已执行工序
|
||||
vo.setTGx(twoDetailsVo.getWorkGx());
|
||||
vo.setWorkContent(twoDetailsVo.getContent());
|
||||
//工作内容
|
||||
vo.setAddGx(twoDetailsVo.getContent());
|
||||
WorkDetailsVo detailsVo3=getMettingInfo(classRisk,"1");
|
||||
if(detailsVo3!=null){
|
||||
//未执行工序
|
||||
vo.setYGx(detailsVo3.getWorkGx());
|
||||
//未执行工序
|
||||
vo.setDelGx(detailsVo3.getContent());
|
||||
List<String> isAdd=mapper.getAddWarnByTicket(vo);
|
||||
if(isAdd==null || isAdd.isEmpty()) {
|
||||
mapper.insertWarnInfo(vo);
|
||||
}else{
|
||||
vo.setKeyId(isAdd.get(0));
|
||||
mapper.updateWarnInfo(vo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WorkDetailsVo detailsVo=getMettingInfo(riskList,"2");
|
||||
if(detailsVo!=null){
|
||||
//已执行的二三级
|
||||
vo.setRiskLevel("4");
|
||||
//已执行工序
|
||||
vo.setTGx(detailsVo.getWorkGx());
|
||||
vo.setWorkContent(detailsVo.getContent());
|
||||
//工作内容
|
||||
vo.setAddGx(detailsVo.getContent());
|
||||
//已执行工序及内容
|
||||
WorkDetailsVo detailsVo2=getMettingInfo(classRisk,"2");
|
||||
if(detailsVo2!=null){
|
||||
//未执行工序
|
||||
vo.setYGx(detailsVo2.getWorkGx());
|
||||
//未执行工序
|
||||
vo.setDelGx(detailsVo2.getContent());
|
||||
List<String> isAdd=mapper.getAddWarnByTicket(vo);
|
||||
if(isAdd==null || isAdd.isEmpty()) {
|
||||
mapper.insertWarnInfo(vo);
|
||||
}else{
|
||||
vo.setKeyId(isAdd.get(0));
|
||||
mapper.updateWarnInfo(vo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}else{
|
||||
mapper.delWarnByTeamId(vo);
|
||||
}
|
||||
|
||||
}
|
||||
}else{
|
||||
mapper.deleteWarnInfoByClass(vo);
|
||||
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
|
|
@ -796,6 +858,61 @@ public class JjBusinessService {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询 工序及内容
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
public WorkDetailsVo getMettingInfo(List<String> riskList,String type){
|
||||
try{
|
||||
WorkDetailsVo workDetailsVo=new WorkDetailsVo();
|
||||
List<WorkDetailsVo> details=mapper.getWorkInfo(riskList,type);
|
||||
StringBuffer workSite=new StringBuffer();
|
||||
StringBuffer content=new StringBuffer();
|
||||
List<String> gxList=new ArrayList<>();
|
||||
List<String> typeList=new ArrayList<>();
|
||||
if(details!=null && details.size()>0){
|
||||
details.forEach(vo->{
|
||||
if(StringHelper.isNotEmpty(vo.getWorkSite())){
|
||||
if(StringHelper.isNotEmpty(workSite.toString())){
|
||||
workSite.append(";");
|
||||
}
|
||||
workSite.append(vo.getWorkSite());
|
||||
}
|
||||
if(StringHelper.isNotEmpty(vo.getContent())){
|
||||
if(StringHelper.isNotEmpty(content.toString())){
|
||||
content.append(";");
|
||||
}
|
||||
content.append(vo.getContent());
|
||||
content.append("-(").append(vo.getRiskLevel()).append("级风险)");
|
||||
}
|
||||
//工序
|
||||
if(StringHelper.isNotEmpty(vo.getWorkGx())){
|
||||
if(!gxList.contains(vo.getWorkGx())){
|
||||
gxList.add(vo.getWorkGx());
|
||||
}
|
||||
}
|
||||
if(StringHelper.isNotEmpty(vo.getWorkType())){
|
||||
if(!typeList.contains(vo.getWorkType())){
|
||||
typeList.add(vo.getWorkType());
|
||||
}
|
||||
}
|
||||
});
|
||||
workDetailsVo.setWorkType(String.join(";",typeList));
|
||||
workDetailsVo.setWorkSite(workSite.toString());
|
||||
workDetailsVo.setContent(content.toString());
|
||||
workDetailsVo.setWorkGx(String.join(";",gxList));
|
||||
return workDetailsVo;
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public Double getBallUpTime(String puid){
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ public class JJBusinessXxlJob {
|
|||
* 预警管理-工序变化
|
||||
*/
|
||||
@XxlJob("todayGxChange")
|
||||
@PostConstruct
|
||||
public void todayGxChange(){
|
||||
service.todayGxChange();
|
||||
}
|
||||
|
|
@ -88,6 +87,7 @@ public class JJBusinessXxlJob {
|
|||
* 球机配置少
|
||||
*/
|
||||
@XxlJob("getBallFew")
|
||||
|
||||
public void getBallFew(){
|
||||
service.getBallFew();
|
||||
}
|
||||
|
|
@ -112,6 +112,7 @@ public class JJBusinessXxlJob {
|
|||
* 未执行工序
|
||||
*/
|
||||
@XxlJob("getWorkGxNoWork")
|
||||
@PostConstruct
|
||||
public void getWorkGxNoWork(){
|
||||
service.getWorkGxNoWork();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
delete from jj_warn_info
|
||||
where ticket_id=#{ticketId} and type=#{type} AND warn_day=#{warnDay}
|
||||
</delete>
|
||||
|
||||
<delete id="delWarnInfo">
|
||||
delete from jj_warn_info
|
||||
where key_id=#{keyId}
|
||||
|
|
@ -54,6 +55,11 @@
|
|||
delete from jj_warn_info
|
||||
where t_class_id=#{tClassId} and type=#{type} AND warn_day=#{warnDay}
|
||||
</delete>
|
||||
<delete id="delWarnByTeamId">
|
||||
delete from jj_warn_info
|
||||
where y_class_id=#{yClassId} and type=#{type} AND warn_day=#{warnDay}
|
||||
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="getTodayTicketList" resultType="com.xxl.job.executor.inter.vo.JjBusinessInfoVo">
|
||||
|
|
@ -93,7 +99,7 @@
|
|||
</select>
|
||||
<select id="getNoWorkList" resultType="com.xxl.job.executor.inter.vo.JjBusinessInfoVo">
|
||||
select key_id keyId,ticket_id ticketId,t_class_id tClassId,team_id_car idCard
|
||||
from jj_warn_info
|
||||
from jj_warn_info
|
||||
where type=#{type} and warn_day=#{warnDay}
|
||||
</select>
|
||||
<select id="getTicketInfo" resultType="java.lang.Integer">
|
||||
|
|
@ -399,13 +405,26 @@
|
|||
where jcm.current_constr_date=CURRENT_DATE() and jcm.delete_flag=0
|
||||
|
||||
</select>
|
||||
<select id="getWorkInfo" resultType="com.xxl.job.executor.inter.vo.JjBusinessInfoVo">
|
||||
select distinct jrp.id,work_type ,work_procedure tGx,re_assessment_risk_level riskLevel
|
||||
,work_content workContent,work_site_name addGx,jdc.`value` yGx
|
||||
FROM jj_risk_precaution jrp
|
||||
<select id="getWorkInfo" resultType="com.xxl.job.executor.inter.entity.WorkDetailsVo">
|
||||
select distinct
|
||||
jrp.work_site_name workSite , -- 作业部位
|
||||
jrp.work_content content, -- 作业内容
|
||||
jrp.work_procedure workGx, -- 工序
|
||||
jdc.`value` workType, -- 作业类型
|
||||
jrp.re_assessment_risk_level riskLevel
|
||||
FROM jj_risk_precaution jrp
|
||||
left join jj_data_code jdc on jrp.work_type=jdc.code_value and jdc.code='WORK_TYPE'
|
||||
where jrp.id=#{id}
|
||||
limit 1
|
||||
where jrp.id in (
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
)
|
||||
<if test='type=="1"'>
|
||||
and jrp.re_assessment_risk_level in(2,3,'02','03')
|
||||
</if>
|
||||
<if test='type=="2"'>
|
||||
and jrp.re_assessment_risk_level in(4,5,'04','05')
|
||||
</if>
|
||||
</select>
|
||||
<select id="getTicketData" resultType="com.xxl.job.executor.inter.vo.JjBusinessInfoVo">
|
||||
select jtp.real_name relName,jtp.mobile phone,jtp.id_card idCard,jt.voltage_level,jt.ticket_no ticketNo,
|
||||
|
|
@ -414,9 +433,9 @@
|
|||
jt.ticket_no ticketNo,jt.build_unit_code orgId,
|
||||
jt.re_assessment_risk_level riskLevel,jt.single_project_name proName
|
||||
from jj_ticket jt
|
||||
left join jj_ticket_people jtp ON jt.id=jtp.ticket_id and jtp.position_code='0900101'
|
||||
left join jj_ticket_people jtp ON jt.id=jtp.ticket_id and jtp.position_code='0900101' and jtp.position_flag=1
|
||||
where jt.id=#{ticketId} and jtp.mobile is not null
|
||||
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="getUpdown" resultType="com.xxl.job.executor.inter.entity.BallUpDownVo">
|
||||
|
|
@ -425,15 +444,24 @@
|
|||
where puid=#{id} and create_day=CURRENT_DATE()
|
||||
</select>
|
||||
<select id="getTodayWorkInfo" resultType="com.xxl.job.executor.inter.vo.JjBusinessInfoVo">
|
||||
select risk_precaution_id tClassId,planned_start_date,build_unit_code orgId,plan_status,jdp.team_id teamId ,
|
||||
single_project_code proCode,bidding_section_name proName,ticket_id ticketId
|
||||
select GROUP_CONCAT(risk_precaution_id) riskId,
|
||||
any_value(planned_start_date) planned_start_date,
|
||||
any_value(build_unit_code) orgId,
|
||||
any_value(plan_status) plan_status,
|
||||
any_value(jdp.team_id) yClassId ,
|
||||
any_value(single_project_code) proCode,
|
||||
any_value(bidding_section_name) proName,
|
||||
any_value(ticket_id) ticketId
|
||||
from jj_day_plan jdp
|
||||
WHERE planned_start_date=CURRENT_DATE and delete_flag=0
|
||||
and jdp.exec_status!=1 and jdp.tool_box_talk_id is null and jdp.plan_status='04' and risk_precaution_id is not null
|
||||
GROUP BY jdp.team_id
|
||||
</select>
|
||||
<select id="getClassRisk" resultType="java.lang.String">
|
||||
SELECT risk_precaution_id
|
||||
<select id="getClassRisk" resultType="com.xxl.job.executor.inter.vo.JjBusinessInfoVo">
|
||||
SELECT id , risk_precaution_id riskId
|
||||
FROM jj_class_meetting
|
||||
where current_constr_date=CURRENT_DATE
|
||||
AND ticket_id=#{ticketId} and risk_precaution_id is not null
|
||||
</select>
|
||||
<!--查询预警的展板会-->
|
||||
<select id="getClassUserId" resultType="java.lang.String">
|
||||
|
|
@ -441,6 +469,22 @@
|
|||
FROM t_class_metting_check tcmc
|
||||
where class_id= #{tClassId} AND quality_user='AU' and check_user is not null
|
||||
</select>
|
||||
<select id="getAddWarnByTicket" resultType="java.lang.String">
|
||||
select key_id keyId
|
||||
from jj_warn_info
|
||||
where ticket_id=#{ticketId} and type=#{type} AND warn_day=#{warnDay}
|
||||
and risk_level=#{riskLevel}
|
||||
|
||||
</select>
|
||||
<select id="getTodayWarnInfo" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from jj_day_plan jdp
|
||||
WHERE planned_start_date=CURRENT_DATE and delete_flag=0
|
||||
and jdp.exec_status!=1 and jdp.tool_box_talk_id is null and jdp.plan_status='04' and risk_precaution_id is not null
|
||||
and ticket_id=#{ticketId}
|
||||
GROUP BY jdp.team_id
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<update id="deleteWarnInfoByUserId">
|
||||
|
|
|
|||
Loading…
Reference in New Issue