diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/controller/QualityCommonProblemRecordController.java b/src/main/java/com/zhgd/xmgl/modules/baotou/controller/QualityCommonProblemRecordController.java index 2109e560f..85007dc76 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/controller/QualityCommonProblemRecordController.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/controller/QualityCommonProblemRecordController.java @@ -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> 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 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; +// } } diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/entity/ProjectHomeNotice.java b/src/main/java/com/zhgd/xmgl/modules/baotou/entity/ProjectHomeNotice.java index 1de9fd812..a57114b3c 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/entity/ProjectHomeNotice.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/entity/ProjectHomeNotice.java @@ -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; @@ -21,30 +22,62 @@ import io.swagger.annotations.ApiModelProperty; @TableName("project_home_notice") @ApiModel(value="ProjectHomeNotice实体类",description="ProjectHomeNotice") public class ProjectHomeNotice implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "id") + private java.lang.Long id; + /** + * 所属项目SN + */ + @ApiModelProperty(value = "所属项目SN") + private java.lang.String projectSn; + /** + * 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; - /**id*/ - @TableId(type = IdType.ASSIGN_ID) - @ApiModelProperty(value="id") - private java.lang.Long id ; - /**所属项目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质量监督通知公告") - 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 ; - /**创建时间*/ - @ApiModelProperty(value="创建时间") - private java.util.Date createTime ; - /**更新时间*/ - @ApiModelProperty(value="更新时间") - private java.util.Date updateTime ; } diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/DeviceUnitMapper.xml b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/DeviceUnitMapper.xml index e9d52255a..696f6427b 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/DeviceUnitMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/DeviceUnitMapper.xml @@ -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) diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/ProjectHomeNoticeMapper.xml b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/ProjectHomeNoticeMapper.xml index 4cf806a4c..0c8caaf41 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/ProjectHomeNoticeMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/mapper/xml/ProjectHomeNoticeMapper.xml @@ -5,14 +5,24 @@ @@ -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} diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/controller/PlanFeedbackApprovalController.java b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/controller/PlanFeedbackApprovalController.java index 8314553fd..04d27343c 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/controller/PlanFeedbackApprovalController.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/controller/PlanFeedbackApprovalController.java @@ -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"), diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/controller/PlanFeedbackController.java b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/controller/PlanFeedbackController.java index ea6b3669e..52683e607 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/controller/PlanFeedbackController.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/controller/PlanFeedbackController.java @@ -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 getNewest(@RequestParam(name = "recordId", required = true) String recordId) { - return Result.success(planFeedbackService.getNewest(recordId)); + public Result getNewest(@RequestParam(name = "recordId", required = true) String recordId, Integer feedbackType) { + return Result.success(planFeedbackService.getNewest(recordId, feedbackType)); } @OperLog(operModul = "进度反馈记录管理", operType = "", operDesc = "分页查询计划反馈的周期里程碑列表") diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/controller/PlanRecordController.java b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/controller/PlanRecordController.java index 69f6ea34c..8dd6e287f 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/controller/PlanRecordController.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/controller/PlanRecordController.java @@ -415,7 +415,7 @@ public class PlanRecordController { // } // /** -// * 导入里程碑 +// *录入数据-里程碑 // * // * @return // */ diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/entity/PlanFeedbackApprovalWork.java b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/entity/PlanFeedbackApprovalWork.java index debb7d2fa..c554e81ef 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/entity/PlanFeedbackApprovalWork.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/entity/PlanFeedbackApprovalWork.java @@ -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*/ - @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*/ - @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 ; + private java.lang.Long feedbackId; + /** + * 创建时间 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 + */ + @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; } diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/entity/PlanRecord.java b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/entity/PlanRecord.java index 23bdec115..d7e49894c 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/entity/PlanRecord.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/entity/PlanRecord.java @@ -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; } diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/service/IPlanFeedbackService.java b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/service/IPlanFeedbackService.java index e6d0ab5b3..ab1ef2102 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/service/IPlanFeedbackService.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/service/IPlanFeedbackService.java @@ -64,7 +64,7 @@ public interface IPlanFeedbackService extends IService { */ PlanFeedback queryById(String id); - PlanFeedback getNewest(String recordId); + PlanFeedback getNewest(String recordId, Integer feedbackType); List getPeriodMilestones(Map param); diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/service/IPlanMilestoneService.java b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/service/IPlanMilestoneService.java index 2388cb261..4c5d73e97 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/service/IPlanMilestoneService.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/service/IPlanMilestoneService.java @@ -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; @@ -11,42 +11,53 @@ import java.util.List; /** * @Description: 进度里程碑 * @author: pds - * @date: 2024-11-28 + * @date: 2024-11-28 * @version: V1.0 */ public interface IPlanMilestoneService extends IService { /** * 分页列表查询进度里程碑信息 + * * @param param 参数map * @return */ IPage queryPageList(HashMap param); + /** * 列表查询进度里程碑信息 + * * @param param 参数map * @return */ List queryList(HashMap 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 { List getParentMilestones(String recordId); + /** + * 获取计划编制的里程碑 + * + * @param record + * @param allPlanMilestones + * @return + */ List getParentMilestones(PlanRecord record, List allPlanMilestones); /** diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/service/impl/PlanFeedbackApprovalServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/service/impl/PlanFeedbackApprovalServiceImpl.java index a2f289d22..2613158b1 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/plan/service/impl/PlanFeedbackApprovalServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/plan/service/impl/PlanFeedbackApprovalServiceImpl.java @@ -155,6 +155,7 @@ public class PlanFeedbackApprovalServiceImpl extends ServiceImpl DateUtil.compare(DateUtil.parseDate(beginDate), o.getPeriodEnd()) <= 0).collect(Collectors.toList()); @@ -273,7 +275,7 @@ public class PlanFeedbackServiceImpl extends ServiceImpl DateUtil.compare(DateUtil.parseDate(beginDate), o.getPeriodEnd()) <= 0).collect(Collectors.toList()); @@ -333,28 +335,24 @@ public class PlanRecordServiceImpl extends ServiceImpl 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 feedbackPeriods1 = new ArrayList<>(); List myPeriods = this.getCalFeedbackPeriods(record, planPeriod); for (PlanFeedbackPeriod myPeriod : myPeriods) { Optional 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 getFeedbackPeriods(PlanRecord record, PlanPeriod planPeriod, List allPlanMilestones, PlanFeedback planNewestFeedback, int feedbackType, List fbPeriods, List allVals) { - String recordId = record.getId() + ""; List feedbackPeriods = new ArrayList<>(); if (planNewestFeedback == null) { //计算划分周期 List> divPeriods = planPeriodService.getDivPeriods(record.getPlannedStart(), record.getPlannedFinish(), planPeriod); - List milestones = allPlanMilestones.stream().filter(o -> Objects.equals(recordId, o.getRecordId() + "")).collect(Collectors.toList()); + List milestones = planMilestoneService.getParentMilestones(record, allPlanMilestones); for (Map divPeriod : divPeriods) { PlanFeedbackPeriod fb = new PlanFeedbackPeriod(); fb.setPeriodStart(divPeriod.get("s")); diff --git a/src/main/java/com/zhgd/xmgl/modules/baotou/service/impl/ProjectHomeNoticeServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/baotou/service/impl/ProjectHomeNoticeServiceImpl.java index 7856a5706..165ca8088 100644 --- a/src/main/java/com/zhgd/xmgl/modules/baotou/service/impl/ProjectHomeNoticeServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/baotou/service/impl/ProjectHomeNoticeServiceImpl.java @@ -94,11 +94,15 @@ public class ProjectHomeNoticeServiceImpl extends ServiceImpl param) { ProjectHomeNotice e = new ProjectHomeNotice(); - e.setProjectSn(FlowUtil.getString(param,"projectSn")); - e.setWhichModule(FlowUtil.getInteger(param,"whichModule")); - e.setTitle(FlowUtil.getString(param,"title")); - e.setContent(FlowUtil.getString(param,"content")); + e.setProjectSn(FlowUtil.getString(param, "projectSn")); + e.setWhichModule(FlowUtil.getInteger(param, "whichModule")); + 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); } diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/SystemUserController.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/SystemUserController.java index cbcf3c0fd..a2ed6d137 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/SystemUserController.java +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/controller/SystemUserController.java @@ -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 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() + .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(); + } } diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/Notice.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/Notice.java index 1f8186fa4..971bde5fc 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/Notice.java +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/entity/Notice.java @@ -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; /** * 消息内容 diff --git a/src/main/java/com/zhgd/xmgl/modules/basicdata/service/impl/FlowOrgRepositoryServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/basicdata/service/impl/FlowOrgRepositoryServiceImpl.java index f87e7c2fc..b7b551528 100644 --- a/src/main/java/com/zhgd/xmgl/modules/basicdata/service/impl/FlowOrgRepositoryServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/basicdata/service/impl/FlowOrgRepositoryServiceImpl.java @@ -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 diff --git a/src/main/java/com/zhgd/xmgl/util/EasyPoiUtil.java b/src/main/java/com/zhgd/xmgl/util/EasyPoiUtil.java index 5dd155061..194825289 100644 --- a/src/main/java/com/zhgd/xmgl/util/EasyPoiUtil.java +++ b/src/main/java/com/zhgd/xmgl/util/EasyPoiUtil.java @@ -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 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 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);