|
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.fdkankan.agent.common.PageInfo;
|
|
|
import com.fdkankan.agent.common.ResultCode;
|
|
|
+import com.fdkankan.agent.common.util.IncrementUtil;
|
|
|
import com.fdkankan.agent.entity.IncrementType;
|
|
|
import com.fdkankan.agent.entity.User;
|
|
|
import com.fdkankan.agent.entity.UserIncrement;
|
|
@@ -20,6 +21,7 @@ import com.fdkankan.agent.service.IUserService;
|
|
|
import com.fdkankan.common.util.DateUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
@@ -62,11 +64,8 @@ public class UserIncrementServiceImpl extends ServiceImpl<IUserIncrementMapper,
|
|
|
Page<UserIncrementVo> page = this.getBaseMapper().pageList(new Page<>(param.getPageNum(), param.getPageSize()), param);
|
|
|
|
|
|
for (UserIncrementVo vo :page.getRecords() ) {
|
|
|
- switch (vo.getValidTimeType()){
|
|
|
- case 0 : vo.setIncrementTypeName(vo.getIncrementTypeName() +"(年)"); break;
|
|
|
- case 1 : vo.setIncrementTypeName(vo.getIncrementTypeName() +"(月)"); break;
|
|
|
- default: vo.setIncrementTypeName(vo.getIncrementTypeName() +"(日)"); break;
|
|
|
- }
|
|
|
+ String fmName = IncrementUtil.getStrIncrementName(vo.getValidTimeType(), vo.getIncrementTypeName());
|
|
|
+ vo.setIncrementTypeName(fmName);
|
|
|
}
|
|
|
return PageInfo.PageInfo(page);
|
|
|
}
|
|
@@ -124,7 +123,7 @@ public class UserIncrementServiceImpl extends ServiceImpl<IUserIncrementMapper,
|
|
|
this.saveBatch(userIncrementList);
|
|
|
user.setDownloadNumTotal(user.getDownloadNumTotal() + param.getCount() * incrementType.getDownloadNum());
|
|
|
userService.updateById(user);
|
|
|
- agentNewService.subNum(agentNewVo,user.getId(),incrementType,param.getCount(),0);
|
|
|
+ agentNewService.subNum(agentNewVo,user.getId(),incrementType,param.getCount(),param.getTotalTime(),0);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -162,7 +161,7 @@ public class UserIncrementServiceImpl extends ServiceImpl<IUserIncrementMapper,
|
|
|
|
|
|
user.setDownloadNumTotal(user.getDownloadNumTotal() + incrementType.getDownloadNum());
|
|
|
userService.updateById(user);
|
|
|
- agentNewService.subNum(agentNewVo,user.getId(),incrementType,1,1);
|
|
|
+ agentNewService.subNum(agentNewVo,user.getId(),incrementType,1,param.getTotalTime(),1);
|
|
|
|
|
|
}
|
|
|
}
|