付款进度代码同步
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
package com.ruoyi.oa.controller;
|
||||
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.oa.domain.OaPaymentProgress;
|
||||
import com.ruoyi.oa.domain.SysOaFinance;
|
||||
import com.ruoyi.oa.domain.bo.OaPaymentProgressBo;
|
||||
import com.ruoyi.oa.domain.bo.SysOaFinanceBo;
|
||||
import com.ruoyi.oa.domain.vo.OaPaymentProgressVo;
|
||||
import com.ruoyi.oa.domain.vo.SysOaFinanceVo;
|
||||
import com.ruoyi.oa.service.IOaPaymentProgressService;
|
||||
import com.ruoyi.oa.service.ISysOaFinanceService;
|
||||
import liquibase.pro.packaged.A;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 付款进度
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/oa/payment-progress")
|
||||
public class OaPaymentProgressController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IOaPaymentProgressService progressService;
|
||||
@Autowired
|
||||
private ISysOaFinanceService financeService;
|
||||
|
||||
|
||||
/** 1. 创建付款进度 **/
|
||||
@PostMapping
|
||||
public R<Boolean> createProgress(@RequestBody OaPaymentProgressBo p) {
|
||||
|
||||
return R.ok(progressService.insertByBo(p));
|
||||
}
|
||||
|
||||
/** 2. 修改付款进度(不可改主键/项目ID) **/
|
||||
@PutMapping
|
||||
public R<Boolean> updateProgress(@RequestBody OaPaymentProgressBo p) {
|
||||
|
||||
return R.ok(progressService.updateByBo(p));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目付款进度列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<OaPaymentProgressVo> list(OaPaymentProgressBo bo, PageQuery pageQuery) {
|
||||
return progressService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/** 4. 查询某个进度下的所有明细(finance 记录) **/
|
||||
@GetMapping("/{progressId}/details")
|
||||
public R<List<SysOaFinanceVo>> listDetails(@PathVariable("progressId") Long progressId) {
|
||||
return R.ok(financeService.getByProgressId(progressId));
|
||||
}
|
||||
|
||||
/** 5. 为某个进度添加明细 **/
|
||||
@PostMapping("/{progressId}/details")
|
||||
public R<Boolean> addDetail(@PathVariable("progressId") Long progressId,
|
||||
@RequestBody SysOaFinanceBo f) {
|
||||
f.setPaymentProgressId(progressId);
|
||||
|
||||
return R.ok(financeService.insertByBo(f));
|
||||
}
|
||||
|
||||
/** 6. 修改明细(不可改主键/进度ID) **/
|
||||
@PutMapping("/details")
|
||||
public R<Boolean> updateDetail(@RequestBody SysOaFinanceBo f) {
|
||||
SysOaFinanceVo exist = financeService.queryById(f.getFinanceId());
|
||||
f.setPaymentProgressId(exist.getPaymentProgressId());
|
||||
return R.ok(financeService.updateByBo(f));
|
||||
}
|
||||
|
||||
/** 7. 删除某条明细(并级联删 detail 记录) **/
|
||||
@DeleteMapping("/details/{financeId}")
|
||||
public void deleteDetail(@PathVariable Long financeId) {
|
||||
financeService.deleteDetail(financeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目付款进度
|
||||
*
|
||||
* @param paymentProgressIds 主键串
|
||||
*/
|
||||
@DeleteMapping("/{paymentProgressIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] paymentProgressIds) {
|
||||
return toAjax(progressService.deleteWithValidByIds(Arrays.asList(paymentProgressIds), true));
|
||||
}
|
||||
}
|
||||
@@ -64,6 +64,14 @@ public class SysOaFinanceController extends BaseController {
|
||||
return sysOaFinanceList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询进出账管理列表
|
||||
*/
|
||||
@GetMapping("/progress-list")
|
||||
public TableDataInfo<SysOaFinanceVo> progressList(SysOaFinanceBo bo, PageQuery pageQuery) {
|
||||
TableDataInfo<SysOaFinanceVo> sysOaFinanceVoTableDataInfo = iSysOaFinanceService.progressList(bo, pageQuery);
|
||||
return sysOaFinanceVoTableDataInfo;
|
||||
}
|
||||
|
||||
@GetMapping("/barData")
|
||||
public R<List<SysOaFinanceVo>> pieData(SysOaFinanceBo bo) {
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.ruoyi.oa.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 项目付款进度对象 oa_payment_progress
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-05-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("oa_payment_progress")
|
||||
public class OaPaymentProgress extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 付款进度ID
|
||||
*/
|
||||
@TableId(value = "payment_progress_id")
|
||||
private Long paymentProgressId;
|
||||
/**
|
||||
* 关联项目ID,引用 oa_project.project_id
|
||||
*/
|
||||
private Long projectId;
|
||||
/**
|
||||
* 付款开始时间
|
||||
*/
|
||||
private Date startTime;
|
||||
/**
|
||||
* 付款结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
* 付款金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 是否作废:0正常;1作废
|
||||
*/
|
||||
private Integer isVoid;
|
||||
/**
|
||||
* 删除标志:0正常;1已删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 完成标志
|
||||
*/
|
||||
private Long complete;
|
||||
|
||||
|
||||
}
|
||||
@@ -107,4 +107,20 @@ public class SysOaFinance extends BaseEntity {
|
||||
@TableField(exist = false)
|
||||
private List<SysOaDetail> detailList;
|
||||
|
||||
private Long paymentProgressId;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Date beginTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 完成状态
|
||||
*/
|
||||
private Long status;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.ruoyi.oa.domain.bo;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class OaPaymentProgressBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 付款进度ID
|
||||
*/
|
||||
private Long paymentProgressId;
|
||||
|
||||
/**
|
||||
* 关联项目ID,引用 oa_project.project_id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 付款开始时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 付款结束时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 付款金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 是否作废:0正常;1作废
|
||||
*/
|
||||
private Integer isVoid;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 完成标志
|
||||
*/
|
||||
private Long complete;
|
||||
|
||||
private String projectName;
|
||||
|
||||
private String projectCode;
|
||||
|
||||
private String projectNum;
|
||||
|
||||
|
||||
}
|
||||
@@ -120,5 +120,24 @@ public class SysOaFinanceBo extends BaseEntity {
|
||||
*/
|
||||
private String outType;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Date beginTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 付款进度id
|
||||
*/
|
||||
private Long paymentProgressId;
|
||||
|
||||
/**
|
||||
* 完成状态
|
||||
*/
|
||||
private Long status;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.ruoyi.oa.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 项目付款进度视图对象 oa_payment_progress
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-05-23
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class OaPaymentProgressVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 付款进度ID
|
||||
*/
|
||||
@ExcelProperty(value = "付款进度ID")
|
||||
private Long paymentProgressId;
|
||||
|
||||
/**
|
||||
* 关联项目ID,引用 oa_project.project_id
|
||||
*/
|
||||
@ExcelProperty(value = "关联项目ID,引用 oa_project.project_id")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 付款开始时间
|
||||
*/
|
||||
@ExcelProperty(value = "付款开始时间")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 付款结束时间
|
||||
*/
|
||||
@ExcelProperty(value = "付款结束时间")
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 付款金额
|
||||
*/
|
||||
@ExcelProperty(value = "付款金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 是否作废:0正常;1作废
|
||||
*/
|
||||
@ExcelProperty(value = "是否作废:0正常;1作废")
|
||||
private Integer isVoid;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
private String projectName;
|
||||
private String projectCode;
|
||||
private String projectNum;
|
||||
|
||||
private Date earliestEndTime;
|
||||
|
||||
|
||||
/**
|
||||
* 完成标志
|
||||
*/
|
||||
private Long complete;
|
||||
|
||||
/**
|
||||
* 完成资格
|
||||
*/
|
||||
private Long qualified;
|
||||
}
|
||||
@@ -140,6 +140,16 @@ public class SysOaFinanceVo extends SysOaFinance {
|
||||
*/
|
||||
private String outType;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Date beginTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 类型金钱综合用于饼图数据
|
||||
*/
|
||||
@@ -151,4 +161,9 @@ public class SysOaFinanceVo extends SysOaFinance {
|
||||
|
||||
private String month;
|
||||
|
||||
/**
|
||||
* 完成状态
|
||||
*/
|
||||
private Long status;
|
||||
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public interface SysOaFinanceMapper extends BaseMapperPlus<SysOaFinanceMapper, S
|
||||
*/
|
||||
@DataPermission({
|
||||
@DataColumn(key = "detailTitle", value = "b.detail_id"),
|
||||
@DataColumn(key = "financeTitle", value = "a.finance_id")
|
||||
@DataColumn(key = "financeTitle", value = "sof.finance_id")
|
||||
})
|
||||
Page<SysOaFinanceVo> selectPageFinanceList(@Param("page") Page<SysOaFinanceVo> page, @Param(Constants.WRAPPER) Wrapper<SysOaFinance> queryWrapper);
|
||||
|
||||
@@ -72,6 +72,9 @@ public interface SysOaFinanceMapper extends BaseMapperPlus<SysOaFinanceMapper, S
|
||||
*/
|
||||
List<SysOaFinanceVo> getBarData(SysOaFinanceBo bo);
|
||||
|
||||
List<SysOaFinanceVo> selectByPaymentProgressId(Long progressId);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 项目资金管理,根据时间范围查询列表数据
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.ruoyi.oa.service;
|
||||
|
||||
import com.ruoyi.oa.domain.OaPaymentProgress;
|
||||
import com.ruoyi.oa.domain.vo.OaPaymentProgressVo;
|
||||
import com.ruoyi.oa.domain.bo.OaPaymentProgressBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目付款进度Service接口
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-05-23
|
||||
*/
|
||||
public interface IOaPaymentProgressService {
|
||||
|
||||
/**
|
||||
* 查询项目付款进度
|
||||
*/
|
||||
OaPaymentProgressVo queryById(Long paymentProgressId);
|
||||
|
||||
/**
|
||||
* 查询项目付款进度列表
|
||||
*/
|
||||
TableDataInfo<OaPaymentProgressVo> queryPageList(OaPaymentProgressBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询项目付款进度列表
|
||||
*/
|
||||
List<OaPaymentProgressVo> queryList(OaPaymentProgressBo bo);
|
||||
|
||||
/**
|
||||
* 新增项目付款进度
|
||||
*/
|
||||
Boolean insertByBo(OaPaymentProgressBo bo);
|
||||
|
||||
/**
|
||||
* 修改项目付款进度
|
||||
*/
|
||||
Boolean updateByBo(OaPaymentProgressBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除项目付款进度信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -91,4 +91,11 @@ public interface ISysOaFinanceService {
|
||||
Boolean deleteSysOaFinanceById(Long financeId);
|
||||
|
||||
List<SysOaFinanceVo> getBarData(SysOaFinanceBo bo);
|
||||
|
||||
public List<SysOaFinanceVo> getByProgressId(Long progressId);
|
||||
|
||||
public void deleteDetail(Long financeId);
|
||||
|
||||
TableDataInfo<SysOaFinanceVo> progressList(SysOaFinanceBo bo, PageQuery pageQuery);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.ruoyi.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.oa.domain.bo.OaPaymentProgressBo;
|
||||
import com.ruoyi.oa.domain.vo.OaPaymentProgressVo;
|
||||
import com.ruoyi.oa.domain.OaPaymentProgress;
|
||||
import com.ruoyi.oa.mapper.OaPaymentProgressMapper;
|
||||
import com.ruoyi.oa.service.IOaPaymentProgressService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 项目付款进度Service业务层处理
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-05-23
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class OaPaymentProgressServiceImpl implements IOaPaymentProgressService {
|
||||
|
||||
private final OaPaymentProgressMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询项目付款进度
|
||||
*/
|
||||
@Override
|
||||
public OaPaymentProgressVo queryById(Long paymentProgressId){
|
||||
return baseMapper.selectVoById(paymentProgressId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目付款进度列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<OaPaymentProgressVo> queryPageList(OaPaymentProgressBo bo, PageQuery pageQuery) {
|
||||
QueryWrapper<OaPaymentProgress> lqw = buildQueryWrapper(bo);
|
||||
Page<OaPaymentProgressVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目付款进度列表
|
||||
*/
|
||||
@Override
|
||||
public List<OaPaymentProgressVo> queryList(OaPaymentProgressBo bo) {
|
||||
QueryWrapper<OaPaymentProgress> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private QueryWrapper<OaPaymentProgress> buildQueryWrapper(OaPaymentProgressBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
QueryWrapper<OaPaymentProgress> lqw = Wrappers.query();
|
||||
lqw.like(bo.getProjectId() != null,"opp.project_id", bo.getProjectId());
|
||||
lqw.ge(bo.getStartTime() != null, "opp.start_time", bo.getStartTime());
|
||||
lqw.le(bo.getEndTime() != null,"opp.end_time", bo.getEndTime());
|
||||
lqw.eq(bo.getIsVoid() != null, "opp.is_void", bo.getIsVoid());
|
||||
lqw.eq(bo.getProjectName()!=null,"sop.project_name",bo.getProjectName());
|
||||
lqw.eq(bo.getProjectNum()!=null,"sop.project_num",bo.getProjectNum());
|
||||
lqw.eq(bo.getProjectCode()!=null,"sop.project_code",bo.getProjectCode());
|
||||
lqw.eq("opp.del_flag",0);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增项目付款进度
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(OaPaymentProgressBo bo) {
|
||||
OaPaymentProgress add = BeanUtil.toBean(bo, OaPaymentProgress.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setPaymentProgressId(add.getPaymentProgressId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目付款进度
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(OaPaymentProgressBo bo) {
|
||||
OaPaymentProgress update = BeanUtil.toBean(bo, OaPaymentProgress.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(OaPaymentProgress entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除项目付款进度
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ import com.ruoyi.oa.domain.vo.SysOaFinanceVo;
|
||||
import com.ruoyi.oa.domain.SysOaFinance;
|
||||
import com.ruoyi.oa.mapper.SysOaFinanceMapper;
|
||||
import com.ruoyi.oa.service.ISysOaFinanceService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
@@ -70,14 +71,25 @@ public class SysOaFinanceServiceImpl implements ISysOaFinanceService {
|
||||
return TableDataInfo.build(sysOaFinanceVoList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SysOaFinanceVo> progressList(SysOaFinanceBo bo, PageQuery pageQuery) {
|
||||
QueryWrapper<SysOaFinance> lqw = Wrappers.query();
|
||||
lqw.eq(ObjectUtil.isNotNull(bo.getProjectId()), "sof.project_id", bo.getProjectId());
|
||||
lqw.eq(ObjectUtil.isNotNull(bo.getPaymentProgressId()), "sof.payment_progress_id", bo.getPaymentProgressId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFinanceType()), "sof.finance_type", bo.getFinanceType());
|
||||
lqw.orderByDesc("sof.create_time");
|
||||
Page<SysOaFinanceVo> sysOaFinanceVoList = baseMapper.selectFinanceList(pageQuery.build(),lqw );
|
||||
return TableDataInfo.build(sysOaFinanceVoList);
|
||||
}
|
||||
|
||||
private Wrapper<SysOaFinance> buildQueryWrapperByFinance(SysOaFinanceBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
QueryWrapper<SysOaFinance> lqw = Wrappers.query();
|
||||
lqw.isNull("sof.payment_progress_id");
|
||||
//前端设定了projectId的值为0和1,0:非项目进出账(添加时候默认为0),1:项目进出账(项目的id是数字串整数,添加时候该字段存储;gt大于0表示项目字段值
|
||||
// lqw.ge("a.project_id ",bo.getProjectId());
|
||||
lqw.eq(ObjectUtil.isNotNull(bo.getProjectId()), "a.project_id", bo.getProjectId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFinanceType()), "a.finance_type", bo.getFinanceType());
|
||||
lqw.orderByDesc("a.create_time");
|
||||
lqw.eq(ObjectUtil.isNotNull(bo.getProjectId()), "sof.project_id", bo.getProjectId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFinanceType()), "sof.finance_type", bo.getFinanceType());
|
||||
lqw.orderByDesc("sof.create_time");
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@@ -127,23 +139,16 @@ public class SysOaFinanceServiceImpl implements ISysOaFinanceService {
|
||||
@Override
|
||||
public BigDecimal selectFinanceByProjectId(SysOaFinanceBo bo) {
|
||||
List<SysOaFinance> sysOaFinances = baseMapper.selectFinanceByProjectId(bo);
|
||||
System.out.println("sysOaFinances===" + sysOaFinances);
|
||||
System.out.println("sysOaFinances000===" + sysOaFinances.size());
|
||||
if (sysOaFinances.size() > 0) {
|
||||
ArrayList<BigDecimal> objects = new ArrayList<>();
|
||||
sysOaFinances.forEach(v -> {
|
||||
System.out.println("vvvv" + v.getDetailList());
|
||||
BigDecimal reduce = v.getDetailList().stream().map(s -> s.getPrice() == null ? new BigDecimal(0) : s.getPrice()).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
objects.add(reduce);
|
||||
});
|
||||
//主表再次求和
|
||||
BigDecimal reduce = objects.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
System.out.println("hehehehe999===" + reduce);
|
||||
return reduce;
|
||||
return objects.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
} else {
|
||||
BigDecimal reduce = new BigDecimal(0);
|
||||
System.out.println("hehehehe===" + reduce);
|
||||
return reduce;
|
||||
return new BigDecimal(0);
|
||||
|
||||
}
|
||||
|
||||
@@ -182,13 +187,13 @@ public class SysOaFinanceServiceImpl implements ISysOaFinanceService {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
QueryWrapper<SysOaFinance> lqw = Wrappers.query();
|
||||
//前端设定了projectId的值为0和1,0:非项目进出账(添加时候默认为0),1:项目进出账(项目的id是数字串整数,添加时候该字段存储;gt大于0表示项目字段值
|
||||
lqw.eq("a.project_id", bo.getProjectId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getFinanceTitle()), "a.finance_title", bo.getFinanceTitle());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getFinanceParties()), "a.finance_parties", bo.getFinanceParties());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFinanceType()), "a.finance_type", bo.getFinanceType());
|
||||
lqw.eq(Objects.nonNull(bo.getReceiveAccountId()) && bo.getReceiveAccountId()!=-1L, "a.receive_account_id", bo.getReceiveAccountId());
|
||||
lqw.eq("sof.project_id", bo.getProjectId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getFinanceTitle()), "sof.finance_title", bo.getFinanceTitle());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getFinanceParties()), "sof.finance_parties", bo.getFinanceParties());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFinanceType()), "sof.finance_type", bo.getFinanceType());
|
||||
lqw.eq(Objects.nonNull(bo.getReceiveAccountId()) && bo.getReceiveAccountId()!=-1L, "sof.receive_account_id", bo.getReceiveAccountId());
|
||||
lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
|
||||
"a.create_time", params.get("beginCreateTime"), params.get("endCreateTime"));
|
||||
"sof.create_time", params.get("beginCreateTime"), params.get("endCreateTime"));
|
||||
lqw.orderByDesc("create_time");
|
||||
return lqw;
|
||||
}
|
||||
@@ -284,4 +289,21 @@ public class SysOaFinanceServiceImpl implements ISysOaFinanceService {
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public List<SysOaFinanceVo> getByProgressId(Long progressId) {
|
||||
return baseMapper.selectByPaymentProgressId(progressId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void deleteDetail(Long financeId) {
|
||||
// 先删掉 sys_oa_detail 中的行
|
||||
sysOaDetailMapper.delete(new QueryWrapper<SysOaDetail>()
|
||||
.eq("finance_id", financeId));
|
||||
// 再删 sys_oa_finance
|
||||
baseMapper.deleteById(financeId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<?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="com.ruoyi.oa.mapper.OaPaymentProgressMapper">
|
||||
|
||||
<select id="selectVoPagePlus" resultType="com.ruoyi.oa.domain.vo.OaPaymentProgressVo">
|
||||
SELECT
|
||||
opp.*,
|
||||
sop.project_name,
|
||||
sop.project_code,
|
||||
sop.project_num,
|
||||
mf.min_end_time AS earliestEndTime,
|
||||
-- qualified = 1 当不存在 status=0 的 sof(即要么没有任何 sof,要么所有 sof.status=1)
|
||||
CASE
|
||||
WHEN NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM sys_oa_finance sof_zero
|
||||
WHERE sof_zero.payment_progress_id = opp.payment_progress_id
|
||||
AND sof_zero.status = 0
|
||||
)
|
||||
THEN 1
|
||||
ELSE 0
|
||||
END AS qualified
|
||||
FROM oa_payment_progress opp
|
||||
LEFT JOIN sys_oa_project sop
|
||||
ON opp.project_id = sop.project_id
|
||||
LEFT JOIN (
|
||||
-- 只拿 status=0 且最早的 end_time
|
||||
SELECT
|
||||
payment_progress_id,
|
||||
MIN(end_time) AS min_end_time
|
||||
FROM sys_oa_finance
|
||||
WHERE status = 0
|
||||
GROUP BY payment_progress_id
|
||||
) mf
|
||||
ON opp.payment_progress_id = mf.payment_progress_id
|
||||
${ew.getCustomSqlSegment}
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -27,6 +27,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="totalOut" column="total_out"/>
|
||||
<result property="totalIn" column="total_in"/>
|
||||
<result property="month" column="month"/>
|
||||
<result property="paymentProgressId" column="payment_progress_id"/>
|
||||
<result property="status" column="status"/>
|
||||
|
||||
<result property="receiveAccountId" column="receive_account_id"/>
|
||||
<result property="receiveAccountName" column="receive_account_name"/>
|
||||
@@ -35,6 +37,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
<select id="selectByPaymentProgressId" resultType="com.ruoyi.oa.domain.vo.SysOaFinanceVo">
|
||||
SELECT *
|
||||
FROM sys_oa_finance
|
||||
WHERE payment_progress_id = #{progressId}
|
||||
</select>
|
||||
|
||||
|
||||
<resultMap id="detailResult" type="SysOaDetail">
|
||||
<id property="detailId" column="detail_id"/>
|
||||
<result property="financeId" column="finance_id"/>
|
||||
@@ -51,31 +62,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectFinanceVo">
|
||||
select a.finance_id,
|
||||
a.project_id,
|
||||
a.finance_title,
|
||||
a.finance_parties,
|
||||
a.pay_type,
|
||||
a.finance_type,
|
||||
a.finance_time,
|
||||
a.make_ratio,
|
||||
a.make_price,
|
||||
a.make_time,
|
||||
a.make_explain,
|
||||
a.accessory,
|
||||
a.remark as finance_remark,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
select sof.finance_id,
|
||||
sof.project_id,
|
||||
sof.finance_title,
|
||||
sof.finance_parties,
|
||||
sof.pay_type,
|
||||
sof.finance_type,
|
||||
sof.finance_time,
|
||||
sof.make_ratio,
|
||||
sof.make_price,
|
||||
sof.make_time,
|
||||
sof.make_explain,
|
||||
sof.accessory,
|
||||
sof.remark as finance_remark,
|
||||
sof.create_by,
|
||||
sof.create_time,
|
||||
sof.update_by,
|
||||
sof.update_time,
|
||||
b.detail_id,
|
||||
b.detail_title,
|
||||
a.out_type,
|
||||
sof.out_type,
|
||||
b.price,
|
||||
b.big_price,
|
||||
b.remark as detail_remark
|
||||
from sys_oa_finance a
|
||||
left join sys_oa_detail b on a.finance_id = b.finance_id
|
||||
from sys_oa_finance sof
|
||||
left join sys_oa_detail b on sof.finance_id = b.finance_id
|
||||
</sql>
|
||||
|
||||
<select id="selectPageFinanceList" resultMap="SysOaFinanceResult">
|
||||
@@ -110,7 +121,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
p.project_id,
|
||||
p.project_name,
|
||||
sora.receive_account_name,
|
||||
sora.receive_account_id
|
||||
sora.receive_account_id,
|
||||
sof.payment_progress_id,
|
||||
sof.status
|
||||
from sys_oa_finance sof
|
||||
left join sys_oa_detail b on sof.finance_id = b.finance_id
|
||||
left join sys_oa_project p on sof.project_id = p.project_id
|
||||
@@ -145,7 +158,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
p.project_id,
|
||||
p.project_name,
|
||||
sora.receive_account_name,
|
||||
sora.receive_account_id
|
||||
sora.receive_account_id,
|
||||
sof.status,
|
||||
sof.payment_progress_id
|
||||
from sys_oa_finance sof
|
||||
left join sys_oa_detail b on sof.finance_id = b.finance_id
|
||||
left join sys_oa_project p on sof.project_id = p.project_id
|
||||
@@ -155,7 +170,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<!--进出账查询-->
|
||||
<select id="selectFinanceByProjectId" resultMap="SysOaFinanceResult">
|
||||
select a.finance_id, a.project_id, a.finance_title, a.finance_parties, a.pay_type, a.finance_type, a.finance_time, a.make_ratio, a.make_price, a.make_time, a.make_explain, a.accessory, a.remark as finance_remark, a.create_by, a.create_time, a.update_by, a.update_time,
|
||||
b.detail_id, b.detail_title, b.price, b.big_price, b.remark as detail_remark,a.out_type
|
||||
b.detail_id, b.detail_title, b.price, b.big_price, b.remark as detail_remark,a.out_type,a.payment_progress_id,a.status
|
||||
from sys_oa_finance a
|
||||
left join sys_oa_detail b on a.finance_id = b.finance_id
|
||||
where a.project_id = #{projectId} and a.finance_type = #{financeType}
|
||||
@@ -164,17 +179,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<!--进出账查询-->
|
||||
<select id="findFinanceByTime" resultMap="SysOaFinanceResult">
|
||||
<include refid="selectFinanceVo" />
|
||||
where a.finance_type = #{financeType}
|
||||
where sof.finance_type = #{financeType}
|
||||
<if test=" payType!=NULL and payType!=null and payType !='0' and payType!=0 ">
|
||||
and a.pay_type = #{payType}
|
||||
and sof.pay_type = #{payType}
|
||||
</if>
|
||||
|
||||
<if test=" receiveAccountId!=NULL and receiveAccountId!=null and receiveAccountId!='-1' ">
|
||||
and a.receive_account_id = #{receiveAccountId}
|
||||
and sof.receive_account_id = #{receiveAccountId}
|
||||
</if>
|
||||
and a.project_id = 0
|
||||
and date_format(a.finance_time,'%Y-%m-%d %H:%i:%s') >= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
|
||||
and date_format(a.finance_time,'%Y-%m-%d %H:%i:%s') <= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
|
||||
and sof.project_id = 0
|
||||
and date_format(sof.finance_time,'%Y-%m-%d %H:%i:%s') >= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
|
||||
and date_format(sof.finance_time,'%Y-%m-%d %H:%i:%s') <= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
|
||||
</select>
|
||||
|
||||
<select id="getBarData" resultMap="SysOaFinanceResult">
|
||||
@@ -192,13 +207,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
</select>
|
||||
|
||||
<!--项目进出账查询-->
|
||||
<!-- <select id="findFinanceByTimeAndProjectId" resultMap="SysOaFinanceResult">
|
||||
<include refid="selectFinanceVo" />
|
||||
where a.finance_type = #{financeType}
|
||||
and a.project_id > 0
|
||||
and date_format(a.create_time,'%Y-%m-%d %H:%i:%s') >= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
|
||||
and date_format(a.create_time,'%Y-%m-%d %H:%i:%s') <= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
|
||||
</select>-->
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -22,6 +22,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="createUserNickName" column="createUserNickName"/>
|
||||
<result property="workerNickName" column="workerNickName"/>
|
||||
<result property="postponements" column="postponements"/>
|
||||
<result property="accessory" column="accessory"/>
|
||||
|
||||
<collection property="taskItemVoList" ofType="com.ruoyi.oa.domain.vo.SysOaTaskItemVo" javaType="list">
|
||||
<result property="itemId" column="item_id"/>
|
||||
<result property="content" column="itemContent"/>
|
||||
@@ -31,6 +33,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="endTime" column="itemEndTime"/>
|
||||
<result property="remark" column="itemRemark"/>
|
||||
<result property="completedTime" column="itemCompletedTime"/>
|
||||
<result property="files" column="files"/>
|
||||
|
||||
|
||||
</collection>
|
||||
</resultMap>
|
||||
@@ -112,7 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
sot.task_title,
|
||||
sot.task_type,
|
||||
sot.task_grade,
|
||||
|
||||
sot.accessory,
|
||||
COALESCE(
|
||||
sot.finish_time,
|
||||
(SELECT a.end_time
|
||||
@@ -138,7 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
su1.nick_name AS createUserNickName,
|
||||
su2.nick_name AS workerNickName,
|
||||
|
||||
sot.accessory,
|
||||
|
||||
sot.rank_number,
|
||||
sot.remark,
|
||||
sot.task_rank,
|
||||
|
||||
Reference in New Issue
Block a user