| | |
| | | @ApiOperation(value = "获取crm分公司管理列表") |
| | | @PostMapping(value = "/list") |
| | | public R<List<TCrmBranch>> list() { |
| | | return R.ok(crmBranchService.list(Wrappers.lambdaQuery(TCrmBranch.class).orderByDesc(TCrmBranch::getCreateTime))); |
| | | return R.ok(crmBranchService.list(Wrappers.lambdaQuery(TCrmBranch.class) |
| | | .eq(TCrmBranch::getStatus,1) |
| | | .orderByDesc(TCrmBranch::getCreateTime))); |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 批量删除crm分公司管理 |
| | | */ |
| | | @Log(title = "crm分公司管理信息-分公司管理解冻冻结", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "分公司管理解冻冻结") |
| | | @Log(title = "crm分公司管理信息-分公司管理解冻冻结", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "分公司管理解冻冻结",notes = "状态 1=使用中 2=冻结") |
| | | @PutMapping(value = "/thawOrFreeze") |
| | | public R<Boolean> thawOrFreeze(@RequestParam(value = "id")String id, |
| | | @RequestParam(value = "status")Integer status) { |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.dto.TCrmClinicAuditDTO; |
| | | import com.ruoyi.system.dto.TCrmClinicDTO; |
| | | import com.ruoyi.system.model.TCrmBranch; |
| | | import com.ruoyi.system.model.TCrmClinic; |
| | | import com.ruoyi.system.model.TCrmSalesperson; |
| | | import com.ruoyi.system.model.TCrmWarehouse; |
| | | import com.ruoyi.system.query.TCrmClinicQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.TCrmClinicVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2025-08-20 |
| | | */ |
| | | @Api(tags = "crm诊所管理") |
| | | @RestController |
| | | @RequestMapping("/t-crm-clinic") |
| | | public class TCrmClinicController { |
| | | |
| | | private final TCrmClinicService crmClinicService; |
| | | private final TCrmSupplierService crmSupplierService; |
| | | private final TCrmBranchService crmBranchService; |
| | | private final TCrmWarehouseService crmWarehouseService; |
| | | private final TCrmSalespersonService crmSalespersonService; |
| | | private final ISysUserService sysUserService; |
| | | @Autowired |
| | | public TCrmClinicController(TCrmClinicService crmClinicService, TCrmSupplierService crmSupplierService, TCrmBranchService crmBranchService, TCrmWarehouseService crmWarehouseService, TCrmSalespersonService crmSalespersonService, ISysUserService sysUserService) { |
| | | this.crmClinicService = crmClinicService; |
| | | this.crmSupplierService = crmSupplierService; |
| | | this.crmBranchService = crmBranchService; |
| | | this.crmWarehouseService = crmWarehouseService; |
| | | this.crmSalespersonService = crmSalespersonService; |
| | | this.sysUserService = sysUserService; |
| | | } |
| | | |
| | | /** |
| | | * 获取crm诊所管理管理列表 |
| | | */ |
| | | @ApiOperation(value = "获取crm诊所管理分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<TCrmClinicVO>> pageList(@RequestBody TCrmClinicQuery query) { |
| | | return R.ok(crmClinicService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 获取crm诊所管理管理列表 |
| | | */ |
| | | @ApiOperation(value = "获取crm诊所管理列表") |
| | | @PostMapping(value = "/list") |
| | | public R<List<TCrmClinic>> list() { |
| | | return R.ok(crmClinicService.list(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getStatus,1) |
| | | .orderByDesc(TCrmClinic::getCreateTime))); |
| | | } |
| | | |
| | | /** |
| | | * 添加crm诊所管理管理 |
| | | */ |
| | | @Log(title = "crm诊所管理信息-新增crm诊所管理", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "添加crm诊所管理") |
| | | @PostMapping(value = "/add") |
| | | public R<Boolean> add(@Validated @RequestBody TCrmClinicDTO dto) { |
| | | return crmClinicService.addClinic(dto); |
| | | } |
| | | |
| | | /** |
| | | * 修改crm诊所管理 |
| | | */ |
| | | @Log(title = "crm诊所管理信息-修改crm诊所管理", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "修改crm诊所管理") |
| | | @PostMapping(value = "/update") |
| | | public R<Boolean> update(@Validated @RequestBody TCrmClinicDTO dto) { |
| | | return crmClinicService.updateClinic(dto); |
| | | } |
| | | |
| | | /** |
| | | * 查看crm诊所管理详情 |
| | | */ |
| | | @ApiOperation(value = "查看crm诊所管理详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public R<TCrmClinicVO> getDetailById(@RequestParam String id) { |
| | | TCrmClinic crmSupplier = crmClinicService.getById(id); |
| | | TCrmClinicVO crmSupplierVO = new TCrmClinicVO(); |
| | | BeanUtils.copyProperties(crmSupplier, crmSupplierVO); |
| | | // 获取关联的分公司名称 |
| | | TCrmBranch crmBranch = crmBranchService.getById(crmSupplier.getBranchId()); |
| | | if(Objects.nonNull(crmBranch)){ |
| | | crmSupplierVO.setBranchName(crmBranch.getBranchName()); |
| | | } |
| | | // 获取关联的业务员名称 |
| | | TCrmSalesperson crmSalesperson = crmSalespersonService.getById(crmSupplier.getSalespersonId()); |
| | | if(Objects.nonNull(crmSalesperson)){ |
| | | crmSupplierVO.setSalespersonName(crmSalesperson.getSalespersonName()); |
| | | } |
| | | // 获取关联仓库 |
| | | TCrmWarehouse crmWarehouse = crmWarehouseService.getById(crmSupplier.getWarehouseId()); |
| | | if(Objects.nonNull(crmWarehouse)){ |
| | | crmSupplierVO.setWarehouseName(crmWarehouse.getWarehouseName()); |
| | | } |
| | | return R.ok(crmSupplierVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除crm诊所管理 |
| | | */ |
| | | @Log(title = "crm诊所管理信息-删除crm诊所管理", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "删除crm诊所管理") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public R<Boolean> deleteById(@RequestParam String id) { |
| | | // 删除账号 |
| | | TCrmClinic crmClinic = crmClinicService.getById(id); |
| | | sysUserService.deleteUserById(crmClinic.getUserId()); |
| | | return R.ok(crmClinicService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除crm诊所管理 |
| | | */ |
| | | @Log(title = "crm诊所管理信息-删除crm诊所管理", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量删除crm诊所管理") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public R<Boolean> deleteByIds(@RequestBody List<String> ids) { |
| | | // 删除账号 |
| | | List<TCrmClinic> crmClinicList = crmClinicService.list(Wrappers.lambdaQuery(TCrmClinic.class).in(TCrmClinic::getId, ids)); |
| | | List<Long> userIds = crmClinicList.stream().map(TCrmClinic::getUserId).collect(Collectors.toList()); |
| | | sysUserService.deleteUserByIds(userIds); |
| | | return R.ok(crmClinicService.removeByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除crm诊所管理 |
| | | */ |
| | | @Log(title = "crm诊所管理信息-诊所管理解冻冻结", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "诊所管理解冻冻结",notes = "状态 3=使用中 4=冻结") |
| | | @PutMapping(value = "/thawOrFreeze") |
| | | public R<Boolean> thawOrFreeze(@RequestParam(value = "id")String id, |
| | | @RequestParam(value = "status")Integer status) { |
| | | TCrmClinic crmClinic = crmClinicService.getById(id); |
| | | crmClinic.setStatus(status); |
| | | crmClinicService.updateById(crmClinic); |
| | | // 查询用户 |
| | | SysUser sysUser = sysUserService.selectUserById(crmClinic.getUserId()); |
| | | switch (status){ |
| | | case 3: |
| | | // 解冻 |
| | | sysUser.setStatus("0"); |
| | | sysUserService.updateUser(sysUser); |
| | | break; |
| | | case 4: |
| | | // 冻结 |
| | | sysUser.setStatus("1"); |
| | | sysUserService.updateUser(sysUser); |
| | | break; |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除crm诊所管理 |
| | | */ |
| | | @Log(title = "crm诊所管理信息-诊所管理审核", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "诊所管理审核",notes = "状态 1=待审核 2=已拒绝 3=使用中 4=冻结") |
| | | @PutMapping(value = "/thawOrFreeze") |
| | | public R<Boolean> thawOrFreeze(@RequestBody TCrmClinicAuditDTO dto) { |
| | | TCrmClinic crmClinic = crmClinicService.getById(dto.getId()); |
| | | crmClinic.setStatus(dto.getStatus()); |
| | | crmClinic.setAuditRemark(dto.getAuditRemark()); |
| | | crmClinicService.updateById(crmClinic); |
| | | // 查询用户 |
| | | if(dto.getStatus() == 3){ |
| | | SysUser sysUser = sysUserService.selectUserById(crmClinic.getUserId()); |
| | | sysUser.setDelFlag("0"); |
| | | sysUserService.updateUser(sysUser); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "获取crm业务员管理列表") |
| | | @PostMapping(value = "/list") |
| | | public R<List<TCrmSalesperson>> list() { |
| | | return R.ok(crmSalespersonService.list(Wrappers.lambdaQuery(TCrmSalesperson.class).orderByDesc(TCrmSalesperson::getCreateTime))); |
| | | return R.ok(crmSalespersonService.list(Wrappers.lambdaQuery(TCrmSalesperson.class) |
| | | .eq(TCrmSalesperson::getStatus,1) |
| | | .orderByDesc(TCrmSalesperson::getCreateTime))); |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 批量删除crm业务员管理 |
| | | */ |
| | | @Log(title = "crm业务员管理信息-业务员管理解冻冻结", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "业务员管理解冻冻结") |
| | | @Log(title = "crm业务员管理信息-业务员管理解冻冻结", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "业务员管理解冻冻结",notes = "状态 1=使用中 2=冻结") |
| | | @PutMapping(value = "/thawOrFreeze") |
| | | public R<Boolean> thawOrFreeze(@RequestParam(value = "id")String id, |
| | | @RequestParam(value = "status")Integer status) { |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.dto.TCrmSupplierDTO; |
| | | import com.ruoyi.system.model.TCrmBranch; |
| | | import com.ruoyi.system.model.TCrmChangePoints; |
| | | import com.ruoyi.system.model.TCrmSalesperson; |
| | | import com.ruoyi.system.model.TCrmSupplier; |
| | | import com.ruoyi.system.query.TCrmSupplierQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.TCrmSupplierVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2025-08-20 |
| | | */ |
| | | @Api(tags = "crm供应商管理") |
| | | @RestController |
| | | @RequestMapping("/t-crm-supplier") |
| | | public class TCrmSupplierController { |
| | | |
| | | private final TCrmSupplierService crmSupplierService; |
| | | private final ISysUserService sysUserService; |
| | | @Autowired |
| | | public TCrmSupplierController(TCrmSupplierService crmSupplierService, ISysUserService sysUserService) { |
| | | this.crmSupplierService = crmSupplierService; |
| | | this.sysUserService = sysUserService; |
| | | } |
| | | |
| | | /** |
| | | * 获取crm供应商管理管理列表 |
| | | */ |
| | | @ApiOperation(value = "获取crm供应商管理分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<TCrmSupplierVO>> pageList(@RequestBody TCrmSupplierQuery query) { |
| | | return R.ok(crmSupplierService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 获取crm供应商管理管理列表 |
| | | */ |
| | | @ApiOperation(value = "获取crm供应商管理列表") |
| | | @PostMapping(value = "/list") |
| | | public R<List<TCrmSupplier>> list() { |
| | | return R.ok(crmSupplierService.list(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getStatus,1) |
| | | .orderByDesc(TCrmSupplier::getCreateTime))); |
| | | } |
| | | |
| | | /** |
| | | * 添加crm供应商管理管理 |
| | | */ |
| | | @Log(title = "crm供应商管理信息-新增crm供应商管理", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "添加crm供应商管理") |
| | | @PostMapping(value = "/add") |
| | | public R<Boolean> add(@Validated @RequestBody TCrmSupplierDTO dto) { |
| | | return crmSupplierService.addSupplier(dto); |
| | | } |
| | | |
| | | /** |
| | | * 修改crm供应商管理 |
| | | */ |
| | | @Log(title = "crm供应商管理信息-修改crm供应商管理", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "修改crm供应商管理") |
| | | @PostMapping(value = "/update") |
| | | public R<Boolean> update(@Validated @RequestBody TCrmSupplierDTO dto) { |
| | | return crmSupplierService.updateSupplier(dto); |
| | | } |
| | | |
| | | /** |
| | | * 查看crm供应商管理详情 |
| | | */ |
| | | @ApiOperation(value = "查看crm供应商管理详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public R<TCrmSupplierVO> getDetailById(@RequestParam String id) { |
| | | TCrmSupplier crmSupplier = crmSupplierService.getById(id); |
| | | TCrmSupplierVO crmSupplierVO = new TCrmSupplierVO(); |
| | | BeanUtils.copyProperties(crmSupplier, crmSupplierVO); |
| | | return R.ok(crmSupplierVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除crm供应商管理 |
| | | */ |
| | | @Log(title = "crm供应商管理信息-删除crm供应商管理", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "删除crm供应商管理") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public R<Boolean> deleteById(@RequestParam String id) { |
| | | // 删除账号 |
| | | TCrmSupplier crmBranch = crmSupplierService.getById(id); |
| | | sysUserService.deleteUserById(crmBranch.getUserId()); |
| | | return R.ok(crmSupplierService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除crm供应商管理 |
| | | */ |
| | | @Log(title = "crm供应商管理信息-删除crm供应商管理", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量删除crm供应商管理") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public R<Boolean> deleteByIds(@RequestBody List<String> ids) { |
| | | // 删除账号 |
| | | List<TCrmSupplier> crmSupplierList = crmSupplierService.list(Wrappers.lambdaQuery(TCrmSupplier.class).in(TCrmSupplier::getId, ids)); |
| | | List<Long> userIds = crmSupplierList.stream().map(TCrmSupplier::getUserId).collect(Collectors.toList()); |
| | | sysUserService.deleteUserByIds(userIds); |
| | | return R.ok(crmSupplierService.removeByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除crm供应商管理 |
| | | */ |
| | | @Log(title = "crm供应商管理信息-供应商管理解冻冻结", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "供应商管理解冻冻结",notes = "状态 1=使用中 2=冻结") |
| | | @PutMapping(value = "/thawOrFreeze") |
| | | public R<Boolean> thawOrFreeze(@RequestParam(value = "id")String id, |
| | | @RequestParam(value = "status")Integer status) { |
| | | TCrmSupplier crmSupplier = crmSupplierService.getById(id); |
| | | crmSupplier.setStatus(status); |
| | | crmSupplierService.updateById(crmSupplier); |
| | | // 查询用户 |
| | | SysUser sysUser = sysUserService.selectUserById(crmSupplier.getUserId()); |
| | | switch (status){ |
| | | case 1: |
| | | // 解冻 |
| | | sysUser.setStatus("0"); |
| | | sysUserService.updateUser(sysUser); |
| | | break; |
| | | case 2: |
| | | // 冻结 |
| | | sysUser.setStatus("1"); |
| | | sysUserService.updateUser(sysUser); |
| | | break; |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.dto.TCrmWarehouseDTO; |
| | | import com.ruoyi.system.model.TCrmWarehouse; |
| | | import com.ruoyi.system.query.TCrmWarehouseQuery; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TCrmWarehouseService; |
| | | import com.ruoyi.system.vo.TCrmWarehouseVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2025-08-20 |
| | | */ |
| | | @Api(tags = "crm仓库管理") |
| | | @RestController |
| | | @RequestMapping("/t-crm-warehouse") |
| | | public class TCrmWarehouseController { |
| | | |
| | | private final TCrmWarehouseService crmWarehouseService; |
| | | private final ISysUserService sysUserService; |
| | | @Autowired |
| | | public TCrmWarehouseController(TCrmWarehouseService crmWarehouseService, ISysUserService sysUserService) { |
| | | this.crmWarehouseService = crmWarehouseService; |
| | | this.sysUserService = sysUserService; |
| | | } |
| | | |
| | | /** |
| | | * 获取crm仓库管理管理列表 |
| | | */ |
| | | @ApiOperation(value = "获取crm仓库管理分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<TCrmWarehouseVO>> pageList(@RequestBody TCrmWarehouseQuery query) { |
| | | return R.ok(crmWarehouseService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 获取crm仓库管理管理列表 |
| | | */ |
| | | @ApiOperation(value = "获取crm仓库管理列表") |
| | | @PostMapping(value = "/list") |
| | | public R<List<TCrmWarehouse>> list() { |
| | | return R.ok(crmWarehouseService.list(Wrappers.lambdaQuery(TCrmWarehouse.class) |
| | | .eq(TCrmWarehouse::getStatus,1) |
| | | .orderByDesc(TCrmWarehouse::getCreateTime))); |
| | | } |
| | | |
| | | /** |
| | | * 添加crm仓库管理管理 |
| | | */ |
| | | @Log(title = "crm仓库管理信息-新增crm仓库管理", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "添加crm仓库管理") |
| | | @PostMapping(value = "/add") |
| | | public R<Boolean> add(@Validated @RequestBody TCrmWarehouseDTO dto) { |
| | | return crmWarehouseService.addWarehouse(dto); |
| | | } |
| | | |
| | | /** |
| | | * 修改crm仓库管理 |
| | | */ |
| | | @Log(title = "crm仓库管理信息-修改crm仓库管理", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "修改crm仓库管理") |
| | | @PostMapping(value = "/update") |
| | | public R<Boolean> update(@Validated @RequestBody TCrmWarehouseDTO dto) { |
| | | return crmWarehouseService.updateWarehouse(dto); |
| | | } |
| | | |
| | | /** |
| | | * 查看crm仓库管理详情 |
| | | */ |
| | | @ApiOperation(value = "查看crm仓库管理详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public R<TCrmWarehouseVO> getDetailById(@RequestParam String id) { |
| | | TCrmWarehouse crmSupplier = crmWarehouseService.getById(id); |
| | | TCrmWarehouseVO crmSupplierVO = new TCrmWarehouseVO(); |
| | | BeanUtils.copyProperties(crmSupplier, crmSupplierVO); |
| | | return R.ok(crmSupplierVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除crm仓库管理 |
| | | */ |
| | | @Log(title = "crm仓库管理信息-删除crm仓库管理", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "删除crm仓库管理") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public R<Boolean> deleteById(@RequestParam String id) { |
| | | // 删除账号 |
| | | TCrmWarehouse crmWarehouse = crmWarehouseService.getById(id); |
| | | sysUserService.deleteUserById(crmWarehouse.getUserId()); |
| | | return R.ok(crmWarehouseService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除crm仓库管理 |
| | | */ |
| | | @Log(title = "crm仓库管理信息-删除crm仓库管理", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量删除crm仓库管理") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public R<Boolean> deleteByIds(@RequestBody List<String> ids) { |
| | | // 删除账号 |
| | | List<TCrmWarehouse> crmWarehouseList = crmWarehouseService.list(Wrappers.lambdaQuery(TCrmWarehouse.class).in(TCrmWarehouse::getId, ids)); |
| | | List<Long> userIds = crmWarehouseList.stream().map(TCrmWarehouse::getUserId).collect(Collectors.toList()); |
| | | sysUserService.deleteUserByIds(userIds); |
| | | return R.ok(crmWarehouseService.removeByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除crm仓库管理 |
| | | */ |
| | | @Log(title = "crm仓库管理信息-仓库管理解冻冻结", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "仓库管理解冻冻结",notes = "状态 1=使用中 2=冻结") |
| | | @PutMapping(value = "/thawOrFreeze") |
| | | public R<Boolean> thawOrFreeze(@RequestParam(value = "id")String id, |
| | | @RequestParam(value = "status")Integer status) { |
| | | TCrmWarehouse crmWarehouse = crmWarehouseService.getById(id); |
| | | crmWarehouse.setStatus(status); |
| | | crmWarehouseService.updateById(crmWarehouse); |
| | | // 查询用户 |
| | | SysUser sysUser = sysUserService.selectUserById(crmWarehouse.getUserId()); |
| | | switch (status){ |
| | | case 1: |
| | | // 解冻 |
| | | sysUser.setStatus("0"); |
| | | sysUserService.updateUser(sysUser); |
| | | break; |
| | | case 2: |
| | | // 冻结 |
| | | sysUser.setStatus("1"); |
| | | sysUserService.updateUser(sysUser); |
| | | break; |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |
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 = "crm诊所管理审核DTO") |
| | | public class TCrmClinicAuditDTO implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "id") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "审核结果 3=通过 2=拒绝") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "审核意见") |
| | | private String auditRemark; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.dto; |
| | | |
| | | import com.ruoyi.system.model.TCrmClinic; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value="TCrmClinicDTO对象", description="crm诊所管理") |
| | | public class TCrmClinicDTO extends TCrmClinic { |
| | | |
| | | @ApiModelProperty(value = "密码") |
| | | private String password; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.dto; |
| | | |
| | | import com.ruoyi.system.model.TCrmSupplier; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "crm供应商DTO") |
| | | public class TCrmSupplierDTO extends TCrmSupplier { |
| | | |
| | | @ApiModelProperty(value = "密码") |
| | | private String password; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.dto; |
| | | |
| | | import com.ruoyi.system.model.TCrmWarehouse; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value="TCrmWarehouseDTO对象", description="crm仓库管理") |
| | | public class TCrmWarehouseDTO extends TCrmWarehouse { |
| | | |
| | | @ApiModelProperty(value = "密码") |
| | | private String password; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TCrmClinic; |
| | | import com.ruoyi.system.query.TCrmClinicQuery; |
| | | import com.ruoyi.system.vo.TCrmClinicVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TCrmClinicMapper extends BaseMapper<TCrmClinic> { |
| | | |
| | | /** |
| | | * 分页列表 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TCrmClinicVO> pageList(@Param("query") TCrmClinicQuery query, @Param("pageInfo")PageInfo<TCrmClinicVO> pageInfo); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TCrmSupplier; |
| | | import com.ruoyi.system.query.TCrmSupplierQuery; |
| | | import com.ruoyi.system.vo.TCrmSupplierVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TCrmSupplierMapper extends BaseMapper<TCrmSupplier> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TCrmSupplierVO> pageList(@Param("query") TCrmSupplierQuery query, @Param("pageInfo")PageInfo<TCrmSupplierVO> pageInfo); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TCrmWarehouse; |
| | | import com.ruoyi.system.query.TCrmWarehouseQuery; |
| | | import com.ruoyi.system.vo.TCrmWarehouseVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TCrmWarehouseMapper extends BaseMapper<TCrmWarehouse> { |
| | | |
| | | /** |
| | | * 分页列表 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TCrmWarehouseVO> pageList(@Param("query") TCrmWarehouseQuery query, @Param("pageInfo")PageInfo<TCrmWarehouseVO> pageInfo); |
| | | |
| | | } |
| | |
| | | @TableField("warehouse_id") |
| | | private String warehouseId; |
| | | |
| | | @ApiModelProperty(value = "后台用户id") |
| | | @TableField("user_id") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "诊所名称") |
| | | @TableField("clinic_name") |
| | | private String clinicName; |
| | |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "审核备注") |
| | | @TableField("audit_remark") |
| | | private String auditRemark; |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "后台用户id") |
| | | @TableField("user_id") |
| | | private Integer userId; |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "供应商名称") |
| | | @TableField("supplier_name") |
| | |
| | | |
| | | @ApiModelProperty(value = "后台用户id") |
| | | @TableField("user_id") |
| | | private Integer userId; |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "仓库名称") |
| | | @TableField("warehouse_name") |
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; |
| | | |
| | | @Data |
| | | @ApiModel(value = "crm诊所管理查询参数TCrmClinicQuery") |
| | | public class TCrmClinicQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "诊所名称") |
| | | private String clinicName; |
| | | |
| | | @ApiModelProperty(value = "负责人名称") |
| | | private String personChargeName; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "分公司id") |
| | | private String branchId; |
| | | |
| | | @ApiModelProperty(value = "业务员id") |
| | | private String salespersonId; |
| | | |
| | | @ApiModelProperty(value = "业绩状态 1=已达成 2=未达成") |
| | | private Integer performanceStatus; |
| | | |
| | | @ApiModelProperty(value = "状态 1=待审核 2=已拒绝 3=使用中 4=冻结") |
| | | private Integer status; |
| | | |
| | | } |
New file |
| | |
| | | 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 lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "crm供应商查询参数TCrmSupplierQuery") |
| | | public class TCrmSupplierQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "供应商名称") |
| | | private String supplierName; |
| | | |
| | | @ApiModelProperty(value = "供应商联系人") |
| | | private String supplierContact; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "状态 1=使用中 2=冻结") |
| | | private Integer status; |
| | | |
| | | } |
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; |
| | | |
| | | @Data |
| | | @ApiModel(value = "crm仓库管理查询参数TCrmWarehouseQuery") |
| | | public class TCrmWarehouseQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "仓库名称") |
| | | private String warehouseName; |
| | | |
| | | @ApiModelProperty(value = "联系人") |
| | | private String warehouseContact; |
| | | |
| | | @ApiModelProperty(value = "仓库电话") |
| | | private String warehousePhone; |
| | | |
| | | @ApiModelProperty(value = "状态 1=使用中 2=冻结") |
| | | private Integer status; |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.dto.TCrmClinicDTO; |
| | | import com.ruoyi.system.model.TCrmClinic; |
| | | import com.ruoyi.system.query.TCrmClinicQuery; |
| | | import com.ruoyi.system.vo.TCrmClinicVO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TCrmClinicService extends IService<TCrmClinic> { |
| | | |
| | | /** |
| | | * 获取crm诊所管理分页列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TCrmClinicVO> pageList(TCrmClinicQuery query); |
| | | |
| | | /** |
| | | * 添加crm诊所管理 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | R<Boolean> addClinic(TCrmClinicDTO dto); |
| | | |
| | | /** |
| | | * 修改crm诊所管理 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | R<Boolean> updateClinic(TCrmClinicDTO dto); |
| | | } |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.dto.TCrmSupplierDTO; |
| | | import com.ruoyi.system.model.TCrmSupplier; |
| | | import com.ruoyi.system.query.TCrmSupplierQuery; |
| | | import com.ruoyi.system.vo.TCrmSupplierVO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TCrmSupplierService extends IService<TCrmSupplier> { |
| | | |
| | | /** |
| | | * 获取crm供应商管理分页列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TCrmSupplierVO> pageList(TCrmSupplierQuery query); |
| | | |
| | | /** |
| | | * 添加供应商 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | R<Boolean> addSupplier(TCrmSupplierDTO dto); |
| | | |
| | | /** |
| | | * 编辑供应商 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | R<Boolean> updateSupplier(TCrmSupplierDTO dto); |
| | | } |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.dto.TCrmWarehouseDTO; |
| | | import com.ruoyi.system.model.TCrmWarehouse; |
| | | import com.ruoyi.system.query.TCrmWarehouseQuery; |
| | | import com.ruoyi.system.vo.TCrmWarehouseVO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TCrmWarehouseService extends IService<TCrmWarehouse> { |
| | | |
| | | /** |
| | | * 获取crm仓库管理分页列表 |
| | | * |
| | | * @param query 查询参数 |
| | | * @return PageInfo<TCrmWarehouseVO> |
| | | */ |
| | | PageInfo<TCrmWarehouseVO> pageList(TCrmWarehouseQuery query); |
| | | |
| | | /** |
| | | * 新增crm仓库管理 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | R<Boolean> addWarehouse(TCrmWarehouseDTO dto); |
| | | |
| | | /** |
| | | * 修改crm仓库管理 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | R<Boolean> updateWarehouse(TCrmWarehouseDTO dto); |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.system.dto.TCrmClinicDTO; |
| | | import com.ruoyi.system.mapper.TCrmClinicMapper; |
| | | import com.ruoyi.system.model.TCrmClinic; |
| | | import com.ruoyi.system.query.TCrmClinicQuery; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TCrmClinicService; |
| | | import com.ruoyi.system.vo.TCrmClinicVO; |
| | | import com.ruoyi.system.vo.TCrmSupplierVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TCrmClinicServiceImpl extends ServiceImpl<TCrmClinicMapper, TCrmClinic> implements TCrmClinicService { |
| | | |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | |
| | | @Override |
| | | public PageInfo<TCrmClinicVO> pageList(TCrmClinicQuery query) { |
| | | |
| | | // TODO 业绩状态查询处理 |
| | | |
| | | PageInfo<TCrmClinicVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TCrmClinicVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> addClinic(TCrmClinicDTO dto) { |
| | | // 判断账号是否已存在 |
| | | SysUser sysUser = sysUserService.selectUserByUserName(dto.getPhone()); |
| | | if(Objects.nonNull(sysUser)){ |
| | | return R.fail(dto.getPhone()+"-账号已存在"); |
| | | } |
| | | dto.setStatus(1); |
| | | this.save(dto); |
| | | // 添加账号 |
| | | SysUser user = new SysUser(); |
| | | user.setUserName(dto.getPhone()); |
| | | user.setPhonenumber(dto.getPhone()); |
| | | user.setNickName(dto.getClinicName()); |
| | | user.setPassword(SecurityUtils.encryptPassword(dto.getPassword())); |
| | | user.setStatus("0"); |
| | | user.setDelFlag("2"); |
| | | user.setRoleType(5); |
| | | user.setRoleId(5L); |
| | | sysUserService.insertUser(user); |
| | | dto.setUserId(user.getUserId()); |
| | | this.updateById(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> updateClinic(TCrmClinicDTO dto) { |
| | | // 判断账号是否已存在 |
| | | SysUser sysUser1 = sysUserService.selectUserByUserName(dto.getPhone()); |
| | | if(Objects.nonNull(sysUser1) && !sysUser1.getUserId().equals(dto.getUserId())){ |
| | | return R.fail(dto.getPhone()+"-账号已存在"); |
| | | } |
| | | this.updateById(dto); |
| | | SysUser user = sysUserService.selectUserById(dto.getUserId()); |
| | | if(Objects.nonNull(user)){ |
| | | // 修改账号 |
| | | user.setPhonenumber(dto.getPhone()); |
| | | user.setUserName(dto.getPhone()); |
| | | user.setNickName(dto.getClinicName()); |
| | | user.setPassword(SecurityUtils.encryptPassword(dto.getPassword())); |
| | | sysUserService.updateUser(user); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.system.dto.TCrmSupplierDTO; |
| | | import com.ruoyi.system.mapper.TCrmSupplierMapper; |
| | | import com.ruoyi.system.model.TCrmSupplier; |
| | | import com.ruoyi.system.query.TCrmSupplierQuery; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TCrmSupplierService; |
| | | import com.ruoyi.system.vo.TCrmSupplierVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TCrmSupplierServiceImpl extends ServiceImpl<TCrmSupplierMapper, TCrmSupplier> implements TCrmSupplierService { |
| | | |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | |
| | | @Override |
| | | public PageInfo<TCrmSupplierVO> pageList(TCrmSupplierQuery query) { |
| | | PageInfo<TCrmSupplierVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TCrmSupplierVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> addSupplier(TCrmSupplierDTO dto) { |
| | | // 判断账号是否已存在 |
| | | SysUser sysUser = sysUserService.selectUserByUserName(dto.getAccount()); |
| | | if(Objects.nonNull(sysUser)){ |
| | | return R.fail(dto.getAccount()+"-账号已存在"); |
| | | } |
| | | this.save(dto); |
| | | // 添加账号 |
| | | SysUser user = new SysUser(); |
| | | user.setUserName(dto.getAccount()); |
| | | user.setPhonenumber(dto.getPhone()); |
| | | user.setNickName(dto.getSupplierName()); |
| | | user.setPassword(SecurityUtils.encryptPassword(dto.getPassword())); |
| | | user.setStatus("0"); |
| | | user.setDelFlag("0"); |
| | | user.setRoleType(4); |
| | | user.setRoleId(4L); |
| | | sysUserService.insertUser(user); |
| | | dto.setUserId(user.getUserId()); |
| | | this.updateById(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> updateSupplier(TCrmSupplierDTO dto) { |
| | | // 判断账号是否已存在 |
| | | SysUser sysUser1 = sysUserService.selectUserByUserName(dto.getAccount()); |
| | | if(Objects.nonNull(sysUser1) && !sysUser1.getUserId().equals(dto.getUserId())){ |
| | | return R.fail(dto.getAccount()+"-账号已存在"); |
| | | } |
| | | SysUser user = sysUserService.selectUserById(dto.getUserId()); |
| | | this.updateById(dto); |
| | | if(Objects.nonNull(user)){ |
| | | // 修改账号 |
| | | user.setPhonenumber(dto.getPhone()); |
| | | user.setUserName(dto.getAccount()); |
| | | user.setNickName(dto.getSupplierName()); |
| | | user.setPassword(SecurityUtils.encryptPassword(dto.getPassword())); |
| | | sysUserService.updateUser(user); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.system.dto.TCrmWarehouseDTO; |
| | | import com.ruoyi.system.model.TCrmWarehouse; |
| | | import com.ruoyi.system.mapper.TCrmWarehouseMapper; |
| | | import com.ruoyi.system.query.TCrmWarehouseQuery; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import com.ruoyi.system.service.TCrmWarehouseService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.vo.TCrmSupplierVO; |
| | | import com.ruoyi.system.vo.TCrmWarehouseVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TCrmWarehouseServiceImpl extends ServiceImpl<TCrmWarehouseMapper, TCrmWarehouse> implements TCrmWarehouseService { |
| | | |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | |
| | | @Override |
| | | public PageInfo<TCrmWarehouseVO> pageList(TCrmWarehouseQuery query) { |
| | | PageInfo<TCrmWarehouseVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TCrmWarehouseVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> addWarehouse(TCrmWarehouseDTO dto) { |
| | | // 判断账号是否已存在 |
| | | SysUser sysUser = sysUserService.selectUserByUserName(dto.getAccount()); |
| | | if(Objects.nonNull(sysUser)){ |
| | | return R.fail(dto.getAccount()+"-账号已存在"); |
| | | } |
| | | this.save(dto); |
| | | // 添加账号 |
| | | SysUser user = new SysUser(); |
| | | user.setUserName(dto.getAccount()); |
| | | user.setPhonenumber(dto.getWarehousePhone()); |
| | | user.setNickName(dto.getWarehouseName()); |
| | | user.setPassword(SecurityUtils.encryptPassword(dto.getPassword())); |
| | | user.setStatus("0"); |
| | | user.setDelFlag("0"); |
| | | user.setRoleType(6); |
| | | user.setRoleId(6L); |
| | | sysUserService.insertUser(user); |
| | | dto.setUserId(user.getUserId()); |
| | | this.updateById(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> updateWarehouse(TCrmWarehouseDTO dto) { |
| | | // 判断账号是否已存在 |
| | | SysUser sysUser1 = sysUserService.selectUserByUserName(dto.getAccount()); |
| | | if(Objects.nonNull(sysUser1) && !sysUser1.getUserId().equals(dto.getUserId())){ |
| | | return R.fail(dto.getAccount()+"-账号已存在"); |
| | | } |
| | | SysUser user = sysUserService.selectUserById(dto.getUserId()); |
| | | this.updateById(dto); |
| | | if(Objects.nonNull(user)){ |
| | | // 修改账号 |
| | | user.setPhonenumber(dto.getWarehousePhone()); |
| | | user.setUserName(dto.getAccount()); |
| | | user.setNickName(dto.getWarehouseName()); |
| | | user.setPassword(SecurityUtils.encryptPassword(dto.getPassword())); |
| | | sysUserService.updateUser(user); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.ruoyi.system.model.TCrmClinic; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "crm诊所管理VO") |
| | | public class TCrmClinicVO extends TCrmClinic { |
| | | |
| | | @ApiModelProperty(value = "业务员名称") |
| | | private String salespersonName; |
| | | |
| | | @ApiModelProperty(value = "分公司名称") |
| | | private String branchName; |
| | | |
| | | @ApiModelProperty(value = "仓库名称") |
| | | private String warehouseName; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.ruoyi.system.model.TCrmSupplier; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "TCrmSupplierVO对象", description = "crm供应商VO") |
| | | public class TCrmSupplierVO extends TCrmSupplier { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.ruoyi.system.model.TCrmWarehouse; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value="TCrmWarehouseVO对象", description="crm仓库管理VO") |
| | | public class TCrmWarehouseVO extends TCrmWarehouse { |
| | | } |
| | |
| | | <result column="branch_id" property="branchId" /> |
| | | <result column="salesperson_id" property="salespersonId" /> |
| | | <result column="warehouse_id" property="warehouseId" /> |
| | | <result column="user_id" property="userId" /> |
| | | <result column="clinic_name" property="clinicName" /> |
| | | <result column="person_charge_name" property="personChargeName" /> |
| | | <result column="phone" property="phone" /> |
| | |
| | | <result column="clinic_address" property="clinicAddress" /> |
| | | <result column="qualification_picture" property="qualificationPicture" /> |
| | | <result column="status" property="status" /> |
| | | <result column="audit_remark" property="auditRemark" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_by" property="createBy" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, branch_id, salesperson_id, warehouse_id, clinic_name, person_charge_name, phone, low_procurement_money, clinic_address, qualification_picture, status, create_time, update_time, create_by, update_by, disabled |
| | | id, branch_id, salesperson_id, warehouse_id,user_id, clinic_name, person_charge_name, phone, low_procurement_money, |
| | | clinic_address, qualification_picture, status,audit_remark, create_time, update_time, create_by, update_by, disabled |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.TCrmClinicVO"> |
| | | SELECT |
| | | tcc.id, tcc.branch_id, tcc.salesperson_id, tcc.warehouse_id,tcc.user_id, tcc.clinic_name, tcc.person_charge_name, |
| | | tcc.phone, tcc.low_procurement_money, tcc.clinic_address, tcc.qualification_picture, tcc.status,tcc.audit_remark, |
| | | tcc.create_time, tcc.update_time, tcc.create_by, tcc.update_by, tcc.disabled, |
| | | tcb.branch_name, tcs.salesperson_name, tcw.warehouse_name |
| | | from t_crm_clinic tcc |
| | | left join t_crm_branch tcb on tcc.branch_id = tcb.id |
| | | left join t_crm_salesperson tcs on tcc.salesperson_id = tcs.id |
| | | left join t_crm_warehouse tcw on tcc.warehouse_id = tcw.id |
| | | <where> |
| | | <if test="query.clinicName != null and query.clinicName != ''"> |
| | | and tcc.clinic_name like concat('%',#{query.clinicName},'%') |
| | | </if> |
| | | <if test="query.personChargeName != null and query.personChargeName != ''"> |
| | | and tcc.person_charge_name like concat('%',#{query.personChargeName},'%') |
| | | </if> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and tcc.phone like concat('%',#{query.phone},'%') |
| | | </if> |
| | | <if test="query.branchId != null and query.branchId != ''"> |
| | | and tcc.branch_id = #{query.branchId} |
| | | </if> |
| | | <if test="query.salespersonId != null and query.salespersonId != ''"> |
| | | and tcc.salesperson_id = #{query.salespersonId} |
| | | </if> |
| | | <!-- <if test="query.performanceStatus != null">--> |
| | | <!-- and tcc.salesperson_id = #{query.performanceStatus}--> |
| | | <!-- </if>--> |
| | | <if test="query.status != null"> |
| | | and tcc.status = #{query.status} |
| | | </if> |
| | | AND tcc.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY tcc.create_time DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, user_id, supplier_name, is_add_points_goods, supplier_contact, phone, account, remarks, qualification_picture, status, create_time, update_time, create_by, update_by, disabled |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.TCrmSupplierVO"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from t_crm_supplier |
| | | <where> |
| | | <if test="query.supplierName != null and query.supplierName != ''"> |
| | | and supplier_name like concat('%',#{query.supplierName},'%') |
| | | </if> |
| | | <if test="query.supplierContact != null and query.supplierContact != ''"> |
| | | and supplier_contact like concat('%',#{query.supplierContact},'%') |
| | | </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> |
| | | AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY create_time DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, user_id, warehouse_name, warehouse_address, warehouse_contact, warehouse_phone, account, remarks, status, create_time, update_time, create_by, update_by, disabled |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.TCrmWarehouseVO"> |
| | | SELECT |
| | | <include refid="Base_Column_List"/> |
| | | FROM t_crm_warehouse |
| | | <where> |
| | | <if test="query.warehouseName != null and query.warehouseName != ''"> |
| | | AND warehouse_name LIKE concat('%',#{query.warehouseName},'%') |
| | | </if> |
| | | <if test="query.warehouseContact != null and query.warehouseContact != ''"> |
| | | AND warehouse_contact LIKE concat('%',#{query.warehouseContact},'%') |
| | | </if> |
| | | <if test="query.warehousePhone != null and query.warehousePhone != ''"> |
| | | AND warehouse_phone LIKE concat('%',#{query.warehousePhone},'%') |
| | | </if> |
| | | <if test="query.status != null"> |
| | | AND status = #{query.status} |
| | | </if> |
| | | AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY create_time DESC |
| | | </select> |
| | | |
| | | </mapper> |