package com.sinosoft.lis.realname;
/**
*
* Title: Web业务系统
*
*
* Description: 实名制校验
*
*
* Copyright: Copyright (c) 2020
*
*
* Company: Sinosoft
*
*
* @author wangjianan
*/
import com.sinosoft.lis.db.LCPolDB;
import com.sinosoft.lis.db.LJSGetEndorseDB;
import com.sinosoft.lis.db.LLBalanceDB;
import com.sinosoft.lis.db.LPEdorItemDB;
import com.sinosoft.lis.db.LPPolDB;
import com.sinosoft.lis.i18n.I18nMessage;
import com.sinosoft.lis.pubfun.LDExch;
import com.sinosoft.lis.pubfun.MMap;
import com.sinosoft.lis.sql.realname.RealNameCheckBLSQL;
import com.sinosoft.lis.sql.repository.LPEdorItemSQL;
import com.sinosoft.lis.vschema.LCPersonSet;
import com.sinosoft.lis.vschema.LCPolSet;
import com.sinosoft.lis.vschema.LJSGetEndorseSet;
import com.sinosoft.lis.vschema.LLBalanceSet;
import com.sinosoft.lis.vschema.LPEdorItemSet;
import com.sinosoft.lis.vschema.LPPolSet;
import com.sinosoft.persistence.SQLProxy;
import com.sinosoft.service.BusinessService;
import com.sinosoft.utility.CError;
import com.sinosoft.utility.CErrors;
import com.sinosoft.utility.TransferData;
import com.sinosoft.utility.VData;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class RealNameCheckBL implements BusinessService {
private static final Logger logger = LoggerFactory.getLogger(RealNameCheckBL.class);
/**
* 错误处理类,每个需要错误处理的类中都放置该类
*/
private CErrors mErrors = new CErrors();
/**
* 传入数据的容器
*/
private VData mInputData = new VData();
private LCPersonSet mLCPersonSet = new LCPersonSet();
private TransferData mTransferData = new TransferData();
private String bussType;
private String bussNo;
private String mOperate;
/**
* 往后面传输数据的容器
*/
private VData mResult = new VData();
private List mInputList = new ArrayList<>();
private MMap mMap = new MMap();
public boolean submitData(VData cInputData, String cOperate) {
this.mInputData = (VData) cInputData.clone();
mTransferData= mInputData.get(TransferData.class,0);
this.mOperate = cOperate;
if (!getInputData()) {
return false;
}
if (!dealData()) {
CError tError = new CError();
tError.moduleName = "RealNameCheckBL";
tError.functionName = "dealData";
tError.errorMessage(new I18nMessage("数据处理失败!", "LIS-07126"));
this.mErrors .addOneError(tError);
return false;
}
if (!prepareData()) {
return false;
}
return true;
}
private boolean getInputData() {
try {
bussType = (String) mTransferData.getValueByName("bussType");
bussNo = (String) mTransferData.getValueByName("bussNo");
mInputList = mInputData.get(ArrayList.class, 0);
if (mInputList.size() < 1) {
CError tError = new CError();
tError.moduleName = "RealNameCheckBL";
tError.functionName = "getInputData";
tError.errorMessage(new I18nMessage("接收数据失败!", "LIS-07747"));
this.mErrors.addOneError(tError);
return false;
}
} catch (Exception e) {
// @@错误处理
logger.error("程序执行异常",e);
CError tError = new CError();
tError.moduleName = "RealNameCheckBL";
tError.functionName = "getInputData";
tError.errorMessage(new I18nMessage("接收数据失败!!", "LIS-07747"));
this.mErrors.addOneError(tError);
return false;
}
return true;
}
/**
* 业务处理
*
* @return 如果处理失败,则返回false,否则返回true
*/
private boolean dealData() {
LDExch tLDExch = new LDExch();
RealNameCheckBLSQL sqlRealNameCheckBLSQL = SQLProxy.getInstance(RealNameCheckBLSQL.class);
LPEdorItemSQL sqlLPEdorItemSQL = SQLProxy.getInstance(LPEdorItemSQL.class);
try {
//根据业务类型 和 角色类型 判断
for (int i = 0; i < mInputList.size(); i++) {
if (!"1".equals(mInputList.get(i).getPolType())) {
if (("Appnt").equals(mInputList.get(i).getRole())) {
String intervalDate = "-1";
double money = 0;
double pdMoney = 0;
//当业务类型为 NB和XB时 验证 投保人
if (bussType.equals("NB") ||
bussType.equals("XB")) {
intervalDate = sqlRealNameCheckBLSQL.findIntervalDateFromLCContAndLCPolByContNo(bussNo);
//查询所有险种信息
LCPolDB ttLCPolDB = new LCPolDB();
ttLCPolDB.setContNo(bussNo);
LCPolSet ttLCPolSet = ttLCPolDB.query();
for (int z = 1; z <= ttLCPolSet.size(); z++) {
int payintv = ttLCPolSet.get(z).getPayIntv();
int payyears = ttLCPolSet.get(z).getPayYears();
double prem = ttLCPolSet.get(z).getPrem();
String currency = ttLCPolSet.get(z).getCurrency();
String signDate = ttLCPolSet.get(z).getCValiDate();
money += getAllPremSum(payintv, payyears, prem, currency, signDate);
}
} else if (bussType.equals("NI") ||
bussType.equals("AE") ||
bussType.equals("CM") ||
bussType.equals("AA") ||
bussType.equals("IO") ||
bussType.equals("FM") ||
bussType.equals("NS") ||
bussType.equals("PM") ||
bussType.equals("BC") ||
// 20210111-zhangchaoshuo-insert-增加保全项RR、IC的实名校验
bussType.equals("RR") ||
bussType.equals("IC")) {//当业务类型为保全时,验证 投保人
String contNo = sqlLPEdorItemSQL.findContNoByEdorNo(bussNo);
intervalDate = sqlRealNameCheckBLSQL.findIntervalDateFromLCContAndLCPolByContNo(contNo);
//根据险种类型判断
if (bussType.equals("NI")) {
LPEdorItemDB ttLPEdorItemDB = new LPEdorItemDB();
ttLPEdorItemDB.setEdorType("NI");
ttLPEdorItemDB.setEdorNo(bussNo);
LPEdorItemSet ttLPEdorItemSet = ttLPEdorItemDB.query();
if (ttLPEdorItemSet.size() > 0) {
//查询所有险种信息
LCPolDB ttLCPolDB = new LCPolDB();
ttLCPolDB.setContNo(ttLPEdorItemSet.get(1).getContNo());
LCPolSet ttLCPolSet = ttLCPolDB.query();
for (int z = 1; z <= ttLCPolSet.size(); z++) {
int payintv = ttLCPolSet.get(z).getPayIntv();
int payyears = ttLCPolSet.get(z).getPayYears();
double prem = ttLCPolSet.get(z).getPrem();
String currency = ttLCPolSet.get(z).getCurrency();
String signDate = ttLCPolSet.get(z).getCValiDate();
money += getAllPremSum(payintv, payyears, prem, currency, signDate);
}
money = money + pdMoney;
}
} else if (bussType.equals("AE")) {
//查询保全申请信息
LPEdorItemDB ttLPEdorItemDB = new LPEdorItemDB();
ttLPEdorItemDB.setEdorType(bussType);
ttLPEdorItemDB.setEdorNo(bussNo);
LPEdorItemSet ttLPEdorItemSet = ttLPEdorItemDB.query();
if (ttLPEdorItemSet.size() > 0) {
LPPolDB ttLPPolDB = new LPPolDB();
ttLPPolDB.setEdorNo(ttLPEdorItemSet.get(1).getEdorNo());
ttLPPolDB.setEdorType(bussType);
ttLPPolDB.setContNo(ttLPEdorItemSet.get(1).getContNo());
ttLPPolDB.setAppntNo(mInputList.get(i).getCustomeno());
LPPolSet ttLPPolSet = ttLPPolDB.query();
if (ttLPPolSet.size() > 0) {
for (int y = 1; y <= ttLPPolSet.size(); y++) {
pdMoney += getAllPremSum(ttLPPolSet.get(y).getPayIntv(), ttLPPolSet.get(y).getPayYears(), ttLPPolSet.get(y).getPrem(), ttLPPolSet.get(y).getCurrency(), ttLPPolSet.get(y).getCValiDate());
}
}
money = money + pdMoney;
}
} else if (bussType.equals("IC")) {
//查询保全申请信息
LPEdorItemDB ttLPEdorItemDB = new LPEdorItemDB();
ttLPEdorItemDB.setEdorType(bussType);
ttLPEdorItemDB.setEdorNo(bussNo);
LPEdorItemSet ttLPEdorItemSet = ttLPEdorItemDB.query();
if (ttLPEdorItemSet.size() > 0) {
LPPolDB ttLPPolDB = new LPPolDB();
ttLPPolDB.setEdorNo(ttLPEdorItemSet.get(1).getEdorNo());
ttLPPolDB.setEdorType(bussType);
ttLPPolDB.setContNo(ttLPEdorItemSet.get(1).getContNo());
LPPolSet ttLPPolSet = ttLPPolDB.query();
if (ttLPPolSet.size() > 0) {
for (int y = 1; y <= ttLPPolSet.size(); y++) {
pdMoney += getAllPremSum(ttLPPolSet.get(y).getPayIntv(), ttLPPolSet.get(y).getPayYears(), ttLPPolSet.get(y).getPrem(), ttLPPolSet.get(y).getCurrency(), ttLPPolSet.get(y).getCValiDate());
}
}
money = money + pdMoney;
}
} else if (bussType.equals("CM")) {
//查询保全申请信息
LPEdorItemDB ttLPEdorItemDB = new LPEdorItemDB();
ttLPEdorItemDB.setEdorType(bussType);
ttLPEdorItemDB.setEdorNo(bussNo);
LPEdorItemSet ttLPEdorItemSet = ttLPEdorItemDB.query();
if (ttLPEdorItemSet.size() > 0) {
//查询所有险种信息
LCPolDB ttLCPolDB = new LCPolDB();
ttLCPolDB.setContNo(ttLPEdorItemSet.get(1).getContNo());
LCPolSet ttLCPolSet = ttLCPolDB.query();
//查询出lppol数据
if (ttLPEdorItemSet.get(1).getChgPrem() > 0) {
LPPolDB ttLPPolDB = new LPPolDB();
ttLPPolDB.setEdorNo(ttLPEdorItemSet.get(1).getEdorNo());
ttLPPolDB.setEdorType(bussType);
ttLPPolDB.setContNo(ttLPEdorItemSet.get(1).getContNo());
LPPolSet ttLPPolSet = ttLPPolDB.query();
if (ttLPPolSet.size() > 0) {
for (int y = 1; y <= ttLPPolSet.size(); y++) {
pdMoney += getAllPremSum(ttLPPolSet.get(y).getPayIntv(), ttLPPolSet.get(y).getPayYears(), ttLPPolSet.get(y).getPrem(), ttLPPolSet.get(y).getCurrency(), ttLPPolSet.get(y).getCValiDate());
for (int z = 1; z <= ttLCPolSet.size(); z++) {
if (ttLPPolSet.get(y).getPolNo().equals(ttLCPolSet.get(z).getPolNo())) {
ttLCPolSet.remove(ttLCPolSet.get(z));
}
}
}
}
}
for (int o = 1; o <= ttLCPolSet.size(); o++) {
int payintv = ttLCPolSet.get(o).getPayIntv();
int payyears = ttLCPolSet.get(o).getPayYears();
double prem = ttLCPolSet.get(o).getPrem();
String currency = ttLCPolSet.get(o).getCurrency();
String signDate = ttLCPolSet.get(o).getCValiDate();
money += getAllPremSum(payintv, payyears, prem, currency, signDate);
}
money = money + pdMoney;
}
} else if (bussType.equals("AA")) {
//查询保全申请信息
LPEdorItemDB ttLPEdorItemDB = new LPEdorItemDB();
ttLPEdorItemDB.setEdorType("AA");
ttLPEdorItemDB.setEdorNo(bussNo);
LPEdorItemSet ttLPEdorItemSet = ttLPEdorItemDB.query();
if (ttLPEdorItemSet.size() > 0) {
//查询所有险种信息
LCPolDB ttLCPolDB = new LCPolDB();
ttLCPolDB.setContNo(ttLPEdorItemSet.get(1).getContNo());
LCPolSet ttLCPolSet = ttLCPolDB.query();
if (ttLPEdorItemSet.get(1).getGetMoney() > 0) {
LPPolDB ttLPPolDB = new LPPolDB();
ttLPPolDB.setEdorNo(ttLPEdorItemSet.get(1).getEdorNo());
ttLPPolDB.setEdorType("AA");
ttLPPolDB.setContNo(ttLPEdorItemSet.get(1).getContNo());
LPPolSet ttLPPolSet = ttLPPolDB.query();
pdMoney += getAllPremSum(ttLPPolSet.get(1).getPayIntv(), ttLPPolSet.get(1).getPayYears(), ttLPPolSet.get(1).getPrem(), ttLPPolSet.get(1).getCurrency(), ttLPPolSet.get(1).getCValiDate());
for (int z = 1; z <= ttLCPolSet.size(); z++) {
if (ttLCPolSet.get(z).getPolNo().equals(ttLPPolSet.get(1).getPolNo())) {
ttLCPolSet.remove(ttLCPolSet.get(z));
}
}
}
for (int z = 1; z <= ttLCPolSet.size(); z++) {
int payintv = ttLCPolSet.get(z).getPayIntv();
int payyears = ttLCPolSet.get(z).getPayYears();
double prem = ttLCPolSet.get(z).getPrem();
String currency = ttLCPolSet.get(z).getCurrency();
String signDate = ttLCPolSet.get(z).getCValiDate();
money += getAllPremSum(payintv, payyears, prem, currency, signDate);
}
money = pdMoney + money;
}
} else if (bussType.equals("IO") || bussType.equals("RR")) {
//查询保全申请信息
LPEdorItemDB ttLPEdorItemDB = new LPEdorItemDB();
ttLPEdorItemDB.setEdorType(bussType);
ttLPEdorItemDB.setEdorNo(bussNo);
LPEdorItemSet ttLPEdorItemSet = ttLPEdorItemDB.query();
if (ttLPEdorItemSet.size() > 0) {
//查询所有险种信息
LCPolDB ttLCPolDB = new LCPolDB();
ttLCPolDB.setContNo(ttLPEdorItemSet.get(1).getContNo());
LCPolSet ttLCPolSet = ttLCPolDB.query();
LPPolDB ttLPPolDB = new LPPolDB();
ttLPPolDB.setEdorNo(bussNo);
ttLPPolDB.setEdorType(bussType);
ttLPPolDB.setContNo(ttLPEdorItemSet.get(1).getContNo());
LPPolSet ttLPPolSet = ttLPPolDB.query();
if (ttLPPolSet.size() > 0) {
pdMoney += getAllPremSum(ttLPPolSet.get(1).getPayIntv(), ttLPPolSet.get(1).getPayYears(), ttLPPolSet.get(1).getPrem(), ttLPPolSet.get(1).getCurrency(), ttLPPolSet.get(1).getCValiDate());
if (ttLCPolSet.size() != ttLPPolSet.size()) {
for (int z = 1; z <= ttLCPolSet.size(); z++) {
if (ttLCPolSet.get(z).getPolNo().equals(ttLPPolSet.get(1).getPolNo())) {
ttLCPolSet.remove(ttLCPolSet.get(z));
}
}
}
}
for (int z = 1; z <= ttLCPolSet.size(); z++) {
int payintv = ttLCPolSet.get(z).getPayIntv();
int payyears = ttLCPolSet.get(z).getPayYears();
double prem = ttLCPolSet.get(z).getPrem();
String currency = ttLCPolSet.get(z).getCurrency();
String signDate = ttLCPolSet.get(z).getCValiDate();
money += getAllPremSum(payintv, payyears, prem, currency, signDate);
}
money = pdMoney + money;
}
} else if (bussType.equals("FM") || bussType.equals("PM")) {
//查询保全申请信息
LPEdorItemDB ttLPEdorItemDB = new LPEdorItemDB();
ttLPEdorItemDB.setEdorType(bussType);
ttLPEdorItemDB.setEdorNo(bussNo);
LPEdorItemSet ttLPEdorItemSet = ttLPEdorItemDB.query();
if (ttLPEdorItemSet.size() > 0) {
//查询所有险种信息
LCPolDB ttLCPolDB = new LCPolDB();
ttLCPolDB.setContNo(ttLPEdorItemSet.get(1).getContNo());
LCPolSet ttLCPolSet = ttLCPolDB.query();
LPPolDB ttLPPolDB = new LPPolDB();
ttLPPolDB.setEdorNo(bussNo);
ttLPPolDB.setEdorType(bussType);
ttLPPolDB.setContNo(ttLPEdorItemSet.get(1).getContNo());
LPPolSet ttLPPolSet = ttLPPolDB.query();
if (ttLPPolSet.size() > 0) {
for (int y = 1; y <= ttLPPolSet.size(); y++) {
pdMoney += getAllPremSum(ttLPPolSet.get(y).getPayIntv(), ttLPPolSet.get(y).getPayYears(), ttLPPolSet.get(y).getPrem(), ttLPPolSet.get(y).getCurrency(), ttLPPolSet.get(y).getCValiDate());
for (int z = 1; z <= ttLCPolSet.size(); z++) {
if (ttLPPolSet.get(y).getPolNo().equals(ttLCPolSet.get(z).getPolNo())) {
ttLCPolSet.remove(ttLCPolSet.get(z));
}
}
}
}
if (ttLCPolSet.size() > 0) {
for (int z = 1; z <= ttLCPolSet.size(); z++) {
int payintv = ttLCPolSet.get(z).getPayIntv();
int payyears = ttLCPolSet.get(z).getPayYears();
double prem = ttLCPolSet.get(z).getPrem();
String currency = ttLCPolSet.get(z).getCurrency();
String signDate = ttLCPolSet.get(z).getCValiDate();
money += getAllPremSum(payintv, payyears, prem, currency, signDate);
}
}
money = pdMoney + money;
}
} else if (bussType.equals("NS") || bussType.equals("BC")) {
//查询保全申请信息
LPEdorItemDB ttLPEdorItemDB = new LPEdorItemDB();
ttLPEdorItemDB.setEdorType(bussType);
ttLPEdorItemDB.setEdorNo(bussNo);
LPEdorItemSet ttLPEdorItemSet = ttLPEdorItemDB.query();
if (ttLPEdorItemSet.size() > 0) {
//查询所有险种信息
LCPolDB ttLCPolDB = new LCPolDB();
ttLCPolDB.setContNo(ttLPEdorItemSet.get(1).getContNo());
LCPolSet ttLCPolSet = ttLCPolDB.query();
for (int z = 1; z <= ttLCPolSet.size(); z++) {
int payintv = ttLCPolSet.get(z).getPayIntv();
int payyears = ttLCPolSet.get(z).getPayYears();
double prem = ttLCPolSet.get(z).getPrem();
String currency = ttLCPolSet.get(z).getCurrency();
String signDate = ttLCPolSet.get(z).getCValiDate();
money += getAllPremSum(payintv, payyears, prem, currency, signDate);
}
}
}
} else if (bussType.equals("CT") ||
bussType.equals("XT") ||
bussType.equals("ZT") ||
bussType.equals("PT")) {
//退保金额为人民币1万元或者等值外币以上的
LPEdorItemDB ttLPEdorItemDB = new LPEdorItemDB();
ttLPEdorItemDB.setEdorNo(bussNo);
ttLPEdorItemDB.setEdorType(bussType);
LPEdorItemSet ttLPEdorItemSet = ttLPEdorItemDB.query();
money = tLDExch.toBaseCur(ttLPEdorItemSet.get(1).getCurrency(), "01", ttLPEdorItemSet.get(1).getEdorValiDate(), ttLPEdorItemSet.get(1).getGetMoney());
BigDecimal b = new BigDecimal(money);
money = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
}
if ((Integer.parseInt(intervalDate) > 7 && money > 200) || (Integer.parseInt(intervalDate) == -1 && money > 10000)) {
setMinputListCheckResult(i, "LIS-20331", "LIS-20332", "LIS-20333");
}
} else if (("Insured").equals(mInputList.get(i).getRole())) {
String intervalDate = "0";
double money = 0;
double pdMoney = 0;
//当业务类型为 NB和XB时 验证 被保人
if (bussType.equals("NB") ||
bussType.equals("XB")) {
intervalDate = sqlRealNameCheckBLSQL.findIntervalDateFromLCContAndLCPolByContNoAndInsuredNo(bussNo, mInputList.get(i).getCustomeno());
LCPolDB ttLCPolDB = new LCPolDB();
ttLCPolDB.setContNo(bussNo);
ttLCPolDB.setInsuredNo(mInputList.get(i).getCustomeno());
LCPolSet ttLCPolSet = ttLCPolDB.query();
for (int v = 1; v <= ttLCPolSet.size(); v++) {
money += getAllPremSum(ttLCPolSet.get(v).getPayIntv(), ttLCPolSet.get(v).getPayYears(), ttLCPolSet.get(v).getPrem(), ttLCPolSet.get(v).getCurrency(), ttLCPolSet.get(v).getCValiDate());
}
} else if (bussType.equals("NI") ||
bussType.equals("CM") ||
bussType.equals("AA") ||
bussType.equals("IO") ||
bussType.equals("FM") ||
bussType.equals("NS") ||
bussType.equals("PM") ||
bussType.equals("BC") ||
// 20210111-zhangchaoshuo-insert-增加保全项RR、IC的实名校验
bussType.equals("RR") ||
bussType.equals("IC")) {//当业务类型为保全时,验证 投保人
String contNo = sqlLPEdorItemSQL.findContNoByEdorNo(bussNo);
intervalDate = sqlRealNameCheckBLSQL.findIntervalDateFromLCContAndLCPolByContNo(contNo);
//根据保全类型判断
if (bussType.equals("NI")) {
LPEdorItemDB ttLPEdorItemDB = new LPEdorItemDB();
ttLPEdorItemDB.setEdorType("NI");
ttLPEdorItemDB.setEdorNo(bussNo);
LPEdorItemSet ttLPEdorItemSet = ttLPEdorItemDB.query();
if (ttLPEdorItemSet.size() > 0) {
//查询所有险种信息
LCPolDB ttLCPolDB = new LCPolDB();
ttLCPolDB.setContNo(ttLPEdorItemSet.get(1).getContNo());
LCPolSet ttLCPolSet = ttLCPolDB.query();
for (int z = 1; z <= ttLCPolSet.size(); z++) {
int payintv = ttLCPolSet.get(z).getPayIntv();
int payyears = ttLCPolSet.get(z).getPayYears();
double prem = ttLCPolSet.get(z).getPrem();
String currency = ttLCPolSet.get(z).getCurrency();
String signDate = ttLCPolSet.get(z).getCValiDate();
money += getAllPremSum(payintv, payyears, prem, currency, signDate);
}
money = money + pdMoney;
}
} else if (bussType.equals("CM")) {
//查询保全申请信息
LPEdorItemDB ttLPEdorItemDB = new LPEdorItemDB();
ttLPEdorItemDB.setEdorType(bussType);
ttLPEdorItemDB.setEdorNo(bussNo);
LPEdorItemSet ttLPEdorItemSet = ttLPEdorItemDB.query();
if (ttLPEdorItemSet.size() > 0) {
//查询所有险种信息
LCPolDB ttLCPolDB = new LCPolDB();
ttLCPolDB.setContNo(ttLPEdorItemSet.get(1).getContNo());
LCPolSet ttLCPolSet = ttLCPolDB.query();
//查询出lppol数据
if (ttLPEdorItemSet.get(1).getChgPrem() > 0) {
LPPolDB ttLPPolDB = new LPPolDB();
ttLPPolDB.setEdorNo(ttLPEdorItemSet.get(1).getEdorNo());
ttLPPolDB.setEdorType(bussType);
ttLPPolDB.setContNo(ttLPEdorItemSet.get(1).getContNo());
LPPolSet ttLPPolSet = ttLPPolDB.query();
if (ttLPPolSet.size() > 0) {
for (int y = 1; y <= ttLPPolSet.size(); y++) {
pdMoney += getAllPremSum(ttLPPolSet.get(y).getPayIntv(), ttLPPolSet.get(y).getPayYears(), ttLPPolSet.get(y).getPrem(), ttLPPolSet.get(y).getCurrency(), ttLPPolSet.get(y).getCValiDate());
for (int z = 1; z <= ttLCPolSet.size(); z++) {
if (ttLPPolSet.get(y).getPolNo().equals(ttLCPolSet.get(z).getPolNo())) {
ttLCPolSet.remove(ttLCPolSet.get(z));
}
}
}
}
}
for (int o = 1; o <= ttLCPolSet.size(); o++) {
int payintv = ttLCPolSet.get(o).getPayIntv();
int payyears = ttLCPolSet.get(o).getPayYears();
double prem = ttLCPolSet.get(o).getPrem();
String currency = ttLCPolSet.get(o).getCurrency();
String signDate = ttLCPolSet.get(o).getCValiDate();
money += getAllPremSum(payintv, payyears, prem, currency, signDate);
}
money = money + pdMoney;
}
} else if (bussType.equals("AA")) {
//查询保全申请信息
LPEdorItemDB ttLPEdorItemDB = new LPEdorItemDB();
ttLPEdorItemDB.setEdorType("AA");
ttLPEdorItemDB.setEdorNo(bussNo);
LPEdorItemSet ttLPEdorItemSet = ttLPEdorItemDB.query();
if (ttLPEdorItemSet.size() > 0) {
//查询所有险种信息
LCPolDB ttLCPolDB = new LCPolDB();
ttLCPolDB.setContNo(ttLPEdorItemSet.get(1).getContNo());
LCPolSet ttLCPolSet = ttLCPolDB.query();
if (ttLPEdorItemSet.get(1).getGetMoney() > 0) {
LPPolDB ttLPPolDB = new LPPolDB();
ttLPPolDB.setEdorNo(ttLPEdorItemSet.get(1).getEdorNo());
ttLPPolDB.setEdorType("AA");
ttLPPolDB.setContNo(ttLPEdorItemSet.get(1).getContNo());
LPPolSet ttLPPolSet = ttLPPolDB.query();
pdMoney += getAllPremSum(ttLPPolSet.get(1).getPayIntv(), ttLPPolSet.get(1).getPayYears(), ttLPPolSet.get(1).getPrem(), ttLPPolSet.get(1).getCurrency(), ttLPPolSet.get(1).getCValiDate());
for (int z = 1; z <= ttLCPolSet.size(); z++) {
if (ttLCPolSet.get(z).getPolNo().equals(ttLPPolSet.get(1).getPolNo())) {
ttLCPolSet.remove(ttLCPolSet.get(z));
}
}
}
for (int z = 1; z <= ttLCPolSet.size(); z++) {
int payintv = ttLCPolSet.get(z).getPayIntv();
int payyears = ttLCPolSet.get(z).getPayYears();
double prem = ttLCPolSet.get(z).getPrem();
String currency = ttLCPolSet.get(z).getCurrency();
String signDate = ttLCPolSet.get(z).getCValiDate();
money += getAllPremSum(payintv, payyears, prem, currency, signDate);
}
money = pdMoney + money;
}
} else if (bussType.equals("IO") || bussType.equals("RR")) {
//查询保全申请信息
LPEdorItemDB ttLPEdorItemDB = new LPEdorItemDB();
ttLPEdorItemDB.setEdorType(bussType);
ttLPEdorItemDB.setEdorNo(bussNo);
LPEdorItemSet ttLPEdorItemSet = ttLPEdorItemDB.query();
if (ttLPEdorItemSet.size() > 0) {
//查询所有险种信息
LCPolDB ttLCPolDB = new LCPolDB();
ttLCPolDB.setContNo(ttLPEdorItemSet.get(1).getContNo());
LCPolSet ttLCPolSet = ttLCPolDB.query();
LPPolDB ttLPPolDB = new LPPolDB();
ttLPPolDB.setEdorNo(bussNo);
ttLPPolDB.setEdorType(bussType);
ttLPPolDB.setContNo(ttLPEdorItemSet.get(1).getContNo());
LPPolSet ttLPPolSet = ttLPPolDB.query();
if (ttLPPolSet.size() > 0) {
pdMoney += getAllPremSum(ttLPPolSet.get(1).getPayIntv(), ttLPPolSet.get(1).getPayYears(), ttLPPolSet.get(1).getPrem(), ttLPPolSet.get(1).getCurrency(), ttLPPolSet.get(1).getCValiDate());
if (ttLCPolSet.size() != ttLPPolSet.size()) {
for (int z = 1; z <= ttLCPolSet.size(); z++) {
if (ttLCPolSet.get(z).getPolNo().equals(ttLPPolSet.get(1).getPolNo())) {
ttLCPolSet.remove(ttLCPolSet.get(z));
}
}
}
}
for (int z = 1; z <= ttLCPolSet.size(); z++) {
int payintv = ttLCPolSet.get(z).getPayIntv();
int payyears = ttLCPolSet.get(z).getPayYears();
double prem = ttLCPolSet.get(z).getPrem();
String currency = ttLCPolSet.get(z).getCurrency();
String signDate = ttLCPolSet.get(z).getCValiDate();
money += getAllPremSum(payintv, payyears, prem, currency, signDate);
}
money = pdMoney + money;
}
} else if (bussType.equals("FM") || bussType.equals("PM")) {
//查询保全申请信息
LPEdorItemDB ttLPEdorItemDB = new LPEdorItemDB();
ttLPEdorItemDB.setEdorType(bussType);
ttLPEdorItemDB.setEdorNo(bussNo);
LPEdorItemSet ttLPEdorItemSet = ttLPEdorItemDB.query();
if (ttLPEdorItemSet.size() > 0) {
//查询所有险种信息
LCPolDB ttLCPolDB = new LCPolDB();
ttLCPolDB.setContNo(ttLPEdorItemSet.get(1).getContNo());
LCPolSet ttLCPolSet = ttLCPolDB.query();
LPPolDB ttLPPolDB = new LPPolDB();
ttLPPolDB.setEdorNo(bussNo);
ttLPPolDB.setEdorType(bussType);
ttLPPolDB.setContNo(ttLPEdorItemSet.get(1).getContNo());
LPPolSet ttLPPolSet = ttLPPolDB.query();
if (ttLPPolSet.size() > 0) {
for (int y = 1; y <= ttLPPolSet.size(); y++) {
pdMoney += getAllPremSum(ttLPPolSet.get(y).getPayIntv(), ttLPPolSet.get(y).getPayYears(), ttLPPolSet.get(y).getPrem(), ttLPPolSet.get(y).getCurrency(), ttLPPolSet.get(y).getCValiDate());
for (int z = 1; z <= ttLCPolSet.size(); z++) {
if (ttLPPolSet.get(y).getPolNo().equals(ttLCPolSet.get(z).getPolNo())) {
ttLCPolSet.remove(ttLCPolSet.get(z));
}
}
}
}
if (ttLCPolSet.size() > 0) {
for (int z = 1; z <= ttLCPolSet.size(); z++) {
int payintv = ttLCPolSet.get(z).getPayIntv();
int payyears = ttLCPolSet.get(z).getPayYears();
double prem = ttLCPolSet.get(z).getPrem();
String currency = ttLCPolSet.get(z).getCurrency();
String signDate = ttLCPolSet.get(z).getCValiDate();
money += getAllPremSum(payintv, payyears, prem, currency, signDate);
}
}
money = pdMoney + money;
}
} else if (bussType.equals("NS") || bussType.equals("BC")) {
//查询保全申请信息
LPEdorItemDB ttLPEdorItemDB = new LPEdorItemDB();
ttLPEdorItemDB.setEdorType(bussType);
ttLPEdorItemDB.setEdorNo(bussNo);
LPEdorItemSet ttLPEdorItemSet = ttLPEdorItemDB.query();
if (ttLPEdorItemSet.size() > 0) {
//查询所有险种信息
LCPolDB ttLCPolDB = new LCPolDB();
ttLCPolDB.setContNo(ttLPEdorItemSet.get(1).getContNo());
LCPolSet ttLCPolSet = ttLCPolDB.query();
for (int z = 1; z <= ttLCPolSet.size(); z++) {
int payintv = ttLCPolSet.get(z).getPayIntv();
int payyears = ttLCPolSet.get(z).getPayYears();
double prem = ttLCPolSet.get(z).getPrem();
String currency = ttLCPolSet.get(z).getCurrency();
String signDate = ttLCPolSet.get(z).getCValiDate();
money += getAllPremSum(payintv, payyears, prem, currency, signDate);
}
}
} else if (bussType.equals("IC")) {
//查询保全申请信息
LPEdorItemDB ttLPEdorItemDB = new LPEdorItemDB();
ttLPEdorItemDB.setEdorType(bussType);
ttLPEdorItemDB.setEdorNo(bussNo);
LPEdorItemSet ttLPEdorItemSet = ttLPEdorItemDB.query();
if (ttLPEdorItemSet.size() > 0) {
LPPolDB ttLPPolDB = new LPPolDB();
ttLPPolDB.setEdorNo(ttLPEdorItemSet.get(1).getEdorNo());
ttLPPolDB.setEdorType(bussType);
ttLPPolDB.setContNo(ttLPEdorItemSet.get(1).getContNo());
LPPolSet ttLPPolSet = ttLPPolDB.query();
if (ttLPPolSet.size() > 0) {
for (int y = 1; y <= ttLPPolSet.size(); y++) {
pdMoney += getAllPremSum(ttLPPolSet.get(y).getPayIntv(), ttLPPolSet.get(y).getPayYears(), ttLPPolSet.get(y).getPrem(), ttLPPolSet.get(y).getCurrency(), ttLPPolSet.get(y).getCValiDate());
}
}
money = money + pdMoney;
}
}
}
if (Integer.parseInt(intervalDate) > 7 && money > 200) {
if ("N".equals(mInputList.get(i).getRealNameCheck())) {
mInputList.get(i).setCheckResultFlag(false);
mInputList.get(i).setCheckResultMsg("LIS-20334");
} else {
mInputList.get(i).setCheckResultFlag(true);
mInputList.get(i).setCheckResultMsg("");
}
}
} else if ("Bnf".equals(mInputList.get(i).getRole()) || "Assignee".equals(mInputList.get(i).getRole()) || "Payee".equals(mInputList.get(i).getRole())) {//Bnf-受益人;Assignee-受托人
double money = 0;
if (bussType.equals("CLM")) {
//理赔金额为人民币1万元或者等值外币以上的
LLBalanceDB ttLLBalanceDB = new LLBalanceDB();
ttLLBalanceDB.setClmNo(bussNo);
LLBalanceSet ttLLBalanceSet = ttLLBalanceDB.query();
for (int w = 1; w <= ttLLBalanceSet.size(); w++) {
money += tLDExch.toBaseCur(ttLLBalanceSet.get(w).getCurrency(), "01", ttLLBalanceSet.get(w).getGetDate(), ttLLBalanceSet.get(w).getPay());
}
BigDecimal b = new BigDecimal(money);
money = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
if (money > 10000 && "Bnf".equals(mInputList.get(i).getRole())) {
setMinputListCheckResult(i, "LIS-20341", "LIS-20342", "LIS-20343");
}
if (money > 10000 && "Assignee".equals(mInputList.get(i).getRole())) {
setMinputListCheckResult(i, "LIS-20338", "LIS-20339", "LIS-20340");
}
if (money > 10000 && "Payee".equals(mInputList.get(i).getRole())) {
setMinputListCheckResult(i, "LIS-20335", "LIS-20336", "LIS-20337");
}
} else if (bussType.equals("LN")) {
setMinputListCheckResult(i, "LIS-20335", "LIS-20336", "LIS-20337");
} else if (bussType.equals("PAY")) {
//退费金额为人民币1万元或者等值外币以上的
LJSGetEndorseDB ttLJSGetEndorseDB = new LJSGetEndorseDB();
ttLJSGetEndorseDB.setEndorsementNo(bussNo);
LJSGetEndorseSet ttLJSGetEndorseSet = ttLJSGetEndorseDB.query();
for (int x = 1; x <= ttLJSGetEndorseSet.size(); x++) {
money += tLDExch.toBaseCur(ttLJSGetEndorseSet.get(x).getCurrency(), "01", ttLJSGetEndorseSet.get(x).getGetDate(), ttLJSGetEndorseSet.get(x).getGetMoney());
}
BigDecimal b = new BigDecimal(money);
money = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
if (money > 10000) {
setMinputListCheckResult(i, "LIS-20335", "LIS-20336", "LIS-20337");
}
}
}
}
}
}catch(Exception ex){
return false;
}
return true;
}
private boolean prepareData() {
mResult.clear();
mResult.add(mMap);
return true;
}
public VData getResult() {
return mResult;
}
public CErrors getErrors() {
return mErrors;
}
/*
* 根据交费间隔和交费交费年期计算所有保费
* */
private double getAllPremSum(int payintv, int payyears, double prem, String currecy, String signDate) {
double sumPrem = 0;
double sumAllPrem = 0;
//年交
if (payintv == 12) {
sumPrem = prem * payyears;
} else if (payintv == -1) {
//不定期交
sumPrem = prem;
} else if (payintv == 0) {
//一次性交清
sumPrem = prem;
} else if (payintv == 1) {
//月交
sumPrem = prem * 12 * payyears;
} else if (payintv == 3) {
//季交
sumPrem = prem * 4 * payyears;
} else if (payintv == 6) {
//半年交
sumPrem = prem * 2 * payyears;
}
if ("01".equals(currecy)) {
sumAllPrem = sumPrem;
} else {
LDExch tLDExch = new LDExch();
sumAllPrem = tLDExch.toBaseCur(currecy, "01", signDate, sumPrem);
//结果保留两位小数
BigDecimal b = new BigDecimal(sumAllPrem);
sumAllPrem = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
}
return sumAllPrem;
}
/*
* 人证和实名校验
* */
private void setMinputListCheckResult(int i, String resultMsg1, String resultMsg2, String resultMsg3) {
if ("N".equals(mInputList.get(i).getPerCertConsist()) && "Y".equals(mInputList.get(i).getRealNameCheck())) {
mInputList.get(i).setCheckResultFlag(false);
mInputList.get(i).setCheckResultMsg(resultMsg1);
}
if ("N".equals(mInputList.get(i).getRealNameCheck()) && "Y".equals(mInputList.get(i).getPerCertConsist())) {
mInputList.get(i).setCheckResultFlag(false);
mInputList.get(i).setCheckResultMsg(resultMsg2);
}
if ("N".equals(mInputList.get(i).getRealNameCheck()) && "N".equals(mInputList.get(i).getPerCertConsist())) {
mInputList.get(i).setCheckResultFlag(false);
mInputList.get(i).setCheckResultMsg(resultMsg3);
}
if ("Y".equals(mInputList.get(i).getRealNameCheck()) && "Y".equals(mInputList.get(i).getPerCertConsist())) {
mInputList.get(i).setCheckResultFlag(true);
mInputList.get(i).setCheckResultMsg("");
}
}
}