Showing
10 changed files
with
43 additions
and
27 deletions
| ... | ... | @@ -2974,7 +2974,7 @@ CREATE TABLE IF NOT EXISTS `procurement_buyout_account_order_line` |
| 2974 | 2974 | `settle_line_id` varchar(32) DEFAULT NULL COMMENT '原料结算详情单明细行ID(来源行,数据追溯)', |
| 2975 | 2975 | `procurement_plan_id` varchar(32) DEFAULT NULL COMMENT '采购计划ID(来源行计划)', |
| 2976 | 2976 | `product_id` varchar(32) DEFAULT NULL COMMENT '品种关系ID(来源行品种)', |
| 2977 | - `buyout_category` varchar(50) DEFAULT NULL COMMENT '买断品种(原料结算详情单类别,品种关系代号)', | |
| 2977 | + `product_name` varchar(100) DEFAULT NULL COMMENT '买断品种(原料结算详情单品种名称)', | |
| 2978 | 2978 | `buyout_quantity` decimal(12,2) DEFAULT NULL COMMENT '买断数量 kg(原料结算详情单过磅数)', |
| 2979 | 2979 | `buyout_price` decimal(12,4) DEFAULT NULL COMMENT '买断单价 元/kg(仓库收料单含税单价)', |
| 2980 | 2980 | `buyout_amount` decimal(14,2) DEFAULT NULL COMMENT '买断金额 = 买断单价*买断数量', | ... | ... |
| ... | ... | @@ -161,8 +161,8 @@ public class GetBuyoutAccountOrderBo { |
| 161 | 161 | @ApiModelProperty("品种关系ID") |
| 162 | 162 | private String productId; |
| 163 | 163 | |
| 164 | - @ApiModelProperty("买断品种") | |
| 165 | - private String buyoutCategory; | |
| 164 | + @ApiModelProperty("买断品种(品种名称)") | |
| 165 | + private String productName; | |
| 166 | 166 | |
| 167 | 167 | @ApiModelProperty("买断数量 kg") |
| 168 | 168 | private BigDecimal buyoutQuantity; | ... | ... |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/procurement/GetBuyoutAccountSummaryLineBo.java
| ... | ... | @@ -25,8 +25,8 @@ public class GetBuyoutAccountSummaryLineBo { |
| 25 | 25 | @ApiModelProperty("合计差异金额(单级,备用)") |
| 26 | 26 | private BigDecimal totalDiffAmount; |
| 27 | 27 | |
| 28 | - @ApiModelProperty("品种") | |
| 29 | - private String buyoutCategory; | |
| 28 | + @ApiModelProperty("品种(品种名称)") | |
| 29 | + private String productName; | |
| 30 | 30 | |
| 31 | 31 | @ApiModelProperty("买断数量 公斤") |
| 32 | 32 | private BigDecimal buyoutQuantity; | ... | ... |
| ... | ... | @@ -26,6 +26,9 @@ public class GetBuyoutSettleDataBo { |
| 26 | 26 | @ApiModelProperty("来料单位(原料结算详情单的单位)") |
| 27 | 27 | private String incomingUnit; |
| 28 | 28 | |
| 29 | + @ApiModelProperty("公司简称(取自过磅码单)") | |
| 30 | + private String companyShortName; | |
| 31 | + | |
| 29 | 32 | @ApiModelProperty("计划编号(关联结算详情单的计划编号)") |
| 30 | 33 | private String planCodes; |
| 31 | 34 | ... | ... |
| ... | ... | @@ -284,8 +284,8 @@ public class ProcurementBuyoutAccountOrderController extends DefaultBaseControll |
| 284 | 284 | if (line == null) { |
| 285 | 285 | return; |
| 286 | 286 | } |
| 287 | - if (line.getBuyoutCategory() != null) { | |
| 288 | - ExcelUtil.setCellValue(sheet, rowIdx, 0, line.getBuyoutCategory()); | |
| 287 | + if (line.getProductName() != null) { | |
| 288 | + ExcelUtil.setCellValue(sheet, rowIdx, 0, line.getProductName()); | |
| 289 | 289 | } |
| 290 | 290 | if (line.getBuyoutQuantity() != null) { |
| 291 | 291 | ExcelUtil.setCellValue(sheet, rowIdx, 1, line.getBuyoutQuantity()); | ... | ... |
| ... | ... | @@ -44,9 +44,9 @@ public class ProcurementBuyoutAccountOrderLine extends BaseEntity implements Bas |
| 44 | 44 | private String productId; |
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | - * 买断品种(原料结算详情单类别,品种关系代号) | |
| 47 | + * 买断品种(原料结算详情单品种名称) | |
| 48 | 48 | */ |
| 49 | - private String buyoutCategory; | |
| 49 | + private String productName; | |
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * 买断数量 kg(原料结算详情单过磅数) | ... | ... |
| ... | ... | @@ -49,10 +49,12 @@ import com.lframework.xingyun.sc.procurement.entity.receive.ProcurementWarehouse |
| 49 | 49 | import com.lframework.xingyun.sc.procurement.entity.receive.ProcurementWarehouseReceiveOrderLine; |
| 50 | 50 | import com.lframework.xingyun.sc.procurement.entity.buyoutAccount.ProcurementBuyoutAccountOrder; |
| 51 | 51 | import com.lframework.xingyun.sc.procurement.entity.buyoutAccount.ProcurementBuyoutAccountOrderLine; |
| 52 | +import com.lframework.xingyun.sc.procurement.entity.weighing.ProcurementWeighingTicket; | |
| 52 | 53 | import com.lframework.xingyun.sc.procurement.mappers.buyoutAccount.ProcurementBuyoutAccountOrderMapper; |
| 53 | 54 | import com.lframework.xingyun.sc.procurement.mappers.receive.ProcurementWarehouseReceiveOrderLineMapper; |
| 54 | 55 | import com.lframework.xingyun.sc.procurement.mappers.receive.ProcurementWarehouseReceiveOrderMapper; |
| 55 | 56 | import com.lframework.xingyun.sc.procurement.mappers.settle.ProcurementMaterialSettleDetailMapper; |
| 57 | +import com.lframework.xingyun.sc.procurement.mappers.weighing.ProcurementWeighingTicketMapper; | |
| 56 | 58 | import com.lframework.xingyun.sc.procurement.service.buyout.ProcurementBuyoutApplyLineService; |
| 57 | 59 | import com.lframework.xingyun.sc.procurement.service.buyout.ProcurementBuyoutApplyService; |
| 58 | 60 | import com.lframework.xingyun.sc.procurement.service.buyoutAccount.ProcurementBuyoutAccountOrderLineService; |
| ... | ... | @@ -170,6 +172,8 @@ public class ProcurementBuyoutAccountOrderServiceImpl |
| 170 | 172 | @Resource |
| 171 | 173 | private SysDeptService sysDeptService; |
| 172 | 174 | @Resource |
| 175 | + private ProcurementWeighingTicketMapper weighingTicketMapper; | |
| 176 | + @Resource | |
| 173 | 177 | private FlowInstanceWrapperService flowInstanceWrapperService; |
| 174 | 178 | @Resource |
| 175 | 179 | private FlowTaskWrapperMapper flowTaskWrapperMapper; |
| ... | ... | @@ -258,6 +262,11 @@ public class ProcurementBuyoutAccountOrderServiceImpl |
| 258 | 262 | option.setPlanCodes(detail.getPlanCodes()); |
| 259 | 263 | option.setWorkshopId(detail.getWorkshopId()); |
| 260 | 264 | option.setWorkshopName(detail.getWorkshopName()); |
| 265 | + // 公司简称取自过磅码单 | |
| 266 | + if (StringUtil.isNotBlank(detail.getWeighingTicketId())) { | |
| 267 | + ProcurementWeighingTicket ticket = weighingTicketMapper.findById(detail.getWeighingTicketId()); | |
| 268 | + option.setCompanyShortName(ticket == null ? "" : ticket.getCompanyShortName()); | |
| 269 | + } | |
| 261 | 270 | options.add(option); |
| 262 | 271 | } |
| 263 | 272 | return options; |
| ... | ... | @@ -301,14 +310,15 @@ public class ProcurementBuyoutAccountOrderServiceImpl |
| 301 | 310 | |
| 302 | 311 | List<ProcurementMaterialSettleLine> settleLines = settleLineService.getBySettleDetailId(settleDetailId); |
| 303 | 312 | for (ProcurementMaterialSettleLine settleLine : settleLines) { |
| 304 | - if (settleLine == null) { | |
| 313 | + if (settleLine == null || StringUtil.isBlank(settleLine.getCategory())) { | |
| 314 | + // 没有类别(category)的结算明细行不代入 | |
| 305 | 315 | continue; |
| 306 | 316 | } |
| 307 | 317 | BuyoutAccountOrderLineVo lineVo = new BuyoutAccountOrderLineVo(); |
| 308 | 318 | lineVo.setSettleLineId(settleLine.getId()); |
| 309 | 319 | lineVo.setProcurementPlanId(settleLine.getProcurementPlanId()); |
| 310 | 320 | lineVo.setProductId(settleLine.getProductId()); |
| 311 | - lineVo.setBuyoutCategory(settleLine.getCategory()); | |
| 321 | + lineVo.setProductName(settleLine.getProductName()); | |
| 312 | 322 | lineVo.setBuyoutQuantity(settleLine.getWeighQuantity()); |
| 313 | 323 | lineVo.setBuyoutPrice(receiveTaxPriceMap.get(settleLine.getId())); |
| 314 | 324 | if (lineVo.getBuyoutPrice() != null && lineVo.getBuyoutQuantity() != null) { |
| ... | ... | @@ -821,8 +831,8 @@ public class ProcurementBuyoutAccountOrderServiceImpl |
| 821 | 831 | for (int k = i; k < j; k++) { |
| 822 | 832 | int rowIdx = lineStartRow + k; |
| 823 | 833 | GetBuyoutAccountSummaryLineBo row = rows.get(k); |
| 824 | - if (row.getBuyoutCategory() != null) { | |
| 825 | - ExcelUtil.setCellValue(sheet, rowIdx, 4, row.getBuyoutCategory()); | |
| 834 | + if (row.getProductName() != null) { | |
| 835 | + ExcelUtil.setCellValue(sheet, rowIdx, 4, row.getProductName()); | |
| 826 | 836 | } |
| 827 | 837 | if (row.getBuyoutQuantity() != null) { |
| 828 | 838 | ExcelUtil.setCellValue(sheet, rowIdx, 5, row.getBuyoutQuantity()); | ... | ... |
| ... | ... | @@ -26,8 +26,8 @@ public class BuyoutAccountOrderLineVo implements Serializable { |
| 26 | 26 | @ApiModelProperty("品种关系ID(来源行品种)") |
| 27 | 27 | private String productId; |
| 28 | 28 | |
| 29 | - @ApiModelProperty("买断品种(原料结算详情单类别)") | |
| 30 | - private String buyoutCategory; | |
| 29 | + @ApiModelProperty("买断品种(原料结算详情单品种名称)") | |
| 30 | + private String productName; | |
| 31 | 31 | |
| 32 | 32 | @ApiModelProperty("买断数量 kg(原料结算详情单过磅数)") |
| 33 | 33 | private BigDecimal buyoutQuantity; | ... | ... |
| ... | ... | @@ -2,13 +2,14 @@ package com.lframework.xingyun.sc.procurement.vo.buyoutAccount; |
| 2 | 2 | |
| 3 | 3 | import com.fasterxml.jackson.annotation.JsonFormat; |
| 4 | 4 | import com.lframework.starter.common.constants.StringPool; |
| 5 | +import com.lframework.starter.web.core.components.validation.TypeMismatch; | |
| 5 | 6 | import com.lframework.starter.web.core.vo.SortPageVo; |
| 6 | 7 | import io.swagger.annotations.ApiModel; |
| 7 | 8 | import io.swagger.annotations.ApiModelProperty; |
| 8 | 9 | import lombok.Data; |
| 9 | 10 | |
| 10 | 11 | import java.io.Serializable; |
| 11 | -import java.time.LocalDate; | |
| 12 | +import java.time.LocalDateTime; | |
| 12 | 13 | |
| 13 | 14 | @Data |
| 14 | 15 | @ApiModel("查询买断入库核算单Vo") |
| ... | ... | @@ -23,12 +24,14 @@ public class QueryBuyoutAccountOrderVo extends SortPageVo implements Serializabl |
| 23 | 24 | private String planCode; |
| 24 | 25 | |
| 25 | 26 | @ApiModelProperty("创建时间-开始") |
| 26 | - @JsonFormat(pattern = StringPool.DATE_PATTERN) | |
| 27 | - private LocalDate createTimeStart; | |
| 27 | + @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN) | |
| 28 | + @TypeMismatch(message = "创建时间开始格式有误!") | |
| 29 | + private LocalDateTime startTime; | |
| 28 | 30 | |
| 29 | 31 | @ApiModelProperty("创建时间-结束") |
| 30 | - @JsonFormat(pattern = StringPool.DATE_PATTERN) | |
| 31 | - private LocalDate createTimeEnd; | |
| 32 | + @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN) | |
| 33 | + @TypeMismatch(message = "创建时间结束格式有误!") | |
| 34 | + private LocalDateTime endTime; | |
| 32 | 35 | |
| 33 | 36 | @ApiModelProperty("客户名称/来料单位(模糊匹配)") |
| 34 | 37 | private String incomingUnit; | ... | ... |
| ... | ... | @@ -117,12 +117,12 @@ |
| 117 | 117 | <if test="vo.planCode != null and vo.planCode != ''"> |
| 118 | 118 | AND tb.plan_codes LIKE CONCAT('%', #{vo.planCode}, '%') |
| 119 | 119 | </if> |
| 120 | - <!-- 创建时间筛选(结束日期覆盖全天) --> | |
| 121 | - <if test="vo.createTimeStart != null"> | |
| 122 | - AND tb.create_time >= #{vo.createTimeStart} | |
| 120 | + <!-- 创建时间筛选(精确到时分秒) --> | |
| 121 | + <if test="vo.startTime != null"> | |
| 122 | + AND tb.create_time >= #{vo.startTime} | |
| 123 | 123 | </if> |
| 124 | - <if test="vo.createTimeEnd != null"> | |
| 125 | - AND tb.create_time < DATE_ADD(#{vo.createTimeEnd}, INTERVAL 1 DAY) | |
| 124 | + <if test="vo.endTime != null"> | |
| 125 | + AND tb.create_time <= #{vo.endTime} | |
| 126 | 126 | </if> |
| 127 | 127 | <if test="vo.incomingUnit != null and vo.incomingUnit != ''"> |
| 128 | 128 | AND tb.incoming_unit LIKE CONCAT('%', #{vo.incomingUnit}, '%') |
| ... | ... | @@ -153,7 +153,7 @@ |
| 153 | 153 | <result column="purchase_department_name" property="purchaseDepartmentName"/> |
| 154 | 154 | <result column="incoming_unit" property="incomingUnit"/> |
| 155 | 155 | <result column="total_diff_amount" property="totalDiffAmount"/> |
| 156 | - <result column="buyout_category" property="buyoutCategory"/> | |
| 156 | + <result column="product_name" property="productName"/> | |
| 157 | 157 | <result column="buyout_quantity" property="buyoutQuantity"/> |
| 158 | 158 | <result column="expect_ton_loss" property="expectTonLoss"/> |
| 159 | 159 | <result column="actual_ton_loss" property="actualTonLoss"/> |
| ... | ... | @@ -169,7 +169,7 @@ |
| 169 | 169 | tb.purchase_department_name, |
| 170 | 170 | tb.incoming_unit, |
| 171 | 171 | tb.total_diff_amount, |
| 172 | - pwl.buyout_category, | |
| 172 | + pwl.product_name, | |
| 173 | 173 | pwl.buyout_quantity, |
| 174 | 174 | pwl.expect_ton_loss, |
| 175 | 175 | pwl.actual_ton_loss, | ... | ... |