升级创客
This commit is contained in:
@@ -1746,4 +1746,15 @@ public class UserAppController {
|
|||||||
UserApp info = userAppService.getUserAppByPhone(phone, userApp);
|
UserApp info = userAppService.getUserAppByPhone(phone, userApp);
|
||||||
return ResultGenerator.genSuccessResult("操作成功", info);
|
return ResultGenerator.genSuccessResult("操作成功", info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "applyMarker")
|
||||||
|
public Result<Object> applyMarker(){
|
||||||
|
UserApp userApp = userAppService.checkApiToken();
|
||||||
|
userAppService.applyMarker(userApp);
|
||||||
|
return ResultGenerator.genSuccessResult("申请成功");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package cn.pluss.platform.mapper;
|
||||||
|
|
||||||
|
import cn.pluss.platform.entity.UserMarker;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface UserMarkerMapper extends BaseMapper<UserMarker> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package cn.pluss.platform.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class UserMarker implements Serializable {
|
||||||
|
|
||||||
|
@TableField("user_id")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@TableField("name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@TableField("phone")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@TableField("status")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@TableField("remark")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@TableField("create_time")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@TableField("update_time")
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
||||||
@@ -179,7 +179,7 @@ public class MerchantProfitServiceImpl extends ServiceImpl<MerchantProfitMapper,
|
|||||||
nowRate = new BigDecimal(userPromotion.getCurrentFee());
|
nowRate = new BigDecimal(userPromotion.getCurrentFee());
|
||||||
}
|
}
|
||||||
|
|
||||||
if("0".equals(userPromotion.getIsExtend())||"3".equals(userPromotion.getIsExtend())){
|
if(!"1".equals(userPromotion.getIsExtend())||!"2".equals(userPromotion.getIsExtend())){
|
||||||
createUserV3Profit(order,userPromotion.getParentUserId(),profits,nowRate);
|
createUserV3Profit(order,userPromotion.getParentUserId(),profits,nowRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -398,5 +398,9 @@ public interface UserAppService extends IService<UserApp> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
UserApp getUserAppByPhone(String phone, UserApp userApp);
|
UserApp getUserAppByPhone(String phone, UserApp userApp);
|
||||||
|
|
||||||
|
|
||||||
|
void applyMarker(UserApp userApp);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package cn.pluss.platform.userApp.impl;
|
package cn.pluss.platform.userApp.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.pluss.platform.IdCardService;
|
import cn.pluss.platform.IdCardService;
|
||||||
import cn.pluss.platform.ali.AliService;
|
import cn.pluss.platform.ali.AliService;
|
||||||
import cn.pluss.platform.api.PageInfo;
|
import cn.pluss.platform.api.PageInfo;
|
||||||
@@ -1911,4 +1912,43 @@ public class UserAppServiceImpl extends ServiceImpl<UserAppMapper, UserApp> impl
|
|||||||
MsgException.check(userApp.getUserId().equals(app.getUserId()), "无法选择自己");
|
MsgException.check(userApp.getUserId().equals(app.getUserId()), "无法选择自己");
|
||||||
return app;
|
return app;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
@Lazy
|
||||||
|
UserMarkerMapper userMarkerMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
@Lazy
|
||||||
|
UserPromotionMapper userPromotionMapper;
|
||||||
|
@Override
|
||||||
|
public void applyMarker(UserApp userApp) {
|
||||||
|
|
||||||
|
UserMarker marker= userMarkerMapper.selectById(userApp.getUserId());
|
||||||
|
if(ObjectUtil.isNotEmpty(marker)){
|
||||||
|
if(marker.getStatus().equals("2")){
|
||||||
|
marker.setStatus("0");
|
||||||
|
}else {
|
||||||
|
MsgException.checkNull(null,"等待审核完成之后再申请");
|
||||||
|
}
|
||||||
|
|
||||||
|
}else {
|
||||||
|
marker=new UserMarker();
|
||||||
|
marker.setName(userApp.getUserName());
|
||||||
|
marker.setPhone(userApp.getPhone());
|
||||||
|
marker.setUserId(userApp.getUserId().intValue());
|
||||||
|
marker.setStatus("0");
|
||||||
|
marker.setCreateTime(new Date());
|
||||||
|
userMarkerMapper.insert(marker);
|
||||||
|
}
|
||||||
|
|
||||||
|
UserPromotion userPromotion= userPromotionMapper.selectById(userApp.getUserId());
|
||||||
|
if(ObjectUtil.isEmpty(userPromotion)){
|
||||||
|
MsgException.checkNull(null,"用户信息错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
userPromotion.setIsExtend("3");
|
||||||
|
userPromotion.setUpdateTime(new Date());
|
||||||
|
userPromotionMapper.updateById(userPromotion);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user