Browse Source

1.资金账户同编号保存报错修改

heqinwei 7 years ago
parent
commit
719061de9d

+ 2 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/BankinformationMapper.java

@@ -3,6 +3,7 @@ package com.usoftchina.saas.document.mapper;
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.commons.dto.ComboDTO;
 import com.usoftchina.saas.document.entities.Bankinformation;
+import com.usoftchina.saas.page.PageDefault;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -25,7 +26,7 @@ public interface BankinformationMapper extends CommonBaseMapper<Bankinformation>
 
     List<ComboDTO> getCombo(@Param("companyId") Long companyId);
     String selectBankcode(@Param("bk_bankcode") String bk_bankcode, @Param("companyId") Long companyId);
-    Long selectBankId(String bk_bankcode);
+    Long selectBankId(@Param("bk_bankcode") String bk_bankcode, @Param("companyId") Long companyId);
 
     void check(Map<String, Object> map);
 

+ 1 - 1
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BankinformationServiceImpl.java

@@ -95,7 +95,7 @@ public class BankinformationServiceImpl extends CommonBaseServiceImpl<Bankinform
                 }
             }
 
-            Long id = bankinformationMapper.selectBankId(bankinformation.getBk_bankcode());
+            Long id = bankinformationMapper.selectBankId(bankinformation.getBk_bankcode(), BaseContextHolder.getCompanyId());
             if (bktion != null){
                 if (id.equals(bankinformation.getId())){
                     bankinformationMapper.updateByPrimaryKeySelective(bankinformation);

+ 2 - 2
applications/document/document-server/src/main/resources/mapper/BankinformationMapper.xml

@@ -329,8 +329,8 @@
         bk_bankcode = #{bk_bankcode,jdbcType=VARCHAR} and companyId = #{companyId}
     </select>
 
-  <select id="selectBankId" parameterType="java.lang.String" resultType="java.lang.Long">
-        select bk_id from bankinformation where bk_bankcode = #{bk_bankcode,jdbcType=VARCHAR}
+  <select id="selectBankId" resultType="java.lang.Long">
+        select bk_id from bankinformation where bk_bankcode = #{bk_bankcode,jdbcType=VARCHAR} and companyId = #{companyId}
    </select>
 
   <select id="selectamount" parameterType="java.lang.Long" resultType="java.lang.Double">