经纪人

This commit is contained in:
曹磊 2024-08-26 15:01:23 +08:00
parent 88257c5bd8
commit 2ea7a15862
8 changed files with 70 additions and 6 deletions

View File

@ -258,4 +258,8 @@ public class UserEntity implements Serializable {
private String blFxyCode;
private Integer blIsYwy;
private String blYwyCode;
}

View File

@ -53,6 +53,13 @@ public class YwyApplyController {
return Result.success();
}
@PostMapping("/updateRate")
@ApiOperation("修改提成比例")
public Result updateRate(YwyApply ywyApply){
service.updateRate(ywyApply);
return Result.success();
}
@GetMapping("/findUserPage")
@ApiOperation("查询(分页)")
public Result findUserPage(YwyApply ywyApply){

View File

@ -13,5 +13,6 @@ public interface YwyApplyDao extends BaseMapper<YwyApply> {
int add(YwyApply ywyApply);
int update(YwyApply ywyApply);
int approve(YwyApply ywyApply);
int updateRate(YwyApply ywyApply);
IPage<YwyApply> findUserPage(Page<YwyApply> page, @Param("params") YwyApply ywyApply);
}

View File

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @description bl_ywy_apply
@ -76,6 +77,14 @@ public class YwyApply implements Serializable {
*审批人
*/
private Long approveUser;
/**
*比例
*/
private BigDecimal rate;
/**
*代理商
*/
private String agentName;
/**
*开始时间
*/

View File

@ -9,5 +9,6 @@ public interface YwyApplyService extends IService<YwyApply> {
int add(YwyApply ywyApply);
int update(YwyApply ywyApply);
int approve(YwyApply ywyApply);
int updateRate(YwyApply ywyApply);
Result findUserPage(YwyApply ywyApply);
}

View File

@ -1,22 +1,34 @@
package com.sqx.modules.bl.commission.ywy.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sqx.common.utils.PageUtils;
import com.sqx.common.utils.Result;
import com.sqx.modules.app.entity.UserEntity;
import com.sqx.modules.app.service.UserService;
import com.sqx.modules.bl.commission.ywy.dao.YwyApplyDao;
import com.sqx.modules.bl.commission.ywy.entity.YwyApply;
import com.sqx.modules.bl.commission.ywy.entity.YwyConfig;
import com.sqx.modules.bl.commission.ywy.service.YwyApplyService;
import com.sqx.modules.bl.commission.ywy.service.YwyConfigService;
import com.sqx.modules.sys.entity.SysUserEntity;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
@Service
public class YwyApplyServiceImpl extends ServiceImpl<YwyApplyDao, YwyApply> implements YwyApplyService {
@Autowired
YwyConfigService ywyConfigService;
@Autowired
private UserService userService;
@Override
public Result findPage(YwyApply ywyApply){
Page<YwyApply> pages=new Page<>(ywyApply.getPage(),ywyApply.getLimit());
@ -41,9 +53,24 @@ public class YwyApplyServiceImpl extends ServiceImpl<YwyApplyDao, YwyApply> impl
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
ywyApply.setApproveTime(sdf.format(new Date()));
ywyApply.setApproveUser(((SysUserEntity) SecurityUtils.getSubject().getPrincipal()).getUserId());
UserEntity userEntity = userService.selectUserById(ywyApply.getUserId());
if(ywyApply.getStatus().equals(1)){
YwyConfig ywyConfig = ywyConfigService.getOne(new QueryWrapper<YwyConfig>());
ywyApply.setRate(ywyConfig.getSalesmanRate());
userEntity.setBlIsYwy(1);
}else{
ywyApply.setRate(BigDecimal.ZERO);
userEntity.setBlIsYwy(0);
}
userService.updateById(userEntity);
return baseMapper.approve(ywyApply);
}
@Override
public int updateRate(YwyApply ywyApply){
return baseMapper.updateRate(ywyApply);
}
@Override
public Result findUserPage(YwyApply ywyApply){
Page<YwyApply> pages=new Page<>(ywyApply.getUserPage(),ywyApply.getUserLimit());

View File

@ -121,16 +121,23 @@ public class TravelConfServiceImpl extends ServiceImpl<TravelConfDao, TravelConf
}else{
//双方混合判断
boolean isSeasonsType = CommonConfigUtil.calcIsDateSlotCentre(businessTime, daylightSavingTimeValues[0],daylightSavingTimeValues[1]);
boolean isWinterTimeType = CommonConfigUtil.calcIsDateSlotCentre(businessTime, winterTimeValues[0],winterTimeValues[1]);
// boolean isWinterTimeType = CommonConfigUtil.calcIsDateSlotCentre(businessTime, winterTimeValues[0],winterTimeValues[1]);
// if(isSeasonsType) {
// //夏令时
// seasonsType = TravelEnum.SeasonsType.DAYLIGHT_SAVING_TIME.getValue();
// }else if(isWinterTimeType) {
// //冬令时
// seasonsType = TravelEnum.SeasonsType.WINTER_TIME.getValue();
// } else {
// throw new SqxException("无法找到行配置,请联系管理员!");
// }
if(isSeasonsType) {
//夏令时
seasonsType = TravelEnum.SeasonsType.DAYLIGHT_SAVING_TIME.getValue();
}else if(isWinterTimeType) {
} else {
//冬令时
seasonsType = TravelEnum.SeasonsType.WINTER_TIME.getValue();
} else {
throw new SqxException("无法找到行配置,请联系管理员!");
}
}

View File

@ -4,9 +4,10 @@
<mapper namespace="com.sqx.modules.bl.commission.ywy.dao.YwyApplyDao">
<select id="findPage" resultType="com.sqx.modules.bl.commission.ywy.entity.YwyApply">
select a.id,a.user_id,b.avatar,b.user_name,a.name,a.phone,a.remarks,a.create_time,a.status,a.opinion
select a.id,a.user_id,b.avatar,b.user_name,a.name,a.phone,a.remarks,a.create_time,a.status,a.opinion,a.rate,agent.user_name as agentName
from bl_ywy_apply a
inner join tb_user b on a.user_id = b.user_id
left join tb_user agent on b.bl_dls_code = agent.invitation_code
where 1=1
<if test="params.status!=null">
and a.status=#{params.status}
@ -46,7 +47,14 @@
set status=#{status},
opinion=#{opinion},
approve_time=#{approveTime},
approve_user=#{approveUser}
approve_user=#{approveUser},
rate=#{rate}
where id=#{id}
</update>
<update id="updateRate" parameterType="com.sqx.modules.bl.commission.ywy.entity.YwyApply">
update bl_ywy_apply
set rate=#{rate}
where id=#{id}
</update>