|
|
|
@@ -1,6 +1,5 @@ |
|
|
|
package com.iformall.service.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import com.iformall.common.ErrorCode; |
|
|
|
@@ -16,7 +15,6 @@ import com.iformall.service.WxCardSpendService; |
|
|
|
import com.iformall.service.WxProfitSharingOrderService; |
|
|
|
import com.iformall.utils.Constant; |
|
|
|
import org.apache.commons.io.FileUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.poi.ss.usermodel.Cell; |
|
|
|
import org.apache.poi.ss.usermodel.Row; |
|
|
|
import org.apache.poi.xssf.usermodel.XSSFSheet; |
|
|
|
@@ -32,6 +30,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.*; |
|
|
|
import java.text.DecimalFormat; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
@@ -368,6 +367,10 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { |
|
|
|
cardSpend.setCardId(cardId); |
|
|
|
cardSpend.setOrderId(orderId); |
|
|
|
cardSpend = wxCardSpendMapper.selectOne(cardSpend); |
|
|
|
if (cardSpend != null && cardSpend.getRealPayment() <= 0) { |
|
|
|
logger.error("微信分账金额为0, 无法再分"); |
|
|
|
return; |
|
|
|
} |
|
|
|
WxCardInfo cardInfo = wxCardInfoMapper.selectByPrimaryKey(cardSpend.getCardId()); |
|
|
|
WxOrder wxOrder = wxOrderMapper.selectByPrimaryKey(orderId); |
|
|
|
WxMerchant merchant = wxMerchantMapper.selectByPrimaryKey(cardSpend.getMerchantId()); |
|
|
|
@@ -388,6 +391,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { |
|
|
|
ResultData resultData = profitSharingOrderService.createSharingOrder(shareOrder); |
|
|
|
if(resultData.code != Result.SUCCESS) { |
|
|
|
// 分账异常 |
|
|
|
logger.error(resultData.message); |
|
|
|
throw new MallinkException(resultData.code, resultData.message); |
|
|
|
} |
|
|
|
|
|
|
|
@@ -483,7 +487,8 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { |
|
|
|
String filename = UUID.randomUUID() + ".xlsx"; |
|
|
|
filepath = filepath + filename; |
|
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
DecimalFormat df = new DecimalFormat("0.00"); |
|
|
|
|
|
|
|
try { |
|
|
|
File file = new File(filepath); |
|
|
|
@@ -527,16 +532,19 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { |
|
|
|
|
|
|
|
WxCardSpendVo entity = cardSpendVoList.get(i); |
|
|
|
|
|
|
|
idCellTwo.setCellValue(entity.getId()); |
|
|
|
idCellTwo.setCellValue(String.valueOf(entity.getId())); |
|
|
|
ownerCellTwo.setCellValue(entity.getOnickName()); |
|
|
|
phoneCellTwo.setCellValue(entity.getOuPhone()); |
|
|
|
cardNameCellTwo.setCellValue(entity.getTitle()); |
|
|
|
merchantNameCellTwo.setCellValue(entity.getMerchantName()); |
|
|
|
costCellTwo.setCellValue(entity.getDeductionAmount()); |
|
|
|
String dStr = df.format((float)entity.getDeductionAmount()/100); |
|
|
|
costCellTwo.setCellValue(dStr); |
|
|
|
if (entity.getCreateDate() != null) |
|
|
|
costTimeCellTwo.setCellValue(sdf.format(entity.getCreateDate())); |
|
|
|
receivePayCellTwo.setCellValue(entity.getPayment()); |
|
|
|
realReceivePayCellTwo.setCellValue(entity.getRealPayment()); |
|
|
|
dStr = df.format((float)entity.getPayment()/100); |
|
|
|
receivePayCellTwo.setCellValue(dStr); |
|
|
|
dStr = df.format((float)entity.getRealPayment()/100); |
|
|
|
realReceivePayCellTwo.setCellValue(dStr); |
|
|
|
String statusStr = "未支付"; |
|
|
|
if (entity.getPayStatus().equals(EnumCardSpendStatus.NOT_PAY.getCode())) |
|
|
|
statusStr = "未支付"; |
|
|
|
|