包头bug修改

This commit is contained in:
guoshengxiong 2025-03-18 19:34:09 +08:00
parent d2d44b5c40
commit 3e511807eb
19 changed files with 264 additions and 82 deletions

View File

@ -1,12 +1,18 @@
package com.zhgd.xmgl.modules.baotou.controller;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhgd.annotation.OperLog;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.xmgl.modules.baotou.service.IQualityCommonProblemRecordService;
import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.xmgl.modules.baotou.entity.QualityCommonProblemLibrary;
import com.zhgd.xmgl.modules.baotou.entity.QualityCommonProblemRecord;
import com.zhgd.xmgl.modules.baotou.service.IQualityCommonProblemLibraryService;
import com.zhgd.xmgl.modules.baotou.service.IQualityCommonProblemRecordService;
import com.zhgd.xmgl.util.ExcelUtils;
import com.zhgd.xmgl.util.MessageUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@ -15,7 +21,10 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.simpleframework.xml.core.Validate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import springfox.documentation.annotations.ApiIgnore;
import java.util.HashMap;
@ -38,6 +47,9 @@ import java.util.Optional;
public class QualityCommonProblemRecordController {
@Autowired
private IQualityCommonProblemRecordService qualityCommonProblemRecordService;
@Lazy
@Autowired
private IQualityCommonProblemLibraryService qualityCommonProblemLibraryService;
/**
* 分页列表查询
@ -153,6 +165,57 @@ public class QualityCommonProblemRecordController {
return Result.success(qualityCommonProblemRecordService.tree(param));
}
// /**
// * 录入数据模板
// *
// * @return
// */
// @Transactional(rollbackFor = Exception.class)
// @PostMapping(value = "/importData")
// public Result importData(@ApiIgnore MultipartFile file) {
// List<Map<String, String>> list = null;
// try {
// list = ExcelUtils.jxlExlToList(file.getInputStream(), 0);
// if (list == null || list.size() == 0) {
// throw new OpenAlertException(MessageUtil.get("excelNotDataErr"));
// }
// int sort = 0;
// String projectSn = "5B8B3DB047214AE188F2C7916DD08203";
// String one = null;
// Long top1 = null;
// Long top2 = null;
// for (Map<String, String> map : list) {
// if (StrUtil.isNotBlank(one = map.get("left1"))) {
// QualityCommonProblemLibrary library = getLibrary(projectSn, 0L, sort++, one);
// qualityCommonProblemLibraryService.add(library);
// top1 = library.getId();
// } else if (StrUtil.isNotBlank(one = map.get("left2"))) {
// QualityCommonProblemLibrary library = getLibrary(projectSn, top1, sort++, one);
// qualityCommonProblemLibraryService.add(library);
// top2 = library.getId();
// }
// if (StrUtil.isNotBlank(one = map.get("right"))) {
// QualityCommonProblemRecord record = new QualityCommonProblemRecord();
// record.setQualityCommonProblemLibraryId(top2);
// record.setCommonDiseasePhenomena(one);
// record.setProjectSn(projectSn);
// qualityCommonProblemRecordService.add(record);
// }
// }
// } catch (Exception e) {
// e.printStackTrace();
// throw new OpenAlertException();
// }
// return Result.ok();
// }
//
// private QualityCommonProblemLibrary getLibrary(String projectSn, long parentId, int sort, String name) {
// QualityCommonProblemLibrary library = new QualityCommonProblemLibrary();
// library.setQualityCommonProblemName(name);
// library.setProjectSn(projectSn);
// library.setParentId(parentId);
// library.setSort(sort);
// return library;
// }
}

View File

@ -3,6 +3,7 @@ package com.zhgd.xmgl.modules.baotou.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@ -23,28 +24,60 @@ import io.swagger.annotations.ApiModelProperty;
public class ProjectHomeNotice implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private java.lang.Long id;
/**所属项目SN*/
/**
* 所属项目SN
*/
@ApiModelProperty(value = "所属项目SN")
private java.lang.String projectSn;
/**1人员2安全3质量4进度5施工6党建7质量监督通知公告*/
@ApiModelProperty(value="1人员2安全3质量4进度5施工6党建7质量监督通知公告")
/**
* 1人员2安全3质量4进度5施工6党建7质量监督通知公告8系统管理
*/
@ApiModelProperty(value = "1人员2安全3质量4进度5施工6党建7质量监督通知公告8系统管理")
private java.lang.Integer whichModule;
/**标题*/
/**
* 标题
*/
@ApiModelProperty(value = "标题")
private java.lang.String title;
/**内容*/
/**
* 内容
*/
@ApiModelProperty(value = "内容")
private java.lang.String content;
@ApiModelProperty(value = "附件url")
private java.lang.String fileUrl;
/**创建时间*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "上传时间")
private java.util.Date uploadTime;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
private java.util.Date createTime;
/**更新时间*/
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间")
private java.util.Date updateTime;
@ApiModelProperty(value = "下发部门(字典值)")
private java.lang.String issueDepartment;
@ApiModelProperty(value = "1首页显示2专题页显示")
private java.lang.Integer showHome;
@ApiModelProperty(value = "上传人")
private java.lang.Long uploader;
@TableField(exist = false)
@ApiModelProperty(value = "上传人名称")
private java.lang.String uploaderName;
@TableField(exist = false)
@ApiModelProperty(value = "下发部门(字典名)")
private java.lang.String issueDepartmentName;
}

View File

@ -27,7 +27,7 @@
,pgu.project_group_id
from
device_unit t
join project_group pg on find_in_set(pg.id,t.project_group_ids)
left join project_group pg on find_in_set(pg.id,t.project_group_ids)
left join project_group_unit pgu on pg.id = pgu.project_group_id
left join enterprise_info ei on find_in_set(ei.id,t.epc_contractor_ids)
left join enterprise_info ei3 on find_in_set(ei3.id,t.construction_unit_ids)

View File

@ -5,14 +5,24 @@
<select id="queryList" resultType="com.zhgd.xmgl.modules.baotou.entity.ProjectHomeNotice">
select * from (
select t.*
,su.real_name as uploader_name
,di.name as issue_department_name
from project_home_notice t
left join system_user su on su.user_id=t.uploader
left join dictionary_item di on di.data=t.issue_department and
di.dictionary_encoding='project_home_notice_department'
)t
${ew.customSqlSegment}
</select>
<select id="queryById" resultType="com.zhgd.xmgl.modules.baotou.entity.ProjectHomeNotice">
select * from (
select t.*
,su.real_name as uploader_name
,di.name as issue_department_name
from project_home_notice t
left join system_user su on su.user_id=t.uploader
left join dictionary_item di on di.data=t.issue_department and
di.dictionary_encoding='project_home_notice_department'
)t
where t.id = #{id}
</select>
@ -27,8 +37,10 @@
,t.file_url
,t.create_time
,t.update_time
,su.real_name as uploader_name
from
project_home_notice t
left join system_user su on su.user_id=t.uploader
where project_sn = #{param.projectSn} and which_module = 7
union all
select
@ -40,6 +52,7 @@
,r.attachment
,r.time
,r.update_date
,''
from
project_supervision_monthly_report r
where project_sn = #{param.projectSn}

View File

@ -203,8 +203,8 @@ public class PlanFeedbackApprovalController {
return planFeedbackApprovalService.saveInfo(param);
}
@OperLog(operModul = "进度反馈审批管理", operType = "删除", operDesc = "删除关联的作业和反馈记录")
@ApiOperation(value = "删除关联的作业和反馈记录", notes = "删除关联的作业和反馈记录", httpMethod = "POST")
@OperLog(operModul = "进度反馈审批管理", operType = "删除", operDesc = "删除关联的作业和反馈记录(未发起审批时调用)")
@ApiOperation(value = "删除关联的作业和反馈记录(未发起审批时调用)", notes = "删除关联的作业和反馈记录(未发起审批时调用)", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "approvalId", value = "进度反馈审批ID", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "recordId", value = "记录ID", paramType = "body", required = true, dataType = "String"),

View File

@ -126,10 +126,13 @@ public class PlanFeedbackController {
@OperLog(operModul = "进度反馈记录管理", operType = "", operDesc = "查询最新进度反馈记录信息")
@ApiOperation(value = "查询最新进度反馈记录信息", notes = "查询最新进度反馈记录信息", httpMethod = "GET")
@ApiImplicitParam(name = "recordId", value = "计划编制id", paramType = "query", required = true, dataType = "String")
@ApiImplicitParams({
@ApiImplicitParam(name = "recordId", value = "计划编制id", paramType = "query", required = true, dataType = "String"),
@ApiImplicitParam(name = "feedbackType", value = "1计划2实际", paramType = "query", required = false, dataType = "String"),
})
@GetMapping(value = "/getNewest")
public Result<PlanFeedback> getNewest(@RequestParam(name = "recordId", required = true) String recordId) {
return Result.success(planFeedbackService.getNewest(recordId));
public Result<PlanFeedback> getNewest(@RequestParam(name = "recordId", required = true) String recordId, Integer feedbackType) {
return Result.success(planFeedbackService.getNewest(recordId, feedbackType));
}
@OperLog(operModul = "进度反馈记录管理", operType = "", operDesc = "分页查询计划反馈的周期里程碑列表")

View File

@ -415,7 +415,7 @@ public class PlanRecordController {
// }
// /**
// * 导入里程碑
// *录入数据-里程碑
// *
// * @return
// */

View File

@ -33,17 +33,28 @@ public class PlanFeedbackApprovalWork implements Serializable {
/**计划编制id*/
@ApiModelProperty(value="计划编制id")
private java.lang.Long recordId ;
/**反馈id*/
/**
* 反馈id这个审批未通过之前是空的通过之后才保存因为审批未通过之前外面的反馈要和里面批量反馈的反馈内容一致
*/
@ApiModelProperty(value="反馈id")
private java.lang.Long feedbackId;
/**创建时间 yyyy-MM-dd HH:mm:ss*/
/**
* 创建时间 yyyy-MM-dd HH:mm:ss
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date createTime;
/**更新时间 yyyy-MM-dd HH:mm:ss*/
/**
* 更新时间 yyyy-MM-dd HH:mm:ss
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间 yyyy-MM-dd HH:mm:ss")
private java.util.Date updateTime;
/**
* 1计划2实际
**/
@ApiModelProperty(value = "1计划2实际")
private Integer feedbackType;
}

View File

@ -200,4 +200,12 @@ public class PlanRecord implements Serializable {
@ApiModelProperty(value = "审批通过的最新的feedBackId")
@Deprecated
private Long newestFeedBackId;
@TableField(exist = false)
@ApiModelProperty(value = "1能反馈")
private Integer isFeedback;
@TableField(exist = false)
@ApiModelProperty(value = "1计划2实际")
private Integer feedbackType;
}

View File

@ -64,7 +64,7 @@ public interface IPlanFeedbackService extends IService<PlanFeedback> {
*/
PlanFeedback queryById(String id);
PlanFeedback getNewest(String recordId);
PlanFeedback getNewest(String recordId, Integer feedbackType);
List<PlanFeedbackPeriod> getPeriodMilestones(Map<String, Object> param);

View File

@ -1,8 +1,8 @@
package com.zhgd.xmgl.modules.baotou.plan.service;
import com.zhgd.xmgl.modules.baotou.plan.entity.PlanMilestone;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.xmgl.modules.baotou.plan.entity.PlanMilestone;
import com.zhgd.xmgl.modules.baotou.plan.entity.PlanRecord;
import java.util.HashMap;
@ -17,36 +17,47 @@ import java.util.List;
public interface IPlanMilestoneService extends IService<PlanMilestone> {
/**
* 分页列表查询进度里程碑信息
*
* @param param 参数map
* @return
*/
IPage<PlanMilestone> queryPageList(HashMap<String, Object> param);
/**
* 列表查询进度里程碑信息
*
* @param param 参数map
* @return
*/
List<PlanMilestone> queryList(HashMap<String, Object> param);
/**
* 添加进度里程碑信息
*
* @param planMilestone 进度里程碑
* @return
*/
void add(PlanMilestone planMilestone);
/**
* 编辑进度里程碑信息
*
* @param planMilestone 进度里程碑
* @return
*/
void edit(PlanMilestone planMilestone);
/**
* 根据id删除进度里程碑信息
*
* @param id 进度里程碑的id
* @return
*/
void delete(String id);
/**
* 根据id查询进度里程碑信息
*
* @param id 进度里程碑的id
* @return
*/
@ -54,6 +65,13 @@ public interface IPlanMilestoneService extends IService<PlanMilestone> {
List<PlanMilestone> getParentMilestones(String recordId);
/**
* 获取计划编制的里程碑
*
* @param record
* @param allPlanMilestones
* @return
*/
List<PlanMilestone> getParentMilestones(PlanRecord record, List<PlanMilestone> allPlanMilestones);
/**

View File

@ -155,6 +155,7 @@ public class PlanFeedbackApprovalServiceImpl extends ServiceImpl<PlanFeedbackApp
PlanFeedbackApprovalWork work = ridMap.get(record.getId());
if (work != null) {
record.setFeedbackId(work.getFeedbackId());
record.setFeedbackType(work.getFeedbackType());
}
}
}
@ -300,7 +301,7 @@ public class PlanFeedbackApprovalServiceImpl extends ServiceImpl<PlanFeedbackApp
faw.setRecordId(rid);
PlanFeedback feedback = ridFeedBackMap.get(rid);
if (feedback == null || feedback.getApprovalStatus() != 1) {
feedback = planFeedbackService.getNewest(String.valueOf(rid));
feedback = planFeedbackService.getNewest(String.valueOf(rid), feedback.getFeedbackType());
feedback.setRecordId(rid);
}
feedback.setProjectSn(approval.getProjectSn());
@ -340,7 +341,7 @@ public class PlanFeedbackApprovalServiceImpl extends ServiceImpl<PlanFeedbackApp
for (PlanFeedbackApprovalWork approvalWork : approvalWorks) {
Long feedbackId = approvalWork.getFeedbackId();
if (feedbackId == null) {
PlanFeedback newest = planFeedbackService.getNewest(recordId);
PlanFeedback newest = planFeedbackService.getNewest(recordId, approvalWork.getFeedbackType());
feedbackId = newest != null ? newest.getId() : -100L;
}
planFeedbackService.removeById(feedbackId);

View File

@ -148,9 +148,9 @@ public class PlanFeedbackServiceImpl extends ServiceImpl<PlanFeedbackMapper, Pla
}
@Override
public PlanFeedback getNewest(String recordId) {
public PlanFeedback getNewest(String recordId, Integer feedbackType) {
PlanRecord record = planRecordService.queryById(recordId);
PlanFeedback feedback = this.getNewestFeedback(Long.valueOf(recordId), null, null);
PlanFeedback feedback = this.getNewestFeedback(Long.valueOf(recordId), null, feedbackType);
if (feedback == null) {
PlanPbs pbs = planPbsService.queryById(record.getPbsId() + "");
feedback = new PlanFeedback();
@ -239,6 +239,8 @@ public class PlanFeedbackServiceImpl extends ServiceImpl<PlanFeedbackMapper, Pla
} else {
feedbackPeriods = this.getExistFeedbackPeriods(Long.valueOf(feedbackId), record);
}
//筛选时间
if (CollUtil.isNotEmpty(feedbackPeriods)) {
if (StrUtil.isNotBlank(beginDate)) {
feedbackPeriods = feedbackPeriods.stream().filter(o -> DateUtil.compare(DateUtil.parseDate(beginDate), o.getPeriodEnd()) <= 0).collect(Collectors.toList());
@ -273,7 +275,7 @@ public class PlanFeedbackServiceImpl extends ServiceImpl<PlanFeedbackMapper, Pla
mv.setWeight(milestone.getWeight());
milestoneVals.add(mv);
}
fb.setPlanMilestoneVals(milestoneVals);
fb.setMilestoneVals(milestoneVals);
feedbackPeriods.add(fb);
}
return feedbackPeriods;
@ -338,7 +340,7 @@ public class PlanFeedbackServiceImpl extends ServiceImpl<PlanFeedbackMapper, Pla
public void saveInfo(PlanFeedback feedback) {
//最新一条是新增状态的就更新
Long recordId = feedback.getRecordId();
PlanFeedback feedback1 = this.getNewestFeedback(recordId, null, null);
PlanFeedback feedback1 = this.getNewestFeedback(recordId, null, feedback.getFeedbackType());
PlanRecord record = planRecordService.getById(recordId);
if (record.getWorkType() != 1) {
throw new OpenAlertException("只有作业可以新增反馈内容");

View File

@ -325,6 +325,8 @@ public class PlanRecordServiceImpl extends ServiceImpl<PlanRecordMapper, PlanRec
} else {
throw new OpenAlertException("不存在的类型");
}
//筛选时间
if (CollUtil.isNotEmpty(feedbackPeriods)) {
if (StrUtil.isNotBlank(beginDate)) {
feedbackPeriods = feedbackPeriods.stream().filter(o -> DateUtil.compare(DateUtil.parseDate(beginDate), o.getPeriodEnd()) <= 0).collect(Collectors.toList());
@ -333,28 +335,24 @@ public class PlanRecordServiceImpl extends ServiceImpl<PlanRecordMapper, PlanRec
feedbackPeriods = feedbackPeriods.stream().filter(o -> DateUtil.compare(DateUtil.parseDate(endDate), o.getPeriodStart()) >= 0).collect(Collectors.toList());
}
}
//去掉里程碑
if (record.getWorkType() == 2) {
boolean have = planMilestoneService.checkHaveMilestone(recordId);
if (!have) {
//去掉里程碑
for (PlanFeedbackPeriod period : feedbackPeriods) {
period.setPlanMilestoneVals(new ArrayList<>());
period.setActualMilestoneVals(new ArrayList<>());
}
}
}
//多的周期要删除少的周期要添加
List<PlanFeedbackPeriod> feedbackPeriods1 = new ArrayList<>();
List<PlanFeedbackPeriod> myPeriods = this.getCalFeedbackPeriods(record, planPeriod);
for (PlanFeedbackPeriod myPeriod : myPeriods) {
Optional<PlanFeedbackPeriod> first = feedbackPeriods.stream().filter(o -> DateUtil.compare(o.getPeriodStart(), myPeriod.getPeriodStart()) == 0).findFirst();
PlanFeedbackPeriod planFeedbackPeriod;
if (first.isPresent()) {
planFeedbackPeriod = first.get();
} else {
planFeedbackPeriod = myPeriod;
}
feedbackPeriods1.add(planFeedbackPeriod);
feedbackPeriods1.add(first.orElse(myPeriod));
}
feedbackPeriods1 = feedbackPeriods1.stream().sorted((o1, o2) -> o1.getPeriodStart().compareTo(o2.getPeriodStart())).collect(Collectors.toList());
@ -453,6 +451,7 @@ public class PlanRecordServiceImpl extends ServiceImpl<PlanRecordMapper, PlanRec
milestoneVals.add(mv);
}
fb.setPlanMilestoneVals(milestoneVals);
fb.setActualMilestoneVals(milestoneVals);
fb.setActualPer(new BigDecimal("0"));
fb.setPlanPer(new BigDecimal("0"));
fb.setActualYdz(new BigDecimal("0"));
@ -766,12 +765,11 @@ public class PlanRecordServiceImpl extends ServiceImpl<PlanRecordMapper, PlanRec
* @return
*/
private List<PlanFeedbackPeriod> getFeedbackPeriods(PlanRecord record, PlanPeriod planPeriod, List<PlanMilestone> allPlanMilestones, PlanFeedback planNewestFeedback, int feedbackType, List<PlanFeedbackPeriod> fbPeriods, List<PlanMilestoneVal> allVals) {
String recordId = record.getId() + "";
List<PlanFeedbackPeriod> feedbackPeriods = new ArrayList<>();
if (planNewestFeedback == null) {
//计算划分周期
List<Map<String, Date>> divPeriods = planPeriodService.getDivPeriods(record.getPlannedStart(), record.getPlannedFinish(), planPeriod);
List<PlanMilestone> milestones = allPlanMilestones.stream().filter(o -> Objects.equals(recordId, o.getRecordId() + "")).collect(Collectors.toList());
List<PlanMilestone> milestones = planMilestoneService.getParentMilestones(record, allPlanMilestones);
for (Map<String, Date> divPeriod : divPeriods) {
PlanFeedbackPeriod fb = new PlanFeedbackPeriod();
fb.setPeriodStart(divPeriod.get("s"));

View File

@ -99,6 +99,10 @@ public class ProjectHomeNoticeServiceImpl extends ServiceImpl<ProjectHomeNoticeM
e.setTitle(FlowUtil.getString(param, "title"));
e.setContent(FlowUtil.getString(param, "content"));
e.setFileUrl(FlowUtil.getString(param, "fileUrl"));
e.setIssueDepartment(FlowUtil.getString(param, "issueDepartment"));
e.setShowHome(FlowUtil.getPullDownInteger(param, "showHome"));
e.setUploader(FlowUtil.getLong(param, "startUser"));
e.setUpdateTime(FlowUtil.getDate(param, "updateTime"));
this.add(e);
}

View File

@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gexin.fastjson.TypeReference;
@ -156,8 +157,8 @@ public class SystemUserController {
return Result.success(systemUserService.queryById(map));
}
@OperLog(operModul = "账号管理", operType = "修改用户密码", operDesc = "修改用户密码")
@ApiOperation(value = "修改用户密码", notes = "修改用户密码", httpMethod = "POST")
@OperLog(operModul = "账号管理", operType = "", operDesc = "用户自己修改密码")
@ApiOperation(value = "用户自己修改密码", notes = "用户自己修改密码", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "passWord", required = true, value = "新密码", paramType = "body"),
})
@ -482,4 +483,26 @@ public class SystemUserController {
return Result.ok();
}
@OperLog(operModul = "账号管理", operType = "", operDesc = "通过用户id重置密码")
@ApiOperation(value = "通过用户id重置密码", notes = "通过用户id重置密码", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "passWord", value = "新密码", required = true, paramType = "body"),
@ApiImplicitParam(name = "userId", value = "用户id", required = true, paramType = "body"),
})
@PostMapping(value = "/resetPw")
public Result resetPw(@RequestBody Map<String, Object> map) {
String userId = MapUtils.getString(map, "userId");
String passWord = MapUtils.getString(map, "passWord");
SystemUser su = systemUserService.getById(userId);
if (su == null) {
throw new OpenAlertException("用户不存在");
}
systemUserService.update(null, new LambdaUpdateWrapper<SystemUser>()
.set(SystemUser::getIsFirstLogin, 1)
.set(SystemUser::getShowPassword, passWord)
.set(SystemUser::getPassword, passwordEncoder.encode(passWord))
.set(SystemUser::getPwUpdateTime, new Date())
.eq(SystemUser::getUserId, userId));
return Result.ok();
}
}

View File

@ -31,7 +31,7 @@ public class Notice implements Serializable {
// @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应急处置34车辆不安全行为识别监测")
@ApiModelProperty(value="1质量;2安全;3AI;4安全履职预警;5企业资质;6人员资质;10通知公告;11巡检点;")
@ApiModelProperty(value = "1质量;2安全;3AI;4安全履职预警;5企业资质;6人员资质;10其他;11巡检点;12待办;")
private java.lang.String type;
/**
* 消息内容

View File

@ -324,7 +324,7 @@ public class FlowOrgRepositoryServiceImpl implements OrgRepositoryService {
@Override
public void notifyCustom(NotifyDto notify, WflowModelHistorys model, com.alibaba.fastjson2.JSONObject notifySetUp) {
noticeService.addUserNoticeAndApp(Long.valueOf(notify.getTarget()), notify.getTitle(), notify.getContent(), "10");
noticeService.addUserNoticeAndApp(Long.valueOf(notify.getTarget()), notify.getTitle(), notify.getContent(), "12");
}
@Override

View File

@ -19,9 +19,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.*;
@Slf4j
public class EasyPoiUtil {
@ -290,11 +288,18 @@ public class EasyPoiUtil {
String outDir = pdfFile.getAbsolutePath().substring(0, pdfFile.getAbsolutePath().lastIndexOf(File.separator));
// 构建LibreOffice的命令行工具命令
String command = "libreoffice --invisible --convert-to pdf --outdir " + outDir + " " + sourcePath;
log.info(command);
List<String> cmd = new ArrayList<>();
cmd.add("libreoffice");
cmd.add("--invisible");
cmd.add("--convert-to");
cmd.add("pdf");
cmd.add("--outdir");
cmd.add(outDir);
cmd.add(sourcePath);
log.info(cmd.toString());
// 执行转换命令
try {
executeLinuxCmd(command);
executeLinuxCmd(cmd);
} catch (Exception e) {
log.error("linuxWordToPdf linux环境word转换为pdf时出现异常", e);
}
@ -306,9 +311,9 @@ public class EasyPoiUtil {
* @param cmd 命令行
* @return
*/
private static boolean executeLinuxCmd(String cmd) {
private static boolean executeLinuxCmd(List<String> cmd) {
try {
Process process = Runtime.getRuntime().exec(cmd);
Process process = Runtime.getRuntime().exec(cmd.toArray(new String[cmd.size()]));
process.waitFor();
} catch (InterruptedException e) {
log.error("executeLinuxCmd 执行Linux命令异常", e);