Merge branch 'dev' of http://47.97.8.94:19527/yj/zn-cloud into dev
This commit is contained in:
commit
599980b870
@ -25,10 +25,12 @@ public interface LogInstanceConvert {
|
||||
default LogInstanceRespVO convert(LogInstanceDO logInstanceDO) {
|
||||
|
||||
LogInstanceRespVO logInstanceRespVO = BeanUtils.toBean(logInstanceDO, LogInstanceRespVO.class);
|
||||
if (logInstanceRespVO != null) {
|
||||
|
||||
logInstanceRespVO.setFormVariables(JSONObject.toJSONString(logInstanceDO.getFormVariables()));
|
||||
logInstanceRespVO.setFileItems(JSONObject.toJSONString(logInstanceDO.getFileItems()));
|
||||
logInstanceRespVO.setCreateTime(logInstanceDO.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
logInstanceRespVO.setFormVariables(JSONObject.toJSONString(logInstanceDO.getFormVariables()));
|
||||
logInstanceRespVO.setFileItems(JSONObject.toJSONString(logInstanceDO.getFileItems()));
|
||||
logInstanceRespVO.setCreateTime(logInstanceDO.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
}
|
||||
|
||||
return logInstanceRespVO;
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ public class LogInstanceServiceImpl implements LogInstanceService {
|
||||
String fieldStr = fieldJson.getStr("field");
|
||||
String title = fieldJson.getStr("title");
|
||||
String field = workLogContentJson.getStr(fieldStr);
|
||||
workLogContent.append(title).append(":").append(field);
|
||||
workLogContent.append(title).append(":").append(field).append(" ");
|
||||
}
|
||||
}
|
||||
item.setWorkLogContent(workLogContent.toString());
|
||||
@ -295,8 +295,8 @@ public class LogInstanceServiceImpl implements LogInstanceService {
|
||||
@Override
|
||||
public LogInstanceRespVO setContentFun(LogInstanceRespVO logInstanceRespVO) {
|
||||
|
||||
if (logInstanceRespVO.getFormId() == null) {
|
||||
return logInstanceRespVO;
|
||||
if (logInstanceRespVO == null) {
|
||||
return null;
|
||||
}
|
||||
//获取模板信息
|
||||
LogFormDO logFormDO = logFormService.getForm(logInstanceRespVO.getFormId());
|
||||
|
@ -106,16 +106,16 @@
|
||||
<select id="selectPageResult" resultType="cn.iocoder.yudao.module.system.controller.admin.worklog.vo.loginstance.LogInstanceRespVO">
|
||||
SELECT
|
||||
a.*,
|
||||
e.read_status AS readStatus,
|
||||
COUNT(b.work_log_id) AS comment,
|
||||
COUNT(c.log_instance_id) AS readCount,
|
||||
COUNT(d.log_instance_id) AS unreadCount
|
||||
e.read_status as readStatus,
|
||||
COALESCE(c.readCount, 0) as readCount,
|
||||
COALESCE(d.unreadCount, 0) as unReadCount,
|
||||
COALESCE(b.comment, 0) as comment
|
||||
FROM
|
||||
work_log_instance_ext as a
|
||||
LEFT JOIN work_log_comment as b ON a.id = b.work_log_id
|
||||
LEFT JOIN work_log_read as e ON a.id = e.log_instance_id and e.read_user_id = #{userId}
|
||||
LEFT JOIN work_log_read as c ON a.id = c.log_instance_id and c.read_status = 1
|
||||
LEFT JOIN work_log_read as d ON a.id = d.log_instance_id and d.read_status = 0
|
||||
LEFT JOIN (SELECT log_instance_id, COUNT(log_instance_id) AS readCount FROM work_log_read where read_status = 1 GROUP BY log_instance_id ) AS c ON a.id = c.log_instance_id
|
||||
LEFT JOIN (SELECT log_instance_id, COUNT(log_instance_id) AS unReadCount FROM work_log_read where read_status = 0 GROUP BY log_instance_id ) AS d ON a.id = d.log_instance_id
|
||||
LEFT JOIN (SELECT work_log_id, COUNT(work_log_id) AS comment FROM work_log_comment GROUP BY work_log_id) AS b ON a.id = b.work_log_id
|
||||
<where>
|
||||
<if test="logId != null">
|
||||
and a.id = #{logId}
|
||||
@ -147,7 +147,7 @@
|
||||
and a.start_user_id = #{userId}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY a.id,e.read_status
|
||||
GROUP BY a.id, readStatus, readCount, unReadCount, comment
|
||||
ORDER BY a.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user