Commit 76e06c97 by 谢海旭

优化

1 parent a90b5b4d
package cn.com.glsx.process.modules.mapper;
import cn.com.glsx.process.modules.entity.SopTpl;
import cn.com.glsx.process.modules.model.SopTplDTO;
import cn.com.glsx.process.modules.model.SopTplSearch;
import com.glsx.plat.mybatis.mapper.CommonBaseMapper;
import org.apache.ibatis.annotations.Mapper;
......@@ -10,5 +11,5 @@ import java.util.List;
@Mapper
public interface SopTplMapper extends CommonBaseMapper<SopTpl> {
List<SopTpl> page(SopTplSearch search);
List<SopTplDTO> page(SopTplSearch search);
}
\ No newline at end of file
......@@ -31,7 +31,7 @@ public class SopTplController extends BaseController {
@Operation(summary = "SOP模板列表", description = "SOP模板列表")
@GetMapping
public PageInfo<SopTpl> page(SopTplSearch search) {
public PageInfo<SopTplDTO> page(SopTplSearch search) {
return sopTplService.page(search);
}
......
......@@ -84,6 +84,7 @@ public class SopTplGrantService {
SopTplNodeConverter sopTplNodeConverter = SopTplNodeConverter.INSTANCE;
for (SopTplGrant sopTplGrant : sopTplGrants) {
//TODO 门店-模板 单次授权 多实例 处理
Integer grantId = sopTplGrant.getGrantId();
//克隆模板内容
SopInst sopInst = sopTplConverter.do2inst(sopTpl);
......
......@@ -32,9 +32,9 @@ public class SopTplService {
@Resource
private SopTplLinkMapper sopTplLinkMapper;
public PageInfo<SopTpl> page(SopTplSearch search) {
public PageInfo<SopTplDTO> page(SopTplSearch search) {
PageHelper.startPage(search.getPageNumber(), search.getPageSize());
List<SopTpl> list = sopTplMapper.page(search);
List<SopTplDTO> list = sopTplMapper.page(search);
return new PageInfo<>(list);
}
......
......@@ -27,7 +27,7 @@
</sql>
<update id="updateInstParamCustomData">
UPDATE sop_inst SET inst_param=json_set(inst_param,'$.customData',#{customData,typeHandler=cn.com.glsx.process.modules.handler.JsonTypeHandler}) WHERE inst_id = #{instId}
UPDATE sop_inst SET inst_param=json_set(inst_param,'$.customData',CAST(#{customData,typeHandler=cn.com.glsx.process.modules.handler.JsonTypeHandler} AS JSON)) WHERE inst_id = #{instId}
</update>
<update id="updateInstStatus">
......
......@@ -16,6 +16,9 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<resultMap id="BaseResultDTOMap" extends="BaseResultMap" type="cn.com.glsx.process.modules.model.SopTplDTO">
<association column="tpl_id" jdbcType="INTEGER" property="grantCount" select="cn.com.glsx.process.modules.mapper.SopTplGrantMapper.countByTplId" />
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
......@@ -24,7 +27,7 @@
tpl_singleton, create_time, update_time
</sql>
<select id="page" resultMap="BaseResultMap">
<select id="page" resultMap="BaseResultDTOMap">
select
<include refid="Base_Column_List" />
from sop_tpl
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!