提交个民tgit pull

This commit is contained in:
quyixiao 2020-12-08 18:22:29 +08:00
commit ff06c7537d
18 changed files with 339 additions and 65 deletions

View File

@ -1,5 +1,6 @@
package com.lz.modules.app.controller;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.lz.common.emun.ChartFlowType;
import com.lz.common.emun.WorkMsgTypeEnum;
@ -13,6 +14,7 @@ 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.RecordDetailExportResp;
import com.lz.modules.app.resp.ResultDetailResp;
import com.lz.modules.app.resp.Step;
import com.lz.modules.app.service.DepartmentsService;
@ -23,11 +25,17 @@ import com.lz.modules.flow.model.*;
import com.lz.modules.flow.req.ResultDetailReq;
import com.lz.modules.flow.service.*;
import com.lz.modules.job.business.DingtalkBusiness;
import com.lz.modules.performance.res.ResultRankListRes;
import com.lz.modules.performance.service.ChartResultService;
import com.lz.modules.sys.controller.AbstractController;
import com.lz.modules.sys.entity.Print;
import com.lz.modules.sys.entity.Resource;
import com.lz.modules.sys.entity.SysUserEntity;
import com.lz.modules.sys.entity.app.ResultComment;
import com.lz.modules.sys.entity.app.ResultDetail;
import com.lz.modules.sys.entity.app.ResultRecord;
import com.lz.modules.sys.service.PrintService;
import com.lz.modules.sys.service.ResourceService;
import com.lz.modules.sys.service.app.ResultCommentService;
import com.lz.modules.sys.service.app.ResultDetailService;
import com.lz.modules.sys.service.app.ResultRecordService;
@ -45,7 +53,11 @@ import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -88,8 +100,6 @@ public class ResultRecordController extends AbstractController {
@Autowired
private EvaluationStartStaffService evaluationStartStaffService;
@Autowired
private StaffRoleService staffRoleService;
@ -111,6 +121,17 @@ public class ResultRecordController extends AbstractController {
@Autowired
private DingtalkBusiness dingtalkBusiness;
@Autowired
private PrintService printService;
@Autowired
private ResourceService resourceService;
@Autowired
private ChartResultService chartResultService;
private final static String TYPE = "H5_URL";
private final static String SEC_TYPE = "RECORD";
/**
* 列表
*/
@ -733,57 +754,79 @@ public class ResultRecordController extends AbstractController {
Map<Long, ResultDetail> mapDetails =
resultDetails.stream().collect(Collectors.toMap(ResultDetail::getId, Function.identity(), (e, r) -> e));
List<ResultDetail> updateResultDetails = new ArrayList<>();
//获取当前绩效的节点
boolean isSetKeyResult = false;
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(dto.getId(), 2);
if(flowRecords.size() > 0){
if(flowRecords.get(0).getFlowProcess().intValue() == 0){
//指定目标中
isSetKeyResult = true;
if(dto.getSave() != null && dto.getSave().intValue() ==1){
if(flowRecords.get(0).getFlowProcess().intValue() < 1){//因为先提交流程在保存所以这里写了小于2
//指定目标中
log.info("暂存制定目标中");
isSetKeyResult = true;
}
}else{
if(flowRecords.get(0).getFlowProcess().intValue() < 2){//因为先提交流程在保存所以这里写了小于2
//指定目标中
log.info("制定目标中");
isSetKeyResult = true;
}
}
}
for (ResultRecortModelDto model:dto.getRecortModelDtos()
) {
int index = 0;
BigDecimal weight = BigDecimal.ZERO;
if(model.getMaxCount() != null && model.getDetailDtos().size() > model.getMaxCount().intValue()){
/*if(model.getMaxCount() != null && model.getDetailDtos().size() > model.getMaxCount().intValue()){
return R.error(model.getName() + "维度指标数量不能超过" + model.getMaxCount());
}
}*/
for (ResultDetailDto detailDto:model.getDetailDtos()
) {//排序
ResultDetail resultDetail = new ResultDetail();
BeanUtils.copyProperties(detailDto, resultDetail);
if(!isSetKeyResult && resultDetail.getId() != null && mapDetails.containsKey(resultDetail.getId())){
//这里判断是否有更新或者删除
ResultDetail resultDetail1 = mapDetails.get(resultDetail.getId());
boolean isUp = false;
if(!resultDetail.getTarget().equals(resultDetail1.getTarget())){
//打上标识
isUp = true;
if(!isSetKeyResult){
if(resultDetail.getIsDelete() != null && resultDetail.getIsDelete().intValue() == 1){//被删除了
resultDetail.setIsBack(2);
resultDetail.setBackId(resultDetail.getId());
updateResultDetails.add(resultDetail);
}else if(resultDetail.getId() == null){
resultDetail.setIsBack(3);//新增
}else {
if(resultDetail.getId() != null && mapDetails.containsKey(resultDetail.getId())){
//这里判断是否有更新或者删除
boolean isUp = false;
ResultDetail resultDetail1 = null;
resultDetail1 = mapDetails.get(resultDetail.getId());
}
if(!resultDetail.getCheckResult().equals(resultDetail1.getCheckResult())){
//打上标识
isUp = true;
resultDetail1.setCheckResult("<s>" + resultDetail1.getCheckResult() + "</s>");
}
if(!resultDetail.getTarget().equals(resultDetail1.getTarget())){
//打上标识
isUp = true;
}
if(!resultDetail.getKeyResult().equals(resultDetail1.getKeyResult())){
//打上标识
isUp = true;
}
if(!resultDetail.getCheckWeight().equals(resultDetail1.getCheckWeight())){
//打上标识
isUp = true;
//resultDetail1.setTarget("<s>" + resultDetail1.getTarget() + "</s>");
}
if(isUp){
resultDetail1.setId(null);
resultDetail1.setIsBack(1);
resultDetail1.setTarget("<s>" + resultDetail1.getTarget() + "</s>");
resultDetail1.setBackId(resultDetail.getId());
inserts.add(resultDetail);
if(!resultDetail.getCheckWeight().equals(resultDetail1.getCheckWeight())){
//打上标识
isUp = true;
}
if(isUp){
resultDetail1.setId(null);
resultDetail1.setIsBack(2);
resultDetail1.setBackId(resultDetail.getId());
inserts.add(resultDetail1);
}
}
}
}
resultDetail.setPriority(index);
index++;
@ -816,7 +859,6 @@ public class ResultRecordController extends AbstractController {
}
resultDetail.setAcquireScore(score);
weight = weight.add(resultDetail.getCheckWeight());
}
}
@ -845,9 +887,100 @@ public class ResultRecordController extends AbstractController {
resultRecordService.updateResultRecordById(resultRecord);
if(dto.getCommentId() != null && dto.getCommentId().intValue() > 0){
//修改评论信息
updateResultDetails.addAll(resultDetailService.selectNotNoticeResultDetailByRecordId(dto.getId())) ;
log.info("可能需要写入评论的内容条数{}", updateResultDetails.size());
//去重
mapDetails = updateResultDetails.stream().collect(Collectors.toMap(ResultDetail::getId, Function.identity(), (e, r) -> e));
updateResultDetails = mapDetails.values().stream().collect(Collectors.toList());
if(!isSetKeyResult){
log.info("实际需要写入评论的内容条数{}", updateResultDetails.size());
if(updateResultDetails.size() > 0){
updates.addAll(inserts);
mapDetails = updates.stream().collect(Collectors.toMap(ResultDetail::getId, Function.identity(), (e, r) -> e));
String commandValue = "";
int commandIndex = 1;
for (ResultDetail resultDetail1:updateResultDetails
) {
log.info("修改的对象为{}", resultDetail1);
if(resultDetail1.getIsDelete().intValue() == 1){
commandValue += (commandIndex + "(删除) 指标" + resultDetail1.getTarget() + "\n");
commandIndex++;
resultDetail1.setIsBack(1);
}else if(resultDetail1.getIsBack().intValue() == 3){
commandValue += (commandIndex + "(新增) 指标" + resultDetail1.getTarget() + "\n");
commandIndex++;
resultDetail1.setIsBack(0);
}else{
ResultDetail resultDetail = mapDetails.get(resultDetail1.getBackId());
if(resultDetail != null){
log.info("修改后的对象为{}", resultDetail1);
boolean isUp = false;
String value = "";
String heard = "";
if(!resultDetail.getTarget().equals(resultDetail1.getTarget())){
//打上标识
value += ("(修改) 名称:" +
resultDetail1.getTarget()+ " \n(为)\n" + resultDetail.getTarget() + "\n");
isUp = true;
}else{
heard = "指标:" + resultDetail1.getTarget() + "\n";
}
if(!resultDetail.getKeyResult().equals(resultDetail1.getKeyResult())){
//打上标识
value += ("(修改) 考核标准:" +
resultDetail1.getKeyResult() + "\n(为)\n" + resultDetail.getKeyResult() + "\n");
isUp = true;
}
if(!resultDetail.getCheckWeight().equals(resultDetail1.getCheckWeight())){
//打上标识
value += ("(修改) 权重:" +
resultDetail1.getCheckWeight().multiply(new BigDecimal(100)).intValue() + "%\n(为)\n"
+ resultDetail.getCheckWeight().multiply(new BigDecimal(100)).intValue() +
"%\n");
isUp = true;
}
if(isUp){
commandValue += (commandIndex + "" + heard + value);
commandIndex++;
resultDetail1.setIsBack(1);
}
}
}
}
if(commandValue.length() > 0){
log.info("需要写入评论,具体呢容为{}", commandValue);
ResultComment resultComment = resultCommentService.selectResultCommentById(dto.getCommentId());
if(resultComment.getOptDesc().indexOf("制定了目标") >= 0){
resultComment.setOptDesc("修改了目标");
resultComment.setComment(commandValue);
}else{
resultComment.setOptDesc(resultComment.getOptDesc() + "修改了目标");
resultComment.setComment(resultComment.getComment() + commandValue);
}
resultCommentService.updateResultCommentById(resultComment);//.updateResultCommentCommentById(dto.getCommentId(), commandValue);
}
}
}else{
for (ResultDetail resultDetail1:updateResultDetails
) {
if(resultDetail1.getIsBack().intValue() == 3){
resultDetail1.setIsBack(0);
}else{
resultDetail1.setIsBack(1);
}
}
}
resultDetailService.updateBatchById(updateResultDetails);
}
return R.ok();
}
/**
@ -1230,25 +1363,48 @@ public class ResultRecordController extends AbstractController {
@ApiOperation("导出绩效详情报表")
@GetMapping("/recordDetailExport")
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = RecordDetailExportResp.class)})
public R recordDetailExport(Long recordId){
RecordDetailExportResp resp = new RecordDetailExportResp();
Map map = Maps.newHashMap();
map.put("id",recordId);
R respnse = getDetail(map);
if(respnse.isSuccess()){
ResultRecordDetailDto resultRecordDetailDto = (ResultRecordDetailDto) respnse.get("data");
//chartResultService.selectLevelDetailList(req);
// TODO 暂时按照详情页面数据返回
resp.setRecortModelDtos(resultRecordDetailDto.getRecortModelDtos());
}
return R.ok().put("data",resp);
}
@ApiOperation("保存绩效详情报表计划")
@PostMapping("/recordDetailExplan")
@ApiResponses({@ApiResponse(code = 200,message = "成功")})
public R recordDetailExport(@RequestBody List<RecordDetailExplanReq> reqs){
if(CollectionUtils.isEmpty(reqs)){
return R.error("添加数据为空");
}
LocalDateTime now = LocalDateTime.now();
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
String time = dtf.format(now);
List<Print> prints = Lists.newArrayList();
int i =1;
Resource resource = resourceService.selectResourceByTypeAndSecType(TYPE, SEC_TYPE);
for(RecordDetailExplanReq recordDetailExplanReq:reqs){
Print print = new Print();
BeanUtils.copyProperties(recordDetailExplanReq,print);
print.setBatchNo(time + "_" + recordDetailExplanReq.getRecordId() + "_" + i++);
Optional.ofNullable(resource).ifPresent(resource1 -> print.setUrl(resource1.getValue()));
prints.add(print);
}
if(!printService.saveBatch(prints)){
return R.error("保存失败");
}
return R.ok();
}
@ApiOperation("导出绩效详情报表计划")
@PostMapping("/recordDetailExplan")
public R recordDetailExport(@RequestBody List<RecordDetailExplanReq> reqs){
return R.ok();
}
}

View File

@ -1,5 +1,7 @@
package com.lz.modules.app.req;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
@ -8,13 +10,15 @@ import lombok.Data;
* @Date: 2020/12/4 11:27
*/
@Data
@ApiModel("保存导出计划")
public class RecordDetailExplanReq {
//绩效id
@ApiModelProperty(value = "绩效id", name = "recordId")
private Long recordId;
//是否导出图片
private int image;
//是否打印
private int print;
//0不生成图片1生成图片
@ApiModelProperty(value = "0不生成图片1生成图片", name = "isImage")
private Integer isImage;
//0不打印1 打印
@ApiModelProperty(value = "0不打印1 打印", name = "isPrint")
private Integer isPrint;
}

View File

@ -0,0 +1,48 @@
package com.lz.modules.app.resp;
import com.lz.modules.flow.model.ResultRecortModelDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* @Author: djc
* @Desc:
* @Date: 2020/12/7 15:53
*/
@Data
public class RecordDetailExportResp {
//员工工号
@ApiModelProperty(value = "员工工号", name = "jobNumber")
private String jobNumber;
//员工姓名
@ApiModelProperty(value = "员工姓名", name = "staffName")
private String staffName;
//职位
@ApiModelProperty(value = "职位", name = "position")
private String position;
//最后得分
@ApiModelProperty(value = "最后得分", name = "allScore")
private BigDecimal allScore;
//等级
@ApiModelProperty(value = "等级", name = "scoreLevel")
private String scoreLevel;
@ApiModelProperty(value = "考核维度合计", name = "recortModelDtos")
List<ResultRecortModelDto> recortModelDtos;
//一级部门
@ApiModelProperty(value = "一级部门", name = "departmentOne")
private String departmentOne;
//二级部门
@ApiModelProperty(value = "二级部门", name = "departmentTwo")
private String departmentTwo;
//三级部门
@ApiModelProperty(value = "三级部门", name = "departmentThree")
private String departmentThree;
//直属上级
//考核月份
}

View File

@ -33,6 +33,8 @@ public class ResultRecordDetailDto {
//备注
@ApiModelProperty(value = "备注", name = "remark")
private String remark;
@ApiModelProperty(value = "业绩评论id", name = "commandId")
private Long commentId;
//员工id
@ApiModelProperty(value = "员工id", name = "staffId")
private Long staffId;
@ -40,6 +42,9 @@ public class ResultRecordDetailDto {
@ApiModelProperty(value = "任务id", name = "startId")
private Long startId;
@ApiModelProperty(value = "暂存", name = "save")
private Integer save;
//使用的哪个等级等级组idlz_result_grade的group_id

View File

@ -6,7 +6,9 @@ import com.lz.common.utils.StringUtil;
import com.lz.modules.app.dto.StaffSimpleDto;
import com.lz.modules.flow.dao.FlowStartMapper;
import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.flow.entity.StaffRole;
import com.lz.modules.flow.service.EvaluationStartStaffService;
import com.lz.modules.flow.service.StaffRoleService;
import com.lz.modules.performance.req.AssessChangeReq;
import com.lz.modules.performance.req.AssessListReq;
import com.lz.modules.performance.req.AssessDetailReq;
@ -46,6 +48,8 @@ public class AssessManagerController extends AbstractController{
private ResultRecordMapper resultRecordMapper;
@Autowired
private ChartResultService chartResultService;
@Autowired
private StaffRoleService staffRoleService;
@ -127,6 +131,11 @@ public class AssessManagerController extends AbstractController{
return R.error("没有此条记录");
}
try {
Long userId = getUserId();
StaffRole role = staffRoleService.selectByStaffId(userId);
if(role == null || role.getDepartmentId()!=0){
return R.error("您不是绩效管理员或未管理全公司,无法删除此任务");
}
assessManagerService.accessDelete(flowStart);
} catch (Exception e) {
log.error("删除考核任务异常, id:" + assessId ,e);

View File

@ -22,5 +22,6 @@ public interface ResourceMapper extends BaseMapper<Resource> {
int deleteResourceById(@Param("id") Long id);
Resource selectResourceByTypeAndSecType(@Param("type") String Type, @Param("secType") String secType);
}

View File

@ -38,4 +38,5 @@ public interface ResultCommentMapper extends BaseMapper<ResultComment> {
ResultComment selectLastComment(@Param("recordId") Long recordId);
int updateResultCommentCommentById(@Param("commandId") Long commandId, @Param("commandValue") String commandValue);
}

View File

@ -48,4 +48,8 @@ public interface ResultDetailMapper extends BaseMapper<ResultDetail> {
List<ResultDetailDto> selectDtosByRecordId(@Param("recordResultId") Long id, @Param("modelId") Long modelId);
int deleteResultDetailByRecordId(@Param("recordId") Long recordId);
ResultDetail selectNotNoticeResultDetailByBackId(@Param("backId") Long backId);
List<ResultDetail> selectNotNoticeResultDetailByRecordId(@Param("recordId") Long recordId);
}

View File

@ -36,7 +36,7 @@ public class ResultDetail implements java.io.Serializable {
private Long backId;
//是否为备份0非备份1备份值
@ApiModelProperty(value = "是否为备份0非备份1备份值", name = "isBack")
private Integer isBack;
private Integer isEdit;
//1业绩2文化价值观
@ApiModelProperty(value = "1业绩2文化价值观", name = "type")
private Integer type;
@ -159,14 +159,14 @@ public class ResultDetail implements java.io.Serializable {
* @return
*/
public Integer getIsBack() {
return isBack;
return isEdit;
}
/**
* 是否为备份0非备份1备份值
* @param isBack
*/
public void setIsBack(Integer isBack) {
this.isBack = isBack;
this.isEdit = isBack;
}
/**
@ -387,7 +387,7 @@ public class ResultDetail implements java.io.Serializable {
",gmtCreate=" + gmtCreate +
",gmtModified=" + gmtModified +
",backId=" + backId +
",isBack=" + isBack +
",isBack=" + isEdit +
",type=" + type +
",target=" + target +
",keyResult=" + keyResult +

View File

@ -21,5 +21,7 @@ public interface ResourceService extends IService<Resource> {
int deleteResourceById(Long id);
Resource selectResourceByTypeAndSecType(String type,String secType);
}

View File

@ -40,4 +40,6 @@ public interface ResultCommentService extends IService<ResultComment> {
void addOrUpdateComment(ResultRecordReq req, Long userId, int status , FlowRecord lastUsedFlowRecord);
int updateResultCommentCommentById(Long commandId, String commandValue);
}

View File

@ -72,4 +72,8 @@ public interface ResultDetailService extends IService<ResultDetail> {
List<ResultDetailDto> selectDtosByRecordId(Long id, Long modelId);
int deleteResultDetailByRecordId(Long recordId);
ResultDetail selectNotNoticeResultDetailByBackId(Long id);
List<ResultDetail> selectNotNoticeResultDetailByRecordId(Long recordId);
}

View File

@ -113,4 +113,9 @@ public class ResultCommentServiceImpl extends ServiceImpl<ResultCommentMapper, R
}
}
@Override
public int updateResultCommentCommentById(Long commandId, String commandValue){
return resultCommentMapper.updateResultCommentCommentById(commandId, commandValue);
}
}

View File

@ -345,4 +345,13 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
return resultDetailMapper.deleteResultDetailByRecordId(recordId);
}
@Override
public ResultDetail selectNotNoticeResultDetailByBackId(Long backId){
return resultDetailMapper.selectNotNoticeResultDetailByBackId(backId);
}
@Override
public List<ResultDetail> selectNotNoticeResultDetailByRecordId(Long recordId){
return resultDetailMapper.selectNotNoticeResultDetailByRecordId(recordId);
}
}

View File

@ -49,6 +49,8 @@ public class ResourceServiceImpl extends ServiceImpl<ResourceMapper, Resource> i
return resourceMapper.deleteResourceById(id);
}
@Override
public Resource selectResourceByTypeAndSecType(String type, String secType) {
return resourceMapper.selectResourceByTypeAndSecType(type,secType);
}
}

View File

@ -109,6 +109,15 @@
select * from lz_result_comment where record_id=#{recordId} and is_delete = 0 order by id desc limit 1
</select>
<update id="updateResultCommentCommentById" parameterType="ResultComment" >
update
lz_result_comment
set
opt_desc = '修改了目标',
comment = #{commandValue}
,gmt_modified = now()
where id = #{commandId}
</update>

View File

@ -9,7 +9,7 @@
<result column="gmt_create" property="gmtCreate"/>
<result column="gmt_modified" property="gmtModified"/>
<result column="back_id" property="backId"/>
<result column="is_back" property="isBack"/>
<result column="is_edit" property="isEdit"/>
<result column="type" property="type"/>
<result column="target" property="target"/>
<result column="key_result" property="keyResult"/>
@ -29,7 +29,7 @@
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, back_id AS backId, is_back AS isBack, type AS type, target AS target, key_result AS keyResult, key_result_3_5 AS keyResult35, key_result_3_7 AS keyResult37, check_weight AS checkWeight, check_result AS checkResult, super_score AS superScore, acquire_score AS acquireScore, score_comment AS scoreComment, record_id AS recordId, staff_id AS staffId, priority AS priority, model_id AS modelId
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, back_id AS backId, is_edit AS isEdit, type AS type, target AS target, key_result AS keyResult, key_result_3_5 AS keyResult35, key_result_3_7 AS keyResult37, check_weight AS checkWeight, check_result AS checkResult, super_score AS superScore, acquire_score AS acquireScore, score_comment AS scoreComment, record_id AS recordId, staff_id AS staffId, priority AS priority, model_id AS modelId
</sql>
@ -43,7 +43,7 @@
<insert id="insertResultDetail" parameterType="ResultDetail" useGeneratedKeys="true" keyProperty="id" >
insert into lz_result_detail(
<if test="backId != null">back_id, </if>
<if test="isBack != null">is_back, </if>
<if test="isEdit != null">is_edit, </if>
<if test="type != null">type, </if>
<if test="target != null">target, </if>
<if test="keyResult != null">key_result, </if>
@ -63,7 +63,7 @@
gmt_modified
)values(
<if test="backId != null">#{ backId}, </if>
<if test="isBack != null">#{ isBack}, </if>
<if test="isEdit != null">#{ isEdit}, </if>
<if test="type != null">#{ type}, </if>
<if test="target != null">#{ target}, </if>
<if test="keyResult != null">#{ keyResult}, </if>
@ -92,7 +92,7 @@
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
<if test="backId != null">back_id = #{backId},</if>
<if test="isBack != null">is_back = #{isBack},</if>
<if test="isEdit != null">is_edit = #{isEdit},</if>
<if test="type != null">type = #{type},</if>
<if test="target != null">target = #{target},</if>
<if test="keyResult != null">key_result = #{keyResult},</if>
@ -120,7 +120,7 @@
is_delete = #{isDelete},
gmt_create = #{gmtCreate},
back_id = #{backId},
is_back = #{isBack},
is_edit = #{isEdit},
type = #{type},
target = #{target},
key_result = #{keyResult},
@ -147,7 +147,7 @@
<select id="selectByRecordId" resultType="com.lz.modules.sys.entity.app.ResultDetail">
select * from lz_result_detail where record_id=#{recordResultId} and is_delete = 0 order by type asc ,priority desc
select * from lz_result_detail where record_id=#{recordResultId} and is_delete = 0 and is_edit=0 order by type asc ,priority desc
</select>
<select id="selectByRecordIdType" resultType="com.lz.modules.sys.entity.app.ResultDetail">
@ -196,12 +196,20 @@
</insert>
<select id="selectDtosByRecordId" resultType="com.lz.modules.flow.model.ResultDetailDto">
select * from lz_result_detail where record_id=#{recordResultId} and model_id = #{modelId} and is_delete = 0 order by priority asc
select * from lz_result_detail where record_id=#{recordResultId} and model_id = #{modelId} and is_delete = 0 and (is_edit = 0 or is_edit = 3) order by priority asc
</select>
<update id="deleteResultDetailByRecordId" parameterType="java.lang.Long">
update lz_result_detail set is_delete = 1, gmt_modified = now() where record_id=#{recordId} and is_delete = 0
</update>
<select id="selectNotNoticeResultDetailByBackId" resultType="com.lz.modules.sys.entity.app.ResultDetail">
select * from lz_result_detail where back_id = #{backId} and is_edit = 2 order by priority asc
</select>
<select id="selectNotNoticeResultDetailByRecordId" resultType="com.lz.modules.sys.entity.app.ResultDetail">
select * from lz_result_detail where record_id = #{recordId} and (is_edit = 2 or is_edit = 3) order by priority asc
</select>
</mapper>

View File

@ -38,6 +38,11 @@
</select>
<select id="selectResourceByTypeAndSecType" resultType="com.lz.modules.sys.entity.Resource">
select * from lz_resource where type=#{type} and sec_type=#{secType} 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>