|
@@ -230,12 +230,13 @@ public class TOrderController {
|
|
|
|
|
|
// 支付方式:0或null为汇聚,1为汇付支付
|
|
// 支付方式:0或null为汇聚,1为汇付支付
|
|
String payPlatform = admin.getPayPlatform();
|
|
String payPlatform = admin.getPayPlatform();
|
|
|
|
+ String companyType = admin.getCompanyType();
|
|
// 汇聚分账参数
|
|
// 汇聚分账参数
|
|
JSONArray altInfo = new JSONArray();
|
|
JSONArray altInfo = new JSONArray();
|
|
// 汇付分账明细参数
|
|
// 汇付分账明细参数
|
|
JSONObject acctSplitBunch = new JSONObject();
|
|
JSONObject acctSplitBunch = new JSONObject();
|
|
if(StringUtils.isNotEmpty(payPlatform)&&payPlatform.equals("1")){
|
|
if(StringUtils.isNotEmpty(payPlatform)&&payPlatform.equals("1")){
|
|
- acctSplitBunch = getAcctSplitBunch(proportion, price);
|
|
|
|
|
|
+ acctSplitBunch = getAcctSplitBunch(proportion, price, companyType);
|
|
} else {
|
|
} else {
|
|
altInfo = getAltInfo(proportion, price);
|
|
altInfo = getAltInfo(proportion, price);
|
|
}
|
|
}
|
|
@@ -282,14 +283,14 @@ public class TOrderController {
|
|
if(admin.getType()==0){
|
|
if(admin.getType()==0){
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAgencyProportion(proportion.getAgencyProportion());
|
|
order.setAgencyProportion(proportion.getAgencyProportion());
|
|
- order.setAgencyId(admin.getId());
|
|
|
|
|
|
+ order.setAgencyId(proportion.getAgencyId());
|
|
}
|
|
}
|
|
if(admin.getType()==1){
|
|
if(admin.getType()==1){
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAgencyProportion(proportion.getAgencyProportion());
|
|
order.setAgencyProportion(proportion.getAgencyProportion());
|
|
order.setAgencyId(proportion.getAgencyId());
|
|
order.setAgencyId(proportion.getAgencyId());
|
|
order.setMerchantProportion(proportion.getMerchantProportion());
|
|
order.setMerchantProportion(proportion.getMerchantProportion());
|
|
- order.setMerchantId(admin.getId());
|
|
|
|
|
|
+ order.setMerchantId(proportion.getMerchantId());
|
|
}
|
|
}
|
|
if(admin.getType()==2){
|
|
if(admin.getType()==2){
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
@@ -298,7 +299,7 @@ public class TOrderController {
|
|
order.setMerchantProportion(proportion.getMerchantProportion());
|
|
order.setMerchantProportion(proportion.getMerchantProportion());
|
|
order.setMerchantId(proportion.getMerchantId());
|
|
order.setMerchantId(proportion.getMerchantId());
|
|
order.setPersonageProportion(proportion.getPersonageProportion());
|
|
order.setPersonageProportion(proportion.getPersonageProportion());
|
|
- order.setPersonageId(admin.getId());
|
|
|
|
|
|
+ order.setPersonageId(proportion.getPersonageId());
|
|
}
|
|
}
|
|
|
|
|
|
order.setPayPlatform(payPlatform);
|
|
order.setPayPlatform(payPlatform);
|
|
@@ -315,7 +316,7 @@ public class TOrderController {
|
|
orderDetails.setProductNumber(productNumber);
|
|
orderDetails.setProductNumber(productNumber);
|
|
orderDetails.setAmount(price);
|
|
orderDetails.setAmount(price);
|
|
orderDetails.setRefundStatus("0");
|
|
orderDetails.setRefundStatus("0");
|
|
- orderDetails.setCompanyType(admin.getCompanyType());
|
|
|
|
|
|
+ orderDetails.setCompanyType(companyType);
|
|
orderDetails.setMachineType(equipment.getMachineType());
|
|
orderDetails.setMachineType(equipment.getMachineType());
|
|
|
|
|
|
String client6 = clientId.substring(clientId.length() - 6);
|
|
String client6 = clientId.substring(clientId.length() - 6);
|
|
@@ -332,8 +333,12 @@ public class TOrderController {
|
|
tHuifuTempOrder.setId(id);
|
|
tHuifuTempOrder.setId(id);
|
|
BeanUtil.copyProperties(order,tHuifuTempOrder,ignoreProperties);
|
|
BeanUtil.copyProperties(order,tHuifuTempOrder,ignoreProperties);
|
|
huifuTempOrderService.save(tHuifuTempOrder);
|
|
huifuTempOrderService.save(tHuifuTempOrder);
|
|
- result = HuifuConstant.JUMP_URL+ "/#/weChatPay?id=" + id;
|
|
|
|
- System.out.println(result);
|
|
|
|
|
|
+ if (StrUtil.isNotEmpty(companyType)&&companyType.equals("1")) {
|
|
|
|
+ result = HuifuConstant.SC_JUMP_URL+ "/#/weChatPay?id=" + id;
|
|
|
|
+ } else {
|
|
|
|
+ result = HuifuConstant.SZ_JUMP_URL+ "/#/weChatPay?id=" + id;
|
|
|
|
+ }
|
|
|
|
+ log.info("返回链接:{}", result);
|
|
String qrcode = toQrcode(result);
|
|
String qrcode = toQrcode(result);
|
|
JSONObject kindData = new JSONObject();
|
|
JSONObject kindData = new JSONObject();
|
|
kindData.put("sn", sn);
|
|
kindData.put("sn", sn);
|
|
@@ -344,7 +349,7 @@ public class TOrderController {
|
|
try {
|
|
try {
|
|
result = huifuMchService.uniPay(
|
|
result = huifuMchService.uniPay(
|
|
orderNo, amount, productName1, productDesc,
|
|
orderNo, amount, productName1, productDesc,
|
|
- notifyUrl, frpCode, openId, appid, acctSplitBunch
|
|
|
|
|
|
+ notifyUrl, frpCode, openId, appid, acctSplitBunch, companyType
|
|
);
|
|
);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@@ -490,12 +495,13 @@ public class TOrderController {
|
|
|
|
|
|
// 支付方式:0或null为汇聚,1为汇付支付
|
|
// 支付方式:0或null为汇聚,1为汇付支付
|
|
String payPlatform = admin.getPayPlatform();
|
|
String payPlatform = admin.getPayPlatform();
|
|
|
|
+ String companyType = admin.getCompanyType();
|
|
// 汇聚分账参数
|
|
// 汇聚分账参数
|
|
JSONArray altInfo = new JSONArray();
|
|
JSONArray altInfo = new JSONArray();
|
|
// 汇付分账明细参数
|
|
// 汇付分账明细参数
|
|
JSONObject acctSplitBunch = new JSONObject();
|
|
JSONObject acctSplitBunch = new JSONObject();
|
|
if(StringUtils.isNotEmpty(payPlatform)&&payPlatform.equals("1")){
|
|
if(StringUtils.isNotEmpty(payPlatform)&&payPlatform.equals("1")){
|
|
- acctSplitBunch = getAcctSplitBunch(proportion, price);
|
|
|
|
|
|
+ acctSplitBunch = getAcctSplitBunch(proportion, price, companyType);
|
|
} else {
|
|
} else {
|
|
altInfo = getAltInfo(proportion, price);
|
|
altInfo = getAltInfo(proportion, price);
|
|
}
|
|
}
|
|
@@ -543,14 +549,14 @@ public class TOrderController {
|
|
if(admin.getType()==0){
|
|
if(admin.getType()==0){
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAgencyProportion(proportion.getAgencyProportion());
|
|
order.setAgencyProportion(proportion.getAgencyProportion());
|
|
- order.setAgencyId(admin.getId());
|
|
|
|
|
|
+ order.setAgencyId(proportion.getAgencyId());
|
|
}
|
|
}
|
|
if(admin.getType()==1){
|
|
if(admin.getType()==1){
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAgencyProportion(proportion.getAgencyProportion());
|
|
order.setAgencyProportion(proportion.getAgencyProportion());
|
|
order.setAgencyId(proportion.getAgencyId());
|
|
order.setAgencyId(proportion.getAgencyId());
|
|
order.setMerchantProportion(proportion.getMerchantProportion());
|
|
order.setMerchantProportion(proportion.getMerchantProportion());
|
|
- order.setMerchantId(admin.getId());
|
|
|
|
|
|
+ order.setMerchantId(proportion.getMerchantId());
|
|
}
|
|
}
|
|
if(admin.getType()==2){
|
|
if(admin.getType()==2){
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
@@ -559,7 +565,7 @@ public class TOrderController {
|
|
order.setMerchantProportion(proportion.getMerchantProportion());
|
|
order.setMerchantProportion(proportion.getMerchantProportion());
|
|
order.setMerchantId(proportion.getMerchantId());
|
|
order.setMerchantId(proportion.getMerchantId());
|
|
order.setPersonageProportion(proportion.getPersonageProportion());
|
|
order.setPersonageProportion(proportion.getPersonageProportion());
|
|
- order.setPersonageId(admin.getId());
|
|
|
|
|
|
+ order.setPersonageId(proportion.getPersonageId());
|
|
}
|
|
}
|
|
order.setPayPlatform(payPlatform);
|
|
order.setPayPlatform(payPlatform);
|
|
if(StringUtils.isNotEmpty(payPlatform)&&payPlatform.equals("1")){
|
|
if(StringUtils.isNotEmpty(payPlatform)&&payPlatform.equals("1")){
|
|
@@ -579,7 +585,7 @@ public class TOrderController {
|
|
orderDetails.setProductNumber(productNumber);
|
|
orderDetails.setProductNumber(productNumber);
|
|
orderDetails.setAmount(price);
|
|
orderDetails.setAmount(price);
|
|
orderDetails.setRefundStatus("0");
|
|
orderDetails.setRefundStatus("0");
|
|
- orderDetails.setCompanyType(admin.getCompanyType());
|
|
|
|
|
|
+ orderDetails.setCompanyType(companyType);
|
|
orderDetails.setMachineType(equipment.getMachineType());
|
|
orderDetails.setMachineType(equipment.getMachineType());
|
|
|
|
|
|
String client6 = clientId.substring(clientId.length() - 6);
|
|
String client6 = clientId.substring(clientId.length() - 6);
|
|
@@ -589,7 +595,7 @@ public class TOrderController {
|
|
order.setAcctSplitBunch(acctSplitBunch.toString());
|
|
order.setAcctSplitBunch(acctSplitBunch.toString());
|
|
try {
|
|
try {
|
|
result = huifuMchService.cardPay(
|
|
result = huifuMchService.cardPay(
|
|
- orderNo, amount, productName1, notifyUrl, authCode, acctSplitBunch
|
|
|
|
|
|
+ orderNo, amount, productName1, notifyUrl, authCode, acctSplitBunch, companyType
|
|
);
|
|
);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@@ -727,12 +733,13 @@ public class TOrderController {
|
|
|
|
|
|
// 支付方式:0或null为汇聚,1为汇付支付
|
|
// 支付方式:0或null为汇聚,1为汇付支付
|
|
String payPlatform = admin.getPayPlatform();
|
|
String payPlatform = admin.getPayPlatform();
|
|
|
|
+ String companyType = admin.getCompanyType();
|
|
// 汇聚分账参数
|
|
// 汇聚分账参数
|
|
JSONArray altInfo = new JSONArray();
|
|
JSONArray altInfo = new JSONArray();
|
|
// 汇付分账明细参数
|
|
// 汇付分账明细参数
|
|
JSONObject acctSplitBunch = new JSONObject();
|
|
JSONObject acctSplitBunch = new JSONObject();
|
|
if(StringUtils.isNotEmpty(payPlatform)&&payPlatform.equals("1")){
|
|
if(StringUtils.isNotEmpty(payPlatform)&&payPlatform.equals("1")){
|
|
- acctSplitBunch = getAcctSplitBunch(proportion, price);
|
|
|
|
|
|
+ acctSplitBunch = getAcctSplitBunch(proportion, price, companyType);
|
|
} else {
|
|
} else {
|
|
altInfo = getAltInfo(proportion, price);
|
|
altInfo = getAltInfo(proportion, price);
|
|
}
|
|
}
|
|
@@ -776,19 +783,19 @@ public class TOrderController {
|
|
order.setAltInfo(altInfo.toString());
|
|
order.setAltInfo(altInfo.toString());
|
|
order.setStatus(0);
|
|
order.setStatus(0);
|
|
order.setType(admin.getType());
|
|
order.setType(admin.getType());
|
|
- order.setCompanyType(admin.getCompanyType());
|
|
|
|
|
|
+ order.setCompanyType(companyType);
|
|
order.setMachineType(equipment.getMachineType());
|
|
order.setMachineType(equipment.getMachineType());
|
|
if(admin.getType()==0){
|
|
if(admin.getType()==0){
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAgencyProportion(proportion.getAgencyProportion());
|
|
order.setAgencyProportion(proportion.getAgencyProportion());
|
|
- order.setAgencyId(admin.getId());
|
|
|
|
|
|
+ order.setAgencyId(proportion.getAgencyId());
|
|
}
|
|
}
|
|
if(admin.getType()==1){
|
|
if(admin.getType()==1){
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAgencyProportion(proportion.getAgencyProportion());
|
|
order.setAgencyProportion(proportion.getAgencyProportion());
|
|
order.setAgencyId(proportion.getAgencyId());
|
|
order.setAgencyId(proportion.getAgencyId());
|
|
order.setMerchantProportion(proportion.getMerchantProportion());
|
|
order.setMerchantProportion(proportion.getMerchantProportion());
|
|
- order.setMerchantId(admin.getId());
|
|
|
|
|
|
+ order.setMerchantId(proportion.getMerchantId());
|
|
}
|
|
}
|
|
if(admin.getType()==2){
|
|
if(admin.getType()==2){
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
@@ -797,7 +804,7 @@ public class TOrderController {
|
|
order.setMerchantProportion(proportion.getMerchantProportion());
|
|
order.setMerchantProportion(proportion.getMerchantProportion());
|
|
order.setMerchantId(proportion.getMerchantId());
|
|
order.setMerchantId(proportion.getMerchantId());
|
|
order.setPersonageProportion(proportion.getPersonageProportion());
|
|
order.setPersonageProportion(proportion.getPersonageProportion());
|
|
- order.setPersonageId(admin.getId());
|
|
|
|
|
|
+ order.setPersonageId(proportion.getPersonageId());
|
|
}
|
|
}
|
|
order.setPayPlatform(payPlatform);
|
|
order.setPayPlatform(payPlatform);
|
|
if(StringUtils.isNotEmpty(payPlatform)&&payPlatform.equals("1")){
|
|
if(StringUtils.isNotEmpty(payPlatform)&&payPlatform.equals("1")){
|
|
@@ -818,9 +825,31 @@ public class TOrderController {
|
|
order2.setFrpCode(frpCode2);
|
|
order2.setFrpCode(frpCode2);
|
|
order2.setAltInfo(altInfo.toString());
|
|
order2.setAltInfo(altInfo.toString());
|
|
order2.setStatus(0);
|
|
order2.setStatus(0);
|
|
|
|
+ order2.setType(admin.getType());
|
|
order2.setPayPlatform(payPlatform);
|
|
order2.setPayPlatform(payPlatform);
|
|
- order2.setCompanyType(admin.getCompanyType());
|
|
|
|
|
|
+ order2.setCompanyType(companyType);
|
|
order2.setMachineType(equipment.getMachineType());
|
|
order2.setMachineType(equipment.getMachineType());
|
|
|
|
+ if(admin.getType()==0){
|
|
|
|
+ order2.setAdminProportion(proportion.getAdminProportion());
|
|
|
|
+ order2.setAgencyProportion(proportion.getAgencyProportion());
|
|
|
|
+ order2.setAgencyId(proportion.getAgencyId());
|
|
|
|
+ }
|
|
|
|
+ if(admin.getType()==1){
|
|
|
|
+ order2.setAdminProportion(proportion.getAdminProportion());
|
|
|
|
+ order2.setAgencyProportion(proportion.getAgencyProportion());
|
|
|
|
+ order2.setAgencyId(proportion.getAgencyId());
|
|
|
|
+ order2.setMerchantProportion(proportion.getMerchantProportion());
|
|
|
|
+ order2.setMerchantId(proportion.getMerchantId());
|
|
|
|
+ }
|
|
|
|
+ if(admin.getType()==2){
|
|
|
|
+ order2.setAdminProportion(proportion.getAdminProportion());
|
|
|
|
+ order2.setAgencyProportion(proportion.getAgencyProportion());
|
|
|
|
+ order2.setAgencyId(proportion.getAgencyId());
|
|
|
|
+ order2.setMerchantProportion(proportion.getMerchantProportion());
|
|
|
|
+ order2.setMerchantId(proportion.getMerchantId());
|
|
|
|
+ order2.setPersonageProportion(proportion.getPersonageProportion());
|
|
|
|
+ order2.setPersonageId(proportion.getPersonageId());
|
|
|
|
+ }
|
|
if(StringUtils.isNotEmpty(payPlatform)&&payPlatform.equals("1")){
|
|
if(StringUtils.isNotEmpty(payPlatform)&&payPlatform.equals("1")){
|
|
order2.setIsSettlement("0");
|
|
order2.setIsSettlement("0");
|
|
}
|
|
}
|
|
@@ -834,7 +863,7 @@ public class TOrderController {
|
|
orderDetails.setProductNo(product.getNo());
|
|
orderDetails.setProductNo(product.getNo());
|
|
orderDetails.setProductNumber(productNumber);
|
|
orderDetails.setProductNumber(productNumber);
|
|
orderDetails.setAmount(price);
|
|
orderDetails.setAmount(price);
|
|
- orderDetails.setCompanyType(admin.getCompanyType());
|
|
|
|
|
|
+ orderDetails.setCompanyType(companyType);
|
|
orderDetails.setRefundStatus("0");
|
|
orderDetails.setRefundStatus("0");
|
|
orderDetails.setMachineType(equipment.getMachineType());
|
|
orderDetails.setMachineType(equipment.getMachineType());
|
|
|
|
|
|
@@ -852,12 +881,17 @@ public class TOrderController {
|
|
tHuifuTempOrder.setId(id);
|
|
tHuifuTempOrder.setId(id);
|
|
BeanUtil.copyProperties(order,tHuifuTempOrder,ignoreProperties);
|
|
BeanUtil.copyProperties(order,tHuifuTempOrder,ignoreProperties);
|
|
huifuTempOrderService.save(tHuifuTempOrder);
|
|
huifuTempOrderService.save(tHuifuTempOrder);
|
|
- String result1 = HuifuConstant.JUMP_URL+ "/#/weChatPay?id=" + id;
|
|
|
|
|
|
+ String result1 = "";
|
|
|
|
+ if (StrUtil.isNotEmpty(companyType)&&companyType.equals("1")) {
|
|
|
|
+ result1 = HuifuConstant.SC_JUMP_URL+ "/#/weChatPay?id=" + id;
|
|
|
|
+ } else {
|
|
|
|
+ result1 = HuifuConstant.SZ_JUMP_URL+ "/#/weChatPay?id=" + id;
|
|
|
|
+ }
|
|
// 支付宝
|
|
// 支付宝
|
|
try {
|
|
try {
|
|
result = huifuMchService.uniPay(
|
|
result = huifuMchService.uniPay(
|
|
sn2, amount, productName1, productDesc,
|
|
sn2, amount, productName1, productDesc,
|
|
- notifyUrl, frpCode2, openId, appid, acctSplitBunch
|
|
|
|
|
|
+ notifyUrl, frpCode2, openId, appid, acctSplitBunch,companyType
|
|
);
|
|
);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@@ -1117,12 +1151,13 @@ public class TOrderController {
|
|
|
|
|
|
// 支付方式:0或null为汇聚,1为汇付支付
|
|
// 支付方式:0或null为汇聚,1为汇付支付
|
|
String payPlatform = admin.getPayPlatform();
|
|
String payPlatform = admin.getPayPlatform();
|
|
|
|
+ String companyType = admin.getCompanyType();
|
|
// 汇聚分账参数
|
|
// 汇聚分账参数
|
|
JSONArray altInfo = new JSONArray();
|
|
JSONArray altInfo = new JSONArray();
|
|
// 汇付分账明细参数
|
|
// 汇付分账明细参数
|
|
JSONObject acctSplitBunch = new JSONObject();
|
|
JSONObject acctSplitBunch = new JSONObject();
|
|
if(StringUtils.isNotEmpty(payPlatform)&&payPlatform.equals("1")){
|
|
if(StringUtils.isNotEmpty(payPlatform)&&payPlatform.equals("1")){
|
|
- acctSplitBunch = getAcctSplitBunch(proportion, price);
|
|
|
|
|
|
+ acctSplitBunch = getAcctSplitBunch(proportion, price, companyType);
|
|
} else {
|
|
} else {
|
|
altInfo = getAltInfo(proportion, price);
|
|
altInfo = getAltInfo(proportion, price);
|
|
}
|
|
}
|
|
@@ -1170,19 +1205,19 @@ public class TOrderController {
|
|
order.setProductNumber(productNumber);
|
|
order.setProductNumber(productNumber);
|
|
order.setStatus(0);
|
|
order.setStatus(0);
|
|
order.setType(admin.getType());
|
|
order.setType(admin.getType());
|
|
- order.setCompanyType(admin.getCompanyType());
|
|
|
|
|
|
+ order.setCompanyType(companyType);
|
|
order.setMachineType(equipment.getMachineType());
|
|
order.setMachineType(equipment.getMachineType());
|
|
if(admin.getType()==0){
|
|
if(admin.getType()==0){
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAgencyProportion(proportion.getAgencyProportion());
|
|
order.setAgencyProportion(proportion.getAgencyProportion());
|
|
- order.setAgencyId(admin.getId());
|
|
|
|
|
|
+ order.setAgencyId(proportion.getAgencyId());
|
|
}
|
|
}
|
|
if(admin.getType()==1){
|
|
if(admin.getType()==1){
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAgencyProportion(proportion.getAgencyProportion());
|
|
order.setAgencyProportion(proportion.getAgencyProportion());
|
|
order.setAgencyId(proportion.getAgencyId());
|
|
order.setAgencyId(proportion.getAgencyId());
|
|
order.setMerchantProportion(proportion.getMerchantProportion());
|
|
order.setMerchantProportion(proportion.getMerchantProportion());
|
|
- order.setMerchantId(admin.getId());
|
|
|
|
|
|
+ order.setMerchantId(proportion.getMerchantId());
|
|
}
|
|
}
|
|
if(admin.getType()==2){
|
|
if(admin.getType()==2){
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
@@ -1191,7 +1226,7 @@ public class TOrderController {
|
|
order.setMerchantProportion(proportion.getMerchantProportion());
|
|
order.setMerchantProportion(proportion.getMerchantProportion());
|
|
order.setMerchantId(proportion.getMerchantId());
|
|
order.setMerchantId(proportion.getMerchantId());
|
|
order.setPersonageProportion(proportion.getPersonageProportion());
|
|
order.setPersonageProportion(proportion.getPersonageProportion());
|
|
- order.setPersonageId(admin.getId());
|
|
|
|
|
|
+ order.setPersonageId(proportion.getPersonageId());
|
|
}
|
|
}
|
|
order.setPayPlatform(payPlatform);
|
|
order.setPayPlatform(payPlatform);
|
|
if(StringUtils.isNotEmpty(payPlatform)&&payPlatform.equals("1")){
|
|
if(StringUtils.isNotEmpty(payPlatform)&&payPlatform.equals("1")){
|
|
@@ -1212,29 +1247,29 @@ public class TOrderController {
|
|
order2.setAltInfo(altInfo.toString());
|
|
order2.setAltInfo(altInfo.toString());
|
|
order2.setStatus(0);
|
|
order2.setStatus(0);
|
|
order2.setProductNumber(productNumber);
|
|
order2.setProductNumber(productNumber);
|
|
- order.setType(admin.getType());
|
|
|
|
- order.setCompanyType(admin.getCompanyType());
|
|
|
|
|
|
+ order2.setType(admin.getType());
|
|
|
|
+ order2.setCompanyType(companyType);
|
|
order2.setMachineType(equipment.getMachineType());
|
|
order2.setMachineType(equipment.getMachineType());
|
|
if(admin.getType()==0){
|
|
if(admin.getType()==0){
|
|
- order.setAdminProportion(proportion.getAdminProportion());
|
|
|
|
- order.setAgencyProportion(proportion.getAgencyProportion());
|
|
|
|
- order.setAgencyId(admin.getId());
|
|
|
|
|
|
+ order2.setAdminProportion(proportion.getAdminProportion());
|
|
|
|
+ order2.setAgencyProportion(proportion.getAgencyProportion());
|
|
|
|
+ order2.setAgencyId(proportion.getAgencyId());
|
|
}
|
|
}
|
|
if(admin.getType()==1){
|
|
if(admin.getType()==1){
|
|
- order.setAdminProportion(proportion.getAdminProportion());
|
|
|
|
- order.setAgencyProportion(proportion.getAgencyProportion());
|
|
|
|
- order.setAgencyId(proportion.getAgencyId());
|
|
|
|
- order.setMerchantProportion(proportion.getMerchantProportion());
|
|
|
|
- order.setMerchantId(admin.getId());
|
|
|
|
|
|
+ order2.setAdminProportion(proportion.getAdminProportion());
|
|
|
|
+ order2.setAgencyProportion(proportion.getAgencyProportion());
|
|
|
|
+ order2.setAgencyId(proportion.getAgencyId());
|
|
|
|
+ order2.setMerchantProportion(proportion.getMerchantProportion());
|
|
|
|
+ order2.setMerchantId(proportion.getMerchantId());
|
|
}
|
|
}
|
|
if(admin.getType()==2){
|
|
if(admin.getType()==2){
|
|
- order.setAdminProportion(proportion.getAdminProportion());
|
|
|
|
- order.setAgencyProportion(proportion.getAgencyProportion());
|
|
|
|
- order.setAgencyId(proportion.getAgencyId());
|
|
|
|
- order.setMerchantProportion(proportion.getMerchantProportion());
|
|
|
|
- order.setMerchantId(proportion.getMerchantId());
|
|
|
|
- order.setPersonageProportion(proportion.getPersonageProportion());
|
|
|
|
- order.setPersonageId(admin.getId());
|
|
|
|
|
|
+ order2.setAdminProportion(proportion.getAdminProportion());
|
|
|
|
+ order2.setAgencyProportion(proportion.getAgencyProportion());
|
|
|
|
+ order2.setAgencyId(proportion.getAgencyId());
|
|
|
|
+ order2.setMerchantProportion(proportion.getMerchantProportion());
|
|
|
|
+ order2.setMerchantId(proportion.getMerchantId());
|
|
|
|
+ order2.setPersonageProportion(proportion.getPersonageProportion());
|
|
|
|
+ order2.setPersonageId(proportion.getPersonageId());
|
|
}
|
|
}
|
|
order2.setPayPlatform(payPlatform);
|
|
order2.setPayPlatform(payPlatform);
|
|
if(StringUtils.isNotEmpty(payPlatform)&&payPlatform.equals("1")){
|
|
if(StringUtils.isNotEmpty(payPlatform)&&payPlatform.equals("1")){
|
|
@@ -1246,7 +1281,7 @@ public class TOrderController {
|
|
orderDetails.setAdminId(admin.getId());
|
|
orderDetails.setAdminId(admin.getId());
|
|
orderDetails.setEquipmentId(equipmentId);
|
|
orderDetails.setEquipmentId(equipmentId);
|
|
orderDetails.setCreateDate(new Date());
|
|
orderDetails.setCreateDate(new Date());
|
|
- orderDetails.setCompanyType(admin.getCompanyType());
|
|
|
|
|
|
+ orderDetails.setCompanyType(companyType);
|
|
orderDetails.setRefundStatus("0");
|
|
orderDetails.setRefundStatus("0");
|
|
orderDetails.setMachineType(equipment.getMachineType());
|
|
orderDetails.setMachineType(equipment.getMachineType());
|
|
|
|
|
|
@@ -1273,12 +1308,17 @@ public class TOrderController {
|
|
tHuifuTempOrder.setId(id);
|
|
tHuifuTempOrder.setId(id);
|
|
BeanUtil.copyProperties(order,tHuifuTempOrder,ignoreProperties);
|
|
BeanUtil.copyProperties(order,tHuifuTempOrder,ignoreProperties);
|
|
huifuTempOrderService.save(tHuifuTempOrder);
|
|
huifuTempOrderService.save(tHuifuTempOrder);
|
|
- String result1 = HuifuConstant.JUMP_URL+"/#/weChatPay?id=" + id;
|
|
|
|
|
|
+ String result1 = "";
|
|
|
|
+ if (StrUtil.isNotEmpty(companyType)&&companyType.equals("1")) {
|
|
|
|
+ result1 = HuifuConstant.SC_JUMP_URL+ "/#/weChatPay?id=" + id;
|
|
|
|
+ } else {
|
|
|
|
+ result1 = HuifuConstant.SZ_JUMP_URL+ "/#/weChatPay?id=" + id;
|
|
|
|
+ }
|
|
// 支付宝
|
|
// 支付宝
|
|
try {
|
|
try {
|
|
result = huifuMchService.uniPay(
|
|
result = huifuMchService.uniPay(
|
|
sn2, amount, productName1, productDesc,
|
|
sn2, amount, productName1, productDesc,
|
|
- notifyUrl, frpCode2, openId, appid, acctSplitBunch
|
|
|
|
|
|
+ notifyUrl, frpCode2, openId, appid, acctSplitBunch, companyType
|
|
);
|
|
);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@@ -1578,12 +1618,13 @@ public class TOrderController {
|
|
|
|
|
|
// 支付方式:0或null为汇聚,1为汇付支付
|
|
// 支付方式:0或null为汇聚,1为汇付支付
|
|
String payPlatform = admin.getPayPlatform();
|
|
String payPlatform = admin.getPayPlatform();
|
|
|
|
+ String companyType = admin.getCompanyType();
|
|
// 汇聚分账参数
|
|
// 汇聚分账参数
|
|
JSONArray altInfo = new JSONArray();
|
|
JSONArray altInfo = new JSONArray();
|
|
// 汇付分账明细参数
|
|
// 汇付分账明细参数
|
|
JSONObject acctSplitBunch = new JSONObject();
|
|
JSONObject acctSplitBunch = new JSONObject();
|
|
if(StringUtils.isNotEmpty(payPlatform)&&payPlatform.equals("1")){
|
|
if(StringUtils.isNotEmpty(payPlatform)&&payPlatform.equals("1")){
|
|
- acctSplitBunch = getAcctSplitBunch(proportion, price);
|
|
|
|
|
|
+ acctSplitBunch = getAcctSplitBunch(proportion, price, companyType);
|
|
} else {
|
|
} else {
|
|
altInfo = getAltInfo(proportion, price);
|
|
altInfo = getAltInfo(proportion, price);
|
|
}
|
|
}
|
|
@@ -1673,7 +1714,7 @@ public class TOrderController {
|
|
order.setType(admin.getType());
|
|
order.setType(admin.getType());
|
|
order.setMarketingAmount(marketingAmount);
|
|
order.setMarketingAmount(marketingAmount);
|
|
order.setProductNumber(productNumber);
|
|
order.setProductNumber(productNumber);
|
|
- order.setCompanyType(admin.getCompanyType());
|
|
|
|
|
|
+ order.setCompanyType(companyType);
|
|
order.setMachineType(equipment.getMachineType());
|
|
order.setMachineType(equipment.getMachineType());
|
|
if(couponList.size()>0){
|
|
if(couponList.size()>0){
|
|
order.setCoupons(couponList.toString());
|
|
order.setCoupons(couponList.toString());
|
|
@@ -1681,14 +1722,14 @@ public class TOrderController {
|
|
if(admin.getType()==0){
|
|
if(admin.getType()==0){
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAgencyProportion(proportion.getAgencyProportion());
|
|
order.setAgencyProportion(proportion.getAgencyProportion());
|
|
- order.setAgencyId(admin.getId());
|
|
|
|
|
|
+ order.setAgencyId(proportion.getAgencyId());
|
|
}
|
|
}
|
|
if(admin.getType()==1){
|
|
if(admin.getType()==1){
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAgencyProportion(proportion.getAgencyProportion());
|
|
order.setAgencyProportion(proportion.getAgencyProportion());
|
|
order.setAgencyId(proportion.getAgencyId());
|
|
order.setAgencyId(proportion.getAgencyId());
|
|
order.setMerchantProportion(proportion.getMerchantProportion());
|
|
order.setMerchantProportion(proportion.getMerchantProportion());
|
|
- order.setMerchantId(admin.getId());
|
|
|
|
|
|
+ order.setMerchantId(proportion.getMerchantId());
|
|
}
|
|
}
|
|
if(admin.getType()==2){
|
|
if(admin.getType()==2){
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
order.setAdminProportion(proportion.getAdminProportion());
|
|
@@ -1697,7 +1738,7 @@ public class TOrderController {
|
|
order.setMerchantProportion(proportion.getMerchantProportion());
|
|
order.setMerchantProportion(proportion.getMerchantProportion());
|
|
order.setMerchantId(proportion.getMerchantId());
|
|
order.setMerchantId(proportion.getMerchantId());
|
|
order.setPersonageProportion(proportion.getPersonageProportion());
|
|
order.setPersonageProportion(proportion.getPersonageProportion());
|
|
- order.setPersonageId(admin.getId());
|
|
|
|
|
|
+ order.setPersonageId(proportion.getPersonageId());
|
|
}
|
|
}
|
|
order.setPayPlatform(payPlatform);
|
|
order.setPayPlatform(payPlatform);
|
|
if(StringUtils.isNotEmpty(payPlatform)&&payPlatform.equals("1")){
|
|
if(StringUtils.isNotEmpty(payPlatform)&&payPlatform.equals("1")){
|
|
@@ -1726,7 +1767,7 @@ public class TOrderController {
|
|
orderDetails.setAdminId(admin.getId());
|
|
orderDetails.setAdminId(admin.getId());
|
|
orderDetails.setEquipmentId(equipmentId);
|
|
orderDetails.setEquipmentId(equipmentId);
|
|
orderDetails.setCreateDate(new Date());
|
|
orderDetails.setCreateDate(new Date());
|
|
- orderDetails.setCompanyType(admin.getCompanyType());
|
|
|
|
|
|
+ orderDetails.setCompanyType(companyType);
|
|
orderDetails.setRefundStatus("0");
|
|
orderDetails.setRefundStatus("0");
|
|
orderDetails.setMachineType(equipment.getMachineType());
|
|
orderDetails.setMachineType(equipment.getMachineType());
|
|
|
|
|
|
@@ -1747,7 +1788,7 @@ public class TOrderController {
|
|
try {
|
|
try {
|
|
result = huifuMchService.uniPay(
|
|
result = huifuMchService.uniPay(
|
|
orderNo1, amount, productName1, productDesc,
|
|
orderNo1, amount, productName1, productDesc,
|
|
- notifyUrl, frpCode1, openId, appid, acctSplitBunch
|
|
|
|
|
|
+ notifyUrl, frpCode1, openId, appid, acctSplitBunch, companyType
|
|
);
|
|
);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@@ -1819,27 +1860,54 @@ public class TOrderController {
|
|
// 获取code
|
|
// 获取code
|
|
String code = request.getParameter("code");
|
|
String code = request.getParameter("code");
|
|
String id = request.getParameter("state");
|
|
String id = request.getParameter("state");
|
|
- // 获取openid
|
|
|
|
- String openUrl = "https://api.weixin.qq.com/sns/oauth2/access_token?" +
|
|
|
|
- "appid=" + HuifuConstant.WX_SUB_APP_ID +
|
|
|
|
- "&secret=" + HuifuConstant.WX_APP_SECRET +
|
|
|
|
- "&code=" + code +
|
|
|
|
- "&grant_type=authorization_code";
|
|
|
|
- org.json.JSONObject jsonObject = HttpClientUtils.get(openUrl);
|
|
|
|
- String openid = jsonObject.getString("openid");
|
|
|
|
- // 从临时表中获取订单信息
|
|
|
|
LambdaQueryWrapper<THuifuTempOrder> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<THuifuTempOrder> wrapper = new LambdaQueryWrapper<>();
|
|
wrapper.eq(THuifuTempOrder::getId,id);
|
|
wrapper.eq(THuifuTempOrder::getId,id);
|
|
THuifuTempOrder huifuTempOrder = huifuTempOrderService.getOne(wrapper);
|
|
THuifuTempOrder huifuTempOrder = huifuTempOrderService.getOne(wrapper);
|
|
|
|
+ // 从临时表中获取订单信息
|
|
String result = null;
|
|
String result = null;
|
|
- if(huifuTempOrder.getStatus() == 1) {
|
|
|
|
-// result = "http://szwltest.sunzee.com.cn/shenze/#/popPayment?status=1";
|
|
|
|
- result = HuifuConstant.JUMP_URL+"/#/popPayment?status=1";
|
|
|
|
- } else {
|
|
|
|
- try {
|
|
|
|
- result = huifuMchService.wetchatPay(huifuTempOrder,openid);
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
|
+ if(huifuTempOrder != null) {
|
|
|
|
+ String companyType = huifuTempOrder.getCompanyType();
|
|
|
|
+ if(huifuTempOrder.getStatus() == 1) {
|
|
|
|
+ if(StrUtil.isNotEmpty(companyType) && companyType.equals("1")) {
|
|
|
|
+ result = HuifuConstant.SC_JUMP_URL+"/#/popPayment?status=1";
|
|
|
|
+ } else {
|
|
|
|
+ result = HuifuConstant.SZ_JUMP_URL+"/#/popPayment?status=1";
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ String openid;
|
|
|
|
+ if(StrUtil.isNotEmpty(companyType) && companyType.equals("1")) {
|
|
|
|
+ // 获取openid
|
|
|
|
+ try {
|
|
|
|
+ String openUrl = "https://api.weixin.qq.com/sns/oauth2/access_token?" +
|
|
|
|
+ "appid=" + HuifuConstant.SC_WX_SUB_APP_ID +
|
|
|
|
+ "&secret=" + HuifuConstant.SC_WX_APP_SECRET +
|
|
|
|
+ "&code=" + code +
|
|
|
|
+ "&grant_type=authorization_code";
|
|
|
|
+ log.info("获取openID:{}", openUrl);
|
|
|
|
+ org.json.JSONObject jsonObject = HttpClientUtils.get(openUrl);
|
|
|
|
+ log.info("获取openID结果:{}", jsonObject);
|
|
|
|
+ openid = jsonObject.getString("openid");
|
|
|
|
+ result = huifuMchService.wetchatPay(huifuTempOrder,openid);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ // 获取openid
|
|
|
|
+ try {
|
|
|
|
+ String openUrl = "https://api.weixin.qq.com/sns/oauth2/access_token?" +
|
|
|
|
+ "appid=" + HuifuConstant.SZ_WX_SUB_APP_ID +
|
|
|
|
+ "&secret=" + HuifuConstant.SZ_WX_APP_SECRET +
|
|
|
|
+ "&code=" + code +
|
|
|
|
+ "&grant_type=authorization_code";
|
|
|
|
+ log.info("获取openID:{}", openUrl);
|
|
|
|
+ org.json.JSONObject jsonObject = HttpClientUtils.get(openUrl);
|
|
|
|
+ log.info("获取openID结果:{}", jsonObject);
|
|
|
|
+ openid = jsonObject.getString("openid");
|
|
|
|
+ result = huifuMchService.wetchatPay(huifuTempOrder,openid);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
log.info("支付链接:{}",result);
|
|
log.info("支付链接:{}",result);
|
|
@@ -2570,10 +2638,10 @@ public class TOrderController {
|
|
order.setRefundAmount(newRefundAmount);
|
|
order.setRefundAmount(newRefundAmount);
|
|
// 如果小于订单金额
|
|
// 如果小于订单金额
|
|
if(newRefundAmount.compareTo(order.getPrice()) < 0) {
|
|
if(newRefundAmount.compareTo(order.getPrice()) < 0) {
|
|
- acctSplitBunch = getAcctSplitBunch(proportion,order.getPrice().subtract(newRefundAmount)).toString();
|
|
|
|
|
|
+ acctSplitBunch = getAcctSplitBunch(proportion,order.getPrice().subtract(newRefundAmount), order.getCompanyType()).toString();
|
|
order.setAcctSplitBunch(acctSplitBunch);
|
|
order.setAcctSplitBunch(acctSplitBunch);
|
|
} else {
|
|
} else {
|
|
- acctSplitBunch = getAcctSplitBunch(proportion,order.getPrice()).toString();
|
|
|
|
|
|
+ acctSplitBunch = getAcctSplitBunch(proportion,order.getPrice(), order.getCompanyType()).toString();
|
|
order.setAcctSplitBunch(acctSplitBunch);
|
|
order.setAcctSplitBunch(acctSplitBunch);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -2581,7 +2649,7 @@ public class TOrderController {
|
|
if(new BigDecimal(ordAmt).setScale(2, RoundingMode.HALF_UP).compareTo(order.getPrice()) < 0) {
|
|
if(new BigDecimal(ordAmt).setScale(2, RoundingMode.HALF_UP).compareTo(order.getPrice()) < 0) {
|
|
// 重新设置分销
|
|
// 重新设置分销
|
|
acctSplitBunch = getAcctSplitBunch(proportion,order.getPrice()
|
|
acctSplitBunch = getAcctSplitBunch(proportion,order.getPrice()
|
|
- .subtract(new BigDecimal(ordAmt).setScale(2,RoundingMode.HALF_UP))).toString();
|
|
|
|
|
|
+ .subtract(new BigDecimal(ordAmt).setScale(2,RoundingMode.HALF_UP)), order.getCompanyType()).toString();
|
|
order.setAcctSplitBunch(acctSplitBunch);
|
|
order.setAcctSplitBunch(acctSplitBunch);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -3185,7 +3253,7 @@ public class TOrderController {
|
|
* @param price
|
|
* @param price
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public JSONObject getAcctSplitBunch(TProportion proportion, BigDecimal price) {
|
|
|
|
|
|
+ public JSONObject getAcctSplitBunch(TProportion proportion, BigDecimal price, String companyType) {
|
|
|
|
|
|
// 获取分账有几方:0:分账方2个,1:分账方3个,2:分账方4个,3:分账方超4个
|
|
// 获取分账有几方:0:分账方2个,1:分账方3个,2:分账方4个,3:分账方超4个
|
|
Integer type = proportion.getType();
|
|
Integer type = proportion.getType();
|
|
@@ -3232,7 +3300,12 @@ public class TOrderController {
|
|
// 公司平台分销
|
|
// 公司平台分销
|
|
adminJson = new JSONObject();
|
|
adminJson = new JSONObject();
|
|
adminJson.put("div_amt", adminAmount.toString());
|
|
adminJson.put("div_amt", adminAmount.toString());
|
|
- adminJson.put("huifu_id", HuifuConstant.DIV_HUIFU_ID);
|
|
|
|
|
|
+ // 判断为申泽还是七云
|
|
|
|
+ if(StrUtil.isNotEmpty(companyType) && companyType.equals("1")) {
|
|
|
|
+ adminJson.put("huifu_id", HuifuConstant.SC_DIV_HUIFU_ID);
|
|
|
|
+ } else {
|
|
|
|
+ adminJson.put("huifu_id", HuifuConstant.SZ_DIV_HUIFU_ID);
|
|
|
|
+ }
|
|
acctInfos.add(adminJson);
|
|
acctInfos.add(adminJson);
|
|
// 商家分销获得利润
|
|
// 商家分销获得利润
|
|
selfJson = new JSONObject();
|
|
selfJson = new JSONObject();
|
|
@@ -3258,7 +3331,12 @@ public class TOrderController {
|
|
// 公司平台分销
|
|
// 公司平台分销
|
|
adminJson = new JSONObject();
|
|
adminJson = new JSONObject();
|
|
adminJson.put("div_amt", adminAmount.toString());
|
|
adminJson.put("div_amt", adminAmount.toString());
|
|
- adminJson.put("huifu_id", HuifuConstant.DIV_HUIFU_ID);
|
|
|
|
|
|
+ // 判断为申泽还是七云
|
|
|
|
+ if(StrUtil.isNotEmpty(companyType) && companyType.equals("1")) {
|
|
|
|
+ adminJson.put("huifu_id", HuifuConstant.SC_DIV_HUIFU_ID);
|
|
|
|
+ } else {
|
|
|
|
+ adminJson.put("huifu_id", HuifuConstant.SZ_DIV_HUIFU_ID);
|
|
|
|
+ }
|
|
acctInfos.add(adminJson);
|
|
acctInfos.add(adminJson);
|
|
// 商家分销获得利润
|
|
// 商家分销获得利润
|
|
selfJson = new JSONObject();
|
|
selfJson = new JSONObject();
|
|
@@ -3294,7 +3372,12 @@ public class TOrderController {
|
|
// 公司平台分销
|
|
// 公司平台分销
|
|
adminJson = new JSONObject();
|
|
adminJson = new JSONObject();
|
|
adminJson.put("div_amt", adminAmount.toString());
|
|
adminJson.put("div_amt", adminAmount.toString());
|
|
- adminJson.put("huifu_id", HuifuConstant.DIV_HUIFU_ID);
|
|
|
|
|
|
+ // 判断为申泽还是七云
|
|
|
|
+ if(StrUtil.isNotEmpty(companyType) && companyType.equals("1")) {
|
|
|
|
+ adminJson.put("huifu_id", HuifuConstant.SC_DIV_HUIFU_ID);
|
|
|
|
+ } else {
|
|
|
|
+ adminJson.put("huifu_id", HuifuConstant.SZ_DIV_HUIFU_ID);
|
|
|
|
+ }
|
|
acctInfos.add(adminJson);
|
|
acctInfos.add(adminJson);
|
|
// 商家分销获得利润
|
|
// 商家分销获得利润
|
|
selfJson = new JSONObject();
|
|
selfJson = new JSONObject();
|
|
@@ -3332,7 +3415,7 @@ public class TOrderController {
|
|
for (int i = 0; i < acctInfos.size(); i++) {
|
|
for (int i = 0; i < acctInfos.size(); i++) {
|
|
JSONObject jsonObject = acctInfos.getJSONObject(i);
|
|
JSONObject jsonObject = acctInfos.getJSONObject(i);
|
|
String huifuId = jsonObject.getString("huifu_id");
|
|
String huifuId = jsonObject.getString("huifu_id");
|
|
- if (huifuId.equals(HuifuConstant.DIV_HUIFU_ID)) {
|
|
|
|
|
|
+ if (huifuId.equals(HuifuConstant.SZ_DIV_HUIFU_ID) || huifuId.equals(HuifuConstant.SC_DIV_HUIFU_ID)) {
|
|
BigDecimal currentDivAmt = new BigDecimal(jsonObject.getString("div_amt"));
|
|
BigDecimal currentDivAmt = new BigDecimal(jsonObject.getString("div_amt"));
|
|
BigDecimal adjustedDivAmt = currentDivAmt.subtract(diffAmount).max(BigDecimal.ZERO);
|
|
BigDecimal adjustedDivAmt = currentDivAmt.subtract(diffAmount).max(BigDecimal.ZERO);
|
|
jsonObject.put("div_amt", adjustedDivAmt.toString());
|
|
jsonObject.put("div_amt", adjustedDivAmt.toString());
|