Compare commits
3 Commits
31e12935f8
...
ba90fd2e03
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ba90fd2e03 | ||
![]() |
d422522eb8 | ||
![]() |
cb7c1fd484 |
@ -94,4 +94,13 @@ public class BpmOAExpensesController {
|
||||
expensesService.refused(id, processInstanceId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/oneClickPayment")
|
||||
@Operation(summary = "一键支付")
|
||||
@Parameter(name = "month", description = "月份", required = true, example = "2025-04")
|
||||
public CommonResult<Boolean> oneClickPayment(String month) {
|
||||
|
||||
expensesService.oneClickPayment(month);
|
||||
return success(true);
|
||||
}
|
||||
}
|
@ -42,10 +42,10 @@ public class BpmOASalaryController {
|
||||
@Operation(summary = "创建请求申请")
|
||||
public CommonResult<Long> createSalary(@Valid @RequestBody BpmOASalaryCreateReqVO createReqVO) {
|
||||
|
||||
if (createReqVO.getFactoryId() != null) {
|
||||
DeptRespDTO dto = deptApi.getDeptByFactoryId(createReqVO.getFactoryId()).getCheckedData();
|
||||
createReqVO.setCompanyDeptId(dto.getId());
|
||||
}
|
||||
// if (createReqVO.getFactoryId() != null) {
|
||||
// DeptRespDTO dto = deptApi.getDeptByFactoryId(createReqVO.getFactoryId()).getCheckedData();
|
||||
// createReqVO.setCompanyDeptId(dto.getId());
|
||||
// }
|
||||
return success(salaryService.createSalary(getLoginUserId(), createReqVO));
|
||||
}
|
||||
|
||||
|
@ -30,4 +30,7 @@ public class BpmOAExpensesPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "审批通过时间")
|
||||
private String[] endTime;
|
||||
|
||||
@Schema(description = "收款人姓名")
|
||||
private String payeeName;
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ public class BpmOAPaymentCreateReqVO {
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
@Schema(description = "付款比例 | 针对分期付款情况", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private Integer paymentRatio;
|
||||
private BigDecimal paymentRatio;
|
||||
|
||||
@Schema(description = "付款金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "付款金额不能为空")
|
||||
|
@ -68,7 +68,7 @@ public class BpmOAPaymentRespVO extends BpmOABaseRespVO {
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
@Schema(description = "付款比例 | 针对分期付款情况")
|
||||
private Integer paymentRatio;
|
||||
private BigDecimal paymentRatio;
|
||||
|
||||
@Schema(description = "付款金额")
|
||||
private BigDecimal amount;
|
||||
@ -92,7 +92,10 @@ public class BpmOAPaymentRespVO extends BpmOABaseRespVO {
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "累计付款比列")
|
||||
private Integer ratio;
|
||||
private BigDecimal ratio;
|
||||
|
||||
@Schema(description = "累计付款金额")
|
||||
private BigDecimal paymentAmount;
|
||||
|
||||
@Schema(description = "上传文件")
|
||||
private List<UploadUserFile> fileItems;
|
||||
|
@ -10,6 +10,7 @@ import org.springframework.format.annotation.DateTimeFormat;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 薪资付款申请 创建 Request VO
|
||||
@ -30,11 +31,15 @@ public class BpmOASalaryCreateReqVO {
|
||||
@DateTimeFormat(pattern = "yyyy-MM")
|
||||
private String salaryDate;
|
||||
|
||||
@Schema(description = "公司类型 | 1公司 2工厂", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "公司类型不能为空")
|
||||
private Integer deptType;
|
||||
|
||||
@Schema(description = "付款公司")
|
||||
private Long companyDeptId;
|
||||
|
||||
@Schema(description = "付款工厂编号")
|
||||
private Long factoryId;
|
||||
@Schema(description = "付款工厂的部门编号集合")
|
||||
private Set<Long> factoryDeptId;
|
||||
|
||||
@Schema(description = "付款总额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "付款总额不能为空")
|
||||
|
@ -10,6 +10,7 @@ import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author 符溶馨
|
||||
@ -27,12 +28,21 @@ public class BpmOASalaryRespVO extends BpmOABaseRespVO {
|
||||
@DateTimeFormat(pattern = "yyyy-MM")
|
||||
private String salaryDate;
|
||||
|
||||
@Schema(description = "公司类型 | 1公司 2工厂")
|
||||
private Integer deptType;
|
||||
|
||||
@Schema(description = "付款公司")
|
||||
private Long companyDeptId;
|
||||
|
||||
@Schema(description = "付款公司名称")
|
||||
private String companyName;
|
||||
|
||||
@Schema(description = "付款工厂的部门编号集合")
|
||||
private Set<Long> factoryDeptId;
|
||||
|
||||
@Schema(description = "付款工厂名称")
|
||||
private String factoryName;
|
||||
|
||||
@Schema(description = "付款工厂")
|
||||
private Long FactoryId;
|
||||
|
||||
|
@ -78,9 +78,9 @@ public class BpmOAPaymentDO extends BaseDO {
|
||||
private Long bankId;
|
||||
|
||||
/**
|
||||
* 付款方式 | 1预付款 2分期付款 3全额付款
|
||||
* 付款方式 | 1分批付款 3全额付款 4指定金额付款
|
||||
*/
|
||||
private Integer paymentMethod;
|
||||
private BigDecimal paymentMethod;
|
||||
|
||||
/**
|
||||
* 付款总额 | 针对预付款、分期付款情况
|
||||
|
@ -64,11 +64,11 @@ public class BpmOAReimbursementDO extends BaseDO {
|
||||
*/
|
||||
private String bankName;
|
||||
|
||||
/**
|
||||
* 报销明细数据JSON
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<Reimbursement> reimbursements;
|
||||
// /**
|
||||
// * 报销明细数据JSON
|
||||
// */
|
||||
// @TableField(typeHandler = JacksonTypeHandler.class)
|
||||
// private List<Reimbursement> reimbursements;
|
||||
/**
|
||||
* 总报销金额
|
||||
*/
|
||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.type.JsonLongSetTypeHandler;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.salary.SalarySubjectItemsVO;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
@ -12,6 +13,7 @@ import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* OA 薪资付款 DO
|
||||
@ -50,11 +52,22 @@ public class BpmOASalaryDO extends BaseDO {
|
||||
*/
|
||||
private String salaryDate;
|
||||
|
||||
/**
|
||||
* 公司类型 | 1公司 2工厂
|
||||
*/
|
||||
private Integer deptType;
|
||||
|
||||
/**
|
||||
* 付款公司
|
||||
*/
|
||||
private Long companyDeptId;
|
||||
|
||||
/**
|
||||
* 付款工厂的部门编号集合
|
||||
*/
|
||||
@TableField(typeHandler = JsonLongSetTypeHandler.class)
|
||||
private Set<Long> factoryDeptId;
|
||||
|
||||
/**
|
||||
* 付款总额
|
||||
*/
|
||||
|
@ -16,4 +16,6 @@ public interface BpmOAExpensesMapper extends BaseMapperX<BpmOAExpensesDO> {
|
||||
@Param("pageReqVO") BpmOAExpensesPageReqVO pageReqVO);
|
||||
|
||||
BpmOAExpensesTotal selectTotal(@Param("pageReqVO") BpmOAExpensesPageReqVO pageReqVO);
|
||||
|
||||
void oneClickPayment(@Param("month") String month);
|
||||
}
|
||||
|
@ -91,4 +91,10 @@ public interface BpmOAExpensesService {
|
||||
* @param processInstanceId 流程实例编号
|
||||
*/
|
||||
void refused(Long id, String processInstanceId);
|
||||
|
||||
/**
|
||||
* 一键支付
|
||||
* @param month 月份
|
||||
*/
|
||||
void oneClickPayment(String month);
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ import cn.iocoder.yudao.module.system.api.loan.dto.LoanDTO;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
@ -265,7 +266,10 @@ public class BpmOAExpensesServiceImpl extends BpmOABaseService implements BpmOAE
|
||||
CommonResult<AdminUserRespDTO> user = userApi.getUser(expenses.getUserId());
|
||||
|
||||
// 获取收款人信息
|
||||
BankRespDTO bankRespDTO = bankApi.getBank(expenses.getBankId()).getCheckedData();
|
||||
BankRespDTO bankRespDTO = null;
|
||||
if (expenses.getBankId() != null) {
|
||||
bankRespDTO = bankApi.getBank(expenses.getBankId()).getCheckedData();
|
||||
}
|
||||
|
||||
// 获取付款公司信息
|
||||
FactoryInfoDTO dto = new FactoryInfoDTO();
|
||||
@ -285,7 +289,7 @@ public class BpmOAExpensesServiceImpl extends BpmOABaseService implements BpmOAE
|
||||
.setProcessInstanceName(processInstance.getName())
|
||||
.setBeginTime(processInstance.getCreateTime())
|
||||
.setEndTime(processInstance.getEndTime())
|
||||
.setRecipientName(bankRespDTO.getNickname())
|
||||
.setRecipientName(bankRespDTO != null ? bankRespDTO.getNickname() : "")
|
||||
.setCompanyFactoryId(dto.getId())
|
||||
);
|
||||
}
|
||||
@ -311,4 +315,10 @@ public class BpmOAExpensesServiceImpl extends BpmOABaseService implements BpmOAE
|
||||
// 同步更新流程实例表
|
||||
processInstanceService.updateProcessInstanceResult(processInstanceId, BpmProcessInstanceResultEnum.BACK.getResult());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void oneClickPayment(String month) {
|
||||
|
||||
expensesMapper.oneClickPayment(month);
|
||||
}
|
||||
}
|
||||
|
@ -70,12 +70,14 @@ public class BpmOASalaryServiceImpl extends BpmOABaseService implements BpmOASal
|
||||
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
||||
salaryMapper.insert(salary) ;
|
||||
|
||||
// 获取申请公司或工厂信息
|
||||
DeptRespDTO dto = deptApi.getDept(salary.getCompanyDeptId()).getCheckedData();
|
||||
|
||||
// 配置申请公司或工厂部门flag
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
if (createReqVO.getDeptType() == 1) {
|
||||
// 获取申请公司信息
|
||||
DeptRespDTO dto = deptApi.getDept(salary.getCompanyDeptId()).getCheckedData();
|
||||
processInstanceVariables.put("company_dept_flag", dto.getFlag());
|
||||
}
|
||||
processInstanceVariables.put("dept_type", createReqVO.getDeptType());
|
||||
// 发起 BPM 流程
|
||||
String processInstanceId = processInstanceService.createProcessInstance(userId,
|
||||
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
|
||||
@ -112,9 +114,6 @@ public class BpmOASalaryServiceImpl extends BpmOABaseService implements BpmOASal
|
||||
// -- 插入到财务支付表中
|
||||
CommonResult<AdminUserRespDTO> user = userApi.getUser(salaryDO.getUserId());
|
||||
|
||||
// 从缓存中部门所属公司信息
|
||||
DeptRespDTO deptRespDTO = deptApi.getDept(salaryDO.getCompanyDeptId()).getCheckedData();
|
||||
|
||||
financialPaymentService.save(new FinancialPaymentDO()
|
||||
.setUserId(salaryDO.getUserId())
|
||||
.setDeptId(user.getData() == null ? null : user.getData().getDeptId())
|
||||
@ -127,7 +126,7 @@ public class BpmOASalaryServiceImpl extends BpmOABaseService implements BpmOASal
|
||||
.setProcessInstanceName(processInstance.getName())
|
||||
.setBeginTime(processInstance.getCreateTime())
|
||||
.setEndTime(processInstance.getEndTime())
|
||||
.setCompanyId(deptRespDTO != null && deptRespDTO.getFactoryId() == null ? deptRespDTO.getId() : null)
|
||||
.setCompanyId(salaryDO.getDeptType() == 1 ? salaryDO.getCompanyDeptId() : null)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAExpensesMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
@ -50,6 +49,9 @@
|
||||
<if test="pageReqVO.costSection != null">
|
||||
AND a.cost_section = #{pageReqVO.costSection}
|
||||
</if>
|
||||
<if test="pageReqVO.payeeName != null">
|
||||
AND ub.nickname LIKE CONCAT('%', #{pageReqVO.payeeName}, '%')
|
||||
</if>
|
||||
<if test="pageReqVO.endTime != null and pageReqVO.endTime.length > 0">
|
||||
<if test="pageReqVO.endTime[0] != null">
|
||||
and DATE_FORMAT(c.end_time, '%Y-%m-%d') >= #{pageReqVO.endTime[0]}
|
||||
@ -70,6 +72,7 @@
|
||||
bpm_oa_expenses a
|
||||
LEFT JOIN bpm_oa_expenses_item b ON b.expenses_id = a.id
|
||||
LEFT JOIN bpm_process_instance_ext c ON c.process_instance_id = a.process_instance_id
|
||||
LEFT JOIN system_bank ub ON ub.id = a.bank_id
|
||||
WHERE
|
||||
a.deleted = 0
|
||||
AND b.deleted = 0
|
||||
@ -86,6 +89,9 @@
|
||||
<if test="pageReqVO.costSection != null">
|
||||
AND b.cost_section = #{pageReqVO.costSection}
|
||||
</if>
|
||||
<if test="pageReqVO.payeeName != null">
|
||||
AND ub.nickname LIKE CONCAT('%', #{pageReqVO.payeeName}, '%')
|
||||
</if>
|
||||
<if test="pageReqVO.endTime != null and pageReqVO.endTime.length > 0">
|
||||
<if test="pageReqVO.endTime[0] != null">
|
||||
and DATE_FORMAT(c.end_time, '%Y-%m-%d') >= #{pageReqVO.endTime[0]}
|
||||
@ -95,4 +101,14 @@
|
||||
</if>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<update id="oneClickPayment">
|
||||
UPDATE bpm_oa_expenses e
|
||||
JOIN bpm_process_instance_ext b ON e.process_instance_id = b.process_instance_id
|
||||
SET e.STATUS = 1, e.amount_paid = e.total_money
|
||||
WHERE
|
||||
e.result = 2
|
||||
AND e.STATUS != 2
|
||||
AND DATE_FORMAT( b.end_time, '%Y-%m' ) = #{month}
|
||||
</update>
|
||||
</mapper>
|
||||
|
@ -17,7 +17,8 @@
|
||||
bank.nickname as nickname,
|
||||
bank.bank_no as bankNo,
|
||||
bank.bank_name as bankName,
|
||||
COALESCE(SUM( b.payment_ratio ), 0) + COALESCE(a.payment_ratio,0) AS ratio
|
||||
COALESCE(SUM( b.payment_ratio ), 0) + COALESCE(a.payment_ratio,0) AS ratio,
|
||||
COALESCE(SUM( b.amount ), 0) + COALESCE(a.amount, 0) AS paymentAmount
|
||||
FROM
|
||||
bpm_oa_payment a
|
||||
<if test="method != 1">
|
||||
@ -35,6 +36,6 @@
|
||||
GROUP BY
|
||||
a.id
|
||||
HAVING
|
||||
ratio < 100
|
||||
amount < total_amount
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -99,6 +99,7 @@ public class CustomerSettlementServiceImpl implements CustomerSettlementService
|
||||
// 获取需创建的 结算明细
|
||||
List<SettlementItemDO> createDO = BeanUtils.toBean(updateReqVO.getSettlementItems(), SettlementItemDO.class).stream()
|
||||
.filter(item -> item.getId() == null)
|
||||
.map(item -> item.setSettlementId(updateReqVO.getId()))
|
||||
.collect(Collectors.toList());
|
||||
// 获取需更新的 结算明细
|
||||
List<SettlementItemDO> updateDO = BeanUtils.toBean(updateReqVO.getSettlementItems(), SettlementItemDO.class).stream()
|
||||
|
@ -338,7 +338,8 @@ public class DeptServiceImpl implements DeptService {
|
||||
.eq(DeptDO::getStatus, CommonStatusEnum.ENABLE.getStatus())
|
||||
.eq(DeptDO::getType, DeptTypeEnum.COMPANY.getValue())
|
||||
.or()
|
||||
.eq(DeptDO::getType, DeptTypeEnum.HEAD_COMPANY.getValue()));
|
||||
.eq(DeptDO::getType, DeptTypeEnum.HEAD_COMPANY.getValue())
|
||||
.ne(DeptDO::getLevel, 0));
|
||||
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,8 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 厂区员工工资分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ -26,4 +28,7 @@ public class StaffSalaryPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "复核状态 | 0未复核 1已复核", example = "0")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "工厂编码集合")
|
||||
private List<Long> factoryIds;
|
||||
}
|
@ -66,6 +66,7 @@ public interface StaffMapper extends BaseMapperX<StaffDO> {
|
||||
.selectAs(StaffSalaryDO::getRealAmount, StaffSalaryRespVO::getRealAmount)
|
||||
.selectAs(StaffSalaryDO::getDeductionItems, StaffSalaryRespVO::getDeductionItems)
|
||||
.selectAs(StaffSalaryDO::getStatus, StaffSalaryRespVO::getStatus)
|
||||
.selectAs(StaffSalaryDO::getSalarySubjectItems, StaffSalaryRespVO::getSalarySubjectItems)
|
||||
.selectAs(StaffSalaryDO::getCreateTime, StaffSalaryRespVO::getCreateTime);
|
||||
query.leftJoin(StaffSalaryDO.class, on -> on
|
||||
.eq(StaffDO::getId, StaffSalaryDO::getStaffId)
|
||||
|
@ -38,6 +38,7 @@ public interface StaffSalaryMapper extends BaseMapperX<StaffSalaryDO> {
|
||||
query.eqIfPresent(StaffSalaryDO::getStaffId, reqVO.getStaffId());
|
||||
query.eqIfPresent(StaffSalaryDO::getMonth, reqVO.getMonth());
|
||||
query.eqIfPresent(StaffSalaryDO::getFactoryId, reqVO.getFactoryId());
|
||||
query.inIfPresent(StaffSalaryDO::getFactoryId, reqVO.getFactoryIds());
|
||||
query.eqIfPresent(StaffSalaryDO::getStatus, reqVO.getStatus());
|
||||
query.apply(Objects.nonNull(reqVO.getWorkTypeId()), "staff.work_type_id = {0} ", reqVO.getWorkTypeId());
|
||||
|
||||
@ -46,5 +47,17 @@ public interface StaffSalaryMapper extends BaseMapperX<StaffSalaryDO> {
|
||||
|
||||
SalaryTotalVO selectSalaryTotal(@Param("pageReqVO") StaffSalaryPageReqVO pageReqVO);
|
||||
|
||||
List<SalarySubjectItemsVO> selectListSalarySubjectItems(@Param("pageReqVO") StaffSalaryPageReqVO pageReqVO);
|
||||
default List<StaffSalaryRespVO> selectListSalarySubjectItems(StaffSalaryPageReqVO reqVO) {
|
||||
|
||||
MPJLambdaWrapperX<StaffSalaryDO> query = new MPJLambdaWrapperX<StaffSalaryDO>();
|
||||
query.selectAs(StaffSalaryDO::getSalarySubjectItems, StaffSalaryRespVO::getSalarySubjectItems);
|
||||
|
||||
query.leftJoin(StaffDO.class, "staff", StaffDO::getId, StaffSalaryDO::getStaffId);
|
||||
query.eqIfPresent(StaffSalaryDO::getMonth, reqVO.getMonth());
|
||||
query.eqIfPresent(StaffSalaryDO::getFactoryId, reqVO.getFactoryId());
|
||||
query.eqIfPresent(StaffSalaryDO::getStatus, reqVO.getStatus());
|
||||
query.apply(Objects.nonNull(reqVO.getWorkTypeId()), "staff.work_type_id = {0} ", reqVO.getWorkTypeId());
|
||||
|
||||
return selectJoinList(StaffSalaryRespVO.class, query);
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.smartfactory.service.staffsalary;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.bpm.api.oa.BpmOALoanApi;
|
||||
@ -108,7 +109,7 @@ public class StaffSalaryServiceImpl implements StaffSalaryService {
|
||||
@Override
|
||||
public PageResult<StaffSalaryRespVO> getStaffSalaryPage(StaffSalaryPageReqVO pageReqVO) {
|
||||
|
||||
if (pageReqVO.getMonth() != null) {
|
||||
if (pageReqVO.getMonth() != null && pageReqVO.getStatus() == null) {
|
||||
return staffMapper.selectSalaryPage(pageReqVO);
|
||||
}else {
|
||||
return staffSalaryMapper.selectSalaryPage(pageReqVO);
|
||||
@ -260,8 +261,17 @@ public class StaffSalaryServiceImpl implements StaffSalaryService {
|
||||
SalaryTotalVO salaryTotalVO = staffSalaryMapper.selectSalaryTotal(pageReqVO);
|
||||
|
||||
// 获取主体薪资的合计
|
||||
List<SalarySubjectItemsVO> salarySubjectItemsVO = staffSalaryMapper.selectListSalarySubjectItems(pageReqVO);
|
||||
List<StaffSalaryRespVO> salarySubjectItemsVO = staffSalaryMapper.selectListSalarySubjectItems(pageReqVO);
|
||||
//直接从数据库取出来的List<Reimbursement> 实际上是List<LinkedHashMap>类型 所以不能直接遍历
|
||||
//将list再次转为json串,然后由json串再转为list
|
||||
String json = JsonUtils.toJsonString(salarySubjectItemsVO);
|
||||
salarySubjectItemsVO = JsonUtils.parseArray(json, StaffSalaryRespVO.class);
|
||||
|
||||
if (CollUtil.isNotEmpty(salarySubjectItemsVO)) {
|
||||
Map<Integer, SalarySubjectItemsVO> sumMap = salarySubjectItemsVO.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.map(StaffSalaryRespVO::getSalarySubjectItems)
|
||||
.flatMap(List::stream)
|
||||
.collect(Collectors.toMap(
|
||||
SalarySubjectItemsVO::getSalarySubjectId,
|
||||
vo -> new SalarySubjectItemsVO()
|
||||
@ -273,6 +283,7 @@ public class StaffSalaryServiceImpl implements StaffSalaryService {
|
||||
}
|
||||
));
|
||||
salaryTotalVO.setSalarySubjectItems(new ArrayList<>(sumMap.values()));
|
||||
}
|
||||
|
||||
return salaryTotalVO;
|
||||
}
|
||||
|
@ -31,25 +31,4 @@
|
||||
AND b.work_type_id = #{pageReqVO.workTypeId}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectListSalarySubjectItems" resultType="cn.iocoder.yudao.module.smartfactory.controller.admin.staffsalary.vo.SalarySubjectItemsVO">
|
||||
SELECT
|
||||
a.salary_subject_items
|
||||
FROM
|
||||
sf_staff_salary a
|
||||
LEFT JOIN sf_staff b ON b.id = a.staff_id
|
||||
WHERE
|
||||
a.deleted = 0
|
||||
<if test="pageReqVO.factoryId != null">
|
||||
AND a.factory_id = #{pageReqVO.factoryId}
|
||||
</if>
|
||||
<if test="pageReqVO.month != null">
|
||||
AND a.month = #{pageReqVO.month}
|
||||
</if>
|
||||
<if test="pageReqVO.status != null">
|
||||
AND a.status = #{pageReqVO.status}
|
||||
</if>
|
||||
<if test="pageReqVO.workTypeId != null">
|
||||
AND b.work_type_id = #{pageReqVO.workTypeId}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user