Commit 4859f9b7 authored by KeYong's avatar KeYong

Merge branch 'develop_dl' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl

parents 56dd0956 bfda8e3b
...@@ -481,17 +481,35 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr ...@@ -481,17 +481,35 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr
SELECT SELECT
count( a.is_firefighters = 1 OR NULL ) AS firefightersNum, count( a.is_firefighters = 1 OR NULL ) AS firefightersNum,
count( a.is_firefighters = 0 OR NULL ) AS opertNum, count( a.is_firefighters = 0 OR NULL ) AS opertNum,
COUNT(( a.is_firefighters = 1 AND a.certificate_type IS NOT NULL ) OR NULL ) AS fireCer, COUNT(( a.is_firefighters = 1 AND a.post_qualification IS NOT NULL ) OR NULL ) AS fireCer,
COUNT(( a.is_firefighters = 0 AND a.certificate_type IS NOT NULL ) OR NULL ) AS operCer COUNT(( a.is_firefighters = 0 AND a.post_qualification IS NOT NULL ) OR NULL ) AS operCer
FROM FROM
( (
SELECT SELECT
u.sequence_nbr, u.sequence_nbr,
cfp.fire_management_post, cfp.fire_management_post,
( CASE WHEN cf.sequence_nbr IS NULL THEN 0 ELSE 1 END ) AS is_firefighters, ( CASE WHEN cf.sequence_nbr IS NULL THEN 0 ELSE 1 END ) AS is_firefighters,
cfp.certificate_type cfp.post_qualification
FROM FROM
cb_org_usr u ( SELECT
*
FROM (
SELECT
*
FROM
cb_org_usr cb
LEFT JOIN (
SELECT v.`instance_id`,
max( CASE v.field_code WHEN 'peopleType' THEN v.field_value END ) peopleType
FROM
`cb_dynamic_form_instance` v
WHERE
v.group_code = 246
GROUP BY
v.`instance_id`
) temp ON cb.sequence_nbr = temp.instance_id
) te where te.peopleType in('1601','1602' ) and te.is_delete = 0 ) u
LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = u.sequence_nbr LEFT JOIN cb_firefighters_post cfp ON cfp.org_usr_id = u.sequence_nbr
AND cfp.is_delete = 0 AND cfp.is_delete = 0
LEFT JOIN cb_firefighters cf ON cf.org_usr_id = u.sequence_nbr LEFT JOIN cb_firefighters cf ON cf.org_usr_id = u.sequence_nbr
...@@ -554,7 +572,7 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr ...@@ -554,7 +572,7 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr
WHERE WHERE
@s > DATEDIFF( date_add( curdate(), INTERVAL - DAY ( curdate()) + 1 DAY ), CURDATE() )) t @s > DATEDIFF( date_add( curdate(), INTERVAL - DAY ( curdate()) + 1 DAY ), CURDATE() )) t
LEFT JOIN cb_sign cs ON cs.date = t.date LEFT JOIN cb_sign cs ON cs.date = t.date
LEFT JOIN cb_org_usr ou ON ou.`amos_org_id` = cs.`user_id` LEFT JOIN cb_org_usr ou ON ou.`biz_org_code` = cs.`biz_org_code`
AND ou.is_delete = 0 AND ou.is_delete = 0
LEFT JOIN idx_biz_station_info si ON si.`code` = ou.`code` LEFT JOIN idx_biz_station_info si ON si.`code` = ou.`code`
GROUP BY GROUP BY
...@@ -578,26 +596,24 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr ...@@ -578,26 +596,24 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr
<select id="getUsrSignInfoByBizOrgCode" resultType="java.util.Map"> <select id="getUsrSignInfoByBizOrgCode" resultType="java.util.Map">
SELECT SELECT
count( 1 ) AS total, a.qualifiedNum,
count( DISTINCT cs.user_id ) AS qualifiedNum, a.allNum - a.qualifiedNum AS unQualifiedNum,
( (
count( 1 ) - count( DISTINCT cs.user_id )) AS unQualifiedNum, TRUNCATE ( abs( a.qualifiedNum / IF (( a.allNum = 0 ), 1, a.allNum )) * 100, 2 )) AS qualifiedAbs
(TRUNCATE (
abs(
count( DISTINCT cs.user_id ) /
IF
(( count( 1 ) = 0 ), 1, count( 1 ) )) * 100,
2
)) as qualifiedAbs
FROM FROM
cb_org_usr u (
LEFT JOIN cb_sign cs ON cs.user_id = u.amos_org_id SELECT
WHERE ( SELECT count( DISTINCT user_id ) FROM `cb_sign` WHERE `date` = CURRENT_DATE
u.is_delete = 0
AND u.biz_org_type = 'PERSON'
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND u.`biz_org_code` LIKE concat(#{bizOrgCode}, '%') AND `biz_org_code` LIKE concat(#{bizOrgCode}, '%')
</if> </if>
) AS qualifiedNum,
( SELECT count( 1 ) FROM cb_org_usr WHERE is_delete = 0 AND biz_org_type = 'PERSON'
<if test="bizOrgCode != null and bizOrgCode != ''">
AND `biz_org_code` LIKE concat(#{bizOrgCode}, '%')
</if>
) AS allNum
) a
</select> </select>
<select id="getUserInfoByYJYA" resultType="java.util.Map"> <select id="getUserInfoByYJYA" resultType="java.util.Map">
......
...@@ -97,6 +97,11 @@ public class EquipmentSpecific extends BaseEntity { ...@@ -97,6 +97,11 @@ public class EquipmentSpecific extends BaseEntity {
@TableField("realtime_iot_index_update_date") @TableField("realtime_iot_index_update_date")
private Date realtimeIotIndexUpdateDate; private Date realtimeIotIndexUpdateDate;
@ApiModelProperty(value = "物联设备实时状态,默认0表示正常(绿色#00ff00),1为故障类(黄色 #ffd500),2为火警类(红色#ff0000)")
@TableField("equip_status")
private String equipStatus="0";
@ApiModelProperty(value = "完整二维码") @ApiModelProperty(value = "完整二维码")
@TableField(exist = false) @TableField(exist = false)
private String fullqrCode; private String fullqrCode;
...@@ -170,4 +175,12 @@ public class EquipmentSpecific extends BaseEntity { ...@@ -170,4 +175,12 @@ public class EquipmentSpecific extends BaseEntity {
@TableField("warranty_period") @TableField("warranty_period")
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private Date warrantyPeriod; private Date warrantyPeriod;
@ApiModelProperty(value = "是否遥测")
@TableField(exist = false)
private Boolean isTrend;
@ApiModelProperty(value = "指标单位")
@TableField(exist = false)
private String unit;
} }
package com.yeejoin.equipmanage.common.entity.vo; package com.yeejoin.equipmanage.common.entity.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -61,4 +63,10 @@ public class EquipTypeImgAmountVO { ...@@ -61,4 +63,10 @@ public class EquipTypeImgAmountVO {
@ApiModelProperty(value = "纬度") @ApiModelProperty(value = "纬度")
private Double latitude; private Double latitude;
@ApiModelProperty(value = "物联设备实时状态")
private Double equipStatus;
@ApiModelProperty(value = "车牌号")
private String carNum;
} }
...@@ -26,6 +26,7 @@ import io.swagger.annotations.Api; ...@@ -26,6 +26,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -42,6 +43,7 @@ import java.util.Collection; ...@@ -42,6 +43,7 @@ import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* @author fengwang * @author fengwang
...@@ -497,6 +499,22 @@ public class OrgPersonController extends BaseController { ...@@ -497,6 +499,22 @@ public class OrgPersonController extends BaseController {
return ResponseHelper.buildResponse(iOrgUsrService.personListByBizOrgCode( requestBody.containsKey("bizOrgCode") ? requestBody.get("bizOrgCode").toString() : null)); return ResponseHelper.buildResponse(iOrgUsrService.personListByBizOrgCode( requestBody.containsKey("bizOrgCode") ? requestBody.get("bizOrgCode").toString() : null));
} }
/**
* 根据bizOrgCode查询
* @param
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PersonIdentify
@RequestMapping(value = "/getByCurrent/list", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "查询当前单位或部门自己的人员列表 非父子级", notes = "根据bizOrgCode查询")
public ResponseModel<List<OrgUsr>> personListByCurrent() {
ReginParams reginParams = getSelectedOrgInfo();
return ResponseHelper.buildResponse(iOrgUsrService.personByBizOrgCode( reginParams.getPersonIdentity().getCompanyBizOrgCode()));
}
/** /**
* 根据bizOrgCode查询 * 根据bizOrgCode查询
* @param bizOrgCode * @param bizOrgCode
...@@ -521,6 +539,23 @@ public class OrgPersonController extends BaseController { ...@@ -521,6 +539,23 @@ public class OrgPersonController extends BaseController {
return orgUsrs; return orgUsrs;
} }
/**
* 根据ids查询多人员信息
* @param ids
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/listCompanyByIds", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据ids查询多人员信息 非父子级", notes = "根据ids查询多人员信息")
public List<OrgUsr> listCompanyByIds(@RequestParam List<Long> ids) {
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(BaseEntity::getIsDelete,false);
wrapper.in(OrgUsr::getSequenceNbr,ids);
wrapper.eq(OrgUsr::getBizOrgType,"PERSON");
List<OrgUsr> orgUsrs = orgUsrMapper.selectList(wrapper);
return orgUsrs;
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@RequestMapping(value = "/person/img/{id}", method = RequestMethod.GET) @RequestMapping(value = "/person/img/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "查询人员头像", notes = "根据id查询") @ApiOperation(httpMethod = "GET", value = "查询人员头像", notes = "根据id查询")
......
...@@ -3388,6 +3388,15 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -3388,6 +3388,15 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return baseMapper.selectList(wrapper); return baseMapper.selectList(wrapper);
} }
public List<OrgUsr> personByBizOrgCode(String bizOrgCode){
QueryWrapper<OrgUsr> wrapper = new QueryWrapper<>();
wrapper.eq("is_delete",false);
wrapper.like("biz_org_code",bizOrgCode);
wrapper.eq("biz_org_type","PERSON");
wrapper.isNotNull("amos_org_id");
return baseMapper.selectList(wrapper);
}
public List<OrgUsr> getDetByCompanyId(String companyId){ public List<OrgUsr> getDetByCompanyId(String companyId){
QueryWrapper<OrgUsr> wrapper = new QueryWrapper<>(); QueryWrapper<OrgUsr> wrapper = new QueryWrapper<>();
wrapper.eq("is_delete",false); wrapper.eq("is_delete",false);
......
...@@ -113,6 +113,9 @@ public class EquipmentDetailController extends AbstractBaseController { ...@@ -113,6 +113,9 @@ public class EquipmentDetailController extends AbstractBaseController {
@Value("${equip.enabled}") @Value("${equip.enabled}")
private Boolean enabled; private Boolean enabled;
@Autowired
IEquipmentIndexService equipmentIndexService;
@Value("${iot.code.prefix.have.used:20210003,20210004,20210005}") @Value("${iot.code.prefix.have.used:20210003,20210004,20210005}")
private String haveUsedIotPrefix; private String haveUsedIotPrefix;
...@@ -242,6 +245,10 @@ public class EquipmentDetailController extends AbstractBaseController { ...@@ -242,6 +245,10 @@ public class EquipmentDetailController extends AbstractBaseController {
@RequestParam(required = false) Long stockDetailId) { @RequestParam(required = false) Long stockDetailId) {
EquipmentDate equipmentDate = new EquipmentDate(); EquipmentDate equipmentDate = new EquipmentDate();
EquipmentSpecific equipmentSpecific = equipmentSpecificSerivce.getBaseMapper().selectOne(new QueryWrapper<EquipmentSpecific>().eq("code",code)); EquipmentSpecific equipmentSpecific = equipmentSpecificSerivce.getBaseMapper().selectOne(new QueryWrapper<EquipmentSpecific>().eq("code",code));
EquipmentIndex equipmentIndex = equipmentIndexService.getById(equipmentSpecific.getRealtimeIotIndexId());
equipmentSpecific.setIsTrend(equipmentIndex.getIsTrend());
equipmentSpecific.setUnit(equipmentIndex.getUnit());
FireFightingSystemEntity fightingSystemEntity = new FireFightingSystemEntity(); FireFightingSystemEntity fightingSystemEntity = new FireFightingSystemEntity();
if(!ObjectUtils.isEmpty(equipmentSpecific.getSystemId())){ if(!ObjectUtils.isEmpty(equipmentSpecific.getSystemId())){
fightingSystemEntity = fireFightingSystemService.getOneById(Long.valueOf(equipmentSpecific.getSystemId())); fightingSystemEntity = fireFightingSystemService.getOneById(Long.valueOf(equipmentSpecific.getSystemId()));
......
package com.yeejoin.equipmanage.dto; package com.yeejoin.equipmanage.dto;
import cn.afterturn.easypoi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.util.Date;
...@@ -59,9 +61,16 @@ public class EquipDataDto { ...@@ -59,9 +61,16 @@ public class EquipDataDto {
// //@Excel(name = "品牌", width = 30, orderNum = "4") // //@Excel(name = "品牌", width = 30, orderNum = "4")
// private BigDecimal maintenanceCycle ; // private BigDecimal maintenanceCycle ;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
@com.alibaba.excel.annotation.format.DateTimeFormat("yyyy-MM-dd")
@Excel(name = "生产日期", width = 30, orderNum = "12") @Excel(name = "生产日期", width = 30, orderNum = "12")
private Date productionDate; private Date productionDate;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
@com.alibaba.excel.annotation.format.DateTimeFormat("yyyy-MM-dd")
@Excel(name = "投运日期", width = 30, orderNum = "13") @Excel(name = "投运日期", width = 30, orderNum = "13")
//@Excel(name = "品牌", width = 30, orderNum = "4") //@Excel(name = "品牌", width = 30, orderNum = "4")
private Date deliveryDate; private Date deliveryDate;
......
...@@ -19,6 +19,6 @@ public interface WlCarMileageMapper extends BaseMapper<WlCarMileage> { ...@@ -19,6 +19,6 @@ public interface WlCarMileageMapper extends BaseMapper<WlCarMileage> {
Double totalMileage(String iotCode); Double totalMileage(String iotCode);
List<WlCarMileage> list(); List<WlCarMileage> list(@Param("date") String date);
} }
...@@ -13,6 +13,7 @@ import com.yeejoin.equipmanage.mapper.MarqueeDataMapper; ...@@ -13,6 +13,7 @@ import com.yeejoin.equipmanage.mapper.MarqueeDataMapper;
import com.yeejoin.equipmanage.remote.RemoteSecurityService; import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmLogService; import com.yeejoin.equipmanage.service.IEquipmentSpecificAlarmLogService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.quartz.Job; import org.quartz.Job;
import org.quartz.JobExecutionContext; import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException; import org.quartz.JobExecutionException;
...@@ -67,7 +68,7 @@ public class PumpSendMessage implements Job { ...@@ -67,7 +68,7 @@ public class PumpSendMessage implements Job {
marqueeData.setCreateDate(new Date()); marqueeData.setCreateDate(new Date());
marqueeDataMapper.insert(marqueeData); marqueeDataMapper.insert(marqueeData);
// 稳压泵漏水告警添加告警事件信息 // 稳压泵漏水告警添加告警事件信息
equipmentSpecificAlarmLogService.pressurePumpDisposeAlarm(equipmentSpecific.getId(), equipmentSpecific.getName() + "-" + pressurePumpEnum.getTips()); equipmentSpecificAlarmLogService.pressurePumpDisposeAlarm(equipmentSpecific.getId(), String.format(StringUtils.substring(recordMessage, 13), pressurePumpEnum.getTips()));
} }
model.setBody(body); model.setBody(body);
model.setTitle("漏水提醒"); model.setTitle("漏水提醒");
......
...@@ -1382,7 +1382,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -1382,7 +1382,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override @Override
public List<BuildingTreeVo> getCompanyBuildingTree(String authKey, String type) { public List<BuildingTreeVo> getCompanyBuildingTree(String authKey, String type) {
//1.组装数据 //1.组装数据
List<BuildingTreeVo> companyBuildingList = buildBuildingAndCompanyListVos(authKey, type); List<BuildingTreeVo> companyBuildingList = buildBuildingAndCompanyListVos(authKey, type,"building");
//2.list to tree //2.list to tree
List<BuildingTreeVo> buildingTreeVos = companyBuildingList.stream().filter(a -> companyBuildingList.stream().noneMatch(c -> c.getId().toString().equals(a.getParentId()))).peek(b -> b.setChildren(getCompanyBuildingChildrenTree(b.getId().toString(), companyBuildingList))).collect(Collectors.toList()); List<BuildingTreeVo> buildingTreeVos = companyBuildingList.stream().filter(a -> companyBuildingList.stream().noneMatch(c -> c.getId().toString().equals(a.getParentId()))).peek(b -> b.setChildren(getCompanyBuildingChildrenTree(b.getId().toString(), companyBuildingList))).collect(Collectors.toList());
// 任务 7481 // 任务 7481
...@@ -1442,7 +1442,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -1442,7 +1442,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
} }
private List<BuildingTreeVo> buildBuildingAndCompanyListVos(String authKey, String type) { private List<BuildingTreeVo> buildBuildingAndCompanyListVos(String authKey, String type, String ment) {
if (StringUtils.isEmpty(authKey)) { if (StringUtils.isEmpty(authKey)) {
authKey = this.authKey; authKey = this.authKey;
} }
...@@ -1464,7 +1464,12 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -1464,7 +1464,12 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
vo.setName(orgUsrDto.getBizOrgName()); vo.setName(orgUsrDto.getBizOrgName());
vo.setId(orgUsrDto.getSequenceNbr()); vo.setId(orgUsrDto.getSequenceNbr());
vo.setBizOrgName(orgUsrDto.getBizOrgName()); vo.setBizOrgName(orgUsrDto.getBizOrgName());
//此处为公共接口 未区分导致消防建筑页面树统计错误
if(ment.equals("video")){
vo.setTotal(!StringUtils.isEmpty(orgUsrDto.getBizOrgCode()) ? formInstanceMapper.queryVideoCountByBizOrgCode(orgUsrDto.getBizOrgCode()) : 0L); vo.setTotal(!StringUtils.isEmpty(orgUsrDto.getBizOrgCode()) ? formInstanceMapper.queryVideoCountByBizOrgCode(orgUsrDto.getBizOrgCode()) : 0L);
}else {
vo.setTotal(buildingTreeVos.stream().filter(b -> !ObjectUtils.isEmpty(b.getBizOrgCode()) && b.getBizOrgCode().contains(ObjectUtils.isEmpty(vo.getBizOrgCode())?"":vo.getBizOrgCode()) && "building".equals(b.getGroupType())).count());
}
return vo; return vo;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
// 3.将建筑的bizOrgCode转换为parentId连接树 ,拼接数据准备 // 3.将建筑的bizOrgCode转换为parentId连接树 ,拼接数据准备
...@@ -1488,7 +1493,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -1488,7 +1493,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
@Override @Override
public List<BuildingTreeVo> getBuildingVideoTreeNew() { public List<BuildingTreeVo> getBuildingVideoTreeNew() {
//1.组装数据 //1.组装数据
List<BuildingTreeVo> companyBuildingList = buildBuildingAndCompanyListVos(buildVideoAuthKey, null); List<BuildingTreeVo> companyBuildingList = buildBuildingAndCompanyListVos(buildVideoAuthKey, null,"video");
List<Map<String, Long>> countList = iFormInstanceService.getBuildVideoCount(); List<Map<String, Long>> countList = iFormInstanceService.getBuildVideoCount();
......
...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; ...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.feign.systemctl.model.MessageModel; import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentDefectAlarm; import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentDefectAlarm;
...@@ -608,6 +609,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -608,6 +609,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
BigDecimal minValue = getBigDecimal(map.get("minValues")); BigDecimal minValue = getBigDecimal(map.get("minValues"));
BigDecimal maxValue = getBigDecimal(map.get("maxValues")); BigDecimal maxValue = getBigDecimal(map.get("maxValues"));
BigDecimal nowValue = getBigDecimal(iotDataVO.getValue()); BigDecimal nowValue = getBigDecimal(iotDataVO.getValue());
BigDecimal checkValue = checkUnit(equipmentSpecificIndex.getEquipmentSpecificId(),iotDataVO.getKey().toLowerCase() , nowValue);
if (!ObjectUtils.isEmpty(checkValue)){
nowValue =checkValue;
}
if (nowValue.compareTo(minValue) < 0 || nowValue.compareTo(maxValue) > 0) { if (nowValue.compareTo(minValue) < 0 || nowValue.compareTo(maxValue) > 0) {
String body = ""; String body = "";
if (nowValue.compareTo(minValue) < 0) { if (nowValue.compareTo(minValue) < 0) {
...@@ -660,7 +665,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -660,7 +665,6 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
MessageModel model = new MessageModel(); MessageModel model = new MessageModel();
Map<String, Object> map = fireFightingSystemMapper.getWaterPoolLevel(equipmentSpecificIndex.getEquipmentSpecificId()); Map<String, Object> map = fireFightingSystemMapper.getWaterPoolLevel(equipmentSpecificIndex.getEquipmentSpecificId());
if (!ObjectUtils.isEmpty(map)) { if (!ObjectUtils.isEmpty(map)) {
BigDecimal minValues = new BigDecimal(map.get("minValues").toString());
BigDecimal minValue = getBigDecimal(map.get("minValues")); BigDecimal minValue = getBigDecimal(map.get("minValues"));
BigDecimal maxValue = getBigDecimal(map.get("maxValues")); BigDecimal maxValue = getBigDecimal(map.get("maxValues"));
BigDecimal nowValue = getBigDecimal(iotDataVO.getValue()); BigDecimal nowValue = getBigDecimal(iotDataVO.getValue());
...@@ -678,6 +682,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -678,6 +682,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
} }
nowValue = add.divide(new BigDecimal(i), 2, RoundingMode.HALF_UP); nowValue = add.divide(new BigDecimal(i), 2, RoundingMode.HALF_UP);
} }
BigDecimal checkValue = checkUnit(equipmentSpecificIndex.getEquipmentSpecificId(),iotDataVO.getKey().toLowerCase() , nowValue);
if (!ObjectUtils.isEmpty(checkValue)){
nowValue =checkValue;
}
if (nowValue.compareTo(minValue) < 0 || nowValue.compareTo(maxValue) > 0) { if (nowValue.compareTo(minValue) < 0 || nowValue.compareTo(maxValue) > 0) {
String body = ""; String body = "";
if (nowValue.compareTo(minValue) < 0) { if (nowValue.compareTo(minValue) < 0) {
...@@ -716,6 +724,22 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -716,6 +724,22 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
return alarmFlag; return alarmFlag;
} }
private BigDecimal checkUnit(Long equipmentSpecificId, String indexKey,BigDecimal nowValue){
LambdaQueryWrapper<EquipmentSpecificIndex> lambda = new QueryWrapper<EquipmentSpecificIndex>().lambda();
lambda.eq(EquipmentSpecificIndex :: getEquipmentSpecificId, equipmentSpecificId);
lambda.eq(EquipmentSpecificIndex :: getEquipmentIndexKey, indexKey);
EquipmentSpecificIndex equipmentSpecificIndex = equipmentSpecificIndexMapper.selectOne(lambda);
if (!ObjectUtils.isEmpty(equipmentSpecificIndex) || !ObjectUtils.isEmpty(equipmentSpecificIndex.getUnit())){
if (UnitEnum.MM.getKey().equalsIgnoreCase(equipmentSpecificIndex.getUnit()) || UnitEnum.MM.getName().equals(equipmentSpecificIndex.getUnit())){
BigDecimal divide = new BigDecimal(1000);
nowValue = nowValue.divide(divide,2,BigDecimal.ROUND_HALF_UP);
}else if (UnitEnum.CM.getKey().equalsIgnoreCase(equipmentSpecificIndex.getUnit()) || UnitEnum.CM.getName().equals(equipmentSpecificIndex.getUnit())){
BigDecimal divide = new BigDecimal(100);
nowValue = nowValue.divide(divide,2,BigDecimal.ROUND_HALF_UP);
}
}
return nowValue;
}
private BigDecimal getBigDecimal( Object value ) { private BigDecimal getBigDecimal( Object value ) {
BigDecimal val = null; BigDecimal val = null;
if( value != null ) { if( value != null ) {
...@@ -1731,7 +1755,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -1731,7 +1755,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
marqueeData.setCreateDate(new Date()); marqueeData.setCreateDate(new Date());
marqueeDataMapper.insert(marqueeData); marqueeDataMapper.insert(marqueeData);
// 稳压泵告警事件生成 // 稳压泵告警事件生成
equipmentSpecificAlarmLogService.pressurePumpDisposeAlarm(data.getEquipmentId(), data.getEquipmentSpecificName() + "-" + pressurePumpEnum.getTips()); equipmentSpecificAlarmLogService.pressurePumpDisposeAlarm(data.getEquipmentId(), String.format(org.apache.commons.lang3.StringUtils.substring(recordMessage, 13), pressurePumpEnum.getTips()));
} }
switch (pumpMessageEnum) { switch (pumpMessageEnum) {
......
...@@ -16,8 +16,8 @@ import com.yeejoin.equipmanage.mapper.WlCarMileageMapper; ...@@ -16,8 +16,8 @@ import com.yeejoin.equipmanage.mapper.WlCarMileageMapper;
import com.yeejoin.equipmanage.service.ICarService; import com.yeejoin.equipmanage.service.ICarService;
import com.yeejoin.equipmanage.service.IWlCarMileageService; import com.yeejoin.equipmanage.service.IWlCarMileageService;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.ibatis.logging.Log; import org.slf4j.Logger;
import org.apache.ibatis.logging.LogFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
...@@ -36,6 +36,7 @@ import java.security.NoSuchAlgorithmException; ...@@ -36,6 +36,7 @@ import java.security.NoSuchAlgorithmException;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
/** /**
...@@ -57,7 +58,7 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC ...@@ -57,7 +58,7 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
@Value("${mileage.parameter}") @Value("${mileage.parameter}")
private Double mileageParameter; private Double mileageParameter;
protected Log log = LogFactory.getLog(WlCarMileageServiceImpl.class); private static final Logger log = LoggerFactory.getLogger(HttpUtil.class);
private final String GUIDE_KEY = "813684495d9a3981dd2c7694916fe404"; private final String GUIDE_KEY = "813684495d9a3981dd2c7694916fe404";
...@@ -226,6 +227,8 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC ...@@ -226,6 +227,8 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
List<Map<String, Object>> hasList = this.listMaps(new QueryWrapper<WlCarMileage>() List<Map<String, Object>> hasList = this.listMaps(new QueryWrapper<WlCarMileage>()
.select("COUNT(1) AS count,date").lambda().eq(WlCarMileage::getIotCode, car.getIotCode()) .select("COUNT(1) AS count,date").lambda().eq(WlCarMileage::getIotCode, car.getIotCode())
.between(WlCarMileage::getDate, daylist.get(0), daylist.get(daylist.size() - 1)) .between(WlCarMileage::getDate, daylist.get(0), daylist.get(daylist.size() - 1))
.isNotNull(WlCarMileage::getEndTime)
.ge(WlCarMileage::getTravel, 0.5)
.groupBy(WlCarMileage::getDate)); .groupBy(WlCarMileage::getDate));
Map<String, Object> hasMap = new HashMap<>(); Map<String, Object> hasMap = new HashMap<>();
for (Map<String, Object> mapOne : hasList) { for (Map<String, Object> mapOne : hasList) {
...@@ -276,7 +279,14 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC ...@@ -276,7 +279,14 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
@Override @Override
@Scheduled(cron = "${mileage.segmentation.cron}") @Scheduled(cron = "${mileage.segmentation.cron}")
public void mileageSegmentation() { public void mileageSegmentation() {
List<WlCarMileage> list = this.baseMapper.list(); log.info("轨迹切分定时任务开始执行时间.............{}", LocalDateTime.now());
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
cal.add(Calendar.DATE, -1);
String nowDate = new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime());
log.info("轨迹切分定时任务数据过滤时间.............{}", nowDate);
List<WlCarMileage> list = this.baseMapper.list(nowDate);
log.info("需要切分数据, {}", list);
list.forEach(item -> { list.forEach(item -> {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTime(item.getDate()); calendar.setTime(item.getDate());
...@@ -360,6 +370,7 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC ...@@ -360,6 +370,7 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
} }
}); });
log.info("轨迹切分任务执行完成..............");
} }
......
...@@ -392,7 +392,7 @@ public class DataSourcesImpl implements DataSources { ...@@ -392,7 +392,7 @@ public class DataSourcesImpl implements DataSources {
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class); ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
// 权限处理 // 权限处理
PermissionInterceptorContext.setDataAuthRule(FIRE_WATER_INFO); PermissionInterceptorContext.setDataAuthRule(FIRE_WATER_INFO);
List<OrgMenuDto> orgUsrTree = iOrgUsrService.companyTreeByUserAndType(reginParams, OrgPersonEnum.公司.getKey(), null); List<OrgMenuDto> orgUsrTree = iOrgUsrService.companyTreeByUserAndType(reginParams, null, null);
List<String> stringList = new ArrayList<String>(); List<String> stringList = new ArrayList<String>();
initCompanyList(orgUsrTree, stringList); initCompanyList(orgUsrTree, stringList);
String[] str = stringList.toArray(new String[stringList.size()]); String[] str = stringList.toArray(new String[stringList.size()]);
......
...@@ -142,12 +142,14 @@ public class PlanController extends AbstractBaseController { ...@@ -142,12 +142,14 @@ public class PlanController extends AbstractBaseController {
@RequestMapping(value = "/addPlan", produces = "application/json;charset=UTF-8", method = RequestMethod.POST) @RequestMapping(value = "/addPlan", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse checkPlanAdd(@ApiParam(value = "巡检计划", required = true) @RequestBody Plan param) { public CommonResponse checkPlanAdd(@ApiParam(value = "巡检计划", required = true) @RequestBody Plan param) {
try { try {
if (param.getDayRate() == 1) {
long dayBeginTime = param.getDayBegin().getTime();
if ( param.getDayBegin().getTime()> param.getDayEnd().getTime()){ long dayEndTime = param.getDayEnd().getTime();
throw new BadRequest("开始时间不能大于结束时间"); long diff = (dayEndTime - dayBeginTime) / 1000 / 60;
if (diff < param.getDuration()) {
return CommonResponseUtil.failure("工作时长超出结束时间");
}
} }
String userId = getUserId(); String userId = getUserId();
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams); String loginOrgCode = getOrgCode(reginParams);
...@@ -182,7 +184,9 @@ public class PlanController extends AbstractBaseController { ...@@ -182,7 +184,9 @@ public class PlanController extends AbstractBaseController {
} }
} }
map.put("param", param); map.put("param", param);
return CommonResponseUtil.success(planService.addPlan(map)); Plan plan = planService.addPlan(map);
Object ob = plan != null ? ToJson.tojson(plan) : null;
return CommonResponseUtil.success(ob);
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
return CommonResponseUtil.failure("巡检计划新增失败"); return CommonResponseUtil.failure("巡检计划新增失败");
...@@ -199,7 +203,7 @@ public class PlanController extends AbstractBaseController { ...@@ -199,7 +203,7 @@ public class PlanController extends AbstractBaseController {
@ApiOperation(value = "删除巡检计划", notes = "删除巡检计划") @ApiOperation(value = "删除巡检计划", notes = "删除巡检计划")
@RequestMapping(value = "/deletePlanById", produces = "application/json;charset=UTF-8", method = RequestMethod.POST) @RequestMapping(value = "/deletePlanById", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse deletePlanById( public CommonResponse deletePlanById(
@ApiParam(value = "巡检计划ID", required = true) @RequestParam Integer[] param) { @ApiParam(value = "巡检计划ID", required = true) @RequestParam Long[] param) {
try { try {
planService.delPlanById(param); planService.delPlanById(param);
return CommonResponseUtil.success(); return CommonResponseUtil.success();
...@@ -219,7 +223,7 @@ public class PlanController extends AbstractBaseController { ...@@ -219,7 +223,7 @@ public class PlanController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "另存巡检计划", notes = "另存巡检计划") @ApiOperation(value = "另存巡检计划", notes = "另存巡检计划")
@RequestMapping(value = "/saveAs", produces = "application/json;charset=UTF-8", method = RequestMethod.POST) @RequestMapping(value = "/saveAs", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse planSaveAs(@ApiParam(value = "参数", required = true) @RequestParam Integer[] param) { public CommonResponse planSaveAs(@ApiParam(value = "参数", required = true) @RequestParam Long[] param) {
try { try {
planService.planSaveAs(param); planService.planSaveAs(param);
return CommonResponseUtil.success(); return CommonResponseUtil.success();
......
...@@ -820,7 +820,7 @@ public class PointController extends AbstractBaseController { ...@@ -820,7 +820,7 @@ public class PointController extends AbstractBaseController {
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
return CommonResponseUtil.failure("导入失败"); return CommonResponseUtil.failure(e.getLocalizedMessage());
} }
} }
...@@ -1471,7 +1471,9 @@ public class PointController extends AbstractBaseController { ...@@ -1471,7 +1471,9 @@ public class PointController extends AbstractBaseController {
@ApiParam(value = "巡检点ID") @RequestParam(value = "pointId") Long pointId, @ApiParam(value = "巡检点ID") @RequestParam(value = "pointId") Long pointId,
@ApiParam(value = "设备ID") @RequestParam(value = "classifyId") Long classifyId, @ApiParam(value = "设备ID") @RequestParam(value = "classifyId") Long classifyId,
@ApiParam(value = "路线ID") @RequestParam(value = "routeId") Long routeId) { @ApiParam(value = "路线ID") @RequestParam(value = "routeId") Long routeId) {
return CommonResponseUtil.success(iPointService.queryItemList4RoutePointNew(routeId,pointId, classifyId)); List list = iPointService.queryItemList4RoutePointNew(routeId, pointId, classifyId);
Object ob=list!=null?ToJson.tojson(list):null;
return CommonResponseUtil.success(ob);
} }
/** /**
......
...@@ -214,4 +214,6 @@ public interface PlanTaskMapper extends BaseMapper { ...@@ -214,4 +214,6 @@ public interface PlanTaskMapper extends BaseMapper {
List<Map<String, Object>> getCheckQualifiedEquipInfo(@Param(value="taskDetailId") String taskDetailId); List<Map<String, Object>> getCheckQualifiedEquipInfo(@Param(value="taskDetailId") String taskDetailId);
List<Map<String, Object>> getCheckNotQualifiedEquipInfo(@Param(value="taskDetailId") String taskDetailId); List<Map<String, Object>> getCheckNotQualifiedEquipInfo(@Param(value="taskDetailId") String taskDetailId);
String getCheckIdByDetailId(@Param(value="taskDetailId") String taskDetailId);
} }
package com.yeejoin.amos.patrol.business.feign; package com.yeejoin.amos.patrol.business.feign;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List; import java.util.List;
...@@ -28,6 +28,6 @@ public interface IdxFeign { ...@@ -28,6 +28,6 @@ public interface IdxFeign {
* @Date 2023/04/22 17:46 * @Date 2023/04/22 17:46
*/ */
@PostMapping(value = "/defect/check/list") @PostMapping(value = "/defect/check/list")
FeignClientResult queryDefectByCodes(@RequestBody List<String> codes); FeignClientResult queryDefectByCodes(@RequestBody List<String> codes, @RequestParam String checkId);
} }
...@@ -10,6 +10,7 @@ import com.yeejoin.amos.patrol.business.service.intfc.IPlanService; ...@@ -10,6 +10,7 @@ import com.yeejoin.amos.patrol.business.service.intfc.IPlanService;
import com.yeejoin.amos.patrol.core.util.DateUtil; import com.yeejoin.amos.patrol.core.util.DateUtil;
import com.yeejoin.amos.patrol.core.util.StringUtil; import com.yeejoin.amos.patrol.core.util.StringUtil;
import com.yeejoin.amos.patrol.dao.entity.Plan; import com.yeejoin.amos.patrol.dao.entity.Plan;
import liquibase.pro.packaged.L;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -88,7 +89,7 @@ public class PlanServiceImpl implements IPlanService { ...@@ -88,7 +89,7 @@ public class PlanServiceImpl implements IPlanService {
@Override @Override
@Transactional @Transactional
public void delPlanById(Integer[] param) { public void delPlanById(Long[] param) {
List<Long> ids = new ArrayList<Long>(); List<Long> ids = new ArrayList<Long>();
for(int i=0;i<param.length;i++){ for(int i=0;i<param.length;i++){
ids.add(Long.parseLong(param[i].toString())); ids.add(Long.parseLong(param[i].toString()));
...@@ -112,7 +113,7 @@ public class PlanServiceImpl implements IPlanService { ...@@ -112,7 +113,7 @@ public class PlanServiceImpl implements IPlanService {
} }
@Override @Override
public void planSaveAs(Integer[] param) { public void planSaveAs(Long[] param) {
for(int i=0;i<param.length;i++){ for(int i=0;i<param.length;i++){
planMapper.saveAs(param[i].toString()); planMapper.saveAs(param[i].toString());
} }
......
...@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONArray; ...@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import com.yeejoin.amos.boot.biz.common.constants.RuleConstant; import com.yeejoin.amos.boot.biz.common.constants.RuleConstant;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.component.rule.RuleTrigger; import com.yeejoin.amos.component.rule.RuleTrigger;
...@@ -82,6 +83,7 @@ import java.text.ParseException; ...@@ -82,6 +83,7 @@ import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.*; import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -1809,9 +1811,13 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -1809,9 +1811,13 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
@Override @Override
public Page<HashMap<String, Object>> getPlanTaskPageList(PlanTaskPageParam param) { public Page<HashMap<String, Object>> getPlanTaskPageList(PlanTaskPageParam param) {
CommonPageable commonPageable = new CommonPageable(param.getPageNumber() - 1, param.getPageSize());
if (param.getPageNumber() >= 1) {
param.setPageNumber((param.getPageNumber() - 1)* param.getPageSize());
}
long total = planTaskMapper.countData(param); long total = planTaskMapper.countData(param);
List<HashMap<String, Object>> content = planTaskMapper.planTaskPage(param); List<HashMap<String, Object>> content = planTaskMapper.planTaskPage(param);
Page<HashMap<String, Object>> result = new PageImpl<>(content, param, total); Page<HashMap<String, Object>> result = new PageImpl<>(content, commonPageable, total);
return result; return result;
} }
...@@ -1875,7 +1881,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -1875,7 +1881,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
map.put("task_name", infoMap.get("taskName")); map.put("task_name", infoMap.get("taskName"));
map.put("begin_time", begin); map.put("begin_time", begin);
map.put("end_time", end); map.put("end_time", end);
map.put("task_total_time", infoMap.get("difSecond")); String timestr = DateUtils.secondsToTimeStr(Integer.parseInt( infoMap.get("difSecond").toString()));
map.put("task_total_time",timestr);
map.put("task_status", infoMap.get("taskStatus")); map.put("task_status", infoMap.get("taskStatus"));
Map<String, Object> executeInfoMap = planTaskMapper.getPlanTaskExecuteInfo(taskDetailId); Map<String, Object> executeInfoMap = planTaskMapper.getPlanTaskExecuteInfo(taskDetailId);
// 执行情况参数 // 执行情况参数
...@@ -1899,7 +1906,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -1899,7 +1906,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
qualified_task_percent = 0.0; qualified_task_percent = 0.0;
log.error("-----------------------------应巡查总数是 0,请检查!-----------------------------"); log.error("-----------------------------应巡查总数是 0,请检查!-----------------------------");
} else { } else {
qualified_task_percent = (Double.valueOf(real_count) / Double.valueOf(total_count)) * 100; qualified_task_percent = (Double.valueOf(qualified_count) / Double.valueOf(total_count)) * 100;
} }
map.put("qualified_equip_rate", qualified_task_percent); map.put("qualified_equip_rate", qualified_task_percent);
int missed_count = Integer.valueOf(String.valueOf(executeInfoMap.get("missed_equip_num"))); int missed_count = Integer.valueOf(String.valueOf(executeInfoMap.get("missed_equip_num")));
...@@ -1913,10 +1920,11 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -1913,10 +1920,11 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
} }
map.put("missed_equip_rate", miss_task_percent); map.put("missed_equip_rate", miss_task_percent);
List<String> codes = planTaskMapper.getDefinitionObjCode(taskDetailId); List<String> codes = planTaskMapper.getDefinitionObjCode(taskDetailId);
String checkId = planTaskMapper.getCheckIdByDetailId(taskDetailId);
FeignClientResult responseModel = new FeignClientResult(); FeignClientResult responseModel = new FeignClientResult();
List result = new ArrayList(); List result = new ArrayList();
try { try {
responseModel = idxFeign.queryDefectByCodes(codes); responseModel = idxFeign.queryDefectByCodes(codes, checkId);
result = (List) responseModel.getResult(); result = (List) responseModel.getResult();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
...@@ -1937,15 +1945,21 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -1937,15 +1945,21 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
defectMap.put("defect_num", x.getDefectNum()); defectMap.put("defect_num", x.getDefectNum());
defectMap.put("defect_level", DefectLevelEnum.getByKey(x.getDefectLevel()).getValue()); defectMap.put("defect_level", DefectLevelEnum.getByKey(x.getDefectLevel()).getValue());
defectMap.put("defect_equip_name", x.getDefectEquipmentName()); defectMap.put("defect_equip_name", x.getDefectEquipmentName());
StringBuffer sb = new StringBuffer();
if (!StringUtils.isEmpty(x.getDefectEquipmentIds())){
if (x.getDefectEquipmentIds().contains(",")){
String[] ids = x.getDefectEquipmentIds().split(","); String[] ids = x.getDefectEquipmentIds().split(",");
List<String> equipIds = Arrays.asList(ids); List<String> equipIds = Arrays.asList(ids);
StringBuffer sb = new StringBuffer();
if (0 < equipIds.size()) { if (0 < equipIds.size()) {
for (String s : equipIds) { for (String s : equipIds) {
sb.append(planTaskMapper.getDefectEquipInfo(s).get("equipLocation")).append(","); sb.append(planTaskMapper.getDefectEquipInfo(x.getDefectEquipmentIds()) == null ? "": planTaskMapper.getDefectEquipInfo(x.getDefectEquipmentIds()) .get("equipLocation")).append(",");
}
}
}else {
sb.append(planTaskMapper.getDefectEquipInfo(x.getDefectEquipmentIds()) == null ? "": planTaskMapper.getDefectEquipInfo(x.getDefectEquipmentIds()) .get("equipLocation"));
} }
} }
defectMap.put("defect_equip_position", sb.length() > 0 ? sb.deleteCharAt(sb.length() - 1).toString() : ""); defectMap.put("defect_equip_position", sb == null ? "" :sb);
defectMap.put("defect_equip_describe", x.getDefectDescribe()); defectMap.put("defect_equip_describe", x.getDefectDescribe());
defectMap.put("defect_report_time", sdf.format(x.getAddTime())); defectMap.put("defect_report_time", sdf.format(x.getAddTime()));
defectMap.put("defect_discovery_name", x.getDefectDiscover()); defectMap.put("defect_discovery_name", x.getDefectDiscover());
......
...@@ -191,7 +191,7 @@ public class PointServiceImpl implements IPointService { ...@@ -191,7 +191,7 @@ public class PointServiceImpl implements IPointService {
// BeanUtils.copyProperties(param, point); // BeanUtils.copyProperties(param, point);
int count = iPointDao.findByPointNo(param.getPointNo(), orgCode); int count = iPointDao.findByPointNo(param.getPointNo(), orgCode);
if (count > 0) {// 该单位已存在该编号的点 if (count > 0) {// 该单位已存在该编号的点
continue; throw new BadRequest(param.getPointNo()+"该编号已存在");
} }
if (ObjectUtils.isEmpty(param.getChargePersonId())) { if (ObjectUtils.isEmpty(param.getChargePersonId())) {
throw new BadRequest("责任人不能为空"); throw new BadRequest("责任人不能为空");
......
...@@ -25,12 +25,12 @@ public interface IPlanService { ...@@ -25,12 +25,12 @@ public interface IPlanService {
/** /**
* 巡检计划删除 * 巡检计划删除
*/ */
void delPlanById(Integer[] param); void delPlanById(Long[] param);
/** /**
* 巡检计划另存 * 巡检计划另存
*/ */
void planSaveAs(Integer[] param); void planSaveAs(Long[] param);
/** /**
* 巡检路线查询 * 巡检路线查询
*/ */
......
...@@ -13,6 +13,7 @@ public class CheckInfoVo { ...@@ -13,6 +13,7 @@ public class CheckInfoVo {
private String pointNo; private String pointNo;
private String userId; private String userId;
private String depId; private String depId;
private String address;
@Excel(name = "执行人员", orderNum = "2") @Excel(name = "执行人员", orderNum = "2")
private String userName; private String userName;
@Excel(name = "执行部门", orderNum = "3") @Excel(name = "执行部门", orderNum = "3")
...@@ -140,6 +141,15 @@ public class CheckInfoVo { ...@@ -140,6 +141,15 @@ public class CheckInfoVo {
public String getCheckMode() { public String getCheckMode() {
return checkMode; return checkMode;
} }
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public void setCheckMode(String checkMode) { public void setCheckMode(String checkMode) {
this.checkMode = checkMode; this.checkMode = checkMode;
} }
......
...@@ -201,6 +201,7 @@ public class JobService implements IJobService { ...@@ -201,6 +201,7 @@ public class JobService implements IJobService {
iPlanTaskDetailDao.saveAndFlush(action); iPlanTaskDetailDao.saveAndFlush(action);
}); });
} }
log.info("更新plan_task 和 plan_task_detail表完成,planTask:{}", planTask);
// 巡检站端与中心级数据同步 // 巡检站端与中心级数据同步
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() { TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
@Override @Override
......
...@@ -753,4 +753,47 @@ ...@@ -753,4 +753,47 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="maoy" id="202300511-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="wl_equipment_specific" columnName="equip_status"/>
</not>
</preConditions>
<comment>wl_equipment_specific新增属性字段 equip_status</comment>
<sql>
ALTER TABLE `wl_equipment_specific`
ADD COLUMN `equip_status` varchar(20) NULL DEFAULT 0 COMMENT '物联设备实时状态,默认0表示正常(绿色),1为故障类(黄色),2为火警类(红色)' ;
</sql>
</changeSet>
<changeSet author="maoy" id="202300511-2">
<preConditions onFail="MARK_RAN">
<columnExists tableName="wl_equipment_specific" columnName="equip_status"/>
</preConditions>
<comment>wl_equipment_specific字段 equip_status 初始化</comment>
<sql>
UPDATE wl_equipment_specific es SET es.equip_status = IFNULL((
SELECT
(
CASE
WHEN find_in_set(
'FIREALARM',
GROUP_CONCAT(esa.type)
) > 0 THEN
'2'
ELSE
'1'
END
) s
FROM
`wl_equipment_specific_alarm` esa
WHERE
esa.equipment_specific_id = es.id
AND esa.`status` = TRUE
GROUP BY
esa.equipment_specific_id
),'0') ;
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -1870,7 +1870,7 @@ ...@@ -1870,7 +1870,7 @@
wlai.`name` manufacturerName, wlai.`name` manufacturerName,
wlc.car_num as code, wlc.car_num as code,
wlc.iot_code as iotCode, wlc.iot_code as iotCode,
wlc.car_num, wlc.car_num as carNum,
CASE CASE
wlc.car_state wlc.car_state
WHEN '1' THEN WHEN '1' THEN
...@@ -1976,9 +1976,10 @@ ...@@ -1976,9 +1976,10 @@
wles.create_date as createDate, wles.create_date as createDate,
wled.code as eqtype, wled.code as eqtype,
wles.biz_org_code as bizOrgCode, wles.biz_org_code as bizOrgCode,
wles.biz_org_name as bizOrgName wles.biz_org_name as bizOrgName,
wles.equip_status as equipStatus
FROM FROM
(select id,name,qr_code,code ,iot_code ,biz_org_code,team_id ,biz_org_name,create_date ,equipment_detail_id ,system_id from wl_equipment_specific) wles (select id,name,qr_code,code ,iot_code ,biz_org_code,team_id ,biz_org_name,create_date ,equipment_detail_id ,system_id,equip_status from wl_equipment_specific) wles
LEFT JOIN (select id,amount,status,equipment_specific_id,warehouse_structure_id from wl_stock_detail ) wlsd on wlsd.equipment_specific_id = wles.id LEFT JOIN (select id,amount,status,equipment_specific_id,warehouse_structure_id from wl_stock_detail ) wlsd on wlsd.equipment_specific_id = wles.id
LEFT JOIN wl_warehouse_structure wlws on wlsd.warehouse_structure_id = wlws.id LEFT JOIN wl_warehouse_structure wlws on wlsd.warehouse_structure_id = wlws.id
LEFT JOIN (select id,standard ,name ,area ,code, equipment_id ,manufacturer_id,is_import from wl_equipment_detail) wled on wles.equipment_detail_id = wled.id LEFT JOIN (select id,standard ,name ,area ,code, equipment_id ,manufacturer_id,is_import from wl_equipment_detail) wled on wles.equipment_detail_id = wled.id
...@@ -2093,9 +2094,10 @@ ...@@ -2093,9 +2094,10 @@
wles.create_date as createDate, wles.create_date as createDate,
wled.code as eqtype, wled.code as eqtype,
wles.biz_org_code as bizOrgCode, wles.biz_org_code as bizOrgCode,
wles.biz_org_name as bizOrgName wles.biz_org_name as bizOrgName,
wles.equip_status as equipStatus
FROM FROM
(select id,qr_code,code ,iot_code ,biz_org_code ,team_id,biz_org_name,create_date ,equipment_detail_id ,system_id from wl_equipment_specific) wles (select id,qr_code,code ,iot_code ,biz_org_code ,team_id,biz_org_name,create_date ,equipment_detail_id ,system_id ,equip_status from wl_equipment_specific) wles
LEFT JOIN (select id,amount,status,equipment_specific_id,warehouse_structure_id from wl_stock_detail ) wlsd on wlsd.equipment_specific_id = wles.id LEFT JOIN (select id,amount,status,equipment_specific_id,warehouse_structure_id from wl_stock_detail ) wlsd on wlsd.equipment_specific_id = wles.id
LEFT JOIN wl_warehouse_structure wlws on wlsd.warehouse_structure_id = wlws.id LEFT JOIN wl_warehouse_structure wlws on wlsd.warehouse_structure_id = wlws.id
LEFT JOIN (select id,standard ,name ,area ,code, equipment_id ,manufacturer_id,is_import from wl_equipment_detail) wled on wles.equipment_detail_id = wled.id LEFT JOIN (select id,standard ,name ,area ,code, equipment_id ,manufacturer_id,is_import from wl_equipment_detail) wled on wles.equipment_detail_id = wled.id
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
FROM FROM
`wl_car_mileage` wcm `wl_car_mileage` wcm
WHERE WHERE
wcm.date = DATE_FORMAT( NOW( ), '%Y-%m-%d' ) wcm.date = #{date}
AND wcm.start_time IS NOT NULL AND wcm.start_time IS NOT NULL
AND wcm.end_time IS NULL AND wcm.end_time IS NULL
</select> </select>
......
...@@ -1165,13 +1165,13 @@ ...@@ -1165,13 +1165,13 @@
LEFT JOIN p_route pr ON pr.id = ppk.route_id LEFT JOIN p_route pr ON pr.id = ppk.route_id
<where> <where>
<if test="param.userId != null "> find_in_set(#{param.userId}, ppk.user_id) </if> <if test="param.userId != null "> find_in_set(#{param.userId}, ppk.user_id) </if>
<if test="param.beginTime != null and param.beginTime != '' "> and ppk.begin_time <![CDATA[>=]]> #{param.beginTime} </if> <if test="param.beginDate != null and param.beginDate != '' "> ppk.begin_time <![CDATA[>=]]> #{param.beginDate} </if>
<if test="param.endTime != null and param.endTime != ''"> and ppk.end_time <![CDATA[<=]]> #{param.endTime} </if> <if test="param.endDate != null and param.endDate != ''"> and ppk.end_time <![CDATA[<=]]> #{param.endDate} </if>
<if test="param.taskName != null"> and pp.name like concat(concat("%", #{param.taskName}), "%") </if> <if test="param.taskName != null and param.taskName != ''"> and pp.name like concat('%',#{param.taskName},'%') </if>
<if test="param.routeId!=null"> and ppk.route_id = #{param.routeId} </if> <if test="param.status != null"> and pptd.STATUS = #{param.status} </if>
<if test="param.routeId != null"> and ppk.route_id = #{param.routeId} </if>
<if test="param.bizOrgCode != null"> and pp.biz_org_code like concat('%',#{param.bizOrgCode},'%') </if>
</where> </where>
ORDER BY
ppk.begin_time DESC
</select> </select>
<select id="planTaskPage" resultType="java.util.HashMap"> <select id="planTaskPage" resultType="java.util.HashMap">
...@@ -1193,17 +1193,18 @@ ...@@ -1193,17 +1193,18 @@
LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id LEFT JOIN p_plan_task_detail pptd ON pptd.task_no = ppk.id
LEFT JOIN p_route pr ON pr.id = ppk.route_id LEFT JOIN p_route pr ON pr.id = ppk.route_id
<where> <where>
<if test="param.beginTime != null and param.beginTime != '' "> ppk.begin_time <![CDATA[>=]]> #{param.beginTime} </if> <if test="param.beginDate != null and param.beginDate != '' "> ppk.begin_time <![CDATA[>=]]> #{param.beginDate} </if>
<if test="param.endTime != null and param.endTime != ''"> and ppk.end_time <![CDATA[<=]]> #{param.endTime} </if> <if test="param.endDate != null and param.endDate != ''"> and ppk.end_time <![CDATA[<=]]> #{param.endDate} </if>
<if test="param.taskName != null and param.taskName != ''"> and pp.name like concat(concat("%", #{param.taskName}), "%") </if> <if test="param.taskName != null and param.taskName != ''"> and pp.name like concat('%',#{param.taskName},'%') </if>
<if test="param.status != null"> and pptd.STATUS = #{param.status} </if> <if test="param.status != null"> and pptd.STATUS = #{param.status} </if>
<if test="param.routeId != null"> and ppk.route_id = #{param.routeId} </if> <if test="param.routeId != null"> and ppk.route_id = #{param.routeId} </if>
<if test="param.bizOrgCode != null"> and pp.biz_org_code like concat('%',#{param.bizOrgCode},'%') </if>
</where> </where>
ORDER BY ORDER BY
ppk.begin_time DESC ppk.begin_time DESC
<choose> <choose>
<when test="param.pageSize==-1"></when> <when test="param.pageSize==-1"></when>
<when test="param.pageSize!=-1">limit #{param.offset}, #{param.pageSize}</when> <when test="param.pageSize!=-1">limit #{param.pageNumber}, #{param.pageSize}</when>
</choose> </choose>
</select> </select>
...@@ -1215,7 +1216,7 @@ ...@@ -1215,7 +1216,7 @@
pp.biz_org_name AS stationName, pp.biz_org_name AS stationName,
ppk.begin_time AS beginTime, ppk.begin_time AS beginTime,
ppk.end_time AS endTime, ppk.end_time AS endTime,
SEC_TO_TIME(UNIX_TIMESTAMP(ppk.end_time) - UNIX_TIMESTAMP(ppk.begin_time)) AS difSecond, (UNIX_TIMESTAMP(ppk.end_time) - UNIX_TIMESTAMP(ppk.begin_time)) AS difSecond,
( CASE pptd.is_finish WHEN 0 THEN '未完成' WHEN 1 THEN '已完成' WHEN 2 THEN '超时漏检' END ) AS taskStatus ( CASE pptd.is_finish WHEN 0 THEN '未完成' WHEN 1 THEN '已完成' WHEN 2 THEN '超时漏检' END ) AS taskStatus
FROM FROM
`p_plan_task` ppk `p_plan_task` ppk
...@@ -1233,42 +1234,40 @@ ...@@ -1233,42 +1234,40 @@
FROM FROM
p_plan_task_detail de p_plan_task_detail de
LEFT JOIN p_point_classify cl ON cl.point_id = de.point_id LEFT JOIN p_point_classify cl ON cl.point_id = de.point_id
LEFT JOIN p_plan_task task ON task.id = de.task_no
WHERE WHERE
de.id = #{taskDetailId}) AS 'should_check_equip_num', de.id = #{taskDetailId}) AS 'should_check_equip_num',
(SELECT (SELECT
count(DISTINCT cl.id) count( DISTINCT pci.point_classify_id )
FROM FROM
p_check pc p_check pc
LEFT JOIN p_point_classify cl ON cl.point_id = pc.point_id LEFT JOIN p_check_input pci ON pci.check_id = pc.id
LEFT JOIN p_plan_task task ON task.id = pc.plan_task_id
WHERE WHERE
pc.plan_task_detail_id = #{taskDetailId} pc.plan_task_detail_id = #{taskDetailId}
AND pci.is_ok != 3
) AS 'real_check_equip_num', ) AS 'real_check_equip_num',
(SELECT (SELECT
count(DISTINCT cl.id) count( DISTINCT pci.point_classify_id )
FROM FROM
p_check pc p_check pc
LEFT JOIN p_point_classify cl ON cl.point_id = pc.point_id LEFT JOIN p_check_input pci ON pci.check_id = pc.id
LEFT JOIN p_plan_task task ON task.id = pc.plan_task_id
WHERE WHERE
pc.is_ok = 1 AND pc.plan_task_detail_id = #{taskDetailId} pc.plan_task_detail_id = #{taskDetailId}
AND pci.is_ok = 1
) AS 'qualified_equip_num', ) AS 'qualified_equip_num',
(SELECT (SELECT
count(DISTINCT cl.id) count( DISTINCT pci.point_classify_id )
FROM FROM
p_check pc p_check pc
LEFT JOIN p_point_classify cl ON cl.point_id = pc.point_id LEFT JOIN p_check_input pci ON pci.check_id = pc.id
LEFT JOIN p_plan_task task ON task.id = pc.plan_task_id
WHERE WHERE
pc.is_ok = 2 AND pc.plan_task_detail_id = #{taskDetailId} pc.plan_task_detail_id = #{taskDetailId}
AND pci.is_ok = 2
) AS 'not_qualified_equip_num', ) AS 'not_qualified_equip_num',
(SELECT (SELECT
count(DISTINCT cl.id) count(DISTINCT cl.id)
FROM FROM
p_check pc p_check pc
LEFT JOIN p_point_classify cl ON cl.point_id = pc.point_id LEFT JOIN p_point_classify cl ON cl.point_id = pc.point_id
LEFT JOIN p_plan_task task ON task.id = pc.plan_task_id
WHERE WHERE
pc.is_ok = 3 AND pc.plan_task_detail_id = #{taskDetailId} pc.is_ok = 3 AND pc.plan_task_detail_id = #{taskDetailId}
) AS 'missed_equip_num' ) AS 'missed_equip_num'
...@@ -1299,8 +1298,8 @@ ...@@ -1299,8 +1298,8 @@
<select id="getCheckMissedEquipInfo" resultType="Map"> <select id="getCheckMissedEquipInfo" resultType="Map">
SELECT SELECT
cl.category_name AS equipName, cl.`name` AS equipName,
cl.building_name AS equipPosition, cl.address AS equipPosition,
'漏检' AS result, '漏检' AS result,
cl.data_source_name AS remark cl.data_source_name AS remark
FROM FROM
...@@ -1309,14 +1308,14 @@ ...@@ -1309,14 +1308,14 @@
LEFT JOIN p_check pc ON pc.id = pci.check_id LEFT JOIN p_check pc ON pc.id = pci.check_id
LEFT JOIN p_plan_task task ON task.id = pc.plan_task_id LEFT JOIN p_plan_task task ON task.id = pc.plan_task_id
WHERE WHERE
pc.is_ok = 3 AND pc.plan_task_detail_id = #{taskDetailId} pci.is_ok = 3 AND pc.plan_task_detail_id = #{taskDetailId}
GROUP BY cl.id; GROUP BY cl.id;
</select> </select>
<select id="getCheckQualifiedEquipInfo" resultType="Map"> <select id="getCheckQualifiedEquipInfo" resultType="Map">
SELECT SELECT
cl.category_name AS equipName, cl.`name` AS equipName,
cl.building_name AS equipPosition, cl.address AS equipPosition,
pii.name AS checkItem, pii.name AS checkItem,
'合格' AS result, '合格' AS result,
pc.check_time AS checkDate, pc.check_time AS checkDate,
...@@ -1328,14 +1327,14 @@ ...@@ -1328,14 +1327,14 @@
LEFT JOIN p_input_item pii ON pii.id = pci.input_id LEFT JOIN p_input_item pii ON pii.id = pci.input_id
LEFT JOIN p_plan_task task ON task.id = pc.plan_task_id LEFT JOIN p_plan_task task ON task.id = pc.plan_task_id
WHERE WHERE
pc.is_ok = 1 AND pc.plan_task_detail_id = #{taskDetailId} pci.is_ok = 1 AND pc.plan_task_detail_id = #{taskDetailId}
GROUP BY cl.id; GROUP BY cl.id;
</select> </select>
<select id="getCheckNotQualifiedEquipInfo" resultType="Map"> <select id="getCheckNotQualifiedEquipInfo" resultType="Map">
SELECT SELECT
cl.category_name AS equipName, cl.`name` AS equipName,
cl.building_name AS equipPosition, cl.address AS equipPosition,
pii.name AS checkItem, pii.name AS checkItem,
'不合格' AS result, '不合格' AS result,
pc.check_time AS checkDate, pc.check_time AS checkDate,
...@@ -1348,7 +1347,11 @@ ...@@ -1348,7 +1347,11 @@
LEFT JOIN p_input_item pii ON pii.id = pci.input_id LEFT JOIN p_input_item pii ON pii.id = pci.input_id
LEFT JOIN p_plan_task task ON task.id = pc.plan_task_id LEFT JOIN p_plan_task task ON task.id = pc.plan_task_id
WHERE WHERE
pc.is_ok = 2 AND pc.plan_task_detail_id = #{taskDetailId} pci.is_ok = 2 AND pc.plan_task_detail_id = #{taskDetailId}
GROUP BY cl.id; GROUP BY cl.id;
</select> </select>
<select id="getCheckIdByDetailId" resultType="java.lang.String">
select id from p_check where plan_task_detail_id = #{taskDetailId} limit 1
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment