|  |  | 
 |  |  |  | 
 |  |  | import com.dy.common.webUtil.BaseResponse; | 
 |  |  | import com.dy.common.webUtil.BaseResponseUtils; | 
 |  |  | import com.dy.common.webUtil.QueryResultVo; | 
 |  |  | import com.dy.pipIrrGlobal.daoSe.*; | 
 |  |  | import com.dy.pipIrrGlobal.pojoSe.SeVcRecharge; | 
 |  |  | import com.dy.pipIrrGlobal.pojoSe.SeVcRefund; | 
 |  |  | import com.dy.pipIrrGlobal.pojoSe.SeVcRefundItem; | 
 |  |  | import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard; | 
 |  |  | import com.dy.pipIrrGlobal.voSe.VoOrders; | 
 |  |  | import com.dy.pipIrrGlobal.voSe.VoVcRecharge; | 
 |  |  | import com.dy.pipIrrGlobal.voSe.VoVirtualCard; | 
 |  |  | import com.dy.pipIrrSell.result.SellResultCode; | 
 |  |  | import com.dy.pipIrrSell.virtualCard.dto.DtoVcRecharge; | 
 |  |  | import com.dy.pipIrrSell.virtualCard.dto.DtoVirtualCard; | 
 |  |  | import com.dy.pipIrrSell.virtualCard.enums.LastOperateENUM; | 
 |  |  | import com.dy.pipIrrSell.virtualCard.enums.OrderStateENUM; | 
 |  |  | import lombok.extern.slf4j.Slf4j; | 
 |  |  | import org.apache.dubbo.common.utils.PojoUtils; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.beans.factory.annotation.Value; | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  | import org.springframework.transaction.annotation.Transactional; | 
 |  |  |  | 
 |  |  | import java.util.Date; | 
 |  |  | import java.util.List; | 
 |  |  | import java.util.Map; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * @author ZhuBaoMin | 
 |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private SeClientMapper seClientMapper; | 
 |  |  |  | 
 |  |  |     @Value("${vc.alarmValue}") | 
 |  |  |     private Integer alarmValue; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 根据农户ID获取5级行政区划代码,注册虚拟卡使用 | 
 |  |  |      * @param clientId 农户ID | 
 |  |  | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     public List<VoVirtualCard> getVCs(Long clientId) { | 
 |  |  |         return seVirtualCardMapper.getVCs(clientId); | 
 |  |  |         return seVirtualCardMapper.getVCs(alarmValue, clientId); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  | 
 |  |  |         String orderNumber = po.getOrderNumber(); | 
 |  |  |         Long virtualId = po.getVirtualId(); | 
 |  |  |         Long clientId = po.getClientId(); | 
 |  |  |         Integer rechargeAmount = po.getRechargeAmount(); | 
 |  |  |         Double rechargeAmount = po.getRechargeAmount(); | 
 |  |  |  | 
 |  |  |         // 验证该虚拟卡账户是否存在并取出当前账户余额 | 
 |  |  |         SeVirtualCard seVirtualCard = seVirtualCardMapper.selectByPrimaryKey(virtualId); | 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 根据订单号获取虚拟卡充值对象 | 
 |  |  |      * @param orderNumber | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     public SeVcRecharge getVCRechargeByorderNumber(String orderNumber) { | 
 |  |  |         return seVcRechargeMapper.getVCRechargeByorderNumber(orderNumber); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 修改虚拟卡充值记录 | 
 |  |  |      * 微信支付通知后: | 
 |  |  |      *      1. 更新充值表:充值后余额、支付完成时间、订单状态 | 
 |  |  | 
 |  |  |  | 
 |  |  |         Long virtualId = seVcRecharge.getVcId(); | 
 |  |  |         Double money = seVcRecharge.getMoney(); | 
 |  |  |         Integer rechargeAmount = seVcRecharge.getRechargeAmount(); | 
 |  |  |         Double rechargeAmount = seVcRecharge.getRechargeAmount(); | 
 |  |  |         Double afterRrecharge = money + rechargeAmount; | 
 |  |  |  | 
 |  |  |         seVcRecharge.setAfterRecharge(afterRrecharge); | 
 |  |  | 
 |  |  |      * @param orderNumber | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     public Integer getRechargeAmountByOrderNumber(String orderNumber) { | 
 |  |  |     public Double getRechargeAmountByOrderNumber(String orderNumber) { | 
 |  |  |         return seVcRechargeMapper.getRechargeAmountByOrderNumber(orderNumber); | 
 |  |  |  | 
 |  |  |     } | 
 |  |  | 
 |  |  |     public Long getRefundIdByRefundNumber(String refundNumber) { | 
 |  |  |         return seVcRefundItemMapper.getRefundIdByRefundNumber(refundNumber); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 获取虚拟卡充值记录 | 
 |  |  |      * @param dtoVcRecharge | 
 |  |  |      * @return | 
 |  |  |      */ | 
 |  |  |     public QueryResultVo<List<VoVcRecharge>> getVcRechargeRecords(DtoVcRecharge dtoVcRecharge){ | 
 |  |  |         Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(dtoVcRecharge); | 
 |  |  |         Long itemTotal = seVirtualCardMapper.getRechargeRecordCount(params); | 
 |  |  |  | 
 |  |  |         QueryResultVo<List<VoVcRecharge>> rsVo = new QueryResultVo<>(); | 
 |  |  |         rsVo.pageSize = dtoVcRecharge.pageSize; | 
 |  |  |         rsVo.pageCurr = dtoVcRecharge.pageCurr; | 
 |  |  |  | 
 |  |  |         rsVo.calculateAndSet(itemTotal, params); | 
 |  |  |         rsVo.obj = seVirtualCardMapper.getVcRechargeRecords(params); | 
 |  |  |  | 
 |  |  |         return rsVo; | 
 |  |  |     } | 
 |  |  | } |