⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 radiotbflowservice.java

📁 电信的网厅的整站代码
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
package com.doone.fj1w.fjmgr.order;

import java.util.*;

import com.doone.util.ExtString;
import com.doone.iossp.FormBody;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import com.doone.data.*;
import com.doone.fj1w.fj1w.order.Tf_ProdOrder;
import com.doone.fj1w.fjmgr.order.Bss_infoEntity.CustArchivesBean;
import com.doone.fj1w.fjmgr.order.saveFlowRecord.AdslFlow;
import com.doone.util.FileLogger;
import com.doone.fj1w.fjmgr.order.list.*;

import java.util.Date;

public class RadioTBFlowService {
	
	static private FileLogger log = new FileLogger();
	
	/**将选中的客户保存到数据库中
	 * 
	 * @param request
	 * @param response
	 * @param _map
	 * @return
	 */
	public static String saveInfo(ServletRequest request, ServletResponse response, Map _map) {
		try {
			if (_map != null) {
				String infoType = (String) _map.get("INFOTYPE");
				String prodOrderId = (String) _map.get("PRODORDERID");
				TF_BSSFlowRecord tf_BSSFlowRecord = new TF_BSSFlowRecord(new DacClient(),
						Long.parseLong(prodOrderId));
				if(infoType.equals("archives")){
					System.out.println("infoType==>"+infoType);
					tf_BSSFlowRecord.setStepSN(1);
					tf_BSSFlowRecord.save();
				}
				/*保存客户选择的停机原因信息*/
				if(infoType.equals("reasonInfo")){
					System.out.println("infoType==>"+infoType);
					String reason = (String) _map.get("REASON");
					tf_BSSFlowRecord.setRecordIDS(BssParameter.ORDER_DT_HISITOUT_REASON_ID,reason);
					tf_BSSFlowRecord.setStepSN(2);
					tf_BSSFlowRecord.save();
				}
				if(infoType.equals("relationInfo")){
					System.out.println("infoType==>"+infoType);
					String name =(String) _map.get("RELATIONNAME");//联系人姓名
					String pho = (String) _map.get("RELATIONPHO");//联系人客户的联系电话
					String card = (String) _map.get("CARDTYPE");//客户的证件
					String cardNo = (String) _map.get("CARDNO");//客户的证件号码
					
					String menType = (String) _map.get("TITLE");
					if(menType != null && menType.equals("经办人")){
						tf_BSSFlowRecord.setRecordIDS("ACCEPTMEN_NAME",name);
						tf_BSSFlowRecord.setRecordIDS("ACCEPTMEN_PHO",pho);
						tf_BSSFlowRecord.setRecordIDS("ACCEPTMEN_CARD",card);
						tf_BSSFlowRecord.setRecordIDS("ACCEPTMEN_CARDNO",cardNo);
					}
					else{
						/*添加客户信息*/
						tf_BSSFlowRecord.setRecordIDS("CUSTICUST_RELATIONNAME",name);
						tf_BSSFlowRecord.setRecordIDS("CUSTICUST_RELATIONPHO",pho);
						tf_BSSFlowRecord.setRecordIDS("CUSTICUST_CARD",card);
						tf_BSSFlowRecord.setRecordIDS("CUSTICUST_CARDNO",cardNo);
					}
					tf_BSSFlowRecord.save();
				}
				/*保存客户的公共的受理信息*/
				if(infoType.equals("otherInfo")){
					System.out.println("infoType==>"+infoType);
					String relationName = (String) _map.get("RELATIONNAME");//联系人姓名
					String acceptMen = (String) _map.get("ACCEPTMEN");//受理人姓名
					String developMen = (String) _map.get("DEVELOPMEN");//发展员工
					String fixType = (String) _map.get("FIXTYPE");//安装类型
					String operationLevel = (String) _map.get("OPERATIONLEVEL");//处理级别
					String acceptSource = (String) _map.get("ACCEPTSOURCE");//受理来源
					String bespeakTime = (String) _map.get("BESPEAKTIME");//预约时间
					tf_BSSFlowRecord.setRecordIDS("CUSTICUST_RELATIONNAME",relationName);
					tf_BSSFlowRecord.setRecordIDS("ACCEPTMEN_NAME",acceptMen);
					tf_BSSFlowRecord.setRecordIDS("DEVELOPMEN",developMen);
					tf_BSSFlowRecord.setRecordIDS("FIXTYPE",fixType);
					tf_BSSFlowRecord.setRecordIDS("OPERATIONLEVEL",operationLevel);
					tf_BSSFlowRecord.setRecordIDS("ACCEPTSOURCE",acceptSource);
					tf_BSSFlowRecord.setRecordIDS("BESPEAKTIME",bespeakTime);
					tf_BSSFlowRecord.setStepSN(3);
					tf_BSSFlowRecord.save();
				}
				/*保存客户选择的优惠类型信息*/
				if(infoType.equals("disctTypeInfo")){
					System.out.println("infoType==>"+infoType);
					String disctType = (String) _map.get("DISCTTYPE");
					tf_BSSFlowRecord.setRecordIDS("DISCTTYPE",disctType);
					tf_BSSFlowRecord.setStepSN(4);
					tf_BSSFlowRecord.save();
				}
			}
			return "1";
		} catch (Exception rux) {
			log.warn(rux.getMessage(), rux);
			return "0";
		}
		
	}
	
	/**是否要撤消
	 * 
	 * @param prodOrderId
	 * @return
	 */
	public static boolean isRecisionApply(String prodOrderId) {
		boolean b =false;
		if(prodOrderId != null){
			TF_BSSFlowRecord tf_BSSFlowRecord = TF_BSSFlowRecord.getBSSFlowRecord(new DacClient(),Long.parseLong(prodOrderId));
			if(tf_BSSFlowRecord.getStepSN() >= 5)  b = true;
			else  b = false;
		}
		return b;
	}
	
	/**根据协议查询优惠类型信息,可供营业前台及资费管理程序调用
	 * 
	 * @param prodOrderId
	 * @return
	 */
	public static DataTable getReason(String prodOrderId) {
		DataTable reasonDt = null;
		try {
			if(prodOrderId != null){
				TF_BSSFlowRecord tf_BSSFlowRecord = TF_BSSFlowRecord.getBSSFlowRecord(new DacClient(),Long.parseLong(prodOrderId));
				String cityCode = tf_BSSFlowRecord.getRecordIDS("CITYCODE");
				String SERV_TYPEiSERV_TYPE_ID = tf_BSSFlowRecord.getRecordIDS(BssParameter.SERVISERV_TYPE_ID);//小灵通服务类型编码
				String SO_TYPEiSO_TYPE_ID = tf_BSSFlowRecord.getRecordIDS(BssParameter.SO_TYPE_ID);//申请类型编码(停机保号)
				DataTable custArchives_dt = tf_BSSFlowRecord.getRecordFrom(BssParameter.CUST_ARCHIVES_TABLE);
				CustArchivesBean custArchivesBean = AdslFlow.setfirstflow(custArchives_dt);
				String AREA_DISCTiAREA_ID = "";
				if(custArchivesBean != null) {
					AREA_DISCTiAREA_ID = custArchivesBean.getSERVIAREA_ID();//受理地区
				}

				reasonDt = BssInter1.callWebQryReason(AREA_DISCTiAREA_ID,SERV_TYPEiSERV_TYPE_ID,
						SO_TYPEiSO_TYPE_ID,cityCode);
				tf_BSSFlowRecord.setRecordFrom(reasonDt,BssParameter.REASON_TABLE);
				tf_BSSFlowRecord.save();
			}
			return reasonDt;
		}catch(Exception e) {
			log.warn(e.getMessage(), e);
			return null;
		}
	}
	
	/**获取停机保号的客户档案
	 * 
	 * @param prodOrderId
	 * @return
	 */
	public static String custArchivesQuery(ServletRequest request, ServletResponse response, Map _map) {
		/*根据业务号码查询客户档案*/
		String result = "";
		try {
			String prodOrderId = (String) _map.get("PRODORDERID");
			String serviserv_type_id = (String) _map.get("SERVTYPEID");
			String SO_type_id = (String) _map.get("SOTYPEID");
			String area_id = (String) _map.get("AREAID");
			String cityCode = "0595";
			String key_word = "0";
			String soTypeId = SO_type_id;//申请类型编码小灵通是“5”
			java.util.Map custMap = new java.util.HashMap();
			CustArchivesBean custArchivesBean = null;
			TF_BSSFlowRecord tf_BSSFlowRecord = 
				TF_BSSFlowRecord.getBSSFlowRecord(new DacClient(),Long.parseLong(prodOrderId));
			Tf_ProdOrder tf_prodOrder = tf_BSSFlowRecord.getTf_prodOrder();
			String qry_oper_model = "7";
			DataTable custArchives_dt = tf_BSSFlowRecord.getRecordFrom(BssParameter.CUST_ARCHIVES_TABLE);
			if(custArchives_dt == null) {
				custArchives_dt = BssInter5.callWebQryServFor(qry_oper_model,
						key_word,
						"","","","","","",
						tf_prodOrder.getAbouttel(),"","","","","",serviserv_type_id,area_id,
						"",cityCode);
				tf_BSSFlowRecord.setRecordFrom(custArchives_dt,BssParameter.CUST_ARCHIVES_TABLE);
			}
			if(custArchives_dt == null){
				result = null; 
			}
			else if(custArchives_dt.getRows().getCount() == 0){
				result = "0";
			}
			else{  
				
				AdslFlow.setServiserv_type_id(serviserv_type_id);
				AdslFlow.setCityCode(cityCode);
				custArchivesBean = AdslFlow.setfirstflow(custArchives_dt);
				
				if (tf_BSSFlowRecord.getRecordFrom(BssParameter.CUST_PATIC_TABLE) == null) {
					custMap.put("CUSTiCUST_ID",custArchivesBean.getSUBSCRIBERICUST_ID());
					custMap.put("CITYCODE",custArchivesBean.getCITYCODE());
					//把客户的详细资料存储到数据库
					tf_BSSFlowRecord.setRecordFrom(BssSreachCustImpl.query_customer(custMap),BssParameter.CUST_PATIC_TABLE);
				}
				if (tf_BSSFlowRecord.getRecordFrom(BssParameter.PRODUCT_ARCHIVES_TABLE) == null) {
					java.util.Map productMap = new java.util.HashMap();
					productMap.put("QRY_OPER_MODEL","111111111111111111111111100000000000000101100000000010000111111");
					productMap.put("SERVISERV_ID",custArchivesBean.getSERVISERV_ID());
					productMap.put("KEY_WORD",key_word);
					productMap.put("SERV_TYPE_ID",custArchivesBean.getSERVISERV_TYPE_ID());
					productMap.put("SO_TYPE_ID",soTypeId);
					productMap.put("CITYCODE",custArchivesBean.getCITYCODE());
					//把申请产品的详细资料存储到数据库
					tf_BSSFlowRecord.setRecordFrom(BssSreachCustImpl.query_productInfo(productMap),BssParameter.PRODUCT_ARCHIVES_TABLE);
				}
				if (tf_BSSFlowRecord.getRecordIDS(BssParameter.SERVISERV_TYPE_ID) == null) {
					tf_BSSFlowRecord.setRecordIDS(BssParameter.SERVISERV_TYPE_ID,serviserv_type_id);
					tf_BSSFlowRecord.setRecordIDS(BssParameter.CUSTICUST_ID,custArchivesBean.getSUBSCRIBERICUST_ID());
					tf_BSSFlowRecord.setRecordIDS(BssParameter.CITYCODE,custArchivesBean.getCITYCODE());
					tf_BSSFlowRecord.setRecordIDS(BssParameter.QRY_OPER_MODEL,"111111111111111111111111100000000000000101100000000010000111111");
					tf_BSSFlowRecord.setRecordIDS(BssParameter.SERVISERV_ID,custArchivesBean.getSERVISERV_ID());
					tf_BSSFlowRecord.setRecordIDS(BssParameter.SO_TYPE_ID,soTypeId);
					tf_BSSFlowRecord.setRecordIDS(BssParameter.KEY_WORD,key_word);
				}
				tf_BSSFlowRecord.save();
				result = "1";
			}
		}catch(Exception e) {
			result = null;
			log.warn("获取停机保号的客户档案失败:"+e.getMessage(), e);
		}
		return result;
	}
	
	/**获得已有帐户编码
	 * 
	 * @param prodOrderId
	 */
	public static String getAccId(String prodOrderId) {
		String SO_SERV_ACCTiACCT_ID = "";
		try {
			if(prodOrderId != null){
				TF_BSSFlowRecord tf_BSSFlowRecord = TF_BSSFlowRecord.getBSSFlowRecord(new DacClient(),Long.parseLong(prodOrderId));
				String cityCode = tf_BSSFlowRecord.getRecordIDS("CITYCODE");
				DataTable custArchives_dt = tf_BSSFlowRecord.getRecordFrom(BssParameter.CUST_ARCHIVES_TABLE);
				CustArchivesBean custArchivesBean = AdslFlow.setfirstflow(custArchives_dt);
				/*根据业务号码查询客户档案*/
				String qry_oper_model = "7";
				custArchives_dt = BssInter5.callWebQryServFor(qry_oper_model,"2","","","","","","",
				                  custArchivesBean.getSERV_ACC_NBRISERV_ACC_NBR(),"","","","","",
				                  tf_BSSFlowRecord.getRecordIDS("SERVISERV_TYPE_ID"),
				                  custArchivesBean.getSERVIAREA_ID(),"",cityCode);
				
				if(custArchives_dt != null && custArchives_dt.getColumns().getCount() > 0)
					SO_SERV_ACCTiACCT_ID= custArchives_dt.getRow(0).getString("ACCTiACCT_NBR");//帐户编码
				
				tf_BSSFlowRecord.setRecordIDS("ACCTIACCT_ID",SO_SERV_ACCTiACCT_ID);
				tf_BSSFlowRecord.save();	
			}
		}catch(Exception e) {
			log.warn(e.getMessage(), e);
		}
		return SO_SERV_ACCTiACCT_ID;
	}
	
	/**调用小江的XML配置文件调用callWebReferSo接口(固定电话)
	 * 
	 * @param tf_BSSFlowRecord
	 * @return
	 */
	public String applyPhoTB(TF_BSSFlowRecord tf_BSSFlowRecord) {
		String sResult = "";
		boolean isLock = true;
		AdslFlowService adslFlowService = null;
		try{
			DataTable custArchives_dt = tf_BSSFlowRecord.getRecordFrom(BssParameter.CUST_ARCHIVES_TABLE);
			BssReferProductBean productBean = null;
			BssReferCustBean custBean = null;
			CustArchivesBean custArchivesBean = AdslFlow.setfirstflow(custArchives_dt);
			java.util.Map custMap = new java.util.HashMap();
			
			if(tf_BSSFlowRecord.getRecordIDS("CUSTICUST_ID") != null &&
					tf_BSSFlowRecord.getRecordIDS("CITYCODE") != null){
				custMap.put("CUSTiCUST_ID",tf_BSSFlowRecord.getRecordIDS("CUSTICUST_ID"));
				custMap.put("CITYCODE",tf_BSSFlowRecord.getRecordIDS("CITYCODE"));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -