Bladeren bron

公司的业务

姜永辉 2 jaren geleden
bovenliggende
commit
f4a34bf104

+ 15 - 0
src/main/java/com/dk/oauth/controller/CompanyController.java

@@ -1,10 +1,15 @@
 package com.dk.oauth.controller;
 
+import com.dk.common.response.ResponseResultVO;
+import com.dk.oauth.entity.Company;
 import com.dk.oauth.service.ICompanyService;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -22,4 +27,14 @@ public class CompanyController {
     private ICompanyService companyService;
 
 
+    /**
+     * @desc   : 注册商户
+     * @author : admin
+     * @date   : 2024/2/1 14:55
+     */
+    @ApiOperation( value = "注册商户", notes = "注册商户" )
+    @PostMapping({"register_company"})
+    public ResponseResultVO<?> registerCompany(@RequestBody Company company) {
+        return companyService.registerCompany(company);
+    }
 }

+ 39 - 3
src/main/java/com/dk/oauth/entity/Company.java

@@ -2,6 +2,7 @@ package com.dk.oauth.entity;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.*;
+
 import java.io.Serializable;
 
 import com.dk.common.infrastructure.annotaiton.ExportTitle;
@@ -20,7 +21,7 @@ import java.util.List;
 import java.time.LocalDateTime;
 
 /**
- *  企业
+ * 企业
  */
 @Data
 @AllArgsConstructor
@@ -28,8 +29,8 @@ import java.time.LocalDateTime;
 @EqualsAndHashCode(callSuper = true)
 @Accessors(chain = true)
 @ExportTitle("企业")
-@TableName(value = "t_a_company",schema = "dkic_a",autoResultMap = true)
-@ApiModel(value="实体类:企业", description="表名:t_a_company")
+@TableName(value = "t_a_company", schema = "dkic_a", autoResultMap = true)
+@ApiModel(value = "实体类:企业", description = "表名:t_a_company")
 public class Company extends PageInfo<Company> implements Serializable {
 
     /*
@@ -200,6 +201,41 @@ public class Company extends PageInfo<Company> implements Serializable {
     @TableField(typeHandler = UuidTypeHandler.class)
     private String owner;
 
+    /**
+     * 负责人
+     */
+    @Excel(name = "负责人")
+    @ApiModelProperty(value = "负责人")
+    private String cpManager;
+
+    /**
+     * 负责人联系电话
+     */
+    @Excel(name = "负责人联系电话")
+    @ApiModelProperty(value = "负责人联系电话")
+    private String cpPhone;
+
+
+    /**
+     * 公司规模
+     */
+    @Excel(name = "公司规模")
+    @ApiModelProperty(value = "公司规模")
+    private String cpSize;
+
+    /**
+     * 门店规模
+     */
+    @Excel(name = "门店规模")
+    @ApiModelProperty(value = "门店规模")
+    private String shopSize;
+    /**
+     * 反馈
+     */
+    @Excel(name = "反馈")
+    @ApiModelProperty(value = "反馈")
+    private String feedback;
+
 
     /*
      * 相关属性

+ 8 - 0
src/main/java/com/dk/oauth/service/ICompanyService.java

@@ -1,8 +1,16 @@
 package com.dk.oauth.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.dk.common.response.ResponseResultVO;
 import com.dk.oauth.entity.Company;
 
+/**
+ * 注册商户接口
+ *
+ * @author admin
+ * @since 2023-07-01 09:41:05
+ */
 public interface ICompanyService  extends IService<Company> {
 
+    ResponseResultVO registerCompany(Company company);
 }

+ 5 - 1
src/main/java/com/dk/oauth/service/impl/CompanyServiceImpl.java

@@ -1,6 +1,7 @@
 package com.dk.oauth.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.dk.common.response.ResponseResultVO;
 import com.dk.oauth.entity.Company;
 import com.dk.oauth.mapper.CompanyMapper;
 import com.dk.oauth.service.ICompanyService;
@@ -15,5 +16,8 @@ import org.springframework.stereotype.Service;
 @Service("companyService")
 public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> implements ICompanyService {
 
-
+    @Override
+    public ResponseResultVO registerCompany(Company company) {
+        return null;
+    }
 }

+ 40 - 4
src/main/resources/mapper/CompanyMapper.xml

@@ -6,7 +6,9 @@
     <!-- 通用查询列 -->
     <sql id="Base_Column_List">
         cp_id
-        , cp_code, cp_name, svc_code, opening_date, grade_code, end_date, max_staff_num, cur_staff_num, flg_valid, remarks, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user, owner
+        , cp_code, cp_name, svc_code, opening_date, grade_code, end_date, max_staff_num, cur_staff_num, flg_valid,
+        remarks, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user,
+        owner,cp_manager,cp_phone,cp_size,shop_size,feedback
     </sql>
 
     <!-- 通用查询映射结果 -->
@@ -30,6 +32,12 @@
         <result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
         <result column="op_db_user" property="opDbUser"/>
         <result column="owner" property="owner" typeHandler="UuidTypeHandler"/>
+        <result column="cp_manager" property="cpManager"/>
+        <result column="cp_phone" property="cpPhone"/>
+        <result column="cp_size" property="cpSize"/>
+        <result column="shop_size" property="shopSize"/>
+        <result column="feedback" property="feedback"/>
+
     </resultMap>
 
     <!-- 通用条件列 -->
@@ -103,6 +111,34 @@
           and flg_valid
     </select>
 
+    <insert id="insert">
+        insert into dkic_a.t_a_company
+        (cp_name,
+         svc_code,
+         grade_code,
+         max_staff_num,
+         cur_staff_num,
+         owner,
+         cp_manager,
+         cp_phone,
+         cp_size,
+         shop_size,
+         feedback)
+        values (#{cpName},
+                #{svcCode},
+                #{gradeCode},
+                #{maxStaffNum},
+                #{curStaffNum},
+                #{owner}::uuid,
+                #{cpManager},
+                #{cpPhone},
+                #{cpSize},
+                #{shopSize},
+                #{feedback}
+                )
+
+    </insert>
+
     <sql id="idsForeach">
         <!-- 根据主键cpId批量操作 -->
         WHERE cp_id in
@@ -115,7 +151,7 @@
     <select id="selectByCond" resultMap="BaseResultMap">
         SELECT
         <include refid="Base_Column_List"/>
-        FROM t_a_company
+        FROM dkic_a.t_a_company
         <include refid="Condition"/>
         <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
             limit #{end} offset #{start}
@@ -126,13 +162,13 @@
     <select id="countByCond" resultType="Long">
         SELECT
         count(1)
-        FROM t_a_company
+        FROM dkic_a.t_a_company
         <include refid="Condition"/>
     </select>
 
 
     <insert id="insertBatch">
-        insert into t_a_company
+        insert into dkic_a.t_a_company
         (
         <trim suffixOverrides=",">
             cp_code,