曹煤炭 消防点位扫码后直接跳转至隐患排查项进行操作
parent
a60ce2b85d
commit
f17036abeb
|
@ -518,18 +518,44 @@ public class AppFireRecordController extends BaseController {
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
String errInfo = "success";
|
String errInfo = "success";
|
||||||
PageData pd = this.getPageData();
|
PageData pd = this.getPageData();
|
||||||
if (pd.getString("FIRE_CHECK_ID").equals("undefined") || pd.getString("FIRE_RECORD_ID").equals("undefined") ) {
|
List<PageData> varList = new ArrayList<>();
|
||||||
pd.put("pointId",pd.getString("FIRE_POINT_ID"));
|
if (pd.getString("CORPINFO_ID").equals("6aa255d41602497fa0f934a822820df4") && pd.getString("ISSCAN").equals("1")) {
|
||||||
Page page = new Page();
|
List<PageData> dataList = fireCheckListService.getFireCheckListByPointId(pd);
|
||||||
page.setPd(pd);
|
System.out.println(dataList);
|
||||||
List<PageData> dataList = fireCheckListService.getFireCheckListByAppV2(page);
|
|
||||||
if (dataList.size()>0) {
|
if (dataList.size()>0) {
|
||||||
PageData pageData = dataList.get(0);
|
for (PageData pageData : dataList) {
|
||||||
pd.put("FIRE_CHECK_ID",pageData.getString("FIRE_CHECK_ID"));
|
PageData checkData = new PageData();
|
||||||
pd.put("FIRE_RECORD_ID",pageData.getString("FIRE_RECORD_ID"));
|
checkData.put("FIRE_RECORD_ID",pageData.getString("FIRE_RECORD_ID"));
|
||||||
|
checkData.put("PHONE_REPEAT",pageData.getString("PHONE_REPEAT"));
|
||||||
|
checkData.put("FIRE_CHECK_TYPE",pageData.getString("FIRE_CHECK_TYPE"));
|
||||||
|
checkData.put("FIRE_CHECK_ID",pageData.getString("FIRE_CHECK_ID"));
|
||||||
|
checkData.put("FIRE_PREPARED_ID",pageData.getString("FIRE_PREPARED_ID"));
|
||||||
|
checkData.put("CORPINFO_ID",pd.getString("CORPINFO_ID"));
|
||||||
|
checkData.put("USER_ID",pd.getString("USER_ID"));
|
||||||
|
checkData.put("FIRE_POINT_ID",pd.getString("FIRE_POINT_ID"));
|
||||||
|
if (checkData.getString("PHONE_REPEAT").equals("2")) {
|
||||||
|
// 完全没检查过的清单,初始化一下检查记录
|
||||||
|
PageData fireRecordData = new PageData();
|
||||||
|
initPageDataUtil.initSaveApp(fireRecordData, pageData.getString("USER_ID"));
|
||||||
|
fireRecordData.putAll(pageData);
|
||||||
|
fireRecordData.put("PHONE_REPEAT", "1");
|
||||||
|
pageData.put("PHONE_REPEAT", "1");
|
||||||
|
fireRecordService.saveInfoByPoint(fireRecordData);
|
||||||
|
}
|
||||||
|
List<PageData> checkStandardList = fireCheckStandardService.getAppRiskByPoint(checkData);
|
||||||
|
if (checkStandardList.size()>0) {
|
||||||
|
PageData checkStandData = checkStandardList.get(0);
|
||||||
|
if (checkStandData.getString("ISCHECKED").equals("1")){
|
||||||
|
varList = fireCheckStandardService.getAppRiskByDevice(checkStandData);
|
||||||
|
map.put("EQUIPMENT_POINT_ID",checkStandData.getString("EQUIPMENT_POINT_ID"));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<PageData> varList = fireCheckStandardService.getAppRiskByDevice(pd);
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
varList = fireCheckStandardService.getAppRiskByDevice(pd);
|
||||||
|
}
|
||||||
map.put("result", errInfo);
|
map.put("result", errInfo);
|
||||||
map.put("varData", varList);
|
map.put("varData", varList);
|
||||||
return map;
|
return map;
|
||||||
|
|
|
@ -129,6 +129,8 @@ public interface FireCheckListMapper {
|
||||||
* @Return: java.util.List<com.zcloud.entity.PageData>
|
* @Return: java.util.List<com.zcloud.entity.PageData>
|
||||||
*/
|
*/
|
||||||
List<PageData> getFireCheckListByApplistPageV2(Page pageData);
|
List<PageData> getFireCheckListByApplistPageV2(Page pageData);
|
||||||
|
|
||||||
|
List<PageData> getFireCheckListByPointId(PageData pd);
|
||||||
/**
|
/**
|
||||||
* @Description: 完成记录
|
* @Description: 完成记录
|
||||||
* @Author: dearLin
|
* @Author: dearLin
|
||||||
|
|
|
@ -112,6 +112,7 @@ public interface FireCheckListService {
|
||||||
List<PageData> getFireCheckListCountByApp(PageData pageData);
|
List<PageData> getFireCheckListCountByApp(PageData pageData);
|
||||||
|
|
||||||
List<PageData> getFireCheckListByAppV2(Page page);
|
List<PageData> getFireCheckListByAppV2(Page page);
|
||||||
|
List<PageData> getFireCheckListByPointId(PageData pd);
|
||||||
|
|
||||||
List<PageData> getFireCheckListCountByAppV2(PageData pageData);
|
List<PageData> getFireCheckListCountByAppV2(PageData pageData);
|
||||||
|
|
||||||
|
|
|
@ -421,6 +421,55 @@ public class FireCheckListServiceImpl implements FireCheckListService {
|
||||||
return pageDataLinkedList;
|
return pageDataLinkedList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PageData> getFireCheckListByPointId(PageData pageData) {
|
||||||
|
pageData.put("CYCLETIME", DateUtil.date2Str(new Date()));
|
||||||
|
PageData sysdate = new PageData();
|
||||||
|
sysdate.put("DATE", DateUtil.date2Str(new Date()));
|
||||||
|
try {
|
||||||
|
sysdate = sysDateService.findByDate(sysdate);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
// 根据检查周期生成时间
|
||||||
|
// 首先检查所有该人的清单
|
||||||
|
// todo bug 12427
|
||||||
|
// 现在发现这个人实际有3条待办 但是分页只有十条,查不到其余2条。
|
||||||
|
// 下拉分页后能成功显示点检表
|
||||||
|
// 调大分页数据(或者这个页面不分页=>但是怕数据太多选择调大分页数据)
|
||||||
|
List<PageData> data = fireCheckListMapper.getFireCheckListByPointId(pageData);
|
||||||
|
LinkedList<PageData> pageDataLinkedList = new LinkedList<>();
|
||||||
|
|
||||||
|
PageData finalSysdate = sysdate;
|
||||||
|
data.forEach(item -> {
|
||||||
|
// 检查今天有没有排查过数据
|
||||||
|
pageData.put("FIRE_CHECK_ID", item.get("FIRE_CHECK_ID"));
|
||||||
|
pageData.put("PHONE_REPEAT", 0);
|
||||||
|
PageData today = fireCheckListMapper.getFinshedLog(pageData);
|
||||||
|
if (today == null) {
|
||||||
|
// 今天还没创建过清单 或者填了一半
|
||||||
|
pageData.put("PHONE_REPEAT", 1);
|
||||||
|
PageData todayCreat = fireCheckListMapper.getFinshedLog(pageData);
|
||||||
|
String uuid = UuidUtil.get32UUID();
|
||||||
|
if (todayCreat != null) {
|
||||||
|
// 今天填了一半
|
||||||
|
uuid = todayCreat.getString("FIRE_RECORD_ID");
|
||||||
|
item.put("PHONE_REPEAT", 1);
|
||||||
|
} else {
|
||||||
|
// 今天完全没填过,点击清单检查了就新建数据
|
||||||
|
item.put("PHONE_REPEAT", 2);
|
||||||
|
}
|
||||||
|
String[] periodDate = PeriodDateUtil.getPeriodDate(finalSysdate, (String) item.get("FIRE_CHECK_TYPE"));
|
||||||
|
item.put("FIRE_RECORD_ID", uuid);
|
||||||
|
// 状态已完成 1 填了一半, 2没填过
|
||||||
|
item.put("PERIODSTART", periodDate[0]);
|
||||||
|
item.put("PERIODEND", periodDate[1]);
|
||||||
|
pageDataLinkedList.add(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return pageDataLinkedList;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PageData> getFireCheckListCountByAppV2(PageData pageData) {
|
public List<PageData> getFireCheckListCountByAppV2(PageData pageData) {
|
||||||
pageData.put("CYCLETIME", DateUtil.date2Str(new Date()));
|
pageData.put("CYCLETIME", DateUtil.date2Str(new Date()));
|
||||||
|
|
|
@ -379,6 +379,52 @@
|
||||||
GROUP BY fpc.FIRE_CHECK_ID
|
GROUP BY fpc.FIRE_CHECK_ID
|
||||||
order by cl.CREATTIME desc
|
order by cl.CREATTIME desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getFireCheckListByPointId" parameterType="pd" resultType="com.zcloud.entity.PageData">
|
||||||
|
SELECT cl.FIRE_CHECK_ID,
|
||||||
|
cl.FIRE_CHECK_STANDARD_NAME,
|
||||||
|
cl.FIRE_CHECK_TYPE,
|
||||||
|
COUNT( DISTINCT fpp.FIRE_POINT_ID ) AS ITEMCOUNT,
|
||||||
|
su.`NAME` AS USERNAME,
|
||||||
|
od.`NAME` AS DEPARTMENT,
|
||||||
|
sys_dictionaries.`NAME` BIANMA
|
||||||
|
FROM bus_fire_checklist AS cl
|
||||||
|
LEFT JOIN bus_fire_device_prepared AS fpc ON cl.FIRE_CHECK_ID = fpc.FIRE_CHECK_ID
|
||||||
|
LEFT JOIN bus_fire_point_prepared fpp on cl.FIRE_CHECK_ID = fpp.FIRE_CHECK_ID
|
||||||
|
LEFT JOIN bus_fire_point fp ON fp.FIRE_POINT_ID = fpp.FIRE_POINT_ID
|
||||||
|
LEFT JOIN sys_user AS su ON cl.USER_ID = su.USER_ID
|
||||||
|
LEFT JOIN oa_department AS od ON cl.DEPARTMENT_ID = od.DEPARTMENT_ID
|
||||||
|
LEFT JOIN sys_dictionaries ON cl.FIRE_CHECK_TYPE = sys_dictionaries.BIANMA
|
||||||
|
WHERE cl.ISDELETE = 0
|
||||||
|
AND cl.STATE = 0
|
||||||
|
<if test="pointId != null and pointId != ''">
|
||||||
|
AND fpp.FIRE_POINT_ID = #{pointId}
|
||||||
|
</if>
|
||||||
|
and fpp.ISDELETE = 0
|
||||||
|
and fp.ISDELETE = 0
|
||||||
|
AND fpc.ISDELETE = 0
|
||||||
|
<if test="roleLevel != null and roleLevel != ''"><!-- 权限显示 -->
|
||||||
|
<choose>
|
||||||
|
<!--公司领导-->
|
||||||
|
<when test='roleLevel == "0"'>
|
||||||
|
<if test="CORPINFO_ID!=null and CORPINFO_ID != ''">
|
||||||
|
AND cl.CORPINFO_ID = #{CORPINFO_ID,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
</when>
|
||||||
|
<when test='roleLevel == "1"'>
|
||||||
|
and cl.DEPARTMENT_ID in (${supDeparIds})
|
||||||
|
</when>
|
||||||
|
<when test='roleLevel == "2"'>
|
||||||
|
<if test="USER_ID != null and USER_ID != ''">
|
||||||
|
AND cl.USER_ID = #{USER_ID}
|
||||||
|
</if>
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</if>
|
||||||
|
GROUP BY fpc.FIRE_CHECK_ID
|
||||||
|
order by cl.CREATTIME desc
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getFinshedLog" resultType="com.zcloud.entity.PageData">
|
<select id="getFinshedLog" resultType="com.zcloud.entity.PageData">
|
||||||
SELECT FIRE_RECORD_ID,
|
SELECT FIRE_RECORD_ID,
|
||||||
FIRE_CHECK_ID,
|
FIRE_CHECK_ID,
|
||||||
|
|
|
@ -710,6 +710,9 @@
|
||||||
WHERE
|
WHERE
|
||||||
frp.FIRE_CHECK_ID = #{FIRE_CHECK_ID}
|
frp.FIRE_CHECK_ID = #{FIRE_CHECK_ID}
|
||||||
and frc.FIRE_RECORD_ID = #{FIRE_RECORD_ID}
|
and frc.FIRE_RECORD_ID = #{FIRE_RECORD_ID}
|
||||||
|
<if test="FIRE_POINT_ID != null and FIRE_POINT_ID != ''" >
|
||||||
|
AND fpp.FIRE_POINT_ID = #{FIRE_POINT_ID}
|
||||||
|
</if>
|
||||||
AND frp.ISDELETE = 0
|
AND frp.ISDELETE = 0
|
||||||
AND fpp.ISDELETE = 0
|
AND fpp.ISDELETE = 0
|
||||||
AND t.FIRE_POINT_ID IS NOT NULL
|
AND t.FIRE_POINT_ID IS NOT NULL
|
||||||
|
|
Loading…
Reference in New Issue