0528
This commit is contained in:
parent
3a5a8dba58
commit
d5053744ee
@ -270,4 +270,15 @@ public class DlDriveSchoolCoachController {
|
||||
ExcelUtils.write(response, "员工数据.xls", "数据", SchoolStaffImportExcelVO.class,
|
||||
list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务经理招生信息
|
||||
*/
|
||||
@GetMapping("/getBusinessManager")
|
||||
public CommonResult<IPage<BusinessRecordVO>> getBusinessManager(BusinessRecordVO businessRecordVO,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<BusinessRecordVO> page = new Page<>(pageNo, pageSize);
|
||||
return success(dlDriveSchoolCoachService.getBusinessManager(businessRecordVO, page));
|
||||
}
|
||||
}
|
||||
|
@ -256,4 +256,13 @@ public class DlDriveSchoolStudentController {
|
||||
list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改学员来源
|
||||
*/
|
||||
@PostMapping("/updateChannel")
|
||||
public CommonResult<?> updateChannel(@RequestBody DlDriveSchoolStudent student) {
|
||||
return success(schoolStudentService.updateChannel(student));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -101,15 +101,6 @@ public class DlDriveSchoolCoach extends TenantBaseDO {
|
||||
*/
|
||||
private Long folderId;
|
||||
|
||||
/**
|
||||
* 提成
|
||||
*/
|
||||
private Decimal commission;
|
||||
|
||||
/**
|
||||
* 银行卡号
|
||||
*/
|
||||
private String bankCardId;
|
||||
|
||||
|
||||
}
|
||||
|
@ -49,13 +49,17 @@ public class DlDriveSchoolStudent extends TenantBaseDO {
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 来源(01驾校统招,02教练自招,03自来客户)
|
||||
* 渠道(来源)(01驾校统招,02教练自招,03自来客户,04业务经理统招)
|
||||
*/
|
||||
private String source;
|
||||
/**
|
||||
* 来源id
|
||||
* 渠道id(来源id)
|
||||
*/
|
||||
private Long sourceUserId;
|
||||
/**
|
||||
* 来源(手动填写)
|
||||
*/
|
||||
private String channel;
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
|
@ -50,4 +50,6 @@ public interface DlDriveSchoolCoachMapper extends BaseMapper<DlDriveSchoolCoach>
|
||||
CoachStaffSaveVo getOnInternal(Long id);
|
||||
|
||||
List<SchoolStaffImportExcelVO> getAll(@Param("entity") SchoolStaffImportExcelVO query);
|
||||
|
||||
IPage<BusinessRecordVO> getBusinessManager(@Param("entity") BusinessRecordVO businessRecordVO, Page<BusinessRecordVO> page);
|
||||
}
|
||||
|
@ -152,5 +152,7 @@ public interface DlDriveSchoolCoachService extends IService<DlDriveSchoolCoach>
|
||||
*/
|
||||
List<SchoolStaffImportExcelVO> getAll(SchoolStaffImportExcelVO query);
|
||||
|
||||
IPage<BusinessRecordVO> getBusinessManager(BusinessRecordVO businessRecordVO, Page<BusinessRecordVO> page);
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.base.service;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.base.entity.DlDriveSchoolStudent;
|
||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStaffVO;
|
||||
import cn.iocoder.yudao.module.base.vo.DlDriveSchoolStudentVO;
|
||||
@ -10,11 +11,15 @@ import cn.iocoder.yudao.module.inspection.vo.InspectionStaffExportVo;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 驾校学员 Service 接口
|
||||
*
|
||||
@ -182,4 +187,9 @@ public interface DlDriveSchoolStudentService extends IService<DlDriveSchoolStude
|
||||
* @return
|
||||
*/
|
||||
List<DriveSchoolStudentExportVo> getAll(DlDriveSchoolStudent query);
|
||||
|
||||
/**
|
||||
* 修改学员来源
|
||||
*/
|
||||
public boolean updateChannel(DlDriveSchoolStudent student);
|
||||
}
|
||||
|
@ -860,4 +860,9 @@ public class DlDriveSchoolCoachServiceImpl extends ServiceImpl<DlDriveSchoolCoac
|
||||
public List<SchoolStaffImportExcelVO> getAll(SchoolStaffImportExcelVO query) {
|
||||
return baseMapper.getAll(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<BusinessRecordVO> getBusinessManager(BusinessRecordVO businessRecordVO, Page<BusinessRecordVO> page) {
|
||||
return dlDriveSchoolCoachMapper.getBusinessManager(businessRecordVO, page);
|
||||
}
|
||||
}
|
||||
|
@ -341,7 +341,7 @@ public class DlDriveSchoolStudentServiceImpl extends ServiceImpl<DlDriveSchoolSt
|
||||
endTimeStr = DateUtil.formatDate(DateUtil.date()) + " 23:59:59";
|
||||
}
|
||||
pageReqVO.setStartTime(startTimeStr);
|
||||
pageReqVO.setStartTime(endTimeStr);
|
||||
pageReqVO.setEndTime(endTimeStr);
|
||||
IPage<DlDriveSchoolStudentVO> pageResult = dlDriveSchoolStudentMapper.selectByCoachId(pageReqVO, page);
|
||||
pageResult.getRecords().forEach(item -> {
|
||||
//查每个学生的当前所处的科目
|
||||
@ -407,7 +407,7 @@ public class DlDriveSchoolStudentServiceImpl extends ServiceImpl<DlDriveSchoolSt
|
||||
endTimeStr = DateUtil.formatDate(DateUtil.date()) + " 23:59:59";
|
||||
}
|
||||
pageReqVO.setStartTime(startTimeStr);
|
||||
pageReqVO.setStartTime(endTimeStr);
|
||||
pageReqVO.setEndTime(endTimeStr);
|
||||
IPage<DlDriveSchoolStudentVO> pageResult = dlDriveSchoolStudentMapper.selectByBusinessId(pageReqVO, page);
|
||||
/*pageResult.getRecords().forEach(item -> {
|
||||
//查每个学生的当前所处的科目
|
||||
@ -671,4 +671,17 @@ public class DlDriveSchoolStudentServiceImpl extends ServiceImpl<DlDriveSchoolSt
|
||||
return baseMapper.getAll(query);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改学员来源
|
||||
*/
|
||||
@Override
|
||||
public boolean updateChannel(DlDriveSchoolStudent student) {
|
||||
int rows = dlDriveSchoolStudentMapper.update(Wrappers.lambdaUpdate(DlDriveSchoolStudent.class)
|
||||
.eq(DlDriveSchoolStudent::getUserId, student.getUserId())
|
||||
.eq(DlDriveSchoolStudent::getTenantId, student.getTenantId())
|
||||
.eq(DlDriveSchoolStudent::getDeleted, false)
|
||||
.set(student.getChannel() != null, DlDriveSchoolStudent::getChannel, student.getChannel()));
|
||||
return rows > 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.base.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import lombok.Data;
|
||||
import org.apache.poi.hpsf.Decimal;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class BusinessRecordVO extends TenantBaseDO {
|
||||
private String name;
|
||||
private String phone;
|
||||
private String idCard;
|
||||
private Integer age;
|
||||
private String sex;
|
||||
private String channel;
|
||||
private String courseName;
|
||||
private String coachUserName;
|
||||
private BigDecimal reserveMoney;
|
||||
private BigDecimal restMoney;
|
||||
private String paymentStatus;
|
||||
private String payType;
|
||||
private Integer isSign;
|
||||
private String businessName;
|
||||
private String businessPhone;
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -31,6 +31,8 @@ public class DlDriveSchoolStudentVO extends DlDriveSchoolStudent {
|
||||
private String startTime;
|
||||
/**查询时间范围--结束*/
|
||||
private String endTime;
|
||||
/**是否毕业*/
|
||||
private String isGrad;
|
||||
/**订单表中的毕业时间*/
|
||||
private String orderGradTime;
|
||||
/**课程名称*/
|
||||
|
@ -122,4 +122,45 @@
|
||||
group by su.id
|
||||
order by su.nickname
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getBusinessManager" resultType="cn.iocoder.yudao.module.base.vo.BusinessRecordVO">
|
||||
select dss.name,
|
||||
dss.phone,
|
||||
dss.id_card,
|
||||
dss.age,
|
||||
dss.sex,
|
||||
dss.channel,
|
||||
dsco.course_name,
|
||||
dsco.coach_user_name,
|
||||
dsco.reserve_money,
|
||||
dsco.rest_money,
|
||||
dsco.payment_status,
|
||||
dsco.pay_type,
|
||||
dsco.is_sign,
|
||||
dsc.name AS businessName,
|
||||
dsc.phone AS businessPhone,
|
||||
dsco.create_time
|
||||
from drive_school_student dss
|
||||
LEFT JOIN drive_school_course_order dsco ON dss.user_id = dsco.user_id
|
||||
LEFT JOIN drive_school_coach dsc ON dss.source_user_id = dsc.user_id
|
||||
<where>
|
||||
dss.source = '04'
|
||||
AND dsc.type = 'ywjl'
|
||||
AND dss.deleted = 0
|
||||
AND dsco.deleted = 0
|
||||
AND dsc.deleted = 0
|
||||
<if test="entity.businessName != null and entity.businessName != ''">
|
||||
AND dsc.name LIKE CONCAT('%', #{entity.businessName}, '%')
|
||||
</if>
|
||||
<if test="entity.name != null and entity.name != ''">
|
||||
AND dss.name LIKE CONCAT('%', #{entity.name}, '%')
|
||||
</if>
|
||||
<if test="entity.phone != null and entity.phone != ''">
|
||||
AND (dss.phone LIKE CONCAT('%', #{entity.phone}, '%')
|
||||
OR dsc.phone LIKE CONCAT('%', #{entity.phone}, '%'))
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY dsco.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -21,6 +21,7 @@
|
||||
<if test="entity.name != null and entity.name != ''">and main.name like concat('%', #{entity.name}, '%')</if>
|
||||
<if test="entity.phone != null and entity.phone != ''">and main.phone = #{entity.phone}</if>
|
||||
<if test="entity.idCard != null and entity.idCard != ''">and main.id_card like concat('%', #{entity.idCard}, '%')</if>
|
||||
<if test="entity.source != null and entity.source != ''">and main.source = #{entity.source}</if>
|
||||
</where>
|
||||
GROUP BY main.user_id
|
||||
order by main.create_time desc
|
||||
@ -135,6 +136,12 @@
|
||||
<if test="entity.endTime!=null and entity.endTime!=''">
|
||||
AND dss.create_time <= #{entity.endTime}
|
||||
</if>
|
||||
<if test="entity.isGrad != null and entity.isGrad == 'correct'">
|
||||
AND dsco.grad_time IS NOT NULL
|
||||
</if>
|
||||
<if test="entity.isGrad != null and entity.isGrad == 'deny'">
|
||||
AND dsco.grad_time IS NULL
|
||||
</if>
|
||||
AND dss.id IS NOT NULL
|
||||
ORDER BY
|
||||
dss.create_time DESC
|
||||
|
@ -58,7 +58,23 @@
|
||||
<if test="entity.courseName != null and entity.courseName != '' "> and dsp.name like concat('%', #{entity.courseName}, '%')</if>
|
||||
<if test="entity.userId != null "> and dsp.user_id = #{entity.userId}</if>
|
||||
<if test="entity.courseId != null and entity.courseId != '' "> and dsp.course_id = #{entity.courseId}</if>
|
||||
<if test="entity.studentIdCard != null and entity.studentIdCard != '' "> AND RIGHT(dss.id_card, 4) = RIGHT(#{entity.studentIdCard}, 4) </if>
|
||||
<!--<if test="entity.studentIdCard != null and entity.studentIdCard != '' "> AND RIGHT(dss.id_card, 4) = RIGHT(#{entity.studentIdCard}, 4) </if>-->
|
||||
<if test="entity.studentIdCard != null and entity.studentIdCard != '' ">
|
||||
<choose>
|
||||
<!-- 精确匹配:当输入18位时 -->
|
||||
<when test="entity.studentIdCard.length() == 18">
|
||||
AND dss.id_card = #{entity.studentIdCard}
|
||||
</when>
|
||||
<!-- 后4位匹配:当输入正好4位时 -->
|
||||
<when test="entity.studentIdCard.length() == 4">
|
||||
AND RIGHT(dss.id_card, 4) = #{entity.studentIdCard}
|
||||
</when>
|
||||
<!-- 模糊搜索:当输入大于4位但不足18位时 -->
|
||||
<otherwise>
|
||||
AND dss.id_card LIKE concat('%', #{entity.studentIdCard}, '%')
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
(CASE
|
||||
|
Loading…
Reference in New Issue
Block a user