Showing
5 changed files
with
88 additions
and
0 deletions
| ... | ... | @@ -37,6 +37,18 @@ public class QueryReceiptLedgerInfoBo extends BaseBo<ReceiptLedgerInfo> { |
| 37 | 37 | private String customerShortId; |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | + * 客户简称 | |
| 41 | + */ | |
| 42 | + @ApiModelProperty("客户简称") | |
| 43 | + private String customerShortName; | |
| 44 | + | |
| 45 | + /** | |
| 46 | + * 客户类型 | |
| 47 | + */ | |
| 48 | + @ApiModelProperty("客户类型") | |
| 49 | + private String customerType; | |
| 50 | + | |
| 51 | + /** | |
| 40 | 52 | * 额度 |
| 41 | 53 | */ |
| 42 | 54 | @ApiModelProperty("额度") |
| ... | ... | @@ -55,24 +67,48 @@ public class QueryReceiptLedgerInfoBo extends BaseBo<ReceiptLedgerInfo> { |
| 55 | 67 | private String deptId; |
| 56 | 68 | |
| 57 | 69 | /** |
| 70 | + * 办事处名称 | |
| 71 | + */ | |
| 72 | + @ApiModelProperty("办事处名称") | |
| 73 | + private String deptName; | |
| 74 | + | |
| 75 | + /** | |
| 58 | 76 | * 区域ID |
| 59 | 77 | */ |
| 60 | 78 | @ApiModelProperty("区域ID") |
| 61 | 79 | private String region; |
| 62 | 80 | |
| 63 | 81 | /** |
| 82 | + * 区域名称 | |
| 83 | + */ | |
| 84 | + @ApiModelProperty("区域名称") | |
| 85 | + private String regionName; | |
| 86 | + | |
| 87 | + /** | |
| 64 | 88 | * 备货单位ID |
| 65 | 89 | */ |
| 66 | 90 | @ApiModelProperty("备货单位ID") |
| 67 | 91 | private String stockUpCompanyId; |
| 68 | 92 | |
| 69 | 93 | /** |
| 94 | + * 备货单位名称 | |
| 95 | + */ | |
| 96 | + @ApiModelProperty("备货单位名称") | |
| 97 | + private String stockUpCompanyName; | |
| 98 | + | |
| 99 | + /** | |
| 70 | 100 | * 客户ID |
| 71 | 101 | */ |
| 72 | 102 | @ApiModelProperty("客户ID") |
| 73 | 103 | private String customerId; |
| 74 | 104 | |
| 75 | 105 | /** |
| 106 | + * 客户名称 | |
| 107 | + */ | |
| 108 | + @ApiModelProperty("客户名称") | |
| 109 | + private String customerName; | |
| 110 | + | |
| 111 | + /** | |
| 76 | 112 | * 厂别 |
| 77 | 113 | */ |
| 78 | 114 | @ApiModelProperty("厂别") |
| ... | ... | @@ -234,5 +270,10 @@ public class QueryReceiptLedgerInfoBo extends BaseBo<ReceiptLedgerInfo> { |
| 234 | 270 | if (StringUtils.isNotBlank(dto.getParentId())) { |
| 235 | 271 | this.spilt = true; |
| 236 | 272 | } |
| 273 | + if ("XC".equals(dto.getFactoryType())) { | |
| 274 | + this.factoryType = "安徽楚江科技新材料股份有限公司"; | |
| 275 | + } else if ("GJ".equals(dto.getFactoryType())) { | |
| 276 | + this.factoryType = "安徽楚江高精铜带有限公司"; | |
| 277 | + } | |
| 237 | 278 | } |
| 238 | 279 | } | ... | ... |
| ... | ... | @@ -2,6 +2,7 @@ package com.lframework.xingyun.sc.controller.ledger; |
| 2 | 2 | |
| 3 | 3 | import com.lframework.xingyun.sc.bo.ledger.receipt.GetReceiptLedgerInfoBo; |
| 4 | 4 | import com.lframework.xingyun.sc.bo.ledger.receipt.QueryReceiptLedgerInfoBo; |
| 5 | +import com.lframework.xingyun.sc.utils.CommonUtil; | |
| 5 | 6 | import com.lframework.xingyun.sc.vo.ledger.receipt.QueryReceiptLedgerInfoVo; |
| 6 | 7 | import com.lframework.xingyun.sc.service.ledger.ReceiptLedgerInfoService; |
| 7 | 8 | import com.lframework.xingyun.sc.vo.ledger.receipt.CreateReceiptLedgerInfoVo; |
| ... | ... | @@ -49,6 +50,10 @@ public class ReceiptLedgerInfoController extends DefaultBaseController { |
| 49 | 50 | @HasPermission({"account-manage:ledger-detail:query"}) |
| 50 | 51 | @GetMapping("/query") |
| 51 | 52 | public InvokeResult<PageResult<QueryReceiptLedgerInfoBo>> query(@Valid QueryReceiptLedgerInfoVo vo) { |
| 53 | + if (vo.getTabNum() != null) { | |
| 54 | + String dateTime = CommonUtil.convertToMonthDate(vo.getTabNum()); | |
| 55 | + vo.setCreateTime(dateTime); | |
| 56 | + } | |
| 52 | 57 | PageResult<ReceiptLedgerInfo> pageResult = receiptLedgerInfoService.query(getPageIndex(vo), getPageSize(vo), vo); |
| 53 | 58 | List<ReceiptLedgerInfo> dataList = pageResult.getDatas(); |
| 54 | 59 | List<QueryReceiptLedgerInfoBo> results = null; | ... | ... |
| 1 | 1 | package com.lframework.xingyun.sc.utils; |
| 2 | 2 | |
| 3 | +import com.lframework.starter.common.exceptions.impl.DefaultClientException; | |
| 3 | 4 | import lombok.extern.slf4j.Slf4j; |
| 4 | 5 | import org.apache.commons.collections4.CollectionUtils; |
| 5 | 6 | |
| 6 | 7 | import java.io.*; |
| 7 | 8 | import java.math.BigDecimal; |
| 8 | 9 | import java.math.RoundingMode; |
| 10 | +import java.time.LocalDateTime; | |
| 11 | +import java.time.Year; | |
| 12 | +import java.time.format.DateTimeFormatter; | |
| 9 | 13 | import java.util.ArrayList; |
| 10 | 14 | import java.util.Collections; |
| 11 | 15 | import java.util.List; |
| ... | ... | @@ -14,6 +18,9 @@ import java.util.List; |
| 14 | 18 | public class CommonUtil { |
| 15 | 19 | |
| 16 | 20 | |
| 21 | + // 预定义格式器 | |
| 22 | + private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); | |
| 23 | + | |
| 17 | 24 | |
| 18 | 25 | /** |
| 19 | 26 | * 深度拷贝 |
| ... | ... | @@ -77,4 +84,23 @@ public class CommonUtil { |
| 77 | 84 | return batches; |
| 78 | 85 | } |
| 79 | 86 | |
| 87 | + | |
| 88 | + /** | |
| 89 | + * 将月份数字转换为当前年份对应月份的第一天 | |
| 90 | + * | |
| 91 | + * @param month 月份数字 (1-12) | |
| 92 | + * @return 格式化的日期时间字符串,如 "2025-01-01 00:00:00" | |
| 93 | + */ | |
| 94 | + public static String convertToMonthDate(int month) { | |
| 95 | + // 验证月份是否有效 | |
| 96 | + if (month < 1 || month > 12) { | |
| 97 | + throw new DefaultClientException("月份必须在 1-12 之间,当前值: " + month); | |
| 98 | + } | |
| 99 | + // 获取当前年份 | |
| 100 | + int currentYear = Year.now().getValue(); | |
| 101 | + // 创建当月第一天的日期时间 | |
| 102 | + LocalDateTime dateTime = LocalDateTime.of(currentYear, month, 1, 0, 0, 0); | |
| 103 | + // 格式化为字符串 | |
| 104 | + return dateTime.format(FORMATTER); | |
| 105 | + } | |
| 80 | 106 | } | ... | ... |
| ... | ... | @@ -52,4 +52,17 @@ public class QueryReceiptLedgerInfoVo extends PageVo implements BaseVo, Serializ |
| 52 | 52 | */ |
| 53 | 53 | @ApiModelProperty("客户名称") |
| 54 | 54 | private String customerName; |
| 55 | + | |
| 56 | + /** | |
| 57 | + * tab页 | |
| 58 | + * 月份 | |
| 59 | + */ | |
| 60 | + @ApiModelProperty("tab页") | |
| 61 | + private Integer tabNum; | |
| 62 | + | |
| 63 | + /** | |
| 64 | + * 创建时间 | |
| 65 | + */ | |
| 66 | + @ApiModelProperty("创建时间") | |
| 67 | + private String createTime; | |
| 55 | 68 | } | ... | ... |
| ... | ... | @@ -105,6 +105,9 @@ |
| 105 | 105 | <if test="vo.customerId != null and vo.customerId != ''"> |
| 106 | 106 | AND tb.customer_id = #{vo.customerId} |
| 107 | 107 | </if> |
| 108 | + <if test="vo.createTime != null and vo.createTime != ''"> | |
| 109 | + AND tb.create_time >= #{vo.createTime} | |
| 110 | + </if> | |
| 108 | 111 | <if test="vo.customerName != null and vo.customerName != ''"> |
| 109 | 112 | AND oc.name LIKE CONCAT('%', #{vo.customerName}, '%') |
| 110 | 113 | </if> | ... | ... |