|  |  |  | 
|---|
|  |  |  | &&StringUtils.isNotBlank(cashConsumption.getParamValue())){ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | BigDecimal scoreSetting0 = new BigDecimal(cashConsumption.getParamValue()); | 
|---|
|  |  |  | cashScore[0]= cashPayAmount.divide(scoreSetting0).intValue(); | 
|---|
|  |  |  | if(scoreSetting0.compareTo(BigDecimal.ZERO)>0) { | 
|---|
|  |  |  | cashScore[0] = cashPayAmount.divide(scoreSetting0).intValue(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(StringUtils.isNotBlank(cashConsumption.getParamValue1())){ | 
|---|
|  |  |  | BigDecimal scoreSetting1 = new BigDecimal(cashConsumption.getParamValue1()); | 
|---|
|  |  |  | cashScore[1]= cashPayAmount.divide(scoreSetting1).intValue(); | 
|---|
|  |  |  | if(scoreSetting1.compareTo(BigDecimal.ZERO)>0){ | 
|---|
|  |  |  | cashScore[1]= cashPayAmount.divide(scoreSetting1).intValue(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(StringUtils.isNotBlank(cashConsumption.getParamValue2())){ | 
|---|
|  |  |  | BigDecimal scoreSetting2 = new BigDecimal(cashConsumption.getParamValue2()); | 
|---|
|  |  |  | cashScore[2]= cashPayAmount.divide(scoreSetting2).intValue(); | 
|---|
|  |  |  | if(scoreSetting2.compareTo(BigDecimal.ZERO)>0){ | 
|---|
|  |  |  | cashScore[2]= cashPayAmount.divide(scoreSetting2).intValue(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | &&StringUtils.isNotBlank(principalBalanceConsumption.getParamValue())){ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | BigDecimal scoreSetting0 = new BigDecimal(principalBalanceConsumption.getParamValue()); | 
|---|
|  |  |  | cardScore[0]= cardPayAmount.divide(scoreSetting0).intValue(); | 
|---|
|  |  |  | if(scoreSetting0.compareTo(BigDecimal.ZERO)>0) { | 
|---|
|  |  |  | cardScore[0] = cardPayAmount.divide(scoreSetting0).intValue(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(StringUtils.isNotBlank(principalBalanceConsumption.getParamValue1())){ | 
|---|
|  |  |  | BigDecimal scoreSetting1 = new BigDecimal(principalBalanceConsumption.getParamValue1()); | 
|---|
|  |  |  | cardScore[1]= cardPayAmount.divide(scoreSetting1).intValue(); | 
|---|
|  |  |  | if(scoreSetting1.compareTo(BigDecimal.ZERO)>0) { | 
|---|
|  |  |  | cardScore[1] = cardPayAmount.divide(scoreSetting1).intValue(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(StringUtils.isNotBlank(principalBalanceConsumption.getParamValue2())){ | 
|---|
|  |  |  | BigDecimal scoreSetting2 = new BigDecimal(principalBalanceConsumption.getParamValue2()); | 
|---|
|  |  |  | cardScore[2]= cardPayAmount.divide(scoreSetting2).intValue(); | 
|---|
|  |  |  | if(scoreSetting2.compareTo(BigDecimal.ZERO)>0) { | 
|---|
|  |  |  | cardScore[2] = cardPayAmount.divide(scoreSetting2).intValue(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | &&StringUtils.isNotBlank(bonusBalanceConsumption.getParamValue())){ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | BigDecimal scoreSetting0 = new BigDecimal(bonusBalanceConsumption.getParamValue()); | 
|---|
|  |  |  | giftScore[0]= giftPayAmount.divide(scoreSetting0).intValue(); | 
|---|
|  |  |  | if(scoreSetting0.compareTo(BigDecimal.ZERO)>0) { | 
|---|
|  |  |  | giftScore[0] = giftPayAmount.divide(scoreSetting0).intValue(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(StringUtils.isNotBlank(bonusBalanceConsumption.getParamValue1())){ | 
|---|
|  |  |  | BigDecimal scoreSetting1 = new BigDecimal(bonusBalanceConsumption.getParamValue1()); | 
|---|
|  |  |  | giftScore[1]= giftPayAmount.divide(scoreSetting1).intValue(); | 
|---|
|  |  |  | if(scoreSetting1.compareTo(BigDecimal.ZERO)>0) { | 
|---|
|  |  |  | giftScore[1] = giftPayAmount.divide(scoreSetting1).intValue(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(StringUtils.isNotBlank(bonusBalanceConsumption.getParamValue2())){ | 
|---|
|  |  |  | BigDecimal scoreSetting2 = new BigDecimal(bonusBalanceConsumption.getParamValue2()); | 
|---|
|  |  |  | giftScore[2]= giftPayAmount.divide(scoreSetting2).intValue(); | 
|---|
|  |  |  | if(scoreSetting2.compareTo(BigDecimal.ZERO)>0) { | 
|---|
|  |  |  | giftScore[2] = giftPayAmount.divide(scoreSetting2).intValue(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | ShoppingGoods goods = shoppingGoodsDao.selectById(goodsId); | 
|---|
|  |  |  | flow.setFlowContent(goods.getName() + "等" + sourceOrder.getItems().size() + "件产品"); | 
|---|
|  |  |  | // 若是退款,则取负数 | 
|---|
|  |  |  | if (SysOrder.ORDER_TYPE_REFUND == sourceOrder.getOrderType()) { | 
|---|
|  |  |  | if (SysOrder.ORDER_TYPE_REFUND== sourceOrder.getOrderType()) { | 
|---|
|  |  |  | flow.setFlowType(SysOrderFlow.FLOW_TYPE_REFUND); | 
|---|
|  |  |  | flow.setAmount(flow.getAmount().negate()); | 
|---|
|  |  |  | flow.setOrderId(sourceOrder.getOldOrderId()); | 
|---|
|  |  |  | 
|---|
|  |  |  | order.setRemark(cardUser.getCardName()); | 
|---|
|  |  |  | order.setStaffId(user.getSuId()); | 
|---|
|  |  |  | order.setIsCross(2 + ""); | 
|---|
|  |  |  | order.setOrderType(SysOrder.ORDER_TYPE_SEAL); | 
|---|
|  |  |  | order.setStatu(Dictionary.ORDER_STATU_YFK); | 
|---|
|  |  |  | order.setCompanyId(user.getCompanyId()); | 
|---|
|  |  |  | sysOrderDao.insert(order); | 
|---|
|  |  |  | 
|---|
|  |  |  | orderItem.setPrice(czVo.getBjmoney()); | 
|---|
|  |  |  | orderItem.setStatus(Dictionary.ORDER_STATU_YFK); | 
|---|
|  |  |  | orderItem.setAchieveList(czVo.getAchaeveList()); | 
|---|
|  |  |  | orderItem.setShoppingGoods(shoppingGoods); | 
|---|
|  |  |  | orderItemDao.insert(orderItem); | 
|---|
|  |  |  | List<SysOrderItem> items = new ArrayList<>(); | 
|---|
|  |  |  | items.add(orderItem); | 
|---|
|  |  |  | 
|---|
|  |  |  | moneyCardUseFlowDao.insert(moneyCardUseFlow); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | order.setFlows(czVo.getFlows()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | addOrderFlow(order); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 添加员工业绩 | 
|---|
|  |  |  | achieveNewService.addAchaeveByOrder(order); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return order; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|