diff --git a/wisenergy-mapper/src/main/java/cn/wisenergy/mapper/OrderMapper.java b/wisenergy-mapper/src/main/java/cn/wisenergy/mapper/OrderMapper.java
index 664a496b1402a8d0f7c971bd8a4ce78b35030972..0a4b6c1d76b14d5206542ed8fc8089cee60e5054 100644
--- a/wisenergy-mapper/src/main/java/cn/wisenergy/mapper/OrderMapper.java
+++ b/wisenergy-mapper/src/main/java/cn/wisenergy/mapper/OrderMapper.java
@@ -52,8 +52,8 @@ public interface OrderMapper extends BaseMapper<OrderInfo> {
 
     /**
      * 更据创建订单时间获取订单列表
-     * @param createTime 创建订单时间
+     * @param created 创建订单时间
      * @return 订单列表
      */
-    List<OrderInfo> getByCreateTime(@Param("createTime") Date createTime);
+    List<OrderInfo> getByCreateTime(@Param("created") Date created);
 }
diff --git a/wisenergy-mapper/src/main/java/cn/wisenergy/mapper/TeamPerformanceMapper.java b/wisenergy-mapper/src/main/java/cn/wisenergy/mapper/TeamPerformanceMapper.java
index ad8647e5e5b2b60933ec6a28c993644e4e7aa6f3..75b2daf3ed81995251fae0ce87bf5720534a9dc0 100644
--- a/wisenergy-mapper/src/main/java/cn/wisenergy/mapper/TeamPerformanceMapper.java
+++ b/wisenergy-mapper/src/main/java/cn/wisenergy/mapper/TeamPerformanceMapper.java
@@ -14,6 +14,11 @@ public interface TeamPerformanceMapper extends BaseMapper<TeamPerformance> {
 
     int add(TeamPerformance teamPerformance);
 
+    /**
+     * 编辑
+     * @param teamPerformance 团队业绩
+     * @return 1
+     */
     int edit(TeamPerformance teamPerformance);
 
     int delById(@Param("id") Integer id);
diff --git a/wisenergy-mapper/src/main/resources/mapper/MonthManureMapper.xml b/wisenergy-mapper/src/main/resources/mapper/MonthManureMapper.xml
index ca9aedf09a597209f5079ad7c7cd5ea48ac26df2..4cc7637876c1ca6593b44a9dbc0881e093b8a869 100644
--- a/wisenergy-mapper/src/main/resources/mapper/MonthManureMapper.xml
+++ b/wisenergy-mapper/src/main/resources/mapper/MonthManureMapper.xml
@@ -19,7 +19,7 @@
     </sql>
 
     <sql id="cols_exclude_id">
-        year_month,manure_award,create_time,update_time
+        `year_month`,manure_award,create_time,update_time
     </sql>
 
     <sql id="vals">
@@ -27,14 +27,14 @@
     </sql>
 
     <sql id="updateCondition">
-        <if test="yearMonth != null">year_month =#{yearMonth},</if>
+        <if test="yearMonth != null">`year_month` =#{yearMonth},</if>
         <if test="manureAward != null">manure_award = #{manureAward},</if>
         update_time =now()
     </sql>
 
     <sql id="criteria">
         <if test="id != null">id = #{id}</if>
-        <if test="yearMonth != null">and year_month =#{yearMonth}</if>
+        <if test="yearMonth != null">and `year_month` =#{yearMonth}</if>
         <if test="manureAward != null">and manure_award = #{manureAward}</if>
         <if test="createTime != null">and create_time &gt;= #{createTime}</if>
         <if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
@@ -67,7 +67,7 @@
         <include refid="table"/>
         <where>
             <if test="yearMonth != null and yearMonth != ''">
-                year_month=#{yearMonth}
+                `year_month`=#{yearMonth}
             </if>
         </where>
     </select>
diff --git a/wisenergy-mapper/src/main/resources/mapper/OrderMapper.xml b/wisenergy-mapper/src/main/resources/mapper/OrderMapper.xml
index 3e5b8b43afa3a4f4e64fa0b7d0bc2ba7ff14ce43..86a87c0665667890273b9e6ffed07c652677a39b 100644
--- a/wisenergy-mapper/src/main/resources/mapper/OrderMapper.xml
+++ b/wisenergy-mapper/src/main/resources/mapper/OrderMapper.xml
@@ -146,9 +146,9 @@
         from
         <include refid="table"/>
         <where>
-            <if test="successTime != null ">
-                YEAR(create_time) = YEAR(#{successTime})
-                AND MONTH(create_time) = MONTH(#{successTime})
+            <if test="created != null ">
+                YEAR(created) = YEAR(#{created})
+                AND MONTH(created) = MONTH(#{created})
             </if>
         </where>
     </select>
diff --git a/wisenergy-mapper/src/main/resources/mapper/TeamPerformanceMapper.xml b/wisenergy-mapper/src/main/resources/mapper/TeamPerformanceMapper.xml
index 283bffe29ce62b6025cecd26ee6a35e15987200d..f3d62dc9f8cff771429595a245bf0ae8ba147740 100644
--- a/wisenergy-mapper/src/main/resources/mapper/TeamPerformanceMapper.xml
+++ b/wisenergy-mapper/src/main/resources/mapper/TeamPerformanceMapper.xml
@@ -21,7 +21,7 @@
     </sql>
 
     <sql id="cols_exclude_id">
-        user_id,user_level,year_month,month_team_performance,create_time,update_time
+        user_id,user_level,`year_month`,month_team_performance,create_time,update_time
     </sql>
 
     <sql id="vals">
@@ -29,18 +29,18 @@
     </sql>
 
     <sql id="updateCondition">
-        <if test="userId != null">month_manure_total = #{userId},</if>
+        <if test="userId != null">user_id = #{userId},</if>
         <if test="userLevel != null">user_level = #{userLevel},</if>
-        <if test="yearMonth != null">year_month =#{yearMonth},</if>
+        <if test="yearMonth != null">`year_month` =#{yearMonth},</if>
         <if test="monthTeamPerformance != null">month_team_performance =#{monthTeamPerformance},</if>
         update_time =now()
     </sql>
 
     <sql id="criteria">
         <if test="id != null">id = #{id}</if>
-        <if test="userId != null">and month_manure_total = #{userId}</if>
+        <if test="userId != null">and user_id = #{userId}</if>
         <if test="userLevel != null">and user_level = #{userLevel}</if>
-        <if test="yearMonth != null">and year_month =#{yearMonth}</if>
+        <if test="yearMonth != null">and `year_month` =#{yearMonth}</if>
         <if test="monthTeamPerformance != null">and month_team_performance =#{monthTeamPerformance}</if>
         <if test="createTime != null">and create_time &gt;= #{createTime}</if>
         <if test="updateTime != null">and #{updateTime} &gt;= update_time</if>
@@ -82,9 +82,7 @@
                 user_id = #{userId}
             </if>
             <if test="yearMonth != null">
-                AND(
-                YEAR(year_month) = YEAR(#{yearMonth})
-                AND MONTH(year_month) = MONTH(#{yearMonth}))
+                and `year_month`=#{yearMonth}
             </if>
         </where>
     </select>
@@ -99,9 +97,7 @@
                 user_level = #{userLevel}
             </if>
             <if test="yearMonth != null">
-                AND(
-                YEAR(year_month) = YEAR(#{yearMonth})
-                AND MONTH(year_month) = MONTH(#{yearMonth}))
+                and `year_month` = #{yearMonth}
             </if>
         </where>
     </select>
@@ -113,7 +109,7 @@
         <include refid="table"/>
         <where>
             <if test="yearMonth != null">
-                year_month &lt; #{yearMonth}
+                `year_month` &lt; #{yearMonth}
             </if>
         </where>
     </select>
@@ -125,9 +121,7 @@
         <include refid="table"/>
         <where>
             <if test="yearMonth != null">
-                AND(
-                YEAR(year_month) = YEAR(#{yearMonth})
-                AND MONTH(year_month) = MONTH(#{yearMonth}))
+                `year_month` = #{yearMonth}
             </if>
         </where>
     </select>
@@ -139,9 +133,7 @@
         <include refid="table"/>
         <where>
             <if test="yearMonth != null">
-                AND(
-                YEAR(year_month) = YEAR(#{yearMonth})
-                AND MONTH(year_month) = MONTH(#{yearMonth}))
+                 `year_month` = #{yearMonth}
             </if>
             order by month_team_performance desc
             limit 20
@@ -155,9 +147,7 @@
         <include refid="table"/>
         <where>
             <if test="yearMonth != null">
-                AND(
-                YEAR(year_month) = YEAR(#{yearMonth})
-                AND MONTH(year_month) = MONTH(#{yearMonth}))
+                `year_month` = #{yearMonth}
             </if>
             order by month_team_performance desc
             limit 20
diff --git a/wisenergy-service/src/main/java/cn/wisenergy/service/Manager/AccountManager.java b/wisenergy-service/src/main/java/cn/wisenergy/service/Manager/AccountManager.java
index 41d65e1b159a87a5b8e4f5a770145bd4fa0b23e8..316f579f6bc7905ef71345ce85a0f694009f7c3e 100644
--- a/wisenergy-service/src/main/java/cn/wisenergy/service/Manager/AccountManager.java
+++ b/wisenergy-service/src/main/java/cn/wisenergy/service/Manager/AccountManager.java
@@ -96,7 +96,7 @@ public class AccountManager {
     @Transactional(rollbackFor = Exception.class)
     public void updateAccountPerformanceMonth(List<TeamPerformance> list) {
         for (TeamPerformance teamPerformance : list) {
-            teamPerformanceMapper.updateById(teamPerformance);
+            teamPerformanceMapper.edit(teamPerformance);
         }
     }
 
diff --git a/wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/AccountServiceImpl.java b/wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/AccountServiceImpl.java
index 64d202145b146d5b5f88b99c686894761b7d4606..42bff9223a0c3935183676ce02c5938365e90132 100644
--- a/wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/AccountServiceImpl.java
+++ b/wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/AccountServiceImpl.java
@@ -24,6 +24,7 @@ import org.springframework.util.CollectionUtils;
 
 import java.math.BigDecimal;
 import java.util.*;
+import java.util.stream.Collectors;
 
 
 /**
@@ -130,59 +131,70 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
 
         //计算当月所有订单成交额
         BigDecimal totalMoney = new BigDecimal(0);
+
+        //统计出出每个用户当月订单成交额 key:userId  value:用户当月订单成交额
+        Map<String, Double> map = new HashMap<>();
         for (OrderInfo orderInfo : list) {
-            //判断是否是本月
-            boolean bool = publicManager.isThisMonth(orderInfo.getCreateTime(), PATTERN);
-            if (bool && orderInfo.getMonthlyTaskStatus() == 0) {
-                totalMoney = totalMoney.add(orderInfo.getPayment());
+            String userId = orderInfo.getBuyerId();
+            double payMoney = orderInfo.getPayment().doubleValue();
+
+            //key 存在  累加订单金额 到 value
+            if (map.containsKey(userId)) {
+                double money = payMoney + map.get(orderInfo.getBuyerId());
+                map.put(orderInfo.getBuyerId(), money);
+            } else {
+                //key 不存在,加入集合
+                map.put(userId, payMoney);
             }
+
+            //累加所以订单成交额
+            totalMoney = totalMoney.add(orderInfo.getPayment());
         }
 
-        //遍历订单  订单状态创建时间,当月时间小于当前时间
-        for (OrderInfo orderInfo : list) {
-            long createTime = orderInfo.getCreated().getTime();
-            long time = System.currentTimeMillis();
-            if (createTime <= time) {
-                //获取用户信息
-                User user = usersMapper.selectById(orderInfo.getBuyerId());
-                if (null == user) {
-                    continue;
-                }
 
-                List<TeamPerformance> teamPerformances = new ArrayList<>();
+        //遍历订单
+        for (Map.Entry<String, Double> entity : map.entrySet()) {
+            List<TeamPerformance> teamPerformances = new ArrayList<>();
+            //获取用户信息
+            User user = usersMapper.getByUserId(entity.getKey());
+            if (null == user) {
+                continue;
+            }
 
-                //获取团队业绩信息
-                TeamPerformance teamPerformance = teamPerformanceMapper.getByUserIdAndTime(user.getUserId(), yearMonth);
-                if (null == teamPerformance) {
-                    continue;
-                }
+            //获取团队业绩信息
+            TeamPerformance teamPerformance = teamPerformanceMapper.getByUserIdAndTime(user.getUserId(), yearMonth);
+            if (null == teamPerformance) {
+                continue;
+            }
 
-                //1、统计当前用户月度业绩
-                BigDecimal userCount = teamPerformance.getMonthTeamPerformance().add(orderInfo.getPayment());
-                teamPerformance.setMonthTeamPerformance(userCount);
-                teamPerformances.add(teamPerformance);
+            //1、统计当前用户月度业绩
+            BigDecimal userCount = BigDecimal.valueOf(entity.getValue());
+            teamPerformance.setMonthTeamPerformance(userCount);
+            teamPerformances.add(teamPerformance);
 
-                //2、获取当前用户的上级用户列表 todo 邀请码等于一个固定值,停止 等于两个值  七位XXXXXXX 和 7777777
-                List<User> userList = getByList(user.getUserId());
-                if (CollectionUtils.isEmpty(userList)) {
-                    continue;
-                }
+            //2、获取当前用户的上级用户列表 todo 邀请码等于一个固定值,停止 等于两个值  七位XXXXXXX 和 7777777
+            List<User> userList = getByList(user.getUserId());
+            if (CollectionUtils.isEmpty(userList)) {
+                //更新当前用户月度业绩
+                accountManager.updateAccountPerformanceMonth(teamPerformances);
+                continue;
+            }
 
-                for (User userInfo : userList) {
-                    //3、统计当前用户上级月度绩效
-                    TeamPerformance team = teamPerformanceMapper.getByUserIdAndTime(userInfo.getUserId(), yearMonth);
-                    if (null == team) {
-                        continue;
-                    }
-                    //1、统计当前用户月度绩效
-                    BigDecimal monthCount = team.getMonthTeamPerformance().add(orderInfo.getPayment());
-                    team.setMonthTeamPerformance(monthCount);
-                    teamPerformances.add(team);
+            for (User userInfo : userList) {
+                //3、统计当前用户上级月度绩效
+                TeamPerformance team = teamPerformanceMapper.getByUserIdAndTime(userInfo.getUserId(), yearMonth);
+                if (null == team) {
+                    continue;
                 }
-
-                //4、更新账户月度绩效
-                accountManager.updateAccountPerformanceMonth(teamPerformances);
+                //1、统计当前用户月度绩效
+                BigDecimal monthCount = team.getMonthTeamPerformance().add(userCount);
+                log.info("当前用户月度绩效:" + monthCount);
+                team.setMonthTeamPerformance(monthCount);
+                teamPerformances.add(team);
             }
+
+            //4、更新账户月度绩效
+            accountManager.updateAccountPerformanceMonth(teamPerformances);
         }
         //5、获取所有用户,如果会员等级是黄金以上,计算月度收益
         List<User> userList = usersMapper.getAllGoldUser();
@@ -207,9 +219,10 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
     @Override
     public List<User> getByList(String userId) {
         List<User> list = new ArrayList<>();
-
+        User user = usersMapper.getByUserId(userId);
         getUser(list, userId);
-
+        //去除本身
+        list.remove(user);
         return list;
     }
 
@@ -303,9 +316,11 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
     public void getUser(List<User> list, String userId) {
         User user = usersMapper.getByUserId(userId);
         list.add(user);
-        if (null != user && StringUtils.isBlank(user.getBeInvitedCode())) {
+        if (null != user && !StringUtils.isBlank(user.getBeInvitedCode())) {
             User userInfo = usersMapper.getByBeInvitedCode(user.getBeInvitedCode());
-            getUser(list, userInfo.getUserId());
+            if (null != userInfo) {
+                getUser(list, userInfo.getUserId());
+            }
         }
     }
 
diff --git a/wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/OrderServiceImpl.java b/wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/OrderServiceImpl.java
index fab30441e538ddda2afd3fbe9598c6b991a0b632..cd0a96d0a4d2e9d4777e2e01c7082ee9c84f8e0b 100644
--- a/wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/OrderServiceImpl.java
+++ b/wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/OrderServiceImpl.java
@@ -45,7 +45,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderInfo> implem
     Date endCreatedDate = null;
     Date startUpdateDate = null;
     Date endUpdateDate = null;
-    Date date = new Date();
+//    Date date = new Date();
 
     /**
      * 根据订单的创建时间获取有赞的订单数据 插入本地数据库
@@ -56,6 +56,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderInfo> implem
     @XxlJob(value = "YouZanOrdersjobhandler")
     @Override
     public void getYouZanOrdersForCreateTime() throws SDKException {
+        Date date = new Date();
         Token token = youzanToken();
         YouzanTradesSoldGet youzanTradesSoldGet = new YouzanTradesSoldGet();
         //创建参数对象,并设置参数
@@ -68,6 +69,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderInfo> implem
             startCreatedDate = sdf.parse(sdf.format(new Date(date.getTime()-(long) 5*60*1000)));
             log.info("订单创建开始时间"+sdf.format(startCreatedDate));
             endCreatedDate = sdf.parse(sdf.format(date));
+
             String format = sdf.format(date);
             log.info("订单创建结束时间"+sdf.format(endCreatedDate));
         } catch (ParseException e) {
@@ -140,6 +142,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderInfo> implem
     @XxlJob(value = "YouZanOrdersForUpdateTimejobhandler")
     @Override
     public void getYouZanOrdersForUpdateTime() throws SDKException {
+        Date date = new Date();
         Token token = youzanToken();
         YouzanTradesSoldGet youzanTradesSoldGet = new YouzanTradesSoldGet();
         //创建参数对象,并设置参数
@@ -148,7 +151,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderInfo> implem
         try {
 //            startUpdateDate = sdf.parse("2021-02-28 11:04:01");
 //            endUpdateDate = sdf.parse("2021-03-2 16:39:59");
-            startUpdateDate = sdf.parse(sdf.format(new Date(date.getTime()-(long) 60*1000)));
+            startUpdateDate = sdf.parse(sdf.format(new Date(date.getTime()-(long) 5*60*1000)));
             log.info("订单修改开始时间"+sdf.format(startUpdateDate));
             endUpdateDate = sdf.parse(sdf.format(date));
             log.info("订单修改结束时间"+sdf.format(endUpdateDate));
diff --git a/wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/AccountController.java b/wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/AccountController.java
index e71f2cc32f0a1a1290194a80b2f2bd4fdd653a73..fcbba0349c3f35cf4a8f4fb947bcb55399d3bb3f 100644
--- a/wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/AccountController.java
+++ b/wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/AccountController.java
@@ -30,20 +30,34 @@ public class AccountController extends BaseController {
     @ApiOperation(value = "获取账户信息", notes = "获取账户信息", httpMethod = "GET")
     @ApiImplicitParam(name = "userId", value = "用户id", dataType = "String")
     @GetMapping("/getByUserId")
-    public R<AccountInfo> getByUserId(String userId){
+    public R<AccountInfo> getByUserId(String userId) {
         return accountService.getByUserId(userId);
     }
 
     @ApiOperation(value = "获取账户列表信息", notes = "获取账户列表信息", httpMethod = "GET")
     @ApiImplicitParam(name = "userId", value = "用户id", dataType = "String")
     @GetMapping("/getByList")
-    public List<User> getByList(String userId){
+    public List<User> getByList(String userId) {
         return accountService.getByList(userId);
     }
 
     @ApiOperation(value = "订单佣金", notes = "订单佣金", httpMethod = "GET")
     @GetMapping("/orderRebate")
-    public R<Boolean> orderRebate(){
+    public R<Boolean> orderRebate() {
         return accountService.orderRebate();
     }
+
+
+    @ApiOperation(value = "月度肥料", notes = "月度肥料", httpMethod = "GET")
+    @GetMapping("/monthManure")
+    public R<Boolean> monthManure() {
+        return accountService.performanceCount();
+    }
+
+    @ApiOperation(value = "最大进步奖", notes = "最大进步奖", httpMethod = "GET")
+    @GetMapping("/growAward")
+    public R<Boolean> growAward() {
+        return accountService.progressPrizeCount();
+    }
+
 }