保单打印报文开发

master
szy 3 weeks ago
parent 2892048cf4
commit f7fdbd8c0b
  1. 56
      lis-framework-service/src/main/java/com/sinosoft/lis/httpservice/nb/PolicyPrintCallbackServlet.java
  2. 10
      lis-framework-service/src/main/java/com/sinosoft/lis/httpservice/sql/nb/PolicyPrintCallbackBLSQL.java
  3. 270
      lis-module-grp-print-service/src/main/java/com/sinosoft/lis/g_print/LCGrpPrintBL.java
  4. 52
      lis-module-grp-print-service/src/main/java/com/sinosoft/lis/sql/g_print/LCGrpPrintBLSQL.java

@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import com.sinosoft.lis.httpservice.sql.nb.PolicyPrintCallbackBLSQL; import com.sinosoft.lis.httpservice.sql.nb.PolicyPrintCallbackBLSQL;
import com.sinosoft.lis.i18n.I18nMessage; import com.sinosoft.lis.i18n.I18nMessage;
import com.sinosoft.lis.pubfun.MMap; import com.sinosoft.lis.pubfun.MMap;
import com.sinosoft.lis.pubfun.PubFun;
import com.sinosoft.lis.pubfun.PubSubmit; import com.sinosoft.lis.pubfun.PubSubmit;
import com.sinosoft.persistence.SQLProxy; import com.sinosoft.persistence.SQLProxy;
import com.sinosoft.utility.CError; import com.sinosoft.utility.CError;
@ -22,6 +23,8 @@ import org.slf4j.LoggerFactory;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
/** /**
* 1000022230 * 1000022230
@ -43,6 +46,8 @@ public class PolicyPrintCallbackServlet extends HttpServlet {
private String errorMsg; private String errorMsg;
private String printDate; private String printDate;
private String printTime; private String printTime;
private String printSzie;
private JSONArray biliCards;
private final JSONObject responseJson = new JSONObject(); private final JSONObject responseJson = new JSONObject();
@ -165,10 +170,13 @@ public class PolicyPrintCallbackServlet extends HttpServlet {
serialNo = data.getString("serialNo"); serialNo = data.getString("serialNo");
grpContNo = data.getString("grpContNo"); grpContNo = data.getString("grpContNo");
contType = data.getString("contType"); contType = data.getString("contType");
printFlag = data.getString("printFlag"); printFlag = "Y".equals(data.getString("printFlag"))?"1":"0";
errorMsg = data.getString("errorMsg"); errorMsg = data.getString("errorMsg");
printDate = data.getString("printDate"); printDate = LocalDate.parse(data.getString("printDate"), DateTimeFormatter.ofPattern("yyyy年M月d日"))
printTime = data.getString("printTime"); .format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
printTime = "00:00:00";
printSzie = data.getString("printSize");
biliCards = data.getJSONArray("bilicards");
return true; return true;
} }
@ -193,10 +201,14 @@ public class PolicyPrintCallbackServlet extends HttpServlet {
buildError("checkData", new I18nMessage("打印日期不能为空", "")); buildError("checkData", new I18nMessage("打印日期不能为空", ""));
return false; return false;
} }
if (StringUtils.isBlank(printTime)) { if(biliCards.isEmpty()){
buildError("checkData", new I18nMessage("打印时间不能为空", "")); buildError("checkData", new I18nMessage("单证信息不能为空", ""));
return false; return false;
} }
// if (StringUtils.isBlank(printTime)) {
// buildError("checkData", new I18nMessage("打印时间不能为空", ""));
// return false;
// }
// if (!"0".equals(printFlag) && !"1".equals(printFlag)) { // if (!"0".equals(printFlag) && !"1".equals(printFlag)) {
// buildError("checkData", new I18nMessage("成功标识必须为0或1", "")); // buildError("checkData", new I18nMessage("成功标识必须为0或1", ""));
// return false; // return false;
@ -213,6 +225,10 @@ public class PolicyPrintCallbackServlet extends HttpServlet {
result = "N"; result = "N";
return false; return false;
} }
if(!saveLCCardInfo()){
result = "N";
return false;
}
if ("1".equals(printFlag)) { if ("1".equals(printFlag)) {
result = "Y"; result = "Y";
return true; return true;
@ -244,6 +260,36 @@ public class PolicyPrintCallbackServlet extends HttpServlet {
} }
} }
private boolean saveLCCardInfo() {
try {
mMMap = new MMap();
mInputData.clear();
for (int i = 0; i < biliCards.size(); i++) {
}
for (Object biliCard : biliCards) {
JSONObject card = (JSONObject) biliCard;
String bilicardMain = card.getString("bilicardMain");
String bilicardnoMain = card.getString("bilicardnoMain");
SQLwithBindVariables sqlbv = policyPrintCallbackBLSQL.insertLCCardInfo(grpContNo, bilicardMain,bilicardnoMain,printDate, PubFun.getCurrentDate(), "ggfw", PubFun.getCurrentTime());
mMMap.put(sqlbv, MMap.Action.INSERT);
}
mInputData.add(mMMap);
PubSubmit tPubSubmit = new PubSubmit();
if (!tPubSubmit.submitData(mInputData, null)) {
buildError("saveLCCardInfo", new I18nMessage("保存单证信息失败", ""));
return false;
}
return true;
} catch (Exception e) {
logger.error("PolicyPrintCallbackBL saveLCCardInfo exception", e);
buildError("saveLCCardInfo", new I18nMessage("保存单证信息失败", ""));
return false;
}
}
public void buildError(String functionName, I18nMessage errorMessage) { public void buildError(String functionName, I18nMessage errorMessage) {
CError tCError = new CError(); CError tCError = new CError();
tCError.moduleName = this.getClass().getSimpleName(); tCError.moduleName = this.getClass().getSimpleName();

@ -17,5 +17,15 @@ public interface PolicyPrintCallbackBLSQL {
@SQL("select count(1) from lcgrpprint where PrintNo='?serialNo?' and GrpContNo='?grpContNo?'") @SQL("select count(1) from lcgrpprint where PrintNo='?serialNo?' and GrpContNo='?grpContNo?'")
String countLCGrpPrintByGrpContNoAndPrintType(@Param("serialNo") String serialNo, String countLCGrpPrintByGrpContNoAndPrintType(@Param("serialNo") String serialNo,
@Param("grpContNo") String grpContNo); @Param("grpContNo") String grpContNo);
@SQL(value = "insert into lccardinfo(GrpContNo,bilicardcodemain, bilicardnomain,PrintDate, Operator, makedate, maketime, modifydate, modifytime) " +
" values ( '?tGrpContNo?','?mBiliCardCodeMain?', '?mBiliCardNoMain?','?mPrintDate?', '?Operator?', '?mCurrentDate?', '?mCurrentTime?', '?mCurrentDate?', '?mCurrentTime?')" )
SQLwithBindVariables insertLCCardInfo(@Param("tGrpContNo")String tGrpContNo,
@Param("mBiliCardCodeMain")String mBiliCardCodeMain,
@Param("mBiliCardNoMain")String mBiliCardNoMain,
@Param("mPrintDate") String mPrintDate,
@Param("mCurrentDate")String mCurrentDate,
@Param("Operator")String Operator,
@Param("mCurrentTime")String mCurrentTime);
} }

@ -25,6 +25,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
/** /**
@ -76,6 +78,7 @@ public class LCGrpPrintBL extends CovBase implements BusinessService {
private String mCurrentDate; private String mCurrentDate;
private String mCurrentTime; private String mCurrentTime;
private String mJsonData=null ; private String mJsonData=null ;
private static final DateTimeFormatter FMT = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String CacheValueFalg = null;//现金价值节点 String CacheValueFalg = null;//现金价值节点
@ -2457,8 +2460,8 @@ public class LCGrpPrintBL extends CovBase implements BusinessService {
SpecAssump = SpecAssump + mLCGrpContSchema.getGrpSpec(); SpecAssump = SpecAssump + mLCGrpContSchema.getGrpSpec();
jsonCONVER.put("LCCont_SignDate", StrTool.getChnDate(mLCGrpContSchema.getSignDate())); jsonCONVER.put("LCCont_SignDate", mLCGrpContSchema.getSignDate());
jsonCONVER.put("LCCont_SignTime", StrTool.getChnTime(mLCGrpContSchema.getSignTime().trim())); jsonCONVER.put("LCCont_SignTime", mLCGrpContSchema.getSignTime().trim());
tSSRS = lcGrpPrintBLSQL.getGrpInfoByGrpContNo(mGrpContNo); tSSRS = lcGrpPrintBLSQL.getGrpInfoByGrpContNo(mGrpContNo);
@ -2526,7 +2529,7 @@ public class LCGrpPrintBL extends CovBase implements BusinessService {
ManageCom1 = aSSRS.GetText(1, 3); ManageCom1 = aSSRS.GetText(1, 3);
ManageName1 = aSSRS.GetText(1, 1); ManageName1 = aSSRS.GetText(1, 1);
String tManageName1; String tManageName1;
tManageName1 = "泰和人寿保险股份有限公司" + tManageName + ""; tManageName1 = "富泽人寿保险股份有限公司" + tManageName + "";
// xmlexport.addControlItem("Cont","ManageCom1", ManageCom1); // xmlexport.addControlItem("Cont","ManageCom1", ManageCom1);
// xmlexport.addControlItem("Cont","ManageName1", tManageName1); // xmlexport.addControlItem("Cont","ManageName1", tManageName1);
jsonCont.put("ManageCom1", ManageCom1); jsonCont.put("ManageCom1", ManageCom1);
@ -2544,7 +2547,7 @@ public class LCGrpPrintBL extends CovBase implements BusinessService {
jsonCont.put("LCGrpCont_GrpName", mLCGrpContSchema.getGrpName()); jsonCont.put("LCGrpCont_GrpName", mLCGrpContSchema.getGrpName());
jsonCont.put("LCGrpCont_AppntNo", mLCGrpContSchema.getAppntNo()); jsonCont.put("LCGrpCont_AppntNo", mLCGrpContSchema.getAppntNo());
jsonCont.put("LCGrpCont_ProposalGrpContNo", mLCGrpContSchema.getProposalGrpContNo()); jsonCont.put("LCGrpCont_ProposalGrpContNo", mLCGrpContSchema.getProposalGrpContNo());
jsonCont.put("LCGrpCont_EndDate", StrTool.getChnDate(mLCGrpContSchema.getEndDate()) + " 24时"); jsonCont.put("LCGrpCont_EndDate", mLCGrpContSchema.getEndDate());
jsonCont.put("LCGrpAppnt_PostalAddress", tSSRS.GetText(1, 1)); jsonCont.put("LCGrpAppnt_PostalAddress", tSSRS.GetText(1, 1));
jsonCont.put("LCGrpAppnt_ZipCode", tSSRS.GetText(1, 2)); jsonCont.put("LCGrpAppnt_ZipCode", tSSRS.GetText(1, 2));
@ -2607,7 +2610,7 @@ public class LCGrpPrintBL extends CovBase implements BusinessService {
tSSRS = lcGrpPrintBLSQL.getPayTimeByGrpContNo(mGrpContNo); tSSRS = lcGrpPrintBLSQL.getPayTimeByGrpContNo(mGrpContNo);
jsonCont.put("PayTerm", tSSRS.GetText(1, 1)); jsonCont.put("PayTerm", tSSRS.GetText(1, 1));
jsonCont.put("LCGrpCont_CValiDate", StrTool.getChnDate(mLCGrpContSchema.getCValiDate()) + " 零时"); jsonCont.put("LCGrpCont_CValiDate", mLCGrpContSchema.getCValiDate());
/** /**
* Modify by ZJM,2011-11-29 增加232004-康和险种 * Modify by ZJM,2011-11-29 增加232004-康和险种
@ -2641,7 +2644,38 @@ public class LCGrpPrintBL extends CovBase implements BusinessService {
jsonCont.put("LDCom_Address", Address); jsonCont.put("LDCom_Address", Address);
jsonCont.put("ServicePhone", "4000188688"); jsonCont.put("ServicePhone", "956016");
jsonCont.put("CompanyAddress","www.fzlife.com");
//客服网点地址 TODO
tSSRS = lcGrpPrintBLSQL.getGrpBranchAddress(mGrpContNo);
jsonCont.put("SignComName",tSSRS.GetText(1,1));
jsonCont.put("SignComAddress",tSSRS.GetText(1,2));
String serviceBranchAddress = tSSRS.GetText(1, 3);
jsonCont.put("ServiceBranchAddress",serviceBranchAddress);
//定结相关字段
tSSRS = lcGrpPrintBLSQL.getGrpBalance(mGrpContNo);
if(tSSRS.getMaxRow() == 0){
//如果查不到数据,默认即时结算
jsonCont.put("BalanceOnState","即时结算");
}else{
String balanceonstate = tSSRS.GetText(1, 1);
String balanceonstateDesc = tSSRS.GetText(1, 2);
String balanceonperiod = tSSRS.GetText(1, 3);
String balanceonperiodDesc = tSSRS.GetText(1, 4);
jsonCont.put("BalanceOnState",balanceonstate);
if("1".equals(balanceonstate)){
String cValiDate = mLCGrpContSchema.getCValiDate();
LocalDate cvalidate = LocalDate.parse(cValiDate);
LocalDate localDate = cvalidate.plusMonths(Long.valueOf(balanceonperiod));
//定期结算
jsonCont.put("BalancePeriod",balanceonperiodDesc);
jsonCont.put("FirstBalanceDate",localDate.format(FMT));
}
}
//200805 保全补发时补充字样 //200805 保全补发时补充字样
if (mOperate.equals("EDORPRINT")) { if (mOperate.equals("EDORPRINT")) {
@ -2650,7 +2684,7 @@ public class LCGrpPrintBL extends CovBase implements BusinessService {
tSSRS = lcGrpPrintBLSQL.getEdorValiDateByGrpContNo(mGrpContNo); tSSRS = lcGrpPrintBLSQL.getEdorValiDateByGrpContNo(mGrpContNo);
String b = StrTool.getChnDate(tSSRS.GetText(1, 1)); String b = tSSRS.GetText(1, 1);
int tPrintCount; int tPrintCount;
// String tSql=" select count(1) from lpgrpedoritem " // String tSql=" select count(1) from lpgrpedoritem "
@ -3017,9 +3051,11 @@ public class LCGrpPrintBL extends CovBase implements BusinessService {
// ContractTitle[2] = "保险金额(元)"; // ContractTitle[2] = "保险金额(元)";
ContractTitle[2] = "参保人数"; ContractTitle[2] = "参保人数";
ContractTitle[3] = "保险费(元)"; ContractTitle[3] = "保险费(元)";
if (getGrpType()) { ContractTitle[4] = "保险金额总和(元)";
ContractTitle[4] = "领取年龄";
} // if (getGrpType()) {
// ContractTitle[4] = "领取年龄";
// }
for (int i = 1; i <= tLCGrpPolSSRS.getMaxRow(); i++) { for (int i = 1; i <= tLCGrpPolSSRS.getMaxRow(); i++) {
@ -3047,14 +3083,18 @@ public class LCGrpPrintBL extends CovBase implements BusinessService {
tSSRS = lcGrpPrintBLSQL.getSumActuPayMoneyByGrpContNoAndRiskCode(mGrpContNo, riskcode); tSSRS = lcGrpPrintBLSQL.getSumActuPayMoneyByGrpContNoAndRiskCode(mGrpContNo, riskcode);
str[3] = format(Double.parseDouble(tSSRS.GetText(1, 1))); str[3] = format(Double.parseDouble(tSSRS.GetText(1, 1)));
if (getGrpType()) { //取团单下每个险种的合计保额
String riskcodes = tLCGrpPolSSRS.GetText(1, 1); tSSRS = lcGrpPrintBLSQL.getAmtByGrpContNo(mGrpContNo, riskcode);
if (riskcodes.equals("232005")) { str[4] = format(Double.parseDouble(tSSRS.GetText(1, 1)));
str[4] = "-----";
} else { // if (getGrpType()) {
str[4] = getGetYear(tLCGrpPolSSRS.GetText(i, 1)); // String riskcodes = tLCGrpPolSSRS.GetText(1, 1);
} // if (riskcodes.equals("232005")) {
} // str[4] = "-----";
// } else {
// str[4] = getGetYear(tLCGrpPolSSRS.GetText(i, 1));
// }
// }
tListTable.add(str); tListTable.add(str);
} }
// xmlexport.addListTable(tListTable, ContractTitle); // xmlexport.addListTable(tListTable, ContractTitle);
@ -3064,14 +3104,10 @@ public class LCGrpPrintBL extends CovBase implements BusinessService {
if (tLCGrpPolSSRS.GetText(1, 1).trim().equals("231017") || tLCGrpPolSSRS.GetText(1, 1).trim().equals("231022")) { if (tLCGrpPolSSRS.GetText(1, 1).trim().equals("231017") || tLCGrpPolSSRS.GetText(1, 1).trim().equals("231022")) {
// ListTable aListTable = new ListTable();
// String astr[];
// aListTable.setName("ContPlan");
// String[] aContractTitle = new String[5];
JSONObject jsonContPlan = new JSONObject(); JSONObject jsonContPlan = new JSONObject();
jsonDATASET.put("ContPlan", jsonContPlan); jsonDATASET.put("ContPlan", jsonContPlan);
ArrayList aListTable = new ArrayList<String[]>(); ArrayList aListTable = new ArrayList<String[]>();
String astr[]; String astr[];
String[] aContractTitle = new String[5]; String[] aContractTitle = new String[5];
@ -3086,11 +3122,6 @@ public class LCGrpPrintBL extends CovBase implements BusinessService {
//查询被保险人使用的保险计划 //查询被保险人使用的保险计划
SSRS gSSRS; SSRS gSSRS;
SSRS hSSRS; SSRS hSSRS;
// sql =" select distinct contplancode from lccontplandutyparam "
// +" where grpcontno='"+mLCGrpContSchema.getGrpContNo()+"' "
// +" and contplancode<>'00' "
// +" order by contplancode ";
// gSSRS = exeSql.execSQL(sql);
gSSRS = lcGrpPrintBLSQL.getContPlanCodeByGrpContNo(mGrpContNo); gSSRS = lcGrpPrintBLSQL.getContPlanCodeByGrpContNo(mGrpContNo);
if (gSSRS.getMaxRow() == 0) { if (gSSRS.getMaxRow() == 0) {
@ -3138,21 +3169,16 @@ public class LCGrpPrintBL extends CovBase implements BusinessService {
} }
// 多主险开发 // 多主险开发
else { else {
JSONObject jsonContPlans = new JSONObject();
jsonDATASET.put("ContPlans", jsonContPlans);
jsonContPlans.put("PrtDate",mCurrentDate);
jsonContPlans.put("CurrencyType","人民币元");
JSONArray jsonContplans = new JSONArray();
// ListTable aListTable = new ListTable(); jsonContPlans.put("ContPlan", jsonContplans);
// aListTable.setName("ContPlan");
// String[] aContractTitle = new String[8];
JSONObject jsonContPlan = new JSONObject();
jsonDATASET.put("ContPlan", jsonContPlan);
ArrayList aListTable = new ArrayList<String[]>();
String astr[];
String[] aContractTitle = new String[9];
String[] aContractTitle = new String[11];
aContractTitle[0] = "层级代码"; aContractTitle[0] = "层级代码";
aContractTitle[1] = "责任项目"; aContractTitle[1] = "责任项目";
aContractTitle[2] = "基本保额/人"; aContractTitle[2] = "基本保额/人";
@ -3160,65 +3186,43 @@ public class LCGrpPrintBL extends CovBase implements BusinessService {
aContractTitle[4] = "赔付比例(%)"; aContractTitle[4] = "赔付比例(%)";
aContractTitle[5] = "公共保险金使用限额/人"; aContractTitle[5] = "公共保险金使用限额/人";
aContractTitle[6] = "是否医保"; aContractTitle[6] = "是否医保";
if (getGrpType()) {
aContractTitle[7] = "领取年龄";//有啥区别
}
aContractTitle[7] = "领取年龄"; aContractTitle[7] = "领取年龄";
aContractTitle[8] = "险种名称"; aContractTitle[8] = "险种名称";
//查询被保险人使用的保险计划 aContractTitle[9] = "备注";
aContractTitle[10] = "保险费/人";
// sql =" select distinct contplancode from lccontplandutyparam " //查询被保险人使用的保险计划
// +" where grpcontno='"+mLCGrpContSchema.getGrpContNo()+"' "
// +" and contplancode<>'00' "
// +" order by contplancode ";
// gSSRS = exeSql.execSQL(sql);
SSRS gSSRS; SSRS gSSRS;
gSSRS = lcGrpPrintBLSQL.getContPlanCodeByGrpContNo(mGrpContNo); gSSRS = lcGrpPrintBLSQL.getContPlanCodeByGrpContNo(mGrpContNo);
if (gSSRS.getMaxRow() == 0) { if (gSSRS.getMaxRow() == 0) {
buildError("dealData", new I18nMessage("没有查询到被保人参与的保险计划信息!", "LIS-99999")); buildError("dealData", new I18nMessage("没有查询到被保人参与的保险计划信息!", "LIS-99999"));
} }
for (int j = 1; j <= gSSRS.getMaxRow(); j++) { for (int j = 1; j <= gSSRS.getMaxRow(); j++) {
ArrayList aListTable = new ArrayList<String[]>();
String contplancode = gSSRS.GetText(j, 1); String contplancode = gSSRS.GetText(j, 1);
//
// String tSql=" select distinct a.contplancode,b.dutycode ,b.dutyname, "
// +" (select c.calfactorvalue from lccontplandutyparam c where c.grpcontno=a.grpcontno "
// +" and c.riskcode=a.riskcode and c.dutycode=a.dutycode "
// +" and c.contplancode=a.contplancode and c.calfactor='Amnt'), "
// +" (select c.calfactorvalue from lccontplandutyparam c where c.grpcontno=a.grpcontno "
// +" and c.riskcode=a.riskcode and c.dutycode=a.dutycode "
// +" and c.contplancode=a.contplancode and c.calfactor='GetLimit'), "
// +" (select c.calfactorvalue from lccontplandutyparam c where c.grpcontno=a.grpcontno "
// +" and c.riskcode=a.riskcode and c.dutycode=a.dutycode "
// +" and c.contplancode=a.contplancode and c.calfactor='GetRate'), "
// +" (select c.calfactorvalue from lccontplandutyparam c where c.grpcontno=a.grpcontno "
// +" and c.riskcode=a.riskcode and c.dutycode=a.dutycode "
// +" and c.contplancode=a.contplancode and c.calfactor='PubAmntLimit'),a.riskcode, "
// +" (select (select trim(CodeName) from ldcode where codetype = 'medicaflag' and trim(Code)=c.calfactorvalue) from lccontplandutyparam c where c.grpcontno=a.grpcontno "
// +" and c.riskcode=a.riskcode and c.dutycode=a.dutycode "
// +" and c.contplancode=a.contplancode and c.calfactor in (select r.risksortvalue from lmrisksort r where riskcode=a.riskcode and r.risksorttype='medical')),"
// +" (select c.calfactorvalue from lccontplandutyparam c where c.grpcontno=a.grpcontno "
// +" and c.riskcode=a.riskcode and c.dutycode=a.dutycode "
// +" and c.calfactor='GetYear')"
// +" from lccontplandutyparam a,lmduty b "
// +" where a.grpcontno='"+mLCGrpContSchema.getGrpContNo()+"' "
// +" and a.contplancode<>'00' "
// +" and trim(a.contplancode)='"+contplancode+"' "
// +" and a.dutycode=b.dutycode"
// +" order by a.contplancode,b.dutycode";
SSRS tSSRS; SSRS tSSRS;
tSSRS = lcGrpPrintBLSQL.getContPlanSumDetailByGrpContNoAndContPlanCode(mGrpContNo, contplancode);
JSONObject jsonContPlan = new JSONObject();
jsonContPlan.put("ContPlanTypeName",tSSRS.GetText(1,1));
jsonContPlan.put("ContPlanInsuredCounts",Integer.parseInt(tSSRS.GetText(1,2)));
jsonContPlan.put("ContPlanTypePrem",format(Double.parseDouble(tSSRS.GetText(1, 3))));
tSSRS = lcGrpPrintBLSQL.getContPlanDetailByGrpContNoAndContPlanCode(mGrpContNo, contplancode); tSSRS = lcGrpPrintBLSQL.getContPlanDetailByGrpContNoAndContPlanCode(mGrpContNo, contplancode);
if (tSSRS.getMaxRow() == 0) { if (tSSRS.getMaxRow() == 0) {
buildError("dealData", new I18nMessage("没有查询到保险计划的详细信息!", "LIS-99999")); buildError("dealData", new I18nMessage("没有查询到保险计划的详细信息!", "LIS-99999"));
} }
for (int t = 1; t <= tSSRS.getMaxRow(); t++) { for (int t = 1; t <= tSSRS.getMaxRow(); t++) {
String[] tStr = new String[9]; String[] tStr = new String[11];
tStr[0] = tSSRS.GetText(t, 1); tStr[0] = tSSRS.GetText(t, 1);
tStr[1] = tSSRS.GetText(t, 3); tStr[1] = tSSRS.GetText(t, 3);
tStr[8] = tSSRS.GetText(t, 11); tStr[8] = tSSRS.GetText(t, 11);
tStr[9] = tSSRS.GetText(t, 13);
tStr[10] = format(Double.parseDouble(tSSRS.GetText(t, 12)));
String tDudtyCode = tSSRS.GetText(t, 2); String tDudtyCode = tSSRS.GetText(t, 2);
if (tSSRS.GetText(t, 4) == null || tSSRS.GetText(t, 4).equals("")) { if (tSSRS.GetText(t, 4) == null || tSSRS.GetText(t, 4).equals("")) {
tStr[2] = "-----"; tStr[2] = "-----";
@ -3260,31 +3264,16 @@ public class LCGrpPrintBL extends CovBase implements BusinessService {
/** /**
* 第十个参数为领取年龄 * 第十个参数为领取年龄
*/ */
if (getGrpType()) { if (tSSRS.GetText(t, 10) == null || tSSRS.GetText(t, 10).equals("")) {
if (tSSRS.GetText(t, 8).trim().equals("213003")) { tStr[7] = "--------";
if (tSSRS.GetText(t, 10) == null || tSSRS.GetText(t, 10).equals("")) { } else {
tStr[7] = "--------";
} else {
tStr[7] = tSSRS.GetText(t, 10); tStr[7] = tSSRS.GetText(t, 10);
}
} else {
tStr[7] = "--------";
}
} }
//对赔付比例做特殊处理 //对赔付比例做特殊处理
if (tDudtyCode.equals("231302"))//主被保人住院责任 if (tDudtyCode.equals("231302"))//主被保人住院责任
{ {
// String tSql1="select a.calfactor,nvl(a.calfactorvalue,0) "
// +" from lccontplandutyparam a "
// +" where a.grpcontno='"+mLCGrpContSchema.getGrpContNo()+"' "
// +" and a.riskcode='231003' "
// +" and a.contplancode<>'00' "
// +" and a.contplancode='"+contplancode+"' "
// +" and a.dutycode='231302' "
// +" and a.calfactor like 'GetRate%' "
// +" order by a.calfactor";
SSRS tSSRS1; SSRS tSSRS1;
//老核心查询结果为一个字段 新核心这个分为5个字段 //老核心查询结果为一个字段 新核心这个分为5个字段
/** /**
@ -3342,15 +3331,6 @@ public class LCGrpPrintBL extends CovBase implements BusinessService {
tStr[4] = tGetRateInfo; tStr[4] = tGetRateInfo;
} else if (tDudtyCode.equals("231303"))//主被保人门急诊责任 } else if (tDudtyCode.equals("231303"))//主被保人门急诊责任
{ {
// String tSql2="select a.calfactor,nvl(a.calfactorvalue,0) "
// +" from lccontplandutyparam a "
// +" where a.grpcontno='"+mLCGrpContSchema.getGrpContNo()+"' "
// +" and a.riskcode='231003' "
// +" and a.contplancode<>'00' "
// +" and a.contplancode='"+contplancode+"' "
// +" and a.dutycode='231303' "
// +" and a.calfactor like 'GetRate%' "
// +" order by a.calfactor";
SSRS tSSRS2; SSRS tSSRS2;
tSSRS2 = lcGrpPrintBLSQL.getLikeGetRateByGrpContNoAndContPlanCode(mGrpContNo, contplancode, "231303"); tSSRS2 = lcGrpPrintBLSQL.getLikeGetRateByGrpContNoAndContPlanCode(mGrpContNo, contplancode, "231303");
String tGetRateInfo = "详见投保资料"; String tGetRateInfo = "详见投保资料";
@ -3399,10 +3379,9 @@ public class LCGrpPrintBL extends CovBase implements BusinessService {
} }
aListTable.add(tStr); aListTable.add(tStr);
} }
addListTable(jsonContPlan, aListTable, aContractTitle);
jsonContplans.add(jsonContPlan);
} }
addListTable(jsonContPlan, aListTable, aContractTitle);
} }
//第五步 生成specAssump层数据 //第五步 生成specAssump层数据
// mTextTag4.add("SpecAssump"," "); // mTextTag4.add("SpecAssump"," ");
@ -3677,6 +3656,8 @@ public class LCGrpPrintBL extends CovBase implements BusinessService {
// 增加业务员营业机构代码和名称2008-12-02 // 增加业务员营业机构代码和名称2008-12-02
jsonReceipt.put("LCGrpCont_PrtNo",mLCGrpContSchema.getPrtNo()); jsonReceipt.put("LCGrpCont_PrtNo",mLCGrpContSchema.getPrtNo());
SSRS AgentSSRS = lcGrpPrintBLSQL.getlasaleagentAddressAndZipCodeByGrpContNo(mGrpContNo); SSRS AgentSSRS = lcGrpPrintBLSQL.getlasaleagentAddressAndZipCodeByGrpContNo(mGrpContNo);
jsonReceipt.put("SaleAgentNum",AgentSSRS.GetText(1,1));
jsonReceipt.put("ServiceBranchAddress",serviceBranchAddress);
jsonReceipt.put("LCGrpCont_SaleAgentName",AgentSSRS.GetText(1,2)); jsonReceipt.put("LCGrpCont_SaleAgentName",AgentSSRS.GetText(1,2));
//xmlexport.addControlItem("receipt","LABranchGroup_Name",BranchName); //xmlexport.addControlItem("receipt","LABranchGroup_Name",BranchName);
@ -3729,6 +3710,76 @@ public class LCGrpPrintBL extends CovBase implements BusinessService {
} else if ("2".equals(mPrintType)) { } else if ("2".equals(mPrintType)) {
jsonCONTROL.put("PDFNAME",bdFileName); jsonCONTROL.put("PDFNAME",bdFileName);
} }
//被保险人清单
JSONArray insuedList = new JSONArray();
JSONObject insuedObj = new JSONObject();
jsonDATASET.put("InsuedList", insuedObj);
SSRS insuredInfoSSRS = lcGrpPrintBLSQL.getInsuredInfoByGrpContNo(mGrpContNo);
if (insuredInfoSSRS.getMaxRow() == 0) {
buildError("printPolicy", new I18nMessage("查询被保人信息失败!", "LIS-99999"));
return false;
}
for (int i = 1; i <= insuredInfoSSRS.getMaxRow(); i++) {
JSONObject object = new JSONObject();
object.put("Number", insuredInfoSSRS.GetText(i, 1));
object.put("InsuredName", insuredInfoSSRS.GetText(i, 2));
object.put("IDType", insuredInfoSSRS.GetText(i, 3));
object.put("IDNo", insuredInfoSSRS.GetText(i, 4));
object.put("Sex", insuredInfoSSRS.GetText(i, 5));
object.put("Age", insuredInfoSSRS.GetText(i, 6));
object.put("Birthday", insuredInfoSSRS.GetText(i, 7));
object.put("PlanCde", insuredInfoSSRS.GetText(i, 8));
if ("3".equals(insuredInfoSSRS.GetText(i,19))){
object.put("Prem", insuredInfoSSRS.GetText(i, 9) + "(投保人承担金额" + insuredInfoSSRS.GetText(i, 21) + ",被保险人承担金额" + insuredInfoSSRS.GetText(i, 20) + ")");
}else {
object.put("Prem", insuredInfoSSRS.GetText(i, 9));
}
object.put("order_num", i);
object.put("BnfName", insuredInfoSSRS.GetText(i, 13));
object.put("OccupationName", insuredInfoSSRS.GetText(i, 14));
object.put("OccupationCode", insuredInfoSSRS.GetText(i, 15));
object.put("OccupationType", insuredInfoSSRS.GetText(i, 16));
object.put("SocialInsuFlag", insuredInfoSSRS.GetText(i, 17));
object.put("NativePlace", insuredInfoSSRS.GetText(i, 18));
object.put("Remark", insuredInfoSSRS.GetText(i, 22));
object.put("RelationtoInsured", insuredInfoSSRS.GetText(i, 23));
object.put("EmployeeName", insuredInfoSSRS.GetText(i, 24));
object.put("amnt", insuredInfoSSRS.GetText(i, 25));
object.put("ContPlanTypeName", insuredInfoSSRS.GetText(i, 26));
insuedList.add(object);
}
insuedObj.put("item",insuedList);
//收益人清单
JSONArray bnfList = new JSONArray();
JSONObject bnfObj = new JSONObject();
jsonDATASET.put("BnfList", bnfObj);
SSRS bnfInfoSSRS = lcGrpPrintBLSQL.getBnfInfoByGrpContNo(mGrpContNo);
if (bnfInfoSSRS.getMaxRow() > 0) {
for (int i = 1; i <= bnfInfoSSRS.getMaxRow(); i++) {
JSONObject object = new JSONObject();
object.put("BnfName", bnfInfoSSRS.GetText(i, 1));
object.put("Sex", bnfInfoSSRS.GetText(i, 2));
object.put("Birthday", bnfInfoSSRS.GetText(i, 3));
object.put("IDNo", bnfInfoSSRS.GetText(i, 4));
object.put("RelationtoInsured", bnfInfoSSRS.GetText(i, 5));
object.put("BnfGrade", bnfInfoSSRS.GetText(i, 6));
object.put("Bnflot", bnfInfoSSRS.GetText(i, 7));
object.put("InsuredName", bnfInfoSSRS.GetText(i, 8));
bnfList.add(object);
}
}
bnfObj.put("item",bnfList);
JSONObject objectOut = new JSONObject(); JSONObject objectOut = new JSONObject();
objectOut.put("ContNo",mGrpContNo); objectOut.put("ContNo",mGrpContNo);
String printNo = "GRPPRINT" + PubFun1.CreateMaxNo("PrintSerialNo", 10); String printNo = "GRPPRINT" + PubFun1.CreateMaxNo("PrintSerialNo", 10);
@ -3737,7 +3788,8 @@ public class LCGrpPrintBL extends CovBase implements BusinessService {
objectOut.put("bussinessType","NB"); objectOut.put("bussinessType","NB");
objectOut.put("fromSystem","GRP"); objectOut.put("fromSystem","GRP");
objectOut.put("PrintType",mPrintType); objectOut.put("PrintType",mPrintType);
objectOut.put("PDFNameOUT",bdFileName); String pdfName = mGrpContNo + System.currentTimeMillis()/1000;
objectOut.put("PDFNameOUT",pdfName);
objectOut.put("bussinessBody",jsonDATASETS1); objectOut.put("bussinessBody",jsonDATASETS1);

@ -489,6 +489,15 @@ public interface LCGrpPrintBLSQL {
@SQL(value = "select a.InsuyearFlag,a.Insuyear from lcpol a where grpcontno='?GrpContNo?' and riskcode='?RiskCode?' ") @SQL(value = "select a.InsuyearFlag,a.Insuyear from lcpol a where grpcontno='?GrpContNo?' and riskcode='?RiskCode?' ")
SSRS getInsuYearByGrpContNo(@Param("GrpContNo") String GrpContNo,@Param("RiskCode") String RiskCode); SSRS getInsuYearByGrpContNo(@Param("GrpContNo") String GrpContNo,@Param("RiskCode") String RiskCode);
@SQL(value = "select a.amnt from lcgrppol a where grpcontno='?GrpContNo?' and riskcode='?RiskCode?' ")
SSRS getAmtByGrpContNo(@Param("GrpContNo") String GrpContNo,@Param("RiskCode") String RiskCode);
@SQL(value = "select a.balanceonstate,(select d.codename from ldcode d where d.codetype = 'balanceontime' and d.code = a.balanceonstate),a.balanceperiod,(select d.codename from ldcode d where d.codetype = 'balanceperiod' and d.code = a.balanceperiod) from LDPBalanceOn a where a.grpcontno='?GrpContNo?'")
SSRS getGrpBalance(@Param("GrpContNo") String GrpContNo);
@SQL(value = "select (select name from ldcom where comcode = a.signcom),(select address from ldcom where comcode = a.signcom),(select address from ldcom where comcode = a.managecom) from lcgrpcont a where a.grpcontno='?GrpContNo?'")
SSRS getGrpBranchAddress(@Param("GrpContNo") String GrpContNo);
@SQL(value = "select distinct a.ContPlanCode ,a.PremCalType ,a.CalParam from lccontplan a where a.grpcontno = '?GrpContNo?' ") @SQL(value = "select distinct a.ContPlanCode ,a.PremCalType ,a.CalParam from lccontplan a where a.grpcontno = '?GrpContNo?' ")
SSRS getContPlanByGrpContNo(@Param("GrpContNo") String GrpContNo); SSRS getContPlanByGrpContNo(@Param("GrpContNo") String GrpContNo);
@ -519,7 +528,7 @@ public interface LCGrpPrintBLSQL {
"order by a.SysPlanCode,b.dutycode ") "order by a.SysPlanCode,b.dutycode ")
SSRS getContPlanDetailByGrpContNo(@Param("GrpContNo") String GrpContNo,@Param("RiskCode") String RiskCode,@Param("ContPlanCode") String ContPlanCode); SSRS getContPlanDetailByGrpContNo(@Param("GrpContNo") String GrpContNo,@Param("RiskCode") String RiskCode,@Param("ContPlanCode") String ContPlanCode);
@SQL(value = "select DISTINCT a.plancode,b.dutycode,b.dutyname ,FIXEDAMNT ,p6, p2 ,p3,a.riskcode,(select d.CodeName from ldcode d where d.CodeType ='medicalflag' and d.Code =p4),'',(select p.RiskName from lmriskapp p where p.RiskCode=a.RiskCode) " + @SQL(value = "select DISTINCT a.plancode,b.dutycode,b.dutyname ,FIXEDAMNT ,p6, p2 ,p3,a.riskcode,(select d.CodeName from ldcode d where d.CodeType ='medicalflag' and d.Code =p4),'',(select p.RiskName from lmriskapp p where p.RiskCode=a.RiskCode), a.finalvalue, a.remark " +
"from lccontplandetail a ,lmduty b,lccontplandetailsub c " + "from lccontplandetail a ,lmduty b,lccontplandetailsub c " +
"where a.POLICYNO =c.POLICYNO " + "where a.POLICYNO =c.POLICYNO " +
"and a.DUTYCODE =b.DUTYCODE " + "and a.DUTYCODE =b.DUTYCODE " +
@ -530,7 +539,12 @@ public interface LCGrpPrintBLSQL {
"order by a.PLANCODE ,b.DUTYCODE ") "order by a.PLANCODE ,b.DUTYCODE ")
SSRS getContPlanDetailByGrpContNoAndContPlanCode(@Param("GrpContNo")String GrpContNo,@Param("ContPlanCode")String ContPlanCode); SSRS getContPlanDetailByGrpContNoAndContPlanCode(@Param("GrpContNo")String GrpContNo,@Param("ContPlanCode")String ContPlanCode);
@SQL(value = """
select a.contplanname,a.peoples2,(select sum(finalvalue) from lccontplandetail where SysPlanCode=a.ContPlanCode and POLICYNO = a.GrpContNo)
from lccontplan a
where a.GrpContNo ='?GrpContNo?' and a.ContPlanCode='?ContPlanCode?'
""")
SSRS getContPlanSumDetailByGrpContNoAndContPlanCode(@Param("GrpContNo")String GrpContNo,@Param("ContPlanCode")String ContPlanCode);
@SQL(value = " select GetRate,GetRate1,GetRate2,GetRate3,GetRate4,GetRate5 from lccontplandetail WHERE POLICYNO ='?GrpContNo?' and SysPlanCode='?ContPlanCode?' and dutycode='?DutyCode?' ") @SQL(value = " select GetRate,GetRate1,GetRate2,GetRate3,GetRate4,GetRate5 from lccontplandetail WHERE POLICYNO ='?GrpContNo?' and SysPlanCode='?ContPlanCode?' and dutycode='?DutyCode?' ")
SSRS getLikeGetRateByGrpContNoAndContPlanCode(@Param("GrpContNo")String GrpContNo,@Param("ContPlanCode")String ContPlanCode,@Param("DutyCode")String DutyCode); SSRS getLikeGetRateByGrpContNoAndContPlanCode(@Param("GrpContNo")String GrpContNo,@Param("ContPlanCode")String ContPlanCode,@Param("DutyCode")String DutyCode);
@ -587,4 +601,38 @@ public interface LCGrpPrintBLSQL {
@SQL("update LCCont set printcount = ifnull(printcount,0)+1, CredentialURI = '?CredentialURI?' where contno = '?ContNo?' " ) @SQL("update LCCont set printcount = ifnull(printcount,0)+1, CredentialURI = '?CredentialURI?' where contno = '?ContNo?' " )
SQLwithBindVariables updateCredentialURIByContno(@Param("ContNo")String ContNo,@Param("CredentialURI")String CredentialURI); SQLwithBindVariables updateCredentialURIByContno(@Param("ContNo")String ContNo,@Param("CredentialURI")String CredentialURI);
@SQL(value = """
select
rownum,
a.Name ,
(SELECT codename FROM ldcode WHERE codetype = 'idtype' AND CODE = a.idtype ) idtype,
a.IDNo ,
(SELECT codename FROM ldcode WHERE codetype = 'sex' AND CODE = a.sex ) sex,
(select insuredappage from lcpol t where t.grpcontno = a.grpcontno and t.contno = a.contno and t.InsuredNo=a.InsuredNo limit 1) insuredappage,
a.Birthday ,
a.PlanCode ,
(select sum(prem) from lcpol l where a.GrpContNo = l.GrpContNo and a.InsuredNo=l.InsuredNo),
(select bankname from ldbankcom where bankcode = a.bankcode limit 1),
a.accname,
a.bankaccno,
ifnull((select group_concat(name,'') as bnfname from lcbnf where contno = a.contno and insuredno=a.InsuredNo and bnftype = '1' limit 1),'法定继承人'),
(select occupationname from ldoccupation where occupationcode = a.occupationcode ),
a.occupationcode,
a.occupationtype,
(case when a.socialinsuflag = '1' then '有医保' when a.socialinsuflag = '2' then '无医保' else '未采集' end) socialinsuflag,
(select codename from ldcode where codetype = 'nativeplace' and code = a.nativeplace),
(select premmode from lccontplan where contplancode = a.contplancode and grpcontno = a.grpcontno LIMIT 1),
a.PersonBurden ,
a.EnterPriseBurden,
a.remark,
(select codename from ldcode where codetype='relation' and code=a.RelationToMainInsured),
(case a.relationtomaininsured when '00' then a.name else (select name from lcinsured where a.MainCustomerNo =InsuredNo ) end),
(select amnt from lccont where contno = a.contno),
(select contplanname from lccontplan where contplancode = a.contplancode and grpcontno = a.grpcontno LIMIT 1)
from lcinsured a where a.GrpContNo ='?GrpContNo?' and a.InsuredType='0' order by a.contno
""")
SSRS getInsuredInfoByGrpContNo(@Param("GrpContNo") String mGrpPropNo);
@SQL(value= "select name,(SELECT codename FROM ldcode WHERE codetype = 'sex' AND CODE = a.sex ) sex,a.Birthday ,a.IDNo ,(select codename from ldcode where codetype='relation' and code=a.relationtoinsured ),a.bnfgrade ,a.bnflot,(select name from lcinsured where a.insuredno = insuredno) from lcbnf a where a.contno in (select contno from lccont where grpcontno = '?GrpContNo?') ")
SSRS getBnfInfoByGrpContNo(@Param("GrpContNo") String mGrpPropNo);
} }

Loading…
Cancel
Save