12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- package com.chinacreator.videoalliance.order.service;
- import java.util.Date;
- import org.apache.commons.lang.math.NumberUtils;
- import org.apache.commons.lang.time.DateFormatUtils;
- import org.springframework.stereotype.Component;
- import com.chinacreator.videoalliance.order.bean.BussinessBean;
- import com.chinacreator.videoalliance.order.bean.WxcsBean;
- @Component
- public class WxcsService {
-
- public int checkVipConfig(WxcsBean wxcsBean,String discntFee) {
- if (!wxcsBean.getVipstatus().equals("0")
- || NumberUtils.toLong(DateFormatUtils.format(new Date(), "yyyyMMddHHmmss")) > NumberUtils.toLong(wxcsBean.getVipendtime())
- || NumberUtils.toLong(DateFormatUtils.format(new Date(), "yyyyMMddHHmmss")) < NumberUtils.toLong(wxcsBean
- .getVipstarttime())) {
- return 3;
- }
- if(NumberUtils.toInt(wxcsBean.getTotalvip()) <= getVipUseNum(wxcsBean.getCpid(), wxcsBean.getSpid())){
- return 4;
- }
- return 0;
- }
-
- public int checkVip(BussinessBean bussinessBean ){
- int vipstatus = 0;
- switch (Integer.valueOf(bussinessBean.getVipstatus())) {
- case 0:
- vipstatus = 1;
- break;
- case 1:
- vipstatus = 5;
- break;
- case 2:
- vipstatus = 0;
- break;
- }
- return vipstatus;
- }
-
- public int checkFlow(BussinessBean bussinessBean ){
- int flowstatus = Integer.valueOf(bussinessBean.getFlowstatus());
- switch (flowstatus) {
- case 1:
- if(bussinessBean.getPortstatus().equals("0")){
- flowstatus = 0;
- }else{
- flowstatus = 4;
- }
- break;
- case 2:
- flowstatus = 4;
- break;
- case 7:
- flowstatus = 1;
- break;
- case 3:
- flowstatus = 1;
- break;
- case 8:
- flowstatus = 2;
- break;
- }
- return flowstatus;
- }
- public int checkFlowConfig(WxcsBean wxcsBean,String discntFee) {
- if (!wxcsBean.getFlowstatus().equals("0")
- || NumberUtils.toLong(DateFormatUtils.format(new Date(), "yyyyMMddHHmmss")) > NumberUtils.toLong(wxcsBean.getFlowendtime())
- || NumberUtils.toLong(DateFormatUtils.format(new Date(), "yyyyMMddHHmmss")) < NumberUtils.toLong(wxcsBean
- .getFlowstarttime())) {
- return 3;
- }
- return 0;
- }
-
- public int getVipUseNum(String cpid,String spid){
- return 0;
- }
- }
|