feat(sales): 优化发货信息管理功能
- 在ShippingInfo实体类中新增发货日期范围查询字段
- 修改导出接口支持按条件导出发货信息数据
- 为ShippingInfoDto添加规格型号、产品名称、厚度等导出字段
- 重构markOrderCompleted方法中的参数类型转换逻辑
- 在mapper层添加发货日期范围查询的SQL条件
- 新增exportList查询方法支持按条件导出发货信息
| | |
| | | @ApiOperation("标记订单完成(不可撤销)") |
| | | public AjaxResult markOrderCompleted(@RequestBody Map<String, Object> params) { |
| | | @SuppressWarnings("unchecked") |
| | | List<Long> ids = (List<Long>) params.get("ids"); |
| | | List<Long> ids = ((List<Object>) params.get("ids")).stream() |
| | | .map(obj -> Long.valueOf(obj.toString())) |
| | | .collect(Collectors.toList()); |
| | | if (ids == null || ids.isEmpty()) { |
| | | return AjaxResult.error("请选择要标记完成的订单"); |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/export") |
| | | @ApiOperation("导出发货信息") |
| | | public void export(HttpServletResponse response) { |
| | | List<ShippingInfo> list = shippingInfoMapper.listAll(); |
| | | ExcelUtil<ShippingInfo> util = new ExcelUtil<ShippingInfo>(ShippingInfo.class); |
| | | public void export(ShippingInfo req, HttpServletResponse response) { |
| | | List<ShippingInfoDto> list = shippingInfoMapper.exportList(req); |
| | | ExcelUtil<ShippingInfoDto> util = new ExcelUtil<ShippingInfoDto>(ShippingInfoDto.class); |
| | | util.exportExcel(response, list, "发货信息"); |
| | | } |
| | | |
| | |
| | | @TableField(exist = false) |
| | | private List<CommonFile> commonFileList; |
| | | |
| | | @Excel(name = "规格型号") |
| | | private String specificationModel; |
| | | |
| | | @Excel(name = "产品名称") |
| | | private String productName; |
| | | |
| | | /** |
| | | * 厚度 |
| | | */ |
| | | @Excel(name = "厚度(mm)") |
| | | private BigDecimal thickness; |
| | | |
| | | } |
| | |
| | | |
| | | List<ShippingInfo> listAll(); |
| | | |
| | | List<ShippingInfoDto> exportList(@Param("req") ShippingInfo req); |
| | | |
| | | List<SalesLedgerProductDto> getReturnManagementDtoById(@Param("shippingId")Long shippingId); |
| | | |
| | | List<ShippingInfo> getShippingInfoByCustomerName(String customerName); |
| | |
| | | @Excel(name = "客户名称") |
| | | private String customerName; |
| | | |
| | | /** 发货日期查询开始 */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "发货日期开始") |
| | | private String shippingDateStart; |
| | | |
| | | /** 发货日期查询结束 */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "发货日期结束") |
| | | private String shippingDateEnd; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | |
| | | <if test="req.expressNumber != null and req.expressNumber != ''"> |
| | | AND s.express_number LIKE CONCAT('%',#{req.expressNumber},'%') |
| | | </if> |
| | | <if test="req.shippingDateStart != null and req.shippingDateStart != ''"> |
| | | AND s.shipping_date >= #{req.shippingDateStart} |
| | | </if> |
| | | <if test="req.shippingDateEnd != null and req.shippingDateEnd != ''"> |
| | | AND s.shipping_date <= #{req.shippingDateEnd} |
| | | </if> |
| | | order by create_time DESC |
| | | </select> |
| | | <select id="listAll" resultType="com.ruoyi.sales.pojo.ShippingInfo"> |
| | |
| | | ORDER BY s.create_time ASC |
| | | </select> |
| | | |
| | | <select id="exportList" resultType="com.ruoyi.sales.dto.ShippingInfoDto"> |
| | | SELECT |
| | | s.id, |
| | | s.sales_ledger_id, |
| | | s.shipping_date, |
| | | s.shipping_car_number, |
| | | s.express_number, |
| | | s.express_company, |
| | | s.shipping_no, |
| | | s.type, |
| | | s.status, |
| | | s.create_time, |
| | | s.update_time, |
| | | s.create_user, |
| | | s.update_user, |
| | | s.tenant_id, |
| | | sl.sales_contract_no, |
| | | slp.specification_model, |
| | | p.product_name, |
| | | pm.thickness, |
| | | sl.customer_name |
| | | FROM shipping_info s |
| | | LEFT JOIN sales_ledger sl ON s.sales_ledger_id = sl.id |
| | | LEFT JOIN sales_ledger_product slp ON s.sales_ledger_product_id = slp.id and slp.type = 1 |
| | | left join product_model pm on slp.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | WHERE 1=1 |
| | | <if test="req.salesContractNo != null and req.salesContractNo != ''"> |
| | | AND sl.sales_contract_no LIKE CONCAT('%',#{req.salesContractNo},'%') |
| | | </if> |
| | | <if test="req.shippingCarNumber != null and req.shippingCarNumber != ''"> |
| | | AND s.shipping_car_number LIKE CONCAT('%',#{req.shippingCarNumber},'%') |
| | | </if> |
| | | <if test="req.expressNumber != null and req.expressNumber != ''"> |
| | | AND s.express_number LIKE CONCAT('%',#{req.expressNumber},'%') |
| | | </if> |
| | | <if test="req.shippingDateStart != null and req.shippingDateStart != ''"> |
| | | AND s.shipping_date >= #{req.shippingDateStart} |
| | | </if> |
| | | <if test="req.shippingDateEnd != null and req.shippingDateEnd != ''"> |
| | | AND s.shipping_date <= #{req.shippingDateEnd} |
| | | </if> |
| | | order by s.create_time DESC |
| | | </select> |
| | | |
| | | <select id="getReturnManagementDtoById" resultType="com.ruoyi.sales.dto.SalesLedgerProductDto"> |
| | | SELECT |
| | | slp.*, |