模版编制的相关实现
This commit is contained in:
@@ -30,4 +30,6 @@ public interface TemplateInstanceDataMapper extends BaseMapperX<TemplateInstance
|
|||||||
}
|
}
|
||||||
int deleteByTemplateInstanceId(@Param("templateInstanceId") Long templateInstanceId);
|
int deleteByTemplateInstanceId(@Param("templateInstanceId") Long templateInstanceId);
|
||||||
|
|
||||||
|
int updateFldValBatchById(@Param("id") Long id, @Param("fldVal") String fldVal);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,7 +103,8 @@ public class TemplateInstanceDataServiceImpl implements TemplateInstanceDataServ
|
|||||||
if (CollUtil.isEmpty(pageReqVOS)) {
|
if (CollUtil.isEmpty(pageReqVOS)) {
|
||||||
throw exception(PARAMS_IS_NULL_OR_ERR);
|
throw exception(PARAMS_IS_NULL_OR_ERR);
|
||||||
}
|
}
|
||||||
return templateInstanceDataMapper.updateBatch(pageReqVOS);
|
pageReqVOS.forEach(i->templateInstanceDataMapper.updateFldValBatchById(i.getId(),i.getFldVal()));
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.base.util;
|
|||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.util.ClassUtils;
|
import org.springframework.util.ClassUtils;
|
||||||
import org.springframework.util.ResourceUtils;
|
import org.springframework.util.ResourceUtils;
|
||||||
|
|
||||||
@@ -231,7 +232,7 @@ public class ClassInfoScanner {
|
|||||||
|
|
||||||
List<Map<String, Object>> resultList = new ArrayList<>();
|
List<Map<String, Object>> resultList = new ArrayList<>();
|
||||||
Field[] fields = targetClass.getDeclaredFields();
|
Field[] fields = targetClass.getDeclaredFields();
|
||||||
|
// PreAuthorize preAuthorize = targetClass.getAnnotation(PreAuthorize.class);
|
||||||
for (Field field : fields) {
|
for (Field field : fields) {
|
||||||
if (field.isAnnotationPresent(Schema.class)) {
|
if (field.isAnnotationPresent(Schema.class)) {
|
||||||
Schema schema = field.getAnnotation(Schema.class);
|
Schema schema = field.getAnnotation(Schema.class);
|
||||||
@@ -261,7 +262,7 @@ public class ClassInfoScanner {
|
|||||||
String protocol = url.getProtocol();
|
String protocol = url.getProtocol();
|
||||||
|
|
||||||
if ("file".equals(protocol)) {
|
if ("file".equals(protocol)) {
|
||||||
String filePath = URLDecoder.decode(url.getFile(), StandardCharsets.UTF_8.name());
|
String filePath = URLDecoder.decode(url.getFile(), StandardCharsets.UTF_8);
|
||||||
findAndAddClassesInPackageByFile(basePackage, filePath);
|
findAndAddClassesInPackageByFile(basePackage, filePath);
|
||||||
} else if ("jar".equals(protocol)) {
|
} else if ("jar".equals(protocol)) {
|
||||||
JarFile jar = ((JarURLConnection) url.openConnection()).getJarFile();
|
JarFile jar = ((JarURLConnection) url.openConnection()).getJarFile();
|
||||||
|
|||||||
@@ -9,8 +9,14 @@
|
|||||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<update id="deleteByTemplateInstanceId" >
|
<update id="deleteByTemplateInstanceId">
|
||||||
update BSE_TMPL_INSC_DAT set deleted = 1
|
update BSE_TMPL_INSC_DAT
|
||||||
|
set deleted = 1
|
||||||
WHERE INSC_ID = #{templateInstanceId}
|
WHERE INSC_ID = #{templateInstanceId}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="updateFldValBatchById">
|
||||||
|
update BSE_TMPL_INSC_DAT
|
||||||
|
set FLD_VAL = #{fldVal}
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user