|
@@ -1,8 +1,8 @@
|
|
|
package com.pj.project.tb_costomer;
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.Date;
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.annotation.*;
|
|
@@ -14,10 +14,12 @@ import lombok.EqualsAndHashCode;
|
|
|
import lombok.Data;
|
|
|
import lombok.Getter;
|
|
|
import lombok.experimental.Accessors;
|
|
|
+import org.omg.CORBA.IRObject;
|
|
|
|
|
|
/**
|
|
|
* Model: tb_costomer -- 客户管理
|
|
|
- * @author qzy
|
|
|
+ *
|
|
|
+ * @author qzy
|
|
|
*/
|
|
|
@Data
|
|
|
@Accessors(chain = true)
|
|
@@ -25,126 +27,135 @@ import lombok.experimental.Accessors;
|
|
|
@EqualsAndHashCode(callSuper = false)
|
|
|
public class TbCostomer extends Model<TbCostomer> implements Serializable {
|
|
|
|
|
|
- // ---------- 模块常量 ----------
|
|
|
- /**
|
|
|
- * 序列化版本id
|
|
|
- */
|
|
|
- private static final long serialVersionUID = 1L;
|
|
|
- /**
|
|
|
- * 此模块对应的表名
|
|
|
- */
|
|
|
- public static final String TABLE_NAME = "tb_costomer";
|
|
|
- /**
|
|
|
- * 此模块对应的权限码
|
|
|
- */
|
|
|
- public static final String PERMISSION_CODE = "tb-costomer";
|
|
|
- public static final String PARTNER_PERMISSION_CODE = "tb-partner";
|
|
|
- public static final String PERMISSION_INFO = "tb-costomer-maintain";
|
|
|
-
|
|
|
- // ---------- 表中字段 ----------
|
|
|
- /**
|
|
|
- * 主键
|
|
|
- */
|
|
|
- private String id;
|
|
|
-
|
|
|
- /**
|
|
|
- * 名称
|
|
|
- */
|
|
|
- private String name;
|
|
|
-
|
|
|
- /**
|
|
|
- * 联系号码
|
|
|
- */
|
|
|
- private String phone;
|
|
|
-
|
|
|
- /**
|
|
|
- * 负责人
|
|
|
- */
|
|
|
- private String dutyPeople;
|
|
|
-
|
|
|
- /**
|
|
|
- * 地址id
|
|
|
- */
|
|
|
- private String addressIds;
|
|
|
-
|
|
|
- /**
|
|
|
- * 地址
|
|
|
- */
|
|
|
- private String addressStr;
|
|
|
-
|
|
|
- /**
|
|
|
- * 营业执照
|
|
|
- */
|
|
|
- private String businessLicence;
|
|
|
-
|
|
|
- /**
|
|
|
- * 状态(0=否,1=是)
|
|
|
- */
|
|
|
- private Integer status;
|
|
|
-
|
|
|
- /**
|
|
|
- * 创建时间
|
|
|
- */
|
|
|
- private Date creareTime=null;
|
|
|
-
|
|
|
- /**
|
|
|
- * 审核状态(1=未审核,2审核通过,3审核不通过)
|
|
|
- */
|
|
|
- private Integer judgeStatus=1;
|
|
|
-
|
|
|
- /**
|
|
|
- * 审核时间
|
|
|
- */
|
|
|
- private Date judgeTime=null;
|
|
|
-
|
|
|
- /**
|
|
|
- * 审核意见
|
|
|
- */
|
|
|
- private String judgeContent;
|
|
|
- /**
|
|
|
- * 结账方式(1=现结,2=月结)[j]
|
|
|
- */
|
|
|
- private int payType;
|
|
|
- /**
|
|
|
- * 类型0、理货员;1、消杀;2、装卸
|
|
|
- */
|
|
|
- private String type="0";
|
|
|
-
|
|
|
- @TableField(exist = false)
|
|
|
- private String typeDes;
|
|
|
-
|
|
|
- public String getTypeDes() {
|
|
|
- String type=this.type;
|
|
|
- StringBuilder sb=new StringBuilder();
|
|
|
- StrUtil.splitTrim(type,",")
|
|
|
- .forEach(t->{
|
|
|
- sb.append(CustomerEnum.getDesc(t)).append("、");
|
|
|
- });
|
|
|
- return sb.substring(0,sb.lastIndexOf("、"));
|
|
|
- }
|
|
|
-
|
|
|
- @Getter
|
|
|
- @AllArgsConstructor
|
|
|
- public static enum CustomerEnum{
|
|
|
- BUSINESS_TYPE("0","理货员"),
|
|
|
- DISINFECT_TYPE("1","消杀"),
|
|
|
- TAKE_TYPE("2","装卸"),
|
|
|
- HESUAN_TYPE("3","核酸"),
|
|
|
- ;
|
|
|
- private String type;
|
|
|
- private String desc;
|
|
|
- public static String getDesc(String type){
|
|
|
- return Arrays.stream(CustomerEnum.values()).filter(customerEnum -> customerEnum.getType().equals(type))
|
|
|
- .findFirst().orElseThrow(()->new BusinessException("不存在")).getDesc();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ // ---------- 模块常量 ----------
|
|
|
+ /**
|
|
|
+ * 序列化版本id
|
|
|
+ */
|
|
|
+ private static final long serialVersionUID = 1L;
|
|
|
+ /**
|
|
|
+ * 此模块对应的表名
|
|
|
+ */
|
|
|
+ public static final String TABLE_NAME = "tb_costomer";
|
|
|
+ /**
|
|
|
+ * 此模块对应的权限码
|
|
|
+ */
|
|
|
+ public static final String PERMISSION_CODE = "tb-costomer";
|
|
|
+ public static final String PARTNER_PERMISSION_CODE = "tb-partner";
|
|
|
+ public static final String PERMISSION_INFO = "tb-costomer-maintain";
|
|
|
+
|
|
|
+ // ---------- 表中字段 ----------
|
|
|
+ /**
|
|
|
+ * 主键
|
|
|
+ */
|
|
|
+ private String id;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 名称
|
|
|
+ */
|
|
|
+ private String name;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 联系号码
|
|
|
+ */
|
|
|
+ private String phone;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 负责人
|
|
|
+ */
|
|
|
+ private String dutyPeople;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 地址id
|
|
|
+ */
|
|
|
+ private String addressIds;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 地址
|
|
|
+ */
|
|
|
+ private String addressStr;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 营业执照
|
|
|
+ */
|
|
|
+ private String businessLicence;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 状态(0=否,1=是)
|
|
|
+ */
|
|
|
+ private Integer status;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 创建时间
|
|
|
+ */
|
|
|
+ private Date creareTime = null;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 审核状态(1=未审核,2审核通过,3审核不通过)
|
|
|
+ */
|
|
|
+ private Integer judgeStatus = 1;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 审核时间
|
|
|
+ */
|
|
|
+ private Date judgeTime = null;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 审核意见
|
|
|
+ */
|
|
|
+ private String judgeContent;
|
|
|
+ /**
|
|
|
+ * 结账方式(1=现结,2=月结)[j]
|
|
|
+ */
|
|
|
+ private int payType;
|
|
|
+ /**
|
|
|
+ * 类型0、理货员;1、消杀;2、装卸
|
|
|
+ */
|
|
|
+ private String type = "0";
|
|
|
+
|
|
|
+ @TableField(exist = false)
|
|
|
+ private String typeDes;
|
|
|
+
|
|
|
+ public String getTypeDes() {
|
|
|
+ String type = this.type;
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
+ StrUtil.splitTrim(type, ",")
|
|
|
+ .forEach(t -> {
|
|
|
+ sb.append(CustomerEnum.getDesc(t)).append("、");
|
|
|
+ });
|
|
|
+ return sb.substring(0, sb.lastIndexOf("、"));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Getter
|
|
|
+ @AllArgsConstructor
|
|
|
+ public static enum CustomerEnum {
|
|
|
+ BUSINESS_TYPE("0", "理货员"),
|
|
|
+ DISINFECT_TYPE("1", "消杀"),
|
|
|
+ TAKE_TYPE("2", "装卸"),
|
|
|
+ HESUAN_TYPE("3", "核酸"),
|
|
|
+ ;
|
|
|
+ private String type;
|
|
|
+ private String desc;
|
|
|
+
|
|
|
+ public static String getDesc(String type) {
|
|
|
+ return Arrays.stream(CustomerEnum.values()).filter(customerEnum -> customerEnum.getType().equals(type))
|
|
|
+ .findFirst().orElseThrow(() -> new BusinessException("不存在")).getDesc();
|
|
|
+ }
|
|
|
+
|
|
|
+ public static List<Map<String, String>> getList() {
|
|
|
+ List<Map<String, String>> list = new ArrayList<>();
|
|
|
+ for (CustomerEnum customerEnum : CustomerEnum.values()) {
|
|
|
+ if (customerEnum.getType().equals("0")) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("id", customerEnum.getType());
|
|
|
+ map.put("name", customerEnum.getDesc());
|
|
|
+ list.add(map);
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|