feat(wms): 添加物流预览和快递问题相关功能
- 新增物流预览和快递问题相关的实体类、Mapper、Service和Controller - 实现物流预览列表查询、导出、详情获取、新增、修改和删除功能 - 实现快递问题列表查询、详情获取、新增、修改和删除功能 - 添加百世、顺丰、申通快递的路由查询工具类 - 更新pom.xml,添加fastjson2等依赖 - 修改application-stage.yml,禁用xxl-job
This commit is contained in:
@@ -0,0 +1,107 @@
|
||||
package com.klp.controller;
|
||||
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.domain.bo.WmsExpressBo;
|
||||
import com.klp.domain.vo.WmsExpressVo;
|
||||
import com.klp.service.IWmsExpressService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物流预览
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/oa/express")
|
||||
public class WmsExpressController extends BaseController {
|
||||
|
||||
private final IWmsExpressService iWmsExpressService;
|
||||
|
||||
/**
|
||||
* 查询物流预览列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<WmsExpressVo> list(WmsExpressBo bo, PageQuery pageQuery) {
|
||||
return iWmsExpressService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出物流预览列表
|
||||
*/
|
||||
@Log(title = "物流预览", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(WmsExpressBo bo, HttpServletResponse response) {
|
||||
List<WmsExpressVo> list = iWmsExpressService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "物流预览", WmsExpressVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物流预览详细信息
|
||||
*
|
||||
* @param expressId 主键
|
||||
*/
|
||||
@GetMapping("/{expressId}")
|
||||
public R<WmsExpressVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long expressId) {
|
||||
return R.ok(iWmsExpressService.queryById(expressId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物流预览
|
||||
*/
|
||||
@Log(title = "物流预览", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsExpressBo bo) {
|
||||
return toAjax(iWmsExpressService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物流预览
|
||||
*/
|
||||
@Log(title = "物流预览", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsExpressBo bo) {
|
||||
return toAjax(iWmsExpressService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物流预览
|
||||
*
|
||||
* @param expressIds 主键串
|
||||
*/
|
||||
@Log(title = "物流预览", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{expressIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] expressIds) {
|
||||
return toAjax(iWmsExpressService.deleteWithValidByIds(Arrays.asList(expressIds), true));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/refresh/{expressIds}")
|
||||
public R<Void> getRefreshExpress(@PathVariable Long[] expressIds) throws IOException {
|
||||
return toAjax(iWmsExpressService.getRefreshExpress(Arrays.asList(expressIds)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.klp.controller;
|
||||
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.domain.bo.WmsExpressQuestionBo;
|
||||
import com.klp.domain.vo.WmsExpressQuestionVo;
|
||||
import com.klp.service.IWmsExpressQuestionService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 快递问题
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-21
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/oa/expressQuestion")
|
||||
public class WmsExpressQuestionController extends BaseController {
|
||||
|
||||
private final IWmsExpressQuestionService IWmsExpressQuestionService;
|
||||
|
||||
/**
|
||||
* 查询快递问题列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<WmsExpressQuestionVo> list(WmsExpressQuestionBo bo, PageQuery pageQuery) {
|
||||
return IWmsExpressQuestionService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出快递问题列表
|
||||
*/
|
||||
@Log(title = "快递问题", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(WmsExpressQuestionBo bo, HttpServletResponse response) {
|
||||
List<WmsExpressQuestionVo> list = IWmsExpressQuestionService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "快递问题", WmsExpressQuestionVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取快递问题详细信息
|
||||
*
|
||||
* @param questionId 主键
|
||||
*/
|
||||
@GetMapping("/{questionId}")
|
||||
public R<WmsExpressQuestionVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long questionId) {
|
||||
return R.ok(IWmsExpressQuestionService.queryById(questionId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增快递问题
|
||||
*/
|
||||
@Log(title = "快递问题", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsExpressQuestionBo bo) {
|
||||
return toAjax(IWmsExpressQuestionService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改快递问题
|
||||
*/
|
||||
@Log(title = "快递问题", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsExpressQuestionBo bo) {
|
||||
return toAjax(IWmsExpressQuestionService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除快递问题
|
||||
*
|
||||
* @param questionIds 主键串
|
||||
*/
|
||||
@Log(title = "快递问题", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{questionIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] questionIds) {
|
||||
return toAjax(IWmsExpressQuestionService.deleteWithValidByIds(Arrays.asList(questionIds), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.klp.controller;
|
||||
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.domain.bo.WmsReportDetailBo;
|
||||
import com.klp.domain.vo.WmsReportDetailVo;
|
||||
import com.klp.service.IWmsReportDetailService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设计项目汇报详情
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/reportDetail")
|
||||
public class WmsReportDetailController extends BaseController {
|
||||
|
||||
private final IWmsReportDetailService IWmsReportDetailService;
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报详情列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<WmsReportDetailVo> list(WmsReportDetailBo bo, PageQuery pageQuery) {
|
||||
return IWmsReportDetailService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设计项目汇报详情列表
|
||||
*/
|
||||
@Log(title = "设计项目汇报详情", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(WmsReportDetailBo bo, HttpServletResponse response) {
|
||||
List<WmsReportDetailVo> list = IWmsReportDetailService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "设计项目汇报详情", WmsReportDetailVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设计项目汇报详情详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R<WmsReportDetailVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(IWmsReportDetailService.queryById(id));
|
||||
}
|
||||
// /**
|
||||
// * 获取设计项目汇报详情详细信息
|
||||
// *
|
||||
// * @param projectId 主键
|
||||
// */
|
||||
// @GetMapping("/project/{projectId}")
|
||||
// public R<List<WmsReportDetailVo>> listReportDetailByProjectId(@NotNull(message = "主键不能为空")
|
||||
// @PathVariable Long projectId) {
|
||||
// return R.ok(IWmsReportDetailService.queryByProjectId(projectId));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 新增设计项目汇报详情
|
||||
*/
|
||||
@Log(title = "设计项目汇报详情", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsReportDetailBo bo) {
|
||||
return toAjax(IWmsReportDetailService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设计项目汇报详情
|
||||
*/
|
||||
@Log(title = "设计项目汇报详情", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsReportDetailBo bo) {
|
||||
return toAjax(IWmsReportDetailService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设计项目汇报详情
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(IWmsReportDetailService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.klp.controller;
|
||||
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.domain.bo.WmsReportSummaryBo;
|
||||
import com.klp.domain.vo.WmsReportSummaryVo;
|
||||
import com.klp.service.IWmsReportSummaryService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设计项目汇报概述
|
||||
*
|
||||
* @author cpy
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/reportSummary")
|
||||
public class WmsReportSummaryController extends BaseController {
|
||||
|
||||
private final IWmsReportSummaryService IWmsReportSummaryService;
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报概述列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<WmsReportSummaryVo> list(WmsReportSummaryBo bo, PageQuery pageQuery) {
|
||||
return IWmsReportSummaryService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设计项目汇报概述列表
|
||||
*/
|
||||
@Log(title = "设计项目汇报概述", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(WmsReportSummaryBo bo, HttpServletResponse response) {
|
||||
List<WmsReportSummaryVo> list = IWmsReportSummaryService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "设计项目汇报概述", WmsReportSummaryVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设计项目汇报概述详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R<WmsReportSummaryVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(IWmsReportSummaryService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设计项目汇报概述
|
||||
*/
|
||||
@Log(title = "设计项目汇报概述", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsReportSummaryBo bo) {
|
||||
return toAjax(IWmsReportSummaryService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设计项目汇报概述
|
||||
*/
|
||||
@Log(title = "设计项目汇报概述", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsReportSummaryBo bo) {
|
||||
return toAjax(IWmsReportSummaryService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设计项目汇报概述
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@Log(title = "设计项目汇报概述", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(IWmsReportSummaryService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
86
klp-wms/src/main/java/com/klp/domain/WmsExpress.java
Normal file
86
klp-wms/src/main/java/com/klp/domain/WmsExpress.java
Normal file
@@ -0,0 +1,86 @@
|
||||
package com.klp.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 物流预览对象 oa_express
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("oa_express")
|
||||
public class WmsExpress extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "express_id")
|
||||
private Long expressId;
|
||||
|
||||
/**
|
||||
* 物流编号
|
||||
*/
|
||||
private String expressCode;
|
||||
/**
|
||||
* 数据状态0未确认1进行中2已完成
|
||||
*/
|
||||
private Long status;
|
||||
/**
|
||||
* 供应商姓名
|
||||
*/
|
||||
private String supplyName;
|
||||
/**
|
||||
* 供应商联系方式
|
||||
*/
|
||||
private String supplyPhone;
|
||||
/**
|
||||
* 负责人id
|
||||
*/
|
||||
private Long ownerId;
|
||||
/**
|
||||
* 负责人手机号(快递手机号)
|
||||
*/
|
||||
private String ownerPhone;
|
||||
/**
|
||||
* 计划到货时间
|
||||
*/
|
||||
private Date planDate;
|
||||
/**
|
||||
* 物流公司标识
|
||||
*/
|
||||
private String expressType;
|
||||
/**
|
||||
* 删除标志
|
||||
*/
|
||||
@TableLogic
|
||||
private Long delFlag;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 节点变化时间
|
||||
*/
|
||||
private Date lastUpdateTime;
|
||||
|
||||
/**
|
||||
* 当前节点
|
||||
*/
|
||||
private String lastStatus;
|
||||
|
||||
|
||||
|
||||
}
|
||||
60
klp-wms/src/main/java/com/klp/domain/WmsExpressQuestion.java
Normal file
60
klp-wms/src/main/java/com/klp/domain/WmsExpressQuestion.java
Normal file
@@ -0,0 +1,60 @@
|
||||
package com.klp.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 快递问题对象 oa_express_question
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-21
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("oa_express_question")
|
||||
public class WmsExpressQuestion extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "question_id")
|
||||
private Long questionId;
|
||||
/**
|
||||
* 关联快递
|
||||
*/
|
||||
private Long expressId;
|
||||
/**
|
||||
* 问题描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 汇报时间
|
||||
*/
|
||||
private Date reportTime;
|
||||
/**
|
||||
* 汇报人
|
||||
*/
|
||||
private String reportBy;
|
||||
/**
|
||||
* 0未解决1已解决
|
||||
*/
|
||||
private Long status;
|
||||
/**
|
||||
* 删除标志
|
||||
*/
|
||||
@TableLogic
|
||||
private Long delFlag;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
62
klp-wms/src/main/java/com/klp/domain/WmsReportDetail.java
Normal file
62
klp-wms/src/main/java/com/klp/domain/WmsReportDetail.java
Normal file
@@ -0,0 +1,62 @@
|
||||
package com.klp.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 设计项目汇报详情对象 oa_report_detail
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("oa_report_detail")
|
||||
public class WmsReportDetail extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "detail_id")
|
||||
private Long detailId;
|
||||
/**
|
||||
* 关联汇报概述ID(oa_report_summary.id)
|
||||
*/
|
||||
private Long summaryId;
|
||||
/**
|
||||
* 设备唯一编号
|
||||
*/
|
||||
private String deviceCode;
|
||||
/**
|
||||
* 设备类别
|
||||
*/
|
||||
private String category;
|
||||
/**
|
||||
* 设备生产说明
|
||||
*/
|
||||
private String deviceDescription;
|
||||
/**
|
||||
* 汇报详情内容(含文字、图像说明等)
|
||||
*/
|
||||
private String reportDetail;
|
||||
/**
|
||||
* 关联图像 OSS ID 列表(逗号分隔)
|
||||
*/
|
||||
private String ossIds;
|
||||
/**
|
||||
* 删除标志(0 正常,1 删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Long delFlag;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
54
klp-wms/src/main/java/com/klp/domain/WmsReportSummary.java
Normal file
54
klp-wms/src/main/java/com/klp/domain/WmsReportSummary.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package com.klp.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 设计项目汇报概述对象 oa_report_summary
|
||||
*
|
||||
* @author cpy
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("oa_report_summary")
|
||||
public class WmsReportSummary extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "summary_id")
|
||||
private Long summaryId;
|
||||
/**
|
||||
* 汇报标题
|
||||
*/
|
||||
private String reportTitle;
|
||||
/**
|
||||
* 汇报日期
|
||||
*/
|
||||
private Date reportDate;
|
||||
/**
|
||||
* 汇报人
|
||||
*/
|
||||
private String reporter;
|
||||
/**
|
||||
* 删除标志(0 正常,1 删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Long delFlag;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
private Long type;
|
||||
|
||||
}
|
||||
81
klp-wms/src/main/java/com/klp/domain/bo/WmsExpressBo.java
Normal file
81
klp-wms/src/main/java/com/klp/domain/bo/WmsExpressBo.java
Normal file
@@ -0,0 +1,81 @@
|
||||
package com.klp.domain.bo;
|
||||
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 物流预览业务对象 oa_express
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class WmsExpressBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long expressId;
|
||||
|
||||
/**
|
||||
* 物流编号
|
||||
*/
|
||||
private String expressCode;
|
||||
|
||||
/**
|
||||
* 数据状态0未确认1进行中2已完成
|
||||
*/
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 供应商姓名
|
||||
*/
|
||||
private String supplyName;
|
||||
|
||||
/**
|
||||
* 供应商联系方式
|
||||
*/
|
||||
private String supplyPhone;
|
||||
|
||||
/**
|
||||
* 负责人id
|
||||
*/
|
||||
private Long ownerId;
|
||||
|
||||
/**
|
||||
* 负责人手机号(快递手机号)
|
||||
*/
|
||||
private String ownerPhone;
|
||||
|
||||
/**
|
||||
* 计划到货时间
|
||||
*/
|
||||
private Date planDate;
|
||||
|
||||
/**
|
||||
* 物流公司标识
|
||||
*/
|
||||
private String expressType;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 节点变化时间
|
||||
*/
|
||||
private Date lastUpdateTime;
|
||||
|
||||
/**
|
||||
* 当前节点
|
||||
*/
|
||||
private String lastStatus;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.klp.domain.bo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 快递问题业务对象 oa_express_question
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-21
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class WmsExpressQuestionBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long questionId;
|
||||
|
||||
/**
|
||||
* 关联快递
|
||||
*/
|
||||
private Long expressId;
|
||||
|
||||
/**
|
||||
* 问题描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 汇报时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date reportTime;
|
||||
|
||||
/**
|
||||
* 汇报人
|
||||
*/
|
||||
private String reportBy;
|
||||
|
||||
/**
|
||||
* 0未解决1已解决
|
||||
*/
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.klp.domain.bo;
|
||||
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 设计项目汇报详情业务对象 oa_report_detail
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class WmsReportDetailBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long detailId;
|
||||
|
||||
/**
|
||||
* 关联汇报概述ID(oa_report_summary.id)
|
||||
*/
|
||||
private Long summaryId;
|
||||
|
||||
/**
|
||||
* 设备唯一编号
|
||||
*/
|
||||
private String deviceCode;
|
||||
|
||||
/**
|
||||
* 设备类别
|
||||
*/
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 设备生产说明
|
||||
*/
|
||||
private String deviceDescription;
|
||||
|
||||
/**
|
||||
* 汇报详情内容(含文字、图像说明等)
|
||||
*/
|
||||
private String reportDetail;
|
||||
|
||||
/**
|
||||
* 关联图像 OSS ID 列表(逗号分隔)
|
||||
*/
|
||||
private String ossIds;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.klp.domain.bo;
|
||||
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 设计项目汇报概述业务对象 oa_report_summary
|
||||
*
|
||||
* @author cpy
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class WmsReportSummaryBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long summaryId;
|
||||
|
||||
/**
|
||||
* 汇报标题
|
||||
*/
|
||||
@NotBlank(message = "汇报标题不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String reportTitle;
|
||||
|
||||
/**
|
||||
* 汇报日期
|
||||
*/
|
||||
@NotNull(message = "汇报日期不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date reportDate;
|
||||
|
||||
/**
|
||||
* 汇报人
|
||||
*/
|
||||
@NotBlank(message = "汇报人不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String reporter;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
private Long type;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 快递问题视图对象 oa_express_question
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-21
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class WmsExpressQuestionVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ExcelProperty(value = "主键id")
|
||||
private Long questionId;
|
||||
|
||||
/**
|
||||
* 关联快递
|
||||
*/
|
||||
@ExcelProperty(value = "关联快递")
|
||||
private Long expressId;
|
||||
|
||||
/**
|
||||
* 问题描述
|
||||
*/
|
||||
@ExcelProperty(value = "问题描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 汇报时间
|
||||
*/
|
||||
@ExcelProperty(value = "汇报时间")
|
||||
private Date reportTime;
|
||||
|
||||
/**
|
||||
* 汇报人
|
||||
*/
|
||||
@ExcelProperty(value = "汇报人")
|
||||
private String reportBy;
|
||||
|
||||
/**
|
||||
* 0未解决1已解决
|
||||
*/
|
||||
@ExcelProperty(value = "状态")
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 快递单号
|
||||
*/
|
||||
private String expressCode;
|
||||
|
||||
|
||||
}
|
||||
116
klp-wms/src/main/java/com/klp/domain/vo/WmsExpressVo.java
Normal file
116
klp-wms/src/main/java/com/klp/domain/vo/WmsExpressVo.java
Normal file
@@ -0,0 +1,116 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.klp.common.annotation.ExcelDictFormat;
|
||||
import com.klp.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 物流预览视图对象 oa_express
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class WmsExpressVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ExcelProperty(value = "主键id")
|
||||
private Long expressId;
|
||||
|
||||
/**
|
||||
* 物流编号
|
||||
*/
|
||||
@ExcelProperty(value = "物流编号")
|
||||
private String expressCode;
|
||||
|
||||
/**
|
||||
* 数据状态0未确认1进行中2已完成
|
||||
*/
|
||||
@ExcelProperty(value = "数据状态0未确认1进行中2已完成")
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 供应商姓名
|
||||
*/
|
||||
@ExcelProperty(value = "供应商姓名")
|
||||
private String supplyName;
|
||||
|
||||
/**
|
||||
* 供应商联系方式
|
||||
*/
|
||||
@ExcelProperty(value = "供应商联系方式")
|
||||
private String supplyPhone;
|
||||
|
||||
/**
|
||||
* 负责人id
|
||||
*/
|
||||
private Long ownerId;
|
||||
|
||||
|
||||
/**
|
||||
* 负责人id
|
||||
*/
|
||||
@ExcelProperty(value = "负责人")
|
||||
private String ownerName;
|
||||
|
||||
/**
|
||||
* 负责人手机号(快递手机号)
|
||||
*/
|
||||
@ExcelProperty(value = "负责人手机号", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "快=递手机号")
|
||||
private String ownerPhone;
|
||||
|
||||
/**
|
||||
* 计划到货时间
|
||||
*/
|
||||
@ExcelProperty(value = "计划到货时间")
|
||||
private Date planDate;
|
||||
|
||||
/**
|
||||
* 物流公司标识
|
||||
*/
|
||||
@ExcelProperty(value = "物流公司标识", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "oa_express_type")
|
||||
private String expressType;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 接收时间
|
||||
*/
|
||||
private Date acceptTime;
|
||||
|
||||
/**
|
||||
* 物流状态
|
||||
*/
|
||||
private String firstStatusName;
|
||||
|
||||
/**
|
||||
* 节点变化时间
|
||||
*/
|
||||
private Date lastUpdateTime;
|
||||
|
||||
/**
|
||||
* 当前节点
|
||||
*/
|
||||
private String lastStatus;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.klp.common.annotation.ExcelDictFormat;
|
||||
import com.klp.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 设计项目汇报详情视图对象 oa_report_detail
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class WmsReportDetailVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long detailId;
|
||||
|
||||
/**
|
||||
* 关联汇报概述ID(oa_report_summary.id)
|
||||
*/
|
||||
@ExcelProperty(value = "关联汇报概述ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "o=a_report_summary.id")
|
||||
private Long summaryId;
|
||||
|
||||
/**
|
||||
* 设备唯一编号
|
||||
*/
|
||||
@ExcelProperty(value = "设备唯一编号")
|
||||
private String deviceCode;
|
||||
|
||||
/**
|
||||
* 设备类别
|
||||
*/
|
||||
@ExcelProperty(value = "设备类别")
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 设备生产说明
|
||||
*/
|
||||
@ExcelProperty(value = "设备生产说明")
|
||||
private String deviceDescription;
|
||||
|
||||
/**
|
||||
* 汇报详情内容(含文字、图像说明等)
|
||||
*/
|
||||
@ExcelProperty(value = "汇报详情内容", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "含=文字、图像说明等")
|
||||
private String reportDetail;
|
||||
|
||||
/**
|
||||
* 关联图像 OSS ID 列表(逗号分隔)
|
||||
*/
|
||||
@ExcelProperty(value = "关联图像 OSS ID 列表", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "逗=号分隔")
|
||||
private String ossIds;
|
||||
|
||||
/**
|
||||
* 关联图像 OSS URL 列表
|
||||
*/
|
||||
@ExcelProperty(value = "关联图像 OSS URL 列表", converter = ExcelDictConvert.class)
|
||||
private String images;
|
||||
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 设计项目汇报概述视图对象 oa_report_summary
|
||||
*
|
||||
* @author cpy
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class WmsReportSummaryVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long summaryId;
|
||||
|
||||
/**
|
||||
* 汇报标题
|
||||
*/
|
||||
@ExcelProperty(value = "汇报标题")
|
||||
private String reportTitle;
|
||||
|
||||
/**
|
||||
* 汇报日期
|
||||
*/
|
||||
@ExcelProperty(value = "汇报日期")
|
||||
private Date reportDate;
|
||||
|
||||
/**
|
||||
* 汇报人
|
||||
*/
|
||||
@ExcelProperty(value = "汇报人")
|
||||
private String reporter;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
@ExcelProperty(value = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
private Long type;
|
||||
|
||||
@ExcelProperty(value = "最近更新时间")
|
||||
private Date lastUpdateTime;
|
||||
|
||||
}
|
||||
23
klp-wms/src/main/java/com/klp/mapper/WmsExpressMapper.java
Normal file
23
klp-wms/src/main/java/com/klp/mapper/WmsExpressMapper.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package com.klp.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
import com.klp.domain.WmsExpress;
|
||||
import com.klp.domain.vo.WmsExpressVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 物流预览Mapper接口
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
public interface WmsExpressMapper extends BaseMapperPlus<WmsExpressMapper, WmsExpress, WmsExpressVo> {
|
||||
|
||||
Page<WmsExpressVo> selectVoPagePlus(@Param("build") Page<Object> build, @Param(Constants.WRAPPER) QueryWrapper<WmsExpress> lqw);
|
||||
|
||||
WmsExpressVo selectVoByIdPlus(@Param("expressId") Long expressId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.klp.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
import com.klp.domain.WmsExpressQuestion;
|
||||
import com.klp.domain.vo.WmsExpressQuestionVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 快递问题Mapper接口
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-21
|
||||
*/
|
||||
public interface WmsExpressQuestionMapper extends BaseMapperPlus<WmsExpressQuestionMapper, WmsExpressQuestion, WmsExpressQuestionVo> {
|
||||
|
||||
Page<WmsExpressQuestionVo> selectVoPagePlus(@Param("build") Page<Object> build, @Param(Constants.WRAPPER) QueryWrapper<WmsExpressQuestion> lqw);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.klp.mapper;
|
||||
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
import com.klp.domain.WmsReportDetail;
|
||||
import com.klp.domain.vo.WmsReportDetailVo;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设计项目汇报详情Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
public interface WmsReportDetailMapper extends BaseMapperPlus<WmsReportDetailMapper, WmsReportDetail, WmsReportDetailVo> {
|
||||
@Select("SELECT url FROM sys_oss WHERE oss_id = #{ossId}")
|
||||
String selectImageUrlByOssId(String ossId);
|
||||
|
||||
|
||||
WmsReportDetailVo selectVoByIdPlus(Long id);
|
||||
|
||||
List<WmsReportDetailVo> queryByProjectId(Long projectId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.klp.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
import com.klp.domain.WmsReportSummary;
|
||||
import com.klp.domain.bo.WmsReportSummaryBo;
|
||||
import com.klp.domain.vo.WmsReportSummaryVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 设计项目汇报概述Mapper接口
|
||||
*
|
||||
* @author cpy
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
public interface WmsReportSummaryMapper extends BaseMapperPlus<WmsReportSummaryMapper, WmsReportSummary, WmsReportSummaryVo> {
|
||||
Page<WmsReportSummaryVo> selectVoPageWithProject(@Param("page") Page<?> page,
|
||||
@Param("bo") WmsReportSummaryBo bo);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.klp.service;
|
||||
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.domain.bo.WmsExpressQuestionBo;
|
||||
import com.klp.domain.vo.WmsExpressQuestionVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 快递问题Service接口
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-21
|
||||
*/
|
||||
public interface IWmsExpressQuestionService {
|
||||
|
||||
/**
|
||||
* 查询快递问题
|
||||
*/
|
||||
WmsExpressQuestionVo queryById(Long questionId);
|
||||
|
||||
/**
|
||||
* 查询快递问题列表
|
||||
*/
|
||||
TableDataInfo<WmsExpressQuestionVo> queryPageList(WmsExpressQuestionBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询快递问题列表
|
||||
*/
|
||||
List<WmsExpressQuestionVo> queryList(WmsExpressQuestionBo bo);
|
||||
|
||||
/**
|
||||
* 新增快递问题
|
||||
*/
|
||||
Boolean insertByBo(WmsExpressQuestionBo bo);
|
||||
|
||||
/**
|
||||
* 修改快递问题
|
||||
*/
|
||||
Boolean updateByBo(WmsExpressQuestionBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除快递问题信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.klp.service;
|
||||
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.domain.bo.WmsExpressBo;
|
||||
import com.klp.domain.vo.WmsExpressVo;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物流预览Service接口
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
public interface IWmsExpressService {
|
||||
|
||||
/**
|
||||
* 查询物流预览
|
||||
*/
|
||||
WmsExpressVo queryById(Long expressId);
|
||||
|
||||
/**
|
||||
* 查询物流预览列表
|
||||
*/
|
||||
TableDataInfo<WmsExpressVo> queryPageList(WmsExpressBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询物流预览列表
|
||||
*/
|
||||
List<WmsExpressVo> queryList(WmsExpressBo bo);
|
||||
|
||||
/**
|
||||
* 新增物流预览
|
||||
*/
|
||||
Boolean insertByBo(WmsExpressBo bo);
|
||||
|
||||
/**
|
||||
* 修改物流预览
|
||||
*/
|
||||
Boolean updateByBo(WmsExpressBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除物流预览信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 及时更新选中的状态
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
Boolean getRefreshExpress(List<Long> list) throws IOException;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.klp.service;
|
||||
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.domain.bo.WmsReportDetailBo;
|
||||
import com.klp.domain.vo.WmsReportDetailVo;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设计项目汇报详情Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
public interface IWmsReportDetailService {
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报详情
|
||||
*/
|
||||
WmsReportDetailVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报详情列表
|
||||
*/
|
||||
TableDataInfo<WmsReportDetailVo> queryPageList(WmsReportDetailBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报详情列表
|
||||
*/
|
||||
List<WmsReportDetailVo> queryList(WmsReportDetailBo bo);
|
||||
|
||||
/**
|
||||
* 新增设计项目汇报详情
|
||||
*/
|
||||
Boolean insertByBo(WmsReportDetailBo bo);
|
||||
|
||||
/**
|
||||
* 修改设计项目汇报详情
|
||||
*/
|
||||
Boolean updateByBo(WmsReportDetailBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除设计项目汇报详情信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 根据项目查询细节
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
List<WmsReportDetailVo> queryByProjectId(@NotNull(message = "主键不能为空") Long projectId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.klp.service;
|
||||
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.domain.bo.WmsReportSummaryBo;
|
||||
import com.klp.domain.vo.WmsReportSummaryVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设计项目汇报概述Service接口
|
||||
*
|
||||
* @author cpy
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
public interface IWmsReportSummaryService {
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报概述
|
||||
*/
|
||||
WmsReportSummaryVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报概述列表
|
||||
*/
|
||||
TableDataInfo<WmsReportSummaryVo> queryPageList(WmsReportSummaryBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报概述列表
|
||||
*/
|
||||
List<WmsReportSummaryVo> queryList(WmsReportSummaryBo bo);
|
||||
|
||||
/**
|
||||
* 新增设计项目汇报概述
|
||||
*/
|
||||
Boolean insertByBo(WmsReportSummaryBo bo);
|
||||
|
||||
/**
|
||||
* 修改设计项目汇报概述
|
||||
*/
|
||||
Boolean updateByBo(WmsReportSummaryBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除设计项目汇报概述信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
package com.klp.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.helper.LoginHelper;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import com.klp.domain.WmsExpressQuestion;
|
||||
import com.klp.domain.bo.WmsExpressQuestionBo;
|
||||
import com.klp.domain.vo.WmsExpressQuestionVo;
|
||||
import com.klp.mapper.WmsExpressQuestionMapper;
|
||||
import com.klp.service.IWmsExpressQuestionService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 快递问题Service业务层处理
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-21
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class WmsExpressQuestionServiceImpl implements IWmsExpressQuestionService {
|
||||
|
||||
private final WmsExpressQuestionMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询快递问题
|
||||
*/
|
||||
@Override
|
||||
public WmsExpressQuestionVo queryById(Long questionId){
|
||||
return baseMapper.selectVoById(questionId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询快递问题列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<WmsExpressQuestionVo> queryPageList(WmsExpressQuestionBo bo, PageQuery pageQuery) {
|
||||
QueryWrapper<WmsExpressQuestion> lqw = buildQueryWrapperPlus(bo);
|
||||
Page<WmsExpressQuestionVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询快递问题列表
|
||||
*/
|
||||
@Override
|
||||
public List<WmsExpressQuestionVo> queryList(WmsExpressQuestionBo bo) {
|
||||
LambdaQueryWrapper<WmsExpressQuestion> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
private LambdaQueryWrapper<WmsExpressQuestion> buildQueryWrapper(WmsExpressQuestionBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<WmsExpressQuestion> lqw = new LambdaQueryWrapper<>();
|
||||
|
||||
if (bo.getExpressId() != null) {
|
||||
lqw.eq(WmsExpressQuestion::getExpressId, bo.getExpressId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getDescription())) {
|
||||
lqw.eq(WmsExpressQuestion::getDescription, bo.getDescription());
|
||||
}
|
||||
if (bo.getReportTime() != null) {
|
||||
lqw.eq(WmsExpressQuestion::getReportTime, bo.getReportTime());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getReportBy())) {
|
||||
lqw.eq(WmsExpressQuestion::getReportBy, bo.getReportBy());
|
||||
}
|
||||
if (bo.getStatus() != null) {
|
||||
lqw.eq(WmsExpressQuestion::getStatus, bo.getStatus());
|
||||
}
|
||||
return lqw;
|
||||
}
|
||||
|
||||
private QueryWrapper<WmsExpressQuestion> buildQueryWrapperPlus(WmsExpressQuestionBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
QueryWrapper<WmsExpressQuestion> qw = new QueryWrapper<>();
|
||||
// 设置表别名
|
||||
if (bo.getExpressId() != null) {
|
||||
qw.eq("oeq.express_id", bo.getExpressId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getDescription())) {
|
||||
qw.eq("oeq.description", bo.getDescription());
|
||||
}
|
||||
if (bo.getReportTime() != null) {
|
||||
qw.eq("oeq.report_time", bo.getReportTime());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getReportBy())) {
|
||||
qw.eq("oeq.report_by", bo.getReportBy());
|
||||
}
|
||||
if (bo.getStatus() != null) {
|
||||
qw.eq("oeq.status", bo.getStatus());
|
||||
}
|
||||
// 逻辑删除
|
||||
qw.eq("oeq.del_flag", 0);
|
||||
|
||||
return qw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增快递问题
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(WmsExpressQuestionBo bo) {
|
||||
WmsExpressQuestion add = BeanUtil.toBean(bo, WmsExpressQuestion.class);
|
||||
validEntityBeforeSave(add);
|
||||
add.setReportBy(LoginHelper.getNickName());
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setQuestionId(add.getQuestionId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改快递问题
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(WmsExpressQuestionBo bo) {
|
||||
WmsExpressQuestion update = BeanUtil.toBean(bo, WmsExpressQuestion.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(WmsExpressQuestion entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除快递问题
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,246 @@
|
||||
package com.klp.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import com.klp.domain.WmsExpress;
|
||||
import com.klp.domain.bo.WmsExpressBo;
|
||||
import com.klp.domain.vo.WmsExpressVo;
|
||||
import com.klp.mapper.WmsExpressMapper;
|
||||
import com.klp.service.IWmsExpressService;
|
||||
import com.klp.utils.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 物流预览Service业务层处理
|
||||
*
|
||||
* @author hdka
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class WmsExpressServiceImpl implements IWmsExpressService {
|
||||
|
||||
private final WmsExpressMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询物流预览
|
||||
*/
|
||||
@Override
|
||||
public WmsExpressVo queryById(Long expressId){
|
||||
return baseMapper.selectVoByIdPlus(expressId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物流预览列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<WmsExpressVo> queryPageList(WmsExpressBo bo, PageQuery pageQuery) {
|
||||
QueryWrapper<WmsExpress> lqw = buildQueryWrapperPlus(bo);
|
||||
Page<WmsExpressVo> result = baseMapper.selectVoPagePlus(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物流预览列表
|
||||
*/
|
||||
@Override
|
||||
public List<WmsExpressVo> queryList(WmsExpressBo bo) {
|
||||
LambdaQueryWrapper<WmsExpress> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
private LambdaQueryWrapper<WmsExpress> buildQueryWrapper(WmsExpressBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<WmsExpress> lqw = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotBlank(bo.getExpressCode())) {
|
||||
lqw.like(WmsExpress::getExpressCode, bo.getExpressCode());
|
||||
}
|
||||
if (bo.getStatus() != null) {
|
||||
lqw.eq(WmsExpress::getStatus, bo.getStatus());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getSupplyName())) {
|
||||
lqw.like(WmsExpress::getSupplyName, bo.getSupplyName());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getSupplyPhone())) {
|
||||
lqw.eq(WmsExpress::getSupplyPhone, bo.getSupplyPhone());
|
||||
}
|
||||
if (bo.getOwnerId() != null) {
|
||||
lqw.eq(WmsExpress::getOwnerId, bo.getOwnerId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getOwnerPhone())) {
|
||||
lqw.eq(WmsExpress::getOwnerPhone, bo.getOwnerPhone());
|
||||
}
|
||||
if (bo.getPlanDate() != null) {
|
||||
lqw.eq(WmsExpress::getPlanDate, bo.getPlanDate());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getExpressType())) {
|
||||
lqw.eq(WmsExpress::getExpressType, bo.getExpressType());
|
||||
}
|
||||
return lqw;
|
||||
}
|
||||
|
||||
private QueryWrapper<WmsExpress> buildQueryWrapperPlus(WmsExpressBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
QueryWrapper<WmsExpress> qw = new QueryWrapper<>();
|
||||
// 设置表别名
|
||||
if (StringUtils.isNotBlank(bo.getExpressCode())) {
|
||||
qw.like("oe.express_code", bo.getExpressCode());
|
||||
}
|
||||
if (bo.getStatus() != null) {
|
||||
qw.eq("oe.status", bo.getStatus());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getSupplyName())) {
|
||||
qw.like("oe.supply_name", bo.getSupplyName());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getSupplyPhone())) {
|
||||
qw.eq("oe.supply_phone", bo.getSupplyPhone());
|
||||
}
|
||||
if (bo.getOwnerId() != null) {
|
||||
qw.eq("oe.owner_id", bo.getOwnerId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getOwnerPhone())) {
|
||||
qw.eq("oe.owner_phone", bo.getOwnerPhone());
|
||||
}
|
||||
if (bo.getPlanDate() != null) {
|
||||
qw.eq("oe.plan_date", bo.getPlanDate());
|
||||
}
|
||||
if (StringUtils.isNotBlank(bo.getExpressType())) {
|
||||
qw.eq("oe.express_type", bo.getExpressType());
|
||||
}
|
||||
// 添加逻辑删除条件
|
||||
qw.eq("oe.del_flag", 0);
|
||||
|
||||
return qw;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增物流预览
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(WmsExpressBo bo) {
|
||||
WmsExpress add = BeanUtil.toBean(bo, WmsExpress.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setExpressId(add.getExpressId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物流预览
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(WmsExpressBo bo) {
|
||||
WmsExpress update = BeanUtil.toBean(bo, WmsExpress.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(WmsExpress entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除物流预览
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有需要刷新的快递ID(示例:所有类型为SF且状态为1的快递单)
|
||||
*/
|
||||
public List<Long> getAllSfExpressIdsToRefresh() {
|
||||
LambdaQueryWrapper<WmsExpress> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(WmsExpress::getExpressType, "SF");
|
||||
lqw.eq(WmsExpress::getStatus, 1L);
|
||||
List<WmsExpress> list = baseMapper.selectList(lqw);
|
||||
return list.stream().map(WmsExpress::getExpressId).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean getRefreshExpress(List<Long> expressIds) throws IOException {
|
||||
for (Long expressId : expressIds) {
|
||||
WmsExpressVo WmsExpressVo = baseMapper.selectVoById(expressId);
|
||||
String expressType = WmsExpressVo.getExpressType();
|
||||
if (expressType.equals("SF") && WmsExpressVo.getStatus() ==1L) {
|
||||
// 校验为顺丰则进入此位置更新状态
|
||||
String result = SfRouteQueryUtil.queryRoute(WmsExpressVo.getExpressCode(), WmsExpressVo.getOwnerPhone() != null ? WmsExpressVo.getOwnerPhone() : WmsExpressVo.getSupplyPhone());
|
||||
WmsExpressVo WmsExpressVo1 = SfRouteQueryUtil.parseData(result);
|
||||
if (WmsExpressVo1 != null) {
|
||||
WmsExpressVo.setLastUpdateTime(WmsExpressVo1.getAcceptTime());
|
||||
WmsExpressVo.setLastStatus(WmsExpressVo1.getFirstStatusName());
|
||||
}
|
||||
}
|
||||
if (expressType.equals("ZTO") && WmsExpressVo.getStatus() ==1L) {
|
||||
// 校验为顺丰则进入此位置更新状态
|
||||
WmsExpressVo WmsExpressVo1 = ZtoTrackQueryUtil.queryTrack(WmsExpressVo.getExpressCode(), WmsExpressVo.getOwnerPhone() != null ? WmsExpressVo.getOwnerPhone() : WmsExpressVo.getSupplyPhone());
|
||||
if (WmsExpressVo1 != null) {
|
||||
WmsExpressVo.setLastUpdateTime(WmsExpressVo1.getAcceptTime());
|
||||
WmsExpressVo.setLastStatus(WmsExpressVo1.getFirstStatusName());
|
||||
}
|
||||
}
|
||||
if (expressType.equals("Best") && WmsExpressVo.getStatus() ==1L) {
|
||||
// 校验为顺丰则进入此位置更新状态
|
||||
WmsExpressVo WmsExpressVo1 = BestRouteQueryUtil.queryRoute(WmsExpressVo.getExpressCode());
|
||||
|
||||
if (WmsExpressVo1 != null) {
|
||||
WmsExpressVo.setLastUpdateTime(WmsExpressVo1.getAcceptTime());
|
||||
WmsExpressVo.setLastStatus(WmsExpressVo1.getFirstStatusName());
|
||||
}
|
||||
}
|
||||
if (expressType.equals("YD") && WmsExpressVo.getStatus() == 1L) {
|
||||
// 韵达快递轨迹查询
|
||||
String result = com.klp.utils.YdRouteQueryUtil.queryRoute(WmsExpressVo.getExpressCode());
|
||||
WmsExpressVo ydVo = YdRouteQueryUtil.parseData(result);
|
||||
if (ydVo != null) {
|
||||
WmsExpressVo.setLastUpdateTime(ydVo.getLastUpdateTime());
|
||||
WmsExpressVo.setLastStatus(ydVo.getLastStatus());
|
||||
}
|
||||
}
|
||||
if (expressType.equals("YT") && WmsExpressVo.getStatus() == 1L) {
|
||||
// 圆通快递轨迹查询
|
||||
String result = com.klp.utils.YtRouteQueryUtil.queryRoute(WmsExpressVo.getExpressCode());
|
||||
WmsExpressVo ytVo = YtRouteQueryUtil.parseData(result);
|
||||
if (ytVo != null) {
|
||||
WmsExpressVo.setLastUpdateTime(ytVo.getLastUpdateTime());
|
||||
WmsExpressVo.setLastStatus(ytVo.getLastStatus());
|
||||
}
|
||||
}
|
||||
if (expressType.equals("STO") && WmsExpressVo.getStatus() == 1L) {
|
||||
// 申通快递轨迹查询
|
||||
String result = StoRouteQueryUtil.queryRoute(Collections.singletonList(WmsExpressVo.getExpressCode()));
|
||||
WmsExpressVo stoVo = StoRouteQueryUtil.parseData(result);
|
||||
if (stoVo != null) {
|
||||
WmsExpressVo.setLastUpdateTime(stoVo.getAcceptTime());
|
||||
WmsExpressVo.setLastStatus(stoVo.getFirstStatusName());
|
||||
}
|
||||
}
|
||||
WmsExpress add = BeanUtil.toBean(WmsExpressVo, WmsExpress.class);
|
||||
baseMapper.updateById(add);;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
package com.klp.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import com.klp.domain.WmsReportDetail;
|
||||
import com.klp.domain.bo.WmsReportDetailBo;
|
||||
import com.klp.domain.vo.WmsReportDetailVo;
|
||||
import com.klp.mapper.WmsReportDetailMapper;
|
||||
import com.klp.service.IWmsReportDetailService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 设计项目汇报详情Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class WmsReportDetailServiceImpl implements IWmsReportDetailService {
|
||||
|
||||
private final WmsReportDetailMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报详情
|
||||
*/
|
||||
@Override
|
||||
public WmsReportDetailVo queryById(Long id){
|
||||
|
||||
return baseMapper.selectVoByIdPlus(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报详情列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<WmsReportDetailVo> queryPageList(WmsReportDetailBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<WmsReportDetail> lqw = buildQueryWrapper(bo);
|
||||
Page<WmsReportDetailVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
|
||||
for(WmsReportDetailVo item : result.getRecords()) {
|
||||
String ossIds = item.getOssIds();
|
||||
// 分离拿出ossIds
|
||||
String[] ossIdArray = new String[0];
|
||||
if (StringUtils.isNotBlank(ossIds)) {
|
||||
ossIdArray = ossIds.split(",");
|
||||
}
|
||||
// 准备images数组
|
||||
List<String> images = new ArrayList<>();
|
||||
// 遍历ossIdArray,添加到images中
|
||||
for (String ossId : ossIdArray) {
|
||||
// 查出图片地址
|
||||
String url = baseMapper.selectImageUrlByOssId(ossId);
|
||||
images.add(url);
|
||||
}
|
||||
// 设置images属性,将images打成,分割的字符串
|
||||
item.setImages(String.join(",", images));
|
||||
}
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报详情列表
|
||||
*/
|
||||
@Override
|
||||
public List<WmsReportDetailVo> queryList(WmsReportDetailBo bo) {
|
||||
LambdaQueryWrapper<WmsReportDetail> lqw = buildQueryWrapper(bo);
|
||||
List<WmsReportDetailVo> result = baseMapper.selectVoList(lqw);
|
||||
for(WmsReportDetailVo item : result) {
|
||||
String ossIds = item.getOssIds();
|
||||
// 分离拿出ossIds
|
||||
String[] ossIdArray = new String[0];
|
||||
if (StringUtils.isNotBlank(ossIds)) {
|
||||
ossIdArray = ossIds.split(",");
|
||||
}
|
||||
// 准备images数组
|
||||
List<String> images = new ArrayList<>();
|
||||
// 遍历ossIdArray,添加到images中
|
||||
for (String ossId : ossIdArray) {
|
||||
// 查出图片地址
|
||||
String url = baseMapper.selectImageUrlByOssId(ossId);
|
||||
images.add(url);
|
||||
}
|
||||
// 设置images属性,将images打成,分割的字符串
|
||||
item.setImages(String.join(",", images));
|
||||
}
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<WmsReportDetail> buildQueryWrapper(WmsReportDetailBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<WmsReportDetail> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getSummaryId() != null, WmsReportDetail::getSummaryId, bo.getSummaryId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDeviceCode()), WmsReportDetail::getDeviceCode, bo.getDeviceCode());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCategory()), WmsReportDetail::getCategory, bo.getCategory());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDeviceDescription()), WmsReportDetail::getDeviceDescription, bo.getDeviceDescription());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getReportDetail()), WmsReportDetail::getReportDetail, bo.getReportDetail());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getOssIds()), WmsReportDetail::getOssIds, bo.getOssIds());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设计项目汇报详情
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(WmsReportDetailBo bo) {
|
||||
WmsReportDetail add = BeanUtil.toBean(bo, WmsReportDetail.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setDetailId(add.getDetailId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设计项目汇报详情
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(WmsReportDetailBo bo) {
|
||||
WmsReportDetail update = BeanUtil.toBean(bo, WmsReportDetail.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(WmsReportDetail entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设计项目汇报详情
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WmsReportDetailVo> queryByProjectId(Long projectId) {
|
||||
return baseMapper.queryByProjectId(projectId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.klp.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import com.klp.domain.WmsReportSummary;
|
||||
import com.klp.domain.bo.WmsReportSummaryBo;
|
||||
import com.klp.domain.vo.WmsReportSummaryVo;
|
||||
import com.klp.mapper.WmsReportSummaryMapper;
|
||||
import com.klp.service.IWmsReportSummaryService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 设计项目汇报概述Service业务层处理
|
||||
*
|
||||
* @author cpy
|
||||
* @date 2025-05-13
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class WmsReportSummaryServiceImpl implements IWmsReportSummaryService {
|
||||
|
||||
private final WmsReportSummaryMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报概述
|
||||
*/
|
||||
@Override
|
||||
public WmsReportSummaryVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报概述列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<WmsReportSummaryVo> queryPageList(WmsReportSummaryBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<WmsReportSummary> lqw = buildQueryWrapper(bo);
|
||||
// Page<WmsReportSummaryVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
Page<WmsReportSummaryVo> result = baseMapper.selectVoPageWithProject(pageQuery.build(), bo);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设计项目汇报概述列表
|
||||
*/
|
||||
@Override
|
||||
public List<WmsReportSummaryVo> queryList(WmsReportSummaryBo bo) {
|
||||
LambdaQueryWrapper<WmsReportSummary> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<WmsReportSummary> buildQueryWrapper(WmsReportSummaryBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<WmsReportSummary> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getReportTitle()), WmsReportSummary::getReportTitle, bo.getReportTitle());
|
||||
lqw.eq(bo.getReportDate() != null, WmsReportSummary::getReportDate, bo.getReportDate());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getReporter()), WmsReportSummary::getReporter, bo.getReporter());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设计项目汇报概述
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(WmsReportSummaryBo bo) {
|
||||
WmsReportSummary add = BeanUtil.toBean(bo, WmsReportSummary.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setSummaryId(add.getSummaryId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设计项目汇报概述
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(WmsReportSummaryBo bo) {
|
||||
WmsReportSummary update = BeanUtil.toBean(bo, WmsReportSummary.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(WmsReportSummary entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设计项目汇报概述
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
156
klp-wms/src/main/java/com/klp/utils/BestRouteQueryUtil.java
Normal file
156
klp-wms/src/main/java/com/klp/utils/BestRouteQueryUtil.java
Normal file
@@ -0,0 +1,156 @@
|
||||
package com.klp.utils;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.klp.domain.vo.WmsExpressVo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class BestRouteQueryUtil {
|
||||
// 百世开放平台 partnerID
|
||||
private static final String PARTNER_ID = "7285";
|
||||
// 百世开放平台接口地址(请替换为实际地址)
|
||||
private static final String API_URL = "http://openapi.800best.com/api-server/ky/api/process";
|
||||
// 百世开放平台 partnerKey
|
||||
private static final String PARTNER_KEY = "NMGA0BQI";
|
||||
// 固定参数
|
||||
private static final String SERVICE_TYPE = "KY_TRACE_QUERY";
|
||||
|
||||
/**
|
||||
* 查询百世快递路由
|
||||
* @param mailNo 运单号
|
||||
* @return 查询结果WmsExpressVo
|
||||
*/
|
||||
public static WmsExpressVo queryRoute(String mailNo) {
|
||||
try {
|
||||
// 1. 构造业务数据bizData
|
||||
JSONObject bizData = new JSONObject();
|
||||
bizData.put("logisticCompanyID", "BESTQJT");
|
||||
bizData.put("codes", Arrays.asList(mailNo));
|
||||
String bizDataStr = bizData.toJSONString();
|
||||
|
||||
// 2. 生成签名(签名前不做URLEncode)
|
||||
String sign = genSign(bizDataStr, PARTNER_KEY);
|
||||
|
||||
// 3. 拼接表单参数(此处做URLEncode)
|
||||
StringBuilder formParams = new StringBuilder();
|
||||
formParams.append("partnerID=").append(URLEncoder.encode(PARTNER_ID, "UTF-8"));
|
||||
formParams.append("&serviceType=").append(URLEncoder.encode(SERVICE_TYPE, "UTF-8"));
|
||||
formParams.append("&sign=").append(URLEncoder.encode(sign, "UTF-8"));
|
||||
formParams.append("&bizData=").append(URLEncoder.encode(bizDataStr, "UTF-8"));
|
||||
String formBody = formParams.toString();
|
||||
|
||||
// 4. 发送POST请求(表单格式,UTF-8编码)
|
||||
return doPost(API_URL, formBody);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 百世签名生成方式:MD5(bizData + partnerKey),再转大写
|
||||
*/
|
||||
private static String genSign(String bizData, String partnerKey) throws Exception {
|
||||
String toSign = bizData + partnerKey;
|
||||
MessageDigest md5 = MessageDigest.getInstance("MD5");
|
||||
md5.update(toSign.getBytes("UTF-8"));
|
||||
byte[] digest = md5.digest();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (byte b : digest) {
|
||||
sb.append(String.format("%02x", b));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送POST请求(表单格式,UTF-8编码)
|
||||
*/
|
||||
private static WmsExpressVo doPost(String urlStr, String formBody) throws Exception {
|
||||
URL url = new URL(urlStr);
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setRequestMethod("POST");
|
||||
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
|
||||
conn.setDoOutput(true);
|
||||
try (OutputStream os = conn.getOutputStream()) {
|
||||
os.write(formBody.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
int code = conn.getResponseCode();
|
||||
if (code == 200) {
|
||||
try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8))) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
sb.append(line);
|
||||
}
|
||||
return parseData(sb.toString());
|
||||
}
|
||||
} else {
|
||||
throw new RuntimeException("HTTP请求失败,状态码:" + code);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析百世快递返回数据,只取第一个轨迹的acceptTime和remark
|
||||
*/
|
||||
public static WmsExpressVo parseData(String result) {
|
||||
if (StringUtils.isBlank(result)) {
|
||||
System.out.println("返回结果为空");
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
JSONObject json = JSON.parseObject(result);
|
||||
Boolean success = json.getBoolean("result");
|
||||
if (success == null || !success) {
|
||||
System.out.println("查询失败:" + json.getString("resultInfo"));
|
||||
return null;
|
||||
}
|
||||
JSONArray orderTraceList = json.getJSONArray("orderTraceList");
|
||||
if (orderTraceList == null || orderTraceList.isEmpty()) {
|
||||
System.out.println("无轨迹信息");
|
||||
return null;
|
||||
}
|
||||
// 只取第一个轨迹的最后一个步骤
|
||||
JSONObject orderTrace = orderTraceList.getJSONObject(0);
|
||||
JSONArray steps = orderTrace.getJSONArray("steps");
|
||||
if (steps == null || steps.isEmpty()) {
|
||||
System.out.println("无轨迹步骤信息");
|
||||
return null;
|
||||
}
|
||||
JSONObject step = steps.getJSONObject(steps.size() - 1);
|
||||
WmsExpressVo vo = new WmsExpressVo();
|
||||
vo.setExpressCode(orderTrace.getString("code"));
|
||||
vo.setFirstStatusName(step.getString("remark"));
|
||||
String acceptTimeStr = step.getString("acceptTime");
|
||||
if (acceptTimeStr != null) {
|
||||
// 假设格式为 yyyy-MM-dd HH:mm:ss
|
||||
try {
|
||||
vo.setAcceptTime(java.sql.Timestamp.valueOf(acceptTimeStr));
|
||||
} catch (Exception e) {
|
||||
vo.setAcceptTime(null);
|
||||
}
|
||||
}
|
||||
return vo;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// main方法测试
|
||||
public static void main(String[] args) {
|
||||
String mailNo = "80004559434";
|
||||
WmsExpressVo vo = queryRoute(mailNo);
|
||||
System.out.println(vo);
|
||||
}
|
||||
}
|
||||
216
klp-wms/src/main/java/com/klp/utils/SfRouteQueryUtil.java
Normal file
216
klp-wms/src/main/java/com/klp/utils/SfRouteQueryUtil.java
Normal file
@@ -0,0 +1,216 @@
|
||||
package com.klp.utils;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.klp.common.utils.DateUtils;
|
||||
import com.klp.domain.vo.WmsExpressVo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 顺丰路由地址查询工具
|
||||
*/
|
||||
public class SfRouteQueryUtil {
|
||||
// 顺丰开放平台 partnerID
|
||||
private static final String PARTNER_ID = "YIX65G10";
|
||||
// 顺丰开放平台接口地址
|
||||
private static final String API_URL = "https://bspgw.sf-express.com/std/service";
|
||||
|
||||
// 顺丰开放平台 checkWord
|
||||
private static final String CHECK_WORD = "PkJL4cpEQIUuV1goWvhIznqthletmddX";
|
||||
|
||||
// 顺丰OAuth认证
|
||||
private static final String OAUTH_URL = "https://sfapi.sf-express.com/oauth2/accessToken";
|
||||
|
||||
private static final String GRANT_TYPE = "password";
|
||||
/**
|
||||
* 查询顺丰路由
|
||||
* @param mailNo 顺丰运单号
|
||||
* @return 查询结果JSON
|
||||
*/
|
||||
public static String queryRoute(String mailNo,String phoneNumber) {
|
||||
List<String> mailNos = Arrays.asList(mailNo);
|
||||
try {
|
||||
// 1. 构造业务数据msgData
|
||||
JSONObject msgData = new JSONObject();
|
||||
msgData.put("language", "zh-CN");
|
||||
msgData.put("trackingType", "1"); // 1:运单号 2:订单号
|
||||
msgData.put("methodType", "1"); // 1:标准路由
|
||||
msgData.put("trackingNumber", mailNos);
|
||||
msgData.put("checkPhoneNo", StringUtils.right(phoneNumber, 4));
|
||||
String msgDataStr = msgData.toJSONString();
|
||||
System.out.println(msgDataStr);
|
||||
|
||||
// 2. 公共参数
|
||||
String requestID = UUID.randomUUID().toString().replaceAll("-", "");
|
||||
String serviceCode = "EXP_RECE_SEARCH_ROUTES";
|
||||
String timestamp = String.valueOf(System.currentTimeMillis());
|
||||
// String msgDigest = genSign(msgDataStr, timestamp, CHECK_WORD);
|
||||
// System.out.println(msgDigest);
|
||||
String accessToken = oAuth();
|
||||
System.out.println(accessToken);
|
||||
// 3. 拼接表单参数
|
||||
StringBuilder formParams = new StringBuilder();
|
||||
formParams.append("partnerID=").append(URLEncoder.encode(PARTNER_ID, "UTF-8"));
|
||||
formParams.append("&requestID=").append(URLEncoder.encode(requestID, "UTF-8"));
|
||||
formParams.append("&serviceCode=").append(URLEncoder.encode(serviceCode, "UTF-8"));
|
||||
formParams.append("×tamp=").append(URLEncoder.encode(timestamp, "UTF-8"));
|
||||
formParams.append("&accessToken=").append(URLEncoder.encode(accessToken, "UTF-8"));
|
||||
formParams.append("&msgData=").append(URLEncoder.encode(msgDataStr, "UTF-8"));
|
||||
String formBody = formParams.toString();
|
||||
System.out.println(formBody);
|
||||
|
||||
// 4. 发送POST请求
|
||||
return doPost(API_URL, formBody);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 顺丰msgDigest生成方式:Base64(MD5(URLEncode(msgData+timestamp+partnerId+checkWord)))
|
||||
*/
|
||||
private static String genSign(String msgData, String timestamp, String checkWord) throws Exception {
|
||||
String toVerifyText = msgData + timestamp + checkWord;
|
||||
MessageDigest md5 = MessageDigest.getInstance("MD5");
|
||||
md5.update(toVerifyText.getBytes("UTF-8"));
|
||||
byte[] digest = md5.digest();
|
||||
return Base64.getEncoder().encodeToString(digest);
|
||||
}
|
||||
|
||||
/**
|
||||
* 顺丰OAUTH2
|
||||
*/
|
||||
private static String oAuth() throws Exception {
|
||||
StringBuilder formParams = new StringBuilder();
|
||||
formParams.append("partnerID=").append(URLEncoder.encode(PARTNER_ID, "UTF-8"));
|
||||
formParams.append("&secret=").append(URLEncoder.encode(CHECK_WORD, "UTF-8"));
|
||||
formParams.append("&grantType=").append(URLEncoder.encode(GRANT_TYPE, "UTF-8"));
|
||||
String oauthResponse = doPost(OAUTH_URL, formParams.toString());
|
||||
JSONObject jsonObject = JSON.parseObject(oauthResponse);
|
||||
return jsonObject.getString("accessToken");
|
||||
}
|
||||
/**
|
||||
* 发送POST请求(表单格式)
|
||||
*/
|
||||
private static String doPost(String urlStr, String formBody) throws Exception {
|
||||
URL url = new URL(urlStr);
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setRequestMethod("POST");
|
||||
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
|
||||
conn.setDoOutput(true);
|
||||
try (OutputStream os = conn.getOutputStream()) {
|
||||
os.write(formBody.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
int code = conn.getResponseCode();
|
||||
if (code == 200) {
|
||||
try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8))) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
sb.append(line);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
} else {
|
||||
throw new RuntimeException("HTTP请求失败,状态码:" + code);
|
||||
}
|
||||
}
|
||||
|
||||
public static WmsExpressVo parseData(String result) {
|
||||
if (StringUtils.isBlank(result)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
// 1. 解析最外层的JSON
|
||||
JSONObject outerJson = JSON.parseObject(result);
|
||||
if (outerJson == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 2. 获取apiResultData字符串并再次解析
|
||||
String apiResultDataStr = outerJson.getString("apiResultData");
|
||||
if (StringUtils.isBlank(apiResultDataStr)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
JSONObject innerJson = JSON.parseObject(apiResultDataStr);
|
||||
if (innerJson == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 3. 提取所需数据
|
||||
JSONObject msgData = innerJson.getJSONObject("msgData");
|
||||
if (msgData == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
JSONArray routeResps = msgData.getJSONArray("routeResps");
|
||||
if (routeResps == null || routeResps.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
JSONObject firstRouteResp = routeResps.getJSONObject(0);
|
||||
if (firstRouteResp == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
JSONArray routes = firstRouteResp.getJSONArray("routes");
|
||||
if (routes == null || routes.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
JSONObject lastRoute = routes.getJSONObject(routes.size() - 1);
|
||||
if (lastRoute == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String acceptTime = lastRoute.getString("acceptTime");
|
||||
String firstStatusName = lastRoute.getString("firstStatusName");
|
||||
|
||||
WmsExpressVo WmsExpressVo = new WmsExpressVo();
|
||||
// 转换日期并设置,如果日期格式不正确则设置为null
|
||||
if (StringUtils.isNotBlank(acceptTime)) {
|
||||
try {
|
||||
Date date = DateUtils.parseDate(acceptTime);
|
||||
WmsExpressVo.setAcceptTime(date);
|
||||
} catch (Exception e) {
|
||||
WmsExpressVo.setAcceptTime(null);
|
||||
}
|
||||
}
|
||||
WmsExpressVo.setFirstStatusName(firstStatusName);
|
||||
System.out.println(acceptTime);
|
||||
System.out.println(firstStatusName);
|
||||
return WmsExpressVo;
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* main方法测试
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
|
||||
|
||||
String mailNo = "SF3191365477469";
|
||||
String result = queryRoute(mailNo,"15075462410");
|
||||
System.out.println(result);
|
||||
WmsExpressVo WmsExpress = parseData(result);
|
||||
}
|
||||
}
|
||||
147
klp-wms/src/main/java/com/klp/utils/StoRouteQueryUtil.java
Normal file
147
klp-wms/src/main/java/com/klp/utils/StoRouteQueryUtil.java
Normal file
@@ -0,0 +1,147 @@
|
||||
package com.klp.utils;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.klp.domain.vo.WmsExpressVo;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class StoRouteQueryUtil {
|
||||
// 请填写你自己的key/secret
|
||||
private static final String APP_KEY = "CAKDSqybdwbzlUC";
|
||||
private static final String APP_SECRET = "wGRMVXwIf8sp4m4W6tWJcOaDfY7EPblQ";
|
||||
private static final String FROM_CODE = "CAKDSqybdwbzlUC"; // 你的from_code
|
||||
private static final String API_URL = "https://cloudinter-linkgateway.sto.cn/gateway/link.do";
|
||||
|
||||
// 申通签名算法 body+appSecret,MD5后Base64
|
||||
public static String sign(String body, String secret) {
|
||||
String text = body + secret;
|
||||
byte[] md5 = DigestUtils.md5(text);
|
||||
return Base64.encodeBase64String(md5);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询申通轨迹,支持批量单号
|
||||
* @param waybillNos 运单号集合
|
||||
* @return 查询结果JSON
|
||||
*/
|
||||
public static String queryRoute(List<String> waybillNos) {
|
||||
try {
|
||||
// 构造content参数
|
||||
JSONObject content = new JSONObject();
|
||||
content.put("order", "asc");
|
||||
JSONArray waybillNoList = new JSONArray();
|
||||
for (String no : waybillNos) waybillNoList.add(no);
|
||||
content.put("waybillNoList", waybillNoList);
|
||||
String contentStr = content.toJSONString();
|
||||
|
||||
// 构造表单参数字符串
|
||||
StringBuilder form = new StringBuilder();
|
||||
form.append("api_name=STO_TRACE_QUERY_COMMON");
|
||||
form.append("&content=").append(URLEncoder.encode(contentStr, "UTF-8"));
|
||||
form.append("&from_appkey=").append(APP_KEY);
|
||||
form.append("&from_code=").append(APP_KEY);
|
||||
form.append("&to_appkey=sto_trace_query");
|
||||
form.append("&to_code=sto_trace_query");
|
||||
form.append("&data_digest=").append(URLEncoder.encode(sign(contentStr, APP_SECRET), "UTF-8"));
|
||||
|
||||
System.out.println("申通表单请求体:" + form);
|
||||
|
||||
URL url = new URL(API_URL);
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setDoOutput(true);
|
||||
conn.setDoInput(true);
|
||||
conn.setUseCaches(false);
|
||||
conn.setRequestMethod("POST");
|
||||
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
|
||||
OutputStream out = conn.getOutputStream();
|
||||
out.write(form.toString().getBytes(StandardCharsets.UTF_8));
|
||||
out.flush();
|
||||
out.close();
|
||||
StringBuilder sbResult = new StringBuilder();
|
||||
if (200 == conn.getResponseCode()) {
|
||||
BufferedReader responseReader = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
|
||||
String readLine;
|
||||
while ((readLine = responseReader.readLine()) != null) {
|
||||
sbResult.append(readLine).append("\n");
|
||||
}
|
||||
responseReader.close();
|
||||
}
|
||||
return sbResult.toString();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析申通返回数据,转为WmsExpressVo列表
|
||||
*/
|
||||
public static WmsExpressVo parseData(String result) {
|
||||
if (result == null || result.trim().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
// 新增:如果返回是XML,直接打印并返回null
|
||||
if (result.trim().startsWith("<")) {
|
||||
System.err.println("申通返回XML错误:" + result);
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
JSONObject json = JSON.parseObject(result);
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
if (data == null) return null;
|
||||
for (String waybillNo : data.keySet()) {
|
||||
JSONArray arr = data.getJSONArray(waybillNo);
|
||||
if (arr == null || arr.isEmpty()) continue;
|
||||
JSONObject last = arr.getJSONObject(arr.size() - 1);
|
||||
WmsExpressVo vo = new WmsExpressVo();
|
||||
vo.setExpressCode(last.getString("waybillNo"));
|
||||
// 设置时间
|
||||
String opTime = last.getString("opTime");
|
||||
if (opTime != null) {
|
||||
try {
|
||||
// 解析时间格式 "2025-07-27 13:01:00"
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
vo.setAcceptTime(sdf.parse(opTime));
|
||||
} catch (Exception e) {
|
||||
vo.setAcceptTime(null);
|
||||
}
|
||||
}
|
||||
// 设置状态 - 使用scanType作为状态
|
||||
vo.setFirstStatusName(last.getString("memo"));
|
||||
// 设置备注 - 使用memo作为备注
|
||||
vo.setRemark(last.getString("scanType"));
|
||||
return vo;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// main方法测试
|
||||
public static void main(String[] args) {
|
||||
List<String> waybillNos = new ArrayList<>();
|
||||
waybillNos.add("777329412312954"); // 测试单号
|
||||
String result = queryRoute(waybillNos);
|
||||
System.out.println("申通原始返回:" + result);
|
||||
WmsExpressVo vo = parseData(result);
|
||||
if (vo != null) {
|
||||
System.out.println("解析后:" + vo);
|
||||
} else {
|
||||
System.out.println("未解析到数据");
|
||||
}
|
||||
}
|
||||
}
|
||||
75
klp-wms/src/main/java/com/klp/utils/YdRouteQueryUtil.java
Normal file
75
klp-wms/src/main/java/com/klp/utils/YdRouteQueryUtil.java
Normal file
@@ -0,0 +1,75 @@
|
||||
package com.klp.utils;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.klp.domain.vo.WmsExpressVo;
|
||||
import com.yundasys.OpenApiHttpUtils;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
|
||||
public class YdRouteQueryUtil {
|
||||
// 请根据实际环境切换key/secret
|
||||
private static final String APP_KEY = "004160"; // 生产环境
|
||||
private static final String APP_SECRET = "ac9ee46d749e44b98e7a9e38f3c8f8f3"; // 生产环境
|
||||
private static final String API_URL = "https://openapi.yundaex.com/openapi/outer/logictis/query";
|
||||
|
||||
/**
|
||||
* 查询韵达轨迹
|
||||
* @param mailNo 运单号
|
||||
* @return 查询结果JSON
|
||||
*/
|
||||
public static String queryRoute(String mailNo) {
|
||||
String jsonParams = "{\"mailno\":\"" + mailNo + "\"}";
|
||||
return OpenApiHttpUtils.doPostJson(API_URL, jsonParams, APP_KEY, APP_SECRET);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析韵达返回数据,转为WmsExpressVo
|
||||
*/
|
||||
public static WmsExpressVo parseData(String result) {
|
||||
if (result == null || result.trim().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
JSONObject json = JSON.parseObject(result);
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
if (data == null) return null;
|
||||
JSONArray steps = data.getJSONArray("steps");
|
||||
if (steps == null || steps.isEmpty()) return null;
|
||||
JSONObject last = steps.getJSONObject(steps.size() - 1);
|
||||
WmsExpressVo vo = new WmsExpressVo();
|
||||
vo.setExpressCode(data.getString("mailno"));
|
||||
vo.setLastUpdateTime(last.getDate("time"));
|
||||
vo.setLastStatus(last.getString("action"));
|
||||
vo.setRemark(last.getString("description"));
|
||||
return vo;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// MD5签名算法(如需自定义签名,可用此方法)
|
||||
public static String md5(String str, String charset) throws Exception {
|
||||
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
md.update(str.getBytes(charset));
|
||||
byte[] result = md.digest();
|
||||
StringBuilder sb = new StringBuilder(32);
|
||||
for (byte b : result) {
|
||||
int val = b & 0xff;
|
||||
if (val <= 0xf) sb.append("0");
|
||||
sb.append(Integer.toHexString(val));
|
||||
}
|
||||
return sb.toString().toLowerCase();
|
||||
}
|
||||
|
||||
// main方法测试
|
||||
public static void main(String[] args) {
|
||||
String mailNo = "464569453467736";
|
||||
String result = queryRoute(mailNo);
|
||||
System.out.println("韵达原始返回:" + result);
|
||||
WmsExpressVo vo = parseData(result);
|
||||
System.out.println("解析后:" + vo);
|
||||
}
|
||||
}
|
||||
118
klp-wms/src/main/java/com/klp/utils/YtRouteQueryUtil.java
Normal file
118
klp-wms/src/main/java/com/klp/utils/YtRouteQueryUtil.java
Normal file
@@ -0,0 +1,118 @@
|
||||
package com.klp.utils;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.klp.domain.vo.WmsExpressVo;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class YtRouteQueryUtil {
|
||||
// 请填写你自己的密钥、method、v
|
||||
private static final String SECRET = "TEST";
|
||||
private static final String METHOD = "123456"; // 示例
|
||||
private static final String VERSION = "v1"; // 示例
|
||||
private static final String API_URL = " https://openuat.yto56test.com:6443/open/track_query_adapter/v1/hpLkUl/TEST";
|
||||
|
||||
// 圆通签名算法 param+method+v+secret,MD5后Base64
|
||||
public static String sign(String param, String method, String v, String secret) {
|
||||
String data = param + method + v;
|
||||
byte[] md5 = DigestUtils.md5(data + secret);
|
||||
return Base64.encodeBase64String(md5);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询圆通轨迹
|
||||
* @param number 运单号
|
||||
* @return 查询结果JSON
|
||||
*/
|
||||
public static String queryRoute(String number) {
|
||||
try {
|
||||
String timestamp = String.valueOf(System.currentTimeMillis());
|
||||
JSONObject paramObj = new JSONObject();
|
||||
paramObj.put("NUMBER", number);
|
||||
String param = paramObj.toJSONString();
|
||||
String sign = sign(param, METHOD, VERSION, SECRET);
|
||||
JSONObject req = new JSONObject();
|
||||
req.put("timestamp", timestamp);
|
||||
req.put("param", param);
|
||||
req.put("sign", sign);
|
||||
req.put("format", "JSON");
|
||||
req.put("method", METHOD);
|
||||
req.put("v", VERSION);
|
||||
String jsonParams = req.toJSONString();
|
||||
URL url = new URL(API_URL);
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setDoOutput(true);
|
||||
conn.setDoInput(true);
|
||||
conn.setUseCaches(false);
|
||||
conn.setRequestMethod("POST");
|
||||
conn.setRequestProperty("Content-Type", "application/json;charset=UTF-8");
|
||||
OutputStream out = conn.getOutputStream();
|
||||
out.write(jsonParams.getBytes(StandardCharsets.UTF_8));
|
||||
out.flush();
|
||||
out.close();
|
||||
StringBuilder sbResult = new StringBuilder();
|
||||
if (200 == conn.getResponseCode()) {
|
||||
BufferedReader responseReader = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
|
||||
String readLine;
|
||||
while ((readLine = responseReader.readLine()) != null) {
|
||||
sbResult.append(readLine).append("\n");
|
||||
}
|
||||
responseReader.close();
|
||||
}
|
||||
return sbResult.toString();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析圆通返回数据,转为WmsExpressVo列表
|
||||
*/
|
||||
public static WmsExpressVo parseData(String result) {
|
||||
if (result == null || result.trim().isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
if (result.trim().startsWith("{")) {
|
||||
JSONObject json = JSON.parseObject(result);
|
||||
if (json.containsKey("map")) return null; // 查询为空
|
||||
} else if (result.trim().startsWith("[")) {
|
||||
JSONArray arr = JSON.parseArray(result);
|
||||
if (arr.isEmpty()) return null;
|
||||
JSONObject last = arr.getJSONObject(arr.size() - 1);
|
||||
WmsExpressVo vo = new WmsExpressVo();
|
||||
vo.setExpressCode(last.getString("waybill_No"));
|
||||
vo.setLastUpdateTime(last.getDate("upload_Time"));
|
||||
vo.setLastStatus(last.getString("infoContent"));
|
||||
vo.setRemark(last.getString("processInfo"));
|
||||
return vo;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// main方法测试
|
||||
public static void main(String[] args) {
|
||||
String number = "YT2600227881409"; // 测试单号
|
||||
String result = queryRoute(number);
|
||||
System.out.println("圆通原始返回:" + result);
|
||||
WmsExpressVo vo = parseData(result);
|
||||
if (vo != null) {
|
||||
System.out.println("解析后:" + vo);
|
||||
} else {
|
||||
System.out.println("解析后无数据");
|
||||
}
|
||||
}
|
||||
}
|
||||
117
klp-wms/src/main/java/com/klp/utils/ZtoTrackQueryUtil.java
Normal file
117
klp-wms/src/main/java/com/klp/utils/ZtoTrackQueryUtil.java
Normal file
@@ -0,0 +1,117 @@
|
||||
package com.klp.utils;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.klp.domain.vo.WmsExpressVo;
|
||||
import com.zto.zop.ZopClient;
|
||||
import com.zto.zop.ZopPublicRequest;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URL;
|
||||
|
||||
import static com.zto.zop.EncryptionType.MD5;
|
||||
|
||||
public class ZtoTrackQueryUtil {
|
||||
// 替换为你的appKey和appSecret
|
||||
private static final String APP_KEY = "1ebf01ae01cc81d78ba9a";
|
||||
private static final String APP_SECRET = "4bded7f302da7f7913b01810e3421b80";
|
||||
// 测试环境
|
||||
// private static final String API_URL = "https://japi-test.zto.com/zto.merchant.waybill.track.query";
|
||||
// 正式环境
|
||||
private static final String API_URL = "https://japi.zto.com/zto.merchant.waybill.track.query";
|
||||
|
||||
/**
|
||||
* 查询中通物流轨迹
|
||||
*
|
||||
* @param billCode 运单号
|
||||
* @return 查询结果JSON
|
||||
*/
|
||||
public static WmsExpressVo queryTrack(String billCode,String phoneNumber) throws IOException {
|
||||
|
||||
ZopClient client = new ZopClient(APP_KEY, APP_SECRET);
|
||||
ZopPublicRequest request = new ZopPublicRequest();
|
||||
request.setBody("{\"billCode\":\""+billCode+"\",\"mobilePhone\":\""+ StringUtils.right(phoneNumber, 4)+"\"}");
|
||||
request.setUrl(API_URL);
|
||||
request.setBase64(true);
|
||||
request.setEncryptionType(MD5);
|
||||
request.setTimestamp(null);
|
||||
String execute = client.execute(request);
|
||||
System.out.println(execute);
|
||||
return parseData(execute);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析中通返回数据,封装为WmsExpressVo
|
||||
*/
|
||||
public static WmsExpressVo parseData(String result) {
|
||||
if (StringUtils.isBlank(result)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
JSONObject json = JSON.parseObject(result);
|
||||
if (json == null || !"true".equalsIgnoreCase(String.valueOf(json.get("status")))) {
|
||||
return null;
|
||||
}
|
||||
// 取result数组
|
||||
if (!json.containsKey("result")) {
|
||||
return null;
|
||||
}
|
||||
// 只取第一个轨迹(如有多条)
|
||||
Object resultArr = json.get("result");
|
||||
if (!(resultArr instanceof java.util.List)) {
|
||||
return null;
|
||||
}
|
||||
JSONArray arr = json.getJSONArray("result");
|
||||
if (arr == null || arr.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
JSONObject first = arr.getJSONObject(arr.size() - 1); // 取最后一条为最新
|
||||
if (first == null) {
|
||||
return null;
|
||||
}
|
||||
String scanDate = first.getString("scanDate");
|
||||
String desc = first.getString("desc");
|
||||
WmsExpressVo vo = new WmsExpressVo();
|
||||
// scanDate为时间戳字符串
|
||||
if (StringUtils.isNotBlank(scanDate)) {
|
||||
try {
|
||||
long time = Long.parseLong(scanDate);
|
||||
vo.setAcceptTime(new java.util.Date(time));
|
||||
} catch (Exception e) {
|
||||
vo.setAcceptTime(null);
|
||||
}
|
||||
}
|
||||
vo.setFirstStatusName(desc);
|
||||
return vo;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getPublicIp() {
|
||||
String ip = "";
|
||||
try {
|
||||
URL url = new URL("http://ifconfig.me/ip");
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
|
||||
ip = in.readLine();
|
||||
in.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return ip;
|
||||
}
|
||||
|
||||
// main方法测试
|
||||
public static void main(String[] args) throws IOException {
|
||||
System.out.println("本机公网IP为: " + getPublicIp());
|
||||
String billCode = "78925013374727";
|
||||
WmsExpressVo result = queryTrack(billCode,"2410");
|
||||
|
||||
System.out.println(result);
|
||||
}
|
||||
}
|
||||
74
klp-wms/src/main/resources/mapper/klp/WmsExpressMapper.xml
Normal file
74
klp-wms/src/main/resources/mapper/klp/WmsExpressMapper.xml
Normal file
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.klp.mapper.WmsExpressMapper">
|
||||
|
||||
<resultMap type="com.klp.domain.WmsExpress" id="WmsExpressResult">
|
||||
<result property="expressId" column="express_id"/>
|
||||
<result property="expressCode" column="express_code"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="supplyName" column="supply_name"/>
|
||||
<result property="supplyPhone" column="supply_phone"/>
|
||||
<result property="ownerId" column="owner_id"/>
|
||||
<result property="ownerPhone" column="owner_phone"/>
|
||||
<result property="planDate" column="plan_date"/>
|
||||
<result property="expressType" column="express_type"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectVoPagePlus" resultType="com.klp.domain.vo.WmsExpressVo">
|
||||
select oe.express_id,
|
||||
oe.express_code,
|
||||
oe.status,
|
||||
oe.supply_name,
|
||||
oe.supply_phone,
|
||||
oe.owner_id,
|
||||
oe.owner_phone,
|
||||
oe.plan_date,
|
||||
oe.express_type,
|
||||
oe.create_by,
|
||||
oe.create_time,
|
||||
oe.update_by,
|
||||
oe.update_time,
|
||||
oe.last_status,
|
||||
oe.last_update_time,
|
||||
oe.del_flag,
|
||||
oe.remark,
|
||||
su.nick_name as ownerName
|
||||
from wms_express oe
|
||||
left join sys_user su on su.user_id = oe.owner_id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="selectVoByIdPlus" resultType="com.klp.domain.vo.WmsExpressVo">
|
||||
select oe.express_id,
|
||||
oe.express_code,
|
||||
oe.status,
|
||||
oe.supply_name,
|
||||
oe.supply_phone,
|
||||
oe.owner_id,
|
||||
oe.owner_phone,
|
||||
oe.plan_date,
|
||||
oe.express_type,
|
||||
oe.create_by,
|
||||
oe.create_time,
|
||||
oe.update_by,
|
||||
oe.update_time,
|
||||
oe.last_status,
|
||||
oe.last_update_time,
|
||||
oe.del_flag,
|
||||
oe.remark,
|
||||
su.nick_name as ownerName
|
||||
from wms_express oe
|
||||
left join sys_user su on su.user_id = oe.owner_id
|
||||
where express_id = #{expressId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.klp.mapper.WmsExpressQuestionMapper">
|
||||
|
||||
<resultMap type="com.klp.domain.WmsExpressQuestion" id="WmsExpressQuestionResult">
|
||||
<result property="questionId" column="question_id"/>
|
||||
<result property="expressId" column="express_id"/>
|
||||
<result property="description" column="description"/>
|
||||
<result property="reportTime" column="report_time"/>
|
||||
<result property="reportBy" column="report_by"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
<select id="selectVoPagePlus" resultType="com.klp.domain.vo.WmsExpressQuestionVo">
|
||||
select oeq.question_id,
|
||||
oeq.express_id,
|
||||
oeq.description,
|
||||
oeq.report_time,
|
||||
oeq.report_by,
|
||||
oeq.status,
|
||||
oeq.create_time,
|
||||
oeq.create_by,
|
||||
oeq.update_time,
|
||||
oeq.update_by,
|
||||
oeq.del_flag,
|
||||
oeq.remark,
|
||||
oe.express_code
|
||||
from wms_express_question oeq
|
||||
left join wms_express oe on oe.express_id = oeq.express_id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.klp.mapper.WmsReportDetailMapper">
|
||||
|
||||
<resultMap type="com.klp.domain.WmsReportDetail" id="WmsReportDetailResult">
|
||||
<result property="detailId" column="detail_id"/>
|
||||
<result property="summaryId" column="summary_id"/>
|
||||
<result property="deviceCode" column="device_code"/>
|
||||
<result property="category" column="category"/>
|
||||
<result property="deviceDescription" column="device_description"/>
|
||||
<result property="reportDetail" column="report_detail"/>
|
||||
<result property="ossIds" column="oss_ids"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
<select id="selectVoByIdPlus" parameterType="Long" resultType="com.klp.domain.vo.WmsReportDetailVo">
|
||||
select ord.detail_id,
|
||||
summary_id,
|
||||
device_code,
|
||||
category,
|
||||
device_description,
|
||||
report_detail,
|
||||
oss_ids,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time,
|
||||
del_flag,
|
||||
remark,
|
||||
(
|
||||
SELECT GROUP_CONCAT(so.url SEPARATOR ',')
|
||||
FROM sys_oss so
|
||||
WHERE FIND_IN_SET(so.oss_id, ord.oss_ids) > 0
|
||||
) AS images
|
||||
from wms_report_detail ord
|
||||
where ord.detail_id = #{id}
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryByProjectId" resultType="com.klp.domain.vo.WmsReportDetailVo">
|
||||
select ord.detail_id,
|
||||
ord.summary_id,
|
||||
ord.device_code,
|
||||
ord.category,
|
||||
ord.device_description,
|
||||
ord.report_detail,
|
||||
ord.oss_ids,
|
||||
ord.create_by,
|
||||
ord.create_time,
|
||||
ord.update_by,
|
||||
ord.update_time,
|
||||
ord.del_flag,
|
||||
ord.remark
|
||||
from wms_report_detail ord
|
||||
left join wms_report_summary ors on ors.summary_id = ord.summary_id
|
||||
where project_id = #{projectId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.klp.mapper.WmsReportSummaryMapper">
|
||||
|
||||
<resultMap type="com.klp.domain.WmsReportSummary" id="OaReportSummaryResult">
|
||||
<result property="summaryId" column="summary_id"/>
|
||||
<result property="reportTitle" column="report_title"/>
|
||||
<result property="reportDate" column="report_date"/>
|
||||
<result property="reporter" column="reporter"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="type" column="type"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectVoPageWithProject" resultType="com.klp.domain.vo.WmsReportSummaryVo">
|
||||
SELECT
|
||||
s.summary_id as summaryId,
|
||||
s.report_title AS reportTitle,
|
||||
s.report_date AS reportDate,
|
||||
s.reporter,
|
||||
s.remark,
|
||||
s.type,
|
||||
d.latest_create_time AS lastUpdateTime
|
||||
FROM wms_report_summary s
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
summary_id,
|
||||
create_time AS latest_create_time,
|
||||
ROW_NUMBER() OVER (PARTITION BY summary_id ORDER BY create_time DESC) AS rn
|
||||
FROM wms_report_detail
|
||||
) d ON s.summary_id = d.summary_id AND d.rn = 1
|
||||
<where>
|
||||
<if test="bo.reportTitle != null and bo.reportTitle != ''">
|
||||
AND s.report_title LIKE CONCAT('%', #{bo.reportTitle}, '%')
|
||||
</if>
|
||||
<if test="bo.reportDate != null">
|
||||
AND s.report_date = #{bo.reportDate}
|
||||
</if>
|
||||
<if test="bo.reporter != null and bo.reporter != ''">
|
||||
AND s.reporter LIKE CONCAT('%', #{bo.reporter}, '%')
|
||||
</if>
|
||||
<if test="bo.projectId != null">
|
||||
AND s.project_id = #{bo.projectId}
|
||||
</if>
|
||||
<if test="bo.type != null">
|
||||
AND s.type = #{bo.type}
|
||||
</if>
|
||||
AND s.del_flag = 0
|
||||
</where>
|
||||
ORDER BY
|
||||
COALESCE(d.latest_create_time, s.report_date) DESC,
|
||||
s.report_date DESC
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user