feat(approve): 在审批记录中添加发货数量信息
- 修改ApproveProcessServiceImpl,在审批记录的理由中追加发货数量
- 调整SalesLedgerProductMapper.xml,修正分组字段为sales_ledger_product_id并关联对应字段
- 扩展ShippingInfoDto,新增quantity属性用于数量展示
- 修改ShippingInfoMapper.xml,增加对quantity字段的查询支持和对应查询条件完善
| | |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | |
| | | ShippingInfo shippingInfo = shippingInfoMapper.selectOne(new LambdaQueryWrapper<ShippingInfo>() |
| | | .eq(ShippingInfo::getShippingNo, shippingNo) |
| | | .last("limit 1")); |
| | | record.setApproveReason(record.getApproveReason() + "-发货数量:" + Optional.ofNullable(shippingInfo.getPartSendAmount()).orElse(BigDecimal.ZERO).stripTrailingZeros() |
| | | .toPlainString()); |
| | | if (shippingInfo != null) { |
| | | // 使用发货台账的 销售台账ID 去查附件 |
| | | allFiles = commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>() |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | private String productName; |
| | | |
| | | private BigDecimal quantity; |
| | | |
| | | } |
| | |
| | | LEFT JOIN stock_inventory t2 ON T1.product_model_id = t2.product_model_id |
| | | |
| | | LEFT JOIN ( |
| | | SELECT sales_ledger_id, |
| | | SELECT sales_ledger_product_id, |
| | | sum(part_send_amount) as part_send_amount |
| | | FROM shipping_info |
| | | GROUP BY sales_ledger_id |
| | | ) as t3 on t3.sales_ledger_id = T1.sales_ledger_id |
| | | GROUP BY sales_ledger_product_id) as t3 on t3.sales_ledger_product_id = T1.id |
| | | <where> |
| | | <if test="salesLedgerProduct.salesLedgerId != null"> |
| | | AND T1.sales_ledger_id = #{salesLedgerProduct.salesLedgerId} |
| | |
| | | s.shipping_no, |
| | | s.type, |
| | | s.status, |
| | | slp.quantity, |
| | | s.create_time, |
| | | s.update_time, |
| | | s.create_user, |
| | |
| | | <if test="req.salesLedgerId != null"> |
| | | AND s.sales_ledger_id = #{req.salesLedgerId} |
| | | </if> |
| | | <if test="req.salesLedgerProductId != null"> |
| | | AND slp.id = #{req.salesLedgerProductId} |
| | | </if> |
| | | <if test="req.shippingCarNumber != null and req.shippingCarNumber != ''"> |
| | | AND s.shipping_car_number LIKE CONCAT('%',#{req.shippingCarNumber},'%') |
| | | </if> |