Selaa lähdekoodia

权益管理变化

lyhzzz 2 vuotta sitten
vanhempi
commit
6a8b3e2fcc

+ 3 - 3
src/main/java/com/fdkankan/agent/service/impl/AgentNewServiceImpl.java

@@ -69,17 +69,17 @@ public class AgentNewServiceImpl extends ServiceImpl<IAgentNewMapper, AgentNew>
         wrapper.eq(AgentNew::getId,agentNewVo.getId());
         if(incrementType != null && incrementType.getValidTimeType() == 0){
             agentNewLog.setType(0);
-            wrapper.set(AgentNew::getMajorUseNum,agentNewVo.getMajorUseNum() + count);
+            wrapper.set(AgentNew::getMajorUseNum,agentNewVo.getMajorUseNum() + count * totalTime);
         }
 
         if(incrementType != null && incrementType.getValidTimeType() == 1){
             agentNewLog.setType(1);
-            wrapper.set(AgentNew::getHighUseNum,agentNewVo.getHighUseNum() + count);
+            wrapper.set(AgentNew::getHighUseNum,agentNewVo.getHighUseNum() + count * totalTime);
         }
 
         if(incrementType == null){
             agentNewLog.setType(2);
-            wrapper.set(AgentNew::getDownUseNum,agentNewVo.getDownUseNum() + count);
+            wrapper.set(AgentNew::getDownUseNum,agentNewVo.getDownUseNum() + count * totalTime);
         }
 
         this.update(wrapper);

+ 4 - 4
src/main/java/com/fdkankan/agent/service/impl/UserIncrementServiceImpl.java

@@ -81,12 +81,12 @@ public class UserIncrementServiceImpl extends ServiceImpl<IUserIncrementMapper,
             throw new BusinessException(ResultCode.INCREMENT_TYPE_EMPTY);
         }
         if (incrementType.getValidTimeType() == 0) {
-            if(agentNewVo.getMajorSubNum() <=0){
+            if(agentNewVo.getMajorSubNum() < param.getCount() * param.getTotalTime()){
                 throw new BusinessException(ResultCode.INCREMENT_NUM_EMPTY);
             }
         }
         if (incrementType.getValidTimeType() == 1) {
-            if(agentNewVo.getHighSubNum() <=0){
+            if(agentNewVo.getHighSubNum() < param.getCount() * param.getTotalTime()){
                 throw new BusinessException(ResultCode.INCREMENT_NUM_EMPTY);
             }
         }
@@ -143,12 +143,12 @@ public class UserIncrementServiceImpl extends ServiceImpl<IUserIncrementMapper,
             throw new BusinessException(ResultCode.INCREMENT_TYPE_EMPTY);
         }
         if (incrementType.getValidTimeType() == 0) {
-            if(agentNewVo.getMajorSubNum() <=0){
+            if(agentNewVo.getMajorSubNum() < param.getTotalTime()){
                 throw new BusinessException(ResultCode.INCREMENT_NUM_EMPTY);
             }
         }
         if (incrementType.getValidTimeType() == 1) {
-            if(agentNewVo.getHighSubNum() <=0){
+            if(agentNewVo.getHighSubNum() < param.getTotalTime()){
                 throw new BusinessException(ResultCode.INCREMENT_NUM_EMPTY);
             }
         }