|
|
@@ -17,6 +17,7 @@ import com.fs.common.annotation.DataScope;
|
|
|
import com.fs.common.config.FSSysConfig;
|
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.core.redis.RedisCache;
|
|
|
+import com.fs.common.exception.ServiceException;
|
|
|
import com.fs.common.utils.DateUtils;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.company.domain.Company;
|
|
|
@@ -38,10 +39,10 @@ import com.fs.his.utils.ConfigUtil;
|
|
|
import com.fs.hisStore.enums.StatTypeEnum;
|
|
|
import com.fs.hisStore.enums.SysConfigEnum;
|
|
|
import com.fs.hisStore.param.*;
|
|
|
+import com.fs.hisStore.vo.FsStoreScanPaymentStatDetailsVo;
|
|
|
import com.fs.hisStore.vo.FsStoreScanPaymentStatVo;
|
|
|
import com.fs.huifuPay.domain.HuiFuCreateOrder;
|
|
|
import com.fs.huifuPay.domain.HuifuCreateOrderResult;
|
|
|
-import com.fs.huifuPay.sdk.opps.core.utils.ObjectUtils;
|
|
|
import com.fs.huifuPay.service.HuiFuService;
|
|
|
import com.fs.pay.pay.dto.WxJspayDTO;
|
|
|
import com.fs.hisStore.vo.FsStorePaymentStatisticsVO;
|
|
|
@@ -64,6 +65,7 @@ import com.github.binarywang.wxpay.exception.WxPayException;
|
|
|
import com.github.binarywang.wxpay.service.TransferService;
|
|
|
import com.github.binarywang.wxpay.service.WxPayService;
|
|
|
import com.github.binarywang.wxpay.service.impl.WxPayServiceImpl;
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
import me.chanjar.weixin.common.error.WxErrorException;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
@@ -896,10 +898,10 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public R getScanPaymentStat(FsStoreScanPaymentStatParam param) {
|
|
|
+ public FsStoreScanPaymentStatVo getScanPaymentStat(FsStoreScanPaymentStatParam param) {
|
|
|
//验证类型是否错误
|
|
|
if (!StatTypeEnum.isValid(param.getStatType())) {
|
|
|
- return R.error("操作失败,无效的统计类型!有效类型为:" + StatTypeEnum.getAllValidTypes());
|
|
|
+ throw new ServiceException("操作失败,无效的统计类型!有效类型为:" + StatTypeEnum.getAllValidTypes());
|
|
|
}
|
|
|
|
|
|
StatTypeEnum statTypeEnum = param.toStatTypeEnum();
|
|
|
@@ -910,20 +912,47 @@ public class FsStorePaymentScrmServiceImpl implements IFsStorePaymentScrmService
|
|
|
break;
|
|
|
case MONTH://月
|
|
|
paymentStatVo = fsStorePaymentMapper.getScanPaymentMonthStat(param);
|
|
|
+
|
|
|
break;
|
|
|
case YEAR://年
|
|
|
paymentStatVo = fsStorePaymentMapper.getScanPaymentYearStat(param);
|
|
|
break;
|
|
|
case DATE://日期
|
|
|
if(StringUtils.isEmpty(param.getStartDate())){
|
|
|
- return R.error("操作失败,开始日期不能为空!");
|
|
|
+ throw new ServiceException("操作失败,开始日期不能为空!");
|
|
|
}else if(StringUtils.isEmpty(param.getEndDate())){
|
|
|
- return R.error("操作失败,结日期不能为空!");
|
|
|
+ throw new ServiceException("操作失败,结日期不能为空!");
|
|
|
}
|
|
|
paymentStatVo = fsStorePaymentMapper.getScanPaymentDateStat(param);
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- return R.ok("操作成功!").put("data", paymentStatVo);
|
|
|
+ return paymentStatVo;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<FsStoreScanPaymentStatDetailsVo> getScanPaymentStatPage(FsStoreScanPaymentStatParam param) {
|
|
|
+ StatTypeEnum statTypeEnum = param.toStatTypeEnum();
|
|
|
+ List<FsStoreScanPaymentStatDetailsVo> paymentStatDetailsVos = null;
|
|
|
+ switch (statTypeEnum) {
|
|
|
+ case DAY://日
|
|
|
+ paymentStatDetailsVos = fsStorePaymentMapper.getScanPaymentDayStatDetails(param);
|
|
|
+ break;
|
|
|
+ case MONTH://月
|
|
|
+
|
|
|
+ break;
|
|
|
+ case YEAR://年
|
|
|
+
|
|
|
+ break;
|
|
|
+ case DATE://日期
|
|
|
+ if(StringUtils.isEmpty(param.getStartDate())){
|
|
|
+ throw new ServiceException("操作失败,开始日期不能为空!");
|
|
|
+ }else if(StringUtils.isEmpty(param.getEndDate())){
|
|
|
+ throw new ServiceException("操作失败,结日期不能为空!");
|
|
|
+ }
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return paymentStatDetailsVos;
|
|
|
}
|
|
|
}
|