Compare commits
29 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4dc538054c | ||
![]() |
094c01e614 | ||
![]() |
0f2366f8e6 | ||
55bc50afe2 | |||
![]() |
585e2afe5a | ||
![]() |
c512c25a50 | ||
![]() |
d899fdf3d3 | ||
![]() |
1144d4692a | ||
![]() |
4a295a4ec0 | ||
![]() |
5c08e5f5e2 | ||
![]() |
b7cb164837 | ||
![]() |
77d7620898 | ||
![]() |
9a50fa9697 | ||
![]() |
4829400ae2 | ||
![]() |
4131f6100d | ||
![]() |
6cf49d88b1 | ||
![]() |
ca80611f91 | ||
![]() |
32cc7a4f65 | ||
![]() |
e31365ad90 | ||
![]() |
bb49e919cb | ||
![]() |
3aef43868f | ||
![]() |
52fc51c738 | ||
![]() |
a4fba15a4a | ||
![]() |
d4bda37927 | ||
![]() |
8aef773086 | ||
![]() |
b6fb1c99ad | ||
![]() |
1aeef763b6 | ||
![]() |
967e02b067 | ||
![]() |
fa4b663a23 |
@ -73,7 +73,7 @@
|
||||
<!-- 三方云服务相关 -->
|
||||
<okio.version>3.5.0</okio.version>
|
||||
<okhttp3.version>4.11.0</okhttp3.version>
|
||||
<commons-io.version>2.11.0</commons-io.version>
|
||||
<commons-io.version>2.16.1</commons-io.version>
|
||||
<minio.version>8.5.6</minio.version>
|
||||
<aliyun-java-sdk-core.version>4.6.4</aliyun-java-sdk-core.version>
|
||||
<aliyun-java-sdk-dysmsapi.version>2.2.1</aliyun-java-sdk-dysmsapi.version>
|
||||
|
@ -140,6 +140,16 @@
|
||||
<version>2.0.0-jdk8-snapshot</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.alibaba</groupId>-->
|
||||
<!-- <artifactId>easyexcel-core</artifactId>-->
|
||||
<!-- <version>4.0.3</version>-->
|
||||
<!-- <scope>compile</scope>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-excel</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
|
@ -8,9 +8,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
@ -34,8 +32,25 @@ public class BpmOAEvectionApiImpl implements BpmOAEvectionApi {
|
||||
List<BpmOAEvectionDO> evectionOff = evectionService.getEvectionListByEndTime(now.minusDays(1));
|
||||
|
||||
Map<String, List<Long>> result = new HashMap<>();
|
||||
result.put("on", evectionOn.stream().map(BpmOAEvectionDO::getUserId).distinct().collect(Collectors.toList()));
|
||||
result.put("off", evectionOff.stream().map(BpmOAEvectionDO::getUserId).distinct().collect(Collectors.toList()));
|
||||
result.put("on", evectionOn.stream().flatMap(item -> {
|
||||
Set<Long> togetherUserIds = item.getTogetherUserIds();
|
||||
List<Long> ids = new ArrayList<>();
|
||||
ids.add(item.getUserId());
|
||||
if (togetherUserIds != null) {
|
||||
ids.addAll(togetherUserIds); // 将 Set 转换为 List 并添加进去
|
||||
}
|
||||
return ids.stream();
|
||||
}).distinct().collect(Collectors.toList()));
|
||||
result.put("off", evectionOff.stream().flatMap(item -> {
|
||||
Set<Long> togetherUserIds = item.getTogetherUserIds();
|
||||
List<Long> ids = new ArrayList<>();
|
||||
ids.add(item.getUserId());
|
||||
if (togetherUserIds != null) {
|
||||
ids.addAll(togetherUserIds); // 将 Set 转换为 List 并添加进去
|
||||
}
|
||||
return ids.stream();
|
||||
}).distinct().collect(Collectors.toList()));
|
||||
|
||||
return success(result);
|
||||
}
|
||||
}
|
||||
|
@ -2,9 +2,11 @@ package cn.iocoder.yudao.module.bpm.controller.admin.financialpayment;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo.FinancialPaymentPageReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo.FinancialPaymentRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo.FinancialPaymentSaveReqVO;
|
||||
@ -17,15 +19,19 @@ import cn.iocoder.yudao.module.bpm.service.financialpaymentitem.FinancialPayment
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
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.ArrayList;
|
||||
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 = "管理后台 - 财务支付管理")
|
||||
@RestController
|
||||
@ -102,6 +108,11 @@ public class FinancialPaymentController {
|
||||
@Operation(summary = "获得财务支付管理分页")
|
||||
public CommonResult<PageResult<FinancialPaymentRespVO>> getFinancialPaymentPage(@Valid FinancialPaymentPageReqVO pageReqVO) {
|
||||
PageResult<FinancialPaymentDO> pageResult = financialPaymentService.getFinancialPaymentPage(pageReqVO);
|
||||
pageResult.getList().forEach(item -> {
|
||||
if (StringUtils.isNotEmpty(item.getRecipientName())) {
|
||||
item.setRecipientName(item.getRecipientName().split(",")[0]);
|
||||
}
|
||||
});
|
||||
return success(BeanUtils.toBean(pageResult, FinancialPaymentRespVO.class));
|
||||
}
|
||||
|
||||
@ -111,4 +122,14 @@ public class FinancialPaymentController {
|
||||
FinancialPaymentDO paymentDO = financialPaymentService.getPaymentTotal(pageReqVO);
|
||||
return success(BeanUtils.toBean(paymentDO, FinancialPaymentRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出支付信息 Excel")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportFactoryInfoExcel(@Valid FinancialPaymentPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
|
||||
financialPaymentService.exportList(response, pageReqVO);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 用户 Excel 导入 VO
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免用户导入有问题
|
||||
public class FinancialExportExcelVO {
|
||||
|
||||
@ExcelProperty("姓名")
|
||||
private String nickName;
|
||||
|
||||
@ExcelProperty("报销部门")
|
||||
private String deptName;
|
||||
|
||||
@ExcelProperty("事项")
|
||||
private String detail;
|
||||
|
||||
@ExcelProperty("金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@ExcelProperty("卡号")
|
||||
private String bankNo;
|
||||
|
||||
@ExcelProperty("公账/私账")
|
||||
private String type;
|
||||
|
||||
@ExcelProperty("备注")
|
||||
private String note;
|
||||
}
|
@ -75,8 +75,8 @@ public class BpmOAContractController {
|
||||
Map<Long, AdminUserRespDTO> userMap = userApi.getUserMap(userIds);
|
||||
if (CollectionUtil.isNotEmpty(userMap)) {
|
||||
// 设置创建人、签约人名称
|
||||
respVO.setSignatoryName(userMap.get(contract.getSignatoryId()).getNickname());
|
||||
respVO.setCreateName(userMap.get(contract.getUserId()).getNickname());
|
||||
respVO.setSignatoryName(userMap.get(contract.getSignatoryId()) != null ? userMap.get(contract.getSignatoryId()).getNickname() : null);
|
||||
respVO.setCreateName(userMap.get(contract.getUserId()) != null ? userMap.get(contract.getUserId()).getNickname() : null);
|
||||
}
|
||||
|
||||
// 获取公司信息
|
||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.evection.BpmOAEvectionCreateReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.evection.BpmOAEvectionRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOAEvectionConvert;
|
||||
@ -65,6 +66,15 @@ public class BpmOAEvectionController {
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
@GetMapping("/get-list")
|
||||
@Operation(summary = "获得我的出差申请")
|
||||
public CommonResult<List<BpmOAEvectionRespVO>> getEvectionList() {
|
||||
|
||||
List<BpmOAEvectionDO> evections = evectionService.getEvectionList();
|
||||
|
||||
return success(BeanUtils.toBean(evections, BpmOAEvectionRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/getByProcessInstanceId")
|
||||
@Operation(summary = "获得出差申请")
|
||||
@Parameter(name = "processInstanceId", description = "流程实例编号", required = true, example = "1024")
|
||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses.*;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAExpensesDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAExpensesService;
|
||||
@ -62,6 +63,7 @@ public class BpmOAExpensesController {
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得生产开支申请分页")
|
||||
@DataPermission(enable = false)
|
||||
public CommonResult<PageResult<BpmOAExpensesPageRespVO>> getExpensesPage(BpmOAExpensesPageReqVO pageReqVO) {
|
||||
|
||||
PageResult<BpmOAExpensesPageRespVO> respVO = expensesService.getExpensesPage(pageReqVO);
|
||||
@ -70,6 +72,7 @@ public class BpmOAExpensesController {
|
||||
|
||||
@GetMapping("/total")
|
||||
@Operation(summary = "获得开支金额统计")
|
||||
@DataPermission(enable = false)
|
||||
public CommonResult<BpmOAExpensesTotal> getExpensesTotal(BpmOAExpensesPageReqVO pageReqVO) {
|
||||
|
||||
return success(expensesService.getExpensesTotal(pageReqVO));
|
||||
@ -98,6 +101,7 @@ public class BpmOAExpensesController {
|
||||
@GetMapping("/oneClickPayment")
|
||||
@Operation(summary = "一键支付")
|
||||
@Parameter(name = "month", description = "月份", required = true, example = "2025-04")
|
||||
@DataPermission(enable = false)
|
||||
public CommonResult<Boolean> oneClickPayment(String month) {
|
||||
|
||||
expensesService.oneClickPayment(month);
|
||||
|
@ -5,6 +5,7 @@ import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.BpmOARei
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.BpmOAReimbursementRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAReimbursementDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAReimbursementService;
|
||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||
import cn.iocoder.yudao.module.system.api.project.ProjectApi;
|
||||
import cn.iocoder.yudao.module.system.api.project.dto.ProjectDTO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@ -37,6 +38,9 @@ public class BpmOAReimbursementController {
|
||||
@Resource
|
||||
private ProjectApi projectApi;
|
||||
|
||||
@Resource
|
||||
private DeptApi deptApi;
|
||||
|
||||
@PostMapping("/create")
|
||||
// @PreAuthorize("@ss.hasPermission('bpm:oa-reimbursement:create')")
|
||||
@Operation(summary = "创建请求申请")
|
||||
@ -52,10 +56,16 @@ public class BpmOAReimbursementController {
|
||||
|
||||
BpmOAReimbursementDO reimbursement = service.getReimbursement(id);
|
||||
BpmOAReimbursementRespVO respVO = service.convert(reimbursement);
|
||||
if (respVO != null && StringUtil.isNotEmpty(respVO.getProjectNo())) {
|
||||
// 设置项目名称
|
||||
ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData();
|
||||
respVO.setProjectName(projectDTO.getName());
|
||||
if (respVO != null) {
|
||||
if (StringUtil.isNotEmpty(respVO.getProjectNo())) {
|
||||
// 设置项目名称
|
||||
ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData();
|
||||
respVO.setProjectName(projectDTO.getName());
|
||||
}
|
||||
if (respVO.getPaymentCompany() != null) {
|
||||
// 设置付款公司名称
|
||||
respVO.setPaymentCompanyName(deptApi.getDept(respVO.getPaymentCompany()).getCheckedData().getName());
|
||||
}
|
||||
}
|
||||
return success(respVO);
|
||||
}
|
||||
@ -82,10 +92,16 @@ public class BpmOAReimbursementController {
|
||||
|
||||
BpmOAReimbursementDO reimbursement = service.getByProcessInstanceId(processInstanceId);
|
||||
BpmOAReimbursementRespVO respVO = service.convert(reimbursement);
|
||||
if (respVO != null && StringUtil.isNotEmpty(respVO.getProjectNo())) {
|
||||
// 设置项目名称
|
||||
ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData();
|
||||
respVO.setProjectName(projectDTO.getName());
|
||||
if (respVO != null) {
|
||||
if (StringUtil.isNotEmpty(respVO.getProjectNo())) {
|
||||
// 设置项目名称
|
||||
ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData();
|
||||
respVO.setProjectName(projectDTO.getName());
|
||||
}
|
||||
if (respVO.getPaymentCompany() != null) {
|
||||
// 设置付款公司名称
|
||||
respVO.setPaymentCompanyName(deptApi.getDept(respVO.getPaymentCompany()).getCheckedData().getName());
|
||||
}
|
||||
}
|
||||
return success(respVO);
|
||||
}
|
||||
|
@ -1,11 +1,13 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.salary.BpmOASalaryCreateReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.salary.BpmOASalaryRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOASalaryConvert;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASalaryDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOASalaryService;
|
||||
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.api.dept.DeptApi;
|
||||
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@ -16,6 +18,10 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
@ -38,6 +44,9 @@ public class BpmOASalaryController {
|
||||
@Resource
|
||||
private DeptApi deptApi;
|
||||
|
||||
@Resource
|
||||
private FactoryInfoApi factoryInfoApi;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建请求申请")
|
||||
public CommonResult<Long> createSalary(@Valid @RequestBody BpmOASalaryCreateReqVO createReqVO) {
|
||||
@ -59,12 +68,24 @@ public class BpmOASalaryController {
|
||||
return success(new BpmOASalaryRespVO());
|
||||
}
|
||||
|
||||
// 获取部门详情
|
||||
DeptRespDTO dto = getDept(salary.getCompanyDeptId());
|
||||
BpmOASalaryRespVO respVO = BeanUtils.toBean(salary, BpmOASalaryRespVO.class);
|
||||
if (salary.getCompanyDeptId() != null) {
|
||||
// 获取部门详情
|
||||
DeptRespDTO dto = getDept(salary.getCompanyDeptId());
|
||||
|
||||
BpmOASalaryRespVO respVO = BpmOASalaryConvert.INSTANCE.convert(salary)
|
||||
.setCompanyName(dto.getName())
|
||||
.setFactoryId(dto.getFactoryId());
|
||||
respVO.setCompanyName(dto.getName());
|
||||
}else {
|
||||
// 获取工厂信息
|
||||
Set<Long> factoryIds = salary.getFactoryDeptId();
|
||||
List<FactoryInfoDTO> factoryInfoDTOS = factoryInfoApi.getFactoryInfoList(factoryIds).getCheckedData();
|
||||
|
||||
String factoryNames = factoryInfoDTOS.stream()
|
||||
.map(FactoryInfoDTO::getShortName)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.joining(","));
|
||||
|
||||
respVO.setCompanyName(factoryNames);
|
||||
}
|
||||
|
||||
return success(respVO);
|
||||
}
|
||||
@ -76,12 +97,28 @@ public class BpmOASalaryController {
|
||||
|
||||
BpmOASalaryDO salary = salaryService.getByProcessInstanceId(processInstanceId);
|
||||
|
||||
// 获取部门详情
|
||||
DeptRespDTO dto = getDept(salary.getCompanyDeptId());
|
||||
if (salary == null) {
|
||||
return success(new BpmOASalaryRespVO());
|
||||
}
|
||||
|
||||
BpmOASalaryRespVO respVO = BpmOASalaryConvert.INSTANCE.convert(salary)
|
||||
.setCompanyName(dto.getName())
|
||||
.setFactoryId(dto.getFactoryId());
|
||||
BpmOASalaryRespVO respVO = BeanUtils.toBean(salary, BpmOASalaryRespVO.class);
|
||||
if (salary.getCompanyDeptId() != null) {
|
||||
// 获取部门详情
|
||||
DeptRespDTO dto = getDept(salary.getCompanyDeptId());
|
||||
|
||||
respVO.setCompanyName(dto.getName());
|
||||
}else {
|
||||
// 获取工厂信息
|
||||
Set<Long> factoryIds = salary.getFactoryDeptId();
|
||||
List<FactoryInfoDTO> factoryInfoDTOS = factoryInfoApi.getFactoryInfoList(factoryIds).getCheckedData();
|
||||
|
||||
String factoryNames = factoryInfoDTOS.stream()
|
||||
.map(FactoryInfoDTO::getShortName)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.joining(","));
|
||||
|
||||
respVO.setCompanyName(factoryNames);
|
||||
}
|
||||
|
||||
return success(respVO);
|
||||
}
|
||||
|
@ -26,4 +26,7 @@ public class BpmOAPaymentPageReqVO extends PageParam {
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private String[] createTime;
|
||||
|
||||
@Schema(description = "申请人用户编号")
|
||||
private Long userId;
|
||||
}
|
||||
|
@ -24,6 +24,9 @@ public class BpmOAReimbursementCreateReqVO {
|
||||
@Schema(description = "开户行信息")
|
||||
private String bankName;
|
||||
|
||||
@Schema(description = "付款公司")
|
||||
private Long paymentCompany;
|
||||
|
||||
@Schema(description = "报销项目明细", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "报销项目不能为空")
|
||||
private List<Reimbursement> reimbursements;
|
||||
@ -49,6 +52,9 @@ public class BpmOAReimbursementCreateReqVO {
|
||||
@Schema(description = "备用金差额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private BigDecimal difference ;
|
||||
|
||||
@Schema(description = "业务表编号")
|
||||
private Long objectId;
|
||||
|
||||
@Schema(description = "报销发票总数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "报销发票总数不能为空")
|
||||
private Integer totalQuantity ;
|
||||
|
@ -27,6 +27,12 @@ public class BpmOAReimbursementRespVO extends BpmOABaseRespVO {
|
||||
@Schema(description = "收款人卡号")
|
||||
private String bankNo;
|
||||
|
||||
@Schema(description = "付款公司")
|
||||
private Long paymentCompany;
|
||||
|
||||
@Schema(description = "付款公司名称")
|
||||
private String paymentCompanyName;
|
||||
|
||||
@Schema(description = "报销项目明细", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "报销项目不能为空")
|
||||
private List<ReimbursementDTO> reimbursements;
|
||||
|
@ -38,4 +38,7 @@ public class Reimbursement {
|
||||
|
||||
@Schema(description = "采购计划编号", example = "1")
|
||||
private Long procureId;
|
||||
|
||||
@Schema(description = "业务表编号")
|
||||
private Long objectId;
|
||||
}
|
||||
|
@ -36,4 +36,7 @@ public class ReimbursementDTO {
|
||||
|
||||
@Schema(description = "采购计划编号", example = "1")
|
||||
private Long procureId;
|
||||
|
||||
@Schema(description = "业务表编号")
|
||||
private Long objectId;
|
||||
}
|
||||
|
@ -64,4 +64,7 @@ public class BpmOASalaryCreateReqVO {
|
||||
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "附件不能为空")
|
||||
private List<UploadUserFile> fileItems;
|
||||
|
||||
@Schema(description = "员工薪资id集合")
|
||||
private Set<Long> staffSalaryIds;
|
||||
}
|
||||
|
@ -66,4 +66,7 @@ public class BpmOASalaryRespVO extends BpmOABaseRespVO {
|
||||
|
||||
@Schema(description = "上传文件")
|
||||
private List<UploadUserFile> fileItems;
|
||||
|
||||
@Schema(description = "员工薪资id集合")
|
||||
private Set<Long> staffSalaryIds;
|
||||
}
|
||||
|
@ -39,4 +39,6 @@ public class BpmTaskDonePageReqVO extends PageParam {
|
||||
@Schema(description = "部门编号")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "任务状态")
|
||||
private Integer result ;
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.Reimbursement;
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -64,6 +63,11 @@ public class BpmOAReimbursementDO extends BaseDO {
|
||||
*/
|
||||
private String bankName;
|
||||
|
||||
/**
|
||||
* 付款公司编号
|
||||
*/
|
||||
private Long paymentCompany;
|
||||
|
||||
// /**
|
||||
// * 报销明细数据JSON
|
||||
// */
|
||||
|
@ -68,4 +68,9 @@ public class BpmOAReimbursementItemDO extends BaseDO {
|
||||
* 采购申请编号
|
||||
*/
|
||||
private Long procureId;
|
||||
|
||||
/**
|
||||
* 业务表编号
|
||||
*/
|
||||
private Long objectId;
|
||||
}
|
||||
|
@ -68,6 +68,12 @@ public class BpmOASalaryDO extends BaseDO {
|
||||
@TableField(typeHandler = JsonLongSetTypeHandler.class)
|
||||
private Set<Long> factoryDeptId;
|
||||
|
||||
/**
|
||||
* 员工薪资id集合
|
||||
*/
|
||||
@TableField(typeHandler = JsonLongSetTypeHandler.class)
|
||||
private Set<Long> staffSalaryIds;
|
||||
|
||||
/**
|
||||
* 付款总额
|
||||
*/
|
||||
|
@ -6,8 +6,10 @@ import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.evection.BpmOAEvection
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAEvectionDO;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 出差申请 Mapper
|
||||
@ -26,4 +28,6 @@ public interface BpmOAEvectionMapper extends BaseMapperX<BpmOAEvectionDO> {
|
||||
.geIfPresent(BpmOAEvectionDO::getEndTime, createReqVO.getStartTime())
|
||||
.in(BpmOAEvectionDO::getResult, Arrays.asList(BpmProcessInstanceResultEnum.PROCESS.getResult(), BpmProcessInstanceResultEnum.APPROVE.getResult())));
|
||||
}
|
||||
|
||||
List<BpmOAEvectionDO> selectEvectionList(@Param("userId") Long userId);
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ public interface BpmOAPaymentMapper extends BaseMapperX<BpmOAPaymentDO> {
|
||||
.eq(BpmOAPaymentDO::getIsTickets, 1)
|
||||
.eqIfPresent(BpmOAPaymentDO::getStatus, pageReqVO.getStatus())
|
||||
.betweenIfPresent(BpmOAPaymentDO::getCreateTime, pageReqVO.getCreateTime())
|
||||
.eqIfPresent(BpmOAPaymentDO::getUserId, pageReqVO.getUserId())
|
||||
.eq(pageReqVO.getIsMy(), BpmOAPaymentDO::getUserId, userId)
|
||||
.orderByAsc(BpmOAPaymentDO::getStatus)
|
||||
.orderByDesc(BpmOAPaymentDO::getId));
|
||||
|
@ -93,7 +93,7 @@ public interface BpmTaskExtMapper extends BaseMapperX<BpmTaskExtDO> {
|
||||
queryWrapperX.selectAs(BpmProcessInstanceExtDO::getStartUserId, BpmTaskDonePageRespVO::getStartUserId);
|
||||
queryWrapperX.selectAs(BpmProcessInstanceExtDO::getProcessDefinitionId, BpmTaskDonePageRespVO::getProcessDefinitionId);
|
||||
queryWrapperX.selectAs(BpmProcessInstanceExtDO::getCcids, BpmTaskDonePageRespVO::getCcUserIds);
|
||||
queryWrapperX.selectAs(BpmProcessInstanceExtDO::getResult, BpmTaskDonePageRespVO::getStatus ) ;
|
||||
queryWrapperX.selectAs(BpmProcessInstanceExtDO::getStatus, BpmTaskDonePageRespVO::getStatus ) ;
|
||||
|
||||
queryWrapperX.innerJoin(BpmProcessInstanceExtDO.class, on -> on
|
||||
.eq(BpmTaskExtDO::getProcessInstanceId, BpmProcessInstanceExtDO::getProcessInstanceId)
|
||||
@ -102,7 +102,10 @@ public interface BpmTaskExtMapper extends BaseMapperX<BpmTaskExtDO> {
|
||||
queryWrapperX.likeRight(BpmProcessInstanceExtDO::getProcessDefinitionId, "oa_");
|
||||
queryWrapperX.eq(BpmTaskExtDO::getAssigneeUserId, userId);
|
||||
queryWrapperX.ne(BpmTaskExtDO::getReason, BpmConstants.AUTO_APPRAVAL);
|
||||
queryWrapperX.ne(BpmTaskExtDO::getResult,4); //还未开始审批,发起人主动撤销的流程,不显示
|
||||
// queryWrapperX.ne(BpmTaskExtDO::getResult,4); //还未开始审批,发起人主动撤销的流程,不显示
|
||||
if (pageVO.getResult() != null) {
|
||||
queryWrapperX.eq(BpmTaskExtDO::getResult,pageVO.getResult());
|
||||
}
|
||||
queryWrapperX.betweenIfPresent(BpmTaskExtDO::getCreateTime, pageVO.getCreateTime());
|
||||
queryWrapperX.orderByDesc(BpmTaskExtDO::getEndTime);
|
||||
|
||||
|
@ -19,6 +19,7 @@ import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@ -93,9 +94,14 @@ public class BpmTaskFactoryLeaderScript extends BpmTaskAssignLeaderAbstractScrip
|
||||
if (salaryDO != null) {
|
||||
|
||||
// 获取申请部门信息
|
||||
DeptRespDTO deptRespDTO = deptApi.getDept(salaryDO.getCompanyDeptId()).getCheckedData();
|
||||
DeptRespDTO deptRespDTO = null;
|
||||
if (salaryDO.getCompanyDeptId() != null) {
|
||||
deptRespDTO = deptApi.getDept(salaryDO.getCompanyDeptId()).getCheckedData();
|
||||
}else if (CollUtil.isNotEmpty(salaryDO.getFactoryDeptId())) {
|
||||
deptRespDTO = deptApi.getDeptByFactoryId(new ArrayList<>(salaryDO.getFactoryDeptId()).get(0)).getCheckedData();
|
||||
}
|
||||
// 判断是否是属于工厂部门
|
||||
if (deptRespDTO != null && deptRespDTO.getFactoryId() != null) {
|
||||
if (deptRespDTO != null) {
|
||||
dept = deptApi.getDept(deptRespDTO.getParentId()).getCheckedData();
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import cn.iocoder.yudao.module.product.api.storeproduct.StoreProductApi;
|
||||
import cn.iocoder.yudao.module.product.api.storeproductattrvalue.StoreProductAttrValueApi;
|
||||
import cn.iocoder.yudao.module.smartfactory.api.factoryInfo.FactoryInfoApi;
|
||||
import cn.iocoder.yudao.module.smartfactory.api.staff.StaffApi;
|
||||
import cn.iocoder.yudao.module.smartfactory.api.staffSalary.StaffSalaryApi;
|
||||
import cn.iocoder.yudao.module.system.api.assetreceive.AssetReceiveApi;
|
||||
import cn.iocoder.yudao.module.system.api.assets.AssetsApi;
|
||||
import cn.iocoder.yudao.module.system.api.assets.AssetsTypeApi;
|
||||
@ -45,7 +46,8 @@ import org.springframework.context.annotation.Configuration;
|
||||
SubscribeMessageSendApi.class, SocialClientApi.class, UsersExtApi.class, AttendanceApi.class, BankApi.class, ConfigApi.class, PositionApi.class, SupplierApi.class, AssetsApi.class,
|
||||
AssetsTypeApi.class, AssetReceiveApi.class, AttendanceApi.class, AttendanceGroupApi.class, WorkOvertimeApi.class, HolidayApi.class,
|
||||
RentalOrderApi.class, RentalDepositRecordApi.class, ProjectApi.class, RentalItemsRecordApi.class,AdminOauthUserOtherInfoApi.class, StoreProductAttrValueApi.class, StoreProductApi.class,
|
||||
ContractApi.class, BusinessApi.class, CrmCustomerApi.class, StaffApi.class, LoanApi.class, FactoryInfoApi.class, UserLiveTreeApi.class, SalesPerformanceSettlementApi.class
|
||||
ContractApi.class, BusinessApi.class, CrmCustomerApi.class, StaffApi.class, LoanApi.class, FactoryInfoApi.class, UserLiveTreeApi.class, SalesPerformanceSettlementApi.class,
|
||||
StaffSalaryApi.class
|
||||
})
|
||||
public class RpcConfiguration {
|
||||
}
|
||||
|
@ -0,0 +1,77 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.financialpayment;
|
||||
|
||||
import com.alibaba.excel.metadata.Head;
|
||||
import com.alibaba.excel.metadata.data.WriteCellData;
|
||||
import com.alibaba.excel.write.handler.CellWriteHandler;
|
||||
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
|
||||
import com.alibaba.excel.write.metadata.holder.WriteTableHolder;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class CustomCellStyleHandler implements CellWriteHandler {
|
||||
|
||||
private final Map<String, CellStyle> styleCache = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void afterCellDispose(
|
||||
WriteSheetHolder writeSheetHolder,
|
||||
WriteTableHolder writeTableHolder,
|
||||
List<WriteCellData<?>> cellDataList,
|
||||
Cell cell,
|
||||
Head head,
|
||||
Integer relativeRowIndex,
|
||||
Boolean isHead) {
|
||||
|
||||
Workbook workbook = writeSheetHolder.getSheet().getWorkbook();
|
||||
writeSheetHolder.getSheet().setColumnWidth(cell.getColumnIndex(), 7120);
|
||||
|
||||
// 获取或创建样式
|
||||
CellStyle cellStyle = getOrCreateCellStyle(workbook, isHead, relativeRowIndex, cellDataList);
|
||||
|
||||
cell.setCellStyle(cellStyle);
|
||||
}
|
||||
|
||||
private CellStyle getOrCreateCellStyle(Workbook workbook, Boolean isHead, Integer relativeRowIndex, List<WriteCellData<?>> cellDataList) {
|
||||
String key = generateStyleKey(isHead, relativeRowIndex);
|
||||
if (styleCache.containsKey(key)) {
|
||||
return styleCache.get(key);
|
||||
}
|
||||
|
||||
CellStyle cellStyle = workbook.createCellStyle();
|
||||
cellStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
|
||||
// if (isHead != null && isHead) {
|
||||
// setHeaderStyle(workbook, cellStyle, relativeRowIndex, cellDataList);
|
||||
// }
|
||||
|
||||
styleCache.put(key, cellStyle);
|
||||
return cellStyle;
|
||||
}
|
||||
|
||||
private void setHeaderStyle(Workbook workbook, CellStyle cellStyle, Integer relativeRowIndex, List<WriteCellData<?>> cellDataList) {
|
||||
if (relativeRowIndex == 0 || relativeRowIndex == 1) {
|
||||
applyStyle(workbook, cellStyle, IndexedColors.TURQUOISE.getIndex(), (short) 20, cellDataList);
|
||||
} else if (relativeRowIndex == 2 || relativeRowIndex == 3) {
|
||||
applyStyle(workbook, cellStyle, IndexedColors.LIGHT_YELLOW.getIndex(), (short) 20, cellDataList);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void applyStyle(Workbook workbook, CellStyle cellStyle, short backgroundColor, short fontSize, List<WriteCellData<?>> cellDataList) {
|
||||
cellStyle.setFillForegroundColor(backgroundColor);
|
||||
cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
||||
|
||||
Font font = workbook.createFont();
|
||||
font.setFontHeightInPoints(fontSize);
|
||||
cellStyle.setFont(font);
|
||||
cellDataList.get(0).setWriteCellStyle(null);
|
||||
}
|
||||
|
||||
private String generateStyleKey(Boolean isHead, Integer relativeRowIndex) {
|
||||
return "isHead:" + isHead + ",rowIndex:" + relativeRowIndex;
|
||||
}
|
||||
}
|
@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo.Financia
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo.FinancialPaymentSaveVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpayment.FinancialPaymentDO;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
@ -102,4 +103,11 @@ public interface FinancialPaymentService {
|
||||
* @return 统计信息
|
||||
*/
|
||||
FinancialPaymentDO getPaymentTotal(FinancialPaymentPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 导出支付信息
|
||||
* @param response 响应
|
||||
* @param pageReqVO 查询条件
|
||||
*/
|
||||
void exportList(HttpServletResponse response, FinancialPaymentPageReqVO pageReqVO);
|
||||
}
|
||||
|
@ -25,7 +25,6 @@ import cn.iocoder.yudao.module.bpm.dal.mysql.oa.*;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.task.BpmProcessInstanceExtMapper;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceStatusEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAExpensesService;
|
||||
import cn.iocoder.yudao.module.system.api.auth.AdminOauthUserOtherInfoApi;
|
||||
import cn.iocoder.yudao.module.system.api.auth.dto.AdminOauthUserOtherInfoApiDTO;
|
||||
import cn.iocoder.yudao.module.system.api.auth.vo.AdminOauthUserOtherInfoApiVO;
|
||||
@ -33,6 +32,8 @@ import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||
import cn.iocoder.yudao.module.system.api.loan.LoanApi;
|
||||
import cn.iocoder.yudao.module.system.api.loan.dto.LoanDTO;
|
||||
import cn.iocoder.yudao.module.system.api.subscribe.SubscribeMessageSendApi;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.support.ExcelTypeEnum;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -40,10 +41,13 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserId;
|
||||
|
||||
@ -286,4 +290,121 @@ public class FinancialPaymentServiceImpl implements FinancialPaymentService {
|
||||
pageReqVO.setReceiveUserId(getLoginUserId());
|
||||
return financialPaymentMapper.selectPaymentTotal(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportList(HttpServletResponse response, FinancialPaymentPageReqVO pageReqVO) {
|
||||
|
||||
try {
|
||||
if (pageReqVO.getStatus() == null) {
|
||||
pageReqVO.setStatus(0);
|
||||
}
|
||||
|
||||
// 获取支付信息数据
|
||||
List<FinancialPaymentDO> list = this.getFinancialPaymentPage(pageReqVO).getList();
|
||||
list.removeIf(item -> item.getCompanyId() == null);
|
||||
|
||||
// 根据付款公司进行分组
|
||||
Map<Long, List<FinancialPaymentDO>> companyIdMap = list.stream().collect(Collectors.groupingBy(FinancialPaymentDO::getCompanyId));
|
||||
|
||||
List<List<String>> data = new ArrayList<>();
|
||||
for (Map.Entry<Long, List<FinancialPaymentDO>> entry : companyIdMap.entrySet()) {
|
||||
|
||||
// 设置表头
|
||||
data.add(Arrays.asList(entry.getValue().get(0).getCompanyName(), entry.getValue().get(0).getCompanyName(), entry.getValue().get(0).getCompanyName(),
|
||||
entry.getValue().get(0).getCompanyName(), entry.getValue().get(0).getCompanyName(), entry.getValue().get(0).getCompanyName(), entry.getValue().get(0).getCompanyName()));
|
||||
data.add(this.setTitle());
|
||||
|
||||
// 提取所有公账 支付信息
|
||||
List<FinancialPaymentDO> publicAccount = entry.getValue().stream()
|
||||
.filter(item -> item.getType() != 9)
|
||||
.collect(Collectors.toList());
|
||||
// 提取所有私账 支付信息
|
||||
List<FinancialPaymentDO> privateAccount = entry.getValue().stream()
|
||||
.filter(item -> item.getType() == 9)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 遍历公账信息
|
||||
for (FinancialPaymentDO financialPaymentDO : publicAccount) {
|
||||
List<String> row = new ArrayList<>();
|
||||
// 设置姓名
|
||||
row.add(financialPaymentDO.getNickname());
|
||||
// 设置报销部门
|
||||
row.add(financialPaymentDO.getDeptName());
|
||||
// 添加事项
|
||||
row.add(financialPaymentDO.getReason());
|
||||
// 添加金额
|
||||
row.add(financialPaymentDO.getAmountPayable().toString());
|
||||
// 添加卡号
|
||||
row.add(financialPaymentDO.getRecipientName());
|
||||
// 添加公账/私账
|
||||
row.add("公账");
|
||||
// 添加备注
|
||||
row.add(financialPaymentDO.getNickname() + "报销");
|
||||
|
||||
data.add(row);
|
||||
}
|
||||
|
||||
if (CollUtil.isNotEmpty(publicAccount)) {
|
||||
// 添加公账合计数据
|
||||
BigDecimal publicAccountTotal = publicAccount.stream().map(FinancialPaymentDO::getAmountPayable).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
data.add(Arrays.asList("公账总计", "公账总计", "公账总计", publicAccountTotal.toString(), "", "公账"));
|
||||
}
|
||||
|
||||
// 遍历私账信息
|
||||
for (FinancialPaymentDO financialPaymentDO : privateAccount) {
|
||||
List<String> row = new ArrayList<>();
|
||||
// 设置姓名
|
||||
row.add(financialPaymentDO.getNickname());
|
||||
// 设置报销部门
|
||||
row.add(financialPaymentDO.getDeptName());
|
||||
// 添加事项
|
||||
row.add(financialPaymentDO.getReason());
|
||||
// 添加金额
|
||||
row.add(financialPaymentDO.getAmountPayable().toString());
|
||||
// 添加卡号
|
||||
row.add(financialPaymentDO.getRecipientName());
|
||||
// 添加公账/私账
|
||||
row.add("私账");
|
||||
// 添加备注
|
||||
row.add(financialPaymentDO.getNickname() + "报销");
|
||||
|
||||
data.add(row);
|
||||
}
|
||||
|
||||
if (CollUtil.isNotEmpty(privateAccount)) {
|
||||
// 添加私账合计数据
|
||||
BigDecimal privateAccountTotal = privateAccount.stream().map(FinancialPaymentDO::getAmountPayable).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
data.add(Arrays.asList("私账总计", "私账总计", "私账总计", privateAccountTotal.toString(), "", "私账"));
|
||||
}
|
||||
}
|
||||
|
||||
EasyExcel.write(response.getOutputStream())
|
||||
.autoCloseStream(false)
|
||||
.excelType(ExcelTypeEnum.XLSX)
|
||||
.sheet("账目明细")
|
||||
.registerWriteHandler(new CustomCellStyleHandler())
|
||||
.registerWriteHandler(new MergeSameRowCellsHandler())
|
||||
.doWrite(data);
|
||||
|
||||
response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("账目", StandardCharsets.UTF_8.name()));
|
||||
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
||||
|
||||
} catch (IOException e) {
|
||||
log.error("[exportList][导出失败]", e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private List<String> setTitle() {
|
||||
List<String> titleRow = new ArrayList<>();
|
||||
titleRow.add("姓名");
|
||||
titleRow.add("报销部门");
|
||||
titleRow.add("事项");
|
||||
titleRow.add("金额");
|
||||
titleRow.add("卡号");
|
||||
titleRow.add("公账/私账");
|
||||
titleRow.add("备注");
|
||||
|
||||
return titleRow;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,130 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.financialpayment;
|
||||
|
||||
import com.alibaba.excel.metadata.Head;
|
||||
import com.alibaba.excel.write.handler.SheetWriteHandler;
|
||||
import com.alibaba.excel.write.merge.AbstractMergeStrategy;
|
||||
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
|
||||
import com.alibaba.excel.write.metadata.holder.WriteTableHolder;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class MergeSameRowCellsHandler extends AbstractMergeStrategy implements SheetWriteHandler {
|
||||
|
||||
// 记录每行需要合并的区域:<行索引, [起始列, 结束列]列表>
|
||||
private final Map<Integer, List<int[]>> mergeMap = new HashMap<>();
|
||||
|
||||
@Override
|
||||
protected void merge(Sheet sheet, Cell cell, Head head, Integer relativeRowIndex) {
|
||||
// 当前单元格坐标
|
||||
int rowIdx = cell.getRowIndex();
|
||||
int colIdx = cell.getColumnIndex();
|
||||
|
||||
// 获取当前单元格值(按需处理空值)
|
||||
Object cellValue = getCellValue(cell);
|
||||
// 跳过空值单元格
|
||||
if (cellValue == null || "".equals(cellValue)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 初始化该行的合并区域记录
|
||||
mergeMap.computeIfAbsent(rowIdx, k -> new ArrayList<>());
|
||||
|
||||
List<int[]> ranges = mergeMap.get(rowIdx);
|
||||
if (ranges.isEmpty()) {
|
||||
// 第一个单元格直接作为合并起点
|
||||
ranges.add(new int[]{colIdx, colIdx});
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取最后一个合并区域
|
||||
int[] lastRange = ranges.get(ranges.size() - 1);
|
||||
int lastColEnd = lastRange[1];
|
||||
|
||||
// 如果当前单元格与前一列值相同且连续,则扩展合并区域
|
||||
if (colIdx == lastColEnd + 1 && isSameValue(cell, sheet, rowIdx, lastColEnd)) {
|
||||
lastRange[1] = colIdx; // 扩展区域右边界
|
||||
} else {
|
||||
// 创建新合并区域
|
||||
ranges.add(new int[]{colIdx, colIdx});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Cell cell, Head head, Integer relativeRowIndex, Boolean isHead) {
|
||||
// 调用父类的 merge 方法
|
||||
this.merge(writeSheetHolder.getSheet(), cell, head, relativeRowIndex);
|
||||
|
||||
Sheet sheet = writeSheetHolder.getSheet();
|
||||
|
||||
// 应用所有合并区域
|
||||
for (Map.Entry<Integer, List<int[]>> entry : mergeMap.entrySet()) {
|
||||
int rowIdx = entry.getKey();
|
||||
for (int[] range : entry.getValue()) {
|
||||
if (range[0] < range[1]) { // 需要合并的列数>1
|
||||
|
||||
CellRangeAddress newRegion = new CellRangeAddress(rowIdx, rowIdx, range[0], range[1]);
|
||||
|
||||
// 获取当前 sheet 所有已存在的合并区域
|
||||
List<CellRangeAddress> mergedRegions = sheet.getMergedRegions();
|
||||
|
||||
// 查找所有与新区域重叠的旧区域并记录其索引
|
||||
List<Integer> toRemoveIndices = new ArrayList<>();
|
||||
for (int i = 0; i < mergedRegions.size(); i++) {
|
||||
CellRangeAddress existingRegion = mergedRegions.get(i);
|
||||
if (isOverlapping(existingRegion, newRegion)) {
|
||||
toRemoveIndices.add(i);
|
||||
}
|
||||
}
|
||||
|
||||
// 先移除冲突的旧合并区域(注意:索引是动态变化的,应倒序删除)
|
||||
for (int i = toRemoveIndices.size() - 1; i >= 0; i--) {
|
||||
int indexToRemove = toRemoveIndices.get(i);
|
||||
sheet.removeMergedRegion(indexToRemove);
|
||||
}
|
||||
|
||||
// 添加新的合并区域
|
||||
sheet.addMergedRegion(newRegion);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 判断两个合并区域是否有重叠
|
||||
private boolean isOverlapping(CellRangeAddress region1, CellRangeAddress region2) {
|
||||
return region1.getFirstRow() <= region2.getLastRow() &&
|
||||
region1.getLastRow() >= region2.getFirstRow() &&
|
||||
region1.getFirstColumn() <= region2.getLastColumn() &&
|
||||
region1.getLastColumn() >= region2.getFirstColumn();
|
||||
}
|
||||
|
||||
// 比较两个单元格的值是否相同(处理空值)
|
||||
private boolean isSameValue(Cell currentCell, Sheet sheet, int row, int col) {
|
||||
Cell prevCell = sheet.getRow(row).getCell(col);
|
||||
Object val1 = getCellValue(currentCell);
|
||||
Object val2 = getCellValue(prevCell);
|
||||
|
||||
if (val1 == null) {
|
||||
return val2 == null;
|
||||
}
|
||||
return val1.equals(val2);
|
||||
}
|
||||
|
||||
// 安全获取单元格值
|
||||
private Object getCellValue(Cell cell) {
|
||||
if (cell == null) {
|
||||
return null;
|
||||
}
|
||||
switch (cell.getCellType()) {
|
||||
case STRING: return cell.getStringCellValue();
|
||||
case NUMERIC: return cell.getNumericCellValue();
|
||||
case BOOLEAN: return cell.getBooleanCellValue();
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
}
|
@ -252,7 +252,7 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
||||
.setAmountPayable(isImprest == 1 ? amount.abs() : cash.getTotalMoney())
|
||||
.setBeginTime(processInstance.getCreateTime())
|
||||
.setEndTime(processInstance.getEndTime())
|
||||
.setRecipientName(bankRespDTO.getNickname())
|
||||
.setRecipientName(bankRespDTO != null ? bankRespDTO.getNickname() + "," + bankRespDTO.getBankNo() + "," + bankRespDTO.getBankName() : "")
|
||||
.setCompanyId(deptRespDTO != null ? deptRespDTO.getId() : null)
|
||||
);
|
||||
}
|
||||
|
@ -54,4 +54,10 @@ public interface BpmOAEvectionService {
|
||||
* @return 出差申请列表
|
||||
*/
|
||||
List<BpmOAEvectionDO> getEvectionListByEndTime(LocalDate date);
|
||||
|
||||
/**
|
||||
* 获得我的出差申请列表
|
||||
* @return 出差申请列表
|
||||
*/
|
||||
List<BpmOAEvectionDO> getEvectionList();
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_EVECTION_IS_EXISTS;
|
||||
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_EVECTION_NOT_EXISTS;
|
||||
|
||||
@ -150,4 +151,10 @@ public class BpmOAEvectionServiceImpl extends BpmOABaseService implements BpmOAE
|
||||
.eq(BpmOAEvectionDO::getResult, BpmProcessInstanceResultEnum.APPROVE.getResult())
|
||||
.likeIfPresent(BpmOAEvectionDO::getEndTime, date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BpmOAEvectionDO> getEvectionList() {
|
||||
|
||||
return evectionMapper.selectEvectionList(getLoginUserId());
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,6 @@ 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;
|
||||
@ -289,7 +288,7 @@ public class BpmOAExpensesServiceImpl extends BpmOABaseService implements BpmOAE
|
||||
.setProcessInstanceName(processInstance.getName())
|
||||
.setBeginTime(processInstance.getCreateTime())
|
||||
.setEndTime(processInstance.getEndTime())
|
||||
.setRecipientName(bankRespDTO != null ? bankRespDTO.getNickname() : "")
|
||||
.setRecipientName(bankRespDTO != null ? bankRespDTO.getNickname() + "," + bankRespDTO.getBankNo() + "," + bankRespDTO.getBankName() : "")
|
||||
.setCompanyFactoryId(dto.getId())
|
||||
);
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ public class BpmOAImprestServiceImpl extends BpmOABaseService implements BpmOAIm
|
||||
.setProcessInstanceName(processInstance.getName())
|
||||
.setBeginTime(processInstance.getCreateTime())
|
||||
.setEndTime(processInstance.getEndTime())
|
||||
.setRecipientName(bankRespDTO.getNickname())
|
||||
.setRecipientName(bankRespDTO != null ? bankRespDTO.getNickname() + "," + bankRespDTO.getBankNo() + "," + bankRespDTO.getBankName() : "")
|
||||
.setCompanyId(deptRespDTO != null ? deptRespDTO.getId() : null)
|
||||
);
|
||||
}
|
||||
|
@ -20,6 +20,8 @@ import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.financialpayment.FinancialPaymentService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmHistoryProcessInstanceService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
||||
import cn.iocoder.yudao.module.smartfactory.api.factoryInfo.FactoryInfoApi;
|
||||
import cn.iocoder.yudao.module.smartfactory.api.factoryInfo.dto.FactoryInfoDTO;
|
||||
import cn.iocoder.yudao.module.smartfactory.api.staff.StaffApi;
|
||||
import cn.iocoder.yudao.module.smartfactory.api.staff.dto.StaffDTO;
|
||||
import cn.iocoder.yudao.module.system.api.bank.BankApi;
|
||||
@ -77,6 +79,9 @@ public class BpmOALoanServiceImpl extends BpmOABaseService implements BpmOALoanS
|
||||
@Resource
|
||||
private BankApi bankApi;
|
||||
|
||||
@Resource
|
||||
private FactoryInfoApi factoryInfoApi;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@ -97,8 +102,19 @@ public class BpmOALoanServiceImpl extends BpmOABaseService implements BpmOALoanS
|
||||
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
||||
loanMapper.insert(loan);
|
||||
|
||||
|
||||
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
// 提交是费用借支时
|
||||
if (vo.getLoanType() == 2) {
|
||||
|
||||
// 获取借支人所属厂区信息
|
||||
FactoryInfoDTO factoryInfoDTO = factoryInfoApi.getFactoryInfo(loan.getFactoryId()).getCheckedData();
|
||||
processInstanceVariables.put("factoryType", factoryInfoDTO.getType());
|
||||
}
|
||||
|
||||
processInstanceVariables.put("loanType", loan.getLoanType());
|
||||
String processInstanceId = processInstanceService.createProcessInstance(userId,
|
||||
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
|
||||
.setVariables(processInstanceVariables).setBusinessKey(String.valueOf(loan.getId())));
|
||||
@ -158,7 +174,7 @@ public class BpmOALoanServiceImpl extends BpmOABaseService implements BpmOALoanS
|
||||
.setProcessInstanceName(processInstance.getName())
|
||||
.setBeginTime(processInstance.getCreateTime())
|
||||
.setEndTime(processInstance.getEndTime())
|
||||
.setRecipientName(bankRespDTO.getNickname())
|
||||
.setRecipientName(bankRespDTO != null ? bankRespDTO.getNickname() + "," + bankRespDTO.getBankNo() + "," + bankRespDTO.getBankName() : "")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ public class BpmOAPaymentServiceImpl extends BpmOABaseService implements BpmOAPa
|
||||
.setProcessInstanceName(processInstance.getName())
|
||||
.setBeginTime(processInstance.getCreateTime())
|
||||
.setEndTime(processInstance.getEndTime())
|
||||
.setRecipientName(bankRespDTO.getNickname())
|
||||
.setRecipientName(bankRespDTO != null ? bankRespDTO.getNickname() + "," + bankRespDTO.getBankNo() + "," + bankRespDTO.getBankName() : "")
|
||||
.setCompanyId(deptRespDTO != null ? deptRespDTO.getId() : null)
|
||||
);
|
||||
}
|
||||
@ -276,9 +276,9 @@ public class BpmOAPaymentServiceImpl extends BpmOABaseService implements BpmOAPa
|
||||
// 获取银行卡信息
|
||||
BankRespDTO bankResp = bankApi.getBank(payment.getBankId()).getCheckedData();
|
||||
// 设置银行卡信息
|
||||
respVO.setBankName(bankResp.getBankName());
|
||||
respVO.setBankNo(bankResp.getBankNo());
|
||||
respVO.setNickname(bankResp.getNickname());
|
||||
respVO.setBankName(bankResp != null ? bankResp.getBankName() : null);
|
||||
respVO.setBankNo(bankResp != null ? bankResp.getBankNo() : null);
|
||||
respVO.setNickname(bankResp != null ? bankResp.getNickname() : null);
|
||||
}
|
||||
}
|
||||
return respVO;
|
||||
|
@ -25,7 +25,6 @@ import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.financialpayment.FinancialPaymentService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmHistoryProcessInstanceService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
||||
import cn.iocoder.yudao.module.system.api.bank.dto.BankRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
@ -101,6 +100,7 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long createReimbursement(Long userId, BpmOAReimbursementCreateReqVO createReqVO) {
|
||||
BpmOAReimbursementDO reimbursement = BpmOAReimbursementConvert.INSTANCE.convert(createReqVO).setUserId(userId)
|
||||
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
||||
@ -120,6 +120,8 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
||||
createDO.forEach(item -> item.setReimbursementId(reimbursement.getId()));
|
||||
reimbursementItemMapper.insertBatch(createDO);
|
||||
|
||||
// 同步更新
|
||||
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
String processInstanceId = processInstanceApi.createProcessInstance(userId,
|
||||
@ -249,7 +251,7 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
||||
.setProcessInstanceName(processInstance.getName())
|
||||
.setBeginTime(processInstance.getCreateTime())
|
||||
.setEndTime(processInstance.getEndTime())
|
||||
.setRecipientName(bpmOAReimbursementDO.getNickname())
|
||||
.setRecipientName(bpmOAReimbursementDO.getNickname() + "," + bpmOAReimbursementDO.getBankNo() + "," + bpmOAReimbursementDO.getBankName())
|
||||
.setCompanyId(deptRespDTO != null ? deptRespDTO.getId() : null)
|
||||
);
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.financialpayment.FinancialPaymentService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmHistoryProcessInstanceService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
||||
import cn.iocoder.yudao.module.system.api.bank.dto.BankRespDTO;
|
||||
import cn.iocoder.yudao.module.smartfactory.api.staffSalary.StaffSalaryApi;
|
||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
@ -62,6 +62,9 @@ public class BpmOASalaryServiceImpl extends BpmOABaseService implements BpmOASal
|
||||
@Resource
|
||||
private FinancialPaymentService financialPaymentService;
|
||||
|
||||
@Resource
|
||||
private StaffSalaryApi staffSalaryApi;
|
||||
|
||||
@Override
|
||||
public Long createSalary(Long userId, BpmOASalaryCreateReqVO createReqVO) {
|
||||
|
||||
@ -97,12 +100,18 @@ public class BpmOASalaryServiceImpl extends BpmOABaseService implements BpmOASal
|
||||
if (fileItems != null && !fileItems.isEmpty()) {
|
||||
uploadBpmFileProcessInstanceId(processInstanceId,fileItems) ;
|
||||
}
|
||||
|
||||
// 同步更新 员工薪资表已发放工资状态
|
||||
staffSalaryApi.updateIsGrant(salary.getStaffSalaryIds(), 1);
|
||||
|
||||
return salary.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSalaryResult(String processInstanceId, Long id, Integer result) {
|
||||
BpmOASalaryDO salaryDO = validateLeaveExists(id);
|
||||
salaryMapper.updateById(new BpmOASalaryDO().setId(id).setResult(result));
|
||||
|
||||
//审核通过 (最后节点)
|
||||
if (BpmProcessInstanceResultEnum.APPROVE.getResult().equals(result)) {
|
||||
|
||||
@ -130,7 +139,17 @@ public class BpmOASalaryServiceImpl extends BpmOABaseService implements BpmOASal
|
||||
);
|
||||
}
|
||||
}
|
||||
salaryMapper.updateById(new BpmOASalaryDO().setId(id).setResult(result));
|
||||
|
||||
// -- 自己取消
|
||||
// -- 审核拒绝
|
||||
//所有关联的采购申请改为 未支付状态
|
||||
if (BpmProcessInstanceResultEnum.REJECT.getResult().equals(result)
|
||||
|| BpmProcessInstanceResultEnum.CANCEL.getResult().equals(result)
|
||||
|| BpmProcessInstanceResultEnum.BACK.getResult().equals(result)) {
|
||||
|
||||
// 还原员工薪资表已发放工资状态
|
||||
staffSalaryApi.updateIsGrant(salaryDO.getStaffSalaryIds(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
private BpmOASalaryDO validateLeaveExists(Long id) {
|
||||
|
File diff suppressed because one or more lines are too long
@ -28,6 +28,8 @@ import cn.iocoder.yudao.module.bpm.service.definition.BpmProcessDefinitionServic
|
||||
import cn.iocoder.yudao.module.bpm.service.message.BpmMessageService;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOASalaryService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.dto.ProcessInstanceVariablesDTO;
|
||||
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.api.dept.DeptApi;
|
||||
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
@ -99,6 +101,9 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
||||
@Resource
|
||||
private DeptApi deptApi;
|
||||
|
||||
@Resource
|
||||
private FactoryInfoApi factoryInfoApi;
|
||||
|
||||
@Resource
|
||||
private BpmTaskExtMapper taskExtMapper;
|
||||
|
||||
@ -212,16 +217,45 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
||||
|
||||
// 获取薪资付款列表
|
||||
List<BpmOASalaryDO> salaryDOS = salaryService.getListByProcessInstanceIds(processInstanceIds);
|
||||
// 获取公司编号map
|
||||
Map<String, Long> salaryDeptMap = salaryDOS.stream()
|
||||
.filter(item -> item.getCompanyDeptId() != null)
|
||||
.collect(Collectors.toMap(BpmOASalaryDO::getProcessInstanceId, BpmOASalaryDO::getCompanyDeptId));
|
||||
// 获取工厂编号Map
|
||||
Map<String, Set<Long>> factoryDeptMap = salaryDOS.stream()
|
||||
.filter(item -> CollUtil.isNotEmpty(item.getFactoryDeptId()))
|
||||
.collect(Collectors.toMap(BpmOASalaryDO::getProcessInstanceId, BpmOASalaryDO::getFactoryDeptId));
|
||||
// 获取付款部门信息
|
||||
Map<Long, DeptRespDTO> dtoMap = deptApi.getDeptMap(convertSet(salaryDOS, BpmOASalaryDO::getCompanyDeptId));
|
||||
// 获取付款工厂信息
|
||||
Map<Long, FactoryInfoDTO> factoryInfoDTOMap = factoryInfoApi.getFactoryMap(factoryDeptMap.values()
|
||||
.stream()
|
||||
.flatMap(Set::stream)
|
||||
.collect(Collectors.toSet()));
|
||||
// 组合数据
|
||||
Map<String, List<FactoryInfoDTO>> groupedMap = factoryDeptMap.entrySet()
|
||||
.stream()
|
||||
.collect(Collectors.toMap(
|
||||
Map.Entry::getKey,
|
||||
entry -> entry.getValue().stream()
|
||||
.map(factoryInfoDTOMap::get)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList())
|
||||
));
|
||||
|
||||
pageResp.getRecords().forEach(item -> {
|
||||
if (salaryDeptMap.containsKey(item.getProcessInstanceId())) {
|
||||
item.setStartUserNickname(item.getStartUserNickname() +
|
||||
"(" +
|
||||
dtoMap.get(salaryDeptMap.get(item.getProcessInstanceId())).getName() +
|
||||
")");
|
||||
}else if (factoryDeptMap.containsKey(item.getProcessInstanceId())) {
|
||||
item.setStartUserNickname(item.getStartUserNickname() +
|
||||
"(" +
|
||||
groupedMap.get(item.getProcessInstanceId()).stream()
|
||||
.map(FactoryInfoDTO::getShortName)
|
||||
.collect(Collectors.joining(",")) +
|
||||
")");
|
||||
}
|
||||
});
|
||||
|
||||
@ -263,10 +297,31 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
||||
// 获取薪资付款列表
|
||||
List<BpmOASalaryDO> salaryDOS = salaryService.getListByProcessInstanceIds(processInstanceIds);
|
||||
Map<String, Long> salaryDeptMap = salaryDOS.stream()
|
||||
.filter(item -> item.getCompanyDeptId() != null)
|
||||
.collect(Collectors.toMap(BpmOASalaryDO::getProcessInstanceId, BpmOASalaryDO::getCompanyDeptId));
|
||||
// 获取付款部门信息
|
||||
Map<Long, DeptRespDTO> dtoMap = deptApi.getDeptMap(convertSet(salaryDOS, BpmOASalaryDO::getCompanyDeptId));
|
||||
|
||||
// 获取工厂编号Map
|
||||
Map<String, Set<Long>> factoryDeptMap = salaryDOS.stream()
|
||||
.filter(item -> CollUtil.isNotEmpty(item.getFactoryDeptId()))
|
||||
.collect(Collectors.toMap(BpmOASalaryDO::getProcessInstanceId, BpmOASalaryDO::getFactoryDeptId));
|
||||
// 获取付款工厂信息
|
||||
Map<Long, FactoryInfoDTO> factoryInfoDTOMap = factoryInfoApi.getFactoryMap(factoryDeptMap.values()
|
||||
.stream()
|
||||
.flatMap(Set::stream)
|
||||
.collect(Collectors.toSet()));
|
||||
// 组合数据
|
||||
Map<String, List<FactoryInfoDTO>> groupedMap = factoryDeptMap.entrySet()
|
||||
.stream()
|
||||
.collect(Collectors.toMap(
|
||||
Map.Entry::getKey,
|
||||
entry -> entry.getValue().stream()
|
||||
.map(factoryInfoDTOMap::get)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList())
|
||||
));
|
||||
|
||||
pageResult.getList().forEach(item -> {
|
||||
item.setStartUserNickname(userMap.get(item.getStartUserId()).getNickname());
|
||||
if (salaryDeptMap.containsKey(item.getProcessInstanceId())) {
|
||||
@ -274,6 +329,13 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
||||
"(" +
|
||||
dtoMap.get(salaryDeptMap.get(item.getProcessInstanceId())).getName() +
|
||||
")");
|
||||
}else if (factoryDeptMap.containsKey(item.getProcessInstanceId())) {
|
||||
item.setStartUserNickname(item.getStartUserNickname() +
|
||||
"(" +
|
||||
groupedMap.get(item.getProcessInstanceId()).stream()
|
||||
.map(FactoryInfoDTO::getShortName)
|
||||
.collect(Collectors.joining(",")) +
|
||||
")");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -0,0 +1,37 @@
|
||||
<?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.BpmOAEvectionMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
<select id="selectEvectionList" resultType="cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAEvectionDO">
|
||||
SELECT
|
||||
a.*
|
||||
FROM
|
||||
bpm_oa_evection a
|
||||
WHERE
|
||||
a.id NOT IN (
|
||||
SELECT
|
||||
c.object_id
|
||||
FROM
|
||||
bpm_oa_reimbursement b,
|
||||
bpm_oa_reimbursement_item c
|
||||
WHERE
|
||||
b.user_id = #{userId}
|
||||
AND b.deleted = 0
|
||||
AND b.id = c.reimbursement_id
|
||||
AND b.result IN ( 1, 2 )
|
||||
AND c.type = 1
|
||||
AND c.object_id IS NOT NULL
|
||||
)
|
||||
AND a.user_id = #{userId}
|
||||
AND a.deleted = 0
|
||||
ORDER BY
|
||||
a.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
@ -14,7 +14,7 @@
|
||||
a.type as type,
|
||||
a.cost_section AS costSection,
|
||||
a.dept_id AS deptId,
|
||||
d.name AS deptName,
|
||||
d.short_name AS deptName,
|
||||
a.total_money AS amount,
|
||||
a.detail AS detail,
|
||||
b.user_id AS userId,
|
||||
@ -30,7 +30,7 @@
|
||||
FROM bpm_oa_expenses b
|
||||
JOIN bpm_oa_expenses_item a ON a.expenses_id = b.id
|
||||
JOIN bpm_process_instance_ext c ON c.process_instance_id = b.process_instance_id
|
||||
LEFT JOIN system_dept d ON d.factory_id = a.dept_id
|
||||
LEFT JOIN sf_factory_info d ON d.id = a.dept_id
|
||||
LEFT JOIN system_users u ON u.id = b.user_id
|
||||
LEFT JOIN system_bank ub ON ub.id = b.bank_id
|
||||
WHERE
|
||||
@ -70,25 +70,31 @@
|
||||
SUM(a.total_money) - SUM(a.amount_paid) AS remainingPayable
|
||||
FROM
|
||||
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
|
||||
AND a.result = 2
|
||||
<if test="pageReqVO.userId != null">
|
||||
AND a.user_id = #{pageReqVO.userId}
|
||||
</if>
|
||||
<if test="pageReqVO.factoryId != null">
|
||||
AND b.dept_id = #{pageReqVO.factoryId}
|
||||
</if>
|
||||
<if test="pageReqVO.type != null">
|
||||
AND b.type = #{pageReqVO.type}
|
||||
</if>
|
||||
<if test="pageReqVO.costSection != null">
|
||||
AND b.cost_section = #{pageReqVO.costSection}
|
||||
</if>
|
||||
AND EXISTS (
|
||||
SELECT
|
||||
1
|
||||
FROM
|
||||
bpm_oa_expenses_item b
|
||||
WHERE
|
||||
b.expenses_id = a.id
|
||||
<if test="pageReqVO.factoryId != null">
|
||||
AND b.dept_id = #{pageReqVO.factoryId}
|
||||
</if>
|
||||
<if test="pageReqVO.type != null">
|
||||
AND b.type = #{pageReqVO.type}
|
||||
</if>
|
||||
<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>
|
||||
|
@ -31,7 +31,7 @@
|
||||
<if test="pageReqVO.loanType == 1">
|
||||
SELECT
|
||||
s.staff_id AS staffId,
|
||||
CONVERT(st.nick_name USING utf8mb4) COLLATE utf8mb4_unicode_ci AS staffName,
|
||||
st.nick_name AS staffName,
|
||||
s.factory_id AS factoryId,
|
||||
sf.short_name AS factoryName,
|
||||
s.month AS month,
|
||||
|
@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao</artifactId>
|
||||
<version>2.0.0-jdk8-snapshot</version>
|
||||
</parent>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-crm</artifactId>
|
||||
<version>2.0.0-jdk8-snapshot</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>infra 模块,主要提供两块能力:
|
||||
1. 我们放基础设施的运维与管理,支撑上层的通用与核心业务。 例如说:定时任务的管理、服务器的信息等等
|
||||
2. 研发工具,提升研发效率与质量。 例如说:代码生成器、接口文档等等</description>
|
||||
<modules>
|
||||
<module>yudao-module-crm-api</module>
|
||||
<module>yudao-module-crm-biz</module>
|
||||
</modules>
|
||||
</project>
|
@ -1,36 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-crm</artifactId>
|
||||
<version>2.0.0-jdk8-snapshot</version>
|
||||
</parent>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-crm-api</artifactId>
|
||||
<version>2.0.0-jdk8-snapshot</version>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>infra 模块 API,暴露给其它模块调用</description>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-ui</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -1,153 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-crm</artifactId>
|
||||
<version>2.0.0-jdk8-snapshot</version>
|
||||
</parent>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-crm-biz</artifactId>
|
||||
<version>2.0.0-jdk8-snapshot</version>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>infra 模块,主要提供两块能力:
|
||||
1. 我们放基础设施的运维与管理,支撑上层的通用与核心业务。 例如说:定时任务的管理、服务器的信息等等
|
||||
2. 研发工具,提升研发效率与质量。 例如说:代码生成器、接口文档等等</description>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-crm-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-product-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-system-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-banner</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-operatelog</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-error-code</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-mybatis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-generator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-redis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-rpc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-job</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-mq</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-excel</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.smallbun.screw</groupId>
|
||||
<artifactId>screw-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-monitor</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-starter-server</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-file</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-bpm-api</artifactId>
|
||||
<version>2.0.0-jdk8-snapshot</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>8</source>
|
||||
<target>8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.system.api.customersettlement;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.api.customersettlement.dto.SettlementItemDTO;
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 结算")
|
||||
public interface SettlementApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/customer-settlement";
|
||||
|
||||
@GetMapping(PREFIX + "/get-deductionItems")
|
||||
@Operation(summary = "获得结算扣款明细")
|
||||
CommonResult<List<SettlementItemDTO>> getDeductionItems(@RequestParam(value = "factoryId", required = false) Long factoryId,
|
||||
@RequestParam(value = "month", required = false) String month);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.system.api.customersettlement.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 工厂结算项VO")
|
||||
@Data
|
||||
public class SettlementItemDTO {
|
||||
|
||||
@Schema(description = "工厂编号")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "结算月份")
|
||||
private String month;
|
||||
|
||||
@Schema(description = "业务类型")
|
||||
private Integer businessType;
|
||||
|
||||
@Schema(description = "扣款明细")
|
||||
private List<Deduction> deductionItems;
|
||||
|
||||
/**
|
||||
* 扣款明细
|
||||
*/
|
||||
@Data
|
||||
public static class Deduction {
|
||||
|
||||
private String key;
|
||||
|
||||
private BigDecimal value;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.system.api.customersettlement;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.api.customersettlement.dto.SettlementItemDTO;
|
||||
import cn.iocoder.yudao.module.system.service.customersettlement.CustomerSettlementService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@Validated
|
||||
public class SettlementApiImpl implements SettlementApi {
|
||||
|
||||
@Resource
|
||||
private CustomerSettlementService customerSettlementService;
|
||||
|
||||
|
||||
@Override
|
||||
public CommonResult<List<SettlementItemDTO>> getDeductionItems(Long factoryId, String month) {
|
||||
return success( customerSettlementService.getDeductionItems(factoryId, month));
|
||||
}
|
||||
}
|
@ -3,12 +3,17 @@ package cn.iocoder.yudao.module.system.dal.mysql.customersettlement;
|
||||
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.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import cn.iocoder.yudao.module.system.api.customersettlement.dto.SettlementItemDTO;
|
||||
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 cn.iocoder.yudao.module.system.dal.dataobject.customersettlement.SettlementItemDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户结算信息 Mapper
|
||||
*
|
||||
@ -25,4 +30,18 @@ public interface CustomerSettlementMapper extends BaseMapperX<CustomerSettlement
|
||||
}
|
||||
|
||||
StatisticsVO selectTotal(@Param("reqVO") CustomerSettlementPageReqVO pageReqVO);
|
||||
|
||||
default List<SettlementItemDTO> selectDeductionItems(Long factoryId, String month) {
|
||||
|
||||
MPJLambdaWrapperX<CustomerSettlementDO> queryWrapper = new MPJLambdaWrapperX<CustomerSettlementDO>();
|
||||
queryWrapper.selectAs(CustomerSettlementDO::getCustomerId, SettlementItemDTO::getFactoryId);
|
||||
queryWrapper.selectAs(CustomerSettlementDO::getSettlementMonth, SettlementItemDTO::getMonth);
|
||||
queryWrapper.selectAs(SettlementItemDO::getBusinessType, SettlementItemDTO::getBusinessType);
|
||||
queryWrapper.selectAs(SettlementItemDO::getDeductionItems, SettlementItemDTO::getDeductionItems);
|
||||
queryWrapper.leftJoin(SettlementItemDO.class, SettlementItemDO::getSettlementId, CustomerSettlementDO::getId);
|
||||
queryWrapper.eqIfPresent(CustomerSettlementDO::getCustomerId, factoryId);
|
||||
queryWrapper.eqIfPresent(CustomerSettlementDO::getSettlementMonth, month);
|
||||
|
||||
return selectJoinList(SettlementItemDTO.class, queryWrapper);
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.system.service.customersettlement;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.system.api.customersettlement.dto.SettlementItemDTO;
|
||||
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;
|
||||
@ -78,4 +79,12 @@ public interface CustomerSettlementService {
|
||||
* @return 统计信息
|
||||
*/
|
||||
StatisticsVO getCustomerSettlementTotal(CustomerSettlementPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得结算扣款明细
|
||||
* @param factoryId 工厂id
|
||||
* @param month 月份
|
||||
* @return 结算扣款明细
|
||||
*/
|
||||
List<SettlementItemDTO> getDeductionItems(Long factoryId, String month);
|
||||
}
|
@ -5,6 +5,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.infra.api.file.FileApi;
|
||||
import cn.iocoder.yudao.module.system.api.customersettlement.dto.SettlementItemDTO;
|
||||
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;
|
||||
@ -170,4 +171,9 @@ public class CustomerSettlementServiceImpl implements CustomerSettlementService
|
||||
|
||||
return customerSettlementMapper.selectTotal(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SettlementItemDTO> getDeductionItems(Long factoryId, String month) {
|
||||
return customerSettlementMapper.selectDeductionItems(factoryId, month);
|
||||
}
|
||||
}
|
@ -270,7 +270,7 @@ public class DeptServiceImpl implements DeptService {
|
||||
|
||||
@Override
|
||||
@DataPermission(enable = false)
|
||||
@Cacheable(cacheNames = RedisKeyConstants.DEPT_CHILD_ID_LIST, key = "#id")
|
||||
@Cacheable(cacheNames = RedisKeyConstants.DEPT_CHILD_ID_LIST, key = "#id", condition = "#id != null")
|
||||
public List<DeptDO> getChildDept(Long id) {
|
||||
|
||||
return deptMapper.selectList(new LambdaQueryWrapperX<DeptDO>()
|
||||
|
@ -0,0 +1,24 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.api.staffSalary;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.smartfactory.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 厂区员工薪资")
|
||||
public interface StaffSalaryApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/staffSalary";
|
||||
|
||||
@PutMapping(PREFIX + "/updateIsGrant")
|
||||
@Operation(summary = "更新是否已发放薪资")
|
||||
CommonResult<Boolean> updateIsGrant(@RequestParam(value = "ids", required = false) Collection<Long> ids,
|
||||
@RequestParam("isGrant") Integer isGrant);
|
||||
}
|
@ -19,6 +19,7 @@ public interface ErrorCodeConstants {
|
||||
|
||||
ErrorCode STAFF_NOT_EXISTS = new ErrorCode(1_000_000_005, "员工不存在");
|
||||
ErrorCode ACCESSORIES_COLLAR_NOT_EXISTS = new ErrorCode(1_000_000_006, "配件费用不存在");
|
||||
ErrorCode IMPORT_LIST_IS_EMPTY = new ErrorCode(1_000_000_007, "导入数据不存在");
|
||||
|
||||
//打包线模块
|
||||
ErrorCode PACKAGE_NOT_EXISTS = new ErrorCode(1_000_001_001, "打包线信息不存在");
|
||||
@ -38,6 +39,9 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode STAFF_SALARY_EXISTS = new ErrorCode(1_000_004_003, "工资记录已存在");
|
||||
// ========== 搬运模块 1_000_005_000 ==========
|
||||
ErrorCode CANNOT_FIND_THE_CORRESPONDING_FACTORY_HANDLING_SPECIFICATION = new ErrorCode(1_000_005_001, "找不到对应的工厂搬运规格");
|
||||
|
||||
ErrorCode FACTORY_HANDLING_SPECIFICATION_EXISTS = new ErrorCode(1_000_005_002, "工厂搬运规格已存在");
|
||||
ErrorCode SPECIFICATION_USER_AMOUNT_NOT_EXISTS = new ErrorCode(1_000_005_003, "工厂当前月份存在未分配人员数据!");
|
||||
ErrorCode ADDED_A_HANDLING_GROUP_WITH_DUPLICATE_DATA = new ErrorCode(1_000_005_004, "新增数据有重复的搬运组!");
|
||||
ErrorCode NEW_DATA_AND_OLD_DATA_HAVE_DUPLICATE_HANDLING_GROUP = new ErrorCode(1_000_005_005, "新增数据与老数据有重复的搬运组!");
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.api.staffSalary;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.smartfactory.service.staffsalary.StaffSalaryService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@Validated
|
||||
public class StaffSalaryApiImpl implements StaffSalaryApi {
|
||||
|
||||
@Resource
|
||||
private StaffSalaryService staffSalaryService;
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> updateIsGrant(Collection<Long> ids, Integer isGrant) {
|
||||
staffSalaryService.updateIsGrant(ids, isGrant);
|
||||
return success(true);
|
||||
}
|
||||
}
|
@ -96,6 +96,15 @@ public class FactoryInfoController {
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得工厂以及公司列表 | 用于前端下拉框")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-info:query')")
|
||||
public CommonResult<List<FactorySimpleRespVO>> getList() {
|
||||
|
||||
List<FactoryInfoDO> factoryInfo = factoryInfoService.getList();
|
||||
return success(BeanUtils.toBean(factoryInfo, FactorySimpleRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/simple-list")
|
||||
@Operation(summary = "获得工厂列表 | 用于前端下拉框")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-info:query')")
|
||||
@ -124,6 +133,15 @@ public class FactoryInfoController {
|
||||
return success(BeanUtils.toBean(factoryInfo, FactorySimpleRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/factory-list")
|
||||
@Operation(summary = "取登录用户工厂列表, 登陆用户无工厂则拉取所有工厂 | 用于前端下拉框")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-info:query')")
|
||||
public CommonResult<List<FactorySimpleRespVO>> getFactoryListByLoginUser() {
|
||||
|
||||
List<FactoryInfoDO> factoryInfo = factoryInfoService.getFactoryListByLoginUser();
|
||||
return success(BeanUtils.toBean(factoryInfo, FactorySimpleRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/get-tree")
|
||||
@Operation(summary = "获得工厂树结构")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:factory-info:query')")
|
||||
|
@ -42,14 +42,23 @@ public class FactoryProfitVO {
|
||||
@Schema(description = "搬运扣款")
|
||||
private BigDecimal porterageDeduction;
|
||||
|
||||
@Schema(description = "叉车扣款明细")
|
||||
private Deduction forkliftDeductionItem;
|
||||
|
||||
@Schema(description = "打包扣款明细")
|
||||
private Deduction packageDeductionItem;
|
||||
|
||||
@Schema(description = "搬运扣款明细")
|
||||
private Deduction porterageDeductionItem;
|
||||
|
||||
@Schema(description = "水电扣款")
|
||||
private BigDecimal hydropower;
|
||||
|
||||
@Schema(description = "工伤保险")
|
||||
private BigDecimal employment;
|
||||
|
||||
@Schema(description = "其他(理赔、扣点)")
|
||||
private BigDecimal other;
|
||||
// @Schema(description = "工伤保险")
|
||||
// private BigDecimal employment;
|
||||
//
|
||||
// @Schema(description = "其他(理赔、扣点)")
|
||||
// private BigDecimal other;
|
||||
|
||||
@Schema(description = "叉车工资")
|
||||
private BigDecimal forkliftSalary;
|
||||
@ -104,4 +113,20 @@ public class FactoryProfitVO {
|
||||
|
||||
@Schema(description = "搬运毛利")
|
||||
private BigDecimal porterageGrossProfit;
|
||||
|
||||
@Data
|
||||
public static class Deduction {
|
||||
|
||||
@Schema(description = "行政罚款")
|
||||
private BigDecimal administrativePenalty;
|
||||
|
||||
@Schema(description = "破损罚款")
|
||||
private BigDecimal damagePenalty;
|
||||
|
||||
@Schema(description = "少件扣款")
|
||||
private BigDecimal missPenalty;
|
||||
|
||||
@Schema(description = "其他扣款")
|
||||
private BigDecimal otherPenalty;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroup;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroup.vo.HandlingGroupPageReqVO;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroup.vo.HandlingGroupRespVO;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroup.vo.HandlingGroupSaveReqVO;
|
||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroup.HandlingGroupDO;
|
||||
import cn.iocoder.yudao.module.smartfactory.service.handlinggroup.HandlingGroupService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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 = "管理后台 - 搬运组")
|
||||
@RestController
|
||||
@RequestMapping("/smartfactory/handling-group")
|
||||
@Validated
|
||||
public class HandlingGroupController {
|
||||
|
||||
@Resource
|
||||
private HandlingGroupService handlingGroupService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建搬运组")
|
||||
public CommonResult<Long> createHandlingGroup(@Valid @RequestBody HandlingGroupSaveReqVO createReqVO) {
|
||||
return success(handlingGroupService.createHandlingGroup(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新搬运组")
|
||||
public CommonResult<Boolean> updateHandlingGroup(@Valid @RequestBody HandlingGroupSaveReqVO updateReqVO) {
|
||||
handlingGroupService.updateHandlingGroup(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除搬运组")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
public CommonResult<Boolean> deleteHandlingGroup(@RequestParam("id") Long id) {
|
||||
handlingGroupService.deleteHandlingGroup(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得搬运组")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<HandlingGroupRespVO> getHandlingGroup(@RequestParam("id") Long id) {
|
||||
HandlingGroupDO handlingGroup = handlingGroupService.getHandlingGroup(id);
|
||||
return success(BeanUtils.toBean(handlingGroup, HandlingGroupRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/getAllByFactoryId")
|
||||
@Operation(summary = "根据工程id获得搬运组列表")
|
||||
public CommonResult<List<HandlingGroupRespVO>> getAllByFactoryId(@RequestParam("factoryId") Long factoryId) {
|
||||
List<HandlingGroupDO> list = handlingGroupService.list(new LambdaQueryWrapper<HandlingGroupDO>().eq(HandlingGroupDO::getFactoryId, factoryId));
|
||||
return success(BeanUtils.toBean(list, HandlingGroupRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得搬运组分页")
|
||||
public CommonResult<PageResult<HandlingGroupRespVO>> getHandlingGroupPage(@Valid HandlingGroupPageReqVO pageReqVO) {
|
||||
PageResult<HandlingGroupDO> pageResult = handlingGroupService.getHandlingGroupPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, HandlingGroupRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出搬运组 Excel")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportHandlingGroupExcel(@Valid HandlingGroupPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<HandlingGroupDO> list = handlingGroupService.getHandlingGroupPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "搬运组.xls", "数据", HandlingGroupRespVO.class,
|
||||
BeanUtils.toBean(list, HandlingGroupRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroup.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.HandlingGroupAmountSpecificationsBatchCreateItemVO;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class HandlingGroupListVO {
|
||||
@Schema(description = "搬运组id", example = "27617")
|
||||
private Long handlingGroupId;
|
||||
|
||||
@Schema(description = "叉车司机id", example = "27617")
|
||||
private Long staffId;
|
||||
|
||||
@Schema(description = "规格/数量列表")
|
||||
private List<HandlingGroupAmountSpecificationsBatchCreateItemVO> itemList;
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroup.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 搬运组分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class HandlingGroupPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "工厂id", example = "5268")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "搬运组名称", example = "芋艿")
|
||||
private String handlingGroupName;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroup.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 搬运组 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class HandlingGroupRespVO {
|
||||
|
||||
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9657")
|
||||
@ExcelProperty("主键id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工厂id", requiredMode = Schema.RequiredMode.REQUIRED, example = "5268")
|
||||
@ExcelProperty("工厂id")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "工厂名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "5268")
|
||||
@ExcelProperty("工厂名称")
|
||||
private String factoryName;
|
||||
|
||||
@Schema(description = "搬运组名称", example = "芋艿")
|
||||
@ExcelProperty("搬运组名称")
|
||||
private String handlingGroupName;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroup.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.*;
|
||||
|
||||
@Schema(description = "管理后台 - 搬运组新增/修改 Request VO")
|
||||
@Data
|
||||
public class HandlingGroupSaveReqVO {
|
||||
|
||||
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9657")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工厂id", requiredMode = Schema.RequiredMode.REQUIRED, example = "5268")
|
||||
@NotNull(message = "工厂id不能为空")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "搬运组名称", example = "芋艿")
|
||||
private String handlingGroupName;
|
||||
|
||||
}
|
@ -7,18 +7,17 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.HandlingGroupAmountSpecificationsBatchCreateVO;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.HandlingGroupAmountSpecificationsPageReqVO;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.HandlingGroupAmountSpecificationsRespVO;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.HandlingGroupAmountSpecificationsSaveReqVO;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.dto.HandlingGroupAmountSpecificationsPageReqDTO;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.dto.HandlingGroupAmountSpecificationsTotalNumDTO;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.*;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.HandlingGroupUserAmountItemVO;
|
||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsDO;
|
||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupuseramount.HandlingGroupUserAmountDO;
|
||||
import cn.iocoder.yudao.module.smartfactory.service.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsService;
|
||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||
import cn.iocoder.yudao.module.smartfactory.service.handlinggroupuseramount.HandlingGroupUserAmountService;
|
||||
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.*;
|
||||
|
||||
@ -26,13 +25,13 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 搬运组工资规格关联")
|
||||
@ -43,69 +42,94 @@ public class HandlingGroupAmountSpecificationsController {
|
||||
|
||||
@Resource
|
||||
private HandlingGroupAmountSpecificationsService handlingGroupAmountSpecificationsService;
|
||||
|
||||
@Resource
|
||||
private DeptApi deptApi;
|
||||
private HandlingGroupUserAmountService handlingGroupUserAmountService;
|
||||
|
||||
@PostMapping("/batchCreate")
|
||||
@Operation(summary = "创建搬运组工资规格关联")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-amount-specifications:create')")
|
||||
@Operation(summary = "批量创建搬运组工资规格关联")
|
||||
public CommonResult<Boolean> batchCreate(@Valid @RequestBody HandlingGroupAmountSpecificationsBatchCreateVO vo) {
|
||||
handlingGroupAmountSpecificationsService.batchCreate(vo);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/getTotalNum")
|
||||
@Operation(summary = "获取合计数")
|
||||
public CommonResult<HandlingGroupAmountSpecificationsTotalNumVO> getTotalNum(@Valid HandlingGroupAmountSpecificationsTotalNumDTO dto) {
|
||||
HandlingGroupAmountSpecificationsTotalNumVO vo = handlingGroupAmountSpecificationsService.getTotalNum(dto);
|
||||
return success(vo);
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "更新搬运组工资规格关联")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-amount-specifications:update')")
|
||||
public CommonResult<Boolean> update(@Valid @RequestBody HandlingGroupAmountSpecificationsSaveReqVO createReqVO) {
|
||||
handlingGroupAmountSpecificationsService.updateHandlingGroupAmountSpecifications(createReqVO);
|
||||
|
||||
@GetMapping("/getAmountSubtotal")
|
||||
@Operation(summary = "获取金额小计")
|
||||
public CommonResult<BigDecimal> getAmountSubtotal(@RequestParam Integer totalCount,
|
||||
@RequestParam Long handlingSpecificationsId) {
|
||||
BigDecimal amount = handlingGroupAmountSpecificationsService.getAmountSubtotal(totalCount, handlingSpecificationsId);
|
||||
return success(amount);
|
||||
}
|
||||
|
||||
@PostMapping("/batchUpdate")
|
||||
@Operation(summary = "批量更新搬运组工资规格关联")
|
||||
public CommonResult<Boolean> batchUpdate(@Valid @RequestBody HandlingGroupAmountSpecificationsBatchUpdateVO vo) {
|
||||
handlingGroupAmountSpecificationsService.batchUpdate(vo);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除搬运组工资规格关联")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-amount-specifications:delete')")
|
||||
public CommonResult<Boolean> deleteHandlingGroupAmountSpecifications(@RequestParam("id") Long id) {
|
||||
handlingGroupAmountSpecificationsService.deleteHandlingGroupAmountSpecifications(id);
|
||||
@PostMapping("/batchDelete")
|
||||
@Operation(summary = "批量删除搬运组工资规格关联")
|
||||
public CommonResult<Boolean> batchDelete(@RequestBody HandlingGroupAmountSpecificationsBatchDelVO vo) {
|
||||
handlingGroupAmountSpecificationsService.batchDelete(vo);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得搬运组工资规格关联")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-amount-specifications:query')")
|
||||
public CommonResult<HandlingGroupAmountSpecificationsRespVO> getHandlingGroupAmountSpecifications(@RequestParam("id") Long id) {
|
||||
HandlingGroupAmountSpecificationsDO handlingGroupAmountSpecifications = handlingGroupAmountSpecificationsService.getHandlingGroupAmountSpecifications(id);
|
||||
return success(BeanUtils.toBean(handlingGroupAmountSpecifications, HandlingGroupAmountSpecificationsRespVO.class));
|
||||
@Parameter(name = "factoryId", description = "工厂id", required = true, example = "1024")
|
||||
@Parameter(name = "dateStr", description = "日期", required = true, example = "1024")
|
||||
@Parameter(name = "handlingGroupId", description = "搬运组id", required = true, example = "1024")
|
||||
public CommonResult<List<HandlingGroupAmountSpecificationsDetailsRespVO>> getHandlingGroupAmountSpecifications(@RequestParam Long factoryId,
|
||||
@RequestParam String dateStr,
|
||||
@RequestParam Long handlingGroupId) {
|
||||
List<HandlingGroupAmountSpecificationsDO> handlingGroupAmountSpecifications = handlingGroupAmountSpecificationsService.getHandlingGroupAmountSpecificationsList(factoryId, dateStr, handlingGroupId);
|
||||
return success(BeanUtils.toBean(handlingGroupAmountSpecifications, HandlingGroupAmountSpecificationsDetailsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得搬运组工资规格关联分页")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-amount-specifications:query')")
|
||||
public CommonResult<PageResult<HandlingGroupAmountSpecificationsRespVO>> getHandlingGroupAmountSpecificationsPage(@Valid HandlingGroupAmountSpecificationsPageReqVO pageReqVO) {
|
||||
PageResult<HandlingGroupAmountSpecificationsDO> pageResult = handlingGroupAmountSpecificationsService.getHandlingGroupAmountSpecificationsPage(pageReqVO);
|
||||
PageResult<HandlingGroupAmountSpecificationsRespVO> result = BeanUtils.toBean(pageResult, HandlingGroupAmountSpecificationsRespVO.class);
|
||||
if (CollUtil.isNotEmpty(result.getList())) {
|
||||
|
||||
// 获取工厂信息
|
||||
Set<Long> factoryIds = convertSet(result.getList(), HandlingGroupAmountSpecificationsRespVO::getFactoryId);
|
||||
Map<Long, DeptRespDTO> factoryMap = convertMap(deptApi.getDeptList(factoryIds).getCheckedData(), DeptRespDTO::getId);
|
||||
|
||||
result.getList().forEach(data -> {
|
||||
// 设置工厂名称
|
||||
data.setFactoryName(factoryMap.get(data.getFactoryId()) != null ? factoryMap.get(data.getFactoryId()).getName() : null);
|
||||
});
|
||||
// 计算合计 - 先根据工厂+搬运组+日期进行分组
|
||||
Map<String, List<HandlingGroupAmountSpecificationsRespVO>> map = result.getList().stream().collect(Collectors.groupingBy(a -> a.getFactoryId() + "_" + a.getHandlingGroupId() + "_" + a.getDateStr()));
|
||||
List<Long> ids = result.getList().stream().map(HandlingGroupAmountSpecificationsRespVO::getHandlingGroupId).distinct().collect(Collectors.toList());
|
||||
Map<Long, List<HandlingGroupUserAmountDO>> handlingGroupUserAmountMap = new HashMap<>();
|
||||
if (CollUtil.isNotEmpty(ids)) {
|
||||
List<HandlingGroupUserAmountDO> list = handlingGroupUserAmountService.getByHandlingGroupIds(ids);
|
||||
handlingGroupUserAmountMap = list.stream().collect(Collectors.groupingBy(HandlingGroupUserAmountDO::getHandlingGroupId));
|
||||
}
|
||||
for (HandlingGroupAmountSpecificationsRespVO handlingGroupAmountSpecificationsDO : result.getList()) {
|
||||
String key = handlingGroupAmountSpecificationsDO.getFactoryId() + "_" + handlingGroupAmountSpecificationsDO.getHandlingGroupId() + "_" + handlingGroupAmountSpecificationsDO.getDateStr();
|
||||
// handlingGroupAmountSpecificationsDO.setTotalAmount(getSumValue(map.get(key), HandlingGroupAmountSpecificationsRespVO::getAmount, BigDecimal::add));
|
||||
// handlingGroupAmountSpecificationsDO.setTotalNum(getSumValue(map.get(key), HandlingGroupAmountSpecificationsRespVO::getTotalCount, Integer::sum));
|
||||
List<HandlingGroupUserAmountDO> items = handlingGroupUserAmountMap.get(handlingGroupAmountSpecificationsDO.getHandlingGroupId());
|
||||
if (CollUtil.isNotEmpty(items)) {
|
||||
List<HandlingGroupUserAmountItemVO> handlingGroupUserAmountItemVOS = BeanUtils.toBean(items, HandlingGroupUserAmountItemVO.class);
|
||||
handlingGroupAmountSpecificationsDO.setHandlingGroupUserAmountItemVOS(handlingGroupUserAmountItemVOS);
|
||||
}
|
||||
}
|
||||
|
||||
return success(result);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/pageV2")
|
||||
@Operation(summary = "获得搬运组工资规格关联分页")
|
||||
public CommonResult<PageResult<HandlingGroupAmountSpecificationsRespVO>> getHandlingGroupAmountSpecificationsPageV2(@Valid HandlingGroupAmountSpecificationsPageReqDTO pageReqVO) {
|
||||
PageResult<HandlingGroupAmountSpecificationsRespVO> pageResult = handlingGroupAmountSpecificationsService.getHandlingGroupAmountSpecificationsPageV2(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出搬运组工资规格关联 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-amount-specifications:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportHandlingGroupAmountSpecificationsExcel(@Valid HandlingGroupAmountSpecificationsPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
@ -113,7 +137,7 @@ public class HandlingGroupAmountSpecificationsController {
|
||||
List<HandlingGroupAmountSpecificationsDO> list = handlingGroupAmountSpecificationsService.getHandlingGroupAmountSpecificationsPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "搬运组工资规格关联.xls", "数据", HandlingGroupAmountSpecificationsRespVO.class,
|
||||
BeanUtils.toBean(list, HandlingGroupAmountSpecificationsRespVO.class));
|
||||
BeanUtils.toBean(list, HandlingGroupAmountSpecificationsRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.dto;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class HandlingGroupAmountSpecificationsPageReqDTO extends PageParam {
|
||||
|
||||
@Schema(description = "工厂id", example = "23178")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "搬运组id", example = "23178")
|
||||
private Long handlingGroupId;
|
||||
|
||||
@Schema(description = "叉车司机名称", example = "23178")
|
||||
private String staffName;
|
||||
|
||||
@Schema(description = "搬运工名称", example = "23178")
|
||||
private String porterName;
|
||||
|
||||
@Schema(description = "搬运规格id", example = "23178")
|
||||
private Long handlingSpecificationsId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "工厂ids", example = "23178")
|
||||
private List<Long> factoryIds;
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class HandlingGroupAmountSpecificationsTotalNumDTO {
|
||||
@Schema(description = "工厂id")
|
||||
private Long factoryId;
|
||||
@Schema(description = "规格id")
|
||||
private Long handlingSpecificationsId;
|
||||
@Schema(description = "叉车司机名称")
|
||||
private String forkliftDriverName;
|
||||
@Schema(description = "搬运工名称")
|
||||
private String porterName;
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
@Schema(description = "工厂ids")
|
||||
private List<Long> factoryIds;
|
||||
}
|
@ -8,6 +8,10 @@ import javax.validation.constraints.NotNull;
|
||||
@Data
|
||||
public class HandlingGroupAmountSpecificationsBatchCreateItemVO {
|
||||
|
||||
@Schema(description = "id", example = "23178")
|
||||
@NotNull(message = "id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "搬运规格id", example = "23178")
|
||||
@NotNull(message = "搬运规格不能为空")
|
||||
private Long handlingSpecificationsId;
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroup.vo.HandlingGroupListVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@ -15,6 +16,6 @@ public class HandlingGroupAmountSpecificationsBatchCreateVO {
|
||||
@NotNull(message = "日期不能为空")
|
||||
private String dateStr;
|
||||
|
||||
@Schema(description = "子列表")
|
||||
private List<HandlingGroupAmountSpecificationsBatchCreateItemVO> itemVOS;
|
||||
@Schema(description = "搬运组列表")
|
||||
private List<HandlingGroupListVO> handlingGroupList;
|
||||
}
|
||||
|
@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class HandlingGroupAmountSpecificationsBatchDelVO {
|
||||
@Schema(description = "工厂id", example = "23178")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "日期 格式 yyyy-MM-dd")
|
||||
@NotNull(message = "日期不能为空")
|
||||
private String dateStr;
|
||||
|
||||
@Schema(description = "搬运组id", example = "27617")
|
||||
private Long handlingGroupId;
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroup.vo.HandlingGroupListVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class HandlingGroupAmountSpecificationsBatchUpdateVO {
|
||||
@Schema(description = "工厂id", example = "23178")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "日期 格式 yyyy-MM-dd")
|
||||
@NotNull(message = "日期不能为空")
|
||||
private String dateStr;
|
||||
|
||||
@Schema(description = "搬运组id", example = "27617")
|
||||
private Long handlingGroupId;
|
||||
|
||||
@Schema(description = "叉车司机id", example = "27617")
|
||||
private Long staffId;
|
||||
|
||||
@Schema(description = "规格/数量列表")
|
||||
private List<HandlingGroupAmountSpecificationsBatchCreateItemVO> itemList;
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.HandlingGroupUserAmountItemVO;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
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;
|
||||
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class HandlingGroupAmountSpecificationsDetailsRespVO {
|
||||
|
||||
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9721")
|
||||
@ExcelProperty("主键id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工厂id", example = "23178")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "工厂名称", example = "23178")
|
||||
private String factoryName;
|
||||
|
||||
@Schema(description = "搬运组id", example = "23178")
|
||||
@ExcelProperty("搬运组id")
|
||||
private Long handlingGroupId;
|
||||
|
||||
@Schema(description = "搬运组名称", example = "23178")
|
||||
@ExcelProperty("搬运组名称")
|
||||
private String handlingGroupName;
|
||||
|
||||
@Schema(description = "叉车司机名称", example = "23178")
|
||||
@ExcelProperty("叉车司机名称")
|
||||
private String staffName;
|
||||
|
||||
@Schema(description = "叉车司机id", example = "23178")
|
||||
@ExcelProperty("叉车司机id")
|
||||
private Long staffId;
|
||||
|
||||
@Schema(description = "搬运规格id", example = "23178")
|
||||
@ExcelProperty("搬运规格id")
|
||||
private Long handlingSpecificationsId;
|
||||
|
||||
@Schema(description = "搬运规格名称", example = "23178")
|
||||
@ExcelProperty("搬运规格名称")
|
||||
private String handlingSpecificationsName;
|
||||
|
||||
@Schema(description = "数量", example = "15611")
|
||||
@ExcelProperty("数量")
|
||||
private Integer totalCount;
|
||||
|
||||
@Schema(description = "日期 格式 yyyy-MM-dd")
|
||||
@ExcelProperty("日期 格式 yyyy-MM-dd")
|
||||
private String dateStr;
|
||||
|
||||
@Schema(description = "总金额(根据规格和总量计算出 该搬运组获得的总金额)")
|
||||
@ExcelProperty("总金额(根据规格和总量计算出 该搬运组获得的总金额)")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
@Schema(description = "金额小计")
|
||||
@ExcelProperty("金额小计")
|
||||
private BigDecimal totalAmount;
|
||||
@Schema(description = "数量小计")
|
||||
@ExcelProperty("数量小计")
|
||||
private Integer totalNum;
|
||||
|
||||
@Schema(description = "搬运工明细列表")
|
||||
private List<HandlingGroupUserAmountItemVO> handlingGroupUserAmountItemVOS;
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@ -9,6 +10,7 @@ import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ -21,6 +23,15 @@ public class HandlingGroupAmountSpecificationsPageReqVO extends PageParam {
|
||||
@Schema(description = "工厂id", example = "23178")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "搬运组id", example = "23178")
|
||||
private Long handlingGroupId;
|
||||
|
||||
@Schema(description = "叉车司机名称", example = "23178")
|
||||
private String staffName;
|
||||
|
||||
@Schema(description = "搬运工名称", example = "23178")
|
||||
private String porterName;
|
||||
|
||||
@Schema(description = "搬运规格id", example = "23178")
|
||||
private Long handlingSpecificationsId;
|
||||
|
||||
@ -37,4 +48,7 @@ public class HandlingGroupAmountSpecificationsPageReqVO extends PageParam {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "工厂ids", example = "23178")
|
||||
private List<Long> factoryIds;
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.HandlingGroupUserAmountItemVO;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@ -7,6 +8,7 @@ import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 搬运组工资规格关联 Response VO")
|
||||
@Data
|
||||
@ -23,28 +25,46 @@ public class HandlingGroupAmountSpecificationsRespVO {
|
||||
@Schema(description = "工厂名称", example = "23178")
|
||||
private String factoryName;
|
||||
|
||||
@Schema(description = "搬运规格id", example = "23178")
|
||||
@ExcelProperty("搬运规格id")
|
||||
private Long handlingSpecificationsId;
|
||||
@Schema(description = "搬运组id", example = "23178")
|
||||
@ExcelProperty("搬运组id")
|
||||
private Long handlingGroupId;
|
||||
|
||||
@Schema(description = "搬运组名称", example = "23178")
|
||||
@ExcelProperty("搬运组名称")
|
||||
private String handlingGroupName;
|
||||
|
||||
@Schema(description = "叉车司机名称", example = "23178")
|
||||
@ExcelProperty("叉车司机名称")
|
||||
private String staffName;
|
||||
|
||||
@Schema(description = "叉车司机id", example = "23178")
|
||||
@ExcelProperty("叉车司机id")
|
||||
private Long staffId;
|
||||
|
||||
@Schema(description = "搬运规格名称", example = "23178")
|
||||
@ExcelProperty("搬运规格名称")
|
||||
private String handlingSpecificationsName;
|
||||
|
||||
@Schema(description = "数量", example = "15611")
|
||||
@ExcelProperty("数量")
|
||||
private Integer totalCount;
|
||||
private List<SpecificationDetailVO> specificationDetails;
|
||||
|
||||
@Schema(description = "日期 格式 yyyy-MM-dd")
|
||||
@ExcelProperty("日期 格式 yyyy-MM-dd")
|
||||
private String dateStr;
|
||||
|
||||
@Schema(description = "总金额(根据规格和总量计算出 该搬运组获得的总金额)")
|
||||
@ExcelProperty("总金额(根据规格和总量计算出 该搬运组获得的总金额)")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
@Schema(description = "金额小计")
|
||||
@ExcelProperty("金额小计")
|
||||
private BigDecimal totalAmount;
|
||||
@Schema(description = "数量小计")
|
||||
@ExcelProperty("数量小计")
|
||||
private Integer totalNum;
|
||||
/**
|
||||
* 搬运规格id 逗号隔开
|
||||
*/
|
||||
private String handlingSpecificationsIds;
|
||||
|
||||
@Schema(description = "搬运工明细列表")
|
||||
private List<HandlingGroupUserAmountItemVO> handlingGroupUserAmountItemVOS;
|
||||
}
|
||||
|
@ -0,0 +1,84 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.HandlingGroupUserAmountItemVO;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
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;
|
||||
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class HandlingGroupAmountSpecificationsRespVOV2 {
|
||||
|
||||
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9721")
|
||||
@ExcelProperty("主键id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工厂id", example = "23178")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "工厂名称", example = "23178")
|
||||
private String factoryName;
|
||||
|
||||
@Schema(description = "搬运组id", example = "23178")
|
||||
@ExcelProperty("搬运组id")
|
||||
private Long handlingGroupId;
|
||||
|
||||
@Schema(description = "搬运组名称", example = "23178")
|
||||
@ExcelProperty("搬运组名称")
|
||||
private String handlingGroupName;
|
||||
|
||||
@Schema(description = "叉车司机名称", example = "23178")
|
||||
@ExcelProperty("叉车司机名称")
|
||||
private String staffName;
|
||||
|
||||
@Schema(description = "叉车司机id", example = "23178")
|
||||
@ExcelProperty("叉车司机id")
|
||||
private Long staffId;
|
||||
|
||||
@Schema(description = "日期 格式 yyyy-MM-dd")
|
||||
@ExcelProperty("日期 格式 yyyy-MM-dd")
|
||||
private String dateStr;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Schema(description = "搬运规格id", example = "23178")
|
||||
@ExcelProperty("搬运规格id")
|
||||
private Long handlingSpecificationsId;
|
||||
|
||||
@Schema(description = "搬运规格名称", example = "23178")
|
||||
@ExcelProperty("搬运规格名称")
|
||||
private String handlingSpecificationsName;
|
||||
|
||||
@Schema(description = "数量", example = "15611")
|
||||
@ExcelProperty("数量")
|
||||
private Integer totalCount;
|
||||
|
||||
|
||||
|
||||
|
||||
@Schema(description = "总金额(根据规格和总量计算出 该搬运组获得的总金额)")
|
||||
@ExcelProperty("总金额(根据规格和总量计算出 该搬运组获得的总金额)")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "金额小计")
|
||||
@ExcelProperty("金额小计")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
@Schema(description = "数量小计")
|
||||
@ExcelProperty("数量小计")
|
||||
private Integer totalNum;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "搬运工明细列表")
|
||||
private List<HandlingGroupUserAmountItemVO> handlingGroupUserAmountItemVOS;
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class HandlingGroupAmountSpecificationsTotalNumVO {
|
||||
@Schema(description = "数量")
|
||||
private Long num;
|
||||
|
||||
@Schema(description = "总金额")
|
||||
private BigDecimal amount;
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
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 lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 搬运组工资规格关联 DO
|
||||
*
|
||||
* @author 艾楷
|
||||
*/
|
||||
@Data
|
||||
public class HandlingGroupAmountSpecificationsVO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 工厂id
|
||||
*/
|
||||
private Long factoryId;
|
||||
/**
|
||||
* 搬运规格id
|
||||
*/
|
||||
private Long handlingSpecificationsId;
|
||||
/**
|
||||
* 搬运组id
|
||||
*/
|
||||
private Long handlingGroupId;
|
||||
|
||||
/**
|
||||
* 叉车司机id
|
||||
*/
|
||||
private Long staffId;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Integer totalCount;
|
||||
/**
|
||||
* 日期 格式 yyyy-MM-dd
|
||||
*/
|
||||
private String dateStr;
|
||||
/**
|
||||
* 总金额(根据规格和总量计算出 该搬运组获得的总金额)
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 金额合计
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private BigDecimal totalAmount;
|
||||
/**
|
||||
* 数量合计
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Integer totalNum;
|
||||
/**
|
||||
* 工厂名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String factoryName;
|
||||
/**
|
||||
* 搬运组名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String handlingGroupName;
|
||||
/**
|
||||
* 叉车司机名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String staffName;
|
||||
/**
|
||||
* 搬运规格id 逗号隔开
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<SpecificationDetailVO> specificationDetails;
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class SpecificationDetailVO {
|
||||
@Schema(description = "工厂搬运规格id", example = "23178")
|
||||
private Long handlingSpecificationsId;
|
||||
|
||||
@Schema(description = "规格名称", example = "标准规格")
|
||||
private String handlingSpecificationsName;
|
||||
|
||||
@Schema(description = "数量", example = "23178")
|
||||
private Integer totalCount;
|
||||
|
||||
@Schema(description = "金额", example = "23178")
|
||||
private BigDecimal amount;
|
||||
|
||||
public SpecificationDetailVO() {
|
||||
}
|
||||
|
||||
public SpecificationDetailVO(Long handlingSpecificationsId, String handlingSpecificationsName, Integer totalCount, BigDecimal amount) {
|
||||
this.handlingSpecificationsId = handlingSpecificationsId;
|
||||
this.handlingSpecificationsName = handlingSpecificationsName;
|
||||
this.totalCount = totalCount;
|
||||
this.amount = amount;
|
||||
}
|
||||
}
|
@ -85,6 +85,13 @@ public class HandlingGroupUserAmountController {
|
||||
return success(BeanUtils.toBean(pageResult, HandlingGroupUserAmountRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/listAll")
|
||||
@Operation(summary = "获得搬运组每日个人工资记录列表")
|
||||
public CommonResult<List<HandlingGroupUserAmountRespVO>> getHandlingGroupUserAmountList(@Valid HandlingGroupUserAmountPageReqVO pageReqVO) {
|
||||
List<HandlingGroupUserAmountDO> list = handlingGroupUserAmountService.getHandlingGroupUserAmountList(pageReqVO);
|
||||
return success(BeanUtils.toBean(list, HandlingGroupUserAmountRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/staffWagesPage")
|
||||
@Operation(summary = "以用户分组工资分页列表")
|
||||
public CommonResult<PageResult<StaffWagesPageVO>> staffWagesPage(@Valid StaffWagesPageDTO dto) {
|
||||
@ -92,6 +99,15 @@ public class HandlingGroupUserAmountController {
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/confirm")
|
||||
@Operation(summary = "确认搬运组薪资")
|
||||
public CommonResult<Boolean> confirmHandlingGroupUserAmount(@RequestParam("factoryId") Long factoryId,
|
||||
@RequestParam("month") String month) {
|
||||
|
||||
handlingGroupUserAmountService.confirmHandlingGroupUserAmount(factoryId, month);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出搬运组每日个人工资记录 Excel")
|
||||
@OperateLog(type = EXPORT)
|
||||
|
@ -18,9 +18,6 @@ public class StaffWagesPageDTO extends PageParam {
|
||||
@Schema(description = "工厂id", example = "12639")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "搬运组工资规格关联id", example = "27617")
|
||||
private Long handlingGroupAmountSpecificationsId;
|
||||
|
||||
@Schema(description = "日期 格式 yyyy-MM-dd")
|
||||
private String dateStr;
|
||||
|
||||
|
@ -0,0 +1,27 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class HandlingGroupUserAmountItemVO {
|
||||
@Schema(description = "用户id", example = "12639")
|
||||
@ExcelProperty("用户id")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "用户名称", example = "12639")
|
||||
@ExcelProperty("用户名称")
|
||||
private String userName;
|
||||
|
||||
@Schema(description = "搬运组每日个人工资")
|
||||
@ExcelProperty("搬运组每日个人工资")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "状态 0未确认 1已确认")
|
||||
private Integer status;
|
||||
}
|
@ -1,11 +1,13 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
@ -19,8 +21,11 @@ public class HandlingGroupUserAmountPageReqVO extends PageParam {
|
||||
@Schema(description = "用户id", example = "12639")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "搬运组工资规格关联id", example = "27617")
|
||||
private Long handlingGroupAmountSpecificationsId;
|
||||
@Schema(description = "工厂id", example = "27617")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "搬运组id", example = "27617")
|
||||
private Long handlingGroupId;
|
||||
|
||||
@Schema(description = "日期 格式 yyyy-MM-dd")
|
||||
private String dateStr;
|
||||
|
@ -1,13 +1,12 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.util.*;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 搬运组每日个人工资记录 Response VO")
|
||||
@Data
|
||||
@ -26,10 +25,6 @@ public class HandlingGroupUserAmountRespVO {
|
||||
@ExcelProperty("用户名称")
|
||||
private String userName;
|
||||
|
||||
@Schema(description = "搬运组工资规格关联id", example = "27617")
|
||||
@ExcelProperty("搬运组工资规格关联id")
|
||||
private Long handlingGroupAmountSpecificationsId;
|
||||
|
||||
@Schema(description = "日期 格式 yyyy-MM-dd")
|
||||
@ExcelProperty("日期 格式 yyyy-MM-dd")
|
||||
private String dateStr;
|
||||
@ -38,6 +33,9 @@ public class HandlingGroupUserAmountRespVO {
|
||||
@ExcelProperty("搬运组每日个人工资")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "状态 0.未确认 1.已确认")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
@ -1,10 +1,8 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.*;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 搬运组每日个人工资记录新增/修改 Request VO")
|
||||
@ -20,8 +18,8 @@ public class HandlingGroupUserAmountSaveReqVO {
|
||||
@Schema(description = "工厂id", example = "12639")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "搬运组工资规格关联id", example = "27617")
|
||||
private Long handlingGroupAmountSpecificationsId;
|
||||
@Schema(description = "搬运组id", example = "12639")
|
||||
private Long handlingGroupId;
|
||||
|
||||
@Schema(description = "日期 格式 yyyy-MM-dd")
|
||||
private String dateStr;
|
||||
|
@ -1,33 +1,37 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlingspecifications;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
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.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
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 static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlingspecifications.vo.*;
|
||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factoryinfo.FactoryInfoDO;
|
||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlingspecifications.HandlingSpecificationsDO;
|
||||
import cn.iocoder.yudao.module.smartfactory.service.factoryinfo.FactoryInfoService;
|
||||
import cn.iocoder.yudao.module.smartfactory.service.handlingspecifications.HandlingSpecificationsService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
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 org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 工厂搬运规格")
|
||||
@RestController
|
||||
@ -38,6 +42,9 @@ public class HandlingSpecificationsController {
|
||||
@Resource
|
||||
private HandlingSpecificationsService handlingSpecificationsService;
|
||||
|
||||
@Resource
|
||||
private FactoryInfoService factoryInfoService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建工厂搬运规格")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:handling-specifications:create')")
|
||||
@ -99,4 +106,38 @@ public class HandlingSpecificationsController {
|
||||
BeanUtils.toBean(list, HandlingSpecificationsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/get-import-template")
|
||||
@Operation(summary = "获得导入用户模板")
|
||||
public void importTemplate(HttpServletResponse response) throws IOException {
|
||||
|
||||
//获取部门名称
|
||||
List<FactoryInfoDO> factoryInfoDOS = factoryInfoService.getFactoryListByType();
|
||||
List<String> factoryName = factoryInfoDOS.stream()
|
||||
.map(item -> item.getId() + ":" + item.getShortName())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 类型选择
|
||||
List<String> type = Arrays.asList("0:数量", "1:重量");
|
||||
|
||||
Map<Integer, List<String>> mapDropDown = new HashMap<>();
|
||||
mapDropDown.put(0, factoryName);
|
||||
mapDropDown.put(2, type);
|
||||
|
||||
// 输出
|
||||
ExcelUtils.write(response, "搬运规格列表模板.xlsx", "搬运规格列表",
|
||||
HandlingSpecificationsImportVO.class, null,
|
||||
mapDropDown);
|
||||
}
|
||||
|
||||
@PostMapping("/import")
|
||||
@Operation(summary = "导入搬运规格列表")
|
||||
@Parameters({
|
||||
@Parameter(name = "file", description = "Excel 文件", required = true),
|
||||
@Parameter(name = "updateSupport", description = "是否支持更新,默认为 false", example = "true")
|
||||
})
|
||||
public CommonResult<HandlingSpecificationsImportRespVO> importExcel(@RequestParam("file") MultipartFile file,
|
||||
@RequestParam(value = "updateSupport", required = false, defaultValue = "false") Boolean updateSupport) throws Exception {
|
||||
List<HandlingSpecificationsImportVO> list = ExcelUtils.read(file, HandlingSpecificationsImportVO.class);
|
||||
return success(handlingSpecificationsService.importList(list, updateSupport));
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlingspecifications.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "管理后台 - 用户导入 Response VO")
|
||||
@Data
|
||||
@Builder
|
||||
public class HandlingSpecificationsImportRespVO {
|
||||
|
||||
@Schema(description = "创建成功的用户名数组", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<String> createUsernames;
|
||||
|
||||
@Schema(description = "更新成功的用户名数组", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<String> updateUsernames;
|
||||
|
||||
@Schema(description = "导入失败的用户集合,key 为用户名,value 为失败原因", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Map<String, String> failureUsernames;
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlingspecifications.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 工厂搬运规格导入 Request VO")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = false) // 设置 chain = false,避免用户导入有问题
|
||||
public class HandlingSpecificationsImportVO {
|
||||
|
||||
@ExcelProperty("厂区名称")
|
||||
@NotNull(message = "厂区名称不能为空")
|
||||
private String factoryName;
|
||||
|
||||
@ExcelProperty("规格名称")
|
||||
@NotNull(message = "规格名称不能为空")
|
||||
private String specificationsName;
|
||||
|
||||
@ExcelProperty("类型")
|
||||
@NotNull(message = "类型不能为空")
|
||||
private String type;
|
||||
|
||||
@ExcelProperty("重量 /(公斤 kg)")
|
||||
private BigDecimal weight;
|
||||
|
||||
@ExcelProperty("单价/(吨/1000 or 件)")
|
||||
@NotNull(message = "单价不能为空")
|
||||
private BigDecimal unitPrice;
|
||||
}
|
@ -18,7 +18,6 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
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 org.springframework.web.multipart.MultipartFile;
|
||||
@ -55,7 +54,6 @@ public class StaffController {
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建员工")
|
||||
@PreAuthorize("@ss.hasPermission('factory:staff:create')")
|
||||
public CommonResult<Long> createStaff(@Valid @RequestBody StaffSaveReqVO createReqVO) {
|
||||
return success(staffService.createStaff(createReqVO));
|
||||
}
|
||||
@ -68,7 +66,6 @@ public class StaffController {
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新员工")
|
||||
@PreAuthorize("@ss.hasPermission('factory:staff:update')")
|
||||
public CommonResult<Boolean> updateStaff(@Valid @RequestBody StaffSaveReqVO updateReqVO) {
|
||||
staffService.updateStaff(updateReqVO);
|
||||
return success(true);
|
||||
@ -76,7 +73,6 @@ public class StaffController {
|
||||
|
||||
@PutMapping("/update-salary")
|
||||
@Operation(summary = "更新员工")
|
||||
@PreAuthorize("@ss.hasPermission('factory:staff:update')")
|
||||
public CommonResult<Boolean> updateStaffSalary(@RequestBody StaffSalaryUpdateVO updateReqVO) {
|
||||
staffService.updateStaffSalary(updateReqVO);
|
||||
return success(true);
|
||||
@ -85,7 +81,6 @@ public class StaffController {
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除员工")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('factory:staff:delete')")
|
||||
public CommonResult<Boolean> deleteStaff(@RequestParam("id") Long id) {
|
||||
staffService.deleteStaff(id);
|
||||
return success(true);
|
||||
@ -94,7 +89,6 @@ public class StaffController {
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得员工")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('factory:staff:query')")
|
||||
public CommonResult<StaffDO> getStaff(@RequestParam("id") Long id) {
|
||||
StaffDO staff = staffService.getStaff(id);
|
||||
return success(staff);
|
||||
@ -104,7 +98,6 @@ public class StaffController {
|
||||
@Operation(summary = "获得指定厂区得员工")
|
||||
@Parameter(name = "factoryId", description = "厂区编号", required = true, example = "1024")
|
||||
@Parameter(name = "isIn", description = "是否获取该厂区得员工", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('factory:staff:query')")
|
||||
public CommonResult<List<StaffRespVO>> getListByFactory(@RequestParam("factoryId") Long factoryId,
|
||||
@RequestParam("isIn") Boolean isIn) {
|
||||
List<StaffDO> staffs = staffService.getListByFactory(factoryId, isIn);
|
||||
@ -115,14 +108,14 @@ public class StaffController {
|
||||
@GetMapping("/getListByFactoryId")
|
||||
@Operation(summary = "获得指定厂员工")
|
||||
public CommonResult<List<StaffRespVO>> getListByFactoryId(@RequestParam("factoryId") Long factoryId,
|
||||
@RequestParam(value = "nickName", required = false) String nickName) {
|
||||
List<StaffDO> staffs = staffService.getListByFactoryId(factoryId, nickName);
|
||||
@RequestParam(value = "nickName", required = false) String nickName,
|
||||
@RequestParam(value = "workTypeId", required = false) Long workTypeId) {
|
||||
List<StaffDO> staffs = staffService.getListByFactoryId(factoryId, nickName, workTypeId);
|
||||
return success(BeanUtils.toBean(staffs, StaffRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得员工分页")
|
||||
@PreAuthorize("@ss.hasPermission('factory:staff:query')")
|
||||
public CommonResult<PageResult<StaffRespVO>> getStaffPage(@Valid StaffPageReqVO pageReqVO) {
|
||||
PageResult<StaffDO> pageResult = staffService.getStaffPage(pageReqVO);
|
||||
PageResult<StaffRespVO> result = BeanUtils.toBean(pageResult, StaffRespVO.class);
|
||||
@ -142,15 +135,33 @@ public class StaffController {
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出员工 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('factory:staff:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportStaffExcel(@Valid StaffPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
pageReqVO.setStatus(1);
|
||||
List<StaffDO> list = staffService.getStaffPage(pageReqVO).getList();
|
||||
|
||||
// 获取工种字典值
|
||||
List<DictDataRespDTO> dictDataRespDTOS = dictDataApi.getDictDataList("user_work_type").getCheckedData();
|
||||
Map<String, String> workTypeMap = dictDataRespDTOS.stream().collect(Collectors.toMap(DictDataRespDTO::getValue, DictDataRespDTO::getLabel));
|
||||
|
||||
// 获取工厂信息Map
|
||||
Map<Long, FactoryInfoDO> factoryInfoDOMap = convertMap(factoryInfoService.getFactoryList(), FactoryInfoDO::getId);
|
||||
|
||||
List<StaffRespVO> respVOS = BeanUtils.toBean(list, StaffRespVO.class);
|
||||
respVOS.forEach(item -> {
|
||||
if (item.getWorkTypeId() != null) {
|
||||
item.setWorkTypeName(workTypeMap.getOrDefault(item.getWorkTypeId().toString(), ""));
|
||||
}
|
||||
// 设置性别
|
||||
item.setSexStr(item.getSex() == null ? null : item.getSex() == 1 ? "男" : "女");
|
||||
// 设置工厂名称
|
||||
item.setFactoryName(factoryInfoDOMap.get(item.getFactoryId()) != null ? factoryInfoDOMap.get(item.getFactoryId()).getShortName() : null);
|
||||
});
|
||||
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "员工.xls", "数据", StaffRespVO.class,
|
||||
BeanUtils.toBean(list, StaffRespVO.class));
|
||||
ExcelUtils.write(response, "员工.xls", "数据", StaffRespVO.class, respVOS);
|
||||
}
|
||||
|
||||
@GetMapping("/get-import-template")
|
||||
@ -160,7 +171,7 @@ public class StaffController {
|
||||
//获取部门名称
|
||||
List<FactoryInfoDO> factoryInfoDOS = factoryInfoService.getFactoryListByType();
|
||||
List<String> factoryName = factoryInfoDOS.stream()
|
||||
.map(item -> item.getId() + ":" + item.getName())
|
||||
.map(item -> item.getId() + ":" + item.getShortName())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
//获取工种名称
|
||||
@ -192,7 +203,6 @@ public class StaffController {
|
||||
@Parameter(name = "file", description = "Excel 文件", required = true),
|
||||
@Parameter(name = "updateSupport", description = "是否支持更新,默认为 false", example = "true")
|
||||
})
|
||||
@PreAuthorize("@ss.hasPermission('factory:staff:import')")
|
||||
public CommonResult<StaffImportRespVO> importExcel(@RequestParam("file") MultipartFile file,
|
||||
@RequestParam(value = "updateSupport", required = false, defaultValue = "false") Boolean updateSupport) throws Exception {
|
||||
List<StaffImportExcelVO> list = ExcelUtils.read(file, StaffImportExcelVO.class);
|
||||
|
@ -41,6 +41,12 @@ public class StaffImportExcelVO {
|
||||
@IdCard
|
||||
private String idCard;
|
||||
|
||||
@ExcelProperty("银行名称")
|
||||
private String bankName;
|
||||
|
||||
@ExcelProperty("银行卡号")
|
||||
private String bankNo;
|
||||
|
||||
@ExcelProperty("薪资")
|
||||
private BigDecimal salary;
|
||||
}
|
||||
|
@ -20,27 +20,34 @@ public class StaffRespVO {
|
||||
@ExcelProperty("姓名")
|
||||
private String nickName;
|
||||
|
||||
@Schema(description = "工厂名称", example = "6971")
|
||||
@ExcelProperty("工厂名称")
|
||||
private String factoryName;
|
||||
|
||||
@Schema(description = "年龄")
|
||||
@ExcelProperty("年龄")
|
||||
private Integer age;
|
||||
|
||||
@Schema(description = "用户性别(0男 1女 2未知)")
|
||||
@ExcelProperty("性别")
|
||||
@Schema(description = "用户性别(1男 2女)")
|
||||
private Integer sex;
|
||||
|
||||
@Schema(description = "用户性别(1男 2女)")
|
||||
@ExcelProperty("性别")
|
||||
private String sexStr;
|
||||
|
||||
@Schema(description = "工种id", example = "6971")
|
||||
private Integer workTypeId;
|
||||
|
||||
@Schema(description = "工种名称", example = "6971")
|
||||
@ExcelProperty("工种")
|
||||
private String workTypeName;
|
||||
|
||||
@Schema(description = "所属业务类型")
|
||||
private Integer businessType;
|
||||
|
||||
@Schema(description = "工厂id", example = "6971")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "工厂名称", example = "6971")
|
||||
@ExcelProperty("工厂名称")
|
||||
private String factoryName;
|
||||
|
||||
@Schema(description = "手机号")
|
||||
@ExcelProperty("手机号")
|
||||
private String mobile;
|
||||
|
@ -39,14 +39,12 @@ public class StaffSalaryController {
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建员工工资")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:staff-salary:create')")
|
||||
public CommonResult<Long> createStaff(@Valid @RequestBody StaffSalarySaveReqVO createReqVO) {
|
||||
return success(staffSalaryService.createStaffSalary(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新厂区员工工资")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:staff-salary:update')")
|
||||
public CommonResult<Boolean> updateStaffSalary(@Valid @RequestBody StaffSalarySaveReqVO updateReqVO) {
|
||||
staffSalaryService.updateStaffSalary(updateReqVO);
|
||||
return success(true);
|
||||
@ -54,7 +52,6 @@ public class StaffSalaryController {
|
||||
|
||||
@PutMapping("/update-status")
|
||||
@Operation(summary = "更新厂区员工工资状态")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:staff-salary:update')")
|
||||
public CommonResult<Boolean> updateStatus(@RequestBody StaffSalarySaveReqVO updateReqVO) {
|
||||
staffSalaryService.updateStatus(updateReqVO);
|
||||
return success(true);
|
||||
@ -63,7 +60,6 @@ public class StaffSalaryController {
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除厂区员工工资")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:staff-salary:delete')")
|
||||
public CommonResult<Boolean> deleteStaffSalary(@RequestParam("id") Long id) {
|
||||
staffSalaryService.deleteStaffSalary(id);
|
||||
return success(true);
|
||||
@ -72,7 +68,6 @@ public class StaffSalaryController {
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得厂区员工工资")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:staff-salary:query')")
|
||||
public CommonResult<StaffSalaryRespVO> getStaffSalary(@RequestParam("id") Long id) {
|
||||
StaffSalaryDO staffSalary = staffSalaryService.getStaffSalary(id);
|
||||
|
||||
@ -81,7 +76,6 @@ public class StaffSalaryController {
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得厂区员工工资分页")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:staff-salary:query')")
|
||||
public CommonResult<PageResult<StaffSalaryRespVO>> getStaffSalaryPage(@Valid StaffSalaryPageReqVO pageReqVO) {
|
||||
PageResult<StaffSalaryRespVO> pageResult = staffSalaryService.getStaffSalaryPage(pageReqVO);
|
||||
return success(pageResult);
|
||||
@ -89,7 +83,6 @@ public class StaffSalaryController {
|
||||
|
||||
@GetMapping("/total")
|
||||
@Operation(summary = "获取工资统计")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:staff-salary:query')")
|
||||
public CommonResult<SalaryTotalVO> getStaffSalaryTotal(@Valid StaffSalaryPageReqVO pageReqVO) {
|
||||
|
||||
return success(staffSalaryService.getStaffSalaryTotal(pageReqVO));
|
||||
@ -97,7 +90,6 @@ public class StaffSalaryController {
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出厂区员工工资 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:staff-salary:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportStaffSalaryExcel(@Valid StaffSalaryPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
@ -107,4 +99,4 @@ public class StaffSalaryController {
|
||||
ExcelUtils.write(response, "厂区员工工资.xls", "数据", StaffSalaryRespVO.class,
|
||||
list);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,4 +31,7 @@ public class StaffSalaryPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "工厂编码集合")
|
||||
private List<Long> factoryIds;
|
||||
|
||||
@Schema(description = "是否发放工资 | 0未发放 1已发放", example = "0")
|
||||
private Integer isGrant;
|
||||
}
|
@ -77,4 +77,7 @@ public class StaffSalaryRespVO {
|
||||
|
||||
@Schema(description = "借支金额")
|
||||
private BigDecimal loanAmount;
|
||||
|
||||
@Schema(description = "是否发放工资 | 0未发放 1已发放")
|
||||
private Integer isGrant;
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroup;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
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 lombok.*;
|
||||
|
||||
/**
|
||||
* 搬运组 DO
|
||||
*
|
||||
* @author 艾楷
|
||||
*/
|
||||
@TableName("sf_handling_group")
|
||||
@KeySequence("sf_handling_group_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class HandlingGroupDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 工厂id
|
||||
*/
|
||||
private Long factoryId;
|
||||
/**
|
||||
* 搬运组名称
|
||||
*/
|
||||
private String handlingGroupName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String factoryName;
|
||||
|
||||
/**
|
||||
* 搬运日期
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String dateStr;
|
||||
}
|
@ -1,15 +1,15 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupamountspecifications;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.SpecificationDetailVO;
|
||||
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 io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 搬运组工资规格关联 DO
|
||||
@ -17,7 +17,8 @@ import java.math.BigDecimal;
|
||||
* @author 艾楷
|
||||
*/
|
||||
@TableName("sf_handling_group_amount_specifications")
|
||||
@KeySequence("sf_handling_group_amount_specifications_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@KeySequence("sf_handling_group_amount_specifications_seq")
|
||||
// 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@ -39,9 +40,21 @@ public class HandlingGroupAmountSpecificationsDO extends BaseDO {
|
||||
* 搬运规格id
|
||||
*/
|
||||
private Long handlingSpecificationsId;
|
||||
|
||||
/**
|
||||
* 搬运规格名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String handlingSpecificationsName;
|
||||
/**
|
||||
* 搬运组id
|
||||
*/
|
||||
private Long handlingGroupId;
|
||||
|
||||
/**
|
||||
* 叉车司机id
|
||||
*/
|
||||
private Long staffId;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@ -54,5 +67,34 @@ public class HandlingGroupAmountSpecificationsDO extends BaseDO {
|
||||
* 总金额(根据规格和总量计算出 该搬运组获得的总金额)
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 金额合计
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private BigDecimal totalAmount;
|
||||
/**
|
||||
* 数量合计
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Integer totalNum;
|
||||
/**
|
||||
* 工厂名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String factoryName;
|
||||
/**
|
||||
* 搬运组名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String handlingGroupName;
|
||||
/**
|
||||
* 叉车司机名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String staffName;
|
||||
/**
|
||||
* 搬运规格id 逗号隔开
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<SpecificationDetailVO> specificationDetails;
|
||||
}
|
||||
|
@ -41,9 +41,10 @@ public class HandlingGroupUserAmountDO extends BaseDO {
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 搬运组工资规格关联id
|
||||
* 搬运组id
|
||||
*/
|
||||
private Long handlingGroupAmountSpecificationsId;
|
||||
private Long handlingGroupId;
|
||||
|
||||
/**
|
||||
* 工厂id
|
||||
*/
|
||||
@ -57,4 +58,8 @@ public class HandlingGroupUserAmountDO extends BaseDO {
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 状态 1未确认 2已确认
|
||||
*/
|
||||
private Integer status;
|
||||
}
|
||||
|
@ -80,4 +80,9 @@ public class StaffSalaryDO extends BaseDO {
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 是否发放工资 | 0未发放 1已发放
|
||||
*/
|
||||
private Integer isGrant;
|
||||
|
||||
}
|
@ -39,6 +39,7 @@ public interface CameraDeviceMapper extends BaseMapperX<CameraDeviceDO> {
|
||||
return selectList(new LambdaQueryWrapperX<CameraDeviceDO>()
|
||||
.eq(factoryId != null, CameraDeviceDO::getFactoryId, factoryId)
|
||||
.eq(CameraDeviceDO::getStatus, CommonStatusEnum.ENABLE.getStatus())
|
||||
.eq(CameraDeviceDO::getIsShow, 1));
|
||||
.eq(CameraDeviceDO::getIsShow, 1)
|
||||
.orderByAsc(CameraDeviceDO::getSort));
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,60 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.dal.mysql.handlinggroup;
|
||||
|
||||
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.smartfactory.controller.admin.handlinggroup.vo.HandlingGroupPageReqVO;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.dto.HandlingGroupAmountSpecificationsPageReqDTO;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.HandlingGroupAmountSpecificationsVO;
|
||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroup.HandlingGroupDO;
|
||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsDO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Result;
|
||||
import org.apache.ibatis.annotations.Results;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 搬运组 Mapper
|
||||
*
|
||||
* @author 艾楷
|
||||
*/
|
||||
@Mapper
|
||||
public interface HandlingGroupMapper extends BaseMapperX<HandlingGroupDO> {
|
||||
|
||||
default PageResult<HandlingGroupDO> selectPage(HandlingGroupPageReqVO reqVO) {
|
||||
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<HandlingGroupDO>()
|
||||
.eqIfPresent(HandlingGroupDO::getFactoryId, reqVO.getFactoryId())
|
||||
.likeIfPresent(HandlingGroupDO::getHandlingGroupName, reqVO.getHandlingGroupName())
|
||||
.betweenIfPresent(HandlingGroupDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(HandlingGroupDO::getId));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param page
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
IPage<HandlingGroupDO> selectPageList(@Param("page") Page<Object> page, @Param("vo") HandlingGroupPageReqVO vo);
|
||||
|
||||
/**
|
||||
* 根据时间分组查询分页
|
||||
*
|
||||
* @param page
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
IPage<HandlingGroupAmountSpecificationsVO> selectPageListByDateStr(@Param("page") Page<Object> page, @Param("vo") HandlingGroupAmountSpecificationsPageReqDTO vo);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
HandlingGroupDO getHandlingGroup(@Param("id") Long id);
|
||||
}
|
@ -3,13 +3,17 @@ package cn.iocoder.yudao.module.smartfactory.dal.mysql.handlinggroupamountspecif
|
||||
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.smartfactory.controller.admin.handlinggroupamountspecifications.dto.HandlingGroupAmountSpecificationsTotalNumDTO;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.HandlingGroupAmountSpecificationsPageReqVO;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.HandlingGroupAmountSpecificationsTotalNumVO;
|
||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsDO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 搬运组工资规格关联 Mapper
|
||||
*
|
||||
@ -44,4 +48,22 @@ public interface HandlingGroupAmountSpecificationsMapper extends BaseMapperX<Han
|
||||
* @return
|
||||
*/
|
||||
HandlingGroupAmountSpecificationsDO getHandlingGroupAmountSpecifications(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 获取详情 多条
|
||||
*
|
||||
* @param factoryId
|
||||
* @param dateStr
|
||||
* @param handlingGroupId
|
||||
* @return
|
||||
*/
|
||||
List<HandlingGroupAmountSpecificationsDO> getHandlingGroupAmountSpecificationsList(@Param("factoryId") Long factoryId, @Param("dateStr") String dateStr, @Param("handlingGroupId") Long handlingGroupId);
|
||||
|
||||
/**
|
||||
* 获取总金额
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
HandlingGroupAmountSpecificationsTotalNumVO getTotalNum(@Param("dto") HandlingGroupAmountSpecificationsTotalNumDTO dto);
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user