业务单查问:
package com.pinganfu.risk.rcoms.web.controller.integrationmanage.businessOrder;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.pinganfu.common.pagination.Page;
import com.pinganfu.risk.rcoms.common.integration.integrationmanage.BusinessOrderDetailsClient;
import com.pinganfu.risk.rcoms.web.controller.constant.ControllerConstant;
import com.pinganfu.risk.rcoms.web.controller.quota.BaseController;
import com.pinganfu.risk.rcomss.common.facade.bean.code.FacadeRespCode;
import com.pinganfu.risk.rcomss.common.facade.bean.model.BusinessOrderDetails;
import com.pinganfu.risk.rcomss.common.facade.bean.request.BusinessOrderDetailsRequest;
import com.pinganfu.risk.rcomss.common.facade.bean.response.BusinessOrderDetailsResponse;
/** 综合治理 -- 业务单查问 @author limeixia */
@Controller
@RequestMapping("/businessOrder")
public class QueryBusinessOrderDetailsController extends BaseController{
protected static final String SUCCESS_FLAG = "success";
protected static final String FAIL_FLAG = "fail";
protected static final String MESSAGE = "message";
protected static final String TRANS_AREA = "TRANS_AREA";
private static Logger logger = LoggerFactory
.getLogger(QueryBusinessOrderDetailsController.class);
@Autowired
BusinessOrderDetailsClient businessOrderDetailsClient;
@RequestMapping("/toBusinessOrderIndex")
public String index() throws Exception {return "integrationmanage/businessOrder/queryBusinessOrder-index";}
/**
*
* <p> 查问订单号查问订单的明细 </p>
* @param req
* @return
* @return Map<String,Object>
*/
@RequestMapping("/queryBusinessOrder")
public @ResponseBody
Map<String, Object> queryBusinessOrder(String busiId,Page page) {Map<String, Object> retMap = new HashMap<String, Object>();
try {logger.info("queryBusinessOrder Start! busiId: {}, page: {}",
busiId, page);
BusinessOrderDetailsRequest request = new BusinessOrderDetailsRequest();
BusinessOrderDetails businessOrderDetails = new BusinessOrderDetails();
// 将输出内容转换为小写
businessOrderDetails.setBusiId(busiId);
// 归档库革新,减少工夫参数。20180125
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
businessOrderDetails.setBeginTime("2013-01-01 00:00:00");
businessOrderDetails.setEndTime(sdf.format(new Date()));
request.setBusinessOrderDetails(businessOrderDetails);
// 归档库革新,不反对分页。20180125
//request.setPage(page);
// 查问符合条件的图片验证码场景
BusinessOrderDetailsResponse response = businessOrderDetailsClient.queryBusinessOrderList(request);
logger.info("Response of queryBusinessOrder List is {}", response);
if (response != null) {if (FacadeRespCode.SUCCESS.getCode().equals(response.get_retCode())) {retMap.put(ControllerConstant.RET_CODE, response.get_retCode());
retMap.put(ControllerConstant.STR_LIST, response.getBusinessOrderDetailsList());
retMap.put(ControllerConstant.STR_MAX_COUNT, response.getTotalsize());
} else {retMap.put(ControllerConstant.RET_CODE, response.get_retCode());
retMap.put(ControllerConstant.ERR_MSG, response.get_errMsg());
}
} else {retMap.put(ControllerConstant.RET_CODE, FacadeRespCode.SYSTEM_ERROR.getCode());
retMap.put(ControllerConstant.ERR_MSG, FacadeRespCode.SYSTEM_ERROR.getMessage());
}
} catch (Exception e) {logger.error("Error in queryBusinessOrder Information!", e);
retMap.put(ControllerConstant.RET_CODE, FacadeRespCode.SYSTEM_ERROR.getCode());
retMap.put(ControllerConstant.ERR_MSG, FacadeRespCode.SYSTEM_ERROR.getMessage());
}
return retMap;
}
}
package com.pinganfu.risk.rcoms.web.controller.integrationmanage.queryAccountCard;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.google.gson.Gson;
import com.pinganfu.cip.common.facade.bean.util.StringUtil;
import com.pinganfu.common.pagination.Page;
import com.pinganfu.risk.rcoms.common.integration.customermanage.CustomerQueryClient;
import com.pinganfu.risk.rcoms.common.integration.rcint.http.AccountCardInfoManageHPClient;
import com.pinganfu.risk.rcoms.common.integration.rcint.http.cip.PrepaidCardInfoHPClient;
import com.pinganfu.risk.rcoms.common.integration.rcint.http.cip.bean.CustAccountCardRes;
import com.pinganfu.risk.rcoms.common.integration.rcint.http.cip.bean.CustAccountCardVO;
import com.pinganfu.risk.rcoms.common.util.AccountCardBindStatusEnum;
import com.pinganfu.risk.rcoms.common.util.AccountCardStatusEnum;
import com.pinganfu.risk.rcoms.common.util.AmountUtil;
import com.pinganfu.risk.rcoms.web.controller.base.BaseControllerSupport;
import com.pinganfu.risk.rcoms.web.controller.integrationmanage.queryAccountCard.vo.AccountCardVO;
/**
- 综合治理 – 账户卡查问
- @author limeixia
*/
@Controller
@RequestMapping(“/accountCard”)
public class QueryAccountCardController extends BaseControllerSupport{
private static Logger logger = LoggerFactory
.getLogger(QueryAccountCardController.class);
@RequestMapping("/toAccountCardIndex")
public String index() throws Exception {return "integrationmanage/queryAccountCard/queryAccountCard-index";}
@Autowired
private PrepaidCardInfoHPClient prepaidCardInfoHPClient;
@Autowired
private AccountCardInfoManageHPClient accountCardInfoManageHPClient;
@Autowired
private CustomerQueryClient customerQueryClient;
/**
*
* <p> 查问会员账户卡的明细 </p>
* @param req
* @return
* @return Map<String,Object>
*/
@RequestMapping("/queryAccountCard")
public @ResponseBody
Map<String, Object> queryAccountCard(String searchKey, String searchValue, Page page) {Map<String, Object> dataMap = new HashMap<String, Object>();
// 申明会员银行卡对象列表
List<AccountCardVO> accountCardVOs = new ArrayList<AccountCardVO>();
int total = 0;
try {
// 获取两个个条件属性
Map<String, String> params = new HashMap<String, String>();
if(StringUtil.isNotBlank(searchKey) && "1".equals(searchKey)) {params.put("custId", searchValue);
params.put("cardType", "003");
logger.info(".queryAccountCard() 中 ReqParams 的值为:request:{}",new Gson().toJson(params));
CustAccountCardRes custAccountCardResult = prepaidCardInfoHPClient.queryCustPrepaidCard(params);
logger.info(".queryAccountCard() 中 ResResult 的值为:respone:{}",new Gson().toJson(custAccountCardResult));
if(custAccountCardResult!=null
&& StringUtils.equals("OK",(String) custAccountCardResult.get_sysRet())
&& StringUtils.equals(SUC_CODE_000000,(String) custAccountCardResult.get_retCode())){List<CustAccountCardVO> convertCardList = (List<CustAccountCardVO>) custAccountCardResult.getCardList();
for(CustAccountCardVO custAccountCard : convertCardList){if(StringUtil.isNotBlank(custAccountCard.getIndexCardId())) {logger.info("queryAccountCard IndexCardId:{}", custAccountCard.getIndexCardId());
Map<String, String> queryAccountParam = new HashMap<String, String>();
queryAccountParam.put("cardSeqId", custAccountCard.getIndexCardId());
Map<String, Object> accountCardResult = accountCardInfoManageHPClient.accCardInfoQuery(queryAccountParam);
if(accountCardResult != null
&& StringUtils.equals("OK",(String) accountCardResult.get("_sysRet"))
&& StringUtils.equals(SUC_CODE_000000,(String) accountCardResult.get("_retCode"))) {AccountCardVO accountCardVO = new AccountCardVO();
accountCardVO.setCustomerId(custAccountCard.getCustomerId());
accountCardVO.setCustomerName(customerQueryClient.queryCustInfoByCustomerId(custAccountCard.getCustomerId(),"Y").getRealName());
accountCardVO.setCardIndex(custAccountCard.getIndexCardId());
accountCardVO.setCardStatus(AccountCardStatusEnum.getByCode(accountCardResult.get("cardStatus").toString()).getName());
accountCardVO.setBindStatus(AccountCardBindStatusEnum.getByCode(accountCardResult.get("bindStatus").toString()).getName());
accountCardVO.setBindReqDatetime(accountCardResult.get("bindReqDatetime").toString());
accountCardVO.setUnbindReqDatetime(accountCardResult.get("unbindReqDatetime").toString());
accountCardVO.setActiveReqDatetime(accountCardResult.get("activeDatetime").toString());
accountCardVO.setUnactiveReqDatetime(accountCardResult.get("unactiveDatetime").toString());
accountCardVOs.add(accountCardVO);
}
}
}
}
}else if(StringUtil.isNotBlank(searchKey) && "2".equals(searchKey)) {Map<String, String> queryAccountParam = new HashMap<String, String>();
queryAccountParam.put("cardSeqId", searchValue);
Map<String, Object> accountCardResult = accountCardInfoManageHPClient.accCardInfoQuery(queryAccountParam);
if(accountCardResult != null
&& StringUtils.equals("OK",(String) accountCardResult.get("_sysRet"))
&& StringUtils.equals(SUC_CODE_000000,(String) accountCardResult.get("_retCode"))) {AccountCardVO accountCardVO = new AccountCardVO();
accountCardVO.setCustomerId(accountCardResult.get("customerId").toString());
accountCardVO.setCustomerName(customerQueryClient.queryCustInfoByCustomerId(accountCardResult.get("customerId").toString(),"Y").getRealName());
accountCardVO.setCardIndex(accountCardResult.get("cardIndex").toString());
accountCardVO.setCardStatus(AccountCardStatusEnum.getByCode(accountCardResult.get("cardStatus").toString()).getName());
accountCardVO.setBindStatus(AccountCardBindStatusEnum.getByCode(accountCardResult.get("bindStatus").toString()).getName());
accountCardVO.setBindReqDatetime(accountCardResult.get("bindReqDatetime").toString());
accountCardVO.setUnbindReqDatetime(accountCardResult.get("unbindReqDatetime").toString());
accountCardVO.setActiveReqDatetime(accountCardResult.get("activeDatetime").toString());
accountCardVO.setUnactiveReqDatetime(accountCardResult.get("unactiveDatetime").toString());
accountCardVOs.add(accountCardVO);
}
}
if (null != accountCardVOs && accountCardVOs.size() >= 1) {
// 对后果 custBankList 集分页
total = accountCardVOs.size();
int pageSize = page.getPageSize();
int currPage = page.getCurrPage();
int pageNum = total % pageSize == 0 ? total / pageSize : total / pageSize + 1;
if (pageNum < currPage) {accountCardVOs=accountCardVOs.subList(pageSize*(pageNum-1), ((pageSize*pageNum)>total?total:(pageSize*pageNum)));
dataMap.put("currPage", String.valueOf(pageNum));
} else {accountCardVOs=accountCardVOs.subList(pageSize*(currPage-1), ((pageSize*currPage)>total?total:(pageSize*currPage)));
}
}
} catch (Exception e) {logger.error("依据会员号或账户卡号查问账户卡信息失败,e============" + e);
}
dataMap.put("list", accountCardVOs);
dataMap.put("maxCount", total);
return dataMap;
}
/**
*
* <p> 解绑账户卡 </p>
* @param req
* @return
* @return Map<String,Object>
*/
@RequestMapping("/accCardUnBind")
public @ResponseBody
Map<String, Object> queryAccountLimit(AccountCardVO accountCardVO) {Map<String, Object> dataMap = new HashMap<String, Object>();
Map<String, String> param = new HashMap<String, String>();
dataMap.put(BaseControllerSupport.MESSAGE, BaseControllerSupport.FAIL_FLAG);
try {param.put("cardIndex", accountCardVO.getCardIndex());
param.put("custId", accountCardVO.getCustomerId());
Map<String, Object> map = accountCardInfoManageHPClient.accCardUnBind(param);
if(map!=null && StringUtils.equals("OK",(String) map.get("_sysRet")) && StringUtils.equals(SUC_CODE_000000,(String) map.get("_retCode"))){dataMap.put(BaseControllerSupport.MESSAGE, BaseControllerSupport.SUCCESS_FLAG);
}
} catch (Exception e) {logger.error("账户卡解绑失败,e============" + e);
}
return dataMap;
}
/**
*
* <p> 勾销激活账户卡 </p>
* @param req
* @return
* @return Map<String,Object>
*/
@RequestMapping("/accCardCancelOfflinePay")
public @ResponseBody
Map<String, Object> modAccountLimit(AccountCardVO accountCardVO) {Map<String, Object> dataMap = new HashMap<String, Object>();
Map<String, String> param = new HashMap<String, String>();
dataMap.put(BaseControllerSupport.MESSAGE, BaseControllerSupport.FAIL_FLAG);
try {param.put("cardIndex", accountCardVO.getCardIndex());
param.put("custId", accountCardVO.getCustomerId());
Map<String, Object> map = accountCardInfoManageHPClient.accCardCancelOfflinePay(param);
if(map!=null && StringUtils.equals("OK",(String) map.get("_sysRet")) && StringUtils.equals(SUC_CODE_000000,(String) map.get("_retCode"))){dataMap.put("privateAmount", AmountUtil.convertToActAmountHd(map.get("privateAmount").toString()));
dataMap.put("shareAmount", AmountUtil.convertToActAmountHd(map.get("shareAmount").toString()));
dataMap.put(BaseControllerSupport.MESSAGE, BaseControllerSupport.SUCCESS_FLAG);
}
} catch (Exception e) {logger.error("账户卡勾销激活失败,e============" + e);
return dataMap;
}
return dataMap;
}
}