Merge branch 'master' of http://122.51.230.86:3000/dianliang/lanan-system
This commit is contained in:
commit
c65ea8d58f
@ -1,16 +1,24 @@
|
||||
package cn.iocoder.yudao.module.company.controller.admin;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.common.CommonErrorCodeConstants;
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.company.entity.Company;
|
||||
import cn.iocoder.yudao.module.company.vo.CompanyRespVO;
|
||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import cn.iocoder.yudao.module.company.vo.CompanyReqVO;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@ -20,11 +28,13 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import cn.iocoder.yudao.module.company.service.CompanyService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
@ -43,6 +53,15 @@ import java.util.Map;
|
||||
@Tag(name = "管理后台 - BASE 企业管理")
|
||||
@Validated
|
||||
public class CompanyController {
|
||||
|
||||
@Resource
|
||||
@Lazy
|
||||
private DeptApi deptApi;
|
||||
|
||||
@Resource
|
||||
@Lazy
|
||||
private AdminUserApi adminUserApi;
|
||||
|
||||
@Autowired
|
||||
private CompanyService companyService;
|
||||
|
||||
@ -160,4 +179,22 @@ public class CompanyController {
|
||||
public CommonResult<List<Company>> getCompanyList(){
|
||||
return success(companyService.list());
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前登录用户的门店信息
|
||||
*
|
||||
* @author 小李
|
||||
* @date 15:41 2024/9/18
|
||||
**/
|
||||
@GetMapping("/now")
|
||||
@Operation(summary = "企业信息表 当前登录用户的")
|
||||
public CommonResult<?> getNowCompany(){
|
||||
Long deptId = SecurityFrameworkUtils.getLoginUserDeptId();
|
||||
DeptRespDTO dept = deptApi.getDept(deptId);
|
||||
// 这里可能出现查不到的情况,直接抛个系统错误先,不能影响后续操作
|
||||
if (ObjectUtil.isEmpty(dept)){
|
||||
throw exception(CommonErrorCodeConstants.SYSTEM_ERROR);
|
||||
}
|
||||
return success(companyService.getById(dept.getCorpId()));
|
||||
}
|
||||
}
|
@ -1,12 +1,19 @@
|
||||
package cn.iocoder.yudao.module.stockTransfer.controller.admin;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.stockTransfer.entity.DlRepairSt;
|
||||
import cn.iocoder.yudao.module.stockTransfer.service.DlRepairStService;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import cn.iocoder.yudao.module.stockTransfer.vo.DlRepairStReqVO;
|
||||
import cn.iocoder.yudao.module.stockTransfer.vo.DlRepairStRespVO;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 调拨单(DlRepairSt)表控制层
|
||||
* @author 小李
|
||||
@ -21,60 +28,36 @@ public class DlRepairStController{
|
||||
@Resource
|
||||
private DlRepairStService dlRepairStService;
|
||||
|
||||
// /**
|
||||
// * 分页查询所有数据
|
||||
// *
|
||||
// * @param page 分页对象
|
||||
// * @param dlRepairSt 查询实体
|
||||
// * @return 所有数据
|
||||
// */
|
||||
// @GetMapping
|
||||
// public R selectAll(Page<DlRepairSt> page, DlRepairSt dlRepairSt) {
|
||||
// return success(this.dlRepairStService.page(page, new QueryWrapper<>(dlRepairSt)));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 通过主键查询单条数据
|
||||
// *
|
||||
// * @param id 主键
|
||||
// * @return 单条数据
|
||||
// */
|
||||
// @GetMapping("{id}")
|
||||
// public R selectOne(@PathVariable Serializable id) {
|
||||
// return success(this.dlRepairStService.getById(id));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 新增数据
|
||||
// *
|
||||
// * @param dlRepairSt 实体对象
|
||||
// * @return 新增结果
|
||||
// */
|
||||
// @PostMapping
|
||||
// public R insert(@RequestBody DlRepairSt dlRepairSt) {
|
||||
// return success(this.dlRepairStService.save(dlRepairSt));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 修改数据
|
||||
// *
|
||||
// * @param dlRepairSt 实体对象
|
||||
// * @return 修改结果
|
||||
// */
|
||||
// @PutMapping
|
||||
// public R update(@RequestBody DlRepairSt dlRepairSt) {
|
||||
// return success(this.dlRepairStService.updateById(dlRepairSt));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 删除数据
|
||||
// *
|
||||
// * @param idList 主键结合
|
||||
// * @return 删除结果
|
||||
// */
|
||||
// @DeleteMapping
|
||||
// public R delete(@RequestParam("idList") List<Long> idList) {
|
||||
// return success(this.dlRepairStService.removeByIds(idList));
|
||||
// }
|
||||
/**
|
||||
* 调拨单 新增
|
||||
*
|
||||
* @author 小李
|
||||
* @date 19:06 2024/9/18
|
||||
* @param repairStRespVO 新增对象
|
||||
**/
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "调拨单 新增")
|
||||
public CommonResult<?> createSt(@RequestBody DlRepairStRespVO repairStRespVO){
|
||||
dlRepairStService.createSt(repairStRespVO);
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 调拨单(出库、入库) 分页
|
||||
*
|
||||
* @author 小李
|
||||
* @date 9:20 2024/9/19
|
||||
* @param repairStReqVO 查询对象
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 条数
|
||||
**/
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "调拨单(出库、入库) 分页")
|
||||
public CommonResult<?> getStPage(DlRepairStReqVO repairStReqVO,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize){
|
||||
Page<DlRepairSt> page = new Page<>(pageNo, pageSize);
|
||||
return success(dlRepairStService.getStPage(repairStReqVO, page));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,12 +1,21 @@
|
||||
package cn.iocoder.yudao.module.stockTransfer.controller.admin;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.stockTransfer.entity.DlRepairSti;
|
||||
import cn.iocoder.yudao.module.stockTransfer.service.DlRepairStiService;
|
||||
import cn.iocoder.yudao.module.stockTransfer.vo.DlRepairStiReqVO;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 调拨单子表(DlRepairSti)表控制层
|
||||
* @author 小李
|
||||
@ -21,60 +30,22 @@ public class DlRepairStiController{
|
||||
@Resource
|
||||
private DlRepairStiService dlRepairStiService;
|
||||
|
||||
// /**
|
||||
// * 分页查询所有数据
|
||||
// *
|
||||
// * @param page 分页对象
|
||||
// * @param dlRepairSti 查询实体
|
||||
// * @return 所有数据
|
||||
// */
|
||||
// @GetMapping
|
||||
// public R selectAll(Page<DlRepairSti> page, DlRepairSti dlRepairSti) {
|
||||
// return success(this.dlRepairStiService.page(page, new QueryWrapper<>(dlRepairSti)));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 通过主键查询单条数据
|
||||
// *
|
||||
// * @param id 主键
|
||||
// * @return 单条数据
|
||||
// */
|
||||
// @GetMapping("{id}")
|
||||
// public R selectOne(@PathVariable Serializable id) {
|
||||
// return success(this.dlRepairStiService.getById(id));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 新增数据
|
||||
// *
|
||||
// * @param dlRepairSti 实体对象
|
||||
// * @return 新增结果
|
||||
// */
|
||||
// @PostMapping
|
||||
// public R insert(@RequestBody DlRepairSti dlRepairSti) {
|
||||
// return success(this.dlRepairStiService.save(dlRepairSti));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 修改数据
|
||||
// *
|
||||
// * @param dlRepairSti 实体对象
|
||||
// * @return 修改结果
|
||||
// */
|
||||
// @PutMapping
|
||||
// public R update(@RequestBody DlRepairSti dlRepairSti) {
|
||||
// return success(this.dlRepairStiService.updateById(dlRepairSti));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 删除数据
|
||||
// *
|
||||
// * @param idList 主键结合
|
||||
// * @return 删除结果
|
||||
// */
|
||||
// @DeleteMapping
|
||||
// public R delete(@RequestParam("idList") List<Long> idList) {
|
||||
// return success(this.dlRepairStiService.removeByIds(idList));
|
||||
// }
|
||||
/**
|
||||
* 调拨单子表 分页
|
||||
*
|
||||
* @author 小李
|
||||
* @date 14:48 2024/9/19
|
||||
* @param repairStiReqVO 查询对象
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 条数
|
||||
**/
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "调拨单子表 分页")
|
||||
public CommonResult<?> getStiPage(DlRepairStiReqVO repairStiReqVO,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1")Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize){
|
||||
Page<DlRepairSti> page = new Page<>(pageNo, pageSize);
|
||||
return success(dlRepairStiService.getStiPage(repairStiReqVO, page));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,8 +5,10 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
@ -85,10 +87,17 @@ public class DlRepairSt extends TenantBaseDO {
|
||||
/**
|
||||
* 调拔时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date stTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 部门ID(system_dept表的ID)
|
||||
*/
|
||||
private Long deptId;
|
||||
}
|
@ -48,9 +48,4 @@ public class DlRepairSti extends TenantBaseDO {
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 部门ID(system_dept表的ID)
|
||||
*/
|
||||
private Long deptId;
|
||||
}
|
@ -1,8 +1,12 @@
|
||||
package cn.iocoder.yudao.module.stockTransfer.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.stockTransfer.entity.DlRepairSt;
|
||||
import cn.iocoder.yudao.module.stockTransfer.vo.DlRepairStReqVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 针对表【dl_repair_st(调拨单)】的数据库操作Mapper
|
||||
@ -13,6 +17,14 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface DlRepairStMapper extends BaseMapper<DlRepairSt> {
|
||||
|
||||
/**
|
||||
* 调拨单(出库、入库) 分页
|
||||
*
|
||||
* @author 小李
|
||||
* @date 9:20 2024/9/19
|
||||
* @param repairStReqVO 查询对象
|
||||
**/
|
||||
IPage<DlRepairSt> getStPage(@Param("map") DlRepairStReqVO repairStReqVO, Page<DlRepairSt> page);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,8 +1,12 @@
|
||||
package cn.iocoder.yudao.module.stockTransfer.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.stockTransfer.entity.DlRepairSti;
|
||||
import cn.iocoder.yudao.module.stockTransfer.vo.DlRepairStiReqVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 针对表【dl_repair_sti(调拨单子表)】的数据库操作Mapper
|
||||
@ -13,6 +17,14 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface DlRepairStiMapper extends BaseMapper<DlRepairSti> {
|
||||
|
||||
/**
|
||||
* 调拨单子表 分页
|
||||
*
|
||||
* @author 小李
|
||||
* @date 14:48 2024/9/19
|
||||
* @param repairStiReqVO 查询对象
|
||||
**/
|
||||
IPage<DlRepairSti> getStiPage(@Param("map") DlRepairStiReqVO repairStiReqVO, Page<DlRepairSti> page);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,6 +1,10 @@
|
||||
package cn.iocoder.yudao.module.stockTransfer.service;
|
||||
|
||||
import cn.iocoder.yudao.module.stockTransfer.entity.DlRepairSt;
|
||||
import cn.iocoder.yudao.module.stockTransfer.vo.DlRepairStReqVO;
|
||||
import cn.iocoder.yudao.module.stockTransfer.vo.DlRepairStRespVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
@ -11,4 +15,21 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
**/
|
||||
public interface DlRepairStService extends IService<DlRepairSt> {
|
||||
|
||||
/**
|
||||
* 调拨单 新增
|
||||
*
|
||||
* @author 小李
|
||||
* @date 19:06 2024/9/18
|
||||
* @param repairStRespVO 新增对象
|
||||
**/
|
||||
void createSt(DlRepairStRespVO repairStRespVO);
|
||||
|
||||
/**
|
||||
* 调拨单(出库、入库) 分页
|
||||
*
|
||||
* @author 小李
|
||||
* @date 9:20 2024/9/19
|
||||
* @param repairStReqVO 查询对象
|
||||
**/
|
||||
IPage<DlRepairSt> getStPage(DlRepairStReqVO repairStReqVO, Page<DlRepairSt> page);
|
||||
}
|
||||
|
@ -1,6 +1,9 @@
|
||||
package cn.iocoder.yudao.module.stockTransfer.service;
|
||||
|
||||
import cn.iocoder.yudao.module.stockTransfer.entity.DlRepairSti;
|
||||
import cn.iocoder.yudao.module.stockTransfer.vo.DlRepairStiReqVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
@ -10,4 +13,12 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
**/
|
||||
public interface DlRepairStiService extends IService<DlRepairSti> {
|
||||
|
||||
/**
|
||||
* 调拨单子表 分页
|
||||
*
|
||||
* @author 小李
|
||||
* @date 14:48 2024/9/19
|
||||
* @param repairStiReqVO 查询对象
|
||||
**/
|
||||
IPage<DlRepairSti> getStiPage(DlRepairStiReqVO repairStiReqVO, Page<DlRepairSti> page);
|
||||
}
|
||||
|
@ -1,11 +1,24 @@
|
||||
package cn.iocoder.yudao.module.stockTransfer.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.iocoder.yudao.common.RepairErrorCodeConstants;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.stockTransfer.entity.DlRepairSt;
|
||||
import cn.iocoder.yudao.module.stockTransfer.service.DlRepairStiService;
|
||||
import cn.iocoder.yudao.module.stockTransfer.vo.DlRepairStReqVO;
|
||||
import cn.iocoder.yudao.module.stockTransfer.vo.DlRepairStRespVO;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import cn.iocoder.yudao.module.stockTransfer.service.DlRepairStService;
|
||||
import cn.iocoder.yudao.module.stockTransfer.mapper.DlRepairStMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
* 针对表【dl_repair_st(调拨单)】的数据库操作Service实现
|
||||
*
|
||||
@ -16,6 +29,43 @@ import org.springframework.stereotype.Service;
|
||||
public class DlRepairStServiceImpl extends ServiceImpl<DlRepairStMapper, DlRepairSt>
|
||||
implements DlRepairStService {
|
||||
|
||||
@Resource
|
||||
private DlRepairStiService repairStiService;
|
||||
|
||||
/**
|
||||
* 调拨单 新增
|
||||
*
|
||||
* @param repairStRespVO 新增对象
|
||||
* @author 小李
|
||||
* @date 19:06 2024/9/18
|
||||
**/
|
||||
@Override
|
||||
@DSTransactional
|
||||
public void createSt(DlRepairStRespVO repairStRespVO) {
|
||||
// 获取当前登录用户的部门ID
|
||||
Long deptId = SecurityFrameworkUtils.getLoginUserDeptId();
|
||||
repairStRespVO.setDeptId(deptId);
|
||||
// 新增调拨单
|
||||
baseMapper.insert(repairStRespVO);
|
||||
// 新增调拨单子表
|
||||
if (CollectionUtil.isEmpty(repairStRespVO.getGoodsList())) {
|
||||
throw exception(RepairErrorCodeConstants.GOODS_IS_EMPTY);
|
||||
}
|
||||
repairStRespVO.getGoodsList().forEach(item -> item.setStId(repairStRespVO.getId()));
|
||||
repairStiService.saveBatch(repairStRespVO.getGoodsList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 调拨单(出库、入库) 分页
|
||||
*
|
||||
* @author 小李
|
||||
* @date 9:20 2024/9/19
|
||||
* @param repairStReqVO 查询对象
|
||||
**/
|
||||
@Override
|
||||
public IPage<DlRepairSt> getStPage(DlRepairStReqVO repairStReqVO, Page<DlRepairSt> page){
|
||||
return baseMapper.getStPage(repairStReqVO, page);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -3,6 +3,9 @@ package cn.iocoder.yudao.module.stockTransfer.service.impl;
|
||||
import cn.iocoder.yudao.module.stockTransfer.entity.DlRepairSti;
|
||||
import cn.iocoder.yudao.module.stockTransfer.mapper.DlRepairStiMapper;
|
||||
import cn.iocoder.yudao.module.stockTransfer.service.DlRepairStiService;
|
||||
import cn.iocoder.yudao.module.stockTransfer.vo.DlRepairStiReqVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -16,6 +19,18 @@ import org.springframework.stereotype.Service;
|
||||
public class DlRepairStiServiceImpl extends ServiceImpl<DlRepairStiMapper, DlRepairSti>
|
||||
implements DlRepairStiService {
|
||||
|
||||
/**
|
||||
* 调拨单子表 分页
|
||||
*
|
||||
* @author 小李
|
||||
* @date 14:48 2024/9/19
|
||||
* @param repairStiReqVO 查询对象
|
||||
**/
|
||||
@Override
|
||||
public IPage<DlRepairSti> getStiPage(DlRepairStiReqVO repairStiReqVO, Page<DlRepairSti> page){
|
||||
return baseMapper.getStiPage(repairStiReqVO, page);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,8 +1,11 @@
|
||||
package cn.iocoder.yudao.module.stockTransfer.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.stockTransfer.entity.DlRepairSt;
|
||||
import cn.iocoder.yudao.module.stockTransfer.entity.DlRepairSti;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 调拨单 响应VO
|
||||
* @author 小李
|
||||
@ -10,4 +13,7 @@ import lombok.Data;
|
||||
**/
|
||||
@Data
|
||||
public class DlRepairStRespVO extends DlRepairSt {
|
||||
|
||||
// 商品列表
|
||||
private List<DlRepairSti> goodsList;
|
||||
}
|
||||
|
@ -5,20 +5,21 @@
|
||||
<mapper namespace="cn.iocoder.yudao.module.stockTransfer.mapper.DlRepairStMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="cn.iocoder.yudao.module.stockTransfer.entity.DlRepairSt">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="outCorpId" column="out_corp_id" jdbcType="VARCHAR"/>
|
||||
<result property="inCorpId" column="in_corp_id" jdbcType="VARCHAR"/>
|
||||
<result property="stNo" column="st_no" jdbcType="VARCHAR"/>
|
||||
<result property="userId" column="user_id" jdbcType="BIGINT"/>
|
||||
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
|
||||
<result property="itemCount" column="item_count" jdbcType="INTEGER"/>
|
||||
<result property="totalPrice" column="total_price" jdbcType="DECIMAL"/>
|
||||
<result property="discountPrice" column="discount_price" jdbcType="DECIMAL"/>
|
||||
<result property="thisCollection" column="this_collection" jdbcType="DECIMAL"/>
|
||||
<result property="thisDebt" column="this_debt" jdbcType="DECIMAL"/>
|
||||
<result property="stStatus" column="st_status" jdbcType="VARCHAR"/>
|
||||
<result property="stTime" column="st_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="outCorpId" column="out_corp_id" jdbcType="VARCHAR"/>
|
||||
<result property="inCorpId" column="in_corp_id" jdbcType="VARCHAR"/>
|
||||
<result property="stNo" column="st_no" jdbcType="VARCHAR"/>
|
||||
<result property="userId" column="user_id" jdbcType="BIGINT"/>
|
||||
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
|
||||
<result property="itemCount" column="item_count" jdbcType="INTEGER"/>
|
||||
<result property="totalPrice" column="total_price" jdbcType="DECIMAL"/>
|
||||
<result property="discountPrice" column="discount_price" jdbcType="DECIMAL"/>
|
||||
<result property="thisCollection" column="this_collection" jdbcType="DECIMAL"/>
|
||||
<result property="thisDebt" column="this_debt" jdbcType="DECIMAL"/>
|
||||
<result property="stStatus" column="st_status" jdbcType="VARCHAR"/>
|
||||
<result property="stTime" column="st_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
<result property="deptId" column="dept_id" jdbcType="BIGINT"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_SQL">
|
||||
@ -35,8 +36,19 @@
|
||||
this_debt,
|
||||
st_status,
|
||||
st_time,
|
||||
remark
|
||||
remark,
|
||||
dept_id
|
||||
from dl_repair_st st
|
||||
where st.deleted = '0'
|
||||
</sql>
|
||||
|
||||
<select id="getStPage" resultMap="BaseResultMap">
|
||||
<include refid="Base_SQL" />
|
||||
<if test="map.outCorpId != null and map.outCorpId != ''">
|
||||
and st.out_corp_id = #{map.outCorpId}
|
||||
</if>
|
||||
<if test="map.inCorpId != null and map.inCorpId != ''">
|
||||
and st.in_corp_id = #{map.inCorpId}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -11,7 +11,6 @@
|
||||
<result property="goodsCount" column="goods_count" jdbcType="INTEGER"/>
|
||||
<result property="goodsPrice" column="goods_price" jdbcType="DECIMAL"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
<result property="deptId" column="dept_id" jdbcType="BIGINT"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_SQL">
|
||||
@ -20,9 +19,12 @@
|
||||
goods_id,
|
||||
goods_count,
|
||||
goods_price,
|
||||
remark,
|
||||
dept_id
|
||||
remark
|
||||
from dl_repair_sti sti
|
||||
where sti.deleted = '0'
|
||||
</sql>
|
||||
|
||||
<select id="getStiPage" resultMap="BaseResultMap">
|
||||
<include refid="Base_SQL" />
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -26,10 +26,16 @@
|
||||
<artifactId>yudao-module-system-biz</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>dl-module-inspection</artifactId>
|
||||
<version>2.1.0-jdk8-snapshot</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
@ -15,6 +15,13 @@ import cn.iocoder.yudao.module.rescue.domain.LoginBody;
|
||||
import cn.iocoder.yudao.module.rescue.domain.WxLoginBody;
|
||||
import cn.iocoder.yudao.module.rescue.service.IDriverInfoService;
|
||||
import cn.iocoder.yudao.module.rescue.utils.RescueSysLoginService;
|
||||
import cn.iocoder.yudao.module.rescue.utils.SendSmsUtil;
|
||||
import cn.iocoder.yudao.module.rescue.vo.RegisterVO;
|
||||
import cn.iocoder.yudao.module.shop.entity.ShopConfig;
|
||||
import cn.iocoder.yudao.module.shop.entity.UserBalance;
|
||||
import cn.iocoder.yudao.module.shop.service.IShopConfigService;
|
||||
import cn.iocoder.yudao.module.shop.service.IUserBalanceService;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSaveReqVO;
|
||||
import cn.iocoder.yudao.util.WechatPayConfig;
|
||||
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
|
||||
import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
|
||||
@ -34,6 +41,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
@ -45,12 +53,13 @@ import javax.crypto.spec.SecretKeySpec;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.security.spec.AlgorithmParameterSpec;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.*;
|
||||
import static cn.iocoder.yudao.module.rescue.utils.RescueSysLoginService.generateVerificationCode;
|
||||
|
||||
/**
|
||||
* 登录验证
|
||||
@ -72,7 +81,8 @@ public class SysLoginController {
|
||||
|
||||
@Resource
|
||||
private PermissionApi permissionApi;
|
||||
|
||||
@Resource
|
||||
private PasswordEncoder passwordEncoder;
|
||||
|
||||
@Resource
|
||||
private RoleApi roleApi;
|
||||
@ -98,14 +108,14 @@ public class SysLoginController {
|
||||
@Resource
|
||||
private SecurityProperties securityProperties;
|
||||
|
||||
// @Autowired
|
||||
// private IUserBalanceService balanceService;
|
||||
@Resource
|
||||
private IUserBalanceService balanceService;
|
||||
// @Autowired
|
||||
// private IShopMallPartnersService partnersService;
|
||||
// @Autowired
|
||||
// private IPartnerWorkerService jcWorkerService;
|
||||
// @Autowired
|
||||
// private IShopConfigService configService;
|
||||
@Resource
|
||||
private IShopConfigService configService;
|
||||
@Resource
|
||||
private IDriverInfoService driverInfoService;
|
||||
// @Autowired
|
||||
@ -185,6 +195,73 @@ public class SysLoginController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 汽修小程序登录方法
|
||||
*
|
||||
* @param loginBody 登录信息
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/loginQx")
|
||||
@TenantIgnore
|
||||
public CommonResult loginQx(@RequestBody LoginBody loginBody) throws Exception {
|
||||
String userName = loginBody.getUsername();
|
||||
AdminUserDO user = userService.getUserByUsername(userName);
|
||||
if (ObjectUtil.isEmpty(user)) {
|
||||
return error(CommonErrorCodeConstants.LOGIN_ACCOUNT_NOT_EXIST);
|
||||
}
|
||||
AuthLoginReqVO authLoginReqVO = new AuthLoginReqVO();
|
||||
authLoginReqVO.setUsername(loginBody.getUsername());
|
||||
authLoginReqVO.setPassword(loginBody.getPassword());
|
||||
return success(loginService.login(authLoginReqVO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送验证码
|
||||
* @param phone
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/sendSmsQx")
|
||||
@TenantIgnore
|
||||
public CommonResult sendSmsQx(@RequestParam("phone") String phone) {
|
||||
String msgCode = generateVerificationCode();
|
||||
redisCache2.setCacheObject(phone+"-registerCode",msgCode,300, TimeUnit.SECONDS);
|
||||
SendSmsUtil.sendMsg(msgCode,phone,"1400852709","机动车管家小程序","1917285");
|
||||
return ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 汽修小程序注册方法
|
||||
*
|
||||
* @param registerVO 登录信息
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/registerQx")
|
||||
@TenantIgnore
|
||||
public CommonResult registerQx(@RequestBody RegisterVO registerVO){
|
||||
if(org.apache.commons.lang3.StringUtils.isEmpty(registerVO.getPhone())){
|
||||
return error(500,"手机号不能为空");
|
||||
}
|
||||
if(org.apache.commons.lang3.StringUtils.isEmpty(registerVO.getPassword())){
|
||||
return error(500,"密码不能为空");
|
||||
}
|
||||
if(org.apache.commons.lang3.StringUtils.isEmpty(registerVO.getCode())){
|
||||
return error(500,"验证码不能为空");
|
||||
}
|
||||
Object registerCode = redisCache2.getCacheObject(registerVO.getPhone() + "-registerCode");
|
||||
if(null==registerCode || !registerCode.equals(registerVO.getCode())){
|
||||
return error(500,"验证码错误");
|
||||
}
|
||||
redisCache2.deleteObject(registerVO.getPhone() + "-registerCode");
|
||||
|
||||
UserSaveReqVO userSaveReqVO = new UserSaveReqVO();
|
||||
userSaveReqVO.setUsername(registerVO.getPhone());
|
||||
userSaveReqVO.setPassword(passwordEncoder.encode(registerVO.getPassword()));
|
||||
userSaveReqVO.setMobile(registerVO.getPhone());
|
||||
userService.createUser(userSaveReqVO);
|
||||
return success("注册成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 司机登录方法
|
||||
*
|
||||
@ -333,33 +410,61 @@ public class SysLoginController {
|
||||
AdminUserDO user = userService.getUser(loginUser.getId());
|
||||
List<Long> roleIdsByUserId = permissionApi.getRoleIdsByUserId(user.getId());
|
||||
List<RoleDO> roleList = roleService.getRoleList(roleIdsByUserId);
|
||||
// 角色集合
|
||||
// Set<String> roles = roleList.stream().map(RoleDO::getCode).collect(Collectors.toSet());
|
||||
// UserBalance userBalance = balanceService.selectShopUserBalanceByUserId(NamedObject.user.getUserId());
|
||||
// if (ObjectUtil.isNotEmpty(userBalance)) {
|
||||
// sysUser.setBalance(userBalance.getBalance());
|
||||
// } else {
|
||||
// //新增用户积分表信息
|
||||
// userBalance=new UserBalance();
|
||||
// userBalance.setUserId(NamedObject.user.getUserId());
|
||||
// userBalance.setAllBalance(0L);
|
||||
// userBalance.setBalance(0L);
|
||||
// userBalance.setFrozenBalance(0L);
|
||||
// balanceService.insertShopUserBalance(userBalance);
|
||||
// sysUser.setBalance(0L);
|
||||
// }
|
||||
Map<String,Object> ajax = new HashMap<>();
|
||||
ajax.put("user", user);
|
||||
ajax.put("role", roleList);
|
||||
// ShopConfig shopConfig = configService.selectShopConfigById(1L);
|
||||
// if (StringUtils.isEmpty(shopConfig.getOpenRz())||shopConfig.getOpenRz().equals("0")){
|
||||
// ajax.put("openRz", "0");
|
||||
// }else {
|
||||
ShopConfig shopConfig = configService.selectShopConfigById(1L);
|
||||
if (StringUtils.isEmpty(shopConfig.getOpenRz())||shopConfig.getOpenRz().equals("0")){
|
||||
ajax.put("openRz", "0");
|
||||
// }
|
||||
}else {
|
||||
ajax.put("openRz", "0");
|
||||
}
|
||||
return CommonResult.success(ajax);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取App用户信息
|
||||
*
|
||||
* @return 用户信息
|
||||
*/
|
||||
@GetMapping("/getJcAppInfo")
|
||||
@TenantIgnore
|
||||
public CommonResult getJcAppInfo()
|
||||
{
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
AdminUserDO user = userService.getUser(loginUser.getId());
|
||||
List<Long> roleIdsByUserId = permissionApi.getRoleIdsByUserId(user.getId());
|
||||
List<RoleDO> roleList = roleService.getRoleList(roleIdsByUserId);
|
||||
// 角色集合
|
||||
UserSaveReqVO userSaveReqVO = new UserSaveReqVO();
|
||||
UserBalance userBalance = balanceService.selectShopUserBalanceByUserId(loginUser.getId());
|
||||
if (ObjectUtil.isNotEmpty(userBalance)) {
|
||||
userSaveReqVO.setBalance(userBalance.getBalance());
|
||||
} else {
|
||||
//新增用户积分表信息
|
||||
userBalance=new UserBalance();
|
||||
userBalance.setUserId(loginUser.getId());
|
||||
userBalance.setAllBalance(0L);
|
||||
userBalance.setBalance(0L);
|
||||
userBalance.setFrozenBalance(0L);
|
||||
balanceService.insertShopUserBalance(userBalance);
|
||||
userSaveReqVO.setBalance(0L);
|
||||
}
|
||||
userService.updateUser(userSaveReqVO);
|
||||
Map<String,Object> ajax = new HashMap<>();
|
||||
ajax.put("user", user);
|
||||
ajax.put("role", roleList);
|
||||
ShopConfig shopConfig = configService.selectShopConfigById(1L);
|
||||
if (StringUtils.isEmpty(shopConfig.getOpenRz())||shopConfig.getOpenRz().equals("0")){
|
||||
ajax.put("openRz", "0");
|
||||
}else {
|
||||
ajax.put("openRz", "0");
|
||||
}
|
||||
return CommonResult.success(ajax);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取App用户信息
|
||||
*
|
||||
|
@ -0,0 +1,10 @@
|
||||
package cn.iocoder.yudao.module.rescue.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RegisterVO {
|
||||
private String phone;
|
||||
private String password;
|
||||
private String code;
|
||||
}
|
@ -54,6 +54,17 @@ public class TenantController {
|
||||
return success(tenant != null ? tenant.getId() : null);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getListByWebsite")
|
||||
@PermitAll
|
||||
@Operation(summary = "使用域名,获得租户信息", description = "登录界面,根据用户的域名,获得租户信息")
|
||||
@Parameter(name = "website", description = "域名", required = true, example = "www.iocoder.cn")
|
||||
public CommonResult<?> getListByWebsite(@RequestParam("website") String website) {
|
||||
List<TenantDO> tenants = tenantService.getListByWebsite(website);
|
||||
return success(tenants);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建租户")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant:create')")
|
||||
|
@ -101,4 +101,6 @@ public class UserSaveReqVO {
|
||||
|
||||
private Long tenantId;
|
||||
|
||||
private Long balance;
|
||||
|
||||
}
|
||||
|
@ -135,4 +135,5 @@ public interface TenantService {
|
||||
*/
|
||||
void validTenant(Long id);
|
||||
|
||||
List<TenantDO> getListByWebsite(String website);
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ import cn.iocoder.yudao.module.system.service.tenant.handler.TenantMenuHandler;
|
||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
@ -106,6 +107,13 @@ public class TenantServiceImpl implements TenantService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TenantDO> getListByWebsite(String website) {
|
||||
QueryWrapper<TenantDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("website", website);
|
||||
return tenantMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DSTransactional // 多数据源,使用 @DSTransactional 保证本地事务,以及数据源的切换
|
||||
public Long createTenant(TenantSaveReqVO createReqVO) {
|
||||
|
@ -68,7 +68,7 @@ flowable:
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
|
||||
@ -225,6 +225,7 @@ yudao:
|
||||
- /admin-api/rescue/wxLoginRescue
|
||||
- /admin-api/rescue/wxLoginJc
|
||||
- /admin-api/rescue/loginJcApp
|
||||
- /admin-api/system/tenant/getListByWebsite
|
||||
websocket:
|
||||
enable: true # websocket的开关
|
||||
path: /infra/ws # 路径
|
||||
@ -274,6 +275,7 @@ yudao:
|
||||
- /admin-api/appInspection/goods/canLedCouponPlatform
|
||||
- /admin-api/rescue/loginApp
|
||||
- /admin-api/rescue/loginJcApp
|
||||
- /admin-api/system/tenant/getListByWebsite
|
||||
ignore-tables:
|
||||
- system_tenant
|
||||
- system_tenant_package
|
||||
|
Loading…
Reference in New Issue
Block a user