Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0

This commit is contained in:
wulin 2020-12-04 16:49:38 +08:00
commit 25af5de8b1
17 changed files with 1419 additions and 29 deletions

View File

@ -1,5 +1,6 @@
package com.lz.modules.app.controller;
import com.google.common.collect.Maps;
import com.lz.common.emun.ChartFlowType;
import com.lz.common.emun.WorkMsgTypeEnum;
import com.lz.common.utils.*;
@ -10,6 +11,7 @@ import com.lz.modules.app.dto.StaffDepartmentDto;
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.app.entity.StaffSimpleInfo;
import com.lz.modules.app.req.RecordDetailExplanReq;
import com.lz.modules.app.req.ResultRecordReq;
import com.lz.modules.app.resp.ResultDetailResp;
import com.lz.modules.app.resp.Step;
@ -1222,4 +1224,31 @@ public class ResultRecordController extends AbstractController {
return resultRecordService.getResetData(recordDetailDto);
}
@ApiOperation("导出绩效详情报表")
@GetMapping("/recordDetailExport")
public R recordDetailExport(Long recordId){
Map map = Maps.newHashMap();
map.put("id",recordId);
R respnse = getDetail(map);
if(respnse.isSuccess()){
ResultRecordDetailDto resultRecordDetailDto = (ResultRecordDetailDto) respnse.get("data");
}
return R.ok();
}
@ApiOperation("导出绩效详情报表计划")
@PostMapping("/recordDetailExplan")
public R recordDetailExport(@RequestBody List<RecordDetailExplanReq> reqs){
return R.ok();
}
}

View File

@ -0,0 +1,20 @@
package com.lz.modules.app.req;
import lombok.Data;
/**
* @Author: djc
* @Desc:
* @Date: 2020/12/4 11:27
*/
@Data
public class RecordDetailExplanReq {
//绩效id
private Long recordId;
//是否导出图片
private int image;
//是否打印
private int print;
}

View File

@ -6,34 +6,32 @@ import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.ExcelWriter;
import cn.hutool.poi.excel.StyleSet;
import com.google.common.collect.Lists;
import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R;
import com.lz.common.utils.StringUtil;
import com.lz.modules.flow.model.ResultDetailDto;
import com.lz.modules.flow.model.ResultRecordDetailDto;
import com.lz.modules.flow.model.ResultRecortModelDto;
import com.lz.modules.performance.dto.RecordDetailExportDto;
import com.lz.modules.performance.req.ChartResultReq;
import com.lz.modules.performance.res.LevelDetailExportRes;
import com.lz.modules.performance.service.ChartResultService;
import com.lz.modules.sys.entity.app.ResultRecord;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.models.auth.In;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddressList;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.math.BigDecimal;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Author: djc
@ -59,7 +57,7 @@ public class ExportController {
//获取数据
List data = chartResultService.selectLevelDetailList(req);
//导出
buildExcelExport(data,response);
buildLevelExcelExport(data,response);
} catch (Exception e) {
log.error("导出等级详情异常e: ",e);
@ -70,9 +68,31 @@ public class ExportController {
@GetMapping("/export/recordDetail")
@ApiOperation("导出绩效详情")
public void recordDetail(ResultRecordDetailDto dto, HttpServletResponse response){
try {
String test = "";
if(CollectionUtils.isEmpty(dto.getRecortModelDtos())){
log.info("没有模板信息,无法生成,id: " + dto.getId());
}
ResultRecordDetailDto testDto = com.alibaba.fastjson.JSONObject.parseObject(test,ResultRecordDetailDto.class);
buildRecordExcelExport(testDto, response);
} catch (Exception e) {
log.error("导出绩效详情异常e: ",e);
}
}
//对应实体属性名与表列名
private void buildData(Class<?> data,List<String> tags,ExcelWriter writer){
private void buildHeaderData(Class<?> data,List<String> tags,ExcelWriter writer){
if(data == null || CollectionUtils.isEmpty(tags)){
log.info("导出excel-实体属性或数据为空!");
return;
@ -89,13 +109,13 @@ public class ExportController {
}
}
private void buildExcelExport(List data, HttpServletResponse response){
private void buildLevelExcelExport(List data, HttpServletResponse response){
//设置表头表尾及数据
List<String> rowHead = CollUtil.newArrayList("序号", "工号", "员工姓名", "当月状态", "一级部门", "二级部门", "三级部门", "职位", "员工月度绩效考核评分","员工月度绩效考核结果等级");
ExcelWriter writer = ExcelUtil.getWriter();
writer.setColumnWidth(-1,15);
writer.passRows(4);
buildData(LevelDetailExportRes.class,rowHead,writer);
buildHeaderData(LevelDetailExportRes.class,rowHead,writer);
writer.merge(0,2,0,9,"绩效考核总表",false);
writer.merge(3,3,0,1,"考核月份",false);
writer.write(data, true);
@ -135,4 +155,230 @@ public class ExportController {
IoUtil.close(out);
}
private void buildRecordExcelExport(ResultRecordDetailDto dto, HttpServletResponse response){
//设置表头表尾及数据
List<String> row = CollUtil.newArrayList("考核月份", "09", "工号", "YN", "员工姓名", "老白", "一级部门", "业务中台", "二级部门","技术中心", "三级部门","攻关小组", "职位","java", "直属上级","佟湘玉");
List<String> rowHead = CollUtil.newArrayList("考核维度", "目标/指标", "关键结果", "考核权重", "考核结果(员工填写)", "直属上级评分100%", "得分","评分说明(直属上级填写)");
ExcelWriter writer = ExcelUtil.getWriter();
writer.setColumnWidth(-1,15);
writer.passRows(3);
buildHeaderData(RecordDetailExportDto.class,rowHead,writer);
writer.merge(0,2,0,9,"员工月度绩效计划与评估表",false);
writer.writeHeadRow(row);
List<ResultRecortModelDto> recortModelDtos = dto.getRecortModelDtos();
List data = Lists.newArrayList();
int mergeStart = 5;
for(ResultRecortModelDto modelDto:recortModelDtos){
//维度名称
String name = modelDto.getName();
//详细条目
List<ResultDetailDto> detailDtos = modelDto.getDetailDtos();
List<RecordDetailExportDto> collect = detailDtos.stream().map(resultDetailDto -> {
RecordDetailExportDto detailExportDto = new RecordDetailExportDto();
BeanUtils.copyProperties(resultDetailDto, detailExportDto);
detailExportDto.setName(name);
return detailExportDto;
}).collect(Collectors.toList());
data.addAll(collect);
int i = mergeStart + collect.size();
writer.merge(mergeStart,i -1,0,0,null,false);
//添加汇总
RecordDetailExportDto add = new RecordDetailExportDto();
add.setAcquireScore(BigDecimal.valueOf(0.01));
add.setKeyResult(name + "考核结果");
add.setCheckWeight(modelDto.getWeight());
writer.merge(i,mergeStart + collect.size(),0,1,null,false);
//1为跳过插入的记录
mergeStart = i + 1;
data.add(add);
}
//设置尾部
RecordDetailExportDto add;
add = new RecordDetailExportDto();
add.setName("最终绩效考核评分");
data.add(add);
add = new RecordDetailExportDto();
add.setName("最终绩效考核结果等级");
data.add(add);
writer.write(data,true);
//writer.merge(7 + data.size(),8 + data.size(),0,0,"签字",false);
//writer.setRowHeight(5,50);
//设置生效的是没有数据的有数据的反而不生效
//writer.setRowHeight(-1,50);
//响应
String name = "test测试";
response.setContentType("application/vnd.ms-excel;charset=utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + name + ".xls");
ServletOutputStream out = null;
try {
out = response.getOutputStream();
writer.flush(out, true);
}
catch (IOException e) {
log.error("生成excel文档异常e: ",e);
}
finally {
writer.close();
}
IoUtil.close(out);
}
/*{\n" +
" \"id\": 807,\n" +
" \"status\": 0,\n" +
" \"lastScore\": null,\n" +
" \"allScore\": null,\n" +
" \"remark\": null,\n" +
" \"staffId\": 303,\n" +
" \"startId\": 83,\n" +
" \"gradeGroupId\": 1,\n" +
" \"flowStaffIdRole\": null,\n" +
" \"departmentId\": \"154231708\",\n" +
" \"departmentName\": \"技术中心\",\n" +
" \"staffName\": \"傅美爱\",\n" +
" \"avatar\": \"https://static-legacy.dingtalk.com/media/lADPBbCc1Tp1ysPNAu7NAu4_750_750.jpg\",\n" +
" \"jobNumber\": \"9\",\n" +
" \"currentApprovalStaffId\": 322,\n" +
" \"currentApprovalStaffName\": \"徐虹杰\",\n" +
" \"scoreLevel\": null,\n" +
" \"flowProcess\": 1,\n" +
" \"recortModelDtos\": [\n" +
" {\n" +
" \"id\": 1276,\n" +
" \"name\": \"业绩绩效\",\n" +
" \"type\": 1,\n" +
" \"weight\": 0.7,\n" +
" \"maxCount\": 10,\n" +
" \"orderBy\": 0,\n" +
" \"detailDtos\": [\n" +
" {\n" +
" \"id\": 932,\n" +
" \"isDelete\": 0,\n" +
" \"type\": 1,\n" +
" \"target\": \"85496\",\n" +
" \"keyResult\": \"56632\",\n" +
" \"calculate\": \"0.7*{acquireScore}\",\n" +
" \"checkWeight\": 0.7,\n" +
" \"checkResult\": null,\n" +
" \"superScore\": \"4分-卓越\",\n" +
" \"acquireScore\": 0,\n" +
" \"scoreComment\": null,\n" +
" \"priority\": 0,\n" +
" \"scoreDtos\": [\n" +
" {\n" +
" \"id\": 296,\n" +
" \"acquireScore\": 0,\n" +
" \"detailId\": 932,\n" +
" \"approvalId\": 322,\n" +
" \"approvalName\": \"徐虹杰\",\n" +
" \"weight\": 1,\n" +
" \"calculate\": \"0.7*1.0*{acquireScore}\",\n" +
" \"scoreComment\": null\n" +
" }\n" +
" ],\n" +
" \"modelId\": 1276\n" +
" },\n" +
" {\n" +
" \"id\": 932,\n" +
" \"isDelete\": 0,\n" +
" \"type\": 1,\n" +
" \"target\": \"85496\",\n" +
" \"keyResult\": \"56632\",\n" +
" \"calculate\": \"0.7*{acquireScore}\",\n" +
" \"checkWeight\": 0.7,\n" +
" \"checkResult\": null,\n" +
" \"superScore\": \"4分-卓越\",\n" +
" \"acquireScore\": 0,\n" +
" \"scoreComment\": null,\n" +
" \"priority\": 0,\n" +
" \"scoreDtos\": [\n" +
" {\n" +
" \"id\": 296,\n" +
" \"acquireScore\": 0,\n" +
" \"detailId\": 932,\n" +
" \"approvalId\": 322,\n" +
" \"approvalName\": \"徐虹杰\",\n" +
" \"weight\": 1,\n" +
" \"calculate\": \"0.7*1.0*{acquireScore}\",\n" +
" \"scoreComment\": null\n" +
" }\n" +
" ],\n" +
" \"modelId\": 1276\n" +
" }\n" +
" ]\n" +
" },\n" +
" {\n" +
" \"id\": 1277,\n" +
" \"name\": \"文化价值观\",\n" +
" \"type\": 1,\n" +
" \"weight\": 0.3,\n" +
" \"maxCount\": 1,\n" +
" \"orderBy\": 1,\n" +
" \"detailDtos\": [\n" +
" {\n" +
" \"id\": 931,\n" +
" \"isDelete\": 0,\n" +
" \"type\": 1,\n" +
" \"target\": \"文化价值观\",\n" +
" \"keyResult\": \"发挥个人体会\",\n" +
" \"calculate\": \"0.3*{acquireScore}\",\n" +
" \"checkWeight\": 0.3,\n" +
" \"checkResult\": null,\n" +
" \"superScore\": null,\n" +
" \"acquireScore\": 0,\n" +
" \"scoreComment\": null,\n" +
" \"priority\": 0,\n" +
" \"scoreDtos\": [\n" +
" {\n" +
" \"id\": 295,\n" +
" \"acquireScore\": 0,\n" +
" \"detailId\": 931,\n" +
" \"approvalId\": 322,\n" +
" \"approvalName\": \"徐虹杰\",\n" +
" \"weight\": 1,\n" +
" \"calculate\": \"0.3*1.0*{acquireScore}\",\n" +
" \"scoreComment\": null\n" +
" }\n" +
" ],\n" +
" \"modelId\": 1277\n" +
" },\n" +
" {\n" +
" \"id\": 931,\n" +
" \"isDelete\": 0,\n" +
" \"type\": 1,\n" +
" \"target\": \"文化价值观\",\n" +
" \"keyResult\": \"发挥个人体会\",\n" +
" \"calculate\": \"0.3*{acquireScore}\",\n" +
" \"checkWeight\": 0.3,\n" +
" \"checkResult\": null,\n" +
" \"superScore\": null,\n" +
" \"acquireScore\": 0,\n" +
" \"scoreComment\": null,\n" +
" \"priority\": 0,\n" +
" \"scoreDtos\": [\n" +
" {\n" +
" \"id\": 295,\n" +
" \"acquireScore\": 0,\n" +
" \"detailId\": 931,\n" +
" \"approvalId\": 322,\n" +
" \"approvalName\": \"徐虹杰\",\n" +
" \"weight\": 1,\n" +
" \"calculate\": \"0.3*1.0*{acquireScore}\",\n" +
" \"scoreComment\": null\n" +
" }\n" +
" ],\n" +
" \"modelId\": 1277\n" +
" }\n" +
" ]\n" +
" }\n" +
" ],\n" +
" \"weight\": 1\n" +
" }*/
}

View File

@ -0,0 +1,34 @@
package com.lz.modules.performance.dto;
import com.lz.modules.flow.model.ResultScoreDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* @Author: djc
* @Desc:
* @Date: 2020/12/3 15:06
*/
@Data
public class RecordDetailExportDto {
//1业绩2文化价值观
private String name;
//目标
private String target;
//关键结果
private String keyResult;
//考核权重
private BigDecimal checkWeight;
//考核结果
private String checkResult;
//直属上级评分
private String superScore;
//得分
private BigDecimal acquireScore;
//评分说明
private String scoreComment;
}

View File

@ -17,12 +17,4 @@ public class StaffTypeDto {
private Long staffId;
//职位
private String position;
//人员状态
private Long staffStatus;
//入职日期
private Date entryTime;
//转正日期
private Date officialTime;
//离职时间
private Date resignationTime;
}

View File

@ -0,0 +1,33 @@
package com.lz.modules.sys.dao;
/**
* <p>
* 流转表 服务类
* </p>
*
* @author quyixiao
* @since 2020-12-04
*/
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lz.modules.sys.entity.Print;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface PrintMapper extends BaseMapper<Print> {
Print selectPrintById(@Param("id") Long id);
Long insertPrint(Print print);
int updatePrintById(Print print);
int updateCoverPrintById(Print print);
int deletePrintById(@Param("id") Long id);
}

View File

@ -0,0 +1,26 @@
package com.lz.modules.sys.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lz.modules.sys.entity.Resource;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface ResourceMapper extends BaseMapper<Resource> {
Resource selectResourceById(@Param("id") Long id);
Long insertResource(Resource resource);
int updateResourceById(Resource resource);
int updateCoverResourceById(Resource resource);
int deleteResourceById(@Param("id") Long id);
}

View File

@ -0,0 +1,234 @@
package com.lz.modules.sys.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* <p>
* </p>*流转表
* @author quyixiao
* @since 2020-12-04
*/
@Data
@TableName("lz_print")
@ApiModel(value = "流转表")
public class Print implements java.io.Serializable {
//
@TableId(value = "id", type = IdType.AUTO)
private Long id;
//是否删除状态1删除0有效
@ApiModelProperty(value = "是否删除状态1删除0有效", name = "isDelete")
private Integer isDelete;
//创建时间
@ApiModelProperty(value = "创建时间", name = "gmtCreate")
private Date gmtCreate;
//最后修改时间
@ApiModelProperty(value = "最后修改时间", name = "gmtModified")
private Date gmtModified;
//打印详情的url
@ApiModelProperty(value = "打印详情的url", name = "url")
private String url;
//备注
@ApiModelProperty(value = "备注", name = "remark")
private String remark;
//打印批次号
@ApiModelProperty(value = "打印批次号", name = "batchNo")
private String batchNo;
//0未打印1打印成功2打印失败
@ApiModelProperty(value = "0未打印1打印成功2打印失败", name = "status")
private Integer status;
//生成图片上传阿里云url
@ApiModelProperty(value = "生成图片上传阿里云url", name = "imageUrl")
private String imageUrl;
//0不生成图片1生成图片
@ApiModelProperty(value = "0不生成图片1生成图片", name = "isImage")
private Integer isImage;
//0不打印1 打印
@ApiModelProperty(value = "0不打印1 打印", name = "isPrint")
private Integer isPrint;
/**
*
* @return
*/
public Long getId() {
return id;
}
/**
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* 是否删除状态1删除0有效
* @return
*/
public Integer getIsDelete() {
return isDelete;
}
/**
* 是否删除状态1删除0有效
* @param isDelete
*/
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
/**
* 创建时间
* @return
*/
public Date getGmtCreate() {
return gmtCreate;
}
/**
* 创建时间
* @param gmtCreate
*/
public void setGmtCreate(Date gmtCreate) {
this.gmtCreate = gmtCreate;
}
/**
* 最后修改时间
* @return
*/
public Date getGmtModified() {
return gmtModified;
}
/**
* 最后修改时间
* @param gmtModified
*/
public void setGmtModified(Date gmtModified) {
this.gmtModified = gmtModified;
}
/**
* 打印详情的url
* @return
*/
public String getUrl() {
return url;
}
/**
* 打印详情的url
* @param url
*/
public void setUrl(String url) {
this.url = url;
}
/**
* 备注
* @return
*/
public String getRemark() {
return remark;
}
/**
* 备注
* @param remark
*/
public void setRemark(String remark) {
this.remark = remark;
}
/**
* 打印批次号
* @return
*/
public String getBatchNo() {
return batchNo;
}
/**
* 打印批次号
* @param batchNo
*/
public void setBatchNo(String batchNo) {
this.batchNo = batchNo;
}
/**
* 0未打印1打印成功2打印失败
* @return
*/
public Integer getStatus() {
return status;
}
/**
* 0未打印1打印成功2打印失败
* @param status
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* 生成图片上传阿里云url
* @return
*/
public String getImageUrl() {
return imageUrl;
}
/**
* 生成图片上传阿里云url
* @param imageUrl
*/
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
/**
* 0不生成图片1生成图片
* @return
*/
public Integer getIsImage() {
return isImage;
}
/**
* 0不生成图片1生成图片
* @param isImage
*/
public void setIsImage(Integer isImage) {
this.isImage = isImage;
}
/**
* 0不打印1 打印
* @return
*/
public Integer getIsPrint() {
return isPrint;
}
/**
* 0不打印1 打印
* @param isPrint
*/
public void setIsPrint(Integer isPrint) {
this.isPrint = isPrint;
}
@Override
public String toString() {
return "Print{" +
",id=" + id +
",isDelete=" + isDelete +
",gmtCreate=" + gmtCreate +
",gmtModified=" + gmtModified +
",url=" + url +
",remark=" + remark +
",batchNo=" + batchNo +
",status=" + status +
",imageUrl=" + imageUrl +
",isImage=" + isImage +
",isPrint=" + isPrint +
"}";
}
}

View File

@ -0,0 +1,361 @@
package com.lz.modules.sys.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@TableName("lz_resource")
@ApiModel(value = "资源配置及业务配置表针对一些会变更的配置如白名单配置、客服电话等或者是某些数据量很少的业务数据如首页bannel、 /* comment truncated */ /*首页广告位等数据*/")
public class Resource implements java.io.Serializable {
//主键自增id
@TableId(value = "id", type = IdType.AUTO)
private Long id;
//是否删除状态1删除0有效
@ApiModelProperty(value = "是否删除状态1删除0有效", name = "isDelete")
private Integer isDelete;
//创建时间
@ApiModelProperty(value = "创建时间", name = "gmtCreate")
private Date gmtCreate;
//最后修改时间
@ApiModelProperty(value = "最后修改时间", name = "gmtModified")
private Date gmtModified;
//创建人
@ApiModelProperty(value = "创建人", name = "creator")
private String creator;
//最后修改人
@ApiModelProperty(value = "最后修改人", name = "modifier")
private String modifier;
//配置类型S:系统配置,B:业务配置
@ApiModelProperty(value = "配置类型S:系统配置,B:业务配置", name = "dataType")
private String dataType;
//配置类型即配置的KEY用于定位配置所有字母大写多个字母中间用下划线_分割用户白名单类型USER_WHITE_LIST
@ApiModelProperty(value = "配置类型即配置的KEY用于定位配置所有字母大写多个字母中间用下划线“_”分割用户白名单类型USER_WHITE_LIST", name = "type")
private String type;
//类型可针对某一类型的配置做分类
@ApiModelProperty(value = "类型,可针对某一类型的配置做分类", name = "secType")
private String secType;
//配置类型描述如针对TYPE=USER_WHITE_LIST该值可描述为用户白名单列表
@ApiModelProperty(value = "配置类型描述如针对TYPE=USER_WHITE_LIST该值可描述为用户白名单列表", name = "typeDesc")
private String typeDesc;
//名称
@ApiModelProperty(value = "名称", name = "name")
private String name;
//
@ApiModelProperty(value = "", name = "value")
private String value;
//描述
@ApiModelProperty(value = "描述", name = "description")
private String description;
//扩展值1
@ApiModelProperty(value = "扩展值1", name = "value1")
private String value1;
//扩展值2
@ApiModelProperty(value = "扩展值2", name = "value2")
private String value2;
//扩展值3
@ApiModelProperty(value = "扩展值3", name = "value3")
private String value3;
//扩展值4
@ApiModelProperty(value = "扩展值4", name = "value4")
private String value4;
//排序
@ApiModelProperty(value = "排序", name = "sort")
private Long sort;
/**
* 主键自增id
* @return
*/
public Long getId() {
return id;
}
/**
* 主键自增id
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* 是否删除状态1删除0有效
* @return
*/
public Integer getIsDelete() {
return isDelete;
}
/**
* 是否删除状态1删除0有效
* @param isDelete
*/
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
/**
* 创建时间
* @return
*/
public Date getGmtCreate() {
return gmtCreate;
}
/**
* 创建时间
* @param gmtCreate
*/
public void setGmtCreate(Date gmtCreate) {
this.gmtCreate = gmtCreate;
}
/**
* 最后修改时间
* @return
*/
public Date getGmtModified() {
return gmtModified;
}
/**
* 最后修改时间
* @param gmtModified
*/
public void setGmtModified(Date gmtModified) {
this.gmtModified = gmtModified;
}
/**
* 创建人
* @return
*/
public String getCreator() {
return creator;
}
/**
* 创建人
* @param creator
*/
public void setCreator(String creator) {
this.creator = creator;
}
/**
* 最后修改人
* @return
*/
public String getModifier() {
return modifier;
}
/**
* 最后修改人
* @param modifier
*/
public void setModifier(String modifier) {
this.modifier = modifier;
}
/**
* 配置类型S:系统配置,B:业务配置
* @return
*/
public String getDataType() {
return dataType;
}
/**
* 配置类型S:系统配置,B:业务配置
* @param dataType
*/
public void setDataType(String dataType) {
this.dataType = dataType;
}
/**
* 配置类型即配置的KEY用于定位配置所有字母大写多个字母中间用下划线_分割用户白名单类型USER_WHITE_LIST
* @return
*/
public String getType() {
return type;
}
/**
* 配置类型即配置的KEY用于定位配置所有字母大写多个字母中间用下划线_分割用户白名单类型USER_WHITE_LIST
* @param type
*/
public void setType(String type) {
this.type = type;
}
/**
* 类型可针对某一类型的配置做分类
* @return
*/
public String getSecType() {
return secType;
}
/**
* 类型可针对某一类型的配置做分类
* @param secType
*/
public void setSecType(String secType) {
this.secType = secType;
}
/**
* 配置类型描述如针对TYPE=USER_WHITE_LIST该值可描述为用户白名单列表
* @return
*/
public String getTypeDesc() {
return typeDesc;
}
/**
* 配置类型描述如针对TYPE=USER_WHITE_LIST该值可描述为用户白名单列表
* @param typeDesc
*/
public void setTypeDesc(String typeDesc) {
this.typeDesc = typeDesc;
}
/**
* 名称
* @return
*/
public String getName() {
return name;
}
/**
* 名称
* @param name
*/
public void setName(String name) {
this.name = name;
}
/**
*
* @return
*/
public String getValue() {
return value;
}
/**
*
* @param value
*/
public void setValue(String value) {
this.value = value;
}
/**
* 描述
* @return
*/
public String getDescription() {
return description;
}
/**
* 描述
* @param description
*/
public void setDescription(String description) {
this.description = description;
}
/**
* 扩展值1
* @return
*/
public String getValue1() {
return value1;
}
/**
* 扩展值1
* @param value1
*/
public void setValue1(String value1) {
this.value1 = value1;
}
/**
* 扩展值2
* @return
*/
public String getValue2() {
return value2;
}
/**
* 扩展值2
* @param value2
*/
public void setValue2(String value2) {
this.value2 = value2;
}
/**
* 扩展值3
* @return
*/
public String getValue3() {
return value3;
}
/**
* 扩展值3
* @param value3
*/
public void setValue3(String value3) {
this.value3 = value3;
}
/**
* 扩展值4
* @return
*/
public String getValue4() {
return value4;
}
/**
* 扩展值4
* @param value4
*/
public void setValue4(String value4) {
this.value4 = value4;
}
/**
* 排序
* @return
*/
public Long getSort() {
return sort;
}
/**
* 排序
* @param sort
*/
public void setSort(Long sort) {
this.sort = sort;
}
@Override
public String toString() {
return "Resource{" +
",id=" + id +
",isDelete=" + isDelete +
",gmtCreate=" + gmtCreate +
",gmtModified=" + gmtModified +
",creator=" + creator +
",modifier=" + modifier +
",dataType=" + dataType +
",type=" + type +
",secType=" + secType +
",typeDesc=" + typeDesc +
",name=" + name +
",value=" + value +
",description=" + description +
",value1=" + value1 +
",value2=" + value2 +
",value3=" + value3 +
",value4=" + value4 +
",sort=" + sort +
"}";
}
}

View File

@ -0,0 +1,33 @@
package com.lz.modules.sys.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lz.modules.sys.entity.Print;
/**
* <p>
* 流转表 服务类
* </p>
*
* @author quyixiao
* @since 2020-12-04
*/
public interface PrintService extends IService<Print> {
Print selectPrintById(Long id);
Long insertPrint(Print print);
int updatePrintById(Print print);
int updateCoverPrintById(Print print);
int deletePrintById(Long id);
}

View File

@ -0,0 +1,25 @@
package com.lz.modules.sys.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lz.modules.sys.entity.Resource;
public interface ResourceService extends IService<Resource> {
Resource selectResourceById(Long id);
Long insertResource(Resource resource);
int updateResourceById(Resource resource);
int updateCoverResourceById(Resource resource);
int deleteResourceById(Long id);
}

View File

@ -884,13 +884,18 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
}
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(approvalDto.getResultRecordId(), 2);
Long commentId = 0l;
if (CollectionUtils.isNotEmpty(flowRecords)) {
FlowRecord preFlowRecord = flowRecords.get(0);
// 评论内容
FlowChart flowChart = flowService.selectFlowChartByChartId(preFlowRecord.getFlowId());
comment(approvalDto, flowChart);
commentId = comment(approvalDto, flowChart);
}
R r = apply(approvalDto);
return r.put("commentId",commentId);
}
public R apply( ApprovalDto approvalDto){
switch (approvalDto.getStatus()) {
case 1: //1 提交审批,审批通过
return newSubmit(approvalDto, null);
@ -920,7 +925,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
default:
break;
}
return null;
return R.ok();
}
@ -1029,7 +1034,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
return newReject(approvalDto);
}
public void comment(ApprovalDto approvalDto, FlowChart flowChart) {
public Long comment(ApprovalDto approvalDto, FlowChart flowChart) {
StaffEntity staffEntity = staffService.selectStaffById(approvalDto.getLoginUserId());
if (staffEntity != null) {
ResultComment resultComment = new ResultComment();
@ -1039,7 +1044,9 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
resultComment.setRecordId(approvalDto.getResultRecordId());
resultComment.setOptDesc(approvalDto.getMenuName() + flowChart.getName());
resultCommentService.insertResultComment(resultComment);
return resultComment.getId();
}
return 0l;
}
private R newSubmit(ApprovalDto approvalDto, Integer finishedStatus) {

View File

@ -0,0 +1,55 @@
package com.lz.modules.sys.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lz.modules.sys.dao.PrintMapper;
import com.lz.modules.sys.entity.Print;
import com.lz.modules.sys.service.PrintService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class PrintServiceImpl extends ServiceImpl<PrintMapper, Print> implements PrintService {
@Autowired
private PrintMapper printMapper;
@Override
public Print selectPrintById(Long id){
return printMapper.selectPrintById(id);
}
@Override
public Long insertPrint(Print print){
return printMapper.insertPrint(print);
}
@Override
public int updatePrintById(Print print){
return printMapper.updatePrintById(print);
}
@Override
public int updateCoverPrintById(Print print){
return printMapper.updateCoverPrintById(print);
}
@Override
public int deletePrintById(Long id){
return printMapper.deletePrintById(id);
}
}

View File

@ -0,0 +1,54 @@
package com.lz.modules.sys.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lz.modules.sys.dao.ResourceMapper;
import com.lz.modules.sys.entity.Resource;
import com.lz.modules.sys.service.ResourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class ResourceServiceImpl extends ServiceImpl<ResourceMapper, Resource> implements ResourceService {
@Autowired
private ResourceMapper resourceMapper;
@Override
public Resource selectResourceById(Long id){
return resourceMapper.selectResourceById(id);
}
@Override
public Long insertResource(Resource resource){
return resourceMapper.insertResource(resource);
}
@Override
public int updateResourceById(Resource resource){
return resourceMapper.updateResourceById(resource);
}
@Override
public int updateCoverResourceById(Resource resource){
return resourceMapper.updateCoverResourceById(resource);
}
@Override
public int deleteResourceById(Long id){
return resourceMapper.deleteResourceById(id);
}
}

View File

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.lz.modules.sys.dao.PrintMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.lz.modules.sys.entity.Print">
<id column="id" property="id"/>
<result column="is_delete" property="isDelete"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="gmt_modified" property="gmtModified"/>
<result column="url" property="url"/>
<result column="remark" property="remark"/>
<result column="batch_no" property="batchNo"/>
<result column="status" property="status"/>
<result column="image_url" property="imageUrl"/>
<result column="is_image" property="isImage"/>
<result column="is_print" property="isPrint"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, url AS url, remark AS remark, batch_no AS batchNo, status AS status, image_url AS imageUrl, is_image AS isImage, is_print AS isPrint
</sql>
<select id="selectPrintById" resultType="Print" >
select * from lz_print where id=#{id} and is_delete = 0 limit 1
</select>
<insert id="insertPrint" parameterType="Print" useGeneratedKeys="true" keyProperty="id" >
insert into lz_print(
<if test="url != null">url, </if>
<if test="remark != null">remark, </if>
<if test="batchNo != null">batch_no, </if>
<if test="status != null">status, </if>
<if test="imageUrl != null">image_url, </if>
<if test="isImage != null">is_image, </if>
<if test="isPrint != null">is_print, </if>
is_delete,
gmt_create,
gmt_modified
)values(
<if test="url != null">#{ url}, </if>
<if test="remark != null">#{ remark}, </if>
<if test="batchNo != null">#{ batchNo}, </if>
<if test="status != null">#{ status}, </if>
<if test="imageUrl != null">#{ imageUrl}, </if>
<if test="isImage != null">#{ isImage}, </if>
<if test="isPrint != null">#{ isPrint}, </if>
0,
now(),
now()
)
</insert>
<update id="updatePrintById" parameterType="Print" >
update
lz_print
<trim prefix="set" suffixOverrides=",">
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
<if test="url != null">url = #{url},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="batchNo != null">batch_no = #{batchNo},</if>
<if test="status != null">status = #{status},</if>
<if test="imageUrl != null">image_url = #{imageUrl},</if>
<if test="isImage != null">is_image = #{isImage},</if>
<if test="isPrint != null">is_print = #{isPrint}</if>
</trim>
,gmt_modified = now()
where id = #{id}
</update>
<update id="updateCoverPrintById" parameterType="Print" >
update
lz_print
set
is_delete = #{isDelete},
gmt_create = #{gmtCreate},
url = #{url},
remark = #{remark},
batch_no = #{batchNo},
status = #{status},
image_url = #{imageUrl},
is_image = #{isImage},
is_print = #{isPrint}
,gmt_modified = now()
where id = #{id}
</update>
<update id="deletePrintById" parameterType="java.lang.Long">
update lz_print set is_delete = 1 where id=#{id} limit 1
</update>
</mapper>

View File

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.lz.modules.sys.dao.ResourceMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.lz.modules.sys.entity.Resource">
<id column="id" property="id"/>
<result column="is_delete" property="isDelete"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="gmt_modified" property="gmtModified"/>
<result column="creator" property="creator"/>
<result column="modifier" property="modifier"/>
<result column="data_type" property="dataType"/>
<result column="type" property="type"/>
<result column="sec_type" property="secType"/>
<result column="type_desc" property="typeDesc"/>
<result column="name" property="name"/>
<result column="value" property="value"/>
<result column="description" property="description"/>
<result column="value_1" property="value1"/>
<result column="value_2" property="value2"/>
<result column="value_3" property="value3"/>
<result column="value_4" property="value4"/>
<result column="sort" property="sort"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, creator AS creator, modifier AS modifier, data_type AS dataType, type AS type, sec_type AS secType, type_desc AS typeDesc, name AS name, value AS value, description AS description, value_1 AS value1, value_2 AS value2, value_3 AS value3, value_4 AS value4, sort AS sort
</sql>
<select id="selectResourceById" resultType="Resource" >
select * from lz_resource where id=#{id} and is_delete = 0 limit 1
</select>
<insert id="insertResource" parameterType="Resource" useGeneratedKeys="true" keyProperty="id" >
insert into lz_resource(
<if test="creator != null">creator, </if>
<if test="modifier != null">modifier, </if>
<if test="dataType != null">data_type, </if>
<if test="type != null">type, </if>
<if test="secType != null">sec_type, </if>
<if test="typeDesc != null">type_desc, </if>
<if test="name != null">name, </if>
<if test="value != null">value, </if>
<if test="description != null">description, </if>
<if test="value1 != null">value_1, </if>
<if test="value2 != null">value_2, </if>
<if test="value3 != null">value_3, </if>
<if test="value4 != null">value_4, </if>
<if test="sort != null">sort, </if>
is_delete,
gmt_create,
gmt_modified
)values(
<if test="creator != null">#{ creator}, </if>
<if test="modifier != null">#{ modifier}, </if>
<if test="dataType != null">#{ dataType}, </if>
<if test="type != null">#{ type}, </if>
<if test="secType != null">#{ secType}, </if>
<if test="typeDesc != null">#{ typeDesc}, </if>
<if test="name != null">#{ name}, </if>
<if test="value != null">#{ value}, </if>
<if test="description != null">#{ description}, </if>
<if test="value1 != null">#{ value1}, </if>
<if test="value2 != null">#{ value2}, </if>
<if test="value3 != null">#{ value3}, </if>
<if test="value4 != null">#{ value4}, </if>
<if test="sort != null">#{ sort}, </if>
0,
now(),
now()
)
</insert>
<update id="updateResourceById" parameterType="Resource" >
update
lz_resource
<trim prefix="set" suffixOverrides=",">
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
<if test="creator != null">creator = #{creator},</if>
<if test="modifier != null">modifier = #{modifier},</if>
<if test="dataType != null">data_type = #{dataType},</if>
<if test="type != null">type = #{type},</if>
<if test="secType != null">sec_type = #{secType},</if>
<if test="typeDesc != null">type_desc = #{typeDesc},</if>
<if test="name != null">name = #{name},</if>
<if test="value != null">value = #{value},</if>
<if test="description != null">description = #{description},</if>
<if test="value1 != null">value_1 = #{value1},</if>
<if test="value2 != null">value_2 = #{value2},</if>
<if test="value3 != null">value_3 = #{value3},</if>
<if test="value4 != null">value_4 = #{value4},</if>
<if test="sort != null">sort = #{sort}</if>
</trim>
,gmt_modified = now()
where id = #{id}
</update>
<update id="updateCoverResourceById" parameterType="Resource" >
update
lz_resource
set
is_delete = #{isDelete},
gmt_create = #{gmtCreate},
creator = #{creator},
modifier = #{modifier},
data_type = #{dataType},
type = #{type},
sec_type = #{secType},
type_desc = #{typeDesc},
name = #{name},
value = #{value},
description = #{description},
value_1 = #{value1},
value_2 = #{value2},
value_3 = #{value3},
value_4 = #{value4},
sort = #{sort}
,gmt_modified = now()
where id = #{id}
</update>
<update id="deleteResourceById" parameterType="java.lang.Long">
update lz_resource set is_delete = 1 where id=#{id} limit 1
</update>
</mapper>

View File

@ -84,8 +84,8 @@ public class MysqlMain {
List<TablesBean> list = new ArrayList<TablesBean>();
list.add(new TablesBean("lz_result_score"));
list.add(new TablesBean("lz_result_detail"));
list.add(new TablesBean("lz_resource"));
list.add(new TablesBean("lz_print"));
List<TablesBean> list2 = new ArrayList<TablesBean>();
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();