Commit 6ca280b9 by hulei

汇款多实体改造

parent 84c47ebd
...@@ -30,4 +30,6 @@ public interface EtyMapper { ...@@ -30,4 +30,6 @@ public interface EtyMapper {
Ety getEtyByExtkey(String extkey); Ety getEtyByExtkey(String extkey);
List<Ety> selectAll();
} }
\ No newline at end of file
package com.brilliance.isc.mda.dao; package com.brilliance.isc.mda.dao;
import com.brilliance.isc.bo.Bch;
import com.brilliance.isc.bo.Pty; import com.brilliance.isc.bo.Pty;
import com.brilliance.isc.vo.manager.PtyManageVo; import com.brilliance.isc.vo.manager.PtyManageVo;
import com.brilliance.isc.vo.manager.PtyTVo; import com.brilliance.isc.vo.manager.PtyTVo;
...@@ -333,5 +332,7 @@ public interface PtyMapper { ...@@ -333,5 +332,7 @@ public interface PtyMapper {
int updatePtySigflg(@Param("sigflg") String sigflg, @Param("inr") String inr); int updatePtySigflg(@Param("sigflg") String sigflg, @Param("inr") String inr);
List<Pty> selectInfoByExtkeyOrNamOrNam1(@Param("extkey") String extkey,@Param("nam1") String nam1,@Param("nam") String nam); List<Pty> selectInfoByExtkeyOrNamOrNam1(@Param("extkey") String extkey,@Param("nam1") String nam1,@Param("nam") String nam);
Pty queryOwnPty(@Param("extkey") String extkey,@Param("etgextkey") String etgextkey);
} }
\ No newline at end of file
...@@ -194,6 +194,12 @@ ...@@ -194,6 +194,12 @@
where trim(extkey) = trim(#{extkey,jdbcType=VARCHAR}) where trim(extkey) = trim(#{extkey,jdbcType=VARCHAR})
</select> </select>
<select id="selectAll" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List" />
FROM ety WHERE ety.ETG in (select etg.extkey from etg)
</select>
</mapper> </mapper>
...@@ -38,11 +38,13 @@ ...@@ -38,11 +38,13 @@
where inr = #{inr,jdbcType=VARCHAR} where inr = #{inr,jdbcType=VARCHAR}
</select> </select>
<!-- TODO 多实体改造 -->
<select id="selectByCod" resultMap="BaseResultMap"> <select id="selectByCod" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from fee from fee
where cod = #{cod,jdbcType=VARCHAR} where cod = #{cod,jdbcType=VARCHAR}
</select> </select>
<delete id="deleteByPrimaryKey"> <delete id="deleteByPrimaryKey">
......
...@@ -1158,6 +1158,17 @@ ...@@ -1158,6 +1158,17 @@
and nam like concat('%',#{nam},'%') and nam like concat('%',#{nam},'%')
</if> </if>
</select> </select>
<select id="queryOwnPty" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from pty
where extkey = #{extkey}
and etgextkey = #{etgextkey}
and ptytyp = 'BA'
</select>
</mapper> </mapper>
package com.brilliance.isc.common.cache.pty; package com.brilliance.isc.common.cache.pty;
import cn.hutool.core.collection.CollUtil;
import com.brilliance.isc.bo.Ety;
import com.brilliance.isc.bo.Pty; import com.brilliance.isc.bo.Pty;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.mda.dao.EtyMapper;
import com.brilliance.isc.mda.dao.PtyMapper; import com.brilliance.isc.mda.dao.PtyMapper;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -10,6 +14,8 @@ import org.springframework.data.redis.core.RedisTemplate; ...@@ -10,6 +14,8 @@ import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@Service @Service
...@@ -23,7 +29,7 @@ public class PtyCacheServiceImpl implements PtyCacheService { ...@@ -23,7 +29,7 @@ public class PtyCacheServiceImpl implements PtyCacheService {
private static final TimeUnit EXPIRETYPE = TimeUnit.SECONDS; private static final TimeUnit EXPIRETYPE = TimeUnit.SECONDS;
private static Pty ownPty = null; // private static Pty ownPty = null;
@Autowired @Autowired
@Qualifier("jacksonRedisTemplate") @Qualifier("jacksonRedisTemplate")
...@@ -32,17 +38,26 @@ public class PtyCacheServiceImpl implements PtyCacheService { ...@@ -32,17 +38,26 @@ public class PtyCacheServiceImpl implements PtyCacheService {
@Autowired @Autowired
private PtyMapper ptyMapper; private PtyMapper ptyMapper;
@Autowired
private EtyMapper etyMapper;
private List<Ety> etyList;
@PostConstruct @PostConstruct
public void initOwnPty() { public void initOwnPty() {
ownPty = ptyMapper.queryDetailByExtkey("EVERCNBJXXX"); etyList = etyMapper.selectAll();
//验证环境 bic第8位都改成了0 if(CollUtil.isEmpty(etyList)){
if (ownPty == null) { throw new RuntimeException("ETY,ETG实体信息表中应至少有一条实体信息配置!");
ownPty = ptyMapper.queryDetailByExtkey("EVERCNB0XXX");
} }
} }
public Pty getOwnPty() { public Pty getOwnPty() {
return ownPty; String etgextkey = SettleContext.getUserEtg().getExtkey();
Optional<Ety> op = etyList.stream().filter(e->etgextkey.equalsIgnoreCase(e.getEtg())).findFirst();
if(op.isPresent()){
Ety ety = op.get();
return ptyMapper.queryOwnPty(ety.getOwnbic(),ety.getEtg());
}
throw new RuntimeException("请检查PTY表是否正确配置了ETG["+etgextkey+"]对应信息!");
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment