浏览代码

1、数据处理

lqh 1 年之前
父节点
当前提交
a608035713

+ 77 - 0
hx-customer/src/main/java/com/fjhx/customer/controller/xiaoman/XiaomanCustomerController.java

@@ -0,0 +1,77 @@
+package com.fjhx.customer.controller.xiaoman;
+
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.customer.entity.xiaoman.vo.XiaomanCustomerVo;
+import com.fjhx.customer.entity.xiaoman.dto.XiaomanCustomerSelectDto;
+import com.fjhx.customer.entity.xiaoman.dto.XiaomanCustomerDto;
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import com.fjhx.customer.service.xiaoman.XiaomanCustomerService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 小满客户表 前端控制器
+ * </p>
+ *
+ * @author lqh
+ * @since 2024-04-06
+ */
+@RestController
+@RequestMapping("/xiaomanCustomer")
+public class XiaomanCustomerController {
+
+    @Autowired
+    private XiaomanCustomerService xiaomanCustomerService;
+
+    /**
+     * 小满客户表列表
+     */
+    @PostMapping("/list")
+    public List<XiaomanCustomerVo> list(@RequestBody XiaomanCustomerSelectDto dto) {
+        return xiaomanCustomerService.getList(dto);
+    }
+
+    /**
+     * 小满客户表分页
+     */
+    @PostMapping("/page")
+    public Page<XiaomanCustomerVo> page(@RequestBody XiaomanCustomerSelectDto dto) {
+        return xiaomanCustomerService.getPage(dto);
+    }
+
+    /**
+     * 小满客户表明细
+     */
+    @PostMapping("/detail")
+    public XiaomanCustomerVo detail(@RequestBody BaseSelectDto dto) {
+        return xiaomanCustomerService.detail(dto.getId());
+    }
+
+    /**
+     * 小满客户表新增
+     */
+    @PostMapping("/add")
+    public void add(@RequestBody XiaomanCustomerDto xiaomanCustomerDto) {
+        xiaomanCustomerService.add(xiaomanCustomerDto);
+    }
+
+    /**
+     * 小满客户表编辑
+     */
+    @PostMapping("/edit")
+    public void edit(@RequestBody XiaomanCustomerDto xiaomanCustomerDto) {
+        xiaomanCustomerService.edit(xiaomanCustomerDto);
+    }
+
+    /**
+     * 小满客户表删除
+     */
+    @PostMapping("/delete")
+    public void delete(@RequestBody BaseSelectDto dto) {
+        xiaomanCustomerService.delete(dto.getId());
+    }
+
+}

+ 17 - 0
hx-customer/src/main/java/com/fjhx/customer/entity/xiaoman/dto/XiaomanCustomerDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.customer.entity.xiaoman.dto;
+
+import com.fjhx.customer.entity.xiaoman.po.XiaomanCustomer;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 小满客户表新增编辑入参实体
+ *
+ * @author lqh
+ * @since 2024-04-06
+ */
+@Getter
+@Setter
+public class XiaomanCustomerDto extends XiaomanCustomer {
+
+}

+ 17 - 0
hx-customer/src/main/java/com/fjhx/customer/entity/xiaoman/dto/XiaomanCustomerSelectDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.customer.entity.xiaoman.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 小满客户表列表查询入参实体
+ *
+ * @author lqh
+ * @since 2024-04-06
+ */
+@Getter
+@Setter
+public class XiaomanCustomerSelectDto extends BaseSelectDto {
+
+}

+ 98 - 0
hx-customer/src/main/java/com/fjhx/customer/entity/xiaoman/po/XiaomanCustomer.java

@@ -0,0 +1,98 @@
+package com.fjhx.customer.entity.xiaoman.po;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.ruoyi.common.core.domain.BaseIdPo;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 小满客户表
+ * </p>
+ *
+ * @author lqh
+ * @since 2024-04-06
+ */
+@Getter
+@Setter
+@TableName("xiaoman_customer")
+public class XiaomanCustomer {
+
+    /**
+     * 公司客户ID
+     */
+    @JsonProperty("company_id")
+    @TableId(value = "company_id", type = IdType.ASSIGN_ID)
+    private Long companyId;
+
+    /**
+     * 小满用户ID
+     */
+    @JsonProperty("user_id")
+    private String userId;
+
+    /**
+     * 公司名称
+     */
+
+    @JsonProperty("name")
+    private String name;
+
+    /**
+     * 公司简称
+     */
+
+    @JsonProperty("short_name")
+    private String shortName;
+
+    /**
+     * 公司编号
+     */
+    @JsonProperty("serial_id")
+    private Integer serialId;
+
+    /**
+     * 最近更新时间
+     */
+    @JsonProperty("order_time")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date orderTime;
+
+    /**
+     * 公司建档时间
+     */
+    @JsonProperty("create_time")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    /**
+     * 公司更新时间
+     */
+    @JsonProperty("update_time")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /**
+     * 存档类型
+     */
+    @JsonProperty("archive_type")
+    private String archiveType;
+
+    /**
+     * 公司修改时间
+     */
+    @JsonProperty("edit_time")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date editTime;
+
+    /**
+     * 客户表客户Id
+     */
+    private Long customerId;
+
+}

+ 25 - 0
hx-customer/src/main/java/com/fjhx/customer/entity/xiaoman/vo/CustomerApiVo.java

@@ -0,0 +1,25 @@
+package com.fjhx.customer.entity.xiaoman.vo;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fjhx.customer.entity.xiaoman.po.XiaomanCustomer;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 小满客户表列表查询返回值实体
+ *
+ * @author lqh
+ * @since 2024-04-06
+ */
+@Getter
+@Setter
+public class CustomerApiVo extends XiaomanCustomer {
+
+    @JsonProperty("create_user")
+    private Long createUser;
+    @JsonProperty("last_edit_user")
+    private Long lastEditUser;
+}

+ 24 - 0
hx-customer/src/main/java/com/fjhx/customer/entity/xiaoman/vo/CustomerListApiVo.java

@@ -0,0 +1,24 @@
+package com.fjhx.customer.entity.xiaoman.vo;
+
+import com.fjhx.customer.entity.xiaoman.po.XiaomanCustomer;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 小满客户表列表查询返回值实体
+ *
+ * @author lqh
+ * @since 2024-04-06
+ */
+@Getter
+@Setter
+public class CustomerListApiVo {
+    List<CustomerApiVo> list = new ArrayList<>();
+
+    public int totalItem;
+
+    public int count;
+}

+ 17 - 0
hx-customer/src/main/java/com/fjhx/customer/entity/xiaoman/vo/XiaomanCustomerVo.java

@@ -0,0 +1,17 @@
+package com.fjhx.customer.entity.xiaoman.vo;
+
+import com.fjhx.customer.entity.xiaoman.po.XiaomanCustomer;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 小满客户表列表查询返回值实体
+ *
+ * @author lqh
+ * @since 2024-04-06
+ */
+@Getter
+@Setter
+public class XiaomanCustomerVo extends XiaomanCustomer {
+
+}

+ 49 - 0
hx-customer/src/main/java/com/fjhx/customer/handle/HandleXiaomanData.java

@@ -0,0 +1,49 @@
+package com.fjhx.customer.handle;
+
+
+import com.fjhx.customer.entity.xiaoman.po.XiaomanCustomer;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fjhx.customer.entity.xiaoman.vo.CustomerApiVo;
+import com.fjhx.customer.entity.xiaoman.vo.CustomerListApiVo;
+
+
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOException;
+
+public class HandleXiaomanData {
+
+
+
+    public static void main(String[] args) {
+        String filePath = "D:\\java_conding\\erhong\\hx-customer\\src\\main\\java\\com\\fjhx\\customer\\handle\\aaa.json";
+        String jsonData = "";
+
+        try (BufferedReader br = new BufferedReader(new FileReader(filePath))) {
+            String line;
+            while ((line = br.readLine()) != null) {
+                jsonData += line;
+            }
+
+            handleList(jsonData, new TypeReference<R<CustomerListApiVo>>() {});
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static <T> T handleList(String res, TypeReference<R<T>> typeReference) {
+        ObjectMapper objectMapper = new ObjectMapper();
+        try {
+            R<T> result = objectMapper.readValue(res, typeReference);
+            if (result.isOk()) {
+                return result.getData();
+            }
+            return null;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+}

+ 125 - 0
hx-customer/src/main/java/com/fjhx/customer/handle/R.java

@@ -0,0 +1,125 @@
+package com.fjhx.customer.handle;
+
+
+import java.io.Serializable;
+
+public class R<T> implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 成功 */
+    public static final int SUCCESS = 200;
+
+    /** 失败 */
+    public static final int FAIL = 500;
+
+    private int code;
+
+    private String message;
+
+    private T data;
+
+    public String now;
+
+
+    public static <T> R<T> ok()
+    {
+        return restResult(null, SUCCESS, null);
+    }
+
+    public static <T> R<T> ok(T data)
+    {
+        return restResult(data, SUCCESS, null);
+    }
+
+    public static <T> R<T> ok(T data, String message)
+    {
+        return restResult(data, SUCCESS, message);
+    }
+
+    public static <T> R<T> fail()
+    {
+        return restResult(null, FAIL, null);
+    }
+
+    public static <T> R<T> fail(String message)
+    {
+        return restResult(null, FAIL, message);
+    }
+
+    public static <T> R<T> fail(T data)
+    {
+        return restResult(data, FAIL, null);
+    }
+
+    public static <T> R<T> fail(T data, String message)
+    {
+        return restResult(data, FAIL, message);
+    }
+
+    public static <T> R<T> fail(int code, String message)
+    {
+        return restResult(null, code, message);
+    }
+
+    private static <T> R<T> restResult(T data, int code, String message)
+    {
+        R<T> apiResult = new R<>();
+        apiResult.setCode(code);
+        apiResult.setData(data);
+        apiResult.setMessage(message);
+        return apiResult;
+    }
+
+    public int getCode()
+    {
+        return code;
+    }
+
+    public void setCode(int code)
+    {
+        this.code = code;
+    }
+
+    public String getMessage()
+    {
+        return message;
+    }
+
+    public void setMessage(String message)
+    {
+        this.message = message;
+    }
+
+    public T getData()
+    {
+        return data;
+    }
+
+    public void setData(T data)
+    {
+        this.data = data;
+    }
+
+    public static <T> Boolean isError(R<T> ret)
+    {
+        return !isSuccess(ret);
+    }
+
+    public static <T> Boolean isSuccess(R<T> ret)
+    {
+        return R.SUCCESS == ret.getCode();
+    }
+
+    public boolean isOk() {
+        return R.SUCCESS == code;
+    }
+
+    public String getNow() {
+        return now;
+    }
+
+    public void setNow(String now) {
+        this.now = now;
+    }
+}

+ 291 - 0
hx-customer/src/main/java/com/fjhx/customer/handle/aaa.json

@@ -0,0 +1,291 @@
+{
+  "code": 200,
+  "message": "success",
+  "now": "2024-04-06 15:08:24",
+  "data": {
+    "list": [
+      {
+        "company_id": 18846628768390,
+        "user_id": "{56322068}",
+        "name": "CLP Trading GmbH",
+        "short_name": "",
+        "serial_id": "86795",
+        "order_time": "2024-04-05 17:49:05",
+        "create_time": "2024-04-05 17:39:57",
+        "update_time": "2024-04-05 17:49:05",
+        "create_user": 56322068,
+        "last_edit_user": 56322068,
+        "archive_type": 4,
+        "edit_time": "2024-04-05 17:39:58"
+      },
+      {
+        "company_id": 18821262794263,
+        "user_id": "{56324651}",
+        "name": "zuo Vicky",
+        "short_name": "",
+        "serial_id": "86794",
+        "order_time": "2024-04-05 00:26:11",
+        "create_time": "2024-04-05 00:24:06",
+        "update_time": "2024-04-06 06:48:00",
+        "create_user": 56324651,
+        "last_edit_user": 56321852,
+        "archive_type": 4,
+        "edit_time": "2024-04-06 06:48:00"
+      },
+      {
+        "company_id": 18797590212301,
+        "user_id": "{}",
+        "name": "Chevroni Garden and home",
+        "short_name": "",
+        "serial_id": "86793",
+        "order_time": "2024-04-04 08:08:48",
+        "create_time": "2024-04-04 08:08:48",
+        "update_time": "2024-04-04 08:08:48",
+        "create_user": 56321852,
+        "last_edit_user": 56321852,
+        "archive_type": 4,
+        "edit_time": "2024-04-04 08:08:48"
+      },
+      {
+        "company_id": 18775848055399,
+        "user_id": "{56322073}",
+        "name": "ATREAT",
+        "short_name": "",
+        "serial_id": "86792",
+        "order_time": "2024-04-03 17:58:15",
+        "create_time": "2024-04-03 17:13:16",
+        "update_time": "2024-04-04 07:06:39",
+        "create_user": 56322073,
+        "last_edit_user": 56321852,
+        "archive_type": 4,
+        "edit_time": "2024-04-04 07:06:39"
+      },
+      {
+        "company_id": 18774421148353,
+        "user_id": "{56322072}",
+        "name": "okkorokoshop LLC",
+        "short_name": "",
+        "serial_id": "86791",
+        "order_time": "2024-04-03 16:43:23",
+        "create_time": "2024-04-03 16:43:09",
+        "update_time": "2024-04-03 16:43:23",
+        "create_user": 56322072,
+        "last_edit_user": 56322072,
+        "archive_type": 4,
+        "edit_time": "2024-04-03 16:43:10"
+      },
+      {
+        "company_id": 18768032408126,
+        "user_id": "{56322068}",
+        "name": "STRIKEONE INC",
+        "short_name": "",
+        "serial_id": "86790",
+        "order_time": "2024-04-03 14:46:11",
+        "create_time": "2024-04-03 14:44:53",
+        "update_time": "2024-04-04 06:42:39",
+        "create_user": 56322068,
+        "last_edit_user": 56321852,
+        "archive_type": 4,
+        "edit_time": "2024-04-04 06:42:39"
+      },
+      {
+        "company_id": 18767388666654,
+        "user_id": "{56322073}",
+        "name": "Solutions VD",
+        "short_name": "",
+        "serial_id": "86789",
+        "order_time": "2024-04-05 18:09:53",
+        "create_time": "2024-04-03 14:32:24",
+        "update_time": "2024-04-05 18:09:53",
+        "create_user": 56322073,
+        "last_edit_user": 56321852,
+        "archive_type": 4,
+        "edit_time": "2024-04-05 18:09:53"
+      },
+      {
+        "company_id": 18754703809198,
+        "user_id": "{56322068}",
+        "name": "Pinisi Home",
+        "short_name": "",
+        "serial_id": "86788",
+        "order_time": "2024-04-06 03:49:02",
+        "create_time": "2024-04-03 09:56:29",
+        "update_time": "2024-04-06 03:49:02",
+        "create_user": 56322068,
+        "last_edit_user": 56321852,
+        "archive_type": 4,
+        "edit_time": "2024-04-04 07:05:41"
+      },
+      {
+        "company_id": 18752693448624,
+        "user_id": "{56322068}",
+        "name": "Sowvital Ltd",
+        "short_name": "",
+        "serial_id": "86787",
+        "order_time": "2024-04-06 02:03:40",
+        "create_time": "2024-04-03 09:24:30",
+        "update_time": "2024-04-06 02:03:40",
+        "create_user": 56322068,
+        "last_edit_user": 56322068,
+        "archive_type": 4,
+        "edit_time": "2024-04-03 09:24:30"
+      },
+      {
+        "company_id": 18723459104412,
+        "user_id": "{56322068}",
+        "name": "Groupe BMR Inc",
+        "short_name": "",
+        "serial_id": "86786",
+        "order_time": "2024-04-02 16:41:29",
+        "create_time": "2024-04-02 16:36:33",
+        "update_time": "2024-04-02 16:36:33",
+        "create_user": 56322068,
+        "last_edit_user": 56322068,
+        "archive_type": 1,
+        "edit_time": "2024-04-02 16:36:33"
+      },
+      {
+        "company_id": 18723361827089,
+        "user_id": "{56322068}",
+        "name": "Cali Bamboo, LLC",
+        "short_name": "",
+        "serial_id": "86785",
+        "order_time": "2024-04-02 16:40:00",
+        "create_time": "2024-04-02 16:34:32",
+        "update_time": "2024-04-02 16:34:32",
+        "create_user": 56322068,
+        "last_edit_user": 56322068,
+        "archive_type": 1,
+        "edit_time": "2024-04-02 16:34:32"
+      },
+      {
+        "company_id": 18723308422201,
+        "user_id": "{56322068}",
+        "name": "Mesun Bamboo Co., Ltd.",
+        "short_name": "",
+        "serial_id": "86784",
+        "order_time": "2024-04-02 16:34:06",
+        "create_time": "2024-04-02 16:33:42",
+        "update_time": "2024-04-02 16:33:42",
+        "create_user": 56322068,
+        "last_edit_user": 56322068,
+        "archive_type": 1,
+        "edit_time": "2024-04-02 16:33:42"
+      },
+      {
+        "company_id": 18717411514550,
+        "user_id": "{56322069}",
+        "name": "ARIAS ONLINE  LLC",
+        "short_name": "",
+        "serial_id": "86783",
+        "order_time": "2024-04-03 10:57:31",
+        "create_time": "2024-04-02 14:53:19",
+        "update_time": "2024-04-03 10:57:31",
+        "create_user": 56322069,
+        "last_edit_user": 56321852,
+        "archive_type": 4,
+        "edit_time": "2024-04-03 08:17:48"
+      },
+      {
+        "company_id": 18714863120466,
+        "user_id": "{56322068}",
+        "name": "NoCompanyName_1952634383",
+        "short_name": "",
+        "serial_id": "86782",
+        "order_time": "2024-04-04 06:57:25",
+        "create_time": "2024-04-02 14:12:51",
+        "update_time": "2024-04-04 06:57:25",
+        "create_user": 56322068,
+        "last_edit_user": 56321852,
+        "archive_type": 4,
+        "edit_time": "2024-04-04 06:57:25"
+      },
+      {
+        "company_id": 18704156643104,
+        "user_id": "{56322068}",
+        "name": "Haroon tradors",
+        "short_name": "",
+        "serial_id": "86781",
+        "order_time": "2024-04-06 08:32:34",
+        "create_time": "2024-04-02 10:24:02",
+        "update_time": "2024-04-06 08:32:34",
+        "create_user": 56322068,
+        "last_edit_user": 56321852,
+        "archive_type": 4,
+        "edit_time": "2024-04-02 18:07:54"
+      },
+      {
+        "company_id": 18702369666786,
+        "user_id": "{56322069}",
+        "name": "Broad Leaf",
+        "short_name": "",
+        "serial_id": "86780",
+        "order_time": "2024-04-06 09:44:28",
+        "create_time": "2024-04-02 09:58:46",
+        "update_time": "2024-04-06 09:44:28",
+        "create_user": 56322069,
+        "last_edit_user": 56321852,
+        "archive_type": 1,
+        "edit_time": "2024-04-03 09:28:28"
+      },
+      {
+        "company_id": 18701988985054,
+        "user_id": "{56322068}",
+        "name": "Jake Paulin",
+        "short_name": "",
+        "serial_id": "86779",
+        "order_time": "2024-04-02 09:52:25",
+        "create_time": "2024-04-02 09:52:25",
+        "update_time": "2024-04-03 18:13:24",
+        "create_user": 56322068,
+        "last_edit_user": 56321852,
+        "archive_type": 4,
+        "edit_time": "2024-04-03 18:13:24"
+      },
+      {
+        "company_id": 18701916426712,
+        "user_id": "{56322073}",
+        "name": "MKS Commerce LLC",
+        "short_name": "",
+        "serial_id": "86778",
+        "order_time": "2024-04-05 19:34:50",
+        "create_time": "2024-04-02 09:51:09",
+        "update_time": "2024-04-05 19:34:50",
+        "create_user": 56322073,
+        "last_edit_user": 56322073,
+        "archive_type": 4,
+        "edit_time": "2024-04-02 09:51:10"
+      },
+      {
+        "company_id": 18670119196518,
+        "user_id": "{56322068}",
+        "name": "Danica",
+        "short_name": "",
+        "serial_id": "86777",
+        "order_time": "2024-04-03 16:05:22",
+        "create_time": "2024-04-01 16:11:12",
+        "update_time": "2024-04-03 16:05:22",
+        "create_user": 56322068,
+        "last_edit_user": 56322068,
+        "archive_type": 1,
+        "edit_time": "2024-04-01 16:11:32"
+      },
+      {
+        "company_id": 18669166854018,
+        "user_id": "{56322072}",
+        "name": "Thu Pham",
+        "short_name": "",
+        "serial_id": "86776",
+        "order_time": "2024-04-06 11:12:47",
+        "create_time": "2024-04-01 15:55:47",
+        "update_time": "2024-04-06 11:12:47",
+        "create_user": 56322072,
+        "last_edit_user": 56322072,
+        "archive_type": 4,
+        "edit_time": "2024-04-06 11:12:46"
+      }
+    ],
+    "totalItem": 86509,
+    "count": 86509
+  }
+}

+ 32 - 0
hx-customer/src/main/java/com/fjhx/customer/mapper/xiaoman/XiaomanCustomerMapper.java

@@ -0,0 +1,32 @@
+package com.fjhx.customer.mapper.xiaoman;
+
+import com.fjhx.customer.entity.xiaoman.po.XiaomanCustomer;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.customer.entity.xiaoman.vo.XiaomanCustomerVo;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 小满客户表 Mapper 接口
+ * </p>
+ *
+ * @author lqh
+ * @since 2024-04-06
+ */
+public interface XiaomanCustomerMapper extends BaseMapper<XiaomanCustomer> {
+
+    /**
+     * 小满客户表列表
+     */
+    List<XiaomanCustomerVo> getList(@Param("ew") IWrapper<XiaomanCustomer> wrapper);
+
+    /**
+     * 小满客户表分页
+     */
+    Page<XiaomanCustomerVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<XiaomanCustomer> wrapper);
+
+}

+ 52 - 0
hx-customer/src/main/java/com/fjhx/customer/service/xiaoman/XiaomanCustomerService.java

@@ -0,0 +1,52 @@
+package com.fjhx.customer.service.xiaoman;
+
+import com.fjhx.customer.entity.xiaoman.po.XiaomanCustomer;
+import com.ruoyi.common.core.service.BaseService;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.customer.entity.xiaoman.vo.XiaomanCustomerVo;
+import com.fjhx.customer.entity.xiaoman.dto.XiaomanCustomerSelectDto;
+import com.fjhx.customer.entity.xiaoman.dto.XiaomanCustomerDto;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 小满客户表 服务类
+ * </p>
+ *
+ * @author lqh
+ * @since 2024-04-06
+ */
+public interface XiaomanCustomerService  {
+
+    /**
+     * 小满客户表列表
+     */
+    List<XiaomanCustomerVo> getList(XiaomanCustomerSelectDto dto);
+
+    /**
+     * 小满客户表分页
+     */
+    Page<XiaomanCustomerVo> getPage(XiaomanCustomerSelectDto dto);
+
+    /**
+     * 小满客户表明细
+     */
+    XiaomanCustomerVo detail(Long id);
+
+    /**
+     * 小满客户表新增
+     */
+    void add(XiaomanCustomerDto xiaomanCustomerDto);
+
+    /**
+     * 小满客户表编辑
+     */
+    void edit(XiaomanCustomerDto xiaomanCustomerDto);
+
+    /**
+     * 小满客户表删除
+     */
+    void delete(Long id);
+
+}

+ 68 - 0
hx-customer/src/main/java/com/fjhx/customer/service/xiaoman/impl/XiaomanCustomerServiceImpl.java

@@ -0,0 +1,68 @@
+package com.fjhx.customer.service.xiaoman.impl;
+
+import com.fjhx.customer.entity.xiaoman.po.XiaomanCustomer;
+import com.fjhx.customer.mapper.xiaoman.XiaomanCustomerMapper;
+import com.fjhx.customer.service.xiaoman.XiaomanCustomerService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.customer.entity.xiaoman.vo.XiaomanCustomerVo;
+import com.fjhx.customer.entity.xiaoman.dto.XiaomanCustomerSelectDto;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.fjhx.customer.entity.xiaoman.dto.XiaomanCustomerDto;
+import cn.hutool.core.bean.BeanUtil;
+
+import java.util.List;
+
+import static com.ruoyi.common.utils.wrapper.IWrapper.getWrapper;
+
+/**
+ * <p>
+ * 小满客户表 服务实现类
+ * </p>
+ *
+ * @author lqh
+ * @since 2024-04-06
+ */
+@Service
+public class XiaomanCustomerServiceImpl extends ServiceImpl<XiaomanCustomerMapper, XiaomanCustomer> implements XiaomanCustomerService {
+
+    @Override
+    public List<XiaomanCustomerVo> getList(XiaomanCustomerSelectDto dto) {
+        IWrapper<XiaomanCustomer> wrapper = getWrapper();
+        wrapper.orderByDesc("xc", XiaomanCustomer::getCompanyId);
+        List<XiaomanCustomerVo> list = this.baseMapper.getList(wrapper);
+        return list;
+    }
+
+    @Override
+    public Page<XiaomanCustomerVo> getPage(XiaomanCustomerSelectDto dto) {
+        IWrapper<XiaomanCustomer> wrapper = getWrapper();
+        wrapper.orderByDesc("xc", XiaomanCustomer::getCompanyId);
+        Page<XiaomanCustomerVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
+        return page;
+    }
+
+    @Override
+    public XiaomanCustomerVo detail(Long id) {
+        XiaomanCustomer XiaomanCustomer = this.getById(id);
+        XiaomanCustomerVo result = BeanUtil.toBean(XiaomanCustomer, XiaomanCustomerVo.class);
+        return result;
+    }
+
+    @Override
+    public void add(XiaomanCustomerDto xiaomanCustomerDto) {
+        this.save(xiaomanCustomerDto);
+    }
+
+    @Override
+    public void edit(XiaomanCustomerDto xiaomanCustomerDto) {
+        this.updateById(xiaomanCustomerDto);
+    }
+
+    @Override
+    public void delete(Long id) {
+        this.removeById(id);
+    }
+
+}

+ 38 - 0
hx-customer/src/main/resources/mapper/xiaoman/XiaomanCustomerMapper.xml

@@ -0,0 +1,38 @@
+<?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.fjhx.customer.mapper.xiaoman.XiaomanCustomerMapper">
+    <select id="getList" resultType="com.fjhx.customer.entity.xiaoman.vo.XiaomanCustomerVo">
+        select
+            xc.company_id,
+            xc.user_id,
+            xc.name,
+            xc.short_name,
+            xc.serial_id,
+            xc.order_time,
+            xc.create_time,
+            xc.update_time,
+            xc.archive_type,
+            xc.edit_time,
+            xc.customer_id
+        from xiaoman_customer xc
+            ${ew.customSqlSegment}
+    </select>
+
+    <select id="getPage" resultType="com.fjhx.customer.entity.xiaoman.vo.XiaomanCustomerVo">
+        select
+            xc.company_id,
+            xc.user_id,
+            xc.name,
+            xc.short_name,
+            xc.serial_id,
+            xc.order_time,
+            xc.create_time,
+            xc.update_time,
+            xc.archive_type,
+            xc.edit_time,
+            xc.customer_id
+        from xiaoman_customer xc
+            ${ew.customSqlSegment}
+    </select>
+
+</mapper>