bug修复
This commit is contained in:
parent
1c1d5a22f4
commit
c5ea8e40ef
@ -44,6 +44,9 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class DataScopeHandler implements DataPermissionHandler {
|
public class DataScopeHandler implements DataPermissionHandler {
|
||||||
|
@Lazy
|
||||||
|
@Autowired
|
||||||
|
IAiAnalyseHardWareRecordService aiAnalyseHardWareRecordService;
|
||||||
@Lazy
|
@Lazy
|
||||||
@Autowired
|
@Autowired
|
||||||
private XzSupplierQualificationApplyServiceImpl xzSupplierQualificationApplyService;
|
private XzSupplierQualificationApplyServiceImpl xzSupplierQualificationApplyService;
|
||||||
@ -53,28 +56,10 @@ public class DataScopeHandler implements DataPermissionHandler {
|
|||||||
@Lazy
|
@Lazy
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserDevAuthorityServiceImpl userDevAuthorityService;
|
private UserDevAuthorityServiceImpl userDevAuthorityService;
|
||||||
//
|
|
||||||
//@Lazy
|
|
||||||
//@Autowired
|
|
||||||
//private IProjectService projectService;
|
|
||||||
//
|
|
||||||
//@Lazy
|
|
||||||
//@Autowired
|
|
||||||
//private IEnterpriseService enterpriseService;
|
|
||||||
//
|
|
||||||
//@Lazy
|
|
||||||
//@Autowired
|
|
||||||
//private IEngineeringService engineeringService;
|
|
||||||
//
|
|
||||||
//@Lazy
|
|
||||||
//@Autowired
|
|
||||||
//private ISystemUserDataScopeService systemUserDataScopeService;
|
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserEnterpriseServiceImpl userEnterpriseService;
|
private UserEnterpriseServiceImpl userEnterpriseService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Expression getSqlSegment(Expression where, String mappedStatementId) {
|
public Expression getSqlSegment(Expression where, String mappedStatementId) {
|
||||||
return null;
|
return null;
|
||||||
@ -131,9 +116,6 @@ public class DataScopeHandler implements DataPermissionHandler {
|
|||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Autowired
|
|
||||||
IAiAnalyseHardWareRecordService aiAnalyseHardWareRecordService;
|
|
||||||
|
|
||||||
private PlainSelect dataScopeFilterByProject(PlainSelect plainSelect, UserInfo user, Object obj) {
|
private PlainSelect dataScopeFilterByProject(PlainSelect plainSelect, UserInfo user, Object obj) {
|
||||||
JSONObject jo = (JSONObject) obj;
|
JSONObject jo = (JSONObject) obj;
|
||||||
Object parameter = jo.get("parameter");
|
Object parameter = jo.get("parameter");
|
||||||
|
|||||||
@ -30,6 +30,8 @@ public interface INoticeService extends IService<Notice> {
|
|||||||
*/
|
*/
|
||||||
void addUserNotice(Long accountId, String msg, String title, String type);
|
void addUserNotice(Long accountId, String msg, String title, String type);
|
||||||
|
|
||||||
|
void addUserNoticeAndApp(Long accountId, String msg, String title, String type, Object payload);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发通知,给某人和app通知
|
* 发通知,给某人和app通知
|
||||||
*
|
*
|
||||||
|
|||||||
@ -82,13 +82,18 @@ public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addUserNoticeAndApp(Long accountId, String msg, String title, String type) {
|
public void addUserNoticeAndApp(Long accountId, String msg, String title, String type, Object payload) {
|
||||||
addUserNotice(accountId, msg, title, type);
|
addUserNotice(accountId, msg, title, type);
|
||||||
SystemUser systemUser = systemUserMapper.selectById(accountId);
|
SystemUser systemUser = systemUserMapper.selectById(accountId);
|
||||||
if (systemUser == null) {
|
if (systemUser == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uniPushService.pushToSingleByAlias(systemUser.getClientId(), title, msg, null);
|
uniPushService.pushToSingleByAlias(systemUser.getClientId(), title, msg, payload);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addUserNoticeAndApp(Long accountId, String msg, String title, String type) {
|
||||||
|
addUserNoticeAndApp(accountId, msg, title, type, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.zhgd.annotation.DataScope;
|
||||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||||
import com.zhgd.xmgl.modules.car.entity.vo.TodayOutInNumber;
|
import com.zhgd.xmgl.modules.car.entity.vo.TodayOutInNumber;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
@ -18,6 +19,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||||||
* @version: V1.0
|
* @version: V1.0
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
|
@DataScope(includeTable = "enterprise_info")
|
||||||
public interface CarPassRecordMapper extends BaseMapper<CarPassRecord> {
|
public interface CarPassRecordMapper extends BaseMapper<CarPassRecord> {
|
||||||
Map<String, Object> getCurrentDayCarPassRecordOutAndInNum(Map<String, Object> map);
|
Map<String, Object> getCurrentDayCarPassRecordOutAndInNum(Map<String, Object> map);
|
||||||
|
|
||||||
|
|||||||
@ -162,6 +162,7 @@
|
|||||||
else 3 end) car_type
|
else 3 end) car_type
|
||||||
FROM car_pass_record a
|
FROM car_pass_record a
|
||||||
LEFT JOIN car_info b ON (a.project_sn = b.project_sn AND a.car_number = b.car_number)
|
LEFT JOIN car_info b ON (a.project_sn = b.project_sn AND a.car_number = b.car_number)
|
||||||
|
left join enterprise_info ei on ei.id=b.enterprise_id
|
||||||
where a.project_sn = #{param.projectSn}
|
where a.project_sn = #{param.projectSn}
|
||||||
<if test="param.carType == '1'.toString()">
|
<if test="param.carType == '1'.toString()">
|
||||||
and b.id is not null
|
and b.id is not null
|
||||||
|
|||||||
@ -38,6 +38,7 @@ import com.zhgd.xmgl.modules.worker.mapper.EnterpriseInfoMapper;
|
|||||||
import com.zhgd.xmgl.modules.worker.mapper.WorkerInfoMapper;
|
import com.zhgd.xmgl.modules.worker.mapper.WorkerInfoMapper;
|
||||||
import com.zhgd.xmgl.modules.xz.entity.XzDeductScoreRecord;
|
import com.zhgd.xmgl.modules.xz.entity.XzDeductScoreRecord;
|
||||||
import com.zhgd.xmgl.modules.xz.mapper.XzDeductScoreRecordMapper;
|
import com.zhgd.xmgl.modules.xz.mapper.XzDeductScoreRecordMapper;
|
||||||
|
import com.zhgd.xmgl.push.config.PushPayloads;
|
||||||
import com.zhgd.xmgl.util.JxlExcelUtils;
|
import com.zhgd.xmgl.util.JxlExcelUtils;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.commons.collections.MapUtils;
|
import org.apache.commons.collections.MapUtils;
|
||||||
@ -261,7 +262,8 @@ public class QualityInspectionRecordServiceImpl extends ServiceImpl<QualityInspe
|
|||||||
}
|
}
|
||||||
qualityInspectionRecordMapper.insert(qualityInspectionRecord);
|
qualityInspectionRecordMapper.insert(qualityInspectionRecord);
|
||||||
if (qualityInspectionRecord.getRecordType() == 1 && qualityInspectionRecord.getStatus() == 2) {
|
if (qualityInspectionRecord.getRecordType() == 1 && qualityInspectionRecord.getStatus() == 2) {
|
||||||
noticeService.addUserNoticeAndApp(qualityInspectionRecord.getChangeId(), "您有一条质量检查待整改,问题:" + qualityInspectionRecord.getDangerItemContent(), "质量管理待整改", "11");
|
noticeService.addUserNoticeAndApp(qualityInspectionRecord.getChangeId(), "您有一条质量检查待整改,问题:" + qualityInspectionRecord.getDangerItemContent(), "质量管理待整改", "11",
|
||||||
|
PushPayloads.buildPushPayload(11, qualityInspectionRecord));
|
||||||
}
|
}
|
||||||
|
|
||||||
sanjiangDataCall.sendAddQualityInspectionRecord(qualityInspectionRecord);
|
sanjiangDataCall.sendAddQualityInspectionRecord(qualityInspectionRecord);
|
||||||
|
|||||||
@ -20,6 +20,7 @@ import com.zhgd.xmgl.modules.quality.mapper.QualityInspectionRecordMapper;
|
|||||||
import com.zhgd.xmgl.modules.quality.mapper.QualityRectifyRecordMapper;
|
import com.zhgd.xmgl.modules.quality.mapper.QualityRectifyRecordMapper;
|
||||||
import com.zhgd.xmgl.modules.quality.service.IQualityInspectionRecordService;
|
import com.zhgd.xmgl.modules.quality.service.IQualityInspectionRecordService;
|
||||||
import com.zhgd.xmgl.modules.quality.service.IQualityRectifyRecordService;
|
import com.zhgd.xmgl.modules.quality.service.IQualityRectifyRecordService;
|
||||||
|
import com.zhgd.xmgl.push.config.PushPayloads;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.commons.collections.MapUtils;
|
import org.apache.commons.collections.MapUtils;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
@ -79,7 +80,8 @@ public class QualityRectifyRecordServiceImpl extends ServiceImpl<QualityRectifyR
|
|||||||
//已整改时候需要复查
|
//已整改时候需要复查
|
||||||
if (qualityRectifyRecord.getStatus() == 2) {
|
if (qualityRectifyRecord.getStatus() == 2) {
|
||||||
qualityInspectionRecord.setStatus(3);
|
qualityInspectionRecord.setStatus(3);
|
||||||
noticeService.addUserNoticeAndApp(tempQualityInspectionRecord.getReviewId(), "您有一条质量检查的整改结果需要复查,请及时查看。", "质量管理整改结果待复查", "11");
|
noticeService.addUserNoticeAndApp(tempQualityInspectionRecord.getReviewId(), "您有一条质量检查的整改结果需要复查,请及时查看。", "质量管理整改结果待复查", "11",
|
||||||
|
PushPayloads.buildPushPayload(11, qualityInspectionRecord));
|
||||||
} else {
|
} else {
|
||||||
qualityInspectionRecord.setStatus(2);
|
qualityInspectionRecord.setStatus(2);
|
||||||
}
|
}
|
||||||
@ -87,19 +89,23 @@ public class QualityRectifyRecordServiceImpl extends ServiceImpl<QualityRectifyR
|
|||||||
//复查合格时候需要核验
|
//复查合格时候需要核验
|
||||||
if (qualityRectifyRecord.getStatus() == 2) {
|
if (qualityRectifyRecord.getStatus() == 2) {
|
||||||
qualityInspectionRecord.setStatus(4);
|
qualityInspectionRecord.setStatus(4);
|
||||||
noticeService.addUserNoticeAndApp(tempQualityInspectionRecord.getVerifyManId(), "您有一条质量检查的整改结果需要核验,请及时查看。", "质量管理整改结果核验通知", "11");
|
noticeService.addUserNoticeAndApp(tempQualityInspectionRecord.getVerifyManId(), "您有一条质量检查的整改结果需要核验,请及时查看。", "质量管理整改结果核验通知", "11",
|
||||||
|
PushPayloads.buildPushPayload(11, qualityInspectionRecord));
|
||||||
} else {
|
} else {
|
||||||
qualityInspectionRecord.setStatus(2);
|
qualityInspectionRecord.setStatus(2);
|
||||||
noticeService.addUserNoticeAndApp(tempQualityInspectionRecord.getChangeId(), "您提交的质量检查的整改结果复查不通过,请及时重新整改。", "质量管理整改结果复查通知", "11");
|
noticeService.addUserNoticeAndApp(tempQualityInspectionRecord.getChangeId(), "您提交的质量检查的整改结果复查不通过,请及时重新整改。", "质量管理整改结果复查通知", "11",
|
||||||
|
PushPayloads.buildPushPayload(11, qualityInspectionRecord));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//核验合格时候则该记录合格
|
//核验合格时候则该记录合格
|
||||||
if (qualityRectifyRecord.getStatus() == 2) {
|
if (qualityRectifyRecord.getStatus() == 2) {
|
||||||
qualityInspectionRecord.setStatus(5);
|
qualityInspectionRecord.setStatus(5);
|
||||||
noticeService.addUserNoticeAndApp(tempQualityInspectionRecord.getChangeId(), "您提交的质量检查的整改结果已通过核验。", "质量管理整改结果核验通知", "11");
|
noticeService.addUserNoticeAndApp(tempQualityInspectionRecord.getChangeId(), "您提交的质量检查的整改结果已通过核验。", "质量管理整改结果核验通知", "11",
|
||||||
|
PushPayloads.buildPushPayload(11, qualityInspectionRecord));
|
||||||
} else {
|
} else {
|
||||||
qualityInspectionRecord.setStatus(2);
|
qualityInspectionRecord.setStatus(2);
|
||||||
noticeService.addUserNoticeAndApp(tempQualityInspectionRecord.getChangeId(), "您提交的质量检查的整改结果核验不通过,请及时重新整改。", "质量管理整改结果核验通知", "11");
|
noticeService.addUserNoticeAndApp(tempQualityInspectionRecord.getChangeId(), "您提交的质量检查的整改结果核验不通过,请及时重新整改。", "质量管理整改结果核验通知", "11",
|
||||||
|
PushPayloads.buildPushPayload(11, qualityInspectionRecord));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
qualityInspectionRecordMapper.updateById(qualityInspectionRecord);
|
qualityInspectionRecordMapper.updateById(qualityInspectionRecord);
|
||||||
|
|||||||
@ -71,6 +71,9 @@ public class AiAnalyseHardWareAlarmRecordController {
|
|||||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
|
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
|
||||||
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "body", required = true, dataType = "Integer"),
|
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "body", required = true, dataType = "Integer"),
|
||||||
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "body", required = true, dataType = "Integer"),
|
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "body", required = true, dataType = "Integer"),
|
||||||
|
@ApiImplicitParam(name = "qualityRegionId", value = "区域id", paramType = "body", required = false, dataType = "String"),
|
||||||
|
@ApiImplicitParam(name = "enterpriseId", value = "合作单位id", paramType = "body", required = false, dataType = "String"),
|
||||||
|
@ApiImplicitParam(name = "handleDone", value = "是否处置过", paramType = "body", required = false, dataType = "Boolean"),
|
||||||
})
|
})
|
||||||
@PostMapping(value = "/selectPageList")
|
@PostMapping(value = "/selectPageList")
|
||||||
public Result<IPage<AiAnalyseHardWareAlarmRecord>> queryPageList(@RequestBody Map<String, Object> map) {
|
public Result<IPage<AiAnalyseHardWareAlarmRecord>> queryPageList(@RequestBody Map<String, Object> map) {
|
||||||
|
|||||||
@ -37,6 +37,32 @@
|
|||||||
<if test="param.endTime != null and param.endTime != ''">
|
<if test="param.endTime != null and param.endTime != ''">
|
||||||
AND a.create_time <= #{param.endTime}
|
AND a.create_time <= #{param.endTime}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="param.enterpriseId != null and param.enterpriseId != ''">
|
||||||
|
and a.hardware_id in (
|
||||||
|
select ai_analyse_hard_ware_record.hardware_id from ai_analyse_hard_ware_record where id in (
|
||||||
|
select distinct qrtaah.ai_analyse_hard_ware_record_id from quality_region_to_ai_analyse_hard qrtaah join
|
||||||
|
quality_region_to_enterprise qrte on qrte.quality_region_id=qrtaah.quality_region_id
|
||||||
|
where qrte.enterprise_id = #{param.enterpriseId} OR qrte.enterprise_id IN ( SELECT DISTINCT t.enterprise_id
|
||||||
|
FROM
|
||||||
|
(SELECT t.id FROM project_enterprise t WHERE t.enterprise_id = #{param.enterpriseId}) t2 join
|
||||||
|
project_enterprise
|
||||||
|
t on find_in_set( t2.id, ancestors ) )
|
||||||
|
))
|
||||||
|
</if>
|
||||||
|
<if test="param.qualityRegionId != null and param.qualityRegionId != ''">
|
||||||
|
and a.hardware_id in(
|
||||||
|
select ai_analyse_hard_ware_record.hardware_id from ai_analyse_hard_ware_record where id in (
|
||||||
|
select distinct h.ai_analyse_hard_ware_record_id from quality_region_to_ai_analyse_hard h where
|
||||||
|
h.quality_region_id = #{param.qualityRegionId} OR h.quality_region_id IN ( SELECT t.id FROM quality_region t
|
||||||
|
WHERE find_in_set(#{param.qualityRegionId}, ancestors) ))
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="param.handleDone != null and param.handleDone != '' or param.handleDone == true">
|
||||||
|
AND a.handle_done = #{param.handleDone}
|
||||||
|
</if>
|
||||||
|
<if test="param.handleDone != null and 'false'.toString() == param.handleDone.toString()">
|
||||||
|
AND (a.handle_done = #{param.handleDone} or a.handle_done is null)
|
||||||
|
</if>
|
||||||
group by a.id
|
group by a.id
|
||||||
order by a.create_time desc
|
order by a.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@ -306,5 +306,14 @@ public class XzSecurityQualityInspectionRecordController {
|
|||||||
return Result.success(qualityInspectionRecordService.countQualityInspectionRecordRegion(paramMap));
|
return Result.success(qualityInspectionRecordService.countQualityInspectionRecordRegion(paramMap));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "整改人统计", notes = "整改人统计", httpMethod = "POST")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
|
||||||
|
})
|
||||||
|
@PostMapping(value = "/statsByChangeId")
|
||||||
|
public Result<List<StatsByChangeIdVo>> statsByChangeId(@ApiIgnore @RequestBody Map<String, Object> paramMap) {
|
||||||
|
return Result.success(qualityInspectionRecordService.statsByChangeId(paramMap));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,17 @@
|
|||||||
|
package com.zhgd.xmgl.modules.xz.security.entity.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class StatsByChangeIdVo {
|
||||||
|
@ApiModelProperty("姓名")
|
||||||
|
private String workerName;
|
||||||
|
@ApiModelProperty("整改数量")
|
||||||
|
private Integer changeNum;
|
||||||
|
@ApiModelProperty("整改率")
|
||||||
|
private Double changeRate;
|
||||||
|
@ApiModelProperty("及时整改率")
|
||||||
|
private Double changeRateTimely;
|
||||||
|
|
||||||
|
}
|
||||||
@ -61,4 +61,6 @@ public interface XzSecurityQualityInspectionRecordMapper extends BaseMapper<XzSe
|
|||||||
List<SectorOneVo> countQualityInspectionRecordUrgentLevel(HashMap<String, Object> paramMap);
|
List<SectorOneVo> countQualityInspectionRecordUrgentLevel(HashMap<String, Object> paramMap);
|
||||||
|
|
||||||
List<TrendOneVo> countQualityInspectionRecordRegion(HashMap<String, Object> paramMap);
|
List<TrendOneVo> countQualityInspectionRecordRegion(HashMap<String, Object> paramMap);
|
||||||
|
|
||||||
|
List<StatsByChangeIdVo> statsByChangeId(Map<String, Object> paramMap);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -498,4 +498,20 @@
|
|||||||
group by qr.id
|
group by qr.id
|
||||||
order by y desc
|
order by y desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="statsByChangeId" resultType="com.zhgd.xmgl.modules.xz.security.entity.vo.StatsByChangeIdVo">
|
||||||
|
SELECT
|
||||||
|
count(*) changeNum,
|
||||||
|
IFNULL(SUM((CASE WHEN status = 1 or status = 4 THEN 0 ELSE 1 END)), 0) notCloseNum,
|
||||||
|
IFNULL(SUM((case
|
||||||
|
when change_limit_time < now() and (status = 2 or status = 3)
|
||||||
|
then 1
|
||||||
|
else 0 end)), 0) overdueNotCloseNum,su.real_name as workerName
|
||||||
|
from hidden_danger_inspection_record hdir
|
||||||
|
left join system_user su on su.user_id=hdir.change_user
|
||||||
|
WHERE record_type = 1
|
||||||
|
and project_sn=#{projectSn}
|
||||||
|
group by hdir.change_user
|
||||||
|
order by changeNum desc
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -61,4 +61,7 @@ public interface IXzSecurityQualityInspectionRecordService extends IService<XzSe
|
|||||||
SectorVo countQualityInspectionRecordUrgentLevel(HashMap<String, Object> paramMap);
|
SectorVo countQualityInspectionRecordUrgentLevel(HashMap<String, Object> paramMap);
|
||||||
|
|
||||||
List<TrendOneVo> countQualityInspectionRecordRegion(HashMap<String, Object> paramMap);
|
List<TrendOneVo> countQualityInspectionRecordRegion(HashMap<String, Object> paramMap);
|
||||||
|
|
||||||
|
List<StatsByChangeIdVo> statsByChangeId(Map<String, Object> paramMap);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,6 +23,12 @@ import com.zhgd.xmgl.modules.basicdata.mapper.SystemUserMapper;
|
|||||||
import com.zhgd.xmgl.modules.basicdata.service.INoticeService;
|
import com.zhgd.xmgl.modules.basicdata.service.INoticeService;
|
||||||
import com.zhgd.xmgl.modules.quality.entity.QualityRegion;
|
import com.zhgd.xmgl.modules.quality.entity.QualityRegion;
|
||||||
import com.zhgd.xmgl.modules.quality.mapper.QualityRegionMapper;
|
import com.zhgd.xmgl.modules.quality.mapper.QualityRegionMapper;
|
||||||
|
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
|
||||||
|
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
||||||
|
import com.zhgd.xmgl.modules.worker.mapper.EnterpriseInfoMapper;
|
||||||
|
import com.zhgd.xmgl.modules.worker.mapper.WorkerInfoMapper;
|
||||||
|
import com.zhgd.xmgl.modules.xz.entity.XzDeductScoreRecord;
|
||||||
|
import com.zhgd.xmgl.modules.xz.mapper.XzDeductScoreRecordMapper;
|
||||||
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerItemRecord;
|
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerItemRecord;
|
||||||
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityQualityInspectionRecord;
|
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityQualityInspectionRecord;
|
||||||
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityQualityRectifyRecord;
|
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityQualityRectifyRecord;
|
||||||
@ -32,12 +38,7 @@ import com.zhgd.xmgl.modules.xz.security.mapper.XzSecurityDangerItemRecordMapper
|
|||||||
import com.zhgd.xmgl.modules.xz.security.mapper.XzSecurityQualityInspectionRecordMapper;
|
import com.zhgd.xmgl.modules.xz.security.mapper.XzSecurityQualityInspectionRecordMapper;
|
||||||
import com.zhgd.xmgl.modules.xz.security.mapper.XzSecurityQualityRectifyRecordMapper;
|
import com.zhgd.xmgl.modules.xz.security.mapper.XzSecurityQualityRectifyRecordMapper;
|
||||||
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityQualityInspectionRecordService;
|
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityQualityInspectionRecordService;
|
||||||
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
|
import com.zhgd.xmgl.push.config.PushPayloads;
|
||||||
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
|
||||||
import com.zhgd.xmgl.modules.worker.mapper.EnterpriseInfoMapper;
|
|
||||||
import com.zhgd.xmgl.modules.worker.mapper.WorkerInfoMapper;
|
|
||||||
import com.zhgd.xmgl.modules.xz.entity.XzDeductScoreRecord;
|
|
||||||
import com.zhgd.xmgl.modules.xz.mapper.XzDeductScoreRecordMapper;
|
|
||||||
import com.zhgd.xmgl.util.JxlExcelUtils;
|
import com.zhgd.xmgl.util.JxlExcelUtils;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.commons.collections.MapUtils;
|
import org.apache.commons.collections.MapUtils;
|
||||||
@ -261,7 +262,8 @@ public class XzSecurityXzSecurityQualityInspectionRecordServiceImpl extends Serv
|
|||||||
}
|
}
|
||||||
xzSecurityQualityInspectionRecordMapper.insert(xzSecurityQualityInspectionRecord);
|
xzSecurityQualityInspectionRecordMapper.insert(xzSecurityQualityInspectionRecord);
|
||||||
if (xzSecurityQualityInspectionRecord.getRecordType() == 1 && xzSecurityQualityInspectionRecord.getStatus() == 2) {
|
if (xzSecurityQualityInspectionRecord.getRecordType() == 1 && xzSecurityQualityInspectionRecord.getStatus() == 2) {
|
||||||
noticeService.addUserNoticeAndApp(xzSecurityQualityInspectionRecord.getChangeId(), "您有一条安全检查待整改,问题:" + xzSecurityQualityInspectionRecord.getDangerItemContent(), "安全管理待整改", "10");
|
noticeService.addUserNoticeAndApp(xzSecurityQualityInspectionRecord.getChangeId(), "您有一条安全检查待整改,问题:" + xzSecurityQualityInspectionRecord.getDangerItemContent(), "安全管理待整改", "10",
|
||||||
|
PushPayloads.buildPushPayload(10, xzSecurityQualityInspectionRecord));
|
||||||
}
|
}
|
||||||
|
|
||||||
deductScoreIf(xzSecurityQualityInspectionRecord);
|
deductScoreIf(xzSecurityQualityInspectionRecord);
|
||||||
@ -439,6 +441,11 @@ public class XzSecurityXzSecurityQualityInspectionRecordServiceImpl extends Serv
|
|||||||
return baseMapper.countQualityInspectionRecordRegion(paramMap);
|
return baseMapper.countQualityInspectionRecordRegion(paramMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<StatsByChangeIdVo> statsByChangeId(Map<String, Object> paramMap) {
|
||||||
|
return baseMapper.statsByChangeId(paramMap);
|
||||||
|
}
|
||||||
|
|
||||||
private void setWeekRatioData(XzSecurityAllAndWeekDataVO allAndWeekDataVO) {
|
private void setWeekRatioData(XzSecurityAllAndWeekDataVO allAndWeekDataVO) {
|
||||||
long weekClose = allAndWeekDataVO.getWeekClose();
|
long weekClose = allAndWeekDataVO.getWeekClose();
|
||||||
long weekNoClose = allAndWeekDataVO.getWeekNoClose();
|
long weekNoClose = allAndWeekDataVO.getWeekNoClose();
|
||||||
|
|||||||
@ -20,6 +20,7 @@ import com.zhgd.xmgl.modules.xz.security.mapper.XzSecurityQualityInspectionRecor
|
|||||||
import com.zhgd.xmgl.modules.xz.security.mapper.XzSecurityQualityRectifyRecordMapper;
|
import com.zhgd.xmgl.modules.xz.security.mapper.XzSecurityQualityRectifyRecordMapper;
|
||||||
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityQualityInspectionRecordService;
|
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityQualityInspectionRecordService;
|
||||||
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityQualityRectifyRecordService;
|
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityQualityRectifyRecordService;
|
||||||
|
import com.zhgd.xmgl.push.config.PushPayloads;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.commons.collections.MapUtils;
|
import org.apache.commons.collections.MapUtils;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
@ -79,7 +80,8 @@ public class XzSecurityXzSecurityQualityRectifyRecordServiceImpl extends Service
|
|||||||
//已整改时候需要复查
|
//已整改时候需要复查
|
||||||
if (xzSecurityQualityRectifyRecord.getStatus() == 2) {
|
if (xzSecurityQualityRectifyRecord.getStatus() == 2) {
|
||||||
xzSecurityQualityInspectionRecord.setStatus(3);
|
xzSecurityQualityInspectionRecord.setStatus(3);
|
||||||
noticeService.addUserNoticeAndApp(tempXzSecurityQualityInspectionRecord.getReviewId(), "您有一条安全检查的整改结果需要复查,请及时查看。", "安全管理整改结果待复查", "10");
|
noticeService.addUserNoticeAndApp(tempXzSecurityQualityInspectionRecord.getReviewId(), "您有一条安全检查的整改结果需要复查,请及时查看。", "安全管理整改结果待复查", "10",
|
||||||
|
PushPayloads.buildPushPayload(10, xzSecurityQualityInspectionRecord));
|
||||||
} else {
|
} else {
|
||||||
xzSecurityQualityInspectionRecord.setStatus(2);
|
xzSecurityQualityInspectionRecord.setStatus(2);
|
||||||
}
|
}
|
||||||
@ -87,19 +89,23 @@ public class XzSecurityXzSecurityQualityRectifyRecordServiceImpl extends Service
|
|||||||
//复查合格时候需要核验
|
//复查合格时候需要核验
|
||||||
if (xzSecurityQualityRectifyRecord.getStatus() == 2) {
|
if (xzSecurityQualityRectifyRecord.getStatus() == 2) {
|
||||||
xzSecurityQualityInspectionRecord.setStatus(4);
|
xzSecurityQualityInspectionRecord.setStatus(4);
|
||||||
noticeService.addUserNoticeAndApp(tempXzSecurityQualityInspectionRecord.getVerifyManId(), "您有一条安全检查的整改结果需要核验,请及时查看。", "安全管理整改结果核验通知", "10");
|
noticeService.addUserNoticeAndApp(tempXzSecurityQualityInspectionRecord.getVerifyManId(), "您有一条安全检查的整改结果需要核验,请及时查看。", "安全管理整改结果核验通知", "10",
|
||||||
|
PushPayloads.buildPushPayload(10, xzSecurityQualityInspectionRecord));
|
||||||
} else {
|
} else {
|
||||||
xzSecurityQualityInspectionRecord.setStatus(2);
|
xzSecurityQualityInspectionRecord.setStatus(2);
|
||||||
noticeService.addUserNoticeAndApp(tempXzSecurityQualityInspectionRecord.getChangeId(), "您提交的安全检查的整改结果复查不通过,请及时重新整改。", "安全管理整改结果复查通知", "10");
|
noticeService.addUserNoticeAndApp(tempXzSecurityQualityInspectionRecord.getChangeId(), "您提交的安全检查的整改结果复查不通过,请及时重新整改。", "安全管理整改结果复查通知", "10",
|
||||||
|
PushPayloads.buildPushPayload(10, xzSecurityQualityInspectionRecord));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//核验合格时候则该记录合格
|
//核验合格时候则该记录合格
|
||||||
if (xzSecurityQualityRectifyRecord.getStatus() == 2) {
|
if (xzSecurityQualityRectifyRecord.getStatus() == 2) {
|
||||||
xzSecurityQualityInspectionRecord.setStatus(5);
|
xzSecurityQualityInspectionRecord.setStatus(5);
|
||||||
noticeService.addUserNoticeAndApp(tempXzSecurityQualityInspectionRecord.getChangeId(), "您提交的安全检查的整改结果已通过核验。", "安全管理整改结果核验通知", "10");
|
noticeService.addUserNoticeAndApp(tempXzSecurityQualityInspectionRecord.getChangeId(), "您提交的安全检查的整改结果已通过核验。", "安全管理整改结果核验通知", "10",
|
||||||
|
PushPayloads.buildPushPayload(10, xzSecurityQualityInspectionRecord));
|
||||||
} else {
|
} else {
|
||||||
xzSecurityQualityInspectionRecord.setStatus(2);
|
xzSecurityQualityInspectionRecord.setStatus(2);
|
||||||
noticeService.addUserNoticeAndApp(tempXzSecurityQualityInspectionRecord.getChangeId(), "您提交的安全检查的整改结果核验不通过,请及时重新整改。", "安全管理整改结果核验通知", "10");
|
noticeService.addUserNoticeAndApp(tempXzSecurityQualityInspectionRecord.getChangeId(), "您提交的安全检查的整改结果核验不通过,请及时重新整改。", "安全管理整改结果核验通知", "10",
|
||||||
|
PushPayloads.buildPushPayload(10, xzSecurityQualityInspectionRecord));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
xzSecurityQualityInspectionRecordMapper.updateById(xzSecurityQualityInspectionRecord);
|
xzSecurityQualityInspectionRecordMapper.updateById(xzSecurityQualityInspectionRecord);
|
||||||
|
|||||||
19
src/main/java/com/zhgd/xmgl/push/config/PushPayloads.java
Normal file
19
src/main/java/com/zhgd/xmgl/push/config/PushPayloads.java
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
package com.zhgd.xmgl.push.config;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PushPayloads {
|
||||||
|
/**
|
||||||
|
* 10安全11质量
|
||||||
|
*/
|
||||||
|
private Integer type;
|
||||||
|
private Object data;
|
||||||
|
|
||||||
|
public static PushPayloads buildPushPayload(Integer type, Object data) {
|
||||||
|
PushPayloads pushPayload = new PushPayloads();
|
||||||
|
pushPayload.setType(type);
|
||||||
|
pushPayload.setData(data);
|
||||||
|
return pushPayload;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -33,12 +33,13 @@ public class UniPushController {
|
|||||||
@ApiImplicitParam(name = "alias", value = "别名", paramType = "body", required = true, dataType = "String"),
|
@ApiImplicitParam(name = "alias", value = "别名", paramType = "body", required = true, dataType = "String"),
|
||||||
@ApiImplicitParam(name = "title", value = "标题", paramType = "body", required = true, dataType = "String"),
|
@ApiImplicitParam(name = "title", value = "标题", paramType = "body", required = true, dataType = "String"),
|
||||||
@ApiImplicitParam(name = "content", value = "标题", paramType = "body", required = true, dataType = "String"),
|
@ApiImplicitParam(name = "content", value = "标题", paramType = "body", required = true, dataType = "String"),
|
||||||
|
@ApiImplicitParam(name = "payload", value = "payload", paramType = "body", required = false, dataType = "String"),
|
||||||
})
|
})
|
||||||
@PostMapping("/pushMess")
|
@PostMapping("/pushMess")
|
||||||
public Result pushMessage(@RequestBody Map<String,Object> map) {
|
public Result pushMessage(@RequestBody Map<String,Object> map) {
|
||||||
Result<String> result=new Result();
|
Result<String> result=new Result();
|
||||||
try {
|
try {
|
||||||
ApiResult apiResult=uniPushService.pushToSingleByAlias(MapUtils.getString(map,"alias"),MapUtils.getString(map,"title"),MapUtils.getString(map,"content"),null);
|
ApiResult apiResult = uniPushService.pushToSingleByAlias(MapUtils.getString(map, "alias"), MapUtils.getString(map, "title"), MapUtils.getString(map, "content"), MapUtils.getString(map, "payload"));
|
||||||
if (apiResult.isSuccess()){
|
if (apiResult.isSuccess()){
|
||||||
result.successMsg("操作成功");
|
result.successMsg("操作成功");
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@ -13,7 +13,7 @@ import java.util.Map;
|
|||||||
**/
|
**/
|
||||||
public interface UniPushService {
|
public interface UniPushService {
|
||||||
|
|
||||||
ApiResult pushToSingleByAlias(String alias, String title, String content,String payload);
|
ApiResult pushToSingleByAlias(String alias, String title, String content, Object payload);
|
||||||
|
|
||||||
ApiResult bindAlias(String alias, String clientId);//别名绑定
|
ApiResult bindAlias(String alias, String clientId);//别名绑定
|
||||||
|
|
||||||
|
|||||||
@ -37,16 +37,16 @@ public class UniPushServiceImpl implements UniPushService {
|
|||||||
private PushApiHelper pushApiHelper;
|
private PushApiHelper pushApiHelper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApiResult pushToSingleByAlias(String alias, String title, String content, String payload) {
|
public ApiResult pushToSingleByAlias(String alias, String title, String content, Object payload) {
|
||||||
PushDTO<Audience> pushDTO = this.buildPushDTO(title, content, payload);
|
PushDTO<Audience> pushDTO = this.buildPushDTO(title, content, payload);
|
||||||
// log.info("payload-----" + pushDTO.getPushMessage().getNotification().getPayload());
|
// log.info("payload-----" + pushDTO.getPushMessage().getNotification().getPayload());
|
||||||
log.info("alias----{},title-----{},content-----{}", alias, title, content);
|
log.info("alias----{},title-----{},content-----{}", alias, title, content);
|
||||||
log.info("pushDTO-----" + JSON.toJSONString(pushDTO));
|
log.info("pushDTO-----" + JSON.toJSONString(pushDTO));
|
||||||
// 设置接收人信息
|
// 设置接收人信息
|
||||||
Audience audience = new Audience();
|
Audience audience = new Audience();
|
||||||
pushDTO.setAudience(audience);
|
|
||||||
audience.addAlias(alias);// cid
|
audience.addAlias(alias);// cid
|
||||||
audience.addCid(alias);// cid
|
audience.addCid(alias);// cid
|
||||||
|
pushDTO.setAudience(audience);
|
||||||
if (pushApiHelper != null) {
|
if (pushApiHelper != null) {
|
||||||
pushApiHelper.getPushApi().pushToSingleByCid(pushDTO);
|
pushApiHelper.getPushApi().pushToSingleByCid(pushDTO);
|
||||||
// 进行cid单推
|
// 进行cid单推
|
||||||
@ -65,7 +65,7 @@ public class UniPushServiceImpl implements UniPushService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private PushDTO<Audience> buildPushDTO(String title, String content, String payload) {
|
private PushDTO<Audience> buildPushDTO(String title, String content, Object payload) {
|
||||||
PushDTO<Audience> pushDTO = new PushDTO<>();
|
PushDTO<Audience> pushDTO = new PushDTO<>();
|
||||||
// 设置推送参数
|
// 设置推送参数
|
||||||
//requestid需要每次变化唯一
|
//requestid需要每次变化唯一
|
||||||
@ -100,7 +100,7 @@ public class UniPushServiceImpl implements UniPushService {
|
|||||||
aps.setSound("default");
|
aps.setSound("default");
|
||||||
aps.setAlert(alert);
|
aps.setAlert(alert);
|
||||||
IosDTO iosDTO = new IosDTO();
|
IosDTO iosDTO = new IosDTO();
|
||||||
iosDTO.setPayload(payload);
|
iosDTO.setPayload(payload.toString());
|
||||||
iosDTO.setAps(aps);
|
iosDTO.setAps(aps);
|
||||||
iosDTO.setType("notify");
|
iosDTO.setType("notify");
|
||||||
|
|
||||||
@ -117,8 +117,8 @@ public class UniPushServiceImpl implements UniPushService {
|
|||||||
notification1.setBody(content);
|
notification1.setBody(content);
|
||||||
notification1.setClickType("intent");
|
notification1.setClickType("intent");
|
||||||
notification1.setIntent("intent:#Intent;action=android.intent.action.oppopush;launchFlags=0x14000000;component=com.weixiaobao/io.dcloud.PandoraEntry;S.UP-OL-SU=true;S.title=" + title + ";S.content=" + content + ";S.payload=" + payload + ";end");
|
notification1.setIntent("intent:#Intent;action=android.intent.action.oppopush;launchFlags=0x14000000;component=com.weixiaobao/io.dcloud.PandoraEntry;S.UP-OL-SU=true;S.title=" + title + ";S.content=" + content + ";S.payload=" + payload + ";end");
|
||||||
notification1.setPayload(payload);
|
notification1.setPayload(payload.toString());
|
||||||
notification1.setUrl(payload);
|
notification1.setUrl(payload.toString());
|
||||||
//各厂商自有功能单项设置
|
//各厂商自有功能单项设置
|
||||||
//ups.addOption("HW", "/message/android/notification/badge/class", "io.dcloud.PandoraEntry ");
|
//ups.addOption("HW", "/message/android/notification/badge/class", "io.dcloud.PandoraEntry ");
|
||||||
//ups.addOption("HW", "/message/android/notification/badge/add_num", 1);
|
//ups.addOption("HW", "/message/android/notification/badge/add_num", 1);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user