Commit 76e06c97 by 谢海旭

优化

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