From 0ef31ffe9d60344f6722c53252a32ddcc2cc2e91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=BB=BA=E8=B6=85?= <3182967682@qq.com> Date: Fri, 4 Dec 2020 10:26:06 +0800 Subject: [PATCH 1/6] fix --- .../controller/ExportController.java | 278 +++++++++++++++++- .../dto/RecordDetailExportDto.java | 34 +++ .../modules/performance/dto/StaffTypeDto.java | 8 - 3 files changed, 296 insertions(+), 24 deletions(-) create mode 100644 src/main/java/com/lz/modules/performance/dto/RecordDetailExportDto.java diff --git a/src/main/java/com/lz/modules/performance/controller/ExportController.java b/src/main/java/com/lz/modules/performance/controller/ExportController.java index d8d2b7be..aeb7d1c3 100644 --- a/src/main/java/com/lz/modules/performance/controller/ExportController.java +++ b/src/main/java/com/lz/modules/performance/controller/ExportController.java @@ -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 tags,ExcelWriter writer){ + private void buildHeaderData(Class data,List 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 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 row = CollUtil.newArrayList("考核月份", "09", "工号", "YN", "员工姓名", "老白", "一级部门", "业务中台", "二级部门","技术中心", "三级部门","攻关小组", "职位","java", "直属上级","佟湘玉"); + List 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 recortModelDtos = dto.getRecortModelDtos(); + List data = Lists.newArrayList(); + int mergeStart = 5; + for(ResultRecortModelDto modelDto:recortModelDtos){ + //维度名称 + String name = modelDto.getName(); + //详细条目 + List detailDtos = modelDto.getDetailDtos(); + + List 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" + + " }*/ } diff --git a/src/main/java/com/lz/modules/performance/dto/RecordDetailExportDto.java b/src/main/java/com/lz/modules/performance/dto/RecordDetailExportDto.java new file mode 100644 index 00000000..5ae5892b --- /dev/null +++ b/src/main/java/com/lz/modules/performance/dto/RecordDetailExportDto.java @@ -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; + +} diff --git a/src/main/java/com/lz/modules/performance/dto/StaffTypeDto.java b/src/main/java/com/lz/modules/performance/dto/StaffTypeDto.java index 5822caf5..891ebc6d 100644 --- a/src/main/java/com/lz/modules/performance/dto/StaffTypeDto.java +++ b/src/main/java/com/lz/modules/performance/dto/StaffTypeDto.java @@ -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; } From 35aa1fd7e8450bc49c4541db6bf88f71ef890088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=BB=BA=E8=B6=85?= <3182967682@qq.com> Date: Fri, 4 Dec 2020 11:22:07 +0800 Subject: [PATCH 2/6] fix --- .../controller/ResultRecordController.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java index 620608ca..7e366111 100644 --- a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java +++ b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java @@ -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.*; @@ -1222,4 +1223,30 @@ public class ResultRecordController extends AbstractController { return resultRecordService.getResetData(recordDetailDto); } + + + + + @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(); + } + + @GetMapping("/recordDetailExplan") + public R recordDetailExport(String recordIds){ + if(StringUtil.isBlank(recordIds)){ + return R.ok(); + } + + + return R.ok(); + } } From 2e7e969c5fe05e81e4d6c8757689d99bad418fb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=BB=BA=E8=B6=85?= <3182967682@qq.com> Date: Fri, 4 Dec 2020 11:48:31 +0800 Subject: [PATCH 3/6] fix --- .../controller/ResultRecordController.java | 12 ++++++----- .../app/req/RecordDetailExplanReq.java | 20 +++++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 src/main/java/com/lz/modules/app/req/RecordDetailExplanReq.java diff --git a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java index 7e366111..b4023253 100644 --- a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java +++ b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java @@ -11,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; @@ -1227,6 +1228,7 @@ public class ResultRecordController extends AbstractController { + @ApiOperation("导出绩效详情报表") @GetMapping("/recordDetailExport") public R recordDetailExport(Long recordId){ Map map = Maps.newHashMap(); @@ -1240,11 +1242,11 @@ public class ResultRecordController extends AbstractController { return R.ok(); } - @GetMapping("/recordDetailExplan") - public R recordDetailExport(String recordIds){ - if(StringUtil.isBlank(recordIds)){ - return R.ok(); - } + @ApiOperation("导出绩效详情报表计划") + @PostMapping("/recordDetailExplan") + public R recordDetailExport(@RequestBody List reqs){ + + return R.ok(); diff --git a/src/main/java/com/lz/modules/app/req/RecordDetailExplanReq.java b/src/main/java/com/lz/modules/app/req/RecordDetailExplanReq.java new file mode 100644 index 00000000..077766ac --- /dev/null +++ b/src/main/java/com/lz/modules/app/req/RecordDetailExplanReq.java @@ -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; +} From a3901bed96a95f4b2747b45fa2acab143304f65a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=BB=BA=E8=B6=85?= <3182967682@qq.com> Date: Fri, 4 Dec 2020 14:23:13 +0800 Subject: [PATCH 4/6] fix --- .../com/lz/modules/sys/dao/PrintMapper.java | 33 ++ .../lz/modules/sys/dao/ResourceMapper.java | 26 ++ .../java/com/lz/modules/sys/entity/Print.java | 234 ++++++++++++ .../com/lz/modules/sys/entity/Resource.java | 361 ++++++++++++++++++ src/main/resources/mapper/sys/PrintMapper.xml | 103 +++++ .../resources/mapper/sys/ResourceMapper.xml | 138 +++++++ src/test/java/com/lz/mysql/MysqlMain.java | 4 +- 7 files changed, 897 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/lz/modules/sys/dao/PrintMapper.java create mode 100644 src/main/java/com/lz/modules/sys/dao/ResourceMapper.java create mode 100644 src/main/java/com/lz/modules/sys/entity/Print.java create mode 100644 src/main/java/com/lz/modules/sys/entity/Resource.java create mode 100644 src/main/resources/mapper/sys/PrintMapper.xml create mode 100644 src/main/resources/mapper/sys/ResourceMapper.xml diff --git a/src/main/java/com/lz/modules/sys/dao/PrintMapper.java b/src/main/java/com/lz/modules/sys/dao/PrintMapper.java new file mode 100644 index 00000000..808924d6 --- /dev/null +++ b/src/main/java/com/lz/modules/sys/dao/PrintMapper.java @@ -0,0 +1,33 @@ +package com.lz.modules.sys.dao; +/** +*

+* 流转表 服务类 +*

+* +* @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 selectPrintById(@Param("id") Long id); + + + Long insertPrint(Print print); + + + int updatePrintById(Print print); + + + int updateCoverPrintById(Print print); + + + int deletePrintById(@Param("id") Long id); + + +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/sys/dao/ResourceMapper.java b/src/main/java/com/lz/modules/sys/dao/ResourceMapper.java new file mode 100644 index 00000000..9d5451c0 --- /dev/null +++ b/src/main/java/com/lz/modules/sys/dao/ResourceMapper.java @@ -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 selectResourceById(@Param("id") Long id); + + + Long insertResource(Resource resource); + + + int updateResourceById(Resource resource); + + + int updateCoverResourceById(Resource resource); + + + int deleteResourceById(@Param("id") Long id); + + +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/sys/entity/Print.java b/src/main/java/com/lz/modules/sys/entity/Print.java new file mode 100644 index 00000000..cadb7712 --- /dev/null +++ b/src/main/java/com/lz/modules/sys/entity/Print.java @@ -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; +/** +*

+*

*流转表 +* @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 + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/sys/entity/Resource.java b/src/main/java/com/lz/modules/sys/entity/Resource.java new file mode 100644 index 00000000..cbb92d62 --- /dev/null +++ b/src/main/java/com/lz/modules/sys/entity/Resource.java @@ -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 + + "}"; + } +} \ No newline at end of file diff --git a/src/main/resources/mapper/sys/PrintMapper.xml b/src/main/resources/mapper/sys/PrintMapper.xml new file mode 100644 index 00000000..ad022c37 --- /dev/null +++ b/src/main/resources/mapper/sys/PrintMapper.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + insert into lz_print( + url, + remark, + batch_no, + status, + image_url, + is_image, + is_print, + is_delete, + gmt_create, + gmt_modified + )values( + #{ url}, + #{ remark}, + #{ batchNo}, + #{ status}, + #{ imageUrl}, + #{ isImage}, + #{ isPrint}, + 0, + now(), + now() + ) + + + + + update + lz_print + + 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 + 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 lz_print set is_delete = 1 where id=#{id} limit 1 + + + + diff --git a/src/main/resources/mapper/sys/ResourceMapper.xml b/src/main/resources/mapper/sys/ResourceMapper.xml new file mode 100644 index 00000000..eb1f3c28 --- /dev/null +++ b/src/main/resources/mapper/sys/ResourceMapper.xml @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + insert into lz_resource( + creator, + modifier, + data_type, + type, + sec_type, + type_desc, + name, + value, + description, + value_1, + value_2, + value_3, + value_4, + sort, + is_delete, + gmt_create, + gmt_modified + )values( + #{ creator}, + #{ modifier}, + #{ dataType}, + #{ type}, + #{ secType}, + #{ typeDesc}, + #{ name}, + #{ value}, + #{ description}, + #{ value1}, + #{ value2}, + #{ value3}, + #{ value4}, + #{ sort}, + 0, + now(), + now() + ) + + + + + update + lz_resource + + 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 + 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 lz_resource set is_delete = 1 where id=#{id} limit 1 + + + + diff --git a/src/test/java/com/lz/mysql/MysqlMain.java b/src/test/java/com/lz/mysql/MysqlMain.java index 6410c7a3..00ac715c 100644 --- a/src/test/java/com/lz/mysql/MysqlMain.java +++ b/src/test/java/com/lz/mysql/MysqlMain.java @@ -84,8 +84,8 @@ public class MysqlMain { List list = new ArrayList(); - 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 list2 = new ArrayList(); Map map = MysqlUtil2ShowCreateTable.getComments(); From 53b4bfb15344ae410322343fbd67758c5a255034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=BB=BA=E8=B6=85?= <3182967682@qq.com> Date: Fri, 4 Dec 2020 14:38:18 +0800 Subject: [PATCH 5/6] fix --- .../lz/modules/sys/service/PrintService.java | 33 +++++++++++ .../modules/sys/service/ResourceService.java | 25 +++++++++ .../sys/service/impl/PrintServiceImpl.java | 55 +++++++++++++++++++ .../sys/service/impl/ResourceServiceImpl.java | 54 ++++++++++++++++++ 4 files changed, 167 insertions(+) create mode 100644 src/main/java/com/lz/modules/sys/service/PrintService.java create mode 100644 src/main/java/com/lz/modules/sys/service/ResourceService.java create mode 100644 src/main/java/com/lz/modules/sys/service/impl/PrintServiceImpl.java create mode 100644 src/main/java/com/lz/modules/sys/service/impl/ResourceServiceImpl.java diff --git a/src/main/java/com/lz/modules/sys/service/PrintService.java b/src/main/java/com/lz/modules/sys/service/PrintService.java new file mode 100644 index 00000000..e92db5cf --- /dev/null +++ b/src/main/java/com/lz/modules/sys/service/PrintService.java @@ -0,0 +1,33 @@ +package com.lz.modules.sys.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.lz.modules.sys.entity.Print; + +/** +*

+* 流转表 服务类 +*

+* +* @author quyixiao +* @since 2020-12-04 +*/ +public interface PrintService extends IService { + + + + Print selectPrintById(Long id); + + + Long insertPrint(Print print); + + + int updatePrintById(Print print); + + + int updateCoverPrintById(Print print); + + + int deletePrintById(Long id); + + +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/sys/service/ResourceService.java b/src/main/java/com/lz/modules/sys/service/ResourceService.java new file mode 100644 index 00000000..3659c714 --- /dev/null +++ b/src/main/java/com/lz/modules/sys/service/ResourceService.java @@ -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 selectResourceById(Long id); + + + Long insertResource(Resource resource); + + + int updateResourceById(Resource resource); + + + int updateCoverResourceById(Resource resource); + + + int deleteResourceById(Long id); + + +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/sys/service/impl/PrintServiceImpl.java b/src/main/java/com/lz/modules/sys/service/impl/PrintServiceImpl.java new file mode 100644 index 00000000..56f66cd4 --- /dev/null +++ b/src/main/java/com/lz/modules/sys/service/impl/PrintServiceImpl.java @@ -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 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); + } + + + +} diff --git a/src/main/java/com/lz/modules/sys/service/impl/ResourceServiceImpl.java b/src/main/java/com/lz/modules/sys/service/impl/ResourceServiceImpl.java new file mode 100644 index 00000000..2142a80d --- /dev/null +++ b/src/main/java/com/lz/modules/sys/service/impl/ResourceServiceImpl.java @@ -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 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); + } + + + +} From 03028ba53bfcd5e8f26daa564d376cf68b430ca0 Mon Sep 17 00:00:00 2001 From: quyixiao <2621048238@qq.com> Date: Fri, 4 Dec 2020 16:44:04 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/app/impl/ResultRecordServiceImpl.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java b/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java index 910a4b25..56386009 100644 --- a/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java +++ b/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java @@ -884,13 +884,18 @@ public class ResultRecordServiceImpl extends ServiceImpl 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