mitao
2025-01-17 afa0dbb4f54e7244835dd67ec33c3e545f122f71
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/util/QiYeUtils.java
@@ -3,7 +3,6 @@
import org.apache.http.HttpResponse;
import org.apache.http.util.EntityUtils;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
@@ -18,30 +17,7 @@
    private final static String ACCESS_TOKEN_HOST = "https://qyapi.weixin.qq.com/cgi-bin/";
    public static void main(String[] args) throws Exception {
        Integer manTotal = 0;
        Integer womenTotal = 0;
        Integer personTotal = manTotal + womenTotal;
        BigDecimal manTotalBig = new BigDecimal(manTotal);
        BigDecimal personTotalBig = new BigDecimal(personTotal);
        BigDecimal bigTen = new BigDecimal("100.00");
        BigDecimal menPercent = new BigDecimal("100.00");
        BigDecimal womenPercent = new BigDecimal("100.00");
        if(manTotal==0&&womenTotal==0){
            menPercent = new BigDecimal("50.00");
            womenPercent = new BigDecimal("50.00");
        }else if(manTotal==0&&womenTotal>0){
            menPercent = new BigDecimal("0.00");
            womenPercent = new BigDecimal("100.00");
        }else if(manTotal>0&&womenTotal==0){
            menPercent = new BigDecimal("100.00");
            womenPercent = new BigDecimal("0.00");
        }else{
            menPercent = manTotalBig.divide(personTotalBig,2,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
            womenPercent = bigTen.subtract(menPercent);
        }
        System.out.println(menPercent+"-"+womenPercent);
    }
    public static String getAccessTokenByQY() throws Exception {
        String host = ACCESS_TOKEN_HOST + "gettoken?corpid=ww11400938eb1b91bc&corpsecret=-wuQ2EBxNT9BJa40LdpFqyxI_8RqrZTCUNiabzBasi8";