parent
081ed4f724
commit
554ffd1655
|
@ -153,6 +153,19 @@ public class AeConfVoucherTemplateEntity extends BaseEntity {
|
||||||
* 修改人
|
* 修改人
|
||||||
*/
|
*/
|
||||||
private String modifyUser;
|
private String modifyUser;
|
||||||
|
/**
|
||||||
|
* 是否按类型合并
|
||||||
|
*/
|
||||||
|
private String typeMerge;
|
||||||
|
|
||||||
|
|
||||||
|
public String getTypeMerge() {
|
||||||
|
return typeMerge;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTypeMerge(String typeMerge) {
|
||||||
|
this.typeMerge = typeMerge;
|
||||||
|
}
|
||||||
|
|
||||||
private List<AeConfVoucherTemplateAssistEntity> assistEntityList;
|
private List<AeConfVoucherTemplateAssistEntity> assistEntityList;
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||||
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
|
<result property="mdmId" column="mdm_id" jdbcType="VARCHAR"/>
|
||||||
<result property="templateTypeId" column="template_type_id" jdbcType="VARCHAR"/>
|
<result property="templateTypeId" column="template_type_id" jdbcType="VARCHAR"/>
|
||||||
|
<result property="typeMerge" column="type_merge" jdbcType="VARCHAR"/>
|
||||||
<result property="pkGlorgbook" column="pk_glorgbook" jdbcType="VARCHAR"/>
|
<result property="pkGlorgbook" column="pk_glorgbook" jdbcType="VARCHAR"/>
|
||||||
<result property="glOrgbookCode" column="gl_orgbook_code" jdbcType="VARCHAR"/>
|
<result property="glOrgbookCode" column="gl_orgbook_code" jdbcType="VARCHAR"/>
|
||||||
<result property="glOrgbookName" column="gl_orgbook_name" jdbcType="VARCHAR"/>
|
<result property="glOrgbookName" column="gl_orgbook_name" jdbcType="VARCHAR"/>
|
||||||
|
@ -68,6 +69,7 @@
|
||||||
id
|
id
|
||||||
,mdm_id
|
,mdm_id
|
||||||
,template_type_id
|
,template_type_id
|
||||||
|
,type_merge
|
||||||
,pk_glorgbook
|
,pk_glorgbook
|
||||||
,gl_orgbook_code
|
,gl_orgbook_code
|
||||||
,gl_orgbook_name
|
,gl_orgbook_name
|
||||||
|
@ -134,6 +136,7 @@
|
||||||
<if test="id != null">and id = #{id}</if>
|
<if test="id != null">and id = #{id}</if>
|
||||||
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
||||||
<if test="templateTypeId != null and templateTypeId != ''">and template_type_id = #{templateTypeId}</if>
|
<if test="templateTypeId != null and templateTypeId != ''">and template_type_id = #{templateTypeId}</if>
|
||||||
|
<if test="typeMerge != null and typeMerge != ''">and type_merge = #{typeMerge}</if>
|
||||||
<if test="pkGlorgbook != null and pkGlorgbook != ''">and pk_glorgbook = #{pkGlorgbook}</if>
|
<if test="pkGlorgbook != null and pkGlorgbook != ''">and pk_glorgbook = #{pkGlorgbook}</if>
|
||||||
<if test="glOrgbookCode != null and glOrgbookCode != ''">and gl_orgbook_code = #{glOrgbookCode}</if>
|
<if test="glOrgbookCode != null and glOrgbookCode != ''">and gl_orgbook_code = #{glOrgbookCode}</if>
|
||||||
<if test="glOrgbookName != null and glOrgbookName != ''">and gl_orgbook_name = #{glOrgbookName}</if>
|
<if test="glOrgbookName != null and glOrgbookName != ''">and gl_orgbook_name = #{glOrgbookName}</if>
|
||||||
|
@ -221,6 +224,7 @@
|
||||||
<if test="id != null">and id = #{id}</if>
|
<if test="id != null">and id = #{id}</if>
|
||||||
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
<if test="mdmId != null and mdmId != ''">and mdm_id = #{mdmId}</if>
|
||||||
<if test="templateTypeId != null and templateTypeId != ''">and template_type_id = #{templateTypeId}</if>
|
<if test="templateTypeId != null and templateTypeId != ''">and template_type_id = #{templateTypeId}</if>
|
||||||
|
<if test="typeMerge != null and typeMerge != ''">and type_merge = #{typeMerge}</if>
|
||||||
<if test="pkGlorgbook != null and pkGlorgbook != ''">and pk_glorgbook = #{pkGlorgbook}</if>
|
<if test="pkGlorgbook != null and pkGlorgbook != ''">and pk_glorgbook = #{pkGlorgbook}</if>
|
||||||
<if test="glOrgbookCode != null and glOrgbookCode != ''">and gl_orgbook_code = #{glOrgbookCode}</if>
|
<if test="glOrgbookCode != null and glOrgbookCode != ''">and gl_orgbook_code = #{glOrgbookCode}</if>
|
||||||
<if test="glOrgbookName != null and glOrgbookName != ''">and gl_orgbook_name = #{glOrgbookName}</if>
|
<if test="glOrgbookName != null and glOrgbookName != ''">and gl_orgbook_name = #{glOrgbookName}</if>
|
||||||
|
@ -310,6 +314,7 @@
|
||||||
<if test="id != null">and id like concat('%',#{id},'%')</if>
|
<if test="id != null">and id like concat('%',#{id},'%')</if>
|
||||||
<if test="mdmId != null and mdmId != ''">and mdm_id like concat('%',#{mdmId},'%')</if>
|
<if test="mdmId != null and mdmId != ''">and mdm_id like concat('%',#{mdmId},'%')</if>
|
||||||
<if test="templateTypeId != null and templateTypeId != ''">and template_type_id like concat('%',#{templateTypeId},'%')</if>
|
<if test="templateTypeId != null and templateTypeId != ''">and template_type_id like concat('%',#{templateTypeId},'%')</if>
|
||||||
|
<if test="typeMerge != null and typeMerge != ''">and type_merge like concat('%',#{typeMerge},'%')</if>
|
||||||
<if test="pkGlorgbook != null and pkGlorgbook != ''">and pk_glorgbook like concat('%',#{pkGlorgbook},'%')
|
<if test="pkGlorgbook != null and pkGlorgbook != ''">and pk_glorgbook like concat('%',#{pkGlorgbook},'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="glOrgbookCode != null and glOrgbookCode != ''">and gl_orgbook_code like
|
<if test="glOrgbookCode != null and glOrgbookCode != ''">and gl_orgbook_code like
|
||||||
|
@ -446,6 +451,7 @@
|
||||||
<if test="id != null">or id = #{id}</if>
|
<if test="id != null">or id = #{id}</if>
|
||||||
<if test="mdmId != null and mdmId != ''">or mdm_id = #{mdmId}</if>
|
<if test="mdmId != null and mdmId != ''">or mdm_id = #{mdmId}</if>
|
||||||
<if test="templateTypeId != null and templateTypeId != ''">or template_type_id = #{templateTypeId}</if>
|
<if test="templateTypeId != null and templateTypeId != ''">or template_type_id = #{templateTypeId}</if>
|
||||||
|
<if test="typeMerge != null and typeMerge != ''">or type_merge = #{typeMerge}</if>
|
||||||
<if test="pkGlorgbook != null and pkGlorgbook != ''">or pk_glorgbook = #{pkGlorgbook}</if>
|
<if test="pkGlorgbook != null and pkGlorgbook != ''">or pk_glorgbook = #{pkGlorgbook}</if>
|
||||||
<if test="glOrgbookCode != null and glOrgbookCode != ''">or gl_orgbook_code = #{glOrgbookCode}</if>
|
<if test="glOrgbookCode != null and glOrgbookCode != ''">or gl_orgbook_code = #{glOrgbookCode}</if>
|
||||||
<if test="glOrgbookName != null and glOrgbookName != ''">or gl_orgbook_name = #{glOrgbookName}</if>
|
<if test="glOrgbookName != null and glOrgbookName != ''">or gl_orgbook_name = #{glOrgbookName}</if>
|
||||||
|
@ -532,6 +538,7 @@
|
||||||
<if test="id != null">id ,</if>
|
<if test="id != null">id ,</if>
|
||||||
<if test="mdmId != null and mdmId != ''">mdm_id ,</if>
|
<if test="mdmId != null and mdmId != ''">mdm_id ,</if>
|
||||||
<if test="templateTypeId != null and templateTypeId != ''">template_type_id ,</if>
|
<if test="templateTypeId != null and templateTypeId != ''">template_type_id ,</if>
|
||||||
|
<if test="typeMerge != null and typeMerge != ''">type_merge ,</if>
|
||||||
<if test="pkGlorgbook != null and pkGlorgbook != ''">pk_glorgbook ,</if>
|
<if test="pkGlorgbook != null and pkGlorgbook != ''">pk_glorgbook ,</if>
|
||||||
<if test="glOrgbookCode != null and glOrgbookCode != ''">gl_orgbook_code ,</if>
|
<if test="glOrgbookCode != null and glOrgbookCode != ''">gl_orgbook_code ,</if>
|
||||||
<if test="glOrgbookName != null and glOrgbookName != ''">gl_orgbook_name ,</if>
|
<if test="glOrgbookName != null and glOrgbookName != ''">gl_orgbook_name ,</if>
|
||||||
|
@ -600,6 +607,7 @@
|
||||||
<if test="id != null">#{id} ,</if>
|
<if test="id != null">#{id} ,</if>
|
||||||
<if test="mdmId != null and mdmId != ''">#{mdmId} ,</if>
|
<if test="mdmId != null and mdmId != ''">#{mdmId} ,</if>
|
||||||
<if test="templateTypeId != null and templateTypeId != ''">#{templateTypeId} ,</if>
|
<if test="templateTypeId != null and templateTypeId != ''">#{templateTypeId} ,</if>
|
||||||
|
<if test="typeMerge != null and typeMerge != ''">#{typeMerge} ,</if>
|
||||||
<if test="pkGlorgbook != null and pkGlorgbook != ''">#{pkGlorgbook} ,</if>
|
<if test="pkGlorgbook != null and pkGlorgbook != ''">#{pkGlorgbook} ,</if>
|
||||||
<if test="glOrgbookCode != null and glOrgbookCode != ''">#{glOrgbookCode} ,</if>
|
<if test="glOrgbookCode != null and glOrgbookCode != ''">#{glOrgbookCode} ,</if>
|
||||||
<if test="glOrgbookName != null and glOrgbookName != ''">#{glOrgbookName} ,</if>
|
<if test="glOrgbookName != null and glOrgbookName != ''">#{glOrgbookName} ,</if>
|
||||||
|
@ -762,6 +770,7 @@
|
||||||
<trim suffix="" suffixOverrides=",">
|
<trim suffix="" suffixOverrides=",">
|
||||||
<if test="mdmId != null and mdmId != ''">mdm_id = #{mdmId},</if>
|
<if test="mdmId != null and mdmId != ''">mdm_id = #{mdmId},</if>
|
||||||
<if test="templateTypeId != null and templateTypeId != ''">template_type_id = #{templateTypeId},</if>
|
<if test="templateTypeId != null and templateTypeId != ''">template_type_id = #{templateTypeId},</if>
|
||||||
|
<if test="typeMerge != null and typeMerge != ''">type_merge = #{typeMerge},</if>
|
||||||
<if test="pkGlorgbook != null and pkGlorgbook != ''">pk_glorgbook = #{pkGlorgbook},</if>
|
<if test="pkGlorgbook != null and pkGlorgbook != ''">pk_glorgbook = #{pkGlorgbook},</if>
|
||||||
<if test="glOrgbookCode != null and glOrgbookCode != ''">gl_orgbook_code = #{glOrgbookCode},</if>
|
<if test="glOrgbookCode != null and glOrgbookCode != ''">gl_orgbook_code = #{glOrgbookCode},</if>
|
||||||
<if test="glOrgbookName != null and glOrgbookName != ''">gl_orgbook_name = #{glOrgbookName},</if>
|
<if test="glOrgbookName != null and glOrgbookName != ''">gl_orgbook_name = #{glOrgbookName},</if>
|
||||||
|
|
|
@ -24,6 +24,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -50,9 +52,6 @@ public class AeConfVoucherTemplateServiceImpl extends BaseService<AeConfVoucherT
|
||||||
@Autowired
|
@Autowired
|
||||||
private IAeConfVoucherTemplateAssistService templateAssistService;
|
private IAeConfVoucherTemplateAssistService templateAssistService;
|
||||||
|
|
||||||
private StringBuffer sb = new StringBuffer();
|
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public void setAeConfVoucherTemplateDao(IAeConfVoucherTemplateDao dao) {
|
public void setAeConfVoucherTemplateDao(IAeConfVoucherTemplateDao dao) {
|
||||||
this.templateDao = dao;
|
this.templateDao = dao;
|
||||||
|
@ -258,7 +257,32 @@ public class AeConfVoucherTemplateServiceImpl extends BaseService<AeConfVoucherT
|
||||||
|
|
||||||
String[] parts = abstractRes.split("\\+");
|
String[] parts = abstractRes.split("\\+");
|
||||||
for (String part : parts) {
|
for (String part : parts) {
|
||||||
sb.append(part);
|
|
||||||
|
//判断substr公式
|
||||||
|
if (part.startsWith("substr(")) {
|
||||||
|
|
||||||
|
// 定义正则表达式模式
|
||||||
|
String regex = "substr\\(([^(),]+|([^()]*\\([^()]*\\)[^()]*)*),\\s*(\\d+),\\s*(\\d+)\\)";
|
||||||
|
Pattern pattern = Pattern.compile(regex);
|
||||||
|
Matcher matcher = pattern.matcher(part);
|
||||||
|
if (matcher.find()) {
|
||||||
|
String param1 = matcher.group(1);
|
||||||
|
String param2 = matcher.group(3);
|
||||||
|
String param3 = matcher.group(4);
|
||||||
|
if (param1 == null || param2 == null || param3 == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (param1.startsWith("@@$")) {
|
||||||
|
String fieldPath = param1.substring(3); // 去除 @@$
|
||||||
|
if (!isValidFieldPath(entity.getMdmId(), fieldPath)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (part.startsWith("@@$")) {
|
if (part.startsWith("@@$")) {
|
||||||
String fieldPath = part.substring(3); // 去除 @@$
|
String fieldPath = part.substring(3); // 去除 @@$
|
||||||
if (!isValidFieldPath(entity.getMdmId(), fieldPath)) {
|
if (!isValidFieldPath(entity.getMdmId(), fieldPath)) {
|
||||||
|
@ -499,7 +523,6 @@ public class AeConfVoucherTemplateServiceImpl extends BaseService<AeConfVoucherT
|
||||||
|
|
||||||
|
|
||||||
private void transformAbstract(AeConfVoucherTemplateEntity entity) {
|
private void transformAbstract(AeConfVoucherTemplateEntity entity) {
|
||||||
sb.delete(0, sb.length());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue