修改查询合同签约状态方法

This commit is contained in:
tangfutang 2021-03-02 17:56:55 +08:00
parent 411a5fcb83
commit 2d8f404a4f
5 changed files with 164 additions and 104 deletions

View File

@ -195,7 +195,7 @@
return ;
}else if("Y"==meassge){
setItemValue(0,0,"sign_status","Y");
}else if("N"==meassge){
}else{
setItemValue(0,0,"sign_status","");
}
}

View File

@ -35,6 +35,7 @@ import com.tenwa.channelportal.action.ContractSignActionTwo;
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
import com.tenwa.makeContract.util.MakeOneCodeAndContractModel;
import com.tenwa.officetempalte.action.CreateContractOfficeAction;
import com.tenwa.util.MakeContractCheck;
import com.tenwa.util.MultiSubjectUtil;
import apx.com.amarsoft.als.apzl.apply.contract.make.service.ContractMakeService;
@ -138,7 +139,7 @@ public class ContractMakeServiceImpl implements ContractMakeService{
body.put("FlowUnid", flowUnid);
String message = this.CheckCar(flowUnid, templateId, contractId);
String projectSignStatus = this.ProjectSignStatus(projectId);
String projectSignStatus = MakeContractCheck.checkSignStatus(projectId );
Configure CurConfig = Configure.getInstance();
String wordPath=CurConfig.getConfigure("FileSavePath");
if(templateId == null || templateId.length() == 0){
@ -225,36 +226,7 @@ public class ContractMakeServiceImpl implements ContractMakeService{
return message;
}
//检查该项目是否进行过签约验证
public String ProjectSignStatus(String projectid) throws Exception{
BizObjectManager caManage = JBOFactory.getBizObjectManager(CUSTOMER_ACCOUNT.CLASS_NAME);
BizObject ca = caManage.createQuery("PROJECT_ID=:projectid").setParameter("projectid", projectid).getSingleResult(false);
if(ca==null){
return "未查询到扣款信息,请联系管理员!" ;
}else{
BizObjectManager lctManage = JBOFactory.getBizObjectManager(LC_CARD_TLSIGN.CLASS_NAME);
String collect_type = ca.getAttribute("collect_type").getString();
if(collect_type.equals("YLcollect")){//广州银联
if(!"Y".equals(ca.getAttribute("SIGN_STATUS").getString())){
return "请提醒客户查看手机短信,完成广州银联扣款卡的签约验证!";
}
}else if(collect_type.equals("TLcollect")){//通联
BizObject lct = lctManage.createQuery(" project_id=:project_id and sign_type='TLcollect' and sign_status='sign_status2' ").setParameter("project_id", projectid).getSingleResult(false);
if( lct==null ){
return "请提醒客户查看手机短信,完成通联扣款卡的签约验证!";
}
}else if(collect_type.equals("YCcollect")){//邮储判断
BizObject lct = lctManage.createQuery(" project_id=:project_id and sign_type='YCcollect' and sign_status='sign_status2' ").setParameter("project_id", projectid).getSingleResult(false);
if( lct==null ){
return "请提醒客户查看手机短信,完成邮储扣款卡的签约验证!";
}
}else{
return "未查询到对应的扣款渠道,请联系管理员!" ;
}
}
return "success" ;
}
@Override
public Map<String, Object> initiateSign(HttpServletRequest request,
HttpServletResponse response, JBOTransaction tx, Transaction sqlca,

View File

@ -34,6 +34,7 @@ import com.base.util.DateUtil;
import com.base.util.MultipartDataUtil;
import com.base.util.ReturnMapUtil;
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
import com.tenwa.util.MakeContractCheck;
import apx.com.amarsoft.als.apzl.apply.contract.make.util.ContractMakeControllerUtil;
import apx.com.amarsoft.als.user.change.center.service.ApplyArchiveService;
@ -527,39 +528,14 @@ public class ApplyArchiveServiceImpl implements ApplyArchiveService{
ASUser asUser = new ASUser(userId);
String orgID = asUser.getOrgID();
BizObjectManager caManage = JBOFactory.getBizObjectManager(CUSTOMER_ACCOUNT.CLASS_NAME);
BizObject ca = caManage.createQuery("PROJECT_ID=:projectid").setParameter("projectid", flowParms.get("ProjectId")).getSingleResult(false);
boolean signStatus = false;
if(ca == null){
ReturnMapUtil.setReturnMap(null,RestfullConstant.baseProperty.get("fail").toString(), "未查询到扣款信息,请联系管理员!");
return ReturnMapUtil.getReturnMap();
}else {
BizObjectManager lctManage = JBOFactory.getBizObjectManager(LC_CARD_TLSIGN.CLASS_NAME);
String collect_type = ca.getAttribute("collect_type").getString();
if(collect_type.equals("YLcollect")){//广州银联
if( "Y".equals( ca.getAttribute("SIGN_STATUS").getString() ) ){
signStatus = true;
}else{
ReturnMapUtil.setReturnMap(null,RestfullConstant.baseProperty.get("fail").toString(), "请提醒客户查看手机短信,完成广州银联扣款卡的签约验证!");
}
}else if( collect_type.equals("TLcollect") ){ // 通联或者邮储
BizObject lct = lctManage.createQuery(" project_id=:project_id and sign_type='TLcollect' and sign_status='sign_status2' ").setParameter("project_id", flowParms.get("ProjectId")).getSingleResult(false);
if( lct==null ){
ReturnMapUtil.setReturnMap(null,RestfullConstant.baseProperty.get("fail").toString(), "请提醒客户查看手机短信,完成通联扣款卡的签约验证!");
}else{
signStatus = true;
}
}else if( collect_type.equals("YCcollect") ){//邮储判断
BizObject lct = lctManage.createQuery(" project_id=:project_id and sign_type='YCcollect' and sign_status='sign_status2' ").setParameter("project_id", flowParms.get("ProjectId")).getSingleResult(false);
if( lct==null ){
ReturnMapUtil.setReturnMap(null,RestfullConstant.baseProperty.get("fail").toString(), "请提醒客户查看手机短信,完成邮储扣款卡的签约验证!");
}else{
signStatus = true;
}
}else{
ReturnMapUtil.setReturnMap(null,RestfullConstant.baseProperty.get("fail").toString(), "未配置对应的扣款渠道,请联系管理员!");
}
String checkSignStatus = MakeContractCheck.checkSignStatus(flowParms.get("ProjectId") );
if("success".equals(checkSignStatus)){
signStatus = true;
}else{
ReturnMapUtil.setReturnMap(null,RestfullConstant.baseProperty.get("fail").toString(), checkSignStatus);
}
if(signStatus){
//String sql = "SELECT serialno,whether FROM PRD_SPECIFIC_LIBRARY WHERE productid='"+flowParms.get("ProductId")+"' ";
String sql = "SELECT DISTRIBUTOR_NO,DISTRIBUTOR_NAME,WHETHER FROM DISTRIBUTOR_INFO where distributor_no=(SELECT distributor_no FROM distributor_info WHERE orgid='"+orgID+"') ";

View File

@ -4,7 +4,9 @@ import java.util.List;
import jbo.app.tenwa.calc.LC_CARD_TLSIGN;
import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT;
import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT_HIS;
import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT_TEMP;
import jbo.app.tenwa.customer.LB_CARD_SIGN_STATUS_HIS;
import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO;
import com.amarsoft.are.jbo.BizObject;
@ -12,6 +14,7 @@ import com.amarsoft.are.jbo.BizObjectManager;
import com.amarsoft.are.jbo.JBOException;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.are.jbo.JBOTransaction;
import com.tenwa.util.MakeContractCheck;
import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO;
@ -51,32 +54,7 @@ public class ContractInfoCheck {
//检查该项目是否进行过签约验证
public String ProjectSignStatus(JBOTransaction tx) throws Exception{
BizObjectManager caManage = JBOFactory.getBizObjectManager(CUSTOMER_ACCOUNT.CLASS_NAME, tx);
BizObject ca = caManage.createQuery("PROJECT_ID=:projectid").setParameter("projectid", projectid).getSingleResult(false);
if(ca==null){
return "未查询到扣款信息,请联系管理员!" ;
}else{
BizObjectManager lctManage = JBOFactory.getBizObjectManager(LC_CARD_TLSIGN.CLASS_NAME, tx);
String collect_type = ca.getAttribute("collect_type").getString();
if(collect_type.equals("YLcollect")){//广州银联
if(!"Y".equals(ca.getAttribute("SIGN_STATUS").getString())){
return "请提醒客户查看手机短信,完成广州银联扣款卡的签约验证!";
}
}else if(collect_type.equals("TLcollect")){//通联
BizObject lct = lctManage.createQuery(" project_id=:project_id and sign_type='TLcollect' and sign_status='sign_status2' ").setParameter("project_id", projectid).getSingleResult(false);
if( lct==null ){
return "请提醒客户查看手机短信,完成通联扣款卡的签约验证!";
}
}else if(collect_type.equals("YCcollect")){//邮储判断
BizObject lct = lctManage.createQuery(" project_id=:project_id and sign_type='YCcollect' and sign_status='sign_status2' ").setParameter("project_id", projectid).getSingleResult(false);
if( lct==null ){
return "请提醒客户查看手机短信,完成邮储扣款卡的签约验证!";
}
}else{
return "未查询到对应的扣款渠道,请联系管理员!" ;
}
}
return "success" ;
return MakeContractCheck.checkSignStatus( projectid );
}
//保存付款申请GPS是否安装状态
@ -113,30 +91,66 @@ public class ContractInfoCheck {
//查出临时表中的是否已签约
public String selectFlowSignStatus(JBOTransaction tx) throws Exception{
BizObjectManager caManage = JBOFactory.getBizObjectManager(CUSTOMER_ACCOUNT_TEMP.CLASS_NAME, tx);
BizObject ca = caManage.createQuery("flowunid=:flowunid").setParameter("flowunid", flowUnid).getSingleResult(false);
BizObject ca = caManage.createQuery("flowunid=:flowunid").setParameter("flowunid", flowUnid).getSingleResult(true);
if(ca==null){
return "未查询到扣款信息,请联系管理员!" ;
}else{
BizObjectManager lctManage = JBOFactory.getBizObjectManager(LC_CARD_TLSIGN.CLASS_NAME, tx);
String collect_type = ca.getAttribute("collect_type").getString();
String account = ca.getAttribute("account").getString();
String acc_number = ca.getAttribute("acc_number").getString();
String certId = ca.getAttribute("certId").getString();
String mobile = ca.getAttribute("mobile").getString();
String projectId = ca.getAttribute("project_id").getString();
BizObjectManager lpiManage = JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME);
BizObject lpi = lpiManage.createQuery(" id=:projectid").setParameter("projectid", projectId).getSingleResult(false);
String subjectId= lpi.getAttribute("subjectid").toString();
if(collect_type.equals("YLcollect")){//广州银联
if(!"Y".equals(ca.getAttribute("SIGN_STATUS").getString())){
return "请提醒客户查看手机短信,完成广州银联扣款卡的签约验证!";
BizObjectManager cahManage = JBOFactory.getFactory().getManager(CUSTOMER_ACCOUNT_HIS.CLASS_NAME);
String sql ="select O.id from O left join jbo.com.tenwa.lease.comm.LB_PROJECT_INFO lpi on lpi.id=O.project_id where O.sign_status='Y' and O.account=:account and O.acc_number=:acc_number and O.certid=:certid and O.collect_type='YLcollect' and lpi.subjectid=:subjectid";
List<BizObject> cahs = cahManage.createQuery(sql).setParameter("account", account).setParameter("acc_number", acc_number).setParameter("certid", certId).setParameter("subjectid", subjectId).getResultList(false);
List<BizObject> cas = caManage.createQuery(sql).setParameter("account", account).setParameter("acc_number", acc_number).setParameter("certid", certId).setParameter("subjectid", subjectId).getResultList(false);
if( (cahs != null && cahs.size() > 0) || (cas != null && cas.size() > 0) ){
ca.setAttributeValue("sign_status", "Y");
caManage.saveObject(ca);
}else{
return "请提醒客户查看手机短信,完成广州银联扣款卡的签约验证!";
}
}
}else if(collect_type.equals("TLcollect")){//通联
BizObject lct = lctManage.createQuery(" project_id=:project_id and sign_type='TLcollect' and sign_status='sign_status2' ").setParameter("project_id", projectid).getSingleResult(false);
if( lct==null ){
return "请提醒客户查看手机短信,完成通联扣款卡的签约验证!";
} else {//通联
BizObjectManager lctManage = JBOFactory.getBizObjectManager(LC_CARD_TLSIGN.CLASS_NAME, tx);
BizObject lct = lctManage.createQuery(" project_id=:project_id and sign_type=:signType ").setParameter("project_id", projectId).setParameter("signType", collect_type).getSingleResult(true);
if( lct==null || (!"sign_status2".equals(lct.getAttribute("sign_status").getString()) ) ){
//查询历史是否签约
BizObjectManager lcsshManage = JBOFactory.getFactory().getManager(LB_CARD_SIGN_STATUS_HIS.CLASS_NAME);
BizObject lcss = lcsshManage.createQuery("select O.AGRMNO from O left join jbo.com.tenwa.lease.comm.LB_PROJECT_INFO lpi on lpi.id=O.project_id where O.tl_status='sign_status2' and O.account=:account and O.acc_number=:acc_number and O.certid=:certid and O.mobile=:mobile and O.sign_type=:sign_type and lpi.subjectid=:subjectId ")
.setParameter("account", account).setParameter("acc_number", acc_number).setParameter("certid", certId).setParameter("mobile", mobile).setParameter("sign_type", collect_type).setParameter("subjectId", subjectId).getSingleResult(false);
//查看现有卡是否签约
BizObject caAgrmno = lctManage.createQuery("select O.AGRMNO from O left join jbo.app.tenwa.customer.CUSTOMER_ACCOUNT_TEMP ca on ca.project_id=O.project_id left join jbo.com.tenwa.lease.comm.LB_PROJECT_INFO lpi on lpi.id=O.project_id where O.sign_status='sign_status2' and lpi.subjectid=:subjectid and O.sign_type=:sign_type and ca.acc_number=:acc_number and ca.certid=:certid and ca.mobile=:mobile ")
.setParameter("subjectId", subjectId).setParameter("sign_type", collect_type).setParameter("account", account).setParameter("acc_number", acc_number).setParameter("certid", certId).setParameter("mobile", mobile).getSingleResult(false);
if( lcss !=null || caAgrmno!=null){
lct = lctManage.createQuery(" project_id=:project_id ").setParameter("project_id", projectId).getSingleResult(true);
if(lct == null){
lct = lctManage.newObject();
lct.setAttributeValue("PROJECT_ID", projectId);
}
lct.setAttributeValue("SIGN_STATUS", "sign_status2");
lct.setAttributeValue("sign_type", collect_type);
lct.setAttributeValue("AGRMNO", lcss!=null ? lcss.getAttribute("agrmno").getString(): caAgrmno.getAttribute("agrmno").getString());
lctManage.saveObject(lct);
}else if (collect_type.equals("TLcollect")){
return "请提醒客户查看手机短信,完成通联扣款卡的签约验证!";
}else if(collect_type.equals("YCcollect")){
return "请提醒客户查看手机短信,完成邮储扣款卡的签约验证!";
}else{
return "未查询到对应的扣款渠道,请联系管理员!" ;
}
}
}else if(collect_type.equals("YCcollect")){//邮储判断
BizObject lct = lctManage.createQuery(" project_id=:project_id and sign_type='YCcollect' and sign_status='sign_status2' ").setParameter("project_id", projectid).getSingleResult(false);
if( lct==null ){
return "请提醒客户查看手机短信,完成邮储扣款卡的签约验证!";
}
}else{
return "未查询到对应的扣款渠道,请联系管理员!" ;
}
}
return "success" ;
}

View File

@ -0,0 +1,98 @@
package com.tenwa.util;
import java.util.List;
import jbo.app.tenwa.calc.LC_CARD_TLSIGN;
import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT;
import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT_HIS;
import jbo.app.tenwa.customer.LB_CARD_SIGN_STATUS_HIS;
import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.BizObjectManager;
import com.amarsoft.are.jbo.JBOException;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.are.jbo.JBOTransaction;
public class MakeContractCheck {
public static String checkSignStatus (String projectId){
JBOTransaction tx = null;
try {
tx = JBOFactory.createJBOTransaction();
BizObjectManager caManage = JBOFactory.getBizObjectManager(CUSTOMER_ACCOUNT.CLASS_NAME,tx);
BizObject ca = caManage.createQuery("PROJECT_ID=:projectid").setParameter("projectid", projectId).getSingleResult(true);
if(ca==null){
return "未查询到扣款信息,请联系管理员!" ;
}else{
String collect_type = ca.getAttribute("collect_type").getString();
String account = ca.getAttribute("account").getString();
String acc_number = ca.getAttribute("acc_number").getString();
String certId = ca.getAttribute("certId").getString();
String mobile = ca.getAttribute("mobile").getString();
BizObjectManager lpiManage = JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME);
BizObject lpi = lpiManage.createQuery(" id=:projectid").setParameter("projectid", projectId).getSingleResult(false);
String subjectId= lpi.getAttribute("subjectid").toString();
if(collect_type.equals("YLcollect")){//广州银联
if(!"Y".equals(ca.getAttribute("SIGN_STATUS").getString())){
BizObjectManager cahManage = JBOFactory.getFactory().getManager(CUSTOMER_ACCOUNT_HIS.CLASS_NAME);
String sql ="select O.id from O left join jbo.com.tenwa.lease.comm.LB_PROJECT_INFO lpi on lpi.id=O.project_id where O.sign_status='Y' and O.account=:account and O.acc_number=:acc_number and O.certid=:certid and O.collect_type='YLcollect' and lpi.subjectid=:subjectid";
List<BizObject> cahs = cahManage.createQuery(sql).setParameter("account", account).setParameter("acc_number", acc_number).setParameter("certid", certId).setParameter("subjectid", subjectId).getResultList(false);
List<BizObject> cas = caManage.createQuery(sql).setParameter("account", account).setParameter("acc_number", acc_number).setParameter("certid", certId).setParameter("subjectid", subjectId).getResultList(false);
if( (cahs != null && cahs.size() > 0) || (cas != null && cas.size() > 0) ){
ca.setAttributeValue("sign_status", "Y");
caManage.saveObject(ca);
}else{
return "请提醒客户查看手机短信,完成广州银联扣款卡的签约验证!";
}
}
} else {//通联
BizObjectManager lctManage = JBOFactory.getBizObjectManager(LC_CARD_TLSIGN.CLASS_NAME, tx);
BizObject lct = lctManage.createQuery(" project_id=:project_id and sign_type=:signType ").setParameter("project_id", projectId).setParameter("signType", collect_type).getSingleResult(true);
if( lct==null || (!"sign_status2".equals(lct.getAttribute("sign_status").getString()) ) ){
//查询历史是否签约
BizObjectManager lcsshManage = JBOFactory.getFactory().getManager(LB_CARD_SIGN_STATUS_HIS.CLASS_NAME);
BizObject lcss = lcsshManage.createQuery("select O.AGRMNO from O left join jbo.com.tenwa.lease.comm.LB_PROJECT_INFO lpi on lpi.id=O.project_id where O.tl_status='sign_status2' and O.account=:account and O.acc_number=:acc_number and O.certid=:certid and O.mobile=:mobile and O.sign_type=:sign_type and lpi.subjectid=:subjectId ")
.setParameter("account", account).setParameter("acc_number", acc_number).setParameter("certid", certId).setParameter("mobile", mobile).setParameter("sign_type", collect_type).setParameter("subjectId", subjectId).getSingleResult(false);
//查看现有卡是否签约
BizObject caAgrmno = lctManage.createQuery("select O.AGRMNO from O left join jbo.app.tenwa.customer.CUSTOMER_ACCOUNT ca on ca.project_id=O.project_id left join jbo.com.tenwa.lease.comm.LB_PROJECT_INFO lpi on lpi.id=O.project_id where O.sign_status='sign_status2' and lpi.subjectid=:subjectid and O.sign_type=:sign_type and ca.acc_number=:acc_number and ca.certid=:certid and ca.mobile=:mobile ")
.setParameter("subjectId", subjectId).setParameter("sign_type", collect_type).setParameter("account", account).setParameter("acc_number", acc_number).setParameter("certid", certId).setParameter("mobile", mobile).getSingleResult(false);
if( lcss !=null || caAgrmno!=null){
lct = lctManage.createQuery(" project_id=:project_id ").setParameter("project_id", projectId).getSingleResult(true);
if(lct == null){
lct = lctManage.newObject();
lct.setAttributeValue("PROJECT_ID", projectId);
}
lct.setAttributeValue("SIGN_STATUS", "sign_status2");
lct.setAttributeValue("sign_type", collect_type);
lct.setAttributeValue("AGRMNO", lcss!=null ? lcss.getAttribute("agrmno").getString(): caAgrmno.getAttribute("agrmno").getString());
lctManage.saveObject(lct);
}else if (collect_type.equals("TLcollect")){
return "请提醒客户查看手机短信,完成通联扣款卡的签约验证!";
}else if(collect_type.equals("YCcollect")){
return "请提醒客户查看手机短信,完成邮储扣款卡的签约验证!";
}else{
return "未查询到对应的扣款渠道,请联系管理员!" ;
}
}
}
}
tx.commit();
return "success" ;
} catch (Exception e) {
try {
if( tx != null){
tx.rollback();
}
} catch (JBOException e1) {
e1.printStackTrace();
}
e.printStackTrace();
return "error" ;
}
}
}