package com.sinosoft.lis.tb;
import com.sinosoft.lis.db.*;
import com.sinosoft.lis.pubfun.*;
import com.sinosoft.lis.schema.*;
import com.sinosoft.lis.vschema.*;
import com.sinosoft.utility.*;
import lombok.extern.slf4j.Slf4j;
import java.util.Date;
import java.util.HashMap;
/**
* <p>Title: LIS</p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: Sinosoft</p>
*
* @author Yangming
* @version 6.0
*/
@Slf4j
public class GrpSignAfterPrintBL
{
/** 错误处理 */
public CErrors mErrors = new CErrors();
/** 返回结果 */
private VData mResult = new VData();
/** 传入数据 */
private VData mInputData;
/** 操作符 */
private String mOperate;
/** 团体合同表 */
private LCGrpContSchema mLCGrpContSchema;
/** 团体下个人数据 */
private LCContSet mLCContSet;
/** 团体保单号 */
private String mGrpContNo;
/** 团体印刷号 */
private String mPrtNo;
/** 团体险种信息 */
private LCGrpPolSet mLCGrpPolSet;
/** mGlobalInput */
private GlobalInput mGlobalInput;
/** 暂收费 */
private LJTempFeeSet mLJTempFeeSet;
/** 首期交费日期 */
private Date mFirstPayDate;
/** 最大缴费日期 */
private Date mMaxPayDate;
/** 险种 */
private LCPolSet mLCPolSet;
/** 缴费 */
private LCPremSet mLCPremSet;
/** 最后递交的数据 */
private MMap map = new MMap();
/** 需要处理溢缴 */
private boolean needDealOverfall = false;
/** 交费总金额 */
private double mPayMoney = 0.0;
/** 总差额 */
private double mDiff = 0.0;
/** 交至日期缓存信息 */
private HashMap mPayToDate = new HashMap();
/** 终交日期 */
private HashMap mPayEndDate = new HashMap();
/** 实收号码 */
private String mPayNo;
/** 客户通知书号码 */
private String mGetNoticeNo;
double mSumActuPayMoney = 0.00;
public GrpSignAfterPrintBL()
{
}
/**
* submitData
*
* @param mInputData VData
* @param mOperate String
* @return boolean
*/
public boolean submitData(VData mInputData, String mOperate)
{
this.mInputData = mInputData;
this.mOperate = mOperate;
if (!getInputData())
{
return false;
}
if (!checkData())
{
return false;
}
if (!dealData())
{
return false;
}
//准备往后台的数据
if (!prepareOutputData())
{
return false;
}
PubSubmit ps = new PubSubmit();
if (!ps.submitData(this.mResult, "INSERT"))
{
this.mErrors.copyAllErrors(ps.mErrors);
return false;
}
if(StrTool.cTrim(mLCGrpContSchema.getCardFlag()).equals("eh")){
log.info("默认回执回销");
if(!dealGetPolInfo(mLCGrpContSchema)){
CError tError = new CError();
tError.moduleName = "GrpSignAfertPrintBL.java";
tError.functionName = "deal";
tError.errorMessage = "保单回执回销失败!";
this.mErrors.addOneError(tError);
return false;
}
}
return true;
}
/**
* checkData
*
* @return boolean
*/
private boolean checkData()
{
log.info("开始校验前台传入的数据!");
mGrpContNo = mLCGrpContSchema.getGrpContNo();
if (this.mLCGrpContSchema == null)
{
// @@错误处理
log.info("GrpSignAfertPrintBLGrpSignAfertPrintBL.java中checkData方法报错,在程序1,Author:Yangming");
CError tError = new CError();
tError.moduleName = "GrpSignAfertPrintBL.java";
tError.functionName = "checkData";
tError.errorMessage = "前台出入的数据为空!";
this.mErrors.addOneError(tError);
return false;
}
if (StrTool.cTrim(this.mLCGrpContSchema.getGrpContNo()).equals(""))
{
// @@错误处理
log.info("GrpSignAfertPrintBLGrpSignAfertPrintBL.java中checkData方法报错,在程序2,Author:Yangming");
CError tError = new CError();
tError.moduleName = "GrpSignAfertPrintBL.java";
tError.functionName = "checkData";
tError.errorMessage = "前台出入的数据为空!";
this.mErrors.addOneError(tError);
return false;
}
LCGrpContDB tLCGrpContDB = new LCGrpContDB(mPrtNo);
tLCGrpContDB.setGrpContNo(mLCGrpContSchema.getGrpContNo());
if (!tLCGrpContDB.getInfo())
{
this.mErrors.copyAllErrors(tLCGrpContDB.mErrors);
return false;
}
/** 封装mLCGrpContSchema */
mLCGrpContSchema = tLCGrpContDB.getSchema();
mPrtNo = mLCGrpContSchema.getPrtNo();
if (!StrTool.cTrim(this.mLCGrpContSchema.getAppFlag()).equals("9"))
{
// @@错误处理
log.info("GrpSignAfertPrintBLGrpSignAfertPrintBL.java中checkData方法报错,在程序3,Author:Yangming");
CError tError = new CError();
tError.moduleName = "GrpSignAfertPrintBL.java";
tError.functionName = "checkData";
tError.errorMessage = "传入保单不是预打保单数据!";
this.mErrors.addOneError(tError);
return false;
}
log.info("完成一般性校验");
/** 完成一般性校验 */
LCGrpPolDB tLCGrpPolDB = new LCGrpPolDB(mPrtNo);
tLCGrpPolDB.setGrpContNo(mGrpContNo);
mLCGrpPolSet = tLCGrpPolDB.query();
if (mLCGrpPolSet.size() <= 0)
{
// @@错误处理
log.info("GrpSignAfertPrintBLGrpSignAfertPrintBL.java中checkData方法报错,在程序4,Author:Yangming");
CError tError = new CError();
tError.moduleName = "GrpSignAfertPrintBL.java";
tError.functionName = "checkData";
tError.errorMessage = "查询团体险种失败!";
this.mErrors.addOneError(tError);
return false;
}
for (int i = 1; i <= this.mLCGrpPolSet.size(); i++)
{
SSRS s=new ExeSQL(mPrtNo).execSQL("SELECT 1 FROM lcpol WHERE grppolno='"+mLCGrpPolSet.get(i).getGrpPolNo()+"'");
if ((!StrTool.cTrim(mLCGrpPolSet.get(i).getAppFlag()).equals("9"))&&(s.getMaxRow()!=0))
{
// @@错误处理
log.info("GrpSignAfertPrintBLGrpSignAfertPrintBL.java中checkData方法报错,在程序5,Author:Yangming");
CError tError = new CError();
tError.moduleName = "GrpSignAfertPrintBL.java";
tError.functionName = "checkData";
tError.errorMessage = "险种状态不是预打保单状态!";
this.mErrors.addOneError(tError);
return false;
}
}
if (!checkCont())
{
return false;
}
log.info("完成险种校验,开始财务收费校验");
/** 开始财务收费校验,首先要有应收数据,其次要有暂收数据,再有应收数据因该和暂收数据相同,同时也等于保费收入 */
if (!checkFee())
{
return false;
}
return true;
}
/**
* checkCont
*
* @return boolean
*/
private boolean checkCont()
{
/** 校验险种和合同信息 */
LCContDB tLCContDB = new LCContDB(mPrtNo);
tLCContDB.setGrpContNo(this.mGrpContNo);
if (tLCContDB.getCount() <= 0)
{
// @@错误处理
log.info("GrpSignAfertPrintBL中checkCont方法报错,在程序6,Author:Yangming");
CError tError = new CError();
tError.moduleName = "GrpSignAfertPrintBL";
tError.functionName = "checkCont";
tError.errorMessage = "查询合同失败!";
this.mErrors.addOneError(tError);
return false;
}
StringBuffer sql = new StringBuffer(255);
sql
.append("select count(1) from lccont where appflag<>'9' and grpcontno='");
sql.append(this.mGrpContNo);
sql.append("'");
int chk = Integer.parseInt((new ExeSQL(mPrtNo)).getOneValue(sql.toString()));
if (chk > 0)
{
buildError("checkCont", "预打签单失败,原因是签单标志不是9!");
return false;
}
LCPolDB tLCPolDB = new LCPolDB(mPrtNo);
tLCPolDB.setGrpContNo(this.mGrpContNo);
// this.mLCPolSet = tLCPolDB.query();
if (tLCPolDB.getCount() <= 0)
{
// @@错误处理
log.info("GrpSignAfertPrintBL中checkCont方法报错,在程序7,Author:Yangming");
CError tError = new CError();
tError.moduleName = "GrpSignAfertPrintBL";
tError.functionName = "checkCont";
tError.errorMessage = "查询险种信息失败!";
this.mErrors.addOneError(tError);
return false;
}
sql = new StringBuffer(255);
sql
.append("select count(1) from lcpol where appflag<>'9' and grpcontno='");
sql.append(this.mGrpContNo);
sql.append("'");
chk = Integer.parseInt((new ExeSQL(mPrtNo)).getOneValue(sql.toString()));
if (chk > 0)
{
buildError("checkCont", "预打签单失败,原因是签单标志不是9!");
return false;
}
// for (int i = 1; i <= mLCPolSet.size(); i++) {
// if (!StrTool.cTrim(mLCPolSet.get(i).getAppFlag()).equals("9")) {
// // @@错误处理
// log.info("GrpSignAfertPrintBL中checkCont方法报错,在程序8行,Author:Yangming");
// CError tError = new CError();
// tError.moduleName = "GrpSignAfertPrintBL";
// tError.functionName = "checkCont";
// tError.errorMessage = "被保险人" +
// this.mLCPolSet.get(i).getInsuredName() +
// "的险种信息存在问题!";
// this.mErrors.addOneError(tError);
// return false;
// }
// }
LCPremDB tLCPremDB = new LCPremDB(mPrtNo);
tLCPremDB.setGrpContNo(this.mGrpContNo);
// this.mLCPremSet = tLCPremDB.query();
if (tLCPremDB.getCount() <= 0)
{
// @@错误处理
log.info("GrpSignAfertPrintBL中checkCont方法报错,在程序9,Author:Yangming");
CError tError = new CError();
tError.moduleName = "GrpSignAfertPrintBL";
tError.functionName = "checkCont";
tError.errorMessage = "缴费项有误!";
this.mErrors.addOneError(tError);
return false;
}
return true;
}
/**
* checkFee
*
* @return boolean
*/
private boolean checkFee()
{
/** 首先校验应收数据 */
// LJSPayDB tLJSPayDB = new LJSPayDB();
// tLJSPayDB.setOtherNo(this.mGrpContNo);
// LJSPaySet tLJSPaySet = tLJSPayDB.query();
// if (tLJSPaySet.size() <= 0) {
// // @@错误处理
// log.info("GrpSignAfertPrintBLGrpSignAfertPrintBL.java中checkFee方法报错,在程序10行,Author:Yangming");
// CError tError = new CError();
// tError.moduleName = "GrpSignAfertPrintBL.java";
// tError.functionName = "checkFee";
// tError.errorMessage = "没有找到应收数据!";
// this.mErrors.addOneError(tError);
// return false;
// }
// if (tLJSPaySet.size() > 1) {
// // @@错误处理
// log.info("GrpSignAfertPrintBLGrpSignAfertPrintBL.java中checkFee方法报错,在程序11行,Author:Yangming");
// CError tError = new CError();
// tError.moduleName = "GrpSignAfertPrintBL.java";
// tError.functionName = "checkFee";
// tError.errorMessage = "同一保单查询到多条应收数据!";
// this.mErrors.addOneError(tError);
// return false;
// }
// if (this.mLCGrpContSchema.getPrem() !=
// tLJSPaySet.get(1).getSumDuePayMoney()) {
// // @@错误处理
// log.info("GrpSignAfertPrintBLGrpSignAfertPrintBL.java中checkFee方法报错,在程序12行,Author:Yangming");
// CError tError = new CError();
// tError.moduleName = "GrpSignAfertPrintBL.java";
// tError.functionName = "checkFee";
// tError.errorMessage = "应收钱数与保单保费不符,请联系开发人员!";
// this.mErrors.addOneError(tError);
// return false;
// }
log.info("开始校验暂收费");
/** 暂收费校验 */
LJTempFeeDB tLJTempFeeDB = new LJTempFeeDB(mPrtNo);
tLJTempFeeDB.setOtherNo(this.mPrtNo);
mLJTempFeeSet = tLJTempFeeDB
.executeQuery("select * from ljtempfee where otherno='"
+ this.mPrtNo
+ "' and enteraccdate is not null and confdate is null ");
if (mLJTempFeeSet.size() <= 0)
{
// @@错误处理
log.info("GrpSignAfertPrintBL中checkFee方法报错,在程序13,Author:Yangming");
CError tError = new CError();
tError.moduleName = "GrpSignAfertPrintBL.java";
tError.functionName = "checkFee";
tError.errorMessage = "未查询到暂收费!";
this.mErrors.addOneError(tError);
return false;
}
/** 纪录总交金额 */
for (int i = 1; i <= mLJTempFeeSet.size(); i++)
{
this.mPayMoney += mLJTempFeeSet.get(i).getPayMoney();
}
if (mPayMoney == 0)
{
CError tError = new CError();
tError.moduleName = "GrpSignAfertPrintBL";
tError.functionName = "checkFee";
tError.errorMessage = "交费金额为零!";
log.info("程序14出错,请检查GrpSignAfertPrintBL中的checkFee方法!{}" + tError.errorMessage);
this.mErrors.addOneError(tError);
return false;
}
if (this.mLCGrpPolSet.size() != mLJTempFeeSet.size())
{
// @@错误处理
log.info("GrpSignAfertPrintBL中checkFee方法报错,在程序15,Author:Yangming");
CError tError = new CError();
tError.moduleName = "GrpSignAfertPrintBL";
tError.functionName = "checkFee";
tError.errorMessage = "暂收费交费险种个数与险种数目不同!";
this.mErrors.addOneError(tError);
return false;
}
else
{
for (int i = 1; i <= mLCGrpPolSet.size(); i++)
{
for (int m = 1; m <= mLJTempFeeSet.size(); m++)
{
if (mLCGrpPolSet.get(i).getRiskCode().equals(
mLJTempFeeSet.get(m).getRiskCode())
&& mLCGrpPolSet.get(i).getPrem() > mLJTempFeeSet
.get(m).getPayMoney())
{
// @@错误处理
log.info("GrpSignAfertPrintBL中checkFee方法报错,在程序16,Author:Yangming");
CError tError = new CError();
tError.moduleName = "GrpSignAfertPrintBL";
tError.functionName = "checkFee";
tError.errorMessage = "险种"
+ mLCGrpPolSet.get(i).getRiskCode() + "保费:"
+ mLCGrpPolSet.get(i).getPrem() + "<br>"
+ "交费金额:" + mLJTempFeeSet.get(m).getPayMoney()
+ ",金额不同!";
this.mErrors.addOneError(tError);
return false;
}
else if (mLCGrpPolSet.get(i).getRiskCode().equals(
mLJTempFeeSet.get(m).getRiskCode())
&& mLCGrpPolSet.get(i).getPrem() < mLJTempFeeSet
.get(m).getPayMoney())
{
log.info("需要溢缴处理!");
needDealOverfall = true;
}
}
}
}
log.info("完成全部的财务校验!");
return true;
}
/**
* getInputData
*
* @return boolean
*/
private boolean getInputData()
{
log.info("开始获取数据!");
if (this.mInputData == null)
{
// @@错误处理
log.info("GrpSignAfertPrintBL中getInputData方法报错,在程序17,Author:Yangming");
CError tError = new CError();
tError.moduleName = "GrpSignAfertPrintBL";
tError.functionName = "getInputData";
tError.errorMessage = "传入参数为空!";
this.mErrors.addOneError(tError);
return false;
}
mLCGrpContSchema = (LCGrpContSchema) this.mInputData
.getObjectByObjectName("LCGrpContSchema", 0);
mGlobalInput = (GlobalInput) this.mInputData.getObjectByObjectName(
"GlobalInput", 0);
return true;
}
/**
* dealData
*
* @return boolean
*/
private boolean dealData()
{
/** 开始处理财务核销 */
if (this.mOperate.equals("INSERT||MAIN"))
{
if (!insertData())
{
return false;
}
}
return true;
}
/**
* insertData
*
* @return boolean
*/
private boolean insertData()
{
log.info("开始财务核销");
/** 为了解决大事务一次递交问题,将LJAPayPerson作为小事务,分别递交 */
/** 首先看是否存在PayNo */
getNo(this.mGrpContNo,mPrtNo);
// tPayNo = PubFun1.CreateMaxNo("PAYNO", PubFun.getNoLimit(
// this.mLCGrpContSchema.getManageCom()));
if (mPayNo == null || mPayNo.equals("") || mPayNo.indexOf("null") != -1)
{
buildError("insertData",
"生成PayNo错误,原因可能是曾经生成过没有查询到,也可能是LDMaxNo存在问题!");
return false;
}
if (mGetNoticeNo == null || mGetNoticeNo.equals("")
|| mGetNoticeNo.indexOf("null") != -1)
{
buildError("insertData", "生成客户通知书号码失败!");
return false;
}
// String newActNoticeNo = PubFun1.CreateMaxNo("GPAYNOTICENO",
// mLCGrpContSchema.getPrtNo());
/** 首期交费日期 */
FDate fDate = new FDate();
this.mFirstPayDate = fDate.getDate(this.mLJTempFeeSet.get(1)
.getPayDate());
this.mMaxPayDate = fDate
.getDate(this.mLJTempFeeSet.get(1).getPayDate());
double sumPrem = 0.0;
for (int i = 1; i <= mLJTempFeeSet.size(); i++)
{
if (fDate.getDate(mLJTempFeeSet.get(i).getPayDate()).before(
this.mFirstPayDate))
{
mFirstPayDate = fDate
.getDate(mLJTempFeeSet.get(i).getPayDate());
}
if (fDate.getDate(mLJTempFeeSet.get(i).getPayDate()).after(
this.mMaxPayDate))
{
mMaxPayDate = fDate.getDate(mLJTempFeeSet.get(i).getPayDate());
}
sumPrem += mLJTempFeeSet.get(i).getPayMoney();
}
/** 实收总表 */
LJAPaySchema tLJAPaySchema = new LJAPaySchema();
/** LJAPayGrp */
LJAPayGrpSet tLJAPayGrpSet = new LJAPayGrpSet();
/** 个人应收表 */
LJAPayPersonSet tLJAPayPersonSet = new LJAPayPersonSet();
tLJAPaySchema.setpartitionkey(mPrtNo);
tLJAPaySchema.setPayNo(this.mPayNo);
tLJAPaySchema.setIncomeNo(this.mGrpContNo);
tLJAPaySchema.setIncomeType("1");
tLJAPaySchema.setAppntNo(mLCGrpContSchema.getAppntNo());
tLJAPaySchema.setSumActuPayMoney(mLCGrpContSchema.getPrem());
tLJAPaySchema.setPayDate(mMaxPayDate);
tLJAPaySchema.setEnterAccDate(PubFun.getCurrentDate());
tLJAPaySchema.setConfDate(PubFun.getCurrentDate());
tLJAPaySchema.setApproveCode(mGlobalInput.Operator);
tLJAPaySchema.setApproveDate(PubFun.getCurrentDate());
tLJAPaySchema.setSerialNo(this.mPayNo);
tLJAPaySchema.setOperator(mGlobalInput.Operator);
tLJAPaySchema.setMakeDate(PubFun.getCurrentDate());
tLJAPaySchema.setMakeTime(PubFun.getCurrentTime());
tLJAPaySchema.setModifyDate(PubFun.getCurrentDate());
tLJAPaySchema.setModifyTime(PubFun.getCurrentTime());
tLJAPaySchema.setStartPayDate(mFirstPayDate);
tLJAPaySchema.setManageCom(mLCGrpContSchema.getManageCom());
tLJAPaySchema.setAgentCom(mLCGrpContSchema.getAgentCom());
tLJAPaySchema.setAgentType(mLCGrpContSchema.getAgentType());
tLJAPaySchema.setAgentCode(mLCGrpContSchema.getAgentCode());
tLJAPaySchema.setAgentGroup(mLCGrpContSchema.getAgentGroup());
tLJAPaySchema.setAgentType(mLCGrpContSchema.getAgentType());
tLJAPaySchema.setBankAccNo(mLCGrpContSchema.getBankAccNo());
tLJAPaySchema.setBankCode(mLCGrpContSchema.getBankCode());
tLJAPaySchema.setAccName(mLCGrpContSchema.getAccName());
// 当网销业务时,网销paymode为11银行汇款,但PayTypeFlag字段长度为1
// tLJAPaySchema.setPayTypeFlag(mLCGrpContSchema.getPayMode());
tLJAPaySchema.setGetNoticeNo(this.mGetNoticeNo);
tLJAPaySchema.setMarketType(mLCGrpContSchema.getMarketType());
tLJAPaySchema.setSaleChnl(mLCGrpContSchema.getSaleChnl());
// 契约新单核销实收标志。契约标志:“0”
tLJAPaySchema.setDueFeeType("0");
// ------------------------------
log.info("完成实收总表操作!");
// 对LCInsureAccFee、LCInsureAccFeeTrace表中OtherNo进行更新,保存值为PayNo。
MMap tTmpMap = prepareInsureAcc(mLCGrpContSchema.getGrpContNo(), this.mPayNo);
map.add(tTmpMap);
//-------------------------------------------
// by gzh 20111223 增加约定缴费计划明细信息
if(mLCGrpContSchema.getPayIntv() == -1){
GrpPayPlanDetailBL tGrpPayPlanDetailBL = new GrpPayPlanDetailBL();
VData tVData = new VData();
TransferData mTransferData = new TransferData();
mTransferData.setNameAndValue("ProposalGrpContNo", mLCGrpContSchema.getProposalGrpContNo());
tVData.add(mGlobalInput);
tVData.add(mTransferData);
if(!tGrpPayPlanDetailBL.submitData(tVData, "")){
CError.buildErr(this, "拆分约定缴费计划有误", tGrpPayPlanDetailBL.mErrors);
return false;
}
map.add(tGrpPayPlanDetailBL.getMMMap());
}
// by gzh end
/** 开始处理LJAPayPerson */
LCPremSet tLCPremSet = new LCPremSet();
RSWrapper tRSWrapper = new RSWrapper();
tRSWrapper.prepareData(tLCPremSet,
"select * from lcprem where grpcontno='" + this.mGrpContNo + "'");
do
{
tRSWrapper.getData();
for (int i = 1; i <= tLCPremSet.size(); i++)
{
if (!dealLJAPayPerson(tLJAPayPersonSet, tLCPremSet.get(i)))
{
return false;
}
}
}
while (tLCPremSet.size() > 0
&& tLCPremSet.size() == SysConst.FETCHCOUNT);
/** 完成上述操作后,需要校验核销金额是否和保费相同,如果相同则表示核销完成 */
if (!checkPayPerson())
{
return false;
}
/** 如果签单核销完成,操作核销日期 */
if (!dealConfDate())
{
return false;
}
/** 完成实收总表操作 */
for (int i = 1; i <= this.mLCGrpPolSet.size(); i++)
{
if (!dealLJAPayGrp(tLJAPayGrpSet, mLCGrpPolSet.get(i)))
{
return false;
}
}
for (int i = 1; i <= mLCGrpPolSet.size(); i++)
{
mLCGrpPolSet.get(i).setPaytoDate(
(String) mPayToDate.get(mLCGrpPolSet.get(i).getRiskCode()));
mLCGrpPolSet.get(i)
.setPayEndDate(
(String) mPayEndDate.get(mLCGrpPolSet.get(i)
.getRiskCode()));
mLCGrpPolSet.get(i).setAppFlag("1");
mLCGrpPolSet.get(i).setStateFlag("1");
mLCGrpPolSet.get(i).setModifyDate(PubFun.getCurrentDate());
mLCGrpPolSet.get(i).setModifyTime(PubFun.getCurrentTime());
mLCGrpPolSet.get(i).setFirstPayDate(fDate.getString(mFirstPayDate));
}
log.info("完成LJAPayGrp表操作");
/** 完成LJAPayGrp表操作 */
log.info("完成财务核销动作,开始处理保单状态!");
map.put(tLJAPaySchema, "INSERT");
map.put(tLJAPayGrpSet, "INSERT");
log.info(tLJAPayGrpSet.get(1).getCurPayToDate());
//社保动态评估日期改为签单当天
String sql_Estimate = "update LCEstimate set makedate='"+PubFun.getCurrentDate()+"',modifydate='"+PubFun.getCurrentDate()
+"',modifytime='" + PubFun.getCurrentTime() + "' where grpcontno='" +this.mGrpContNo+ "'";
map.put(sql_Estimate, "UPDATE");
map.put(tLJAPayPersonSet, "INSERT");
/** 开始保单状态,1、全部的Appflag。2、签单日期,签单机构 */
StringBuffer sql = new StringBuffer();
/** 更新Lcgrpcont */
sql.append("update LCGrpCont set Appflag='1',StateFlag='1',signdate='");
sql.append(PubFun.getCurrentDate());
sql.append("',SignTime='");
sql.append(PubFun.getCurrentTime());
sql.append("',modifydate='");
sql.append(PubFun.getCurrentDate());
sql.append("',modifyTime='");
sql.append(PubFun.getCurrentTime());
if (StrTool.cTrim(mLCGrpContSchema.getCardFlag()).equals("0"))
{
sql.append("',CustomGetPolDate='");
sql.append(PubFun.getCurrentDate());
sql.append("',PrintCount=1");
sql.append(",GetPolDate='");
sql.append(PubFun.getCurrentDate());
sql.append("',GetPolTime='");
sql.append(PubFun.getCurrentTime());
}
//深圳惠民宝默认打印次数为1
if(StrTool.cTrim(mLCGrpContSchema.getCardFlag()).equals("eh")){
sql.append("',PrintCount='1");
}
sql.append("',SignCom='");
sql.append(mGlobalInput.ManageCom);
if (this.needDealOverfall
&& mPayMoney > this.mLCGrpContSchema.getPrem())
{
sql.append("',dif=");
sql.append(mPayMoney - this.mLCGrpContSchema.getPrem());
sql.append(" where grpcontno='");
}
else
{
sql.append("' where grpcontno='");
}
sql.append(this.mGrpContNo);
sql.append("'");
map.put(sql.toString(), "UPDATE");
/** 更新LCCont */
sql = new StringBuffer();
sql.append("update LCCont set Appflag='1',StateFlag='1',signdate='");
sql.append(PubFun.getCurrentDate());
sql.append("',SignTime='");
sql.append(PubFun.getCurrentTime());
sql.append("',modifydate='");
sql.append(PubFun.getCurrentDate());
sql.append("',modifyTime='");
sql.append(PubFun.getCurrentTime());
sql.append("',SignCom='");
sql.append(mGlobalInput.ManageCom);
sql.append("',FirstPayDate='");
sql.append(fDate.getString(mFirstPayDate));
sql.append("' where grpcontno='");
sql.append(this.mGrpContNo);
sql.append("'");
map.put(sql.toString(), "UPDATE");
/** 更新LCPol */
sql = new StringBuffer();
sql.append("update LCPol set Appflag='1',StateFlag='1',signdate='");
sql.append(PubFun.getCurrentDate());
sql.append("',SignTime='");
sql.append(PubFun.getCurrentTime());
sql.append("',modifydate='");
sql.append(PubFun.getCurrentDate());
sql.append("',modifyTime='");
sql.append(PubFun.getCurrentTime());
sql.append("',SignCom='");
sql.append(mGlobalInput.ManageCom);
sql.append("',FirstPayDate='");
sql.append(fDate.getString(mFirstPayDate));
sql.append("' where grpcontno='");
sql.append(this.mGrpContNo);
sql.append("'");
map.put(sql.toString(), "UPDATE");
// /** 更新LCGrpPol */
map.put(this.mLCGrpPolSet, "UPDATE");
// sql = new StringBuffer();
// sql.append("update LCGrpPol set Appflag='1'");
// sql.append(",FirstPayDate='");
// sql.append(fDate.getString(mFirstPayDate));
// sql.append("' where grpcontno='");
// sql.append(this.mGrpContNo);
// sql.append("'");
// map.put(sql.toString(), "UPDATE");
/** 更新LJTempfee */
sql = new StringBuffer();
sql.append("update LJTempFee set ConfFlag='1',ConfDate='");
sql.append(PubFun.getCurrentDate());
sql.append("',ModifyTime='");
sql.append(PubFun.getCurrentTime());
sql.append("',ModifyDate='");
sql.append(PubFun.getCurrentDate());
sql.append("', OtherNo='");
sql.append(this.mGrpContNo);
sql.append("', OtherNoType='7' where OtherNo='");
sql.append(this.mPrtNo);
sql.append("' and ConfFlag='0' and ConfDate is null ");
map.put(sql.toString(), "UPDATE");
sql = new StringBuffer();
sql.append("update ljtempfeeclass set ConfFlag='1',ConfDate='");
sql.append(PubFun.getCurrentDate());
sql.append("',ModifyTime='");
sql.append(PubFun.getCurrentTime());
sql.append("',ModifyDate='");
sql.append(PubFun.getCurrentDate());
sql.append("' where tempfeeno in (select tempfeeno from ljtempfee ");
sql.append("where otherno='");
sql.append(this.mLCGrpContSchema.getGrpContNo());
sql.append("')");
map.put(sql.toString(), "UPDATE");
if(StrTool.cTrim(mLCGrpContSchema.getCardFlag()).equals("eh")){
//生成LCContPrint、LCContReceive、LCContGetPol,默认生成打印数据。打印数据和更新团单信息在同一个事务里
MMap tPrintMap = preparePrintInfo(mLCGrpContSchema);
map.add(tPrintMap);
String LCContReceiveSigndate = "update LCContReceive set signdate=(select signdate from lcgrpcont where prtno='"
+ mPrtNo + "') where prtno='"
+ mPrtNo + "'";
String LCContGetPolSigndate = "update LCContGetPol set signdate=(select signdate from lcgrpcont where prtno='"
+ mPrtNo + "') where prtno='"
+ mPrtNo + "'";
map.put(LCContReceiveSigndate, "UPDATE");
map.put(LCContGetPolSigndate, "UPDATE");
}
return true;
}
最新发布