| | |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.WebUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.BranchAuditDTO; |
| | | import com.ruoyi.system.dto.TCrmBranchDTO; |
| | | import com.ruoyi.system.dto.UnbindDTO; |
| | | import com.ruoyi.system.dto.UnbindProcessingDTO; |
| | | import com.ruoyi.system.export.TCrmBranchAuditExport; |
| | | import com.ruoyi.system.export.TCrmBranchExport; |
| | | import com.ruoyi.system.export.TSysAppUserClinicExport; |
| | | import com.ruoyi.system.export.TSysAppUserExport; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.TCrmBranchAuditQuery; |
| | | import com.ruoyi.system.query.TCrmBranchQuery; |
| | | import com.ruoyi.system.query.TSysAppUserQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.TCrmBranchLiftVO; |
| | | import com.ruoyi.system.vo.TCrmBranchVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | |
| | | Integer roleType = tokenService.getLoginUser().getUser().getRoleType(); |
| | | query.setRoleType(roleType); |
| | | return R.ok(crmBranchService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 获取crm分公司管理管理列表 |
| | | */ |
| | | @ApiOperation(value = "获取crm分公司审核分页列表") |
| | | @PostMapping(value = "/pageAuditList") |
| | | public R<PageInfo<TCrmBranchVO>> pageAuditList(@RequestBody TCrmBranchAuditQuery query) { |
| | | return R.ok(crmBranchService.pageAuditList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 获取crm分公司管理管理列表 |
| | | */ |
| | | @ApiOperation(value = "获取crm分公司解除绑定分页列表") |
| | | @PostMapping(value = "/pageUnbindList") |
| | | public R<PageInfo<TCrmBranchLiftVO>> pageUnbindList(@RequestBody TCrmBranchAuditQuery query) { |
| | | return R.ok(crmBranchService.pageUnbindList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 获取crm分公司管理管理列表 |
| | | */ |
| | | @ApiOperation(value = "获取crm分公司省公司管理列表") |
| | | @PostMapping(value = "/listProvince") |
| | | public R<List<TCrmBranch>> listProvince() { |
| | | List<TCrmBranch> crmBranches = crmBranchService.list(Wrappers.lambdaQuery(TCrmBranch.class) |
| | | .eq(TCrmBranch::getPersonType, 1) |
| | | .eq(TCrmBranch::getStatus, 1) |
| | | .orderByDesc(TCrmBranch::getCreateTime)); |
| | | return R.ok(crmBranches); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | |
| | | @Log(title = "crm分公司管理信息-分公司审核信息导出", businessType = BusinessType.EXPORT) |
| | | @ApiOperation(value = "分公司审核信息导出") |
| | | @PostMapping("/exportAuditList") |
| | | public void exportAuditList(@RequestBody TCrmBranchAuditQuery query){ |
| | | List<TCrmBranchAuditExport> crmBranchAuditExports = crmBranchService.exportAuditList(query); |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), TCrmBranchAuditExport.class, crmBranchAuditExports); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | assert response != null; |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | String fileName = URLEncoder.encode("分公司审核信息.xls", "utf-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | outputStream = response.getOutputStream(); |
| | | workbook.write(outputStream); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 解除绑定 |
| | | */ |
| | | @ApiOperation(value = "crm分公司管理信息-解除绑定", notes = "clinicId:诊所id") |
| | | @GetMapping(value = "/unbind") |
| | | @Log(title = "crm分公司管理信息-解除绑定", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "crm分公司管理信息-解除绑定") |
| | | @PostMapping(value = "/unbind") |
| | | public R<String> unbind(@RequestBody UnbindDTO dto) { |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | TCrmBranch crmBranch = crmBranchService.getOne(Wrappers.lambdaQuery(TCrmBranch.class) |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 分公司审核 |
| | | */ |
| | | @Log(title = "crm分公司管理信息-分公司审核", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "crm分公司管理信息-分公司审核") |
| | | @PostMapping(value = "/branchAudit") |
| | | public R<String> branchAudit(@RequestBody BranchAuditDTO dto) { |
| | | TCrmBranch crmBranch = crmBranchService.getById(dto.getId()); |
| | | crmBranch.setAuditStatus(dto.getAuditStatus()); |
| | | crmBranch.setAuditRemark(dto.getAuditRemark()); |
| | | crmBranch.setAuditTime(LocalDateTime.now()); |
| | | crmBranch.setMoneyCommission(dto.getMoneyCommission()); |
| | | crmBranch.setPointsCommission(dto.getPointsCommission()); |
| | | crmBranchService.updateById(crmBranch); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 解绑处理 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRED) |
| | | @Log(title = "crm分公司管理信息-解绑处理", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "crm分公司管理信息-解绑处理") |
| | | @PostMapping(value = "/unbindProcessing") |
| | | public R<String> unbindProcessing(@RequestBody UnbindProcessingDTO dto) { |
| | | // 查询解绑信息 |
| | | TCrmBranchLift crmBranchLift = crmBranchLiftService.getById(dto.getId()); |
| | | if (Objects.isNull(crmBranchLift)){ |
| | | return R.fail("未查询到该解绑信息"); |
| | | } |
| | | crmBranchLift.setStatus(dto.getStatus()); |
| | | crmBranchLift.setRemarks(dto.getRemarks()); |
| | | crmBranchLiftService.updateById(crmBranchLift); |
| | | TCrmBranch crmBranch = crmBranchService.getById(crmBranchLift.getBranchId()); |
| | | crmBranch.setPhone(crmBranchLift.getChargePhone()); |
| | | crmBranchService.updateById(crmBranch); |
| | | // 查询分公司绑定的人员 |
| | | SysUser sysUser = sysUserService.selectUserById(crmBranch.getUserId()); |
| | | sysUser.setPhonenumber(crmBranchLift.getChargePhone()); |
| | | sysUser.setUserName(crmBranchLift.getChargePhone()); |
| | | sysUserService.updateUser(sysUser); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | "/t-sys-educational-info/list","/t-sys-educational-info/getDetailById","/t-sys-educational-info/pageList", |
| | | "/t-sys-live/list","/t-sys-live/getDetailById","/t-sys-live/pageList","/t-sys-qualifications/list", |
| | | "/open/**","/cos/get/**","/openIdByJsCode","/t-sys-order/**","/openIdByCode","/tRegion/sendTest" |
| | | ,"/t-sys-qualifications/pageList" |
| | | ,"/t-sys-qualifications/pageList","/t-sys-qualifications/getDetailById" |
| | | ).permitAll() |
| | | // 静态资源,可匿名访问 |
| | | .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() |
| New file |
| | |
| | | package com.ruoyi.system.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value = "审核分公司BranchAuditDTO") |
| | | public class BranchAuditDTO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "分公司id") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "审核状态 1=待审核 2=已通过 3=已驳回") |
| | | private Integer auditStatus; |
| | | |
| | | @ApiModelProperty(value = "审核备注") |
| | | private String auditRemark; |
| | | |
| | | @ApiModelProperty(value = "百分比分佣") |
| | | @TableField("money_commission") |
| | | private BigDecimal moneyCommission; |
| | | |
| | | @ApiModelProperty(value = "积分获得限制") |
| | | @TableField("points_commission") |
| | | private BigDecimal pointsCommission; |
| | | } |
| New file |
| | |
| | | package com.ruoyi.system.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @ApiModel(value = "解绑处理参数UnbindProcessingDTO") |
| | | public class UnbindProcessingDTO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "解绑信息id") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "状态 1=待处理 2=已处理") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | private String remarks; |
| | | |
| | | } |
| New file |
| | |
| | | package com.ruoyi.system.export; |
| | | |
| | | import cn.afterturn.easypoi.excel.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @ApiModel(value = "crm分公司审核管理导出TCrmBranchAuditExport") |
| | | public class TCrmBranchAuditExport implements Serializable { |
| | | |
| | | @Excel(name = "分公司名称", width = 20,needMerge = true) |
| | | private String branchName; |
| | | |
| | | @Excel(name = "负责人姓名", width = 20,needMerge = true) |
| | | private String userName; |
| | | |
| | | @Excel(name = "联系电话", width = 20,needMerge = true) |
| | | private String phone; |
| | | |
| | | @Excel(name = "所属分公司", width = 20,needMerge = true) |
| | | private String provinceBranchName; |
| | | |
| | | @Excel(name = "审核状态",width = 20,needMerge = true,replace = {"待审核_1","已通过_2","已驳回_3"}) |
| | | private Integer auditStatus; |
| | | |
| | | @ApiModelProperty(value = "省公司id") |
| | | private String provinceBranchId; |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.export.TCrmBranchAuditExport; |
| | | import com.ruoyi.system.export.TCrmBranchExport; |
| | | import com.ruoyi.system.model.TCrmBranch; |
| | | import com.ruoyi.system.query.TCrmBranchAuditQuery; |
| | | import com.ruoyi.system.query.TCrmBranchQuery; |
| | | import com.ruoyi.system.vo.TCrmBranchLiftVO; |
| | | import com.ruoyi.system.vo.TCrmBranchVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<TCrmBranchExport> exportList(@Param("query")TCrmBranchQuery query); |
| | | |
| | | /** |
| | | * 分页列表 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TCrmBranchVO> pageAuditList(@Param("query")TCrmBranchAuditQuery query, @Param("pageInfo")PageInfo<TCrmBranchVO> pageInfo); |
| | | |
| | | /** |
| | | * 解除绑定列表 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TCrmBranchLiftVO> pageUnbindList(@Param("query")TCrmBranchAuditQuery query, @Param("pageInfo")PageInfo<TCrmBranchLiftVO> pageInfo); |
| | | |
| | | /** |
| | | * 导出列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<TCrmBranchAuditExport> exportAuditList(@Param("query")TCrmBranchAuditQuery query); |
| | | } |
| | |
| | | package com.ruoyi.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.domain.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | |
| | | @TableField("audit_status") |
| | | private Integer auditStatus; |
| | | |
| | | @ApiModelProperty(value = "审核备注") |
| | | @TableField("audit_remark") |
| | | private String auditRemark; |
| | | |
| | | @ApiModelProperty(value = "省公司id") |
| | | @TableField("province_branch_id") |
| | | private String provinceBranchId; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty(value = "审核时间") |
| | | @TableField("audit_time") |
| | | private LocalDateTime auditTime; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.ruoyi.common.core.domain.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "crm分公司审核参数TCrmBranchAuditQuery") |
| | | public class TCrmBranchAuditQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "分公司名称") |
| | | private String branchName; |
| | | |
| | | @ApiModelProperty(value = "电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "所属分公司") |
| | | private String branchId; |
| | | |
| | | @ApiModelProperty(value = "审核状态 1=待审核 2=已通过 3=已驳回") |
| | | private Integer auditStatus; |
| | | |
| | | @ApiModelProperty(value = "分公司id集合,前端忽略") |
| | | private List<String> branchIds; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.ruoyi.common.core.domain.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.dto.TCrmBranchDTO; |
| | | import com.ruoyi.system.export.TCrmBranchAuditExport; |
| | | import com.ruoyi.system.export.TCrmBranchExport; |
| | | import com.ruoyi.system.model.TCrmBranch; |
| | | import com.ruoyi.system.model.TCrmDevice; |
| | | import com.ruoyi.system.query.TCrmBranchAuditQuery; |
| | | import com.ruoyi.system.query.TCrmBranchQuery; |
| | | import com.ruoyi.system.query.TSysAppUserQuery; |
| | | import com.ruoyi.system.vo.TCrmBranchLiftVO; |
| | | import com.ruoyi.system.vo.TCrmBranchVO; |
| | | |
| | | import java.util.List; |
| | |
| | | * @return |
| | | */ |
| | | List<TCrmBranchExport> exportList(TCrmBranchQuery query); |
| | | |
| | | /** |
| | | * 获取crm分公司审核分页列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TCrmBranchVO> pageAuditList(TCrmBranchAuditQuery query); |
| | | |
| | | /** |
| | | * 获取crm分公司解除绑定分页列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TCrmBranchLiftVO> pageUnbindList(TCrmBranchAuditQuery query); |
| | | |
| | | /** |
| | | * 导出crm分公司审核列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | List<TCrmBranchAuditExport> exportAuditList(TCrmBranchAuditQuery query); |
| | | } |
| | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.dto.TCrmBranchDTO; |
| | | import com.ruoyi.system.export.TCrmBranchAuditExport; |
| | | import com.ruoyi.system.export.TCrmBranchExport; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | | import com.ruoyi.system.mapper.TCrmBranchLiftMapper; |
| | |
| | | import com.ruoyi.system.model.TCrmBranchArea; |
| | | import com.ruoyi.system.model.TCrmBranchLift; |
| | | import com.ruoyi.system.model.TCrmBranchSalary; |
| | | import com.ruoyi.system.query.TCrmBranchAuditQuery; |
| | | import com.ruoyi.system.query.TCrmBranchQuery; |
| | | import com.ruoyi.system.query.TSysAppUserQuery; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TCrmBranchAreaService; |
| | | import com.ruoyi.system.service.TCrmBranchSalaryService; |
| | | import com.ruoyi.system.service.TCrmBranchService; |
| | | import com.ruoyi.system.vo.TCrmBranchLiftVO; |
| | | import com.ruoyi.system.vo.TCrmBranchVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | return R.fail("负责区域已存在"); |
| | | } |
| | | } |
| | | } |
| | | if(dto.getPersonType() == 2){ |
| | | // 查询一级 |
| | | TCrmBranch crmBranch = this.getOne(Wrappers.lambdaQuery(TCrmBranch.class) |
| | | .eq(TCrmBranch::getUserId, dto.getCorrelationPersonId()) |
| | | .last("LIMIT 1")); |
| | | dto.setProvinceBranchId(crmBranch.getId()); |
| | | } |
| | | |
| | | if(dto.getPersonType() == 3){ |
| | | // 查询二级 |
| | | TCrmBranch crmBranch = this.getOne(Wrappers.lambdaQuery(TCrmBranch.class) |
| | | .eq(TCrmBranch::getUserId, dto.getCorrelationPersonId()) |
| | | .last("LIMIT 1")); |
| | | // 查询一级 |
| | | TCrmBranch crmBranch1 = this.getOne(Wrappers.lambdaQuery(TCrmBranch.class) |
| | | .eq(TCrmBranch::getUserId, crmBranch.getCorrelationPersonId()) |
| | | .last("LIMIT 1")); |
| | | dto.setProvinceBranchId(crmBranch1.getId()); |
| | | } |
| | | |
| | | this.save(dto); |
| | |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<TCrmBranchVO> pageAuditList(TCrmBranchAuditQuery query) { |
| | | PageInfo<TCrmBranchVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TCrmBranchVO> list = this.baseMapper.pageAuditList(query,pageInfo); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return pageInfo; |
| | | } |
| | | List<String> branchIds = list.stream().map(TCrmBranchVO::getProvinceBranchId).collect(Collectors.toList()); |
| | | List<TCrmBranch> crmBranches = this.list(Wrappers.lambdaQuery(TCrmBranch.class).in(TCrmBranch::getId, branchIds)); |
| | | for (TCrmBranchVO tCrmBranchVO : list) { |
| | | List<TCrmBranch> crmBranchList = crmBranches.stream().filter(t -> tCrmBranchVO.getProvinceBranchId().equals(t.getId())).collect(Collectors.toList()); |
| | | if(!CollectionUtils.isEmpty(crmBranchList)){ |
| | | tCrmBranchVO.setProvinceBranchName(crmBranchList.get(0).getBranchName()); |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<TCrmBranchLiftVO> pageUnbindList(TCrmBranchAuditQuery query) { |
| | | PageInfo<TCrmBranchLiftVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TCrmBranchLiftVO> list = this.baseMapper.pageUnbindList(query,pageInfo); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return pageInfo; |
| | | } |
| | | List<String> branchIds = list.stream().map(TCrmBranchLiftVO::getProvinceBranchId).collect(Collectors.toList()); |
| | | List<TCrmBranch> crmBranches = this.list(Wrappers.lambdaQuery(TCrmBranch.class).in(TCrmBranch::getId, branchIds)); |
| | | for (TCrmBranchLiftVO crmBranchLiftVO : list) { |
| | | List<TCrmBranch> crmBranchList = crmBranches.stream().filter(t -> crmBranchLiftVO.getProvinceBranchId().equals(t.getId())).collect(Collectors.toList()); |
| | | if(!CollectionUtils.isEmpty(crmBranchList)){ |
| | | crmBranchLiftVO.setProvinceBranchName(crmBranchList.get(0).getBranchName()); |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public List<TCrmBranchAuditExport> exportAuditList(TCrmBranchAuditQuery query) { |
| | | List<TCrmBranchAuditExport> list = this.baseMapper.exportAuditList(query); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | List<String> branchIds = list.stream().map(TCrmBranchAuditExport::getProvinceBranchId).collect(Collectors.toList()); |
| | | List<TCrmBranch> crmBranches = this.list(Wrappers.lambdaQuery(TCrmBranch.class).in(TCrmBranch::getId, branchIds)); |
| | | for (TCrmBranchAuditExport crmBranchAuditExport : list) { |
| | | List<TCrmBranch> crmBranchList = crmBranches.stream().filter(t -> crmBranchAuditExport.getProvinceBranchId().equals(t.getId())).collect(Collectors.toList()); |
| | | if(!CollectionUtils.isEmpty(crmBranchList)){ |
| | | crmBranchAuditExport.setProvinceBranchName(crmBranchList.get(0).getBranchName()); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | } |
| | |
| | | e.printStackTrace(); |
| | | throw new RuntimeException("网络繁忙,请重试"); |
| | | } |
| | | tErpProcurementGoods1.forEach(e -> e.setProcurementId(tErpProcurement.getId())); |
| | | for (TErpProcurementGoods tErpProcurementGoods : tErpProcurementGoods1) { |
| | | tErpProcurementGoods.setId(null); |
| | | tErpProcurementGoods.setProcurementId(tErpProcurement.getId()); |
| | | } |
| | | erpProcurementGoodsService.saveBatch(tErpProcurementGoods1); |
| | | } |
| | | |
| New file |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.ruoyi.system.model.TCrmBranchLift; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "TCrmBranchLift对象", description = "crm分公司解绑申请") |
| | | public class TCrmBranchLiftVO extends TCrmBranchLift { |
| | | |
| | | @ApiModelProperty(value = "分公司名称") |
| | | private String branchName; |
| | | |
| | | @ApiModelProperty(value = "负责人姓名") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(value = "电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "所属分公司") |
| | | private String provinceBranchName; |
| | | |
| | | @ApiModelProperty(value = "省公司id") |
| | | private String provinceBranchId; |
| | | } |
| | |
| | | @ApiModelProperty(value = "是否置灰解除绑定按钮") |
| | | private Boolean isGrayOut; |
| | | |
| | | @ApiModelProperty(value = "所属分公司") |
| | | private String provinceBranchName; |
| | | |
| | | } |
| | |
| | | <result column="person_type" property="personType" /> |
| | | <result column="correlation_person_id" property="correlationPersonId" /> |
| | | <result column="audit_status" property="auditStatus" /> |
| | | <result column="province_branch_id" property="provinceBranchId" /> |
| | | <result column="audit_time" property="auditTime" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_by" property="createBy" /> |
| | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, user_id, branch_name, user_name, phone, money_commission, points_commission, user_points, status, |
| | | person_type, correlation_person_id,audit_status,create_time, update_time, create_by, update_by, disabled |
| | | person_type, correlation_person_id,audit_status,province_branch_id,audit_time, |
| | | create_time, update_time, create_by, update_by, disabled |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.TCrmBranchVO"> |
| | | select id, user_id, branch_name, user_name, phone, money_commission, points_commission, |
| | | user_points, status, person_type,audit_status, correlation_person_id,create_time, |
| | | user_points, status, person_type,audit_status, correlation_person_id,province_branch_id, |
| | | audit_time,create_time, |
| | | update_time, create_by, update_by, disabled |
| | | from t_crm_branch |
| | | <where> |
| | |
| | | </select> |
| | | <select id="exportList" resultType="com.ruoyi.system.export.TCrmBranchExport"> |
| | | select id, user_id, branch_name, user_name, phone, money_commission, points_commission, |
| | | user_points, status,person_type, audit_status,correlation_person_id, create_time, |
| | | user_points, status,person_type, audit_status,correlation_person_id,province_branch_id, |
| | | audit_time,create_time, |
| | | update_time, create_by, update_by, disabled |
| | | from t_crm_branch |
| | | <where> |
| | |
| | | </where> |
| | | ORDER BY create_time DESC |
| | | </select> |
| | | <select id="pageAuditList" resultType="com.ruoyi.system.vo.TCrmBranchVO"> |
| | | select id, user_id, branch_name, user_name, phone, money_commission, points_commission, |
| | | user_points, status, person_type,audit_status, correlation_person_id,province_branch_id, |
| | | audit_time,create_time, |
| | | update_time, create_by, update_by, disabled |
| | | from t_crm_branch |
| | | <where> |
| | | <if test="query.branchName != null and query.branchName != ''"> |
| | | and branch_name like concat('%',#{query.branchName},'%') |
| | | </if> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and phone like concat('%',#{query.phone},'%') |
| | | </if> |
| | | <if test="query.status != null"> |
| | | and status = #{query.status} |
| | | </if> |
| | | <if test="query.roleType != null and query.roleType == 1"> |
| | | and audit_status in (1,3) |
| | | </if> |
| | | <if test="query.branchId != null and query.branchId != ''"> |
| | | and province_branch_id = #{query.branchId} |
| | | </if> |
| | | AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY create_time DESC |
| | | </select> |
| | | <select id="pageUnbindList" resultType="com.ruoyi.system.vo.TCrmBranchLiftVO"> |
| | | select tcbl.id, tcbl.branch_id, tcbl.charge_phone, tcbl.lift_reason, tcbl.status, tcbl.remarks, tcbl.create_time, |
| | | tcbl.update_time, tcbl.create_by, tcbl.update_by, tcbl.disabled, |
| | | tcb.user_id, tcb.branch_name, tcb.user_name, tcb.phone, tcb.province_branch_id |
| | | from t_crm_branch_lift tcbl |
| | | left join t_crm_branch tcb on tcb.id = tcbl.branch_id |
| | | <where> |
| | | <if test="query.branchName != null and query.branchName != ''"> |
| | | and tcb.branch_name like concat('%',#{query.branchName},'%') |
| | | </if> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and tcb.phone like concat('%',#{query.phone},'%') |
| | | </if> |
| | | <if test="query.status != null"> |
| | | and tcbl.status = #{query.status} |
| | | </if> |
| | | <if test="query.branchId != null and query.branchId != ''"> |
| | | and tcb.province_branch_id = #{query.branchId} |
| | | </if> |
| | | AND tcbl.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY tcbl.create_time DESC |
| | | </select> |
| | | <select id="exportAuditList" resultType="com.ruoyi.system.export.TCrmBranchAuditExport"> |
| | | select id, user_id, branch_name, user_name, phone, money_commission, points_commission, |
| | | user_points, status, person_type,audit_status, correlation_person_id,province_branch_id, |
| | | audit_time,create_time, |
| | | update_time, create_by, update_by, disabled |
| | | from t_crm_branch |
| | | <where> |
| | | <if test="query.branchName != null and query.branchName != ''"> |
| | | and branch_name like concat('%',#{query.branchName},'%') |
| | | </if> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and phone like concat('%',#{query.phone},'%') |
| | | </if> |
| | | <if test="query.status != null"> |
| | | and status = #{query.status} |
| | | </if> |
| | | <if test="query.roleType != null and query.roleType == 1"> |
| | | and audit_status in (1,3) |
| | | </if> |
| | | <if test="query.branchId != null and query.branchId != ''"> |
| | | and province_branch_id = #{query.branchId} |
| | | </if> |
| | | AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY create_time DESC |
| | | </select> |
| | | |
| | | </mapper> |