模版编制的相关实现

This commit is contained in:
潘荣晟
2025-09-22 17:42:09 +08:00
parent c14837b5e2
commit 0de35c9dde
4 changed files with 15 additions and 5 deletions

View File

@@ -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);
} }

View File

@@ -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

View File

@@ -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();

View File

@@ -10,7 +10,13 @@
--> -->
<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>