zhangxin 3 долоо хоног өмнө
parent
commit
a4a9526360

+ 29 - 10
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/OrderServiceImpl.java

@@ -1626,6 +1626,19 @@ public class OrderServiceImpl implements IOrderService {
                     log.error("微信支付成功通知成功,未查询到分账信息,不进行分账");
                     return stringStringMap;
                 }
+                BigDecimal shBigDecimal =BigDecimal.ZERO;
+                try {
+                    shBigDecimal = getBigDecimal(priceSum, separateAccounts.getShSeparateAccounts());
+                } catch (Exception e) {
+                    log.error("百分比计算错误", e);
+                }
+                BigDecimal ptBigDecimal =BigDecimal.ZERO;
+                try {
+                    ptBigDecimal = getBigDecimal(priceSum, separateAccounts.getPtSeparateAccounts());
+                } catch (Exception e) {
+                    log.error("百分比计算错误", e);
+                }
+                BigDecimal mdBigDecimal = priceSum.subtract(shBigDecimal).subtract(ptBigDecimal).setScale(2, RoundingMode.HALF_UP);
 
                 log.info("支付成功消息通知,门店添加明细:"+JSONObject.toJSONString(receiptPaymentDetailsInfoVoMd));
                 iReceiptPaymentDetailsInfoService.add(receiptPaymentDetailsInfoVoMd);
@@ -1635,23 +1648,29 @@ public class OrderServiceImpl implements IOrderService {
         return stringStringMap;
     }
 
-    private void  getReceiptPaymentDetailsInfoVo(ReceiptPaymentDetailsInfoVo receiptPaymentDetailsInfoVo,BigDecimal proportion,String orgCode,String deptId,Integer deptType,BigDecimal priceSum){
-        receiptPaymentDetailsInfoVo.setOrgCode(orgCode);
+
+
+    private void  getChangeMoney(ReceiptPaymentDetailsInfoVo receiptPaymentDetailsInfoVo,String orgCode,String deptId,Integer deptType,BigDecimal changeMoney){
         receiptPaymentDetailsInfoVo.setDeptId(deptId);
         receiptPaymentDetailsInfoVo.setDeptType(deptType);
+        receiptPaymentDetailsInfoVo.setOrgCode(orgCode);
+        receiptPaymentDetailsInfoVo.setChangeMoney(changeMoney);
+    }
+    private BigDecimal getBigDecimal(BigDecimal priceSum,BigDecimal proportion){
         if (proportion==null){
-        receiptPaymentDetailsInfoVo.setChangeMoney(BigDecimal.ZERO);
-        }else{
-            if (proportion.compareTo(BigDecimal.ZERO)==0){
-                receiptPaymentDetailsInfoVo.setChangeMoney(BigDecimal.ZERO);
-            }else {
-
-//                receiptPaymentDetailsInfoVo.setChangeMoney();
+            return BigDecimal.ZERO;
+        }else {
+            if (proportion.compareTo(BigDecimal.ZERO) == 0) {
+                return BigDecimal.ZERO;
+            } else {   // 将百分比转换为小数(例如:50% -> 0.5)
+                BigDecimal divisor = proportion.divide(BigDecimal.valueOf(100), 4, RoundingMode.HALF_UP);
+                // 执行除法运算,设置精度和舍入模式
+                return priceSum.divide(divisor, 2, RoundingMode.HALF_UP);
             }
         }
-
     }
 
+
     /**
      * @return String 订单号
      * @Author SheepHy

+ 1 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppInstructorMapper.xml

@@ -149,6 +149,7 @@
             a.certificate_innocence,
             a.healthy,
             a.honor,
+            a.avatar,
             b.background_img,
             (SELECT GROUP_CONCAT(DISTINCT c.dep_id ORDER BY c.dep_id SEPARATOR ',')
              FROM sys_user_depart c

+ 4 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/vo/staff/StaffVO.java

@@ -93,4 +93,8 @@ public class StaffVO {
     @Excel(name = "荣誉证书多个逗号分隔", width = 15)
     @Schema(description = "荣誉证书多个逗号分隔")
     private String honorList;
+
+    @Excel(name = "头像", width = 15)
+    @Schema(description = "头像")
+    private String  avatar;
 }