Merge branch 'guoshengxiong' into baotou

This commit is contained in:
guoshengxiong 2024-08-13 10:54:40 +08:00
commit 33cbd89a41
21 changed files with 248 additions and 136 deletions

View File

@ -75,32 +75,45 @@ public class QueryGenerator {
public static <T> QueryWrapper<T> initQueryWrapper(T searchObj) {
long start = System.currentTimeMillis();
QueryWrapper<T> queryWrapper = new QueryWrapper<T>();
installMplus1(queryWrapper, searchObj, null, null, null, null);
installMplus1(queryWrapper, searchObj, null, null, null, null, false);
log.info("---查询条件构造器初始化完成,耗时:" + (System.currentTimeMillis() - start) + "毫秒----");
return queryWrapper;
}
public static <T> QueryWrapper<T> initPageQueryWrapper(Class t, Map<String, Object> map, String alias, List<String> excludeFields, List<String> likeFields) {
return initPageQueryWrapper(t, map, alias, excludeFields, likeFields, false);
}
/**
* 获取查询条件构造器QueryWrapper实例 通用查询条件已被封装完成
*
* @param map 查询map
* @param likeFields RefUtil.fieldNames
* @param allSearch
* @return QueryWrapper实例
*/
public static <T> QueryWrapper<T> initPageQueryWrapper(Class t, Map<String, Object> map, String alias, List<String> excludeFields, List<String> likeFields) {
public static <T> QueryWrapper<T> initPageQueryWrapper(Class t, Map<String, Object> map, String alias, List<String> excludeFields, List<String> likeFields, boolean allSearch) {
long start = System.currentTimeMillis();
QueryWrapper<T> queryWrapper = new QueryWrapper<T>();
installMplus1(queryWrapper, JSONObject.parseObject(JSONObject.toJSONString(map), t), initParamMap(map), alias, excludeFields, likeFields);
installMplus1(queryWrapper, JSONObject.parseObject(JSONObject.toJSONString(map), t), initParamMap(map), alias, excludeFields, likeFields, allSearch);
log.info("---查询条件构造器初始化完成,耗时:" + (System.currentTimeMillis() - start) + "毫秒----");
return queryWrapper;
}
public static <T> QueryWrapper<T> initPageQueryWrapper(Class t, Map<String, Object> map, String alias, boolean allSearch) {
return initPageQueryWrapper(t, map, alias, null, null, allSearch);
}
public static <T> QueryWrapper<T> initPageQueryWrapper(Class t, Map<String, Object> map, String alias) {
return initPageQueryWrapper(t, map, alias, null, null);
return initPageQueryWrapper(t, map, alias, null, null, false);
}
public static <T> QueryWrapper<T> initPageQueryWrapper(Class t, Map<String, Object> map, boolean allSearch) {
return initPageQueryWrapper(t, map, null, allSearch);
}
public static <T> QueryWrapper<T> initPageQueryWrapper(Class t, Map<String, Object> map) {
return initPageQueryWrapper(t, map, null);
return initPageQueryWrapper(t, map, null, false);
}
private static Map<String, String[]> initParamMap(Map<String, Object> map) {
@ -122,7 +135,7 @@ public class QueryGenerator {
* <br>正确示例:QueryWrapper<JeecgDemo> queryWrapper = new QueryWrapper<JeecgDemo>();
* <br>3.也可以不使用这个方法直接调用 {@link #initQueryWrapper}直接获取实例
*/
public static void installMplus1(QueryWrapper<?> queryWrapper, Object searchObj, Map<String, String[]> parameterMap, String alias, List<String> excludeFields, List<String> likeFields) {
public static void installMplus1(QueryWrapper<?> queryWrapper, Object searchObj, Map<String, String[]> parameterMap, String alias, List<String> excludeFields, List<String> likeFields, boolean allSearch) {
/*
* 注意:权限查询由前端配置数据规则 当一个人有多个所属部门时候 可以在规则配置包含条件 orgCode 包含 #{sys_org_code}
@ -145,7 +158,7 @@ public class QueryGenerator {
name = origDescriptors[i].getName();
type = origDescriptors[i].getPropertyType().toString();
try {
if (judgedIsUselessField(name) || !PropertyUtils.isReadable(searchObj, name) || !isExistTable(searchObj, name) || (excludeFields != null && excludeFields.contains(name))) {
if (judgedIsUselessField(name) || !PropertyUtils.isReadable(searchObj, name) || !isExistTable(searchObj, name, allSearch) || (excludeFields != null && excludeFields.contains(name))) {
continue;
}
//模糊查询
@ -207,6 +220,7 @@ public class QueryGenerator {
/**
* 多字段排序 TODO1 需要修改前端
*
* @param queryWrapper
* @param parameterMap
* @param alias
@ -535,7 +549,7 @@ public class QueryGenerator {
name = origDescriptors[i].getName();
type = origDescriptors[i].getPropertyType().toString();
try {
if (!isExistTable(searchObj, name)) {
if (!isExistTable(searchObj, name, false)) {
continue;
}
if (judgedIsUselessField(name) || !PropertyUtils.isReadable(searchObj, name) || (excludeFields != null && excludeFields.contains(name))) {
@ -597,7 +611,10 @@ public class QueryGenerator {
doSuperQuery(queryWrapper, parameterMap, defaultAlias);
}
private static boolean isExistTable(Object searchObj, String name) {
private static boolean isExistTable(Object searchObj, String name, boolean allSearch) {
if (allSearch) {
return true;
}
Field field = ReflectUtil.getField(searchObj.getClass(), name);
Object queryEndTime = AnnotationUtil.getAnnotationValue(field, TableField.class, "exist");
return !Objects.equals(queryEndTime, false);

View File

@ -111,4 +111,5 @@ public interface Cts {
String S1111 = "_";
String STR1112 = ".";
String S32434 = ".";
String LIMIT_1 = "limit 1";
}

View File

@ -28,14 +28,9 @@ public class Notice implements Serializable {
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "消息通知")
private java.lang.Long id;
/**
* 类型1考勤提醒2人员报警,3车辆4混凝土监测5卸料平台6配电箱7扬尘,8视频9标养室,10安全检查,11质量检查,12塔吊,13升降机,"
* "14电表,15水表,16访客,17,防疫人员通知18访客通知,19巡检点,20人员的资质证书即将到期,21人员的合同信息即将到期22人员的保险信息即将到期,"
* "23同步人员到海康isc,24同步车辆到海康isc,25同步组织到海康isc 30工作流审批通知31大屏的安全和质量,32大屏的危大33应急处置
*/
@ApiModelProperty(value = "类型1考勤提醒2人员报警,3车辆4混凝土监测5卸料平台6配电箱7扬尘,8视频9标养室,10安全检查,11质量检查,12塔吊,13升降机," +
"14电表,15水表,16访客,17,防疫人员通知18访客通知,19巡检点,20人员的资质证书即将到期,21人员的合同信息即将到期22人员的保险信息即将到期," +
"23同步人员到海康isc,24同步车辆到海康isc,25同步组织到海康isc 30工作流审批通知31大屏的安全和质量,32大屏的危大33应急处置")
"23同步人员到海康isc,24同步车辆到海康isc,25同步组织到海康isc 30工作流审批通知31大屏的安全和质量,32大屏的危大33应急处置34车辆不安全行为识别监测")
private java.lang.String type;
/**
* 消息内容

View File

@ -104,6 +104,8 @@ public class SystemLogoConfig implements Serializable {
private java.lang.Integer certificateExpireWarnAheadDay;
@ApiModelProperty(value = "是否显示资料中心0不显示1显示")
private java.lang.Integer showFileCenter;
@ApiModelProperty(value = "是否开启用户密码超期重置")
private java.lang.Integer enablePasswordReset;
@TableField(exist = false)
private java.lang.String fileStorageType;
}

View File

@ -382,6 +382,18 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
result.put("sn", toCompanyProject.getSn());
SystemLogoConfig config = getSystemLogoConfig(toCompanyProject.getHeadquartersSn());
result.put("systemLogoConfig", config);
if (Objects.equals(config.getEnablePasswordReset(),1)) {
//密码过期就返回userId提示修改密码
if (PwUtil.checkPwExpire(systemUser.getPwUpdateTime())) {
HashMap<String, Object> m = new HashMap<>(16);
m.put("expire", true);
m.put("userId", systemUser.getUserId());
m.put("account", systemUser.getAccount());
m.put("msg", "需要修改密码");
m.put("token", jwtTokenProvider.createToken(systemUser.getAccount(), 3600));
return m;
}
}
}
return result;
} else {
@ -439,6 +451,18 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
companyConfig.setEffectiveTime(60 * 60 * 24 * 30 * 12);
}
SystemLogoConfig slc = this.getSystemLogoConfig(companyConfig.getHeadquartersSn());
if (Objects.equals(slc.getEnablePasswordReset(),1)) {
//密码过期就返回userId提示修改密码
if (PwUtil.checkPwExpire(systemUser.getPwUpdateTime())) {
HashMap<String, Object> m = new HashMap<>(16);
m.put("expire", true);
m.put("userId", systemUser.getUserId());
m.put("account", systemUser.getAccount());
m.put("msg", "需要修改密码");
m.put("token", jwtTokenProvider.createToken(systemUser.getAccount(), 3600));
return m;
}
}
String token = jwtTokenProvider.createToken(account, companyConfig.getEffectiveTime(), slc != null ? slc.getLoginTimeOut() : null);
UserEnterprise userEnterprise = userEnterpriseService.selectUserEnterpriseByUserId(systemUser.getUserId());
if (userEnterprise != null) {
@ -978,7 +1002,7 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
@Override
public void editProjectUser(SystemUser systemUser) {
SystemUser systemUser1 = systemUserMapper.selectById(systemUser.getUserId());
if (!systemUser1.getXzProjectOrgId().toString().equals(systemUser.getXzProjectOrgId().toString())) {
if (!Objects.equals(systemUser1.getXzProjectOrgId(),systemUser.getXzProjectOrgId())) {
// 判断是否存在工作流的流程中
List<HistoricProcessInstance> list = historyService.createHistoricProcessInstanceQuery().unfinished().list();
if (list.size() > 0) {
@ -1546,17 +1570,6 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
}
}
//密码过期就返回userId提示修改密码
if (PwUtil.checkPwExpire(systemUser.getPwUpdateTime())) {
HashMap<String, Object> m = new HashMap<>(16);
m.put("expire", true);
m.put("userId", systemUser.getUserId());
m.put("account", systemUser.getAccount());
m.put("msg", "需要修改密码");
m.put("token", jwtTokenProvider.createToken(systemUser.getAccount(), 3600));
return m;
}
authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(account, systemUser.getShowPassword()));
return doLogin(map, systemUser);

View File

@ -140,6 +140,7 @@ public class CheckingPointController {
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "body", required = false, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "body", required = false, dataType = "Integer"),
@ApiImplicitParam(name = "xzCheckingRouteTaskId", value = "星纵-巡检路线的任务Id", paramType = "body", required = false, dataType = "String"),
@ApiImplicitParam(name = "checkingPointId", value = "巡检点表id", paramType = "body", required = false, dataType = "String"),
})
@PostMapping(value = "/getTaskDetailPage")
public Result<IPage<TaskDetailPageVo>> getTaskDetailPage(@ApiIgnore @RequestBody Map<String,Object> param) {

View File

@ -189,5 +189,17 @@ public class CheckingPointInfo implements Serializable {
@TableField(exist = false)
@ApiModelProperty(value = "合作单位")
private java.lang.String enterpriseName;
/**
* 经度
*/
@TableField(exist = false)
@ApiModelProperty("经度")
private Double longitude;
/**
* 维度
*/
@TableField(exist = false)
@ApiModelProperty("维度")
private Double latitude;
}

View File

@ -16,7 +16,9 @@
xcrt.item_name,
(SELECT group_concat(nu.enterprise_name)
FROM enterprise_info nu
WHERE find_in_set(nu.id, cp.enterprise_id)) as enterprise_name
WHERE find_in_set(nu.id, cp.enterprise_id)) as enterprise_name,
cp.latitude,
cp.longitude
from checking_point_info t
join checking_point cp on t.checking_point_id = cp.id
left join system_user su on t.checking_point_user_id = su.user_id

View File

@ -140,9 +140,11 @@
join xz_checking_route_task xcrt on xcr.id = xcrt.xz_checking_route_id
left join checking_point_info t on t.checking_point_id = cp.id and t.xz_checking_route_task_id = xcrt.id
left join system_user su on t.checking_point_user_id = su.user_id
left join enterprise_info ei on find_in_set(ei.id,cp.enterprise_id)
left join system_user uo on t.operate_id = uo.user_id
left join quality_region qr on qr.id = cp.quality_region_id
WHERE xcrt.id = #{param.xzCheckingRouteTaskId}
<if test="param.checkingPointId != null and param.checkingPointId != ''">
and xcrtp.checking_point_id = #{param.checkingPointId}
</if>
</select>
</mapper>

View File

@ -363,6 +363,7 @@ public class ExamQuestionBankController {
* @param response
* @return
*/
@OperLog(operModul = "题目管理", operType = "导入", operDesc = "通过excel导入题目管理信息")
@ApiOperation(value = "通过excel导入题目管理信息", notes = "通过excel导入题目管理信息", httpMethod = "POST")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
@ -371,6 +372,7 @@ public class ExamQuestionBankController {
List<ExamSubject> subList = examSubjectService.list();
UserInfo user = SecurityUtils.getUser();
SystemUser systemUser = systemUserService.getById(user.getUserId());
String projectSn = request.getParameter("projectSn");
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
MultipartFile file = entity.getValue();// 获取上传文件对象
try {
@ -408,7 +410,7 @@ public class ExamQuestionBankController {
} catch (Exception e) {
throw new CustomException("分数格式错误,请填写正确的分数", HttpStatus.INTERNAL_SERVER_ERROR);
}
examQuestionBank.setProjectSn(systemUser.getSn());
examQuestionBank.setProjectSn(projectSn);
examQuestionBank.setCreateBy(systemUser.getUserId().toString());
examQuestionBank.setCreateTime(new Date());
examQuestionBank.setUpdateBy(systemUser.getUserId().toString());

View File

@ -72,11 +72,17 @@ public class QualityRectifyRecord implements Serializable {
@ApiModelProperty(value = "创建时间")
private java.lang.String createTime;
/**
* 创建时间
* 创建
*/
@Excel(name = "创建人", width = 15)
@ApiModelProperty(value = "创建人")
private java.lang.Long createUser;
/**
* 违章人员
*/
@Excel(name = "违章人员", width = 15)
@ApiModelProperty(value = "违章人员")
private Long violatorId;
@TableField(exist = false)
private String realName;

View File

@ -295,54 +295,6 @@ public class QualityInspectionRecordServiceImpl extends ServiceImpl<QualityInspe
noticeService.addProjectLevelNoticeAndApp(qualityInspectionRecord.getProjectSn(), title, systemUserService.getFrameUserNames(changeId+"") + "有一条质量检查待整改,问题:" + qualityInspectionRecord.getDangerItemContent(), "11", null);
}
sanjiangDataCall.sendAddQualityInspectionRecord(qualityInspectionRecord);
deductScoreIf(qualityInspectionRecord);
}
private void deductScoreIf(QualityInspectionRecord hiddenDangerInspectRecord) {
if (hiddenDangerInspectRecord.getRecordType() == null || Objects.equals(hiddenDangerInspectRecord.getRecordType(), QualityInspectionRecordRecordTypeEnum.RECORD.getValue())) {
return;
}
Long inspectHiddenDangerItemRecordId = hiddenDangerInspectRecord.getDangerItemId();
DangerItemRecord item = dangerItemRecordMapper.selectById(inspectHiddenDangerItemRecordId);
if (item == null || item.getDeductScore() == null) {
return;
}
Double ds = item.getDeductScore();
if (ds == null || ds == 0) {
return;
}
Long changeUser = hiddenDangerInspectRecord.getChangeId();
if (changeUser == null) {
return;
}
SystemUser systemUser = systemUserMapper.selectById(changeUser);
if (systemUser == null) {
return;
}
WorkerInfo workerInfo = workerInfoMapper.selectById(systemUser.getWorkerId());
if (workerInfo == null) {
return;
}
//扣分
HashMap<String, Object> map = new HashMap<>(16);
map.put("id", workerInfo.getId());
map.put("deductScore", ds);
workerInfoService.updateScoreSendAuth(map);
//存记录
XzDeductScoreRecord vo = new XzDeductScoreRecord();
vo.setProjectSn(hiddenDangerInspectRecord.getProjectSn());
vo.setWorkerId(workerInfo.getId());
vo.setTypeName(item.getContent());
vo.setDeductScore(-item.getDeductScore());
vo.setType(3);
vo.setCreateDate(new Date());
vo.setCurScore(workerInfo.getSafeScore() - item.getDeductScore() >= 0 ? workerInfo.getSafeScore() - item.getDeductScore() : 0);
vo.setDeductReason(StrUtil.format("您在{}发现质量隐患({}-{})扣{}分", DateUtil.format(vo.getCreateDate(), "yyyy年MM月dd日HH:mm:ss"), "质量检査", vo.getTypeName() == null ? "" : vo.getTypeName(), item.getDeductScore()));
vo.setTypeTableId(hiddenDangerInspectRecord.getId());
xzDeductScoreRecordMapper.insert(vo);
}
@Override
@ -580,7 +532,6 @@ public class QualityInspectionRecordServiceImpl extends ServiceImpl<QualityInspe
saveQualityInspectionRecord(qualityInspectionRecord);
} else {
updateById(qualityInspectionRecord);
deductScoreIf(qualityInspectionRecord);
}
}

View File

@ -7,6 +7,7 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -16,18 +17,30 @@ import com.gexin.fastjson.JSONObject;
import com.zhgd.redis.lock.redisson.DistributedLock;
import com.zhgd.redis.lock.redisson.RedissonDistributedLock;
import com.zhgd.xmgl.call.SanjiangDataCall;
import com.zhgd.xmgl.constant.Cts;
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
import com.zhgd.xmgl.modules.basicdata.mapper.SystemUserMapper;
import com.zhgd.xmgl.modules.basicdata.service.INoticeService;
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
import com.zhgd.xmgl.modules.quality.entity.DangerItemRecord;
import com.zhgd.xmgl.modules.quality.entity.QualityInspectionRecord;
import com.zhgd.xmgl.modules.quality.entity.QualityRectifyRecord;
import com.zhgd.xmgl.modules.quality.entity.vo.RecordVo;
import com.zhgd.xmgl.modules.quality.enums.QualityInspectionRecordRecordTypeEnum;
import com.zhgd.xmgl.modules.quality.enums.QualityRectifyRecordStatusEnum;
import com.zhgd.xmgl.modules.quality.enums.QualityRectifyRecordTypeEnum;
import com.zhgd.xmgl.modules.quality.mapper.DangerItemRecordMapper;
import com.zhgd.xmgl.modules.quality.mapper.QualityInspectionRecordMapper;
import com.zhgd.xmgl.modules.quality.mapper.QualityRectifyRecordMapper;
import com.zhgd.xmgl.modules.quality.service.IQualityInspectionRecordService;
import com.zhgd.xmgl.modules.quality.service.IQualityRectifyRecordService;
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.worker.service.IWorkerInfoService;
import com.zhgd.xmgl.modules.xz.entity.XzDeductScoreRecord;
import com.zhgd.xmgl.modules.xz.mapper.XzDeductScoreRecordMapper;
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityQualityRectifyRecord;
import com.zhgd.xmgl.push.config.PushPayloads;
import com.zhgd.xmgl.util.TimeUtil;
import org.apache.commons.collections.CollectionUtils;
@ -68,6 +81,10 @@ public class QualityRectifyRecordServiceImpl extends ServiceImpl<QualityRectifyR
RedissonDistributedLock redissonDistributedLock;
@Autowired
EnterpriseInfoMapper enterpriseInfoMapper;
@Autowired
DangerItemRecordMapper dangerItemRecordMapper;
@Autowired
XzDeductScoreRecordMapper xzDeductScoreRecordMapper;
@Value("${basePath}")
private String basePath;
@Autowired
@ -79,6 +96,14 @@ public class QualityRectifyRecordServiceImpl extends ServiceImpl<QualityRectifyR
@Lazy
@Autowired
private ISystemUserService systemUserService;
@Lazy
@Autowired
private IWorkerInfoService workerInfoService;
@Lazy
@Autowired
private SystemUserMapper systemUserMapper;
@Autowired
private WorkerInfoMapper workerInfoMapper;
@Override
public List<QualityRectifyRecord> selectRectifyRecordList(Map<String, Object> map) {
@ -128,7 +153,7 @@ public class QualityRectifyRecordServiceImpl extends ServiceImpl<QualityRectifyR
String title = "质量管理整改结果待复查";
noticeService.addUserNoticeAndApp(tempQualityInspectionRecord.getReviewId(), title, "您有一条质量检查的整改结果需要复查,请及时查看。", "11",
PushPayloads.buildPushPayload(11, qualityInspectionRecord));
noticeService.addProjectLevelNoticeAndApp(projectSn, title, systemUserService.getFrameUserNames(tempQualityInspectionRecord.getReviewId()+"") + "有一条质量检查的整改结果需要复查,请及时查看。", "11",
noticeService.addProjectLevelNoticeAndApp(projectSn, title, systemUserService.getFrameUserNames(tempQualityInspectionRecord.getReviewId() + "") + "有一条质量检查的整改结果需要复查,请及时查看。", "11",
PushPayloads.buildPushPayload(11, qualityInspectionRecord));
} else {
qualityInspectionRecord.setStatus(2);
@ -139,13 +164,13 @@ public class QualityRectifyRecordServiceImpl extends ServiceImpl<QualityRectifyR
qualityInspectionRecord.setStatus(4);
noticeService.addUserNoticeAndApp(tempQualityInspectionRecord.getVerifyManId(), "质量管理整改结果核验通知", "您有一条质量检查的整改结果需要核验,请及时查看。", "11",
PushPayloads.buildPushPayload(11, qualityInspectionRecord));
noticeService.addProjectLevelNoticeAndApp(projectSn, "质量管理整改结果核验通知", systemUserService.getFrameUserNames(tempQualityInspectionRecord.getVerifyManId()+"") + "有一条质量检查的整改结果需要核验,请及时查看。", "11",
noticeService.addProjectLevelNoticeAndApp(projectSn, "质量管理整改结果核验通知", systemUserService.getFrameUserNames(tempQualityInspectionRecord.getVerifyManId() + "") + "有一条质量检查的整改结果需要核验,请及时查看。", "11",
PushPayloads.buildPushPayload(11, qualityInspectionRecord));
} else {
qualityInspectionRecord.setStatus(2);
noticeService.addUserNoticeAndApp(tempQualityInspectionRecord.getChangeId(), "质量管理整改结果复查通知", "您提交的质量检查的整改结果复查不通过,请及时重新整改。", "11",
PushPayloads.buildPushPayload(11, qualityInspectionRecord));
noticeService.addProjectLevelNoticeAndApp(projectSn, "质量管理整改结果复查通知", systemUserService.getFrameUserNames(tempQualityInspectionRecord.getChangeId()+"") + "提交的质量检查的整改结果复查不通过,请及时重新整改。", "11",
noticeService.addProjectLevelNoticeAndApp(projectSn, "质量管理整改结果复查通知", systemUserService.getFrameUserNames(tempQualityInspectionRecord.getChangeId() + "") + "提交的质量检查的整改结果复查不通过,请及时重新整改。", "11",
PushPayloads.buildPushPayload(11, qualityInspectionRecord));
}
} else {
@ -156,6 +181,8 @@ public class QualityRectifyRecordServiceImpl extends ServiceImpl<QualityRectifyR
PushPayloads.buildPushPayload(11, qualityInspectionRecord));
noticeService.addProjectLevelNoticeAndApp(projectSn, "质量管理整改结果核验通知", systemUserService.getFrameUserNames(String.valueOf(tempQualityInspectionRecord.getChangeId())) + "提交的质量检查的整改结果已通过核验。", "11",
PushPayloads.buildPushPayload(11, qualityInspectionRecord));
this.deductScoreIf(qualityRectifyRecord);
} else {
qualityInspectionRecord.setStatus(2);
noticeService.addUserNoticeAndApp(tempQualityInspectionRecord.getChangeId(), "质量管理整改结果核验通知", "您提交的质量检查的整改结果核验不通过,请及时重新整改。", "11",
@ -170,6 +197,56 @@ public class QualityRectifyRecordServiceImpl extends ServiceImpl<QualityRectifyR
sanjiangDataCall.sendAddQualityRectifyRecord(qualityRectifyRecord, qualityInspectionRecord);
}
private void deductScoreIf(QualityRectifyRecord qualityRectifyRecord) {
QualityInspectionRecord qualityInspectionRecord = qualityInspectionRecordMapper.selectById(qualityRectifyRecord.getQualityId());
if (qualityInspectionRecord.getRecordType() == null || Objects.equals(qualityInspectionRecord.getRecordType(), QualityInspectionRecordRecordTypeEnum.RECORD.getValue())) {
return;
}
Long inspectHiddenDangerItemRecordId = qualityInspectionRecord.getDangerItemId();
DangerItemRecord item = dangerItemRecordMapper.selectById(inspectHiddenDangerItemRecordId);
if (item == null || item.getDeductScore() == null) {
return;
}
Double ds = item.getDeductScore();
if (ds == null || ds == 0) {
return;
}
QualityRectifyRecord rectifyRecord = baseMapper.selectOne(new LambdaQueryWrapper<QualityRectifyRecord>()
.eq(QualityRectifyRecord::getQualityId, qualityRectifyRecord.getQualityId())
.eq(QualityRectifyRecord::getStatus, 2)
.eq(QualityRectifyRecord::getType, 1)
.orderByDesc(QualityRectifyRecord::getRectifyTime).last(Cts.LIMIT_1));
Long changeUser = rectifyRecord.getViolatorId();
if (changeUser == null) {
return;
}
WorkerInfo workerInfo = workerInfoMapper.selectById(changeUser);
if (workerInfo == null) {
return;
}
//扣分
HashMap<String, Object> map = new HashMap<>(16);
map.put("id", workerInfo.getId());
map.put("deductScore", ds);
workerInfoService.updateScoreSendAuth(map);
//存记录
XzDeductScoreRecord vo = new XzDeductScoreRecord();
vo.setProjectSn(qualityInspectionRecord.getProjectSn());
vo.setWorkerId(workerInfo.getId());
vo.setTypeName(item.getContent());
vo.setDeductScore(-item.getDeductScore());
vo.setType(3);
vo.setCreateDate(new Date());
vo.setCurScore(workerInfo.getSafeScore() - item.getDeductScore() >= 0 ? workerInfo.getSafeScore() - item.getDeductScore() : 0);
vo.setDeductReason(StrUtil.format("您在{}发现质量隐患({}-{})扣{}分", DateUtil.format(vo.getCreateDate(), "yyyy年MM月dd日HH:mm:ss"), "质量检査", vo.getTypeName() == null ? "" : vo.getTypeName(), item.getDeductScore()));
vo.setTypeTableId(qualityInspectionRecord.getId());
xzDeductScoreRecordMapper.insert(vo);
}
@Override
public void qualityInspectionRecordRectifyExportExcel(Map<String, Object> map, HttpServletResponse response) throws IOException {
String fileName = "qualityInspectionRecordRectifyTemplate.xls";

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.xmgl.constant.Cts;
import com.zhgd.xmgl.modules.xz.emergency.entity.XzEmergencyPush;
import com.zhgd.xmgl.modules.xz.emergency.mapper.XzEmergencyPushMapper;
import com.zhgd.xmgl.modules.xz.emergency.service.IXzEmergencyPushService;
@ -66,6 +67,7 @@ public class XzEmergencyPushServiceImpl extends ServiceImpl<XzEmergencyPushMappe
XzEmergencyPush oldXzEmergencyPush = baseMapper.selectOne(new LambdaQueryWrapper<XzEmergencyPush>()
.eq(XzEmergencyPush::getProjectSn, xzEmergencyPush.getProjectSn())
.eq(XzEmergencyPush::getEnterpriseId, xzEmergencyPush.getEnterpriseId())
.last(Cts.IGNORE_DATA_SCOPE_CONDITION)
);
if (oldXzEmergencyPush == null) {
add(xzEmergencyPush);

View File

@ -233,7 +233,7 @@ public class XzEmergencyRecordServiceImpl extends ServiceImpl<XzEmergencyRecordM
}
}
if (msg != null) {
noticeService.addProjectLevelNotice(type.getProjectSn(), title, systemUserService.getFrameUserNames(push.getEmergencyManagerId()) + msg, "33", null);
noticeService.addProjectLevelNotice(entity.getProjectSn(), title, systemUserService.getFrameUserNames(push.getEmergencyManagerId()) + msg, "33", null);
}
}

View File

@ -73,11 +73,17 @@ public class XzSecurityQualityRectifyRecord implements Serializable {
@ApiModelProperty(value = "创建时间")
private String createTime;
/**
* 创建时间
* 创建
*/
@Excel(name = "创建人", width = 15)
@ApiModelProperty(value = "创建人")
private Long createUser;
/**
* 违章人员
*/
@Excel(name = "违章人员", width = 15)
@ApiModelProperty(value = "违章人员")
private Long violatorId;
@TableField(exist = false)
private String realName;

View File

@ -416,53 +416,6 @@ public class XzSecurityQualityInspectionRecordServiceImpl extends ServiceImpl<Xz
record.getRegionName(), StrUtil.subAfter(record.getDangerItemContent(), "/", true)));
}
}
deductScoreIf(record);
}
private void deductScoreIf(XzSecurityQualityInspectionRecord hiddenDangerInspectRecord) {
if (hiddenDangerInspectRecord.getRecordType() == null || Objects.equals(hiddenDangerInspectRecord.getRecordType(), XzSecurityQualityInspectionRecordStatusEnum.NOT_RECTIFIED.getValue())) {
return;
}
Long inspectHiddenDangerItemRecordId = hiddenDangerInspectRecord.getDangerItemId();
XzSecurityDangerItemRecord item = xzSecurityDangerItemRecordMapper.selectById(inspectHiddenDangerItemRecordId);
if (item == null || item.getDeductScore() == null) {
return;
}
Double ds = item.getDeductScore();
if (ds == null || ds == 0) {
return;
}
Long changeUser = hiddenDangerInspectRecord.getChangeId();
if (changeUser == null) {
return;
}
SystemUser systemUser = systemUserMapper.selectById(changeUser);
if (systemUser == null) {
return;
}
WorkerInfo workerInfo = workerInfoMapper.selectById(systemUser.getWorkerId());
if (workerInfo == null) {
return;
}
//扣分
HashMap<String, Object> map = new HashMap<>(16);
map.put("id", workerInfo.getId());
map.put("deductScore", ds);
workerInfoService.updateScoreSendAuth(map);
//存记录
XzDeductScoreRecord vo = new XzDeductScoreRecord();
vo.setProjectSn(hiddenDangerInspectRecord.getProjectSn());
vo.setWorkerId(workerInfo.getId());
vo.setTypeName(item.getContent());
vo.setDeductScore(-item.getDeductScore());
vo.setType(1);
vo.setCreateDate(new Date());
vo.setCurScore(workerInfo.getSafeScore() - item.getDeductScore() >= 0 ? workerInfo.getSafeScore() - item.getDeductScore() : 0);
vo.setDeductReason(StrUtil.format("您在{}发现安全隐患({}-{})扣{}分", DateUtil.format(vo.getCreateDate(), "yyyy年MM月dd日HH:mm:ss"), "安全检査", vo.getTypeName() == null ? "" : vo.getTypeName(), item.getDeductScore()));
vo.setTypeTableId(hiddenDangerInspectRecord.getId());
xzDeductScoreRecordMapper.insert(vo);
}
@Override
@ -631,7 +584,6 @@ public class XzSecurityQualityInspectionRecordServiceImpl extends ServiceImpl<Xz
saveQualityInspectionRecord(xzSecurityQualityInspectionRecord);
} else {
updateById(xzSecurityQualityInspectionRecord);
deductScoreIf(xzSecurityQualityInspectionRecord);
}
}

View File

@ -14,16 +14,27 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gexin.fastjson.JSON;
import com.gexin.fastjson.JSONArray;
import com.gexin.fastjson.JSONObject;
import com.zhgd.redis.lock.redisson.DistributedLock;
import com.zhgd.xmgl.call.SanjiangDataCall;
import com.zhgd.xmgl.constant.Cts;
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
import com.zhgd.xmgl.modules.basicdata.mapper.SystemUserMapper;
import com.zhgd.xmgl.modules.basicdata.service.INoticeService;
import com.zhgd.xmgl.modules.basicdata.service.impl.SystemUserServiceImpl;
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.worker.service.IWorkerInfoService;
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.XzSecurityQualityInspectionRecord;
import com.zhgd.xmgl.modules.xz.security.entity.XzSecurityQualityRectifyRecord;
import com.zhgd.xmgl.modules.xz.security.entity.vo.XzSecurityRecordVo;
import com.zhgd.xmgl.modules.xz.security.enums.XzSecurityQualityRectifyRecordStatusEnum;
import com.zhgd.xmgl.modules.xz.security.enums.XzSecurityQualityRectifyRecordTypeEnum;
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.XzSecurityQualityRectifyRecordMapper;
import com.zhgd.xmgl.modules.xz.security.service.IXzSecurityQualityInspectionRecordService;
@ -66,6 +77,10 @@ public class XzSecurityQualityRectifyRecordServiceImpl extends ServiceImpl<XzSec
SanjiangDataCall sanjiangDataCall;
@Autowired
EnterpriseInfoMapper enterpriseInfoMapper;
@Autowired
XzSecurityDangerItemRecordMapper xzSecurityDangerItemRecordMapper;
@Autowired
XzDeductScoreRecordMapper xzDeductScoreRecordMapper;
@Value("${basePath}")
private String basePath;
@Autowired
@ -77,6 +92,14 @@ public class XzSecurityQualityRectifyRecordServiceImpl extends ServiceImpl<XzSec
@Lazy
@Autowired
private SystemUserServiceImpl systemUserService;
@Lazy
@Autowired
private IWorkerInfoService workerInfoService;
@Lazy
@Autowired
private SystemUserMapper systemUserMapper;
@Autowired
private WorkerInfoMapper workerInfoMapper;
@Override
public List<XzSecurityQualityRectifyRecord> selectRectifyRecordList(Map<String, Object> map) {
@ -110,6 +133,7 @@ public class XzSecurityQualityRectifyRecordServiceImpl extends ServiceImpl<XzSec
}
@Override
@DistributedLock(keyPrefix = "xz_security_quality_rectify_record:", key = "#qualityRectifyRecord.qualityId", tryLok = true, lockTime = 0)
public void saveQualityRectifyRecord(XzSecurityQualityRectifyRecord qualityRectifyRecord) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
qualityRectifyRecord.setCreateTime(sdf.format(new Date()));
@ -156,6 +180,7 @@ public class XzSecurityQualityRectifyRecordServiceImpl extends ServiceImpl<XzSec
PushPayloads.buildPushPayload(10, tempQualityInspectionRecord));
qualityInspectionRecordService.noticeBigScreen("31", tempQualityInspectionRecord, qualityRectifyRecord.getRectifyTime(), StrUtil.format("{}核验了{}的一条{}安全隐患问题,请注意查看!",
enterpriseInfo.getEnterpriseName(), tempQualityInspectionRecord.getRegionName(), StrUtil.subAfter(tempQualityInspectionRecord.getDangerItemContent(), "/", true)));
this.deductScoreIf(qualityRectifyRecord);
} else {
tempQualityInspectionRecord.setStatus(2);
noticeService.addUserNoticeAndApp(tempQualityInspectionRecord.getChangeId(), "安全管理整改结果核验通知", "您提交的安全检查的整改结果核验不通过,请及时重新整改。", "10",
@ -168,6 +193,51 @@ public class XzSecurityQualityRectifyRecordServiceImpl extends ServiceImpl<XzSec
}
private void deductScoreIf(XzSecurityQualityRectifyRecord qualityRectifyRecord) {
XzSecurityQualityInspectionRecord hiddenDangerInspectRecord = xzSecurityQualityInspectionRecordMapper.selectById(qualityRectifyRecord.getQualityId());
Long inspectHiddenDangerItemRecordId = hiddenDangerInspectRecord.getDangerItemId();
XzSecurityDangerItemRecord item = xzSecurityDangerItemRecordMapper.selectById(inspectHiddenDangerItemRecordId);
if (item == null || item.getDeductScore() == null) {
return;
}
Double ds = item.getDeductScore();
if (ds == null || ds == 0) {
return;
}
XzSecurityQualityRectifyRecord rectifyRecord = baseMapper.selectOne(new LambdaQueryWrapper<XzSecurityQualityRectifyRecord>()
.eq(XzSecurityQualityRectifyRecord::getQualityId, qualityRectifyRecord.getQualityId())
.eq(XzSecurityQualityRectifyRecord::getStatus, 2)
.eq(XzSecurityQualityRectifyRecord::getType, 1)
.orderByDesc(XzSecurityQualityRectifyRecord::getRectifyTime).last(Cts.LIMIT_1));
Long changeUser = rectifyRecord.getViolatorId();
if (changeUser == null) {
return;
}
WorkerInfo workerInfo = workerInfoMapper.selectById(changeUser);
if (workerInfo == null) {
return;
}
//扣分
HashMap<String, Object> map = new HashMap<>(16);
map.put("id", workerInfo.getId());
map.put("deductScore", ds);
workerInfoService.updateScoreSendAuth(map);
//存记录
XzDeductScoreRecord vo = new XzDeductScoreRecord();
vo.setProjectSn(hiddenDangerInspectRecord.getProjectSn());
vo.setWorkerId(workerInfo.getId());
vo.setTypeName(item.getContent());
vo.setDeductScore(-item.getDeductScore());
vo.setType(1);
vo.setCreateDate(new Date());
vo.setCurScore(workerInfo.getSafeScore() - item.getDeductScore() >= 0 ? workerInfo.getSafeScore() - item.getDeductScore() : 0);
vo.setDeductReason(StrUtil.format("您在{}发现安全隐患({}-{})扣{}分", DateUtil.format(vo.getCreateDate(), "yyyy年MM月dd日HH:mm:ss"), "安全检査", vo.getTypeName() == null ? "" : vo.getTypeName(), item.getDeductScore()));
vo.setTypeTableId(hiddenDangerInspectRecord.getId());
xzDeductScoreRecordMapper.insert(vo);
}
@Override
public void qualityInspectionRecordRectifyExportExcel(Map<String, Object> map, HttpServletResponse response) throws IOException {
String fileName = "qualityInspectionRecordRectifyTemplate.xls";

View File

@ -80,6 +80,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
http.authorizeRequests()
//请求路径允许访问
.antMatchers("/xmgl/dangerEnvironmentEvaluate/flow/add").permitAll()
.antMatchers("/xmgl/firstExampleManage/flow/add").permitAll()
.antMatchers("/actuator/**").permitAll()
.antMatchers("/exam/courseRecord/page").permitAll()
.antMatchers("/xmgl/carInfo/validEnterpriseStatus").permitAll()

View File

@ -43,9 +43,8 @@ public class ${entityName}ServiceImpl extends ServiceImpl<${entityName}Mapper, $
}
private QueryWrapper<${entityName}> getQueryWrapper(HashMap<String, Object> param) {
String alias = "";
QueryWrapper<${entityName}> queryWrapper = QueryGenerator.initPageQueryWrapper(${entityName}.class, param, alias);
queryWrapper.orderByDesc(alias + RefUtil.fieldNameUlc(${entityName}::getId));
QueryWrapper<${entityName}> queryWrapper = QueryGenerator.initPageQueryWrapper(${entityName}.class, param, true);
queryWrapper.orderByDesc(RefUtil.fieldNameUlc(${entityName}::getId));
return queryWrapper;
}