resKeyArr =
- Lists.newArrayList("subReportType", "subReportTypeCost", "treatResult", "treatErrorCode", "errorMessage");
- for(String keyRes : keyObj.keySet()){
- if(!resKeyArr.contains(keyRes) || "3".equals(treatResult)){
- addContentB = true;
- }
- }
- if(addContentB){
- String content = createBaseContent(pe.getCode(), pe.getHtmlContent(), obj);
- sb.append(content);
- }
- }
- return sb.toString();
- }
-
- /**
- * 反欺诈信息汇总
- * @param obj
- * @return
- */
- private static String createPafDescContent(String key, JSONObject obj){
- String bodyPersonAntiFraudDescInfoContent = personAntiFraudDescInfoContent;
- JSONObject subObj = obj.getJSONObject(key);
- // TODO: 2020/7/29 增加判断空 antiFraudScore
- String antiFraudScore = subObj.getString("antiFraudScore");
- bodyPersonAntiFraudDescInfoContent = bodyPersonAntiFraudDescInfoContent.replace("antiFraudScore", subObj.getString("antiFraudScore"));
- StringBuilder sbContent = new StringBuilder();
- for(PersonAntiFraudDescInfoEnums pe : PersonAntiFraudDescInfoEnums.values()){
- if(null != subObj.getString(pe.getCode())
- && !"".equals(subObj.getString(pe.getCode()))){
- String subContent = personAntiFraudDescInfoContentItem;
- String imgStatus = "image_success";
- // TODO: 2020/7/29 如果包含 不正常 高风险 则改为 imgage_error
- String result = subObj.getString(pe.getCode());
- if("antiFraudScore".equals(pe.getCode())) {
- if(Integer.parseInt(result) > 500){
- imgStatus = "image_error";
- }
- }else if("policeCheckDesc".equals(pe.getCode())){
- String resPre = subObj.getString("policeCheckRiskLevel");
- if(resPre.contains("高风险")){
- imgStatus = "image_error";
- }else if(resPre.contains("中风险")){
- imgStatus = "image_warn";
- }
- }else if("mobileCheckDesc".equals(pe.getCode())){
- String resPre = subObj.getString("mobileCheckRiskLevel");
- if(resPre.contains("高风险")){
- imgStatus = "image_error";
- }else if(resPre.contains("中风险")){
- imgStatus = "image_warn";
- }
- }else if("mobileStatusDesc".equals(pe.getCode())){
- String resPre = subObj.getString("mobileStatusRiskLevel");
- if(resPre.contains("高风险")){
- imgStatus = "image_error";
- }else if(resPre.contains("中风险")){
- imgStatus = "image_warn";
- }
- }else if("judicialRiskDesc".equals(pe.getCode())){
- String resPre = subObj.getString("judicialRiskLevel");
- if(resPre.contains("高风险")){
- imgStatus = "image_error";
- }else if(resPre.contains("中风险")){
- imgStatus = "image_warn";
- }
- }else if("riskRosterDesc".equals(pe.getCode())){
- if(!"未命中风险名单".equals(result)){
- imgStatus = "image_error";
- }
- }
- if(result.contains("高风险")){
- imgStatus = "image_error";
- }
- String pafDesc = pe.getDesc() + ":" + subObj.getString(pe.getCode());
- subContent = subContent.replace("image_status", imgStatus);
- subContent = subContent.replace("pafDesc", pafDesc);
- sbContent.append(subContent);
- }
- }
- bodyPersonAntiFraudDescInfoContent = bodyPersonAntiFraudDescInfoContent.replace("contentItem", sbContent.toString());
- return bodyPersonAntiFraudDescInfoContent;
- }
-
- //反欺诈分析综述
- public static String personAntiFraudDescInfoContentItem =
- " 
pafDesc
";
-
- //反欺诈分析综述
- public static String personAntiFraudDescInfoContent =
- " \n" +
- " | 欺诈风险指数为 antiFraudScore 分 | \n" +
- "
\n" +
- " \n" +
- " | contentItem | \n" +
- "
\n" ;
- //反欺诈分析综述
- public static String personAntiFraudDescInfo =
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "  | \n" +
- " 反欺诈分析综述 | \n" +
- " \n" +
- " \n" +
- " | \n" +
- "
\n" +
- " \n" +
- " \n" +
- " \n" +
- " subContent \n" +
- " | \n" +
- "
\n" ;
-
- /**
- * 反欺诈指数
- * @param obj
- * @return
- */
- private static String createPersonAntiFraudScoreInfoContent(String key, JSONObject obj){
- String bodyPersonAntiFraudScoreInfoContent = personAntiFraudScoreInfoContent;
- JSONObject subObj = obj.getJSONObject(key);
- bodyPersonAntiFraudScoreInfoContent = bodyPersonAntiFraudScoreInfoContent.replace("riskScore", subObj.getString("riskScore"));
- bodyPersonAntiFraudScoreInfoContent = bodyPersonAntiFraudScoreInfoContent.replace("riskLevel", subObj.getString("riskLevel"));
- bodyPersonAntiFraudScoreInfoContent = bodyPersonAntiFraudScoreInfoContent.replace("hitTypes", subObj.getString("hitTypes"));
- return bodyPersonAntiFraudScoreInfoContent;
- }
-
- //反欺诈分析指数
- public static String personAntiFraudScoreInfoContent =
- " | 欺诈风险指数为 riskScore 分 |
\n" +
- "| 欺诈风险等级为 riskLevel |
\n" +
- "| 欺诈风险标签为 hitTypes |
\n" ;
-
- //反欺诈分析指数【图片删掉】
- public static String personAntiFraudScoreInfo =
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "  | \n" +
- " 欺诈风险指数 | \n" +
- " \n" +
- " \n" +
- " | \n" +
- "
\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " subContent \n" +
- " | \n" +
- "
\n" ;
-
- /**
- * 证件号码校验信息
- * @param obj
- * @return
- */
- private static String createPersonBaseInfoContent(String key, JSONObject obj) throws ParseException {
- String bodyPersonBaseInfoContent = personBaseInfoContent;
- JSONObject subObj = obj.getJSONObject(key);
- bodyPersonBaseInfoContent = bodyPersonBaseInfoContent.replace("docNo", subObj.getString("docNo"));
- SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
- Date birDate = sdf.parse(subObj.getString("birthday"));
- SimpleDateFormat sdfRes = new SimpleDateFormat("yyyy年MM月dd日");
- String birStr = sdfRes.format(birDate);
- bodyPersonBaseInfoContent = bodyPersonBaseInfoContent.replace("birthday", birStr);
- String genderId = subObj.getString("genderID");
- if("1".equals(genderId)){
- genderId = "男";
- }else if("2".equals(genderId)){
- genderId = "女";
- }else if("3".equals(genderId)){
- genderId = "不详";
- }
- bodyPersonBaseInfoContent = bodyPersonBaseInfoContent.replace("genderID", genderId);
- bodyPersonBaseInfoContent = bodyPersonBaseInfoContent.replace("age", subObj.getString("age"));
- bodyPersonBaseInfoContent = bodyPersonBaseInfoContent.replace("originalAddress", subObj.getString("originalAddress"));
- bodyPersonBaseInfoContent = bodyPersonBaseInfoContent.replace("verifyResult", "1".equals(subObj.getString("verifyResult")) ? "通过" : "未通过");
- return bodyPersonBaseInfoContent;
- }
-
- //证件号码校验信息
- public static String personBaseInfoContent =
- " \n" +
- " | 证件号码 | \n" +
- " docNo | \n" +
- " 出生日期 | \n" +
- " birthday | \n" +
- "
\n" +
- " \n" +
- " | 性别 | \n" +
- " genderID | \n" +
- " 年龄 | \n" +
- " age | \n" +
- "
\n" +
- " \n" +
- " | 原始发证地区 | \n" +
- " originalAddress | \n" +
- "
\n" +
- " \n" +
- " | 证件校验结果 | \n" +
- " verifyResult | \n" +
- "
\n" ;
-
- //证件号码校验信息
- public static String personBaseInfo =
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "  | \n" +
- " 证件号码校验信息 | \n" +
- " \n" +
- " \n" +
- " | \n" +
- "
\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " subContent \n" +
- " | \n" +
- "
\n";
-
-
- /**
- * 证件号码校验信息
- * @param obj
- * @return
- */
- private static String createPoliceCheckInfoContent(String key, JSONObject obj){
- StringBuilder sb = new StringBuilder();
- JSONObject arrObj = obj.getJSONObject(key);
- JSONArray subArr = arrObj.getJSONArray("item");
- for(int i = 0; i < subArr.size(); i++){
- JSONObject subObj = subArr.getJSONObject(i);
- String bodyPoliceCheckInfoContent = policeCheckInfoContent;
- bodyPoliceCheckInfoContent = bodyPoliceCheckInfoContent.replace("result",
- "1".equals(subObj.getString("result")) ? "一致" : "不一致");
- sb.append(bodyPoliceCheckInfoContent);
- }
- return sb.toString();
- }
-
- //证件号码认证结果
- public static String policeCheckInfoContent =
- " \n" +
- " | 身份认证结果 | \n" +
- " result | \n" +
- "
\n" ;
-
- //证件号码认证结果
- public static String policeCheckInfo =
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "  | \n" +
- " 身份认证 | \n" +
- " \n" +
- " \n" +
- " | \n" +
- "
\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " subContent \n" +
- " | \n" +
- "
\n";
-
- /**
- * 手机号码校验信息结果
- * @param obj
- * @return
- */
- private static String createMobileCheckInfoContent(String key, JSONObject obj){
- StringBuilder sb = new StringBuilder();
- JSONObject arrObj = obj.getJSONObject(key);
- JSONArray subArr = arrObj.getJSONArray("item");
- for(int i = 0; i < subArr.size(); i++){
- JSONObject subObj = subArr.getJSONObject(i);
- String bodyMobileCheckInfoContent = mobileCheckInfoContent;
- bodyMobileCheckInfoContent = bodyMobileCheckInfoContent.replace("checkResult", subObj.getString("checkResult"));
- bodyMobileCheckInfoContent = bodyMobileCheckInfoContent.replace("areaInfo", subObj.getString("areaInfo"));
- bodyMobileCheckInfoContent = bodyMobileCheckInfoContent.replace("operator", MobileOperatorEnums.getValueData(subObj.getString("operator")));
- sb.append(bodyMobileCheckInfoContent);
- }
- return sb.toString();
- }
-
-
- //手机号码校验信息结果
- public static String mobileCheckInfoContent =
- " \n" +
- " | 运营商名称 | \n" +
- " operator | \n" +
- "
\n" +
- " \n" +
- " | 手机号码归属地 | \n" +
- " areaInfo | \n" +
- "
\n" +
- " \n" +
- " | 手机认证结果 | \n" +
- " checkResult | \n" +
- "
\n" ;
- //手机号码校验信息结果
- public static String mobileCheckInfo =
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "  | \n" +
- " 手机认证 | \n" +
- " \n" +
- " \n" +
- " | \n" +
- "
\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " subContent \n" +
- " | \n" +
- "
\n";
-
- /**
- * 手机号码在线时长
- * @param obj
- * @return
- */
- private static String createMobileStatusInfoContent(String key, JSONObject obj){
- StringBuilder sb = new StringBuilder();
- JSONObject arrObj = obj.getJSONObject(key);
- JSONArray subArr = arrObj.getJSONArray("item");
- for(int i = 0; i < subArr.size(); i++){
- JSONObject subObj = subArr.getJSONObject(i);
- String bodyMobileStatusInfoContent = mobileStatusInfoContent;
- bodyMobileStatusInfoContent = bodyMobileStatusInfoContent.replace("timeLength", MobileTimeLengthEnums.getValueData(subObj.getString("timeLength")));
- bodyMobileStatusInfoContent = bodyMobileStatusInfoContent.replace("phoneStatus", MobileStsEnums.getValueData(subObj.getString("phoneStatus")));
- sb.append(bodyMobileStatusInfoContent);
- }
- return sb.toString();
- }
-
-
- //手机号码在线时长
- public static String mobileStatusInfoContent =
- " \n" +
- " | 手机号码状态 | \n" +
- " phoneStatus | \n" +
- "
\n" +
- " \n" +
- " | 手机号码在网时长 | \n" +
- " timeLength | \n" +
- "
\n" ;
-
- //手机号码在线时长
- public static String mobileStatusInfo =
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "  | \n" +
- " 手机号码状态时长 | \n" +
- " \n" +
- " \n" +
- " | \n" +
- "
\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
-
- " subContent \n" +
- " | \n" +
- "
\n";
-
-
- /**
- * 风险名单命中结果
- * @param obj
- * @return
- */
- private static String createPersonRiskRosterInfoContent(String key, JSONObject obj){
- String bodyPersonRiskRosterInfoContent = personRiskRosterInfoContent;
- JSONObject subObj = obj.getJSONObject(key);
- StringBuilder sb = new StringBuilder();
- // TODO: 2020/7/29 判断为空
- String[] riskTypes = subObj.getString("riskTypes").split(",");
- for(String riskType : riskTypes){
- sb.append(RiskType.getValueData(riskType) + ", ");
- }
- String risk = sb.toString();
- risk = risk.substring(0, risk.length() - 2);
- bodyPersonRiskRosterInfoContent = bodyPersonRiskRosterInfoContent.replace("riskTypes", risk);
- return bodyPersonRiskRosterInfoContent;
- }
-
- //风险名单命中结果
- public static String personRiskRosterInfoContent =
- " \n" +
- " | 命中风险类型 | \n" +
- " riskTypes | \n" +
- "
\n" ;
-
- //风险名单命中结果
- public static String personRiskRosterInfo =
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "  | \n" +
- " 风险名单 | \n" +
- " \n" +
- " \n" +
- " | \n" +
- "
\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " subContent \n" +
- " | \n" +
- "
\n";
-
-
- /**
- * 风险名单命中结果
- * @param obj
- * @return
- */
- private static String createPersonJudicialSFRiskInfoContent(String key, JSONObject obj){
- String bodyPersonJudicialRiskInfoContentSFItem = personJudicialRiskInfoContent;
- String tail = "";
- //obj转换
- JSONObject resObj = new JSONObject();
- JSONObject civilCaseCount = new JSONObject();
- JSONObject criminalCaseCount = new JSONObject();
- JSONObject judicialCount = new JSONObject();
- JSONObject endCaseCount = new JSONObject();
- JSONObject breakFaithCount = new JSONObject();
- JSONObject judicialTotalCount = new JSONObject();
- resObj.put("civilCaseCount", civilCaseCount);
- resObj.put("criminalCaseCount", criminalCaseCount);
- resObj.put("judicialCount", judicialCount);
- resObj.put("endCaseCount", endCaseCount);
- resObj.put("breakFaithCount", breakFaithCount);
- resObj.put("judicialTotalCount", judicialTotalCount);
- JSONObject subObj = obj.getJSONObject("personJudicialRiskInfo");
- JSONArray subArr = subObj.getJSONArray("item");
- for(int i = 0; i < subArr.size(); i++){
- JSONObject subJson = subArr.getJSONObject(i);
- String resKey = JudicialRiskTimeLengthEnums.getValueData(subJson.getString("timePeriod"));
- for(String subKey : subJson.keySet()){
- for(String resSubKey : resObj.keySet()){
- if(subKey.equals(resSubKey)){
- JSONObject resSubObj = resObj.getJSONObject(resSubKey);
- resSubObj.put(resKey, subJson.getString(subKey));
- }
- }
- }
- }
- StringBuilder sb = new StringBuilder();
- //循环
- for(String resKey : resObj.keySet()){
- JSONObject resJson = resObj.getJSONObject(resKey);
- String content = personJudicialRiskInfoContentSFItem;
- content = content.replace("judicialSFType", JudicialSFCountTypeEnums.getValueData(resKey));
- for(JudicialRiskTimeLengthEnums je : JudicialRiskTimeLengthEnums.values()){
- content = content.replace(je.getDesc(), resJson.getString(je.getDesc()));
- }
- if("judicialTotalCount".equals(resKey)){//合计放在末尾
- tail = content;
- }else {
- sb.append(content);
- }
- }
- return bodyPersonJudicialRiskInfoContentSFItem + sb.toString() + tail;
- }
- /**
- * 风险名单命中结果
- * @param obj
- * @return
- */
- private static String createPersonJudicialXZRiskInfoContent(String key, JSONObject obj){
- String bodyPersonJudicialRiskInfoContentXZItem = personJudicialRiskInfoContent;
- String tail = "";
- //obj转换
- JSONObject resObj = new JSONObject();
- JSONObject taxPunishCount = new JSONObject();
- JSONObject marketPunishCount = new JSONObject();
- JSONObject customsPunishCount = new JSONObject();
- JSONObject environmentPunishCount = new JSONObject();
- JSONObject otherPunishCount = new JSONObject();
- JSONObject punishTotalCount = new JSONObject();
- resObj.put("taxPunishCount", taxPunishCount);
- resObj.put("marketPunishCount", marketPunishCount);
- resObj.put("customsPunishCount", customsPunishCount);
- resObj.put("environmentPunishCount", environmentPunishCount);
- resObj.put("otherPunishCount", otherPunishCount);
- resObj.put("punishTotalCount", punishTotalCount);
- JSONObject subObj = obj.getJSONObject("personJudicialRiskInfo");
- JSONArray subArr = subObj.getJSONArray("item");
- for(int i = 0; i < subArr.size(); i++){
- JSONObject subJson = subArr.getJSONObject(i);
- String resKey = JudicialRiskTimeLengthEnums.getValueData(subJson.getString("timePeriod"));
- for(String subKey : subJson.keySet()){
- for(String resSubKey : resObj.keySet()){
- if(subKey.equals(resSubKey)){
- JSONObject resSubObj = resObj.getJSONObject(resSubKey);
- resSubObj.put(resKey, subJson.getString(subKey));
- }
- }
- }
- }
-
- StringBuilder sb = new StringBuilder();
- System.out.println("resObj="+resObj.toJSONString());
- //循环
- for(String resKey : resObj.keySet()){
- JSONObject resJson = resObj.getJSONObject(resKey);
- String content = personJudicialRiskInfoContentXZItem;
- content = content.replace("judicialXZType", JudicialXZCountTypeEnums.getValueData(resKey));
- for(JudicialRiskTimeLengthEnums je : JudicialRiskTimeLengthEnums.values()){
- content = content.replace(je.getDesc(), resJson.getString(je.getDesc()));
- }
- if("punishTotalCount".equals(resKey)){//合计放在末尾
- tail = content;
- }else {
- sb.append(content);
- }
- }
- return bodyPersonJudicialRiskInfoContentXZItem + sb.toString() + tail;
- }
-
- /**
- * 内容生成
- * @param key
- * @param obj
- * @return
- */
- private static String createBodyContentDes(String key, JSONObject obj) throws ParseException {
- if("personAntiFraudDescInfo".equals(key)){
- return createPafDescContent(key, obj);
- }else if("personAntiFraudScoreInfo".equals(key)){
- return createPersonAntiFraudScoreInfoContent(key, obj);
- }else if("personBaseInfo".equals(key)){//证件号码校验信息
- return createPersonBaseInfoContent(key, obj);
- }else if("policeCheckInfo".equals(key)){
- return createPoliceCheckInfoContent(key, obj);
- }else if("mobileCheckInfo".equals(key)){
- return createMobileCheckInfoContent(key, obj);
- }else if("mobileStatusInfo".equals(key)){
- return createMobileStatusInfoContent(key, obj);
- }else if("personRiskRosterInfo".equals(key)){
- return createPersonRiskRosterInfoContent(key, obj);
- }else if("personJudicialSFRiskInfo".equals(key)){
- return createPersonJudicialSFRiskInfoContent(key, obj);
- }else if("personJudicialXZRiskInfo".equals(key)){
- return createPersonJudicialXZRiskInfoContent(key, obj);
- }
- return null;
- }
-
-
- public static String personJudicialRiskInfoContentSFItem =
- " \n" +
- " | judicialSFType | \n" +
- " oneYearCount | \n" +
- " twoYearCount | \n" +
- " fiveYearCount | \n" +
- " historyYearCount | \n" +
- "
\n";
-
- public static String personJudicialRiskInfoContentXZItem =
- " \n" +
- " | judicialXZType | \n" +
- " oneYearCount | \n" +
- " twoYearCount | \n" +
- " fiveYearCount | \n" +
- " historyYearCount | \n" +
- "
\n";
-
- public static String personJudicialRiskInfoContent =
- " \n" +
- " | 风险类型 | \n" +
- " 近1年 | \n" +
- " 近2年 | \n" +
- " 近5年 | \n" +
- " 历史 | \n" +
- "
\n" ;
-
- public static String personJudicialSFRiskInfo =
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- "  | \n" +
- " 司法风险汇总 | \n" +
- " \n" +
- " \n" +
- " | \n" +
- "
\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " | 司法涉诉 | \n" +
- " \n" +
- " \n" +
- " | \n" +
- "
\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " subContent \n" +
- " | \n" +
- "
\n" ;
-
- public static String personJudicialXZRiskInfo =
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " | 行政处罚 | \n" +
- " \n" +
- " \n" +
- " | \n" +
- "
\n" +
- " \n" +
- " \n" +
- " \n" +
- " \n" +
- " subContent \n" +
- " | \n" +
- "
";
-
-
-}
+package com.tenwa.httpclient.pypafhtml;
+ import com.alibaba.fastjson.JSONArray;
+ import com.alibaba.fastjson.JSONObject;
+ import com.google.common.collect.Lists;
+
+ import java.text.ParseException;
+ import java.text.SimpleDateFormat;
+ import java.util.ArrayList;
+ import java.util.Date;
+ import java.util.List;
+
+public class PyHtmlContent {
+ /**
+ * 统计时间段:1-近1年、2-近2年、3-近5年、4-历史
+ * 数据库表名和列字段对应关系
+ */
+ public enum JudicialXZCountTypeEnums{
+ taxPunishCount("taxPunishCount","税务处罚事件数量"),
+ marketPunishCount("marketPunishCount","市场监管处罚事件数量"),
+ customsPunishCount("customsPunishCount","海关处罚事件数量"),
+ environmentPunishCount("environmentPunishCount","环保处罚事件数量"),
+ otherPunishCount("otherPunishCount","其他行政处罚事件数量"),
+ punishTotalCount("punishTotalCount","(行政处罚事件)合计");
+
+ private String code; //类型
+ private String desc; //描述
+
+ private JudicialXZCountTypeEnums(String code, String desc){
+ this.code=code;
+ this.desc=desc;
+ }
+ public String getDesc() {
+ return desc;
+ }
+
+ public String getCode() {
+ return this.code;
+ }
+
+ /**
+ * 根据code 数据库表名的列字段
+ * @param code
+ * @return
+ */
+ public static String getValueData(String code){
+ for(JudicialXZCountTypeEnums data : JudicialXZCountTypeEnums.values()){
+ if(data.getCode().toLowerCase().equals(code.toLowerCase())){
+ return data.getDesc();
+ }
+ }
+ return "无";
+ }
+ }
+
+ /**
+ * 统计时间段:1-近1年、2-近2年、3-近5年、4-历史
+ * 数据库表名和列字段对应关系
+ */
+ public enum JudicialSFCountTypeEnums{
+ civilCaseCount("civilCaseCount","民事案件被告风险事件数量"),
+ criminalCaseCount("criminalCaseCount","刑事案件被告风险事件数量"),
+ judicialCount("judicialCount","司法被执行人风险事件数量"),
+ endCaseCount("endCaseCount","终本案件风险事件数量"),
+ breakFaithCount("breakFaithCount","失信被执行人风险事件数量"),
+ judicialTotalCount("judicialTotalCount","(司法涉诉风险事件)合计");
+
+ private String code; //类型
+ private String desc; //描述
+
+ private JudicialSFCountTypeEnums(String code, String desc){
+ this.code=code;
+ this.desc=desc;
+ }
+ public String getDesc() {
+ return desc;
+ }
+
+ public String getCode() {
+ return this.code;
+ }
+
+ /**
+ * 根据code 数据库表名的列字段
+ * @param code
+ * @return
+ */
+ public static String getValueData(String code){
+ for(JudicialSFCountTypeEnums data : JudicialSFCountTypeEnums.values()){
+ if(data.getCode().toLowerCase().equals(code.toLowerCase())){
+ return data.getDesc();
+ }
+ }
+ return "无";
+ }
+ }
+
+ /**
+ * 统计时间段:1-近1年、2-近2年、3-近5年、4-历史
+ * 数据库表名和列字段对应关系
+ */
+ public enum JudicialRiskTimeLengthEnums{
+ Length_1("1","oneYearCount"),
+ Length_2("2","twoYearCount"),
+ Length_3("3","fiveYearCount"),
+ Length_4("4","historyYearCount");
+
+ private String code; //类型
+ private String desc; //描述
+
+ private JudicialRiskTimeLengthEnums(String code, String desc){
+ this.code=code;
+ this.desc=desc;
+ }
+ public String getDesc() {
+ return desc;
+ }
+
+ public String getCode() {
+ return this.code;
+ }
+
+ /**
+ * 根据code 数据库表名的列字段
+ * @param code
+ * @return
+ */
+ public static String getValueData(String code){
+ for(JudicialRiskTimeLengthEnums data : JudicialRiskTimeLengthEnums.values()){
+ if(data.getCode().toLowerCase().equals(code.toLowerCase())){
+ return data.getDesc();
+ }
+ }
+ return "无";
+ }
+ }
+
+ /**
+ * 1:正常在用 2: 停机 3:未启用 4:已销号 6:预销号该值可能为空
+ * 数据库表名和列字段对应关系
+ */
+ public enum MobileStsEnums{
+ Sts_1("1","正常在用"),
+ Sts_2("2","停机"),
+ Sts_3("3","未启用"),
+ Sts_4("4","已销号"),
+ Sts_6("6","预销号该值可能为空");
+
+ private String code; //类型
+ private String desc; //描述
+
+ private MobileStsEnums(String code, String desc){
+ this.code=code;
+ this.desc=desc;
+ }
+ public String getDesc() {
+ return desc;
+ }
+
+ public String getCode() {
+ return this.code;
+ }
+
+ /**
+ * 根据code 数据库表名的列字段
+ * @param code
+ * @return
+ */
+ public static String getValueData(String code){
+ for(MobileStsEnums data : MobileStsEnums.values()){
+ if(data.getCode().toLowerCase().equals(code.toLowerCase())){
+ return data.getDesc();
+ }
+ }
+ return "无";
+ }
+ }
+ //1:不足3个月 2:3-6个月 3:6-12个月 4:12-24个月 5:24个月
+ /**
+ * 数据库表名和列字段对应关系
+ */
+ public enum MobileTimeLengthEnums{
+ Length_1("1","不足3个月"),
+ Length_2("2","3-6个月"),
+ Length_3("3","6-12个月"),
+ Length_4("4","12-24个月"),
+ Length_5("5","24个月");
+
+ private String code; //类型
+ private String desc; //描述
+
+ private MobileTimeLengthEnums(String code, String desc){
+ this.code=code;
+ this.desc=desc;
+ }
+ public String getDesc() {
+ return desc;
+ }
+
+ public String getCode() {
+ return this.code;
+ }
+
+ /**
+ * 根据code 数据库表名的列字段
+ * @param code
+ * @return
+ */
+ public static String getValueData(String code){
+ for(MobileTimeLengthEnums data : MobileTimeLengthEnums.values()){
+ if(data.getCode().toLowerCase().equals(code.toLowerCase())){
+ return data.getDesc();
+ }
+ }
+ return "无";
+ }
+ }
+
+ /**
+ * 数据库表名和列字段对应关系
+ */
+ public enum MobileOperatorEnums{
+ DX("1","中国电信"),
+ YD("2","中国移动"),
+ LT("3","中国联通");
+
+ private String code; //类型
+ private String desc; //描述
+
+ private MobileOperatorEnums(String code, String desc){
+ this.code=code;
+ this.desc=desc;
+ }
+ public String getDesc() {
+ return desc;
+ }
+
+ public String getCode() {
+ return this.code;
+ }
+
+ /**
+ * 根据code 数据库表名的列字段
+ * @param code
+ * @return
+ */
+ public static String getValueData(String code){
+ for(MobileOperatorEnums data : MobileOperatorEnums.values()){
+ if(data.getCode().toLowerCase().equals(code.toLowerCase())){
+ return data.getDesc();
+ }
+ }
+ return "无";
+ }
+ }
+
+ /**
+ * 数据库表名和列字段对应关系
+ */
+ public enum PafEnums{
+ personAntiFraudDescInfo("personAntiFraudDescInfo","欺诈风险汇总", PyHtmlContent.personAntiFraudDescInfo),
+ personAntiFraudScoreInfo("personAntiFraudScoreInfo","欺诈风险指数", PyHtmlContent.personAntiFraudScoreInfo),
+ personBaseInfo("personBaseInfo","身份信息校验", PyHtmlContent.personBaseInfo),
+ policeCheckInfo("policeCheckInfo","身份认证结果", PyHtmlContent.policeCheckInfo),
+ mobileCheckInfo("mobileCheckInfo","手机号信息校验", PyHtmlContent.mobileCheckInfo),
+ mobileStatusInfo("mobileStatusInfo","手机号码时长", PyHtmlContent.mobileStatusInfo),
+ personRiskRosterInfo("personRiskRosterInfo","命中名单", PyHtmlContent.personRiskRosterInfo),
+ personJudicialSFRiskInfo("personJudicialSFRiskInfo","司法查询", PyHtmlContent.personJudicialSFRiskInfo),
+ personJudicialXZRiskInfo("personJudicialXZRiskInfo","行政查询", PyHtmlContent.personJudicialXZRiskInfo);
+
+ private String code; //类型
+ private String htmlContent; //类型
+ private String desc; //描述
+
+ private PafEnums(String code, String desc, String htmlContent){
+ this.code=code;
+ this.desc=desc;
+ this.htmlContent=htmlContent;
+ }
+ public String getDesc() {
+ return desc;
+ }
+ public String getHtmlContent() {
+ return htmlContent;
+ }
+
+ public String getCode() {
+ return this.code;
+ }
+
+ /**
+ * 根据code 数据库表名的列字段
+ * @param code
+ * @return
+ */
+ public static String getValueData(String code){
+ for(PafEnums data : PafEnums.values()){
+ if(data.getCode().toLowerCase().equals(code.toLowerCase())){
+ return data.getHtmlContent();
+ }
+ }
+ return "无";
+ }
+ }
+
+ /**
+ * 数据库表名和列字段对应关系
+ */
+ public enum PersonAntiFraudDescInfoEnums{
+ antiFraudScore("antiFraudScore","欺诈风险指数"),
+ antiFraudScoreRiskLevel("antiFraudScoreRiskLevel","欺诈风险指数风险等级"),
+ policeCheckRiskLevel("policeCheckRiskLevel","身份认证结果风险等级"),
+ policeCheckDesc("policeCheckDesc","身份认证结果"),
+ mobileCheckRiskLevel("mobileCheckRiskLevel","手机号码核查结果风险等级"),
+ mobileCheckDesc("mobileCheckDesc","手机号码核查结果"),
+ mobileStatusRiskLevel("mobileStatusRiskLevel","手机号码状态及在网时长结果风险等级"),
+ mobileStatusDesc("mobileStatusDesc","手机号码状态及在网时长结果"),
+ riskRosterRiskLevel("riskRosterRiskLevel","风险名单结果风险等级"),
+ riskRosterDesc("riskRosterDesc","风险名单结果"),
+ judicialRiskLevel("judicialRiskLevel","司法风险结果风险等级"),
+ judicialRiskDesc("judicialRiskDesc","司法风险结果");
+
+ private String code; //类型
+ private String desc; //描述
+
+ private PersonAntiFraudDescInfoEnums(String code, String desc){
+ this.code=code;
+ this.desc=desc;
+ }
+ public String getDesc() {
+ return desc;
+ }
+
+ public String getCode() {
+ return this.code;
+ }
+
+ /**
+ * 根据code 数据库表名的列字段
+ * @param code
+ * @return
+ */
+ public static String getValueData(String code){
+ for(PersonAntiFraudDescInfoEnums data : PersonAntiFraudDescInfoEnums.values()){
+ if(data.getCode().toLowerCase().equals(code.toLowerCase())){
+ return data.getDesc();
+ }
+ }
+ return "无";
+ }
+ }
+
+ /**
+ * 数据库表名和列字段对应关系
+ */
+ public enum RiskType{
+ risk_000("000","未命中风险名单"),
+ risk_101("101","疑似欺诈风险"),
+ risk_102("102","疑似营销套利"),
+ risk_201("201","疑似身份造假"),
+ risk_202("202","疑似资料造假"),
+ risk_203("203","疑似盗号风险"),
+ risk_301("301","刑事被告"),
+ risk_302("302","民事被告"),
+ risk_303("303","司法被执行人"),
+ risk_304("304","终本案件人员"),
+ risk_305("305","司法失信人员"),
+ risk_306("306","行政处罚人员"),
+ risk_999("999","其他风险");
+
+ private String code; //类型
+ private String desc; //描述
+
+ private RiskType(String code, String desc){
+ this.code=code;
+ this.desc=desc;
+ }
+ public String getDesc() {
+ return desc;
+ }
+
+ public String getCode() {
+ return this.code;
+ }
+
+ /**
+ * 根据code 数据库表名的列字段
+ * @param code
+ * @return
+ */
+ public static String getValueData(String code){
+ for(RiskType data : RiskType.values()){
+ if(data.getCode().toLowerCase().equals(code.toLowerCase())){
+ return data.getDesc();
+ }
+ }
+ return "未命中风险名单";
+ }
+ }
+
+ /**
+ * 内容开始部分
+ * @param obj
+ * @return
+ */
+ public static String createBodyHead(JSONObject obj) throws ParseException {
+ StringBuilder sb = new StringBuilder();
+ String bodyTitle = title;
+ bodyTitle = bodyTitle.replace("reportID", obj.getString("reportID"));
+ sb.append(bodyTitle);
+ String bodyQueryConditions = queryConditions;
+ JSONObject queryConditionsObj = obj.getJSONObject("queryConditionsObj");
+ bodyQueryConditions = bodyQueryConditions.replace("name", queryConditionsObj.getString("name"));
+ bodyQueryConditions = bodyQueryConditions.replace("documentNo", queryConditionsObj.getString("documentNo"));
+ bodyQueryConditions = bodyQueryConditions.replace("unitName", obj.getString("unitName"));
+ bodyQueryConditions = bodyQueryConditions.replace("queryUserID", obj.getString("queryUserID"));
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+ Date birDate = sdf.parse(obj.getString("receiveTime").substring(0, 8));
+ SimpleDateFormat sdfRes = new SimpleDateFormat("yyyy年MM月dd日");
+ String birStr = sdfRes.format(birDate);
+ bodyQueryConditions = bodyQueryConditions.replace("receiveTime", birStr);
+ sb.append(bodyQueryConditions);
+ String bodyBContentPafQuery = bodyContentPafQuery;
+ bodyBContentPafQuery = bodyBContentPafQuery.replace("phone", queryConditionsObj.getString("phone"));
+ sb.append(bodyBContentPafQuery);
+ return sb.toString();
+ }
+
+ public static String title = " reportID" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" ;
+
+ public static String queryConditions =
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " | 姓名 | \n" +
+ " name | \n" +
+// " 熊海 | \n" +
+ " 查询时间 | \n" +
+ " receiveTime | \n" +
+// " 2020年07月28日 | \n" +
+ " \n" +
+ " \n" +
+ " | 证件号码 | \n" +
+ " documentNo | \n" +
+// " 360123*********978 | \n" +
+ " 操作员 | \n" +
+ " queryUserID | \n" +
+// " apwsqueryn | \n" +
+ " \n" +
+ " \n" +
+ " | 查询机构 | \n" +
+ " unitName | \n" +
+// " 安鹏融资租赁(天津)有限公司 | \n" +
+ " \n" +
+ " \n" +
+ " | \n" +
+ "
\n" ;
+
+ //反欺诈附件条件
+ public static String bodyContentPafQuery =
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "  | \n" +
+ " 反欺诈分析附加条件 | \n" +
+ " \n" +
+ " \n" +
+ " | \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " | 手机号码 | \n" +
+ " phone | \n" +
+ " \n" +
+ " \n" +
+ " | \n" +
+ "
\n" ;
+
+
+ public static String contentError = "| errorMessage |
";
+ public static String contentEmpty = "|
| errorMessage |
";
+
+
+ /**
+ * 反欺诈信息汇总
+ * @param obj
+ * @return
+ */
+ private static String createBaseContent(String key, String content, JSONObject obj) throws ParseException {
+ String bodyContentError = contentError;
+ String bodyContentEmpty = contentEmpty;
+ String bodyContent = content;
+ String subContent = "";
+ String jsonKey = key;
+ if("personJudicialSFRiskInfo".equals(key) || "personJudicialXZRiskInfo".equals(key)){
+ jsonKey = "personJudicialRiskInfo";
+ }
+ JSONObject keyObj = obj.getJSONObject(jsonKey);
+ String errorMessage = "";
+ if(keyObj.containsKey("errorMessage")){
+ errorMessage = keyObj.getString("errorMessage");
+ }
+ if("3".equals(keyObj.getString("treatResult"))){//系统错误,默认包含细节
+ if(null == errorMessage || "".equals(errorMessage)){
+ errorMessage = "系统错误。";
+ }
+ bodyContentError = bodyContentError.replace("errorMessage", errorMessage);
+ subContent = bodyContentError;
+ }else{//如果包含细节
+ subContent = createBodyContentDes(key, obj);
+ }
+ if(null == subContent || "".equals(subContent.toString())){
+ subContent = bodyContentEmpty.replace("errorMessage", "根据已提供的查询条件,未能在系统中查得相关信息。");
+ }
+ bodyContent = bodyContent.replace("subContent", subContent);
+ return bodyContent;
+ }
+
+
+
+ /**
+ *
+ * @param obj
+ * @return
+ */
+ public static String createBodyContent(JSONObject obj) throws ParseException {
+ StringBuilder sb = new StringBuilder();
+ for(PafEnums pe : PafEnums.values()){
+ String jsonKey = pe.getCode();
+ if("personJudicialSFRiskInfo".equals(pe.getCode()) || "personJudicialXZRiskInfo".equals(pe.getCode())){
+ jsonKey = "personJudicialRiskInfo";
+ }
+ JSONObject keyObj = obj.getJSONObject(jsonKey);
+ String treatResult = keyObj.getString("treatResult");
+ //是否包含细节内容
+ boolean addContentB = false;
+ List resKeyArr =
+ Lists.newArrayList("subReportType", "subReportTypeCost", "treatResult", "treatErrorCode", "errorMessage");
+ for(String keyRes : keyObj.keySet()){
+ if(!resKeyArr.contains(keyRes) || "3".equals(treatResult)){
+ addContentB = true;
+ }
+ }
+ if(addContentB){
+ String content = createBaseContent(pe.getCode(), pe.getHtmlContent(), obj);
+ sb.append(content);
+ }
+ }
+ return sb.toString();
+ }
+
+ /**
+ * 反欺诈信息汇总
+ * @param obj
+ * @return
+ */
+ private static String createPafDescContent(String key, JSONObject obj){
+ String bodyPersonAntiFraudDescInfoContent = personAntiFraudDescInfoContent;
+ JSONObject subObj = obj.getJSONObject(key);
+ // TODO: 2020/7/29 增加判断空 antiFraudScore
+ String antiFraudScore = subObj.getString("antiFraudScore");
+ bodyPersonAntiFraudDescInfoContent = bodyPersonAntiFraudDescInfoContent.replace("antiFraudScore", subObj.getString("antiFraudScore"));
+ StringBuilder sbContent = new StringBuilder();
+ for(PersonAntiFraudDescInfoEnums pe : PersonAntiFraudDescInfoEnums.values()){
+ if(null != subObj.getString(pe.getCode())
+ && !"".equals(subObj.getString(pe.getCode()))){
+ String subContent = personAntiFraudDescInfoContentItem;
+ String imgStatus = "image_success";
+ // TODO: 2020/7/29 如果包含 不正常 高风险 则改为 imgage_error
+ String result = subObj.getString(pe.getCode());
+ if("antiFraudScore".equals(pe.getCode())) {
+ if(Integer.parseInt(result) > 500){
+ imgStatus = "image_error";
+ }
+ }else if("policeCheckDesc".equals(pe.getCode())){
+ String resPre = subObj.getString("policeCheckRiskLevel");
+ if(resPre.contains("高风险")){
+ imgStatus = "image_error";
+ }else if(resPre.contains("中风险")){
+ imgStatus = "image_warn";
+ }
+ }else if("mobileCheckDesc".equals(pe.getCode())){
+ String resPre = subObj.getString("mobileCheckRiskLevel");
+ if(resPre.contains("高风险")){
+ imgStatus = "image_error";
+ }else if(resPre.contains("中风险")){
+ imgStatus = "image_warn";
+ }
+ }else if("mobileStatusDesc".equals(pe.getCode())){
+ String resPre = subObj.getString("mobileStatusRiskLevel");
+ if(resPre.contains("高风险")){
+ imgStatus = "image_error";
+ }else if(resPre.contains("中风险")){
+ imgStatus = "image_warn";
+ }
+ }else if("judicialRiskDesc".equals(pe.getCode())){
+ String resPre = subObj.getString("judicialRiskLevel");
+ if(resPre.contains("高风险")){
+ imgStatus = "image_error";
+ }else if(resPre.contains("中风险")){
+ imgStatus = "image_warn";
+ }
+ }else if("riskRosterDesc".equals(pe.getCode())){
+ if(!"未命中风险名单".equals(result)){
+ imgStatus = "image_error";
+ }
+ }
+ if(result.contains("高风险")){
+ imgStatus = "image_error";
+ }
+ String pafDesc = pe.getDesc() + ":" + subObj.getString(pe.getCode());
+ subContent = subContent.replace("image_status", imgStatus);
+ subContent = subContent.replace("pafDesc", pafDesc);
+ sbContent.append(subContent);
+ }
+ }
+ bodyPersonAntiFraudDescInfoContent = bodyPersonAntiFraudDescInfoContent.replace("contentItem", sbContent.toString());
+ return bodyPersonAntiFraudDescInfoContent;
+ }
+
+ //反欺诈分析综述
+ public static String personAntiFraudDescInfoContentItem =
+ " 
pafDesc
";
+
+ //反欺诈分析综述
+ public static String personAntiFraudDescInfoContent =
+ " \n" +
+ " | 欺诈风险指数为 antiFraudScore 分 | \n" +
+ "
\n" +
+ " \n" +
+ " | contentItem | \n" +
+ "
\n" ;
+ //反欺诈分析综述
+ public static String personAntiFraudDescInfo =
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "  | \n" +
+ " 反欺诈分析综述 | \n" +
+ " \n" +
+ " \n" +
+ " | \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " subContent \n" +
+ " | \n" +
+ "
\n" ;
+
+ /**
+ * 反欺诈指数
+ * @param obj
+ * @return
+ */
+ private static String createPersonAntiFraudScoreInfoContent(String key, JSONObject obj){
+ String bodyPersonAntiFraudScoreInfoContent = personAntiFraudScoreInfoContent;
+ JSONObject subObj = obj.getJSONObject(key);
+ bodyPersonAntiFraudScoreInfoContent = bodyPersonAntiFraudScoreInfoContent.replace("riskScore", subObj.getString("riskScore"));
+ bodyPersonAntiFraudScoreInfoContent = bodyPersonAntiFraudScoreInfoContent.replace("riskLevel", subObj.getString("riskLevel"));
+ bodyPersonAntiFraudScoreInfoContent = bodyPersonAntiFraudScoreInfoContent.replace("hitTypes", subObj.getString("hitTypes"));
+ return bodyPersonAntiFraudScoreInfoContent;
+ }
+
+ //反欺诈分析指数
+ public static String personAntiFraudScoreInfoContent =
+ " | 欺诈风险指数为 riskScore 分 |
\n" +
+ "| 欺诈风险等级为 riskLevel |
\n" +
+ "| 欺诈风险标签为 hitTypes |
\n" ;
+
+ //反欺诈分析指数【图片删掉】
+ public static String personAntiFraudScoreInfo =
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "  | \n" +
+ " 欺诈风险指数 | \n" +
+ " \n" +
+ " \n" +
+ " | \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " subContent \n" +
+ " | \n" +
+ "
\n" ;
+
+ /**
+ * 证件号码校验信息
+ * @param obj
+ * @return
+ */
+ private static String createPersonBaseInfoContent(String key, JSONObject obj) throws ParseException {
+ String bodyPersonBaseInfoContent = personBaseInfoContent;
+ JSONObject subObj = obj.getJSONObject(key);
+ bodyPersonBaseInfoContent = bodyPersonBaseInfoContent.replace("docNo", subObj.getString("docNo"));
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+ Date birDate = sdf.parse(subObj.getString("birthday"));
+ SimpleDateFormat sdfRes = new SimpleDateFormat("yyyy年MM月dd日");
+ String birStr = sdfRes.format(birDate);
+ bodyPersonBaseInfoContent = bodyPersonBaseInfoContent.replace("birthday", birStr);
+ String genderId = subObj.getString("genderID");
+ if("1".equals(genderId)){
+ genderId = "男";
+ }else if("2".equals(genderId)){
+ genderId = "女";
+ }else if("3".equals(genderId)){
+ genderId = "不详";
+ }
+ bodyPersonBaseInfoContent = bodyPersonBaseInfoContent.replace("genderID", genderId);
+ bodyPersonBaseInfoContent = bodyPersonBaseInfoContent.replace("age", subObj.getString("age"));
+ bodyPersonBaseInfoContent = bodyPersonBaseInfoContent.replace("originalAddress", subObj.getString("originalAddress"));
+ bodyPersonBaseInfoContent = bodyPersonBaseInfoContent.replace("verifyResult", "1".equals(subObj.getString("verifyResult")) ? "通过" : "未通过");
+ return bodyPersonBaseInfoContent;
+ }
+
+ //证件号码校验信息
+ public static String personBaseInfoContent =
+ " \n" +
+ " | 证件号码 | \n" +
+ " docNo | \n" +
+ " 出生日期 | \n" +
+ " birthday | \n" +
+ "
\n" +
+ " \n" +
+ " | 性别 | \n" +
+ " genderID | \n" +
+ " 年龄 | \n" +
+ " age | \n" +
+ "
\n" +
+ " \n" +
+ " | 原始发证地区 | \n" +
+ " originalAddress | \n" +
+ "
\n" +
+ " \n" +
+ " | 证件校验结果 | \n" +
+ " verifyResult | \n" +
+ "
\n" ;
+
+ //证件号码校验信息
+ public static String personBaseInfo =
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "  | \n" +
+ " 证件号码校验信息 | \n" +
+ " \n" +
+ " \n" +
+ " | \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " subContent \n" +
+ " | \n" +
+ "
\n";
+
+
+ /**
+ * 证件号码校验信息
+ * @param obj
+ * @return
+ */
+ private static String createPoliceCheckInfoContent(String key, JSONObject obj){
+ StringBuilder sb = new StringBuilder();
+ JSONObject arrObj = obj.getJSONObject(key);
+ JSONArray subArr = arrObj.getJSONArray("item");
+ for(int i = 0; i < subArr.size(); i++){
+ JSONObject subObj = subArr.getJSONObject(i);
+ String bodyPoliceCheckInfoContent = policeCheckInfoContent;
+ bodyPoliceCheckInfoContent = bodyPoliceCheckInfoContent.replace("result",
+ "1".equals(subObj.getString("result")) ? "一致" : "不一致");
+ sb.append(bodyPoliceCheckInfoContent);
+ }
+ return sb.toString();
+ }
+
+ //证件号码认证结果
+ public static String policeCheckInfoContent =
+ " \n" +
+ " | 身份认证结果 | \n" +
+ " result | \n" +
+ "
\n" ;
+
+ //证件号码认证结果
+ public static String policeCheckInfo =
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "  | \n" +
+ " 身份认证 | \n" +
+ " \n" +
+ " \n" +
+ " | \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " subContent \n" +
+ " | \n" +
+ "
\n";
+
+ /**
+ * 手机号码校验信息结果
+ * @param obj
+ * @return
+ */
+ private static String createMobileCheckInfoContent(String key, JSONObject obj){
+ StringBuilder sb = new StringBuilder();
+ JSONObject arrObj = obj.getJSONObject(key);
+ JSONArray subArr = arrObj.getJSONArray("item");
+ for(int i = 0; i < subArr.size(); i++){
+ JSONObject subObj = subArr.getJSONObject(i);
+ String bodyMobileCheckInfoContent = mobileCheckInfoContent;
+ bodyMobileCheckInfoContent = bodyMobileCheckInfoContent.replace("checkResult", subObj.getString("checkResult"));
+ bodyMobileCheckInfoContent = bodyMobileCheckInfoContent.replace("areaInfo", subObj.getString("areaInfo"));
+ bodyMobileCheckInfoContent = bodyMobileCheckInfoContent.replace("operator", MobileOperatorEnums.getValueData(subObj.getString("operator")));
+ sb.append(bodyMobileCheckInfoContent);
+ }
+ return sb.toString();
+ }
+
+
+ //手机号码校验信息结果
+ public static String mobileCheckInfoContent =
+ " \n" +
+ " | 运营商名称 | \n" +
+ " operator | \n" +
+ "
\n" +
+ " \n" +
+ " | 手机号码归属地 | \n" +
+ " areaInfo | \n" +
+ "
\n" +
+ " \n" +
+ " | 手机认证结果 | \n" +
+ " checkResult | \n" +
+ "
\n" ;
+ //手机号码校验信息结果
+ public static String mobileCheckInfo =
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "  | \n" +
+ " 手机认证 | \n" +
+ " \n" +
+ " \n" +
+ " | \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " subContent \n" +
+ " | \n" +
+ "
\n";
+
+ /**
+ * 手机号码在线时长
+ * @param obj
+ * @return
+ */
+ private static String createMobileStatusInfoContent(String key, JSONObject obj){
+ StringBuilder sb = new StringBuilder();
+ JSONObject arrObj = obj.getJSONObject(key);
+ JSONArray subArr = arrObj.getJSONArray("item");
+ for(int i = 0; i < subArr.size(); i++){
+ JSONObject subObj = subArr.getJSONObject(i);
+ String bodyMobileStatusInfoContent = mobileStatusInfoContent;
+ bodyMobileStatusInfoContent = bodyMobileStatusInfoContent.replace("timeLength", MobileTimeLengthEnums.getValueData(subObj.getString("timeLength")));
+ bodyMobileStatusInfoContent = bodyMobileStatusInfoContent.replace("phoneStatus", MobileStsEnums.getValueData(subObj.getString("phoneStatus")));
+ sb.append(bodyMobileStatusInfoContent);
+ }
+ return sb.toString();
+ }
+
+
+ //手机号码在线时长
+ public static String mobileStatusInfoContent =
+ " \n" +
+ " | 手机号码状态 | \n" +
+ " phoneStatus | \n" +
+ "
\n" +
+ " \n" +
+ " | 手机号码在网时长 | \n" +
+ " timeLength | \n" +
+ "
\n" ;
+
+ //手机号码在线时长
+ public static String mobileStatusInfo =
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "  | \n" +
+ " 手机号码状态时长 | \n" +
+ " \n" +
+ " \n" +
+ " | \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+
+ " subContent \n" +
+ " | \n" +
+ "
\n";
+
+
+ /**
+ * 风险名单命中结果
+ * @param obj
+ * @return
+ */
+ private static String createPersonRiskRosterInfoContent(String key, JSONObject obj){
+ String bodyPersonRiskRosterInfoContent = personRiskRosterInfoContent;
+ JSONObject subObj = obj.getJSONObject(key);
+ StringBuilder sb = new StringBuilder();
+ // TODO: 2020/7/29 判断为空
+ String[] riskTypes = subObj.getString("riskTypes").split(",");
+ for(String riskType : riskTypes){
+ sb.append(RiskType.getValueData(riskType) + ", ");
+ }
+ String risk = sb.toString();
+ risk = risk.substring(0, risk.length() - 2);
+ bodyPersonRiskRosterInfoContent = bodyPersonRiskRosterInfoContent.replace("riskTypes", risk);
+ return bodyPersonRiskRosterInfoContent;
+ }
+
+ //风险名单命中结果
+ public static String personRiskRosterInfoContent =
+ " \n" +
+ " | 命中风险类型 | \n" +
+ " riskTypes | \n" +
+ "
\n" ;
+
+ //风险名单命中结果
+ public static String personRiskRosterInfo =
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "  | \n" +
+ " 风险名单 | \n" +
+ " \n" +
+ " \n" +
+ " | \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " subContent \n" +
+ " | \n" +
+ "
\n";
+
+
+ /**
+ * 风险名单命中结果
+ * @param obj
+ * @return
+ */
+ private static String createPersonJudicialSFRiskInfoContent(String key, JSONObject obj){
+ String bodyPersonJudicialRiskInfoContentSFItem = personJudicialRiskInfoContent;
+ String tail = "";
+ //obj转换
+ JSONObject resObj = new JSONObject();
+ JSONObject civilCaseCount = new JSONObject();
+ JSONObject criminalCaseCount = new JSONObject();
+ JSONObject judicialCount = new JSONObject();
+ JSONObject endCaseCount = new JSONObject();
+ JSONObject breakFaithCount = new JSONObject();
+ JSONObject judicialTotalCount = new JSONObject();
+ resObj.put("civilCaseCount", civilCaseCount);
+ resObj.put("criminalCaseCount", criminalCaseCount);
+ resObj.put("judicialCount", judicialCount);
+ resObj.put("endCaseCount", endCaseCount);
+ resObj.put("breakFaithCount", breakFaithCount);
+ resObj.put("judicialTotalCount", judicialTotalCount);
+ JSONObject subObj = obj.getJSONObject("personJudicialRiskInfo");
+ JSONArray subArr = subObj.getJSONArray("item");
+ for(int i = 0; i < subArr.size(); i++){
+ JSONObject subJson = subArr.getJSONObject(i);
+ String resKey = JudicialRiskTimeLengthEnums.getValueData(subJson.getString("timePeriod"));
+ for(String subKey : subJson.keySet()){
+ for(String resSubKey : resObj.keySet()){
+ if(subKey.equals(resSubKey)){
+ JSONObject resSubObj = resObj.getJSONObject(resSubKey);
+ resSubObj.put(resKey, subJson.getString(subKey));
+ }
+ }
+ }
+ }
+ StringBuilder sb = new StringBuilder();
+ //循环
+ for(String resKey : resObj.keySet()){
+ JSONObject resJson = resObj.getJSONObject(resKey);
+ String content = personJudicialRiskInfoContentSFItem;
+ content = content.replace("judicialSFType", JudicialSFCountTypeEnums.getValueData(resKey));
+ for(JudicialRiskTimeLengthEnums je : JudicialRiskTimeLengthEnums.values()){
+ content = content.replace(je.getDesc(), resJson.getString(je.getDesc()));
+ }
+ if("judicialTotalCount".equals(resKey)){//合计放在末尾
+ tail = content;
+ }else {
+ sb.append(content);
+ }
+ }
+ return bodyPersonJudicialRiskInfoContentSFItem + sb.toString() + tail;
+ }
+ /**
+ * 风险名单命中结果
+ * @param obj
+ * @return
+ */
+ private static String createPersonJudicialXZRiskInfoContent(String key, JSONObject obj){
+ String bodyPersonJudicialRiskInfoContentXZItem = personJudicialRiskInfoContent;
+ String tail = "";
+ //obj转换
+ JSONObject resObj = new JSONObject();
+ JSONObject taxPunishCount = new JSONObject();
+ JSONObject marketPunishCount = new JSONObject();
+ JSONObject customsPunishCount = new JSONObject();
+ JSONObject environmentPunishCount = new JSONObject();
+ JSONObject otherPunishCount = new JSONObject();
+ JSONObject punishTotalCount = new JSONObject();
+ resObj.put("taxPunishCount", taxPunishCount);
+ resObj.put("marketPunishCount", marketPunishCount);
+ resObj.put("customsPunishCount", customsPunishCount);
+ resObj.put("environmentPunishCount", environmentPunishCount);
+ resObj.put("otherPunishCount", otherPunishCount);
+ resObj.put("punishTotalCount", punishTotalCount);
+ JSONObject subObj = obj.getJSONObject("personJudicialRiskInfo");
+ JSONArray subArr = subObj.getJSONArray("item");
+ for(int i = 0; i < subArr.size(); i++){
+ JSONObject subJson = subArr.getJSONObject(i);
+ String resKey = JudicialRiskTimeLengthEnums.getValueData(subJson.getString("timePeriod"));
+ for(String subKey : subJson.keySet()){
+ for(String resSubKey : resObj.keySet()){
+ if(subKey.equals(resSubKey)){
+ JSONObject resSubObj = resObj.getJSONObject(resSubKey);
+ resSubObj.put(resKey, subJson.getString(subKey));
+ }
+ }
+ }
+ }
+
+ StringBuilder sb = new StringBuilder();
+ System.out.println("resObj="+resObj.toJSONString());
+ //循环
+ for(String resKey : resObj.keySet()){
+ JSONObject resJson = resObj.getJSONObject(resKey);
+ String content = personJudicialRiskInfoContentXZItem;
+ content = content.replace("judicialXZType", JudicialXZCountTypeEnums.getValueData(resKey));
+ for(JudicialRiskTimeLengthEnums je : JudicialRiskTimeLengthEnums.values()){
+ content = content.replace(je.getDesc(), resJson.getString(je.getDesc()));
+ }
+ if("punishTotalCount".equals(resKey)){//合计放在末尾
+ tail = content;
+ }else {
+ sb.append(content);
+ }
+ }
+ return bodyPersonJudicialRiskInfoContentXZItem + sb.toString() + tail;
+ }
+
+ /**
+ * 内容生成
+ * @param key
+ * @param obj
+ * @return
+ */
+ private static String createBodyContentDes(String key, JSONObject obj) throws ParseException {
+ if("personAntiFraudDescInfo".equals(key)){
+ return createPafDescContent(key, obj);
+ }else if("personAntiFraudScoreInfo".equals(key)){
+ return createPersonAntiFraudScoreInfoContent(key, obj);
+ }else if("personBaseInfo".equals(key)){//证件号码校验信息
+ return createPersonBaseInfoContent(key, obj);
+ }else if("policeCheckInfo".equals(key)){
+ return createPoliceCheckInfoContent(key, obj);
+ }else if("mobileCheckInfo".equals(key)){
+ return createMobileCheckInfoContent(key, obj);
+ }else if("mobileStatusInfo".equals(key)){
+ return createMobileStatusInfoContent(key, obj);
+ }else if("personRiskRosterInfo".equals(key)){
+ return createPersonRiskRosterInfoContent(key, obj);
+ }else if("personJudicialSFRiskInfo".equals(key)){
+ return createPersonJudicialSFRiskInfoContent(key, obj);
+ }else if("personJudicialXZRiskInfo".equals(key)){
+ return createPersonJudicialXZRiskInfoContent(key, obj);
+ }
+ return null;
+ }
+
+
+ public static String personJudicialRiskInfoContentSFItem =
+ " \n" +
+ " | judicialSFType | \n" +
+ " oneYearCount | \n" +
+ " twoYearCount | \n" +
+ " fiveYearCount | \n" +
+ " historyYearCount | \n" +
+ "
\n";
+
+ public static String personJudicialRiskInfoContentXZItem =
+ " \n" +
+ " | judicialXZType | \n" +
+ " oneYearCount | \n" +
+ " twoYearCount | \n" +
+ " fiveYearCount | \n" +
+ " historyYearCount | \n" +
+ "
\n";
+
+ public static String personJudicialRiskInfoContent =
+ " \n" +
+ " | 风险类型 | \n" +
+ " 近1年 | \n" +
+ " 近2年 | \n" +
+ " 近5年 | \n" +
+ " 历史 | \n" +
+ "
\n" ;
+
+ public static String personJudicialSFRiskInfo =
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "  | \n" +
+ " 司法风险汇总 | \n" +
+ " \n" +
+ " \n" +
+ " | \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " | 司法涉诉 | \n" +
+ " \n" +
+ " \n" +
+ " | \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " subContent \n" +
+ " | \n" +
+ "
\n" ;
+
+ public static String personJudicialXZRiskInfo =
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " | 行政处罚 | \n" +
+ " \n" +
+ " \n" +
+ " | \n" +
+ "
\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " subContent \n" +
+ " | \n" +
+ "
";
+
+
+}
diff --git a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBProjectIntoTempInitCarBusiness.java b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBProjectIntoTempInitCarBusiness.java
index 17192e3b0..fd43c4c1c 100644
--- a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBProjectIntoTempInitCarBusiness.java
+++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/LBProjectIntoTempInitCarBusiness.java
@@ -318,6 +318,7 @@ public class LBProjectIntoTempInitCarBusiness extends BaseBussiness {
bmLEC.setAttributeValue("cartype",this.getAttribute("cartype"));
bmLEC.setAttributeValue("vehicletype",this.getAttribute("vehicletype"));
bmLEC.setAttributeValue("vehiclelevel",this.getAttribute("vehiclelevel"));
+ bmLEC.setAttributeValue("car_attribute","head");
if(lbat!=null){
bmLEC.setAttributeValue("FRAME_NUMBER", lbat.getAttribute("frame_number")+"");//车架号
bmLEC.setAttributeValue("mile", lbat.getAttribute("mile")+"");//公里数
diff --git a/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PaymentContractFileShiQiao.java b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PaymentContractFileShiQiao.java
new file mode 100644
index 000000000..c2b0e033b
--- /dev/null
+++ b/src_tenwa/com/tenwa/lease/flow/project/commbusiness/PaymentContractFileShiQiao.java
@@ -0,0 +1,78 @@
+package com.tenwa.lease.flow.project.commbusiness;
+
+import java.util.Map;
+
+import jbo.app.LB_DOCLIBRARY;
+import jbo.app.tenwa.doc.LB_DOCATTRIBUTE;
+import jbo.app.tenwa.doc.LB_DOC_CONTRACT_LIST;
+import jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT;
+
+import com.alibaba.fastjson.JSON;
+import com.amarsoft.are.jbo.BizObject;
+import com.amarsoft.are.jbo.BizObjectManager;
+import com.amarsoft.are.jbo.JBOFactory;
+import com.amarsoft.awe.util.Transaction;
+import com.amarsoft.context.ASUser;
+import com.tenwa.flow.baseBussion.BaseBussiness;
+import com.tenwa.httpclient.resources.InterfacePlatformConfigure;
+import com.tenwa.reckon.util.DateUtil;
+
+/**
+ * 付款申请业务申请将合同制作文件带到资料清单中(狮桥)
+ */
+public class PaymentContractFileShiQiao extends BaseBussiness {
+
+ @Override
+ public Object run(Transaction Sqlca) throws Exception {
+ this.initBussinessParam(Sqlca);
+ if (this.getAttribute("serial") == null) return "true";
+ String channel_shiqiao = InterfacePlatformConfigure.get("channel_shiqiao");
+ if (this.getAttribute("channel") != null && this.getAttribute("channel").toString().equals(channel_shiqiao)){
+ String projectId = this.getAttribute("ProjectId").toString();
+ BizObjectManager ldlm = JBOFactory.getBizObjectManager(LB_DOCLIBRARY.CLASS_NAME, Sqlca);
+ BizObject ldl = ldlm.createQuery("select * from O left join jbo.app.tenwa.doc.LB_DOCRELATIVE ldr on O.relative_id=ldr.id where ldr.proj_id=:projectId and ldr.objecttype='FundPaymentCarFlow' and O.DOC_CLASS_ITEMNO='037001' and O.Serial_Num='1' ").setParameter("projectId", projectId).getSingleResult(true);
+ if(ldl != null ){
+ String libraryId = ldl.getAttribute("id").getString();
+ if( libraryId!=null && libraryId.length()>0){
+ BizObjectManager ldclm = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME, Sqlca);
+ BizObject ldcl = ldclm.createQuery(" project_id=:project_id and file_flag='yes' ").setParameter("project_id", projectId).getSingleResult(false);
+ String attributeId = ldcl == null?"":ldcl.getAttribute("ATTRIBUTE_ID").getString();
+ String contractFlowUnid = ldcl == null?"":ldcl.getAttribute("FLOW_UNID").getString();
+ BizObjectManager fboMange = JBOFactory.getBizObjectManager(FLOW_BUSSINESS_OBJECT.CLASS_NAME);
+ BizObject fbo = fboMange.createQuery("flow_unid=:flow_unid").setParameter("flow_unid", contractFlowUnid).getSingleResult(false);
+ Map flowParms = JSON.parseObject(fbo.getAttribute("FixedFlowParam").getString(),Map.class);
+ String signType = flowParms.get("signType");
+ if("Electronic".equals(signType)){
+ BizObjectManager ldam = JBOFactory.getBizObjectManager(LB_DOCATTRIBUTE.CLASS_NAME, Sqlca);
+ BizObject lda = ldam.createQuery(" library_id=:library_id ").setParameter("library_id", libraryId).getSingleResult(true);
+ BizObject ldaMeta = ldam.createQuery(" id=:id ").setParameter("id", attributeId).getSingleResult(false);
+ if(lda!=null && ldaMeta!=null ){
+ lda.setAttributeValue("FILEPATH", ldaMeta.getAttribute("FILEPATH").getString());
+ lda.setAttributeValue("FULLPATH", ldaMeta.getAttribute("FULLPATH").getString());
+ lda.setAttributeValue("FILENAME", ldaMeta.getAttribute("FILENAME").getString());
+ lda.setAttributeValue("FILESIZE", ldaMeta.getAttribute("FILESIZE").getString());
+ }else if(lda ==null && ldaMeta!=null ){
+ String userId = this.getAttribute("CurUserID").toString();
+ ASUser asUser = new ASUser(userId);
+ lda = ldam.newObject();
+ lda.setAttributeValue("LIBRARY_ID", libraryId);
+ lda.setAttributeValue("FILEPATH", ldaMeta.getAttribute("FILEPATH").getString());
+ lda.setAttributeValue("FULLPATH", ldaMeta.getAttribute("FULLPATH").getString());
+ lda.setAttributeValue("FILENAME", ldaMeta.getAttribute("FILENAME").getString());
+ lda.setAttributeValue("FILESIZE", ldaMeta.getAttribute("FILESIZE").getString());
+ lda.setAttributeValue("INPUTUSERID", userId);
+ lda.setAttributeValue("INPUTORGID", asUser.getOrgID());
+ lda.setAttributeValue("INPUTTIME", DateUtil.getSystemTimeByFormat("yyyy/MM/dd HH:mm:ss:sss"));
+ lda.setAttributeValue("CONTENT_TYPE", "application/pdf");
+ lda.setAttributeValue("OBJECTTYPE", "FundPaymentCarFlow");
+ }
+ ldam.saveObject(lda);
+ }
+ }
+ ldl.setAttributeValue("BUSINESS_CHECK", "DocCheck_0");
+ ldlm.saveObject(ldl);
+ }
+ }
+ return "true";
+ }
+}
diff --git a/src_tenwa/com/tenwa/lease/flow/rent/rentreback/LCRentIncomeTempToFormalBusiness.java b/src_tenwa/com/tenwa/lease/flow/rent/rentreback/LCRentIncomeTempToFormalBusiness.java
index e54ec7364..fbcd4e640 100644
--- a/src_tenwa/com/tenwa/lease/flow/rent/rentreback/LCRentIncomeTempToFormalBusiness.java
+++ b/src_tenwa/com/tenwa/lease/flow/rent/rentreback/LCRentIncomeTempToFormalBusiness.java
@@ -1,77 +1,78 @@
-package com.tenwa.lease.flow.rent.rentreback;
-
-import java.math.BigDecimal;
-import java.util.List;
-import java.util.Map;
-
-import jbo.app.tenwa.calc.LC_FUND_INCOME;
-import jbo.app.tenwa.calc.LC_FUND_INCOME_TEMP;
-import jbo.app.tenwa.calc.LC_RENT_INCOME;
-import jbo.app.tenwa.calc.LC_RENT_INCOME_TEMP;
-import jbo.app.tenwa.calc.LC_RENT_PLAN;
-
-import com.amarsoft.are.jbo.BizObject;
-import com.amarsoft.are.jbo.BizObjectManager;
-import com.amarsoft.are.jbo.JBOFactory;
-import com.amarsoft.awe.util.Transaction;
-import com.tenwa.comm.util.jboutil.DataOperatorUtil;
-import com.tenwa.flow.baseBussion.BaseBussiness;
-import com.tenwa.lease.flow.comm.service.LeaseFlowBaseService;
-import com.tenwa.lease.flow.comm.service.ServiceOperatorEnum;
-import com.tenwa.lease.flow.comm.serviceImp.LeaseFlowBaseServiceImp;
-
-public class LCRentIncomeTempToFormalBusiness extends BaseBussiness{
- public Object run(Transaction Sqlca) throws Exception{
- this.initBussinessParam(Sqlca);
- LeaseFlowBaseService service=new LeaseFlowBaseServiceImp();
- MapfromCondtion=this.getDefaultTempToFormalFromCondtion();
- //将正式表中状态改为红冲状态
- BizObjectManager fiFormal = JBOFactory.getBizObjectManager(LC_FUND_INCOME.CLASS_NAME);
- BizObjectManager fiTemp = JBOFactory.getBizObjectManager(LC_FUND_INCOME_TEMP.CLASS_NAME);
- BizObjectManager riFormal = JBOFactory.getBizObjectManager(LC_RENT_INCOME.CLASS_NAME);
- BizObjectManager riTemp = JBOFactory.getBizObjectManager(LC_RENT_INCOME_TEMP.CLASS_NAME);
- BizObjectManager bom_lrp = JBOFactory.getBizObjectManager(LC_RENT_PLAN.CLASS_NAME);
- Sqlca.join(fiFormal);
- Sqlca.join(fiTemp);
- Sqlca.join(riFormal);
- Sqlca.join(riTemp);
- Sqlca.join(bom_lrp);
- List fits = DataOperatorUtil.getSetJBO(LC_FUND_INCOME_TEMP.CLASS_NAME, fromCondtion, Sqlca);
- List rits = DataOperatorUtil.getSetJBO(LC_RENT_INCOME_TEMP.CLASS_NAME, fromCondtion, Sqlca);
- String fsql="update O set ROLL_BACK=1 where ID=:ID ";
- String tsql="update O set IS_FLOWING=1 where ID=:ID ";
- String lsql = "update O set collect_status=:collect_status,collect_msg='租金红冲' where ID=:ID";
- MapotherProperty=this.getDefaultOtherProperty();
- if(fits.size()>0){
- for(BizObject fit:fits){
- fiFormal.createQuery(fsql).setParameter("ID", fit.getAttribute("INCOME_ID").getString()).executeUpdate();
- fiTemp.createQuery(tsql).setParameter("ID", fit.getAttribute("ID").getString()).executeUpdate();
- }
- service.copyFundIncomeInfo(Sqlca, fromCondtion, null, otherProperty, ServiceOperatorEnum.TempToFormal,null);
- }
- if(rits.size()>0){
- for(BizObject rit:rits){
- riFormal.createQuery(fsql).setParameter("ID", rit.getAttribute("INCOME_ID").getString()).executeUpdate();
- riTemp.createQuery(tsql).setParameter("ID", rit.getAttribute("ID").getString()).executeUpdate();
- }
- service.copyRentIncomeInfo(Sqlca, fromCondtion, null, otherProperty, ServiceOperatorEnum.TempToFormal,null);
- }
- List lrits = riTemp.createQuery("select plan_id from O where flowunid=:flowunid group by plan_id").setParameter("flowunid", this.getAttribute("flowunid").toString()).getResultList(false);
- if(lrits.size()>0){
- for(BizObject lrit:lrits){
- String status = "";
- String planId = lrit.getAttribute("plan_id").toString();
- BizObject bo_lrp = bom_lrp.createQuery("select rent from O where id=:id").setParameter("id", planId).getSingleResult(false);
- BizObject bo_lri = riFormal.createQuery("select sum(rent) as rent from O where plan_id=:plan_id group by plan_id").setParameter("plan_id", planId).getSingleResult(false);
- String lriRent = bo_lri.getAttribute("rent").toString();
- if(new BigDecimal(lriRent).compareTo(new BigDecimal("0"))==1&&new BigDecimal(lriRent).compareTo(new BigDecimal(bo_lrp.getAttribute("rent").toString()))==-1){
- status = "部分收款";
- }
- bom_lrp.createQuery(lsql).setParameter("collect_status", status).setParameter("ID", planId).executeUpdate();
- }
- }
- String sMessage="true";
- return sMessage;
- }
-}
-
+package com.tenwa.lease.flow.rent.rentreback;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+import jbo.app.tenwa.calc.LC_FUND_INCOME;
+import jbo.app.tenwa.calc.LC_FUND_INCOME_TEMP;
+import jbo.app.tenwa.calc.LC_RENT_INCOME;
+import jbo.app.tenwa.calc.LC_RENT_INCOME_TEMP;
+import jbo.app.tenwa.calc.LC_RENT_PLAN;
+
+import com.amarsoft.are.jbo.BizObject;
+import com.amarsoft.are.jbo.BizObjectManager;
+import com.amarsoft.are.jbo.JBOFactory;
+import com.amarsoft.awe.util.Transaction;
+import com.tenwa.comm.util.jboutil.DataOperatorUtil;
+import com.tenwa.flow.baseBussion.BaseBussiness;
+import com.tenwa.lease.flow.comm.service.LeaseFlowBaseService;
+import com.tenwa.lease.flow.comm.service.ServiceOperatorEnum;
+import com.tenwa.lease.flow.comm.serviceImp.LeaseFlowBaseServiceImp;
+
+public class LCRentIncomeTempToFormalBusiness extends BaseBussiness{
+ public Object run(Transaction Sqlca) throws Exception{
+ this.initBussinessParam(Sqlca);
+ LeaseFlowBaseService service=new LeaseFlowBaseServiceImp();
+ MapfromCondtion=this.getDefaultTempToFormalFromCondtion();
+ //将正式表中状态改为红冲状态
+ BizObjectManager fiFormal = JBOFactory.getBizObjectManager(LC_FUND_INCOME.CLASS_NAME);
+ BizObjectManager fiTemp = JBOFactory.getBizObjectManager(LC_FUND_INCOME_TEMP.CLASS_NAME);
+ BizObjectManager riFormal = JBOFactory.getBizObjectManager(LC_RENT_INCOME.CLASS_NAME);
+ BizObjectManager riTemp = JBOFactory.getBizObjectManager(LC_RENT_INCOME_TEMP.CLASS_NAME);
+ BizObjectManager bom_lrp = JBOFactory.getBizObjectManager(LC_RENT_PLAN.CLASS_NAME);
+ Sqlca.join(fiFormal);
+ Sqlca.join(fiTemp);
+ Sqlca.join(riFormal);
+ Sqlca.join(riTemp);
+ Sqlca.join(bom_lrp);
+ List fits = DataOperatorUtil.getSetJBO(LC_FUND_INCOME_TEMP.CLASS_NAME, fromCondtion, Sqlca);
+ List rits = DataOperatorUtil.getSetJBO(LC_RENT_INCOME_TEMP.CLASS_NAME, fromCondtion, Sqlca);
+ String fsql="update O set ROLL_BACK=1 where ID=:ID ";
+ String tsql="update O set IS_FLOWING=1 where ID=:ID ";
+ String lsql = "update O set collect_status=:collect_status,collect_msg='租金红冲' where ID=:ID";
+ MapotherProperty=this.getDefaultOtherProperty();
+ if(fits.size()>0){
+ for(BizObject fit:fits){
+ fiFormal.createQuery(fsql).setParameter("ID", fit.getAttribute("INCOME_ID").getString()).executeUpdate();
+ fiTemp.createQuery(tsql).setParameter("ID", fit.getAttribute("ID").getString()).executeUpdate();
+ }
+ service.copyFundIncomeInfo(Sqlca, fromCondtion, null, otherProperty, ServiceOperatorEnum.TempToFormal,null);
+ }
+ if(rits.size()>0){
+ for(BizObject rit:rits){
+ riFormal.createQuery(fsql).setParameter("ID", rit.getAttribute("INCOME_ID").getString()).executeUpdate();
+ riTemp.createQuery(tsql).setParameter("ID", rit.getAttribute("ID").getString()).executeUpdate();
+ }
+ service.copyRentIncomeInfo(Sqlca, fromCondtion, null, otherProperty, ServiceOperatorEnum.TempToFormal,null);
+ }
+ String flowunid= this.getAttribute("FlowUnid").toString();
+ List lrits = riTemp.createQuery("select plan_id from O where flowunid=:flowunid group by plan_id").setParameter("flowunid", flowunid).getResultList(false);
+ if(lrits.size()>0){
+ for(BizObject lrit:lrits){
+ String status = "";
+ String planId = lrit.getAttribute("plan_id").toString();
+ BizObject bo_lrp = bom_lrp.createQuery("select rent from O where id=:id").setParameter("id", planId).getSingleResult(false);
+ BizObject bo_lri = riFormal.createQuery("select sum(rent) as v.rent from O where plan_id=:plan_id group by plan_id").setParameter("plan_id", planId).getSingleResult(false);
+ String lriRent = bo_lri.getAttribute("rent").toString();
+ if(new BigDecimal(lriRent).compareTo(new BigDecimal("0"))==1&&new BigDecimal(lriRent).compareTo(new BigDecimal(bo_lrp.getAttribute("rent").toString()))==-1){
+ status = "部分收款";
+ }
+ bom_lrp.createQuery(lsql).setParameter("collect_status", status).setParameter("ID", planId).executeUpdate();
+ }
+ }
+ String sMessage="true";
+ return sMessage;
+ }
+}
+
diff --git a/src_tenwa/com/tenwa/makeContract/util/MakeOneCodeAndContractModel.java b/src_tenwa/com/tenwa/makeContract/util/MakeOneCodeAndContractModel.java
index dbe26378a..bb5d4176b 100644
--- a/src_tenwa/com/tenwa/makeContract/util/MakeOneCodeAndContractModel.java
+++ b/src_tenwa/com/tenwa/makeContract/util/MakeOneCodeAndContractModel.java
@@ -288,16 +288,24 @@ public class MakeOneCodeAndContractModel {
if(filename.indexOf("联合")>=0){
//设置图片宽度和高度
img.scaleAbsolute(160, 18);
- //设置图片水印的位置。
+ //设置图片水印的位置。第一个参:左右移动,小靠左。第二个参数上线移动:小的靠下
img.setAbsolutePosition(410, 815);
+ }else if(filename.indexOf("狮桥")>=0){
+ //设置图片宽度和高度
+ img.scaleAbsolute(160, 18);
+ //设置图片水印的位置。
+ img.setAbsolutePosition(380, 750);
}else{
img.scaleAbsolute(160, 22);
img.setAbsolutePosition(400, 785);
}
PdfContentByte under = stamp.getUnderContent(1);
under.addImage(img);
- if(pages>2&&"02".equals(leasform)&&filename.indexOf("BJ90形式售后回租")<0 && filename.indexOf("联合")<0 && filename.indexOf("狮桥")<0){
+ if(pages>2&&"02".equals(leasform)&&filename.indexOf("BJ90形式售后回租")<0 && filename.indexOf("狮桥")<0){
PdfContentByte under2 = stamp.getUnderContent(3);
+ if(filename.indexOf("联合")>=0){
+ img.setAbsolutePosition(400, 785);
+ }
under2.addImage(img);
}