Commit 6ca280b9 by hulei

汇款多实体改造

parent 84c47ebd
......@@ -30,4 +30,6 @@ public interface EtyMapper {
Ety getEtyByExtkey(String extkey);
List<Ety> selectAll();
}
\ No newline at end of file
package com.brilliance.isc.mda.dao;
import com.brilliance.isc.bo.Bch;
import com.brilliance.isc.bo.Pty;
import com.brilliance.isc.vo.manager.PtyManageVo;
import com.brilliance.isc.vo.manager.PtyTVo;
......@@ -333,5 +332,7 @@ public interface PtyMapper {
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 @@
where trim(extkey) = trim(#{extkey,jdbcType=VARCHAR})
</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>
......@@ -38,11 +38,13 @@
where inr = #{inr,jdbcType=VARCHAR}
</select>
<!-- TODO 多实体改造 -->
<select id="selectByCod" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from fee
where cod = #{cod,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey">
......
......@@ -1158,6 +1158,17 @@
and nam like concat('%',#{nam},'%')
</if>
</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>
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.common.context.SettleContext;
import com.brilliance.isc.mda.dao.EtyMapper;
import com.brilliance.isc.mda.dao.PtyMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -10,6 +14,8 @@ import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
@Service
......@@ -23,7 +29,7 @@ public class PtyCacheServiceImpl implements PtyCacheService {
private static final TimeUnit EXPIRETYPE = TimeUnit.SECONDS;
private static Pty ownPty = null;
// private static Pty ownPty = null;
@Autowired
@Qualifier("jacksonRedisTemplate")
......@@ -32,17 +38,26 @@ public class PtyCacheServiceImpl implements PtyCacheService {
@Autowired
private PtyMapper ptyMapper;
@Autowired
private EtyMapper etyMapper;
private List<Ety> etyList;
@PostConstruct
public void initOwnPty() {
ownPty = ptyMapper.queryDetailByExtkey("EVERCNBJXXX");
//验证环境 bic第8位都改成了0
if (ownPty == null) {
ownPty = ptyMapper.queryDetailByExtkey("EVERCNB0XXX");
etyList = etyMapper.selectAll();
if(CollUtil.isEmpty(etyList)){
throw new RuntimeException("ETY,ETG实体信息表中应至少有一条实体信息配置!");
}
}
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
......
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