6 changed files with 320 additions and 0 deletions
-
92src/main/java/com/gaotao/modules/automatedWarehouse/controller/WcsCallbackTaskController.java
-
53src/main/java/com/gaotao/modules/automatedWarehouse/entity/WcsCallbackTaskData.java
-
29src/main/java/com/gaotao/modules/automatedWarehouse/mapper/WcsCallbackTaskMapper.java
-
36src/main/java/com/gaotao/modules/automatedWarehouse/service/WcsCallbackTaskService.java
-
93src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsCallbackTaskServiceImpl.java
-
17src/main/resources/mapper/automatedWarehouse/WcsCallbackTaskMapper.xml
@ -0,0 +1,92 @@ |
|||
package com.gaotao.modules.automatedWarehouse.controller; |
|||
|
|||
import com.gaotao.common.utils.PageUtils; |
|||
import com.gaotao.common.utils.R; |
|||
import com.gaotao.modules.automatedWarehouse.entity.WcsCallbackTaskData; |
|||
import com.gaotao.modules.automatedWarehouse.service.WcsCallbackTaskService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Description WCS回调任务查询Controller - rqrq |
|||
* @Author rqrq |
|||
* @Date 2025/10/04 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/warehouse/wcsCallbackTask") |
|||
public class WcsCallbackTaskController { |
|||
|
|||
@Autowired |
|||
private WcsCallbackTaskService wcsCallbackTaskService; |
|||
|
|||
/** |
|||
* @Description 查询WCS回调任务列表 - rqrq |
|||
* @Title list |
|||
* @param data 查询条件 |
|||
* @return R |
|||
* @author rqrq |
|||
* @date 2025/10/04 |
|||
*/ |
|||
@PostMapping(value="/list") |
|||
@ResponseBody |
|||
public R list(@RequestBody WcsCallbackTaskData data) throws Exception { |
|||
PageUtils page = wcsCallbackTaskService.queryPage(data); |
|||
return R.ok().put("page", page); |
|||
} |
|||
|
|||
/** |
|||
* @Description 获取任务状态选项 - rqrq |
|||
* @Title statusOptions |
|||
* @return R |
|||
* @author rqrq |
|||
* @date 2025/10/04 |
|||
*/ |
|||
@GetMapping(value="/statusOptions") |
|||
@ResponseBody |
|||
public R statusOptions() throws Exception { |
|||
List<Map<String, String>> options = new ArrayList<>(); |
|||
|
|||
Map<String, String> option1 = new HashMap<>(); |
|||
option1.put("label", "已录入"); |
|||
option1.put("value", "已录入"); |
|||
options.add(option1); |
|||
|
|||
Map<String, String> option2 = new HashMap<>(); |
|||
option2.put("label", "处理中"); |
|||
option2.put("value", "处理中"); |
|||
options.add(option2); |
|||
|
|||
Map<String, String> option3 = new HashMap<>(); |
|||
option3.put("label", "已完成"); |
|||
option3.put("value", "已完成"); |
|||
options.add(option3); |
|||
|
|||
Map<String, String> option4 = new HashMap<>(); |
|||
option4.put("label", "处理失败"); |
|||
option4.put("value", "处理失败"); |
|||
options.add(option4); |
|||
|
|||
return R.ok().put("options", options); |
|||
} |
|||
|
|||
/** |
|||
* @Description 获取用户授权站点列表 - rqrq |
|||
* @Title getUserAuthorizedSites |
|||
* @param params 用户参数 |
|||
* @return R |
|||
* @author rqrq |
|||
* @date 2025/10/04 |
|||
*/ |
|||
@PostMapping(value="/getUserAuthorizedSites") |
|||
@ResponseBody |
|||
public R getUserAuthorizedSites(@RequestBody Map<String, Object> params) throws Exception { |
|||
List<Map<String, String>> sites = wcsCallbackTaskService.getUserAuthorizedSites(params); |
|||
return R.ok().put("data", sites); |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,53 @@ |
|||
package com.gaotao.modules.automatedWarehouse.entity; |
|||
|
|||
import lombok.Data; |
|||
import org.apache.ibatis.type.Alias; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @Description WCS回调任务业务实体类 - 用于业务查询 - rqrq |
|||
* @Author rqrq |
|||
* @Date 2025/10/04 |
|||
*/ |
|||
@Data |
|||
@Alias("WcsCallbackTaskData") |
|||
public class WcsCallbackTaskData extends WcsCallbackTask { |
|||
|
|||
/** |
|||
* 查询开始日期 |
|||
*/ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
|||
private Date startDate; |
|||
|
|||
/** |
|||
* 查询结束日期 |
|||
*/ |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
|||
private Date endDate; |
|||
|
|||
/** |
|||
* 分页参数 |
|||
*/ |
|||
private Integer page; |
|||
|
|||
/** |
|||
* 每页数量 |
|||
*/ |
|||
private Integer limit; |
|||
|
|||
/** |
|||
* 分页参数(兼容) |
|||
*/ |
|||
private Integer pageNum; |
|||
|
|||
/** |
|||
* 每页数量(兼容) |
|||
*/ |
|||
private Integer pageSize; |
|||
} |
|||
|
|||
@ -0,0 +1,29 @@ |
|||
package com.gaotao.modules.automatedWarehouse.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.gaotao.modules.automatedWarehouse.entity.WcsCallbackTask; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Description WCS回调任务Mapper - rqrq |
|||
* @Author rqrq |
|||
* @Date 2025/10/04 |
|||
*/ |
|||
@Mapper |
|||
public interface WcsCallbackTaskMapper extends BaseMapper<WcsCallbackTask> { |
|||
|
|||
/** |
|||
* @Description 获取用户授权站点列表 - rqrq |
|||
* @Title getUserAuthorizedSites |
|||
* @param params 用户参数 |
|||
* @return List<Map<String, String>> |
|||
* @author rqrq |
|||
* @date 2025/10/04 |
|||
*/ |
|||
List<Map<String, String>> getUserAuthorizedSites(@Param("params") Map<String, Object> params); |
|||
} |
|||
|
|||
@ -0,0 +1,36 @@ |
|||
package com.gaotao.modules.automatedWarehouse.service; |
|||
|
|||
import com.gaotao.common.utils.PageUtils; |
|||
import com.gaotao.modules.automatedWarehouse.entity.WcsCallbackTaskData; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Description WCS回调任务查询Service - rqrq |
|||
* @Author rqrq |
|||
* @Date 2025/10/04 |
|||
*/ |
|||
public interface WcsCallbackTaskService { |
|||
|
|||
/** |
|||
* @Description 分页查询WCS回调任务列表 - rqrq |
|||
* @Title queryPage |
|||
* @param data 查询条件 |
|||
* @return PageUtils |
|||
* @author rqrq |
|||
* @date 2025/10/04 |
|||
*/ |
|||
PageUtils queryPage(WcsCallbackTaskData data); |
|||
|
|||
/** |
|||
* @Description 获取用户授权站点列表 - rqrq |
|||
* @Title getUserAuthorizedSites |
|||
* @param params 用户参数 |
|||
* @return List<Map<String, String>> |
|||
* @author rqrq |
|||
* @date 2025/10/04 |
|||
*/ |
|||
List<Map<String, String>> getUserAuthorizedSites(Map<String, Object> params); |
|||
} |
|||
|
|||
@ -0,0 +1,93 @@ |
|||
package com.gaotao.modules.automatedWarehouse.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.gaotao.common.utils.PageUtils; |
|||
import com.gaotao.common.utils.Query; |
|||
import com.gaotao.modules.automatedWarehouse.entity.WcsCallbackTask; |
|||
import com.gaotao.modules.automatedWarehouse.entity.WcsCallbackTaskData; |
|||
import com.gaotao.modules.automatedWarehouse.mapper.WcsCallbackTaskMapper; |
|||
import com.gaotao.modules.automatedWarehouse.service.WcsCallbackTaskService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.util.StringUtils; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Description WCS回调任务查询Service实现类 - rqrq |
|||
* @Author rqrq |
|||
* @Date 2025/10/04 |
|||
*/ |
|||
@Service |
|||
public class WcsCallbackTaskServiceImpl implements WcsCallbackTaskService { |
|||
|
|||
@Autowired |
|||
private WcsCallbackTaskMapper wcsCallbackTaskMapper; |
|||
|
|||
@Override |
|||
public PageUtils queryPage(WcsCallbackTaskData data) { |
|||
System.out.println("开始查询WCS回调任务列表 - rqrq"); |
|||
|
|||
// 构建查询条件 - rqrq |
|||
QueryWrapper<WcsCallbackTask> wrapper = new QueryWrapper<>(); |
|||
|
|||
// 站点条件 - rqrq |
|||
if (StringUtils.hasText(data.getSite())) { |
|||
wrapper.eq("site", data.getSite()); |
|||
} |
|||
|
|||
// 栈板ID条件 - rqrq |
|||
if (StringUtils.hasText(data.getPalletId())) { |
|||
wrapper.like("pallet_id", data.getPalletId()); |
|||
} |
|||
|
|||
// 任务号条件 - rqrq |
|||
if (StringUtils.hasText(data.getTaskNo())) { |
|||
wrapper.like("task_no", data.getTaskNo()); |
|||
} |
|||
|
|||
// 事务类型条件 - rqrq |
|||
if (StringUtils.hasText(data.getTransTypeDesc())) { |
|||
wrapper.eq("trans_type_desc", data.getTransTypeDesc()); |
|||
} |
|||
|
|||
// 状态条件 - rqrq |
|||
if (StringUtils.hasText(data.getStatus())) { |
|||
wrapper.eq("status", data.getStatus()); |
|||
} |
|||
|
|||
// 日期范围条件 - rqrq |
|||
if (data.getStartDate() != null) { |
|||
wrapper.ge("created_time", data.getStartDate()); |
|||
} |
|||
if (data.getEndDate() != null) { |
|||
wrapper.le("created_time", data.getEndDate() + " 23:59:59"); |
|||
} |
|||
|
|||
// 按创建时间倒序排列 - rqrq |
|||
wrapper.orderByDesc("created_time"); |
|||
|
|||
// 分页查询 - rqrq |
|||
int page = data.getPage() != null ? data.getPage() : 1; |
|||
int limit = data.getLimit() != null ? data.getLimit() : 20; |
|||
|
|||
IPage<WcsCallbackTask> pageResult = wcsCallbackTaskMapper.selectPage( |
|||
new Page<>(page, limit), |
|||
wrapper |
|||
); |
|||
|
|||
System.out.println("查询WCS回调任务完成 - rqrq,共" + pageResult.getTotal() + "条记录"); |
|||
|
|||
return new PageUtils(pageResult); |
|||
} |
|||
|
|||
@Override |
|||
public List<Map<String, String>> getUserAuthorizedSites(Map<String, Object> params) { |
|||
System.out.println("获取用户授权站点列表 - rqrq"); |
|||
return wcsCallbackTaskMapper.getUserAuthorizedSites(params); |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,17 @@ |
|||
<?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.gaotao.modules.automatedWarehouse.mapper.WcsCallbackTaskMapper"> |
|||
|
|||
<!-- rqrq - 获取用户授权站点列表 --> |
|||
<select id="getUserAuthorizedSites" resultType="java.util.HashMap"> |
|||
SELECT DISTINCT |
|||
a.site AS site, |
|||
s.siteName AS siteName |
|||
FROM AccessWarehouse a |
|||
LEFT JOIN site s ON a.site = s.site |
|||
WHERE a.userid = #{params.userName} |
|||
ORDER BY a.site |
|||
</select> |
|||
|
|||
</mapper> |
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue