Răsfoiți Sursa

电签配置库

lvy 2 luni în urmă
părinte
comite
83c47c55f5

+ 3 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/SignConfigMapper.xml

@@ -68,8 +68,9 @@
             and a.e_name like concat('%',#{keyword},'%')
         </if>
     </select>
-    <select id="getConfigByENames" resultType="org.springblade.manager.vo.SignConfigVO">
-        select a.id,a.e_name,a.e_id,a.e_key,a.table_type,a.element_type,a.tenant_id,a.create_user,a.create_dept,a.create_time,a.update_user,a.update_time,a.status,a.is_deleted
+    <select id="getConfigByENames" resultMap="signConfigVO">
+        select a.id,a.e_name,a.e_id,a.e_key,a.table_type,a.element_type,a.tenant_id,a.create_user,a.create_dept,a.create_time,a.update_user,a.update_time,a.status,a.is_deleted,
+               b.id,b.conf_id,b.type,b.relation_type,b.relation_id,b.relation_name,b.create_user,b.create_dept,b.create_time,b.update_user,b.update_time,b.status,b.is_deleted
         from m_sign_config a LEFT JOIN m_sign_config_relation b
             on a.id = b.conf_id WHERE a.`status` = 1 and a.is_deleted = 0 and b.is_deleted = 0
         <if test="names != null">

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/TextdictInfoMapper.xml

@@ -44,7 +44,7 @@
         select  *,(SELECT parent_id from blade_role c where c.id=b.sig_role_id) as parentRoleId from m_textdict_info b where is_deleted = 0 and id=#{id}
     </select>
 
-    <select id="selectTextdictInfoByExcelId" resultMap="textdictInfoResultMap">
+    <select id="selectTextdictInfoByExcelId" resultMap="textdictInfoVoResultMap">
         SELECT a.* from m_textdict_info a,
                         (select tab_id,count(1) from m_textdict_info where is_deleted = 0 and type in('2','6') and excel_id=#{param2.excelId} GROUP BY tab_id ORDER BY count(tab_id) desc LIMIT 1) b
         where a.tab_id=b.tab_id and a.is_deleted = 0 and a.type in('2','6') and a.excel_id=#{param2.excelId}

+ 9 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/SignConfigServiceImpl.java

@@ -25,6 +25,7 @@ import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.StringUtil;
 import org.springblade.manager.dto.SignConfigDTO;
 import org.springblade.manager.entity.SignConfig;
@@ -308,7 +309,7 @@ public class SignConfigServiceImpl extends BaseServiceImpl<SignConfigMapper, Sig
             return textdictInfoVOS;
         }
         List<WbsFormElement> list = this.wbsFormElementMapper.selectList(Wrappers.<WbsFormElement>lambdaQuery().select(WbsFormElement::getEName, WbsFormElement::getEKey)
-                .eq(WbsFormElement::getFId, tableInfos.get(0)).in(WbsFormElement::getEKey, keyMap.keySet()));
+                .eq(WbsFormElement::getFId, tableInfos.get(0).getId()).in(WbsFormElement::getEKey, keyMap.keySet()));
         if (list == null || list.isEmpty()) {
             return textdictInfoVOS;
         }
@@ -374,6 +375,12 @@ public class SignConfigServiceImpl extends BaseServiceImpl<SignConfigMapper, Sig
 
     @Override
     public boolean deleteLogic(@NotEmpty List<Long> ids) {
-        return super.deleteLogic(ids);
+        if (!ids.isEmpty()) {
+            transactionTemplate.execute(status -> {
+                super.deleteLogic(ids);
+                return signConfigRelationService.remove(Wrappers.<SignConfigRelation>lambdaQuery().in(SignConfigRelation::getConfId, ids));
+            });
+        }
+        return true;
     }
 }

+ 10 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/TextdictInfoServiceImpl.java

@@ -85,7 +85,7 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
                 }else{
                     textdict = baseMapper.selectTextdictInfoByExcelId(page, textdictInfo);
                 }
-                if (textdict != null && !textdict.isEmpty()) {
+                if (textdict != null && !keys.isEmpty()) {
                     for (TextdictInfoVO vo : textdict) {
                         if (!(privateInfo.getPKeyId() + "").equals(vo.getTabId())) {
                             vo.setIsSystem(1);
@@ -94,7 +94,15 @@ public class TextdictInfoServiceImpl extends ServiceImpl<TextdictInfoMapper, Tex
                     }
                     if (Func.isNotEmpty(keys)) {
                         // 查询系统级电签配置
-                        List<TextdictInfoVO> textdictList = iSignConfigService.hasSignConfig(privateInfo.getInitTableName(), keys, textdict.get(0));
+                        TextdictInfoVO temp = textdict.stream().findFirst().orElse(null);
+                        if (temp == null) {
+                            temp = new TextdictInfoVO();
+                            temp.setProjectId(privateInfo.getProjectId());
+                            temp.setExcelId(privateInfo.getExcelId() + "");
+                            temp.setTabId(privateInfo.getPKeyId() + "");
+                            temp.setType(2);
+                        }
+                        List<TextdictInfoVO> textdictList = iSignConfigService.hasSignConfig(privateInfo.getInitTableName(), keys, temp);
                         textdict.addAll(textdictList);
                     }
                 }