From 3640ae3908b0ad75baee22ba588e5cce4319e216 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期五, 16 九月 2022 08:53:33 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/crm/manager/entity/Cstmr.java |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 51 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/zy/crm/manager/entity/Cstmr.java b/src/main/java/com/zy/crm/manager/entity/Cstmr.java
index ddead87..259cdc0 100644
--- a/src/main/java/com/zy/crm/manager/entity/Cstmr.java
+++ b/src/main/java/com/zy/crm/manager/entity/Cstmr.java
@@ -1,7 +1,9 @@
 package com.zy.crm.manager.entity;
 
 import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableId;
 import com.baomidou.mybatisplus.annotations.TableName;
+import com.baomidou.mybatisplus.enums.IdType;
 import com.core.common.Cools;
 import com.core.common.SpringUtils;
 import com.zy.crm.manager.service.CstmrTypeService;
@@ -29,6 +31,7 @@
      * ID
      */
     @ApiModelProperty(value= "ID")
+    @TableId(value = "id", type = IdType.AUTO)
     private Long id;
 
     /**
@@ -331,7 +334,7 @@
         if (Cools.isEmpty(this.createTime)){
             return "";
         }
-        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime);
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm").format(this.createTime);
     }
 
     public String getUpdateBy$(){
@@ -347,8 +350,54 @@
         if (Cools.isEmpty(this.updateTime)){
             return "";
         }
-        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime);
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm").format(this.updateTime);
     }
 
+    @TableField(exist = false)
+    private String pcd;
+
+    public String getPcd() {
+        StringBuilder sb = new StringBuilder();
+        if (!Cools.isEmpty(province)) {
+            sb.append(province).append(",");
+        }
+        if (!Cools.isEmpty(city)) {
+            sb.append(city).append(",");
+        }
+        if (!Cools.isEmpty(district)) {
+            sb.append(district).append(",");
+        }
+        String s = sb.toString();
+        if (s.endsWith(",")) {
+            s = s.substring(0, s.length() - 1);
+        }
+        return s;
+    }
+
+    public void setPcd(String pcd) {
+        this.pcd = pcd;
+        if (!Cools.isEmpty(pcd)) {
+            String[] split = this.pcd.split(",");
+            for (int i = 0;i< split.length; i++) {
+                switch (i) {
+                    case 0:
+                        this.province = split[0];
+                        break;
+                    case 1:
+                        this.city = split[1];
+                        break;
+                    case 2:
+                        this.district = split[2];
+                        break;
+                    default:
+                        break;
+                }
+            }
+        } else {
+            this.province = "";
+            this.city = "";
+            this.district = "";
+        }
+    }
 
 }

--
Gitblit v1.9.1