|
@@ -1,9 +1,13 @@
|
|
|
package com.fdkankan.ucenter.service.impl;
|
|
|
|
|
|
import com.fdkankan.ucenter.entity.AgentNewLog;
|
|
|
+import com.fdkankan.ucenter.entity.IncrementType;
|
|
|
+import com.fdkankan.ucenter.entity.UserIncrement;
|
|
|
import com.fdkankan.ucenter.mapper.IAgentNewLogMapper;
|
|
|
import com.fdkankan.ucenter.service.IAgentNewLogService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.fdkankan.ucenter.service.IIncrementTypeService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
/**
|
|
@@ -17,4 +21,24 @@ import org.springframework.stereotype.Service;
|
|
|
@Service
|
|
|
public class AgentNewLogServiceImpl extends ServiceImpl<IAgentNewLogMapper, AgentNewLog> implements IAgentNewLogService {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ IIncrementTypeService incrementTypeService;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void addByUserIncrement(UserIncrement userIncrement) {
|
|
|
+ if(userIncrement.getAgentId() !=null){
|
|
|
+ AgentNewLog log = new AgentNewLog();
|
|
|
+ if(userIncrement.getIncrementTypeId() != null){
|
|
|
+ IncrementType incrementType = incrementTypeService.getById(userIncrement.getIncrementTypeId());
|
|
|
+ if(incrementType!=null){
|
|
|
+ log.setType(incrementType.getValidTimeType());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ log.setAgentId(userIncrement.getAgentId());
|
|
|
+ log.setUserId(userIncrement.getUserId());
|
|
|
+ log.setGiveType(2);
|
|
|
+ log.setCount(1);
|
|
|
+ this.save(log);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|