Compare commits
3 Commits
c80164578b
...
92b22c5c5e
Author | SHA1 | Date | |
---|---|---|---|
![]() |
92b22c5c5e | ||
![]() |
72254590dc | ||
![]() |
f1b88b349a |
@ -112,6 +112,7 @@ public class BpmOAExpensesServiceImpl extends BpmOABaseService implements BpmOAE
|
||||
String type = bpmOAExpensesItemDOS.stream().map(item -> item.getType().toString()).collect(Collectors.joining(","));
|
||||
processInstanceVariables.put("type", type);
|
||||
processInstanceVariables.put("factoryType", expenses.getFactoryType());
|
||||
processInstanceVariables.put("factory_id", bpmOAExpensesItemDOS.get(0).getDeptId());
|
||||
String processInstanceId = processInstanceService.createProcessInstance(userId,
|
||||
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
|
||||
.setVariables(processInstanceVariables).setBusinessKey(String.valueOf(expenses.getId())));
|
||||
|
@ -52,10 +52,10 @@
|
||||
</if>
|
||||
<if test="pageReqVO.endTime != null and pageReqVO.endTime.length > 0">
|
||||
<if test="pageReqVO.endTime[0] != null">
|
||||
and c.end_time >= #{pageReqVO.endTime[0]}
|
||||
and DATE_FORMAT(c.end_time, '%Y-%m') >= #{pageReqVO.endTime[0]}
|
||||
</if>
|
||||
<if test="pageReqVO.endTime[1] != null">
|
||||
and c.end_time <= #{pageReqVO.endTime[1]}
|
||||
and DATE_FORMAT(c.end_time, '%Y-%m') <= #{pageReqVO.endTime[1]}
|
||||
</if>
|
||||
</if>
|
||||
ORDER BY c.end_time DESC, a.expenses_id
|
||||
@ -68,8 +68,8 @@
|
||||
SUM(a.total_money) - SUM(a.amount_paid) AS remainingPayable
|
||||
FROM
|
||||
bpm_oa_expenses a
|
||||
JOIN bpm_oa_expenses_item b ON b.expenses_id = b.id
|
||||
JOIN bpm_process_instance_ext c ON c.process_instance_id = a.process_instance_id
|
||||
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
|
||||
WHERE
|
||||
a.deleted = 0
|
||||
AND b.deleted = 0
|
||||
@ -88,10 +88,10 @@
|
||||
</if>
|
||||
<if test="pageReqVO.endTime != null and pageReqVO.endTime.length > 0">
|
||||
<if test="pageReqVO.endTime[0] != null">
|
||||
and c.end_time >= #{pageReqVO.endTime[0]}
|
||||
and DATE_FORMAT(c.end_time, '%Y-%m') >= #{pageReqVO.endTime[0]}
|
||||
</if>
|
||||
<if test="pageReqVO.endTime[1] != null">
|
||||
and c.end_time <= #{pageReqVO.endTime[1]}
|
||||
and DATE_FORMAT(c.end_time, '%Y-%m') <= #{pageReqVO.endTime[1]}
|
||||
</if>
|
||||
</if>
|
||||
</select>
|
||||
|
@ -59,7 +59,6 @@
|
||||
1 AS type
|
||||
FROM
|
||||
bpm_oa_expenses e
|
||||
JOIN bpm_oa_loan l ON e.user_id = l.user_id AND l.sf_user_id = #{pageReqVO.staffId}
|
||||
LEFT JOIN system_users u ON e.user_id = u.id
|
||||
LEFT JOIN system_dept d ON u.dept_id = d.id
|
||||
LEFT JOIN bpm_process_instance_ext p ON e.process_instance_id = p.process_instance_id
|
||||
@ -67,7 +66,6 @@
|
||||
e.deleted = 0
|
||||
AND e.result = 2
|
||||
AND e.status = 2
|
||||
AND l.deleted = 0
|
||||
AND u.deleted = 0
|
||||
AND d.deleted = 0
|
||||
AND p.deleted = 0
|
||||
|
@ -9,10 +9,7 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.module.smartfactory.api.factoryInfo.FactoryInfoApi;
|
||||
import cn.iocoder.yudao.module.smartfactory.api.factoryInfo.dto.FactoryInfoDTO;
|
||||
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.CustomerSettlementSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.customersettlement.vo.SettlementItemVO;
|
||||
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.SettlementItemDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||
@ -136,7 +133,7 @@ public class CustomerSettlementController {
|
||||
item.setSettlementItems(BeanUtils.toBean(itemMap.get(item.getId()), SettlementItemVO.class));
|
||||
}
|
||||
// 设置工厂名称
|
||||
item.setCustomerName(factoryMap.get(item.getCustomerId()).getName());
|
||||
item.setCustomerName(factoryMap.get(item.getCustomerId()).getShortName());
|
||||
// 设置创建人名称
|
||||
item.setCreatorName(userMap.get(item.getCreator()) == null ? "" : userMap.get(item.getCreator()).getNickname());
|
||||
});
|
||||
@ -145,6 +142,14 @@ public class CustomerSettlementController {
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
@GetMapping("/total")
|
||||
@Operation(summary = "获得结算统计信息")
|
||||
@PreAuthorize("@ss.hasPermission('system:customer-settlement:query')")
|
||||
public CommonResult<StatisticsVO> getCustomerSettlementTotal(@Valid CustomerSettlementPageReqVO pageReqVO) {
|
||||
|
||||
return success(customerSettlementService.getCustomerSettlementTotal(pageReqVO));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出客户结算信息 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('system:customer-settlement:export')")
|
||||
|
@ -19,7 +19,7 @@ public class CustomerSettlementPageReqVO extends PageParam {
|
||||
private Integer businessType;
|
||||
|
||||
@Schema(description = "结算月份")
|
||||
private String settlementMonth;
|
||||
private String[] settlementMonth;
|
||||
|
||||
@Schema(description = "结算公司id", example = "3044")
|
||||
private Long companyId;
|
||||
|
@ -6,6 +6,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@ -35,6 +36,9 @@ public class CustomerSettlementRespVO {
|
||||
@Schema(description = "收款明细")
|
||||
private List<PaymentItem> paymentItem;
|
||||
|
||||
@Schema(description = "收款金额")
|
||||
private BigDecimal paymentAmount;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String notes;
|
||||
|
||||
|
@ -6,6 +6,7 @@ import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 客户结算信息新增/修改 Request VO")
|
||||
@ -29,6 +30,9 @@ public class CustomerSettlementSaveReqVO {
|
||||
@Schema(description = "收款明细")
|
||||
private List<PaymentItem> paymentItem;
|
||||
|
||||
@Schema(description = "收款金额")
|
||||
private BigDecimal paymentAmount;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String notes;
|
||||
|
||||
|
@ -27,6 +27,12 @@ public class SettlementItemVO {
|
||||
@Schema(description = "扣款明细")
|
||||
private List<OtherDeductionsVO> deductionItems;
|
||||
|
||||
@Schema(description = "扣款金额")
|
||||
private BigDecimal deductionAmount;
|
||||
|
||||
@Schema(description = "结算金额")
|
||||
private BigDecimal settlementAmount;
|
||||
|
||||
@Schema(description = "已收款金额")
|
||||
private BigDecimal receivedTotal;
|
||||
}
|
||||
|
@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.customersettlement.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 客户结算信息统计 Response VO")
|
||||
@Data
|
||||
public class StatisticsVO {
|
||||
|
||||
@Schema(description = "预结算金额")
|
||||
private BigDecimal preSettlementTotal;
|
||||
|
||||
@Schema(description = "应结算金额")
|
||||
private BigDecimal shouldSettlementTotal;
|
||||
|
||||
@Schema(description = "扣款金额")
|
||||
private BigDecimal deductionTotal;
|
||||
|
||||
@Schema(description = "结算金额")
|
||||
private BigDecimal settlementTotal;
|
||||
|
||||
@Schema(description = "已收款金额")
|
||||
private BigDecimal receivedTotal;
|
||||
}
|
@ -23,8 +23,10 @@ public class LoanPageReqVO extends PageParam {
|
||||
@Schema(description = "借支用户部门编号", example = "128")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
@Schema(description = "借支类型")
|
||||
private Integer loanType;
|
||||
|
||||
@Schema(description = "查询方式 | 是否查询全部借支 0否 1是 为0时查询 剩余金额不为0的借支")
|
||||
private Integer model = 0;
|
||||
|
||||
}
|
@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -48,6 +49,11 @@ public class CustomerSettlementDO extends BaseDO {
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<PaymentItem> paymentItem;
|
||||
|
||||
/**
|
||||
* 收款金额
|
||||
*/
|
||||
private BigDecimal paymentAmount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
|
@ -57,6 +57,11 @@ public class SettlementItemDO extends BaseDO {
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<OtherDeductionsVO> deductionItems;
|
||||
|
||||
/**
|
||||
* 扣款金额
|
||||
*/
|
||||
private BigDecimal deductionAmount;
|
||||
|
||||
/**
|
||||
* 结算金额
|
||||
*/
|
||||
|
@ -4,8 +4,10 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.customersettlement.vo.CustomerSettlementPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.customersettlement.vo.StatisticsVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.customersettlement.CustomerSettlementDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 客户结算信息 Mapper
|
||||
@ -18,8 +20,9 @@ public interface CustomerSettlementMapper extends BaseMapperX<CustomerSettlement
|
||||
default PageResult<CustomerSettlementDO> selectPage(CustomerSettlementPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<CustomerSettlementDO>()
|
||||
.eqIfPresent(CustomerSettlementDO::getCustomerId, reqVO.getCustomerId())
|
||||
.eqIfPresent(CustomerSettlementDO::getSettlementMonth, reqVO.getSettlementMonth())
|
||||
.betweenIfPresent(CustomerSettlementDO::getSettlementMonth, reqVO.getSettlementMonth())
|
||||
.orderByDesc(CustomerSettlementDO::getId));
|
||||
}
|
||||
|
||||
StatisticsVO selectTotal(@Param("reqVO") CustomerSettlementPageReqVO pageReqVO);
|
||||
}
|
@ -23,7 +23,9 @@ public interface LoanMapper extends BaseMapperX<LoanDO> {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<LoanDO>()
|
||||
.eqIfPresent(LoanDO::getUserId, reqVO.getUserId())
|
||||
.eqIfPresent(LoanDO::getDeptId, reqVO.getDeptId())
|
||||
.betweenIfPresent(LoanDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(LoanDO::getLoanType, reqVO.getLoanType())
|
||||
.ne(reqVO.getModel() == 0, LoanDO::getRemainingAmount, 0)
|
||||
.orderByDesc(LoanDO::getRemainingAmount)
|
||||
.orderByDesc(LoanDO::getUserId));
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.system.service.customersettlement;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.customersettlement.vo.CustomerSettlementPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.customersettlement.vo.CustomerSettlementSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.customersettlement.vo.StatisticsVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.customersettlement.CustomerSettlementDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.customersettlement.SettlementItemDO;
|
||||
|
||||
@ -67,7 +68,14 @@ public interface CustomerSettlementService {
|
||||
* 更新结算信息确认状态
|
||||
*
|
||||
* @param id 编号
|
||||
* @param status
|
||||
* @param status 状态
|
||||
*/
|
||||
void updateConfirm(Long id, Integer status);
|
||||
|
||||
/**
|
||||
* 获得结算统计信息
|
||||
* @param pageReqVO 查询信息
|
||||
* @return 统计信息
|
||||
*/
|
||||
StatisticsVO getCustomerSettlementTotal(CustomerSettlementPageReqVO pageReqVO);
|
||||
}
|
@ -7,6 +7,7 @@ import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.infra.api.file.FileApi;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.customersettlement.vo.CustomerSettlementPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.customersettlement.vo.CustomerSettlementSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.customersettlement.vo.StatisticsVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.worklog.vo.upload.UploadUserFile;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.customersettlement.CustomerSettlementDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.customersettlement.SettlementItemDO;
|
||||
@ -162,4 +163,10 @@ public class CustomerSettlementServiceImpl implements CustomerSettlementService
|
||||
.setId(id)
|
||||
.setStatus(status));
|
||||
}
|
||||
|
||||
@Override
|
||||
public StatisticsVO getCustomerSettlementTotal(CustomerSettlementPageReqVO pageReqVO) {
|
||||
|
||||
return customerSettlementMapper.selectTotal(pageReqVO);
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<?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.system.dal.mysql.customersettlement.CustomerSettlementMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
<select id="selectTotal" resultType="cn.iocoder.yudao.module.system.controller.admin.customersettlement.vo.StatisticsVO">
|
||||
SELECT
|
||||
SUM(b.pre_settlement_amount) AS preSettlementTotal,
|
||||
SUM(b.should_settlement_amount) AS shouldSettlementTotal,
|
||||
SUM(b.deduction_amount) AS deductionTotal,
|
||||
SUM(b.settlement_amount) AS settlementTotal,
|
||||
SUM(a.payment_amount) AS receivedTotal
|
||||
FROM
|
||||
system_customer_settlement a
|
||||
LEFT JOIN system_settlement_item b ON b.settlement_id = a.id
|
||||
WHERE
|
||||
a.deleted = 0
|
||||
AND b.deleted = 0
|
||||
<if test="reqVO.customerId != null">
|
||||
AND a.customer_id = #{reqVO.customerId}
|
||||
</if>
|
||||
<if test="reqVO.businessType != null">
|
||||
AND b.business_type = #{reqVO.businessType}
|
||||
</if>
|
||||
<if test="reqVO.settlementMonth != null and reqVO.settlementMonth.length > 0">
|
||||
<if test="reqVO.settlementMonth[0] != null">
|
||||
and a.settlement_month >= #{reqVO.settlementMonth[0]}
|
||||
</if>
|
||||
<if test="reqVO.settlementMonth[1] != null">
|
||||
and a.settlement_month <= #{reqVO.settlementMonth[1]}
|
||||
</if>
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
@ -1,12 +0,0 @@
|
||||
<?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.system.dal.mysql.linefixedassetstemporarytable.LineFixedAssetsTemporaryTableMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@ -56,7 +56,8 @@ public class StaffAttendanceRecordServiceImpl implements StaffAttendanceRecordSe
|
||||
List<StaffAttendanceRecordDO> createDo = new ArrayList<>();
|
||||
for (StaffAttendanceRecordSaveReqVO vo : createReqVO) {
|
||||
|
||||
List<StaffAttendanceRecordDO> staffAttendanceRecord = BeanUtils.toBean(vo.getRecords(), StaffAttendanceRecordDO.class);
|
||||
List<StaffAttendanceRecordDO> staffAttendanceRecord = new ArrayList<>();
|
||||
staffAttendanceRecord = BeanUtils.toBean(vo.getRecords(), StaffAttendanceRecordDO.class);
|
||||
// 移除status为空得数据
|
||||
staffAttendanceRecord.removeIf(item -> item.getStatus() == null);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user