Merge branch 'lmy20231215-动火bug修改' into 1212-八项作业迁移

# Conflicts:
#	src/main/java/com/zcloud/controller/system/LoginController.java
main
limingyu 2023-12-25 13:58:14 +08:00
commit 72793b2a76
15 changed files with 809 additions and 41 deletions

View File

@ -827,11 +827,16 @@ public class AppHotWorkApplicationController extends BaseController {
return map;
}
} else {
hotUserList = hotWorkApplicationUserService.listByDepartment(hotUserPd); // 找到这一笔的审批人们
//先判断延时监火是否为选择部门
hotUserList = hotWorkApplicationUserService.listByDepartment(hotUserPd); // 找到这一笔的审批人们(选择部门)
if (hotUserList.size() < 1) {
map.put("result", "error");
map.put("msg", "获取审批人意见失败!请联系管理员");
return map;
//如果查询部门查不到就根据人查询
hotUserList = hotWorkApplicationUserService.listAll(hotUserPd); // 找到这一笔的审批人(选择人)
if (hotUserList.size() != 1) {
map.put("result", "error");
map.put("msg", "获取审批人意见失败!请联系管理员");
return map;
}
}
}

View File

@ -69,38 +69,38 @@ public class AppHotWorkApplicationDelayedController extends BaseController {
map.put("msg", "文件格式不正确!");
return map;
}
Image srcImg = ImageIO.read(file.getInputStream());
//获取图片的宽
int srcImgWidth = srcImg.getWidth(null);
//获取图片的高
int srcImgHeight = srcImg.getHeight(null);
BufferedImage bufImg = new BufferedImage(srcImgWidth, srcImgHeight, BufferedImage.TYPE_INT_RGB);
// 加水印
//创建画笔
Graphics2D g = bufImg.createGraphics();
//srcImg 为上面获取到的原始图片的图片对象
g.drawImage(srcImg, 0, 0, srcImgWidth, srcImgHeight, null);
//根据图片的背景设置水印颜色
g.setColor(new Color(255,255,255,128));
//设置字体 画笔字体样式为微软雅黑加粗文字大小为60pt
g.setFont(new Font("微软雅黑", Font.BOLD, 20));
//设置水印的坐标
int x=(srcImgWidth - WaterMarkUtil.getWatermarkLength(DateUtil.date2Str(new Date()), g)) / 2;
int y=srcImgHeight / 2;
//画出水印 第一个参数是水印内容第二个参数是x轴坐标第三个参数是y轴坐标
g.drawString(DateUtil.date2Str(new Date()), x, y);
g.dispose();
//将加完水印的图片暂存到内存中
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ImageIO.write(bufImg, suffixName, bos);
ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
// Image srcImg = ImageIO.read(file.getInputStream());
// //获取图片的宽
// int srcImgWidth = srcImg.getWidth(null);
// //获取图片的高
// int srcImgHeight = srcImg.getHeight(null);
//
// BufferedImage bufImg = new BufferedImage(srcImgWidth, srcImgHeight, BufferedImage.TYPE_INT_RGB);
// // 加水印
// //创建画笔
// Graphics2D g = bufImg.createGraphics();
// //srcImg 为上面获取到的原始图片的图片对象
// g.drawImage(srcImg, 0, 0, srcImgWidth, srcImgHeight, null);
// //根据图片的背景设置水印颜色
// g.setColor(new Color(255,255,255,128));
// //设置字体 画笔字体样式为微软雅黑加粗文字大小为60pt
// g.setFont(new Font("微软雅黑", Font.BOLD, 20));
// //设置水印的坐标
// int x=(srcImgWidth - WaterMarkUtil.getWatermarkLength(DateUtil.date2Str(new Date()), g)) / 2;
// int y=srcImgHeight / 2;
// //画出水印 第一个参数是水印内容第二个参数是x轴坐标第三个参数是y轴坐标
// g.drawString(DateUtil.date2Str(new Date()), x, y);
// g.dispose();
// //将加完水印的图片暂存到内存中
// ByteArrayOutputStream bos = new ByteArrayOutputStream();
// ImageIO.write(bufImg, suffixName, bos);
// ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
//
String ffile = DateUtil.getDays();
String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
// Smb.sshSftp(file, fileName, Const.FILEPATHYHTP + corpInfoId + "/" + ffile);
//通过流的方式上传文件
Smb.sshSftpForInput(bis, fileName, Const.FILEPATHYHTP + corpInfoId + "/" + ffile);
Smb.sshSftp(file, fileName, Const.FILEPATHYHTP + corpInfoId + "/" + ffile);
// 通过流的方式上传文件
// Smb.sshSftpForInput(bis, fileName, Const.FILEPATHYHTP + corpInfoId + "/" + ffile);
pd.put("FILEPATH",Const.FILEPATHYHTP + corpInfoId + "/" + ffile + "/" + fileName);
}
hotworkapplicationdelayedService.save(pd);

View File

@ -11,6 +11,7 @@ import com.zcloud.service.system.DepartmentService;
import com.zcloud.service.system.DictionariesService;
import com.zcloud.service.system.UsersService;
import com.zcloud.util.Jurisdiction;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@ -48,7 +49,12 @@ public class HomeHighRiskWorkController extends BaseController {
/*风险管控 数据统计*/
//获取高危作业统计数据(申请数[COUNTAPPLY],审批中[COUNTAPPROVE],归档[COUNTARCHIVE]
PageData data = highworkService.statisticsHighRiskWorkByState(pd);
PageData data = new PageData();
if (StringUtils.equals("035958e685cf4850bc40151c5e0617a6",pd.getString("CORPINFO_ID"))) { //一公司
data = highworkService.statisticsHighRiskWorkByStateFirst(pd);
} else {
data = highworkService.statisticsHighRiskWorkByState(pd);
}
map.put("pd", data);
map.put("result", errInfo);
@ -70,7 +76,12 @@ public class HomeHighRiskWorkController extends BaseController {
pd = this.getPageData();
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业
page.setPd(pd);
List<PageData> varList = highworkService.listHighRiskWork(page);
List<PageData> varList = new ArrayList<>();
if (StringUtils.equals("035958e685cf4850bc40151c5e0617a6",pd.getString("CORPINFO_ID"))) { // 一公司
varList = highworkService.listHighRiskWorkFirst(page);
} else {
varList = highworkService.listHighRiskWork(page);
}
map.put("varList", varList);
map.put("result", errInfo);
return map;
@ -93,7 +104,12 @@ public class HomeHighRiskWorkController extends BaseController {
Map<String, Object> chartData = new HashMap<String, Object>();
List<String> legendData = Arrays.asList(new String[]{"动火作业", "临时用电作业", "盲板作业", "高处作业", "有限空间作业", "吊装作业"});
List<PageData> workChart = highworkService.statisticsAllHighRiskWork(pd); //统计高危作业里各作业数
List<PageData> workChart = new ArrayList<>();
if (StringUtils.equals("035958e685cf4850bc40151c5e0617a6",pd.getString("CORPINFO_ID"))) { //一公司
workChart = highworkService.statisticsAllHighRiskWorkFirst(pd); //统计高危作业里各作业数
} else {
workChart = highworkService.statisticsAllHighRiskWork(pd); //统计高危作业里各作业数
}
List seriesData = new ArrayList();
for (int i = 0; i < legendData.size(); i++) {
PageData pie = new PageData();

View File

@ -83,6 +83,9 @@ public class LoginController extends BaseController {
private String gwjBaseimgpath;
@Value("${gwj-backendaddr}")
private String gwjBackendaddr;
@Autowired
private CorpPathService corpPathService;
/**
*
*
@ -284,6 +287,17 @@ public class LoginController extends BaseController {
session.setAttribute(Const.ISSUPERVISE, dpd.getString("ISSUPERVISE")); //把当前用户放入session
FHLOG.save(USERNAME, "成功登录系统", ip); //记录日志
//查询该用户或企业的图片和后端地址
if (!Tools.isEmpty(pd.getString("CORPINFO_ID")) && !pd.getString("CORPINFO_ID").equals("1")) {
PageData pathData = corpPathService.getCorpPathByCorpId(pd);
map.put("picPath",pathData.getString("PIC_PATH"));
map.put("backEndPath", pathData.getString("BACK_END_PATH"));
} else {
PageData pathData = corpPathService.getCorpPathByPersonInfo(pd);
map.put("picPath", pathData.getString("PIC_PATH"));
map.put("backEndPath", pathData.getString("BACK_END_PATH"));
}
}
} else {
token.clear();

View File

@ -100,5 +100,17 @@ public interface HighWorkMapper{
List<PageData> listAllHighRiskWorkLocation(PageData pd);
void editacceptancapplication(PageData pd);
List<PageData> listHighRiskWorkFirst(Page page);
PageData statisticsHighRiskWorkByStateFirst(PageData pd);
/**
*
* @param pd
* @return
* @throws Exception
*/
List<PageData> statisticsAllHighRiskWorkFirst(PageData pd);
}

View File

@ -0,0 +1,13 @@
package com.zcloud.mapper.datasource.system;
import com.zcloud.entity.PageData;
/**
* 访
*/
public interface CorpPathMapper {
PageData getCorpPathByCorpId(PageData pd);
PageData getCorpPathByPersonInfo(PageData pd);
}

View File

@ -103,5 +103,29 @@ public interface HighWorkService{
* @throws Exception
*/
List<PageData> listAllHighRiskWorkLocation(PageData pd)throws Exception;
/**
*
* @param page
* @return
* @throws Exception
*/
List<PageData> listHighRiskWorkFirst(Page page)throws Exception;
/**
* [COUNTAPPLY][COUNTAPPROVE][COUNTARCHIVE]
* @param pd
* @return
* @throws Exception
*/
PageData statisticsHighRiskWorkByStateFirst(PageData pd)throws Exception;
/**
*
* @param pd
* @return
* @throws Exception
*/
List<PageData> statisticsAllHighRiskWorkFirst(PageData pd)throws Exception;
}

View File

@ -176,5 +176,26 @@ public class HighWorkServiceImpl implements HighWorkService {
public List<PageData> listAllHighRiskWorkLocation(PageData pd) throws Exception {
return highworkMapper.listAllHighRiskWorkLocation(pd);
}
@Override
public List<PageData> listHighRiskWorkFirst(Page page) throws Exception {
return highworkMapper.listHighRiskWorkFirst(page);
}
@Override
public PageData statisticsHighRiskWorkByStateFirst(PageData pd) throws Exception {
return highworkMapper.statisticsHighRiskWorkByStateFirst(pd);
}
/**
*
* @param pd
* @return
* @throws Exception
*/
@Override
public List<PageData> statisticsAllHighRiskWorkFirst(PageData pd) throws Exception {
return highworkMapper.statisticsAllHighRiskWorkFirst(pd);
}
}

View File

@ -0,0 +1,25 @@
package com.zcloud.service.system;
import com.zcloud.entity.PageData;
/**
* 访
*/
public interface CorpPathService {
/**
* id访
* @param pd
* @return
* @throws Exception
*/
PageData getCorpPathByCorpId(PageData pd) throws Exception;
/**
* 访
* @param pd
* @return
* @throws Exception
*/
PageData getCorpPathByPersonInfo(PageData pd) throws Exception;
}

View File

@ -0,0 +1,60 @@
package com.zcloud.service.system.impl;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.system.CorpPathMapper;
import com.zcloud.service.system.CorpPathService;
import com.zcloud.util.Tools;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
/**
* 访
*/
@Service
public class CorpPathServiceImpl implements CorpPathService {
@Autowired
private CorpPathMapper corpPathMapper;
@Value("${corp.default.pic-path}")
private String defaultPicPath;
@Value("${corp.default.back-end-path}")
private String defaultBackEndPath;
/**
* id访
* @param pd
* @return
* @throws Exception
*/
@Override
public PageData getCorpPathByCorpId(PageData pd) throws Exception {
PageData data = corpPathMapper.getCorpPathByCorpId(pd);
if (Tools.isEmpty(data)) {
PageData result = new PageData();
result.put("PIC_PATH",defaultPicPath);
result.put("BACK_END_PATH", defaultBackEndPath);
return result;
}
return data;
}
/**
* 访
* @param pd
* @return
* @throws Exception
*/
@Override
public PageData getCorpPathByPersonInfo(PageData pd) throws Exception {
PageData data = corpPathMapper.getCorpPathByPersonInfo(pd);
if ("1".equals(pd.getString("USER_ID")) || Tools.isEmpty(data)) {
PageData result = new PageData();
result.put("PIC_PATH",defaultPicPath);
result.put("BACK_END_PATH", defaultBackEndPath);
return result;
}
return data;
}
}

View File

@ -61,6 +61,9 @@ spring.main.banner-mode=off
#
#qa-regulatory-gwj.api.url=http://192.168.0.79:8008
corp.default.pic-path=https://qgqy.qhdsafety.com/file/
corp.default.back-end-path=http://192.168.151.57:8092/
preventionxgf.api.url=http://192.168.0.31:8992/qa-prevention-xgf/
qa-regulatory-gwj.api.url=http://192.168.0.31:8992/qa-regulatory-gwj/
#?????

View File

@ -64,6 +64,9 @@ spring.main.banner-mode=off
preventionxgf.api.url=http://192.168.0.79:8088/
qa-regulatory-gwj.api.url=http://192.168.0.79:8092/
corp.default.pic-path=https://qgqy.qhdsafety.com/file/
corp.default.back-end-path=http://192.168.151.57:8092/
#?????
smb.host=39.103.224.166
smb.port=22

View File

@ -877,4 +877,519 @@
) f
</select>
<select id="listHighRiskWorkFirst" resultType="com.zcloud.entity.PageData">
SELECT * FROM
(SELECT
f.HOTWORK_ID ID,
f.CHECK_NO WORK_NUMBER,
'动火作业' WORK_TYPE,
CASE
f.APPLY_STATUS
WHEN 0 THEN '动火作业待提交'
WHEN 1 THEN '作业负责人待审核'
WHEN 2 THEN '所在单位待审核'
WHEN 4 THEN '安全管理部门待审核'
WHEN 5 THEN '动火审批人待审核'
WHEN 6 THEN '班长待验票'
WHEN 7 THEN '待验收'
END STATUS_NAME,
CASE WHEN f.APPLY_STATUS = 0 THEN
IFNULL(
GROUP_CONCAT(
REPLACE ( u1.NAME, '/', ',' )),
IFNULL( qu1.`NAME`, '' ))
WHEN f.APPLY_STATUS = 1 THEN
IFNULL(
GROUP_CONCAT(
REPLACE ( u1.NAME, '/', ',' )),
IFNULL( qu1.`NAME`, '' ))
WHEN f.APPLY_STATUS = 2 THEN
IFNULL(
GROUP_CONCAT(
REPLACE ( u2.NAME, '/', ',' )),
IFNULL( qu2.`NAME`, '' ))
WHEN f.APPLY_STATUS = 4 THEN
IFNULL(
GROUP_CONCAT(
REPLACE ( u3.NAME, '/', ',' )),
IFNULL( qu3.`NAME`, '' ))
WHEN f.APPLY_STATUS = 5 THEN
IFNULL(
GROUP_CONCAT(
REPLACE ( u4.NAME, '/', ',' )),
IFNULL( qu4.`NAME`, '' ))
WHEN f.APPLY_STATUS = 6 THEN
IFNULL(
GROUP_CONCAT(
REPLACE ( u5.NAME, '/', ',' )),
IFNULL( qu5.`NAME`, '' ))
WHEN f.APPLY_STATUS = 7 THEN
IFNULL(
GROUP_CONCAT(
REPLACE ( u6.NAME, '/', ',' )),
IFNULL( qu6.`NAME`, '' ))
ELSE
IFNULL(
GROUP_CONCAT(
REPLACE ( u6.NAME, '/', ',' )),
IFNULL( qu6.`NAME`, '' ))
END USER_NAME,
DATE_FORMAT( ifnull( f.OPERATTIME, f.CREATTIME ), '%Y-%m-%d %H:%i:%s' ) OPERATTIME
FROM
bus_hotwork_cfd f
LEFT JOIN sys_user u1 ON u1.USER_ID = f.CONFIRM_USER_ID
LEFT JOIN `qa-gwj-regulatory`.sys_user qu1 ON qu1.USER_ID = f.CONFIRM_USER_ID
LEFT JOIN sys_user u2 ON u2.USER_ID = f.LEADER_USER_ID
LEFT JOIN `qa-gwj-regulatory`.sys_user qu2 ON qu2.USER_ID = f.LEADER_USER_ID
LEFT JOIN sys_user u3 ON u3.USER_ID = f.AUDIT_USER_ID
LEFT JOIN `qa-gwj-regulatory`.sys_user qu3 ON qu3.USER_ID = f.AUDIT_USER_ID
LEFT JOIN sys_user u4 ON u4.USER_ID = f.APPROVE_USER_ID
LEFT JOIN `qa-gwj-regulatory`.sys_user qu4 ON qu4.USER_ID = f.APPROVE_USER_ID
LEFT JOIN sys_user u5 ON u5.USER_ID = f.MONITOR_USER_ID
LEFT JOIN `qa-gwj-regulatory`.sys_user qu5 ON qu5.USER_ID = f.MONITOR_USER_ID
LEFT JOIN sys_user u6 ON u6.USER_ID = f.ACCEPT_USER_ID
LEFT JOIN `qa-gwj-regulatory`.sys_user qu6 ON qu6.USER_ID = f.ACCEPT_USER_ID
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS >= 0
AND f.APPLY_STATUS != 8
<if test="pd.CORPINFO_ID!= null and pd.CORPINFO_ID!=''">
and f.CORPINFO_ID = #{pd.CORPINFO_ID}
</if>
<if test="pd.ids!= null and pd.ids.size()>0">
AND f.CORPINFO_ID IN
<foreach item="item" index="index" collection="pd.ids" open="(" separator="," close=")">
#{pd.ids[${index}]}
</foreach>
</if>
GROUP BY f.HOTWORK_ID
UNION ALL
SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME
FROM
(SELECT
f.electricity_ID ID,
f.CHECK_NO WORK_NUMBER,
'临时用电作业' WORK_TYPE,
case f.APPLY_STATUS
when '0' then '待提交'
when '1' then '待确认'
when '2' then '待审批'
when '3' then '已归档'
when '4' then '已验收'
when '-1' then '已打回'
END STATUS_NAME,
case f.APPLY_STATUS
when '0' then f.APPLY_USER_ID
when '1' then f.ASSURE_USER_ID
when '2' then f.APPROVE_USER_ID
when '3' then f.ACCEPT_USER_ID
when '-1' then f.APPLY_USER_ID
END NEXT_USER_ID,
ifnull(f.OPERATTIME,f.CREATTIME) OPERATTIME
FROM bus_electricity f WHERE f.ISDELETE = '0' AND f.APPLY_STATUS NOT IN ('3','4')
AND date_format(now(),'%Y-%m-%d %H:%i') >= f.WORK_START_DATE AND f.WORK_END_DATE >= date_format(now(),'%Y-%m-%d %H:%i')
<if test="pd.CORPINFO_ID!= null and pd.CORPINFO_ID!=''">
and f.CORPINFO_ID = #{pd.CORPINFO_ID}
</if>
<if test="pd.ids!= null and pd.ids.size()>0">
AND f.CORPINFO_ID IN
<foreach item="item" index="index" collection="pd.ids" open="(" separator="," close=")">
#{pd.ids[${index}]}
</foreach>
</if>
) f
LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID
UNION ALL
SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME
FROM
(SELECT
f.blindboard_ID ID,
f.CHECK_NO WORK_NUMBER,
'盲板作业' WORK_TYPE,
case f.APPLY_STATUS
when '1' then '待确认'
when '2' then '待审批'
when '3' then '已归档'
when '4' then '已打回'
END STATUS_NAME,
case f.APPLY_STATUS
when '1' then bb.OPERATION_UNIT_PERSONCHARGE
when '2' then bb.CORPINFO_APPROVER
when '3' then f.APPLY_USER_ID
when '4' then f.APPLY_USER_ID
END NEXT_USER_ID,
ifnull(f.OPERATTIME,f.CREATTIME) OPERATTIME
FROM bus_blindboard f
LEFT JOIN bus_blindboardinfo bb ON bb.BLINDBOARD_ID = f.BLINDBOARD_ID
WHERE f.ISDELETE = '0' AND f.APPLY_STATUS NOT IN ('3','4')
AND date_format(now(),'%Y-%m-%d %H:%i') >= bb.BOARD_INSTALL_TIME AND bb.BOARD_DISASSEMBLE_TIME >= date_format(now(),'%Y-%m-%d %H:%i')
<if test="pd.CORPINFO_ID!= null and pd.CORPINFO_ID!=''">
and f.CORPINFO_ID = #{pd.CORPINFO_ID}
</if>
<if test="pd.ids!= null and pd.ids.size()>0">
AND f.CORPINFO_ID IN
<foreach item="item" index="index" collection="pd.ids" open="(" separator="," close=")">
#{pd.ids[${index}]}
</foreach>
</if>
) f
LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID
UNION ALL
SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME
FROM
(SELECT
f.HIGHWORK_ID ID,
f.CHECK_NO WORK_NUMBER,
'高处作业' WORK_TYPE,
case f.APPLY_STATUS
when '0' then '待提交'
when '1' then '待确认'
when '2' then '待审核'
when '3' then '待审批'
when '4' then '已归档'
when '5' then '已验收'
when '-2' then '确认打回'
when '-3' then '审核打回'
when '-4' then '审批打回'
when '55' then '待验收'
END STATUS_NAME,
case f.APPLY_STATUS
when '1' then f.CONSTRUCTION_USER_ID
when '2' then f.AUDIT_USER_ID
when '3' then f.APPROVE_USER_ID
when '-2' then f.CREATOR
when '-3' then f.CREATOR
when '-4' then f.CREATOR
when '55' then f.ACCEPT_USER_ID
END NEXT_USER_ID,
ifnull(f.OPERATTIME,f.CREATTIME) OPERATTIME
FROM bus_highwork f WHERE f.ISDELETE = '0' AND f.APPLY_STATUS NOT IN ('4','5','55','-5')
AND date_format(now(),'%Y-%m-%d %H:%i') >= f.WORK_START_DATE AND f.WORK_END_DATE >= date_format(now(),'%Y-%m-%d %H:%i')
<if test="pd.CORPINFO_ID!= null and pd.CORPINFO_ID!=''">
and f.CORPINFO_ID = #{pd.CORPINFO_ID}
</if>
<if test="pd.ids!= null and pd.ids.size()>0">
AND f.CORPINFO_ID IN
<foreach item="item" index="index" collection="pd.ids" open="(" separator="," close=")">
#{pd.ids[${index}]}
</foreach>
</if>
) f
LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID
UNION ALL
SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME
FROM
(SELECT
f.confinedspace_ID ID,
f.WORK_PERMIT_NUMBER WORK_NUMBER,
'有限空间作业' WORK_TYPE,
case f.APPLY_STATUS
when '1' then '待采样'
when '2' then '作业单位责任人确认'
when '3' then '作业现场责任人审核'
when '4' then '管理单位责任人审批'
when '5' then '作业单位责任人验收'
when '6' then '管理单位责任人验收'
when '-2' then '作业单位责任人确认打回'
when '-3' then '作业现场责任人审核打回'
when '-4' then '管理单位责任人审批打回'
when '-5' then '作业单位责任人验收打回'
when '-6' then '管理单位责任人验收打回'
END STATUS_NAME,
case f.APPLY_STATUS
when '1' then f.SAMPLING_ANALYST_ID
when '2' then f.WORK_UNIT_MANAGER_ID
when '3' then f.JOB_SITE_MANAGER_ID
when '4' then f.MANAGEMENT_UNIT_ID
when '5' then f.WORK_UNIT_MANAGER_ID
when '6' then f.MANAGEMENT_UNIT_ID
when '-2' then f.CREATOR
when '-3' then f.CREATOR
when '-4' then f.CREATOR
when '-5' then f.CREATOR
when '-6' then f.CREATOR
END NEXT_USER_ID,
ifnull(f.OPERATTIME,f.CREATTIME) OPERATTIME
FROM bus_confinedspace f WHERE f.ISDELETE = '0' AND f.APPLY_STATUS != '7'
AND date_format(now(),'%Y-%m-%d %H:%i') >= f.WORK_START_DATE AND f.WORK_END_DATE >= date_format(now(),'%Y-%m-%d %H:%i')
<if test="pd.CORPINFO_ID!= null and pd.CORPINFO_ID!=''">
and f.CORPINFO_ID = #{pd.CORPINFO_ID}
</if>
<if test="pd.ids!= null and pd.ids.size()>0">
AND f.CORPINFO_ID IN
<foreach item="item" index="index" collection="pd.ids" open="(" separator="," close=")">
#{pd.ids[${index}]}
</foreach>
</if>
) f
LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID
UNION ALL
SELECT f.ID, f.WORK_NUMBER, f.WORK_TYPE, f.STATUS_NAME, u.NAME USER_NAME, f.OPERATTIME
FROM
(SELECT
f.hoisting_ID ID,
f.NUMBERING WORK_NUMBER,
'吊装作业' WORK_TYPE,
case f.APPLY_STATUS
when '0' then '待提交'
when '1' then '待确认'
when '2' then '待审核'
when '3' then '待审批'
when '4' then '已归档'
when '5' then '已验收'
when '-2' then '确认打回'
when '-3' then '审核打回'
when '-4' then '审批打回'
when '55' then '待验收'
END STATUS_NAME,
case f.APPLY_STATUS
when '1' then f.CONSTRUCTION_JOB_MANAGER_ID
when '2' then f.WORK_UNIT_MANAGER_ID
when '3' then f.BRANCH_APPROVER_ID
when '-2' then f.CREATOR
when '-3' then f.CREATOR
when '-4' then f.CREATOR
when '55' then f.ACCEPTOR_ID
END NEXT_USER_ID,
ifnull(f.OPERATTIME,f.CREATTIME) OPERATTIME
FROM bus_hoisting f
WHERE f.ISDELETE = '0' AND f.APPLY_STATUS NOT IN ('4','5','55','-5')
AND date_format(now(),'%Y-%m-%d %H:%i') >= f.JOB_START_TIME AND f.JOB_END_TIME >= date_format(now(),'%Y-%m-%d %H:%i')
<if test="pd.CORPINFO_ID!= null and pd.CORPINFO_ID!=''">
and f.CORPINFO_ID = #{pd.CORPINFO_ID}
</if>
<if test="pd.ids!= null and pd.ids.size()>0">
AND f.CORPINFO_ID IN
<foreach item="item" index="index" collection="pd.ids" open="(" separator="," close=")">
#{pd.ids[${index}]}
</foreach>
</if>
) f
LEFT JOIN sys_user u ON u.USER_ID = f.NEXT_USER_ID
) f
ORDER BY f.OPERATTIME DESC
</select>
<select id="statisticsHighRiskWorkByStateFirst" resultType="com.zcloud.entity.PageData">
SELECT
SUM(f.COUNTAPPLY) COUNTAPPLY,SUM(f.COUNTAPPROVE) COUNTAPPROVE,SUM(f.COUNTARCHIVE) COUNTARCHIVE
FROM (
SELECT
COUNT( CASE WHEN f.APPLY_STATUS > 0 THEN f.HOTWORK_ID END ) COUNTAPPLY,
COUNT( CASE WHEN f.APPLY_STATUS > 0 AND f.APPLY_STATUS != 8 THEN f.HOTWORK_ID END ) COUNTAPPROVE,
COUNT( CASE WHEN f.APPLY_STATUS = 8 THEN f.HOTWORK_ID END ) COUNTARCHIVE
FROM bus_hotwork_cfd f WHERE f.ISDELETE = '0'
<if test="CORPINFO_ID!= null and CORPINFO_ID!=''">
and f.CORPINFO_ID = #{CORPINFO_ID}
</if>
<if test="ids!= null and ids.size()>0">
AND f.CORPINFO_ID IN
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
#{item}
</foreach>
</if>
UNION ALL
SELECT
(
SELECT
count( 1 )
FROM
bus_electricity f
WHERE
<if test="CORPINFO_ID!= null and CORPINFO_ID!=''">
f.CORPINFO_ID = #{CORPINFO_ID}
</if>
<if test="ids!= null and ids.size()>0">
f.CORPINFO_ID IN
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
#{item}
</foreach>
</if>
AND (
f.APPLY_STATUS != '0' AND f.APPLY_STATUS NOT IN ('3','4')
AND date_format( now(), '%Y-%m-%d %H:%i' ) >= f.WORK_START_DATE
AND f.WORK_END_DATE >= date_format( now(), '%Y-%m-%d %H:%i' )
OR f.APPLY_STATUS IN ( '3', '4' )
)
) COUNTAPPLY,
COUNT(case when f.APPLY_STATUS != '0' AND f.APPLY_STATUS NOT IN ('3','4') AND date_format(now(),'%Y-%m-%d %H:%i') >= f.WORK_START_DATE AND f.WORK_END_DATE >= date_format(now(),'%Y-%m-%d %H:%i') then f.ELECTRICITY_ID end) COUNTAPPROVE,
COUNT(case when f.APPLY_STATUS IN ('3','4') then f.ELECTRICITY_ID end) COUNTARCHIVE
FROM bus_electricity f WHERE f.ISDELETE = '0'
<if test="CORPINFO_ID!= null and CORPINFO_ID!=''">
and f.CORPINFO_ID = #{CORPINFO_ID}
</if>
<if test="ids!= null and ids.size()>0">
AND f.CORPINFO_ID IN
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
#{item}
</foreach>
</if>
UNION ALL
SELECT
(
SELECT
count( 1 )
FROM
bus_blindboard f
LEFT JOIN
bus_blindboardinfo bb ON bb.BLINDBOARD_ID = f.BLINDBOARD_ID
WHERE
<if test="CORPINFO_ID!= null and CORPINFO_ID!=''">
f.CORPINFO_ID = #{CORPINFO_ID}
</if>
<if test="ids!= null and ids.size()>0">
f.CORPINFO_ID IN
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
#{item}
</foreach>
</if>
AND (
f.APPLY_STATUS != '0' AND f.APPLY_STATUS != '3'
AND date_format( now(), '%Y-%m-%d %H:%i' ) >= bb.BOARD_INSTALL_TIME
AND bb.BOARD_DISASSEMBLE_TIME >= date_format( now(), '%Y-%m-%d %H:%i' )
OR f.APPLY_STATUS = '3'
)
) COUNTAPPLY,
COUNT(case when f.APPLY_STATUS != '0' AND f.APPLY_STATUS != '3' AND date_format(now(),'%Y-%m-%d %H:%i') >= bb.BOARD_INSTALL_TIME AND bb.BOARD_DISASSEMBLE_TIME >= date_format(now(),'%Y-%m-%d %H:%i') then f.BLINDBOARD_ID end) COUNTAPPROVE,
COUNT(case when f.APPLY_STATUS = '3' then f.BLINDBOARD_ID end) COUNTARCHIVE
FROM bus_blindboard f
LEFT JOIN bus_blindboardinfo bb ON bb.BLINDBOARD_ID = f.BLINDBOARD_ID
WHERE f.ISDELETE = '0'
<if test="CORPINFO_ID!= null and CORPINFO_ID!=''">
and f.CORPINFO_ID = #{CORPINFO_ID}
</if>
<if test="ids!= null and ids.size()>0">
AND f.CORPINFO_ID IN
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
#{item}
</foreach>
</if>
UNION ALL
SELECT
(
SELECT
count( 1 )
FROM
bus_highwork f
WHERE
<if test="CORPINFO_ID!= null and CORPINFO_ID!=''">
f.CORPINFO_ID = #{CORPINFO_ID}
</if>
<if test="ids!= null and ids.size()>0">
f.CORPINFO_ID IN
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
#{item}
</foreach>
</if>
AND (
f.APPLY_STATUS != '0' AND f.APPLY_STATUS NOT IN ('4','55','5','-5')
AND date_format( now(), '%Y-%m-%d %H:%i' ) >= f.WORK_START_DATE
AND f.WORK_END_DATE >= date_format( now(), '%Y-%m-%d %H:%i' )
OR f.APPLY_STATUS IN ( '4', '55', '5', '-5' )
)
) COUNTAPPLY,
COUNT(case when f.APPLY_STATUS != '0' AND f.APPLY_STATUS NOT IN ('4','55','5','-5') AND date_format(now(),'%Y-%m-%d %H:%i') >= f.WORK_START_DATE AND f.WORK_END_DATE >= date_format(now(),'%Y-%m-%d %H:%i') then f.HIGHWORK_ID end) COUNTAPPROVE,
COUNT(case when f.APPLY_STATUS in ('4','55','5','-5') then f.HIGHWORK_ID end) COUNTARCHIVE
FROM bus_highwork f WHERE f.ISDELETE = '0'
<if test="CORPINFO_ID!= null and CORPINFO_ID!=''">
and f.CORPINFO_ID = #{CORPINFO_ID}
</if>
<if test="ids!= null and ids.size()>0">
AND f.CORPINFO_ID IN
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
#{item}
</foreach>
</if>
UNION ALL
SELECT
(
SELECT
count(1)
FROM
bus_confinedspace f
WHERE
<if test="CORPINFO_ID!= null and CORPINFO_ID!=''">
f.CORPINFO_ID = #{CORPINFO_ID}
</if>
<if test="ids!= null and ids.size()>0">
f.CORPINFO_ID IN
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
#{item}
</foreach>
</if>
AND (
f.APPLY_STATUS != '0' and f.APPLY_STATUS != '7'
AND date_format( now(), '%Y-%m-%d %H:%i' ) >= f.WORK_START_DATE
AND f.WORK_END_DATE >= date_format( now(), '%Y-%m-%d %H:%i' )
OR f.APPLY_STATUS = '7'
)
) COUNTAPPLY,
COUNT(case when f.APPLY_STATUS != '0' and f.APPLY_STATUS != '7' AND date_format(now(),'%Y-%m-%d %H:%i') >= f.WORK_START_DATE AND f.WORK_END_DATE >= date_format(now(),'%Y-%m-%d %H:%i') then f.CONFINEDSPACE_ID end) COUNTAPPROVE,
COUNT(case when f.APPLY_STATUS = '7' then f.CONFINEDSPACE_ID end) COUNTARCHIVE
FROM bus_confinedspace f WHERE f.ISDELETE = '0'
<if test="CORPINFO_ID!= null and CORPINFO_ID!=''">
and f.CORPINFO_ID = #{CORPINFO_ID}
</if>
<if test="ids!= null and ids.size()>0">
AND f.CORPINFO_ID IN
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
#{item}
</foreach>
</if>
UNION ALL
SELECT
(
SELECT
count( 1 )
FROM
bus_hoisting f
WHERE
<if test="CORPINFO_ID!= null and CORPINFO_ID!=''">
f.CORPINFO_ID = #{CORPINFO_ID}
</if>
<if test="ids!= null and ids.size()>0">
f.CORPINFO_ID IN
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
#{item}
</foreach>
</if>
AND (
f.APPLY_STATUS != '0' and f.APPLY_STATUS not in ('4','55','5','-5')
AND date_format( now(), '%Y-%m-%d %H:%i' ) >= f.JOB_START_TIME
AND f.JOB_END_TIME >= date_format( now(), '%Y-%m-%d %H:%i' )
OR f.APPLY_STATUS IN ( '4', '55', '5', '-5' )
)
) COUNTAPPLY,
COUNT(case when f.APPLY_STATUS != '0' and f.APPLY_STATUS not in ('4','55','5','-5') AND date_format(now(),'%Y-%m-%d %H:%i') >= f.JOB_START_TIME AND f.JOB_END_TIME >= date_format(now(),'%Y-%m-%d %H:%i') then f.HOISTING_ID end) COUNTAPPROVE,
COUNT(case when f.APPLY_STATUS IN ('4','55','5','-5') then f.HOISTING_ID end) COUNTARCHIVE
FROM bus_hoisting f WHERE f.ISDELETE = '0'
<if test="CORPINFO_ID!= null and CORPINFO_ID!=''">
and f.CORPINFO_ID = #{CORPINFO_ID}
</if>
<if test="ids!= null and ids.size()>0">
AND f.CORPINFO_ID IN
<foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
#{item}
</foreach>
</if>
) f
</select>
<select id="statisticsAllHighRiskWorkFirst" resultType="com.zcloud.entity.PageData">
SELECT count(*) COUNT FROM bus_hotwork_cfd f WHERE f.ISDELETE = '0' AND f.CORPINFO_ID = #{CORPINFO_ID}
UNION ALL
SELECT count(*) COUNT FROM bus_electricity f WHERE f.ISDELETE = '0' AND f.CORPINFO_ID = #{CORPINFO_ID}
UNION ALL
SELECT count(*) COUNT FROM bus_blindboard f WHERE f.ISDELETE = '0' AND f.CORPINFO_ID = #{CORPINFO_ID}
UNION ALL
SELECT count(*) COUNT FROM bus_highwork f WHERE f.ISDELETE = '0' AND f.CORPINFO_ID = #{CORPINFO_ID}
UNION ALL
SELECT count(*) COUNT FROM bus_confinedspace f WHERE f.ISDELETE = '0' AND f.CORPINFO_ID = #{CORPINFO_ID}
UNION ALL
SELECT count(*) COUNT FROM bus_hoisting f WHERE f.ISDELETE = '0' AND f.CORPINFO_ID = #{CORPINFO_ID}
</select>
</mapper>

View File

@ -134,21 +134,23 @@
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
,dept.NAME as deptName
,if(dept.NAME is null,dept1.NAME,dept.NAME) as deptName
,u.NAME as userName
,su.USERNAME as userName2
, u.USERNAME as userPhone
,dept.DEPARTMENT_ID DEPARTMENT_ID
,if(dept.DEPARTMENT_ID is null,dept1.DEPARTMENT_ID,dept.DEPARTMENT_ID) as DEPARTMENT_ID
,su.USER_TYPE USER_TYPE
,reuser.NAME as REGULATORY_USER_NAME
,redept.NAME as REGULATORY_DEPT_NAME
,if(redept.NAME is null,redept1.NAME,redept.NAME) as REGULATORY_DEPT_NAME
from
<include refid="tableName"></include> f
left join SYS_USER u on u.USER_ID = f.USER_ID
left join bus_specialuser su on su.SPECIALUSER_ID = f.USER_ID
left join oa_department dept on dept.DEPARTMENT_ID = u.DEPARTMENT_ID
left join oa_department dept1 on dept1.DEPARTMENT_ID = f.USER_ID
left join `qa-gwj-regulatory`.SYS_USER reuser on reuser.USER_ID = f.USER_ID and reuser.USERNAME != 'admin'
left join `qa-gwj-regulatory`.SYS_DEPARTMENT redept on redept.DEPARTMENT_ID = reuser.DEPARTMENT_ID
left join `qa-gwj-regulatory`.SYS_DEPARTMENT redept1 on redept1.DEPARTMENT_ID = f.USER_ID
where f.ISDELETE = '0'
<if test="hotIds != null and hotIds.size>0"> <!-- 关键词检索 -->
and(f.FOREIGN_KEY in
@ -216,7 +218,7 @@
f.OPERATTIME,
s.NAME,
f.TYPE,
u.NAME as USER_NAME,
if(u.NAME is null,od.NAME,u.NAME) as USER_NAME,
su.USERNAME as SPECIAL_USER_NAME,
reuser.NAME as REGULATORY_USER_NAME
FROM
@ -225,6 +227,8 @@
left join SYS_USER u on u.USER_ID = f.USER_ID
left join bus_specialuser su on su.SPECIALUSER_ID = f.USER_ID
left join `qa-gwj-regulatory`.SYS_USER reuser on reuser.USER_ID = f.USER_ID and reuser.USERNAME != 'admin'
left join oa_department od on od.DEPARTMENT_ID = f.USER_ID
left join `qa-gwj-regulatory`.SYS_DEPARTMENT rd on rd.DEPARTMENT_ID = f.USER_ID
WHERE
f.FOREIGN_KEY = #{FOREIGN_KEY}
AND f.ISDELETE = '0'

View File

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zcloud.mapper.datasource.system.CorpPathMapper">
<!--表名 -->
<sql id="tableName">
SYS_CORP_PATH
</sql>
<!-- 字段 -->
<sql id="Field">
CORP_PATH_ID,
CORPINFO_ID,
PIC_PATH,
BACK_END_PATH
</sql>
<!-- 字段 -->
<sql id="Field2">
f.CORP_PATH_ID,
f.CORPINFO_ID,
f.PIC_PATH,
f.BACK_END_PATH
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{CORP_PATH_ID},
#{CORPINFO_ID},
#{PIC_PATH},
#{BACK_END_PATH}
</sql>
<select id="getCorpPathByCorpId" resultType="pd">
select
<include refid="Field"/>
from
<include refid="tableName"/>
where
CORPINFO_ID = #{corpId}
</select>
<select id="getCorpPathByPersonInfo" resultType="pd">
select
<include refid="Field2"/>
from
<include refid="tableName"/> f
left join `qa-gwj-prevention`.vi_user_all vua on vua.USER_ID = #{USER_ID}
where f.CORPINFO_ID = vua.CORPINFO_ID
</select>
</mapper>