Compare commits
5 Commits
708775f6dc
...
c2af2a8374
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c2af2a8374 | ||
![]() |
fc212f9d9e | ||
![]() |
62afcb53d5 | ||
![]() |
49a3cb0064 | ||
![]() |
c9510fb65f |
@ -2,8 +2,12 @@ package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.contract.BpmOAContractPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.contract.BpmOAContractRespVO;
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.BpmOAPaymentCreateReqVO;
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.BpmOAPaymentCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.BpmOAPaymentPageReqVO;
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.BpmOAPaymentRespVO;
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.BpmOAPaymentRespVO;
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.FactoryDetailVO;
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.FactoryDetailVO;
|
||||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAPaymentDO;
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAPaymentDO;
|
||||||
@ -163,4 +167,11 @@ public class BpmOAPaymentController {
|
|||||||
|
|
||||||
return success(paymentService.getPaymentList(type));
|
return success(paymentService.getPaymentList(type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得 后补票的付款申请分页列表")
|
||||||
|
public CommonResult<PageResult<BpmOAPaymentRespVO>> getPage(@Valid BpmOAPaymentPageReqVO pageReqVO) {
|
||||||
|
|
||||||
|
return success(paymentService.getPaymentPage(pageReqVO));
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.project.BpmOAProjectCreateReqVO;
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.project.BpmOAProjectCreateReqVO;
|
||||||
@ -65,12 +66,18 @@ public class BpmOAProjectController {
|
|||||||
BpmOAProjectRespVO respVO = BeanUtils.toBean(project, BpmOAProjectRespVO.class);
|
BpmOAProjectRespVO respVO = BeanUtils.toBean(project, BpmOAProjectRespVO.class);
|
||||||
|
|
||||||
if (respVO != null) {
|
if (respVO != null) {
|
||||||
|
Set<Long> userIds = new HashSet<>();
|
||||||
// 获取项目中所有人员的用户编号列表
|
// 获取项目中所有人员的用户编号列表
|
||||||
Set<Long> userIds = respVO.getStaff() == null ? new HashSet<>() : respVO.getStaff();
|
if (CollUtil.isNotEmpty(respVO.getStaff())) {
|
||||||
|
userIds.addAll(respVO.getStaff());
|
||||||
|
}
|
||||||
userIds.add(respVO.getDirectorUserId());
|
userIds.add(respVO.getDirectorUserId());
|
||||||
|
|
||||||
|
Set<Long> deptIds = new HashSet<>();
|
||||||
// 获取项目中所有部门编号列表
|
// 获取项目中所有部门编号列表
|
||||||
Set<Long> deptIds = respVO.getParticipationDept() == null ? new HashSet<>() : respVO.getParticipationDept();
|
if (CollUtil.isNotEmpty(respVO.getParticipationDept())) {
|
||||||
|
deptIds.addAll(respVO.getParticipationDept());
|
||||||
|
}
|
||||||
deptIds.add(respVO.getResponsibleDept());
|
deptIds.add(respVO.getResponsibleDept());
|
||||||
|
|
||||||
// 获取所有用户信息
|
// 获取所有用户信息
|
||||||
@ -104,29 +111,36 @@ public class BpmOAProjectController {
|
|||||||
|
|
||||||
if (respVO != null) {
|
if (respVO != null) {
|
||||||
|
|
||||||
|
Set<Long> userIds = new HashSet<>();
|
||||||
|
// 获取项目中所有人员的用户编号列表
|
||||||
|
if (CollUtil.isNotEmpty(respVO.getStaff())) {
|
||||||
|
userIds.addAll(respVO.getStaff());
|
||||||
|
}
|
||||||
|
userIds.add(respVO.getDirectorUserId());
|
||||||
|
|
||||||
|
Set<Long> deptIds = new HashSet<>();
|
||||||
// 获取项目中所有部门编号列表
|
// 获取项目中所有部门编号列表
|
||||||
Set<Long> deptIds = respVO.getParticipationDept() == null ? new HashSet<>() : respVO.getParticipationDept();
|
if (CollUtil.isNotEmpty(respVO.getParticipationDept())) {
|
||||||
|
deptIds.addAll(respVO.getParticipationDept());
|
||||||
|
}
|
||||||
deptIds.add(respVO.getResponsibleDept());
|
deptIds.add(respVO.getResponsibleDept());
|
||||||
|
|
||||||
// 获取所有用户信息
|
// 获取所有用户信息
|
||||||
AdminUserRespDTO userRespDTO = userApi.getUser(respVO.getDirectorUserId()).getCheckedData();
|
Map<Long, AdminUserRespDTO> userMap = userApi.getUserMap(userIds);
|
||||||
// 获取所有部门信息
|
// 获取所有部门信息
|
||||||
List<DeptRespDTO> deptDOS = deptApi.getDeptList(deptIds).getCheckedData();
|
Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(deptIds);
|
||||||
Map<Long, DeptRespDTO> deptMap = convertMap(deptDOS, DeptRespDTO::getId);
|
|
||||||
|
|
||||||
// 设置责任人名称
|
// 设置责任人名称
|
||||||
respVO.setDirectorUserName(userRespDTO.getNickname());
|
respVO.setDirectorUserName(userMap.get(respVO.getDirectorUserId()).getNickname());
|
||||||
|
// 设置项目人员名称
|
||||||
// 筛选出不是责任人部门的部门信息
|
userMap.remove(respVO.getDirectorUserId());
|
||||||
List<DeptRespDTO> deptVOs = deptDOS.stream()
|
respVO.setStaffName(userMap.values().stream().map(AdminUserRespDTO::getNickname).collect(Collectors.joining("、")));
|
||||||
.filter(dept -> !dept.getId().equals(respVO.getResponsibleDept()))
|
|
||||||
.distinct()
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
// 设置责任部门名称
|
// 设置责任部门名称
|
||||||
respVO.setResponsibleDeptName(deptMap.get(respVO.getResponsibleDept()).getName());
|
respVO.setResponsibleDeptName(deptMap.get(respVO.getResponsibleDept()).getName());
|
||||||
// 拼接参与部门名称
|
// 拼接参与部门名称
|
||||||
respVO.setParticipationDeptName(deptVOs.stream().map(DeptRespDTO::getName).collect(Collectors.joining("、")));
|
deptMap.remove(respVO.getResponsibleDept());
|
||||||
|
respVO.setParticipationDeptName(deptMap.values().stream().map(DeptRespDTO::getName).collect(Collectors.joining("、")));
|
||||||
}
|
}
|
||||||
|
|
||||||
return success(respVO);
|
return success(respVO);
|
||||||
|
@ -57,6 +57,12 @@ public class BpmOAPaymentCreateReqVO {
|
|||||||
@NotNull(message = "付款公司编号不能为空")
|
@NotNull(message = "付款公司编号不能为空")
|
||||||
private Long paymentCompany;
|
private Long paymentCompany;
|
||||||
|
|
||||||
|
@Schema(description = "是否后补发票 | 0否 1是", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
private Integer isTickets;
|
||||||
|
|
||||||
|
@Schema(description = "后补票批注", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
private String annotations;
|
||||||
|
|
||||||
@Schema(description = "父级审批编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
@Schema(description = "父级审批编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
private Long parentId;
|
private Long parentId;
|
||||||
|
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 付款申请分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class BpmOAPaymentPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "补票状态 | 0待补票 1已补票 2已确认")
|
||||||
|
private Integer status;
|
||||||
|
}
|
@ -73,6 +73,12 @@ public class BpmOAPaymentRespVO extends BpmOABaseRespVO {
|
|||||||
@Schema(description = "付款公司名称")
|
@Schema(description = "付款公司名称")
|
||||||
private String paymentCompanyName;
|
private String paymentCompanyName;
|
||||||
|
|
||||||
|
@Schema(description = "是否后补发票 | 0否 1是", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
private Integer isTickets;
|
||||||
|
|
||||||
|
@Schema(description = "后补票批注", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
private String annotations;
|
||||||
|
|
||||||
@Schema(description = "父级审批编号")
|
@Schema(description = "父级审批编号")
|
||||||
private Long parentId;
|
private Long parentId;
|
||||||
|
|
||||||
|
@ -102,6 +102,16 @@ public class BpmOAPaymentDO extends BaseDO {
|
|||||||
*/
|
*/
|
||||||
private Long paymentCompany;
|
private Long paymentCompany;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否后补发票 | 0否 1是
|
||||||
|
*/
|
||||||
|
private Integer isTickets;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 后补票批注
|
||||||
|
*/
|
||||||
|
private String annotations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 父级审批
|
* 父级审批
|
||||||
*/
|
*/
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.service.oa;
|
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.BpmOAPaymentCreateReqVO;
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.BpmOAPaymentCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.BpmOAPaymentPageReqVO;
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.BpmOAPaymentRespVO;
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.BpmOAPaymentRespVO;
|
||||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAPaymentDO;
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAPaymentDO;
|
||||||
|
|
||||||
@ -46,4 +48,11 @@ public interface BpmOAPaymentService {
|
|||||||
* @return 付款申请列表
|
* @return 付款申请列表
|
||||||
*/
|
*/
|
||||||
List<BpmOAPaymentRespVO> getPaymentList(Integer type);
|
List<BpmOAPaymentRespVO> getPaymentList(Integer type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得 后补票的付款申请分页列表
|
||||||
|
* @param pageReqVO 分页条件
|
||||||
|
* @return 付款申请分页列表
|
||||||
|
*/
|
||||||
|
PageResult<BpmOAPaymentRespVO> getPaymentPage(BpmOAPaymentPageReqVO pageReqVO);
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,12 @@ package cn.iocoder.yudao.module.bpm.service.oa;
|
|||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.BpmOAPaymentCreateReqVO;
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.BpmOAPaymentCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.BpmOAPaymentPageReqVO;
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.BpmOAPaymentRespVO;
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.BpmOAPaymentRespVO;
|
||||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpayment.FinancialPaymentDO;
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpayment.FinancialPaymentDO;
|
||||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAPaymentDO;
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAPaymentDO;
|
||||||
@ -142,6 +144,12 @@ public class BpmOAPaymentServiceImpl extends BpmOABaseService implements BpmOAPa
|
|||||||
return paymentMapper.selectPaymentList(type);
|
return paymentMapper.selectPaymentList(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<BpmOAPaymentRespVO> getPaymentPage(BpmOAPaymentPageReqVO pageReqVO) {
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
private BpmOAPaymentDO validateLeaveExists(Long id) {
|
private BpmOAPaymentDO validateLeaveExists(Long id) {
|
||||||
BpmOAPaymentDO paymentDO = paymentMapper.selectById(id);
|
BpmOAPaymentDO paymentDO = paymentMapper.selectById(id);
|
||||||
if (paymentDO == null) {
|
if (paymentDO == null) {
|
||||||
|
@ -1,32 +1,31 @@
|
|||||||
package cn.iocoder.yudao.module.system.controller.admin.customersettlement;
|
package cn.iocoder.yudao.module.system.controller.admin.customersettlement;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import javax.annotation.Resource;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
|
|
||||||
import javax.validation.*;
|
|
||||||
import javax.servlet.http.*;
|
|
||||||
import java.util.*;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
import cn.iocoder.yudao.module.system.controller.admin.customersettlement.vo.CustomerSettlementPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.customersettlement.vo.CustomerSettlementRespVO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.customersettlement.vo.*;
|
import cn.iocoder.yudao.module.system.controller.admin.customersettlement.vo.CustomerSettlementSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.customersettlement.CustomerSettlementDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.customersettlement.CustomerSettlementDO;
|
||||||
import cn.iocoder.yudao.module.system.service.customersettlement.CustomerSettlementService;
|
import cn.iocoder.yudao.module.system.service.customersettlement.CustomerSettlementService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 客户结算信息")
|
@Tag(name = "管理后台 - 客户结算信息")
|
||||||
@RestController
|
@RestController
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
package cn.iocoder.yudao.module.system.controller.admin.customersettlement.vo;
|
package cn.iocoder.yudao.module.system.controller.admin.customersettlement.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.worklog.vo.upload.UploadUserFile;
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -48,7 +51,7 @@ public class CustomerSettlementRespVO {
|
|||||||
|
|
||||||
@Schema(description = "上传附件", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn")
|
@Schema(description = "上传附件", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn")
|
||||||
@ExcelProperty("上传附件")
|
@ExcelProperty("上传附件")
|
||||||
private String url;
|
private List<UploadUserFile> url;
|
||||||
|
|
||||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@ExcelProperty("创建时间")
|
@ExcelProperty("创建时间")
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
package cn.iocoder.yudao.module.system.controller.admin.customersettlement.vo;
|
package cn.iocoder.yudao.module.system.controller.admin.customersettlement.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.worklog.vo.upload.UploadUserFile;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.Data;
|
||||||
import java.util.*;
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.NotEmpty;
|
||||||
import java.util.*;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 客户结算信息新增/修改 Request VO")
|
@Schema(description = "管理后台 - 客户结算信息新增/修改 Request VO")
|
||||||
@Data
|
@Data
|
||||||
@ -42,6 +44,6 @@ public class CustomerSettlementSaveReqVO {
|
|||||||
|
|
||||||
@Schema(description = "上传附件", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn")
|
@Schema(description = "上传附件", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn")
|
||||||
@NotEmpty(message = "上传附件不能为空")
|
@NotEmpty(message = "上传附件不能为空")
|
||||||
private String url;
|
private List<UploadUserFile> url;
|
||||||
|
|
||||||
}
|
}
|
@ -2,9 +2,11 @@ package cn.iocoder.yudao.module.system.controller.admin.dept;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
|
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
|
||||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||||
|
import cn.iocoder.yudao.module.infra.api.config.ConfigApi;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptRespVO;
|
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptRespVO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptSaveReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptSaveReqVO;
|
||||||
@ -13,6 +15,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
|||||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
||||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
@ -22,11 +25,12 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.util.List;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
|
||||||
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 部门")
|
@Tag(name = "管理后台 - 部门")
|
||||||
@RestController
|
@RestController
|
||||||
@ -39,6 +43,9 @@ public class DeptController {
|
|||||||
@Resource
|
@Resource
|
||||||
private AdminUserService userService;
|
private AdminUserService userService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ConfigApi configApi;
|
||||||
|
|
||||||
@PostMapping("create")
|
@PostMapping("create")
|
||||||
@Operation(summary = "创建部门")
|
@Operation(summary = "创建部门")
|
||||||
@PreAuthorize("@ss.hasPermission('system:dept:create')")
|
@PreAuthorize("@ss.hasPermission('system:dept:create')")
|
||||||
@ -164,6 +171,47 @@ public class DeptController {
|
|||||||
return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
|
return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = {"/all-list-outsiders"})
|
||||||
|
@Operation(summary = "获取部门精简信息列表", description = "只包含被开启的部门,主要用于需要区分外部人员时的下拉选项")
|
||||||
|
@DataPermission(enable = false)
|
||||||
|
public CommonResult<List<DeptSimpleRespVO>> getAllDeptListOutsiders() {
|
||||||
|
|
||||||
|
// 获取外部人员 部门信息
|
||||||
|
String deptString = configApi.getConfigKey("system.outsiders").getCheckedData();
|
||||||
|
Map<String, String> deptMap = JsonUtils.parseObject(deptString, new TypeReference<Map<String, String>>(){});
|
||||||
|
// 判断当前登录用户是否 属于外部人员
|
||||||
|
for (String key : deptMap.keySet()) {
|
||||||
|
String value = deptMap.get(key);
|
||||||
|
if (value.contains(Objects.requireNonNull(getLoginUserId()).toString())) {
|
||||||
|
|
||||||
|
DeptDO deptDO = deptService.getDept(Long.valueOf(key));
|
||||||
|
return success(BeanUtils.toBean(Collections.singletonList(deptDO), DeptSimpleRespVO.class));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<DeptDO> list = deptService.getDeptList(
|
||||||
|
new DeptListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus()));
|
||||||
|
|
||||||
|
// 获得所有得虚机构部门信息
|
||||||
|
List<DeptDO> virtuallyDeptId = list.stream()
|
||||||
|
.filter(dept -> dept.getVirtuallyStatus() == 1)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
virtuallyDeptId.forEach(data -> {
|
||||||
|
|
||||||
|
// 将虚机构的子部门,父部门设置为虚机构的父部门
|
||||||
|
list.stream().filter(dept -> dept.getParentId().equals(data.getId()))
|
||||||
|
.map(dept -> dept.setParentId(data.getParentId()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 移除虚机构,不展示
|
||||||
|
list.removeIf(dept -> dept.getVirtuallyStatus() == 1);
|
||||||
|
|
||||||
|
return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping(value = { "/get-factory-dept"})
|
@GetMapping(value = { "/get-factory-dept"})
|
||||||
@Operation(summary = "获取工厂部门精简信息列表", description = "只包含被开启的部门,主要用于前端的下拉选项")
|
@Operation(summary = "获取工厂部门精简信息列表", description = "只包含被开启的部门,主要用于前端的下拉选项")
|
||||||
@DataPermission(enable = false)
|
@DataPermission(enable = false)
|
||||||
|
@ -173,7 +173,7 @@ public class ProjectController {
|
|||||||
@GetMapping("/get-my-project")
|
@GetMapping("/get-my-project")
|
||||||
@Operation(summary = "获得我参与的项目")
|
@Operation(summary = "获得我参与的项目")
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
@PreAuthorize("@ss.hasPermission('system:project:query')")
|
// @PreAuthorize("@ss.hasPermission('system:project:query')")
|
||||||
public CommonResult<List<ProjectRespVO>> getMyProject() {
|
public CommonResult<List<ProjectRespVO>> getMyProject() {
|
||||||
List<ProjectDO> projectList = projectService.getMyProject(getLoginUserId());
|
List<ProjectDO> projectList = projectService.getMyProject(getLoginUserId());
|
||||||
return success(BeanUtils.toBean(projectList, ProjectRespVO.class));
|
return success(BeanUtils.toBean(projectList, ProjectRespVO.class));
|
||||||
|
@ -1,21 +1,23 @@
|
|||||||
package cn.iocoder.yudao.module.system.dal.dataobject.customersettlement;
|
package cn.iocoder.yudao.module.system.dal.dataobject.customersettlement;
|
||||||
|
|
||||||
import lombok.*;
|
|
||||||
import java.util.*;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.worklog.vo.upload.UploadUserFile;
|
||||||
|
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客户结算信息 DO
|
* 客户结算信息 DO
|
||||||
*
|
*
|
||||||
* @author 陈宾顺
|
* @author 陈宾顺
|
||||||
*/
|
*/
|
||||||
@TableName("system_customer_settlement")
|
@TableName(value = "system_customer_settlement", autoResultMap = true)
|
||||||
@KeySequence("system_customer_settlement_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
@KeySequence("system_customer_settlement_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ -61,6 +63,7 @@ public class CustomerSettlementDO extends BaseDO {
|
|||||||
/**
|
/**
|
||||||
* 上传附件
|
* 上传附件
|
||||||
*/
|
*/
|
||||||
private String url;
|
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||||
|
private List<UploadUserFile> url;
|
||||||
|
|
||||||
}
|
}
|
@ -17,6 +17,14 @@ public interface RedisKeyConstants {
|
|||||||
*/
|
*/
|
||||||
String DEPT_CHILDREN_ID_LIST = "dept_children_ids";
|
String DEPT_CHILDREN_ID_LIST = "dept_children_ids";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指定部门的所有子部门编号数组的缓存
|
||||||
|
* <p>
|
||||||
|
* KEY 格式:dept_child_ids:{id}
|
||||||
|
* VALUE 数据类型:String 子部门编号集合
|
||||||
|
*/
|
||||||
|
String DEPT_CHILD_ID_LIST = "dept_child_ids";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色的缓存
|
* 角色的缓存
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -1,11 +1,17 @@
|
|||||||
package cn.iocoder.yudao.module.system.service.customersettlement;
|
package cn.iocoder.yudao.module.system.service.customersettlement;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.infra.api.file.FileApi;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.worklog.vo.upload.UploadUserFile;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.rental.RentalDepositRecordDO;
|
||||||
|
import org.apache.tomcat.util.digester.ObjectCreateRule;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.customersettlement.vo.*;
|
import cn.iocoder.yudao.module.system.controller.admin.customersettlement.vo.*;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.customersettlement.CustomerSettlementDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.customersettlement.CustomerSettlementDO;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
@ -29,15 +35,27 @@ public class CustomerSettlementServiceImpl implements CustomerSettlementService
|
|||||||
@Resource
|
@Resource
|
||||||
private CustomerSettlementMapper customerSettlementMapper;
|
private CustomerSettlementMapper customerSettlementMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private FileApi fileApi;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long createCustomerSettlement(CustomerSettlementSaveReqVO createReqVO) {
|
public Long createCustomerSettlement(CustomerSettlementSaveReqVO createReqVO) {
|
||||||
// 插入
|
// 插入
|
||||||
CustomerSettlementDO customerSettlement = BeanUtils.toBean(createReqVO, CustomerSettlementDO.class);
|
CustomerSettlementDO customerSettlement = BeanUtils.toBean(createReqVO, CustomerSettlementDO.class);
|
||||||
customerSettlementMapper.insert(customerSettlement);
|
customerSettlementMapper.insert(customerSettlement);
|
||||||
|
|
||||||
|
// 更新交易凭证附件 业务编号
|
||||||
|
UpdateBusinessFile(customerSettlement);
|
||||||
// 返回
|
// 返回
|
||||||
return customerSettlement.getId();
|
return customerSettlement.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void UpdateBusinessFile(CustomerSettlementDO updateReqVO) {
|
||||||
|
|
||||||
|
List<String> urls = updateReqVO.getUrl().stream().map(UploadUserFile::getUrl).collect(Collectors.toList());
|
||||||
|
fileApi.updateBusinessFile(urls, updateReqVO.getId().toString());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateCustomerSettlement(CustomerSettlementSaveReqVO updateReqVO) {
|
public void updateCustomerSettlement(CustomerSettlementSaveReqVO updateReqVO) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
|
@ -270,7 +270,7 @@ public class DeptServiceImpl implements DeptService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@DataPermission(enable = false)
|
@DataPermission(enable = false)
|
||||||
@Cacheable(cacheNames = RedisKeyConstants.DEPT_CHILDREN_ID_LIST, key = "#id")
|
@Cacheable(cacheNames = RedisKeyConstants.DEPT_CHILD_ID_LIST, key = "#id")
|
||||||
public List<DeptDO> getChildDept(Long id) {
|
public List<DeptDO> getChildDept(Long id) {
|
||||||
|
|
||||||
return deptMapper.selectList(new LambdaQueryWrapperX<DeptDO>()
|
return deptMapper.selectList(new LambdaQueryWrapperX<DeptDO>()
|
||||||
|
Loading…
Reference in New Issue
Block a user