Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
9ff2eea9c9
12 files changed
+172
-15
No files matched your search
+6
@@ -26,4 +26,10 @@ public enum TaskCheckStatusEnum {
|
||||
.findFirst().get();
|
||||
}
|
||||
|
||||
public static TaskCheckStatusEnum codeOf(String code) {
|
||||
return Arrays.stream(TaskCheckStatusEnum.values())
|
||||
.filter(v -> ObjectUtil.equal(v.getCode(), code))
|
||||
.findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+3
@@ -14,6 +14,9 @@ public class HardCanteenProductTotalVo {
|
||||
@Schema(description = "用餐时间段(早中晚)")
|
||||
private String hourType;
|
||||
|
||||
@Schema(description = "购买人次")
|
||||
private Long payUserCount;
|
||||
|
||||
@Schema(description = "食品总数量")
|
||||
private Long payCount;
|
||||
|
||||
|
||||
+2
-2
@@ -218,9 +218,9 @@ public class HardOrderController {
|
||||
}
|
||||
|
||||
@Operation(summary = "分页复杂查询", description = "分页复杂查询")
|
||||
@GetMapping("/page-join")
|
||||
@PostMapping("/page-join")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardwareOrder_view')")
|
||||
public R pageJoin(@ParameterObject Page page, @ParameterObject HardOrderDto dto) {
|
||||
public R pageJoin(@ParameterObject Page page, @RequestBody HardOrderDto dto) {
|
||||
DataScope dataScope = DataScope.of().func(DataScopeFuncEnum.ALL);
|
||||
dataScope.setScopeDeptName("merchant_dept_id");
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
|
||||
+2
-1
@@ -54,7 +54,8 @@
|
||||
o.hour_type,
|
||||
COUNT(0) as timeCount,
|
||||
SUM(a.product_count) as payCount,
|
||||
SUM(a.total_price) as totalPrice
|
||||
SUM(a.total_price) as totalPrice,
|
||||
count(distinct o.user_id) as payUserCount
|
||||
from hard_car a
|
||||
inner join hard_parent_car p on a.parent_car_id = p.id and p.del_flag = '0'
|
||||
inner join hard_order o on o.parent_car_id = p.id and o.del_flag = '0' and o.hour_type is not null
|
||||
|
||||
+3
@@ -100,6 +100,9 @@
|
||||
<if test="dto.deptId != null">
|
||||
and a.dept_id = #{dto.deptId}
|
||||
</if>
|
||||
<if test="dto.userDeptId != null">
|
||||
and a.user_dept_id = #{dto.userDeptId}
|
||||
</if>
|
||||
<if test="dto.merchantId != null">
|
||||
and a.merchant_id = #{dto.merchantId}
|
||||
</if>
|
||||
|
||||
+2
-2
@@ -15,8 +15,8 @@ public enum WalletRechargeInvoiceStatusEnum {
|
||||
|
||||
UNBIND("1", "未绑定充值"),
|
||||
BINDED("2", "已绑定充值"),
|
||||
UNCHECKED("3", "未审核"),
|
||||
CHECKED("4", "审核成功"),
|
||||
UNCHECKED("3", "充值审批-未审核"),
|
||||
CHECKED("4", "充值审批-审核成功"),
|
||||
FINANCE_CANCELLATION("5", "财务管理员作废"),
|
||||
DEPT_CANCELLATION("6", "部门管理员作废"),
|
||||
;
|
||||
|
||||
+37
-1
@@ -1,6 +1,7 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo.recharge;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeInvoiceEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@@ -8,7 +9,42 @@ public class WalletRechargeInvoiceVo extends WalletRechargeInvoiceEntity {
|
||||
|
||||
private String totalPriceCnStr;
|
||||
|
||||
|
||||
private Boolean isCheckUser;
|
||||
|
||||
/**
|
||||
* 解析后的发票审核状体啊
|
||||
*/
|
||||
private String parseProcessStatus;
|
||||
|
||||
/**
|
||||
* 解析后的发票状态
|
||||
*/
|
||||
private String paseStatus;
|
||||
|
||||
/**
|
||||
* 解析后的发票日期
|
||||
*/
|
||||
private String parseTime;
|
||||
|
||||
/**
|
||||
* 解析后的申请时间
|
||||
*/
|
||||
private String parseApplyTime;
|
||||
|
||||
/**
|
||||
* 解析后的审核时间
|
||||
*/
|
||||
private String parseProcessTime;
|
||||
|
||||
/**
|
||||
* 解析后的人民币(元)
|
||||
*/
|
||||
private Long paseTotalPrice;
|
||||
|
||||
/**
|
||||
* 导出相关
|
||||
*/
|
||||
@Schema(description = "列号")
|
||||
private Long lineNumber;
|
||||
|
||||
}
|
||||
+5
-3
@@ -13,11 +13,13 @@ import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletManageBalanceDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeBindInvoiceDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeInvoiceApplyDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeInvoiceEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeInvoiceVo;
|
||||
import com.bsd.pjcloud.wallet.service.WalletRechargeInvoiceService;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
@@ -132,9 +134,9 @@ public class WalletRechargeInvoiceController {
|
||||
}
|
||||
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PostMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRechargeInvoice_export')")
|
||||
public List<WalletRechargeInvoiceEntity> export(WalletRechargeInvoiceEntity walletRechargeInvoice, Long[] ids) {
|
||||
return walletRechargeInvoiceService.list(Wrappers.lambdaQuery(walletRechargeInvoice).in(ArrayUtil.isNotEmpty(ids), WalletRechargeInvoiceEntity::getId, ids));
|
||||
public void export(HttpServletResponse response, @ParameterObject Page page, @RequestBody WalletRechargeBindInvoiceDto dto) {
|
||||
walletRechargeInvoiceService.export(response, page, dto, DataScope.of());
|
||||
}
|
||||
}
|
||||
+7
@@ -9,6 +9,8 @@ import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeInvoiceVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface WalletRechargeInvoiceMapper extends PjcloudBaseMapper<WalletRechargeInvoiceEntity> {
|
||||
|
||||
@@ -22,6 +24,11 @@ public interface WalletRechargeInvoiceMapper extends PjcloudBaseMapper<WalletRec
|
||||
*/
|
||||
Page<WalletRechargeInvoiceVo> scopePageList(Page page, @Param("dto") WalletRechargeBindInvoiceDto dto, DataScope dataScope);
|
||||
|
||||
/**
|
||||
* 列表权限查询
|
||||
*/
|
||||
List<WalletRechargeInvoiceVo> scopeList(@Param("dto") WalletRechargeBindInvoiceDto dto, DataScope dataScope);
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
|
||||
+12
@@ -9,9 +9,11 @@ import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeBindInvoiceDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeInvoiceApplyDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeInvoiceEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeInvoiceVo;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public interface WalletRechargeInvoiceService extends IService<WalletRechargeInvoiceEntity> {
|
||||
|
||||
@@ -25,6 +27,11 @@ public interface WalletRechargeInvoiceService extends IService<WalletRechargeInv
|
||||
*/
|
||||
Page<WalletRechargeInvoiceVo> scopePageList(Page page, WalletRechargeBindInvoiceDto dto, DataScope dataScope);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
List<WalletRechargeInvoiceVo> scopeList(WalletRechargeBindInvoiceDto dto, DataScope dataScope);
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@@ -74,4 +81,9 @@ public interface WalletRechargeInvoiceService extends IService<WalletRechargeInv
|
||||
* 生成盖章图片
|
||||
*/
|
||||
String stamp(WalletRechargeInvoiceEntity invoice);
|
||||
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
void export(HttpServletResponse response, Page page, WalletRechargeBindInvoiceDto dto, DataScope dataScope);
|
||||
}
|
||||
+78
@@ -7,6 +7,10 @@ import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.io.resource.ResourceUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.ExcelWriter;
|
||||
import com.alibaba.excel.write.metadata.WriteSheet;
|
||||
import com.alibaba.excel.write.metadata.fill.FillConfig;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
@@ -29,6 +33,7 @@ import com.bsd.pjcloud.flow.task.constant.TaskCheckStatusEnum;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
||||
import com.bsd.pjcloud.flow.task.dto.TaskDto;
|
||||
import com.bsd.pjcloud.flow.task.dto.TaskParamDto;
|
||||
import com.bsd.pjcloud.hard.api.vo.order.HardOrderSbVo;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletBizRechargeEnum;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletRechargeInvoiceStatusEnum;
|
||||
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeBindInvoiceDto;
|
||||
@@ -47,6 +52,7 @@ import com.bsd.pjcloud.wallet.service.WalletRechargeInvoiceService;
|
||||
import com.bsd.pjcloud.wallet.utils.ConvertCnPriceUtil;
|
||||
import com.bsd.pjcloud.wallet.utils.flow.FlowUtil;
|
||||
import com.bsd.pjcloud.wallet.utils.flow.dto.WalletRechargeInvoiceFlowDto;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -65,6 +71,7 @@ import java.math.RoundingMode;
|
||||
import java.net.URL;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -117,6 +124,17 @@ public class WalletRechargeInvoiceServiceImpl extends ServiceImpl<WalletRecharge
|
||||
return pageList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表分页查询
|
||||
*/
|
||||
@Override
|
||||
public List<WalletRechargeInvoiceVo> scopeList(WalletRechargeBindInvoiceDto dto, DataScope dataScope) {
|
||||
List<WalletRechargeInvoiceVo> pageList = baseMapper.scopeList(dto, dataScope);
|
||||
disposeList(pageList, dto);
|
||||
return pageList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*/
|
||||
@@ -448,6 +466,66 @@ public class WalletRechargeInvoiceServiceImpl extends ServiceImpl<WalletRecharge
|
||||
applyMapper.update(updateWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
@Override
|
||||
public void export(HttpServletResponse response, Page page, WalletRechargeBindInvoiceDto dto, DataScope dataScope) {
|
||||
List<WalletRechargeInvoiceVo> list = scopeList(dto, dataScope);
|
||||
try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).withTemplate(ResourceUtil.getStream("file/充值扣款发票申请.xlsx")).build()) {
|
||||
WriteSheet writeSheet = EasyExcel.writerSheet().build();
|
||||
FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
|
||||
map.put("timeSpan", " 到 ");
|
||||
map.put("startTime", LocalDateTimeUtil.format(dto.getCreateTimeList()[0], DatePattern.NORM_DATETIME_PATTERN));
|
||||
map.put("endTime", LocalDateTimeUtil.format(dto.getCreateTimeList()[1], DatePattern.NORM_DATETIME_PATTERN));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(list)) {
|
||||
Long lineNumber = 1L;
|
||||
BigDecimal balanceSum = BigDecimal.ZERO;
|
||||
for (WalletRechargeInvoiceVo v : list) {
|
||||
v.setLineNumber(lineNumber);
|
||||
lineNumber++;
|
||||
// 发票申请日期
|
||||
if (ObjectUtil.isNotEmpty(v.getTime())) {
|
||||
v.setParseTime(LocalDateTimeUtil.format(v.getTime(), DatePattern.NORM_DATETIME_PATTERN));
|
||||
}
|
||||
// 申请时间
|
||||
if (ObjectUtil.isNotEmpty(v.getApplyTime())) {
|
||||
v.setParseApplyTime(LocalDateTimeUtil.format(v.getApplyTime(), DatePattern.NORM_DATETIME_PATTERN));
|
||||
}
|
||||
// 审核时间
|
||||
if (ObjectUtil.isNotEmpty(v.getProcessTime())) {
|
||||
v.setParseProcessTime(LocalDateTimeUtil.format(v.getProcessTime(), DatePattern.NORM_DATETIME_PATTERN));
|
||||
}
|
||||
|
||||
// 发票状态
|
||||
if (ObjectUtil.isNotEmpty(v.getStatus())) {
|
||||
WalletRechargeInvoiceStatusEnum statusEnum = WalletRechargeInvoiceStatusEnum.codeOf(v.getStatus());
|
||||
if (ObjectUtil.isNotEmpty(statusEnum)) v.setPaseStatus(statusEnum.getDesc());
|
||||
}
|
||||
// 发票审核状态
|
||||
if (ObjectUtil.isNotEmpty(v.getProcessStatus())) {
|
||||
TaskCheckStatusEnum statusEnum = TaskCheckStatusEnum.codeOf(v.getProcessStatus());
|
||||
if (ObjectUtil.isNotEmpty(statusEnum)) v.setParseProcessStatus(statusEnum.getDesc());
|
||||
}
|
||||
// 合计人民币
|
||||
if (ObjectUtil.isNotEmpty(v.getTotalPrice())) {
|
||||
balanceSum = balanceSum.add(BigDecimal.valueOf(v.getTotalPrice()));
|
||||
v.setPaseTotalPrice(BigDecimal.valueOf(v.getTotalPrice()).divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).longValue());
|
||||
}
|
||||
}
|
||||
map.put("computeTotalPrice", balanceSum.divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).longValue());
|
||||
}
|
||||
excelWriter.fill(map, writeSheet);
|
||||
excelWriter.fill(list, fillConfig, writeSheet);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|{}|导出失败,error:|{}|", TAG, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private void disposeList(List<WalletRechargeInvoiceVo> list, WalletRechargeBindInvoiceDto dto) {
|
||||
if (ObjectUtil.isEmpty(list)) return;
|
||||
// 审批流程
|
||||
|
||||
+15
-6
@@ -64,12 +64,7 @@
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="selectAllCount" resultType="java.lang.Long">
|
||||
SELECT COUNT(0)
|
||||
FROM wallet_recharge_invoice
|
||||
</select>
|
||||
|
||||
<select id="scopePageList" resultType="com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeInvoiceVo">
|
||||
<sql id="pageList">
|
||||
<include refid="selectA"/>
|
||||
1
|
||||
FROM wallet_recharge_invoice a
|
||||
@@ -77,6 +72,15 @@
|
||||
<include refid="whereA"/>
|
||||
</where>
|
||||
order by a.create_time desc , a.id desc
|
||||
</sql>
|
||||
|
||||
<select id="selectAllCount" resultType="java.lang.Long">
|
||||
SELECT COUNT(0)
|
||||
FROM wallet_recharge_invoice
|
||||
</select>
|
||||
|
||||
<select id="scopePageList" resultType="com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeInvoiceVo">
|
||||
<include refid="pageList" />
|
||||
</select>
|
||||
|
||||
<select id="joinById" resultType="com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeInvoiceVo">
|
||||
@@ -85,4 +89,9 @@
|
||||
FROM wallet_recharge_invoice a
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="scopeList" resultType="com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeInvoiceVo">
|
||||
<include refid="pageList"/>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in new issue
Block a user