From 5c3d381bdfdf1bef8391aa45572237370b720bc2 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期一, 30 六月 2025 17:02:39 +0800
Subject: [PATCH] 新增波次订单关联表
---
rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/WaveOrderRela.java | 93 ++++++++++++++++++
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/WaveOrderRelaServiceImpl.java | 12 ++
rsf-server/src/main/java/com/vincent/rsf/server/manager/mapper/WaveOrderRelaMapper.java | 12 ++
rsf-server/src/main/java/com/vincent/rsf/server/common/CodeBuilder.java | 4
rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/WaveOrderRelaController.java | 110 ++++++++++++++++++++++
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/WaveOrderRelaService.java | 8 +
rsf-server/src/main/resources/mapper/manager/WaveOrderRelaMapper.xml | 5 +
7 files changed, 242 insertions(+), 2 deletions(-)
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/common/CodeBuilder.java b/rsf-server/src/main/java/com/vincent/rsf/server/common/CodeBuilder.java
index e10c4af..7681387 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/common/CodeBuilder.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/common/CodeBuilder.java
@@ -15,14 +15,14 @@
generator.frontendPrefixPath = "rsf-admin/";
generator.sqlOsType = SqlOsType.MYSQL;
- generator.url = "192.168.4.50:3306/rsf";
+ generator.url = "127.0.0.1:3306/rsf";
generator.username = "root";
generator.password = "34821015";
// generator.url="47.97.1.152:51433;databasename=jkasrs";
// generator.username="sa";
// generator.password="Zoneyung@zy56$";
- generator.table = "man_wave_rule";
+ generator.table = "man_wave_order_rela";
generator.tableDesc = "娉㈡绛栫暐";
generator.packagePath = "com.vincent.rsf.server.manager";
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/WaveOrderRelaController.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/WaveOrderRelaController.java
new file mode 100644
index 0000000..68cbb60
--- /dev/null
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/WaveOrderRelaController.java
@@ -0,0 +1,110 @@
+package com.vincent.rsf.server.manager.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.vincent.rsf.framework.common.Cools;
+import com.vincent.rsf.framework.common.R;
+import com.vincent.rsf.server.common.utils.ExcelUtil;
+import com.vincent.rsf.server.common.annotation.OperationLog;
+import com.vincent.rsf.server.common.domain.BaseParam;
+import com.vincent.rsf.server.common.domain.KeyValVo;
+import com.vincent.rsf.server.common.domain.PageParam;
+import com.vincent.rsf.server.manager.entity.WaveOrderRela;
+import com.vincent.rsf.server.manager.service.WaveOrderRelaService;
+import com.vincent.rsf.server.system.controller.BaseController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.*;
+
+@RestController
+public class WaveOrderRelaController extends BaseController {
+
+ @Autowired
+ private WaveOrderRelaService waveOrderRelaService;
+
+ @PreAuthorize("hasAuthority('manager:waveOrderRela:list')")
+ @PostMapping("/waveOrderRela/page")
+ public R page(@RequestBody Map<String, Object> map) {
+ BaseParam baseParam = buildParam(map, BaseParam.class);
+ PageParam<WaveOrderRela, BaseParam> pageParam = new PageParam<>(baseParam, WaveOrderRela.class);
+ return R.ok().add(waveOrderRelaService.page(pageParam, pageParam.buildWrapper(true)));
+ }
+
+ @PreAuthorize("hasAuthority('manager:waveOrderRela:list')")
+ @PostMapping("/waveOrderRela/list")
+ public R list(@RequestBody Map<String, Object> map) {
+ return R.ok().add(waveOrderRelaService.list());
+ }
+
+ @PreAuthorize("hasAuthority('manager:waveOrderRela:list')")
+ @PostMapping({"/waveOrderRela/many/{ids}", "/waveOrderRelas/many/{ids}"})
+ public R many(@PathVariable Long[] ids) {
+ return R.ok().add(waveOrderRelaService.listByIds(Arrays.asList(ids)));
+ }
+
+ @PreAuthorize("hasAuthority('manager:waveOrderRela:list')")
+ @GetMapping("/waveOrderRela/{id}")
+ public R get(@PathVariable("id") Long id) {
+ return R.ok().add(waveOrderRelaService.getById(id));
+ }
+
+ @PreAuthorize("hasAuthority('manager:waveOrderRela:save')")
+ @OperationLog("Create 娉㈡绛栫暐")
+ @PostMapping("/waveOrderRela/save")
+ public R save(@RequestBody WaveOrderRela waveOrderRela) {
+ waveOrderRela.setCreateBy(getLoginUserId());
+ waveOrderRela.setCreateTime(new Date());
+ waveOrderRela.setUpdateBy(getLoginUserId());
+ waveOrderRela.setUpdateTime(new Date());
+ if (!waveOrderRelaService.save(waveOrderRela)) {
+ return R.error("Save Fail");
+ }
+ return R.ok("Save Success").add(waveOrderRela);
+ }
+
+ @PreAuthorize("hasAuthority('manager:waveOrderRela:update')")
+ @OperationLog("Update 娉㈡绛栫暐")
+ @PostMapping("/waveOrderRela/update")
+ public R update(@RequestBody WaveOrderRela waveOrderRela) {
+ waveOrderRela.setUpdateBy(getLoginUserId());
+ waveOrderRela.setUpdateTime(new Date());
+ if (!waveOrderRelaService.updateById(waveOrderRela)) {
+ return R.error("Update Fail");
+ }
+ return R.ok("Update Success").add(waveOrderRela);
+ }
+
+ @PreAuthorize("hasAuthority('manager:waveOrderRela:remove')")
+ @OperationLog("Delete 娉㈡绛栫暐")
+ @PostMapping("/waveOrderRela/remove/{ids}")
+ public R remove(@PathVariable Long[] ids) {
+ if (!waveOrderRelaService.removeByIds(Arrays.asList(ids))) {
+ return R.error("Delete Fail");
+ }
+ return R.ok("Delete Success").add(ids);
+ }
+
+ @PreAuthorize("hasAuthority('manager:waveOrderRela:list')")
+ @PostMapping("/waveOrderRela/query")
+ public R query(@RequestParam(required = false) String condition) {
+ List<KeyValVo> vos = new ArrayList<>();
+ LambdaQueryWrapper<WaveOrderRela> wrapper = new LambdaQueryWrapper<>();
+ if (!Cools.isEmpty(condition)) {
+ wrapper.like(WaveOrderRela::getId, condition);
+ }
+ waveOrderRelaService.page(new Page<>(1, 30), wrapper).getRecords().forEach(
+ item -> vos.add(new KeyValVo(item.getId(), item.getId()))
+ );
+ return R.ok().add(vos);
+ }
+
+ @PreAuthorize("hasAuthority('manager:waveOrderRela:list')")
+ @PostMapping("/waveOrderRela/export")
+ public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception {
+ ExcelUtil.build(ExcelUtil.create(waveOrderRelaService.list(), WaveOrderRela.class), response);
+ }
+
+}
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/WaveOrderRela.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/WaveOrderRela.java
new file mode 100644
index 0000000..627cc27
--- /dev/null
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/WaveOrderRela.java
@@ -0,0 +1,93 @@
+package com.vincent.rsf.server.manager.entity;
+
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import com.vincent.rsf.framework.common.Cools;
+import com.vincent.rsf.framework.common.SpringUtils;
+import com.vincent.rsf.server.system.service.UserService;
+import com.vincent.rsf.server.system.entity.User;
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@TableName("man_wave_order_rela")
+public class WaveOrderRela implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * ID
+ */
+ @ApiModelProperty(value= "ID")
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 娉㈡ID
+ */
+ @ApiModelProperty(value= "娉㈡ID")
+ private Long waveId;
+
+ /**
+ * 娉㈡鏄庣粏ID
+ */
+ @ApiModelProperty(value= "娉㈡鏄庣粏ID")
+ private Long waveItemId;
+
+ /**
+ * 璁㈠崟ID
+ */
+ @ApiModelProperty(value= "璁㈠崟ID")
+ private Long orderId;
+
+ /**
+ * 璁㈠崟鏄庣粏ID
+ */
+ @ApiModelProperty(value= "璁㈠崟鏄庣粏ID")
+ private Long orderItemId;
+
+ /**
+ * 澶囨敞
+ */
+ @ApiModelProperty(value= "澶囨敞")
+ private String memo;
+
+ public WaveOrderRela() {}
+
+ public WaveOrderRela(Long waveId,Long waveItemId,Long orderId,Long orderItemId,String memo) {
+ this.waveId = waveId;
+ this.waveItemId = waveItemId;
+ this.orderId = orderId;
+ this.orderItemId = orderItemId;
+ this.memo = memo;
+ }
+
+// WaveOrderRela waveOrderRela = new WaveOrderRela(
+// null, // 娉㈡ID
+// null, // 娉㈡鏄庣粏ID
+// null, // 璁㈠崟ID
+// null, // 璁㈠崟鏄庣粏ID
+// null // 澶囨敞
+// );
+
+
+
+ public Boolean getStatusBool(){
+ if (null == this.status){ return null; }
+ switch (this.status){
+ case 1:
+ return true;
+ case 0:
+ return false;
+ default:
+ return null;
+ }
+ }
+
+}
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/mapper/WaveOrderRelaMapper.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/mapper/WaveOrderRelaMapper.java
new file mode 100644
index 0000000..f9853eb
--- /dev/null
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/mapper/WaveOrderRelaMapper.java
@@ -0,0 +1,12 @@
+package com.vincent.rsf.server.manager.mapper;
+
+import com.vincent.rsf.server.manager.entity.WaveOrderRela;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+@Mapper
+@Repository
+public interface WaveOrderRelaMapper extends BaseMapper<WaveOrderRela> {
+
+}
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/WaveOrderRelaService.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/WaveOrderRelaService.java
new file mode 100644
index 0000000..c97d3f0
--- /dev/null
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/WaveOrderRelaService.java
@@ -0,0 +1,8 @@
+package com.vincent.rsf.server.manager.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.vincent.rsf.server.manager.entity.WaveOrderRela;
+
+public interface WaveOrderRelaService extends IService<WaveOrderRela> {
+
+}
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/WaveOrderRelaServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/WaveOrderRelaServiceImpl.java
new file mode 100644
index 0000000..6cb479f
--- /dev/null
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/WaveOrderRelaServiceImpl.java
@@ -0,0 +1,12 @@
+package com.vincent.rsf.server.manager.service.impl;
+
+import com.vincent.rsf.server.manager.mapper.WaveOrderRelaMapper;
+import com.vincent.rsf.server.manager.entity.WaveOrderRela;
+import com.vincent.rsf.server.manager.service.WaveOrderRelaService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+@Service("waveOrderRelaService")
+public class WaveOrderRelaServiceImpl extends ServiceImpl<WaveOrderRelaMapper, WaveOrderRela> implements WaveOrderRelaService {
+
+}
diff --git a/rsf-server/src/main/resources/mapper/manager/WaveOrderRelaMapper.xml b/rsf-server/src/main/resources/mapper/manager/WaveOrderRelaMapper.xml
new file mode 100644
index 0000000..a00417d
--- /dev/null
+++ b/rsf-server/src/main/resources/mapper/manager/WaveOrderRelaMapper.xml
@@ -0,0 +1,5 @@
+<?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.vincent.rsf.server.manager.mapper.WaveOrderRelaMapper">
+
+</mapper>
--
Gitblit v1.9.1