|
|
|
@@ -30,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import com.iformall.common.IdWorker; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.text.ParseException; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
@@ -81,7 +82,7 @@ public class WxSubsidyServiceImpl implements WxSubsidyService { |
|
|
|
"\"XML_FORMAT_ERROR\":{\"detail\":\"XML格式错误\t\",\"reason\":\"XML格式错误\",\"reason\":\"请检查XML参数格式是否正确\"}}"); |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData createSubsidy(MallUserInfo user, String ip, Integer amount) { |
|
|
|
public ResultData createSubsidy(MallUserInfo user, String ip, String amountStr) { |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
EnumPayShare isShare = EnumPayShare.NO; |
|
|
|
Date curDate = new Date(); |
|
|
|
@@ -93,7 +94,8 @@ public class WxSubsidyServiceImpl implements WxSubsidyService { |
|
|
|
isShare = EnumPayShare.YES; |
|
|
|
} |
|
|
|
// 3. 补贴订单 |
|
|
|
Integer totalFee = amount * 100; // 元->分 |
|
|
|
BigDecimal amountY = new BigDecimal(amountStr); |
|
|
|
int totalFee = amountY.multiply(new BigDecimal(100)).intValue(); // 元->分 |
|
|
|
|
|
|
|
Long id = idWorker.nextId(); |
|
|
|
String payOrderNo = String.valueOf(id); |
|
|
|
@@ -104,7 +106,7 @@ public class WxSubsidyServiceImpl implements WxSubsidyService { |
|
|
|
record.setCreateTime(curDate); |
|
|
|
record.setUpdateTime(curDate); |
|
|
|
record.setOrderNo(payOrderNo); |
|
|
|
record.setBody("商场补贴-"+amount + "元"); |
|
|
|
record.setBody("商场补贴-"+amountStr + "元"); |
|
|
|
record.setIp(ip); |
|
|
|
record.setStatus(EnumPayStatus.PAY_STATUS_WAIT.getCode()); |
|
|
|
record.setPayTimeStart(curDate); |
|
|
|
|