Commit 868158c7 by hulei

merge from develop

parents c448dc33 a1b61a54
......@@ -59,6 +59,18 @@ public class FxdBizInfoVo extends BizInfoVo {
//fxdgrp.rec.setdat
private Date setdat = NULLDATE;
private Date valdat =NULLDATE;
private Date valdat = NULLDATE;
/**
* 交易主体
* #see com.brilliance.isc.common.setgll.service.impl.SetgllServiceImpl#calcTrdinoutAndTrnman
*/
private String dfkhlb = NULLSTR;
/**
* trdint/trdout
* #see com.brilliance.isc.common.setgll.service.impl.SetgllServiceImpl#calcTrdinoutAndTrnman
*/
private String waitjm = NULLSTR;
}
......@@ -133,6 +133,8 @@ public class PtyManageVo extends BaseEntity {
private String ptabchkeyinr;
private String ptabchkey;
private String ptabchkeyname;
//风险等级
private String rskcls;
// 更新后管户机构
private String newbchlst;
......@@ -180,6 +182,14 @@ public class PtyManageVo extends BaseEntity {
//crm数据
private Ptycrm ptycrm;
public String getRsrcls() {
return rskcls;
}
public void setRskcls(String rskcls) {
this.rskcls = rskcls;
}
public Ptycrm getPtycrm() {
return ptycrm;
}
......@@ -187,6 +197,7 @@ public class PtyManageVo extends BaseEntity {
public void setPtycrm(final Ptycrm ptycrm) {
this.ptycrm = ptycrm;
}
public String getOitinr() {
return oitinr;
}
......
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.Usr;
import com.brilliance.isc.common.context.SettleContext;
import com.brilliance.isc.common.util.StringUtils;
import com.brilliance.isc.mda.dao.EtyMapper;
import com.brilliance.isc.mda.dao.PtyMapper;
import org.slf4j.Logger;
......@@ -12,10 +13,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import javax.annotation.PostConstruct;
import java.util.List;
import java.util.Optional;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
@Service
......@@ -41,23 +41,22 @@ public class PtyCacheServiceImpl implements PtyCacheService {
@Autowired
private EtyMapper etyMapper;
private List<Ety> etyList;
@PostConstruct
public void initOwnPty() {
etyList = etyMapper.selectAll();
if(CollUtil.isEmpty(etyList)){
throw new RuntimeException("ETY,ETG实体信息表中应至少有一条实体信息配置!");
public Pty getOwnPty() {
Ety ety = SettleContext.getUserEty();
if(Objects.isNull(ety)){
Usr usr = SettleContext.getUserSession().getUsr();
if (Objects.nonNull(usr) && StringUtils.isNotEmpty(usr.getEtyextkey())) {
ety = etyMapper.getEtyByExtkey(usr.getEtyextkey());
}
}
public Pty getOwnPty() {
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+"]对应信息!");
String message = String.format("请检查Usr、ETY表,确保正确配置实体信息!");
Assert.hasText(ety.getEtg(), message);
Assert.hasText(ety.getOwnbic(), message);
Pty ownPty = ptyMapper.queryOwnPty(ety.getOwnbic(),ety.getEtg());
Assert.notNull(ownPty, String.format("请检查PTY表是否正确配置了当前实体etgextkey:[%s]BA类型的PTY信息!",ety.getEtg()));
return ownPty;
}
@Override
......
......@@ -43,7 +43,7 @@ public class CbsRange {
String sql = "";
sql += " WHERE FEEINR = '" + feeinr + "'";
sql += " AND FEEPRI = '" + feepri + "'";
sql += " AND date_format(BEGDAT, '%y%m%d') <= " + Utils.dbSqlDate(dat) + " AND date_format(ENDDAT, '%y%m%d') > " + Utils.dbSqlDate(dat) + " ";
sql += " AND BEGDAT <= " + Utils.dbSqlDate(dat) + " AND ENDDAT > " + Utils.dbSqlDate(dat) + " ";
List<Fec> fecList = fecMapper.selectFecByConditionSql(sql);
if (fecList != null && fecList.size() > 0) {
BeanUtils.copyProperties(fecList.get(0), fec); //需要深拷贝,不然调用得到的对象指向的还是原来的地址
......@@ -65,7 +65,7 @@ public class CbsRange {
sql += " AND FEEPRI = '" + feepri + "'";
sql += " AND OBJTYP = '" + objTyp + "'";
sql += " AND OBJINR = '" + objInr + "'";
sql += " AND date_format(BEGDAT, '%y%m%d') <= " + Utils.dbSqlDate(dat) + " AND date_format(ENDDAT, '%y%m%d') > " + Utils.dbSqlDate(dat) + " ";
sql += " AND BEGDAT <= " + Utils.dbSqlDate(dat) + " AND ENDDAT > " + Utils.dbSqlDate(dat) + " ";
List<Fec> fecList = fecMapper.selectFecByConditionSql(sql);
if (fecList != null && fecList.size() > 0) {
BeanUtils.copyProperties(fecList.get(0), fec); //需要深拷贝,不然调用得到的对象指向的还是原来的地址
......@@ -85,7 +85,7 @@ public class CbsRange {
sql += " WHERE CUR = '" + cur + "'";
sql += " AND OBJTYP = '" + objTyp + "'";
sql += " AND OBJINR = '" + objInr + "'";
sql += " AND date_format(BEGDAT, '%y%m%d') <= " + Utils.dbSqlDate(dat) + " AND date_format(ENDDAT, '%y%m%d') > " + Utils.dbSqlDate(dat) + " ";
sql += " AND BEGDAT <= " + Utils.dbSqlDate(dat) + " AND ENDDAT > " + Utils.dbSqlDate(dat) + " ";
List<Irs> irsList = irsMapper.selectIrsByConditionSql(sql);
if (irsList != null && irsList.size() > 0) {
BeanUtils.copyProperties(irsList.get(0), irs); //需要深拷贝,不然调用得到的对象指向的还是原来的地址
......@@ -108,7 +108,7 @@ public class CbsRange {
sql += " AND EXTID = '" + extid + "'";
sql += " AND OBJTYP = '" + objTyp + "'";
sql += " AND OBJINR = '" + objInr + "'";
sql += " AND date_format(BEGDAT, '%y%m%d') <= " + Utils.dbSqlDate(dat) + " AND date_format(ENDDAT, '%y%m%d') > " + Utils.dbSqlDate(dat) + " ";
sql += " AND BEGDAT <= " + Utils.dbSqlDate(dat) + " AND ENDDAT > " + Utils.dbSqlDate(dat) + " ";
List<Cbb> cbbList = cbbMapper.getCbbByContiditionSql(sql);
if (cbbList != null && cbbList.size() > 0) {
BeanUtils.copyProperties(cbbList.get(0), cbb); //需要深拷贝,不然调用得到的对象指向的还是原来的地址
......@@ -124,7 +124,7 @@ public class CbsRange {
String cur = xrt.getCur();
String sql = "";
sql += " WHERE CUR = '" + cur + "'";
sql += " AND date_format(BEGDAT, '%y%m%d') <= " + Utils.dbSqlDate(dat) + " AND date_format(ENDDAT, '%y%m%d') > " + Utils.dbSqlDate(dat) + " ";
sql += " AND BEGDAT <= " + Utils.dbSqlDate(dat) + " AND ENDDAT > " + Utils.dbSqlDate(dat) + " ";
sql = Utils.sdbEtyGenSql("XRT",sql);
List<Xrt> xrtList = xrtMapper.getXrtByConditionSql(sql);
if (xrtList != null && xrtList.size() > 0) {
......@@ -140,7 +140,7 @@ public class CbsRange {
String cur = xrt.getCur();
String sql = "";
sql += " WHERE CUR = '" + cur + "'";
sql += " AND date_format(BEGDAT, '%y%m%d') <= " + Utils.dbSqlDate(dat) + " AND date_format(ENDDAT, '%y%m%d') > " + Utils.dbSqlDate(dat) + " ";
sql += " AND BEGDAT <= " + Utils.dbSqlDate(dat) + " AND ENDDAT > " + Utils.dbSqlDate(dat) + " ";
List<Zmqxrt> zmqxrtList = zmqxrtMapper.getZmqxrtByConditionSql(sql);
if (zmqxrtList != null && zmqxrtList.size() > 0) {
BeanUtils.copyProperties(zmqxrtList.get(0), xrt); //需要深拷贝,不然调用得到的对象指向的还是原来的地址
......@@ -170,7 +170,7 @@ public class CbsRange {
if (endDate == null || Dates.diff(endDate, maxDate) > 0) {
endDate = maxDate;
}
sql += " AND date_format(BEGDAT, '%y%m%d') <= " + Utils.dbSqlDate(beginDate) + " AND date_format(ENDDAT, '%y%m%d') > " + Utils.dbSqlDate(beginDate) + " ";
sql += " AND BEGDAT <= " + Utils.dbSqlDate(beginDate) + " AND ENDDAT > " + Utils.dbSqlDate(beginDate) + " ";
Cbb lastCbb = getCbbByContiditionSql(sql);
if (lastCbb != null) {
Date endDate2 = lastCbb.getEnddat();
......@@ -219,7 +219,7 @@ public class CbsRange {
if (endDate == null || Dates.diff(endDate, maxDate) > 0) {
endDate = maxDate;
}
sql += " AND date_format(BEGDAT, '%y%m%d') <= " + Utils.dbSqlDate(beginDate) + " AND date_format(ENDDAT, '%y%m%d') > " + Utils.dbSqlDate(beginDate) + " ";
sql += " AND BEGDAT <= " + Utils.dbSqlDate(beginDate) + " AND ENDDAT > " + Utils.dbSqlDate(beginDate) + " ";
Fec lastFec = getFecByContiditionSql(sql);
if (lastFec != null) {
Date endDate2 = lastFec.getEnddat();
......@@ -265,7 +265,7 @@ public class CbsRange {
sql += " AND FEEPRI = '" + feepri + "'";
sql += " AND OBJTYP = '" + objTyp + "'";
sql += " AND OBJINR = '" + objInr + "'";
sql += " AND date_format(ENDDAT, '%y%m%d') = " + Utils.dbSqlDate(beginDate) + "";
sql += " AND ENDDAT = " + Utils.dbSqlDate(beginDate) + "";
/**
* 老国结Inr为8位,新国结为16位并填了0,新国结的inr必定小于老国结的inr
* 但老国结按照逻辑,应该要比新国结小因此加了or
......@@ -293,9 +293,9 @@ public class CbsRange {
sql += " AND OBJTYP = '" + objTyp + "'";
sql += " AND OBJINR = '" + objInr + "'";
if (beginDate == null) {
sql += "AND date_format(BEGDAT, '%y%m%d') >= " + Utils.dbSqlDate(Utils.getMinDate());
sql += "AND BEGDAT >= " + Utils.dbSqlDate(Utils.getMinDate());
} else {
sql += "AND date_format(BEGDAT, '%y%m%d') > " + Utils.dbSqlDate(beginDate);
sql += "AND BEGDAT > " + Utils.dbSqlDate(beginDate);
}
sql += " ORDER BY BEGDAT, INR";
return cbbMapper.getCbbByContiditionSql(sql);
......@@ -313,9 +313,9 @@ public class CbsRange {
sql += " AND OBJTYP = '" + objTyp + "'";
sql += " AND OBJINR = '" + objInr + "'";
if (beginDate == null) {
sql += "AND date_format(BEGDAT, '%y%m%d') >= " + Utils.dbSqlDate(Utils.getMinDate());
sql += "AND BEGDAT >= " + Utils.dbSqlDate(Utils.getMinDate());
} else {
sql += "AND date_format(BEGDAT, '%y%m%d') > " + Utils.dbSqlDate(beginDate);
sql += "AND BEGDAT > " + Utils.dbSqlDate(beginDate);
}
sql += " ORDER BY BEGDAT, INR";
return fecMapper.selectFecByConditionSql(sql);
......@@ -338,9 +338,9 @@ public class CbsRange {
sql = sql + " AND INR > '" + inr + "')";
sql = sql + " OR (BEGDAT IS NOT NULL))";
} else {
sql = sql + " AND ((date_format(BEGDAT, '%y%m%d') = " + Utils.dbSqlDate(beginDate);
sql = sql + " AND ((BEGDAT = " + Utils.dbSqlDate(beginDate);
sql = sql + " AND INR > '" + inr + "' )";
sql = sql + " OR (date_format(BEGDAT, '%y%m%d') > " + Utils.dbSqlDate(beginDate) + "))";
sql = sql + " OR (BEGDAT > " + Utils.dbSqlDate(beginDate) + "))";
}
sql += " ORDER BY BEGDAT, INR";
return cbbMapper.getCbbByContiditionSql(sql);
......@@ -365,7 +365,7 @@ public class CbsRange {
sql += " AND EXTID = '" + extid + "'";
sql += " AND OBJTYP = '" + objTyp + "'";
sql += " AND OBJINR = '" + objInr + "'";
sql += " AND date_format(ENDDAT, '%y%m%d') = " + Utils.dbSqlDate(beginDate) + "";
sql += " AND ENDDAT = " + Utils.dbSqlDate(beginDate) + "";
/**
* 老国结Inr为8位,新国结为16位并填了0,新国结的inr必定小于老国结的inr
* 但老国结按照逻辑,应该要比新国结小因此加了or
......
......@@ -442,9 +442,9 @@ public class Utils {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
StringBuilder builder = new StringBuilder();
//oracle 语法
// builder.append(" to_date('").append(df.format(date)).append("','YYYY-MM-DD')");
builder.append(" to_date('").append(df.format(date)).append("','YYYY-MM-DD')");
//mysql 语法
builder.append(" date_format('").append(df.format(date)).append("','%y%m%d')");
// builder.append(" date_format('").append(df.format(date)).append("','%y%m%d')");
return builder.toString();
}
......
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