Pārlūkot izejas kodu

fix:招商代理

wrj 9 mēneši atpakaļ
vecāks
revīzija
2338da421f

+ 95 - 0
nightFragrance-admin/src/main/java/com/ylx/web/controller/massage/BusinessDevelopmentController.java

@@ -0,0 +1,95 @@
+package com.ylx.web.controller.massage;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ylx.common.core.controller.BaseController;
+import com.ylx.massage.domain.BusinessDevelopment;
+import com.ylx.massage.service.BusinessDevelopmentService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
+import com.ylx.common.core.domain.R;
+
+import javax.annotation.Resource;
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 招商代理(BusinessDevelopment)表控制层
+ *
+ * @author makejava
+ * @since 2024-07-29 16:42:47
+ */
+@RestController
+@Api(tags = {"招商代理(BusinessDevelopment)表控制层"})
+@RequestMapping("businessDevelopment")
+public class BusinessDevelopmentController extends BaseController {
+    /**
+     * 服务对象
+     */
+    @Resource
+    private BusinessDevelopmentService businessDevelopmentService;
+
+    /**
+     * 分页查询所有数据
+     *
+     * @param page                分页对象
+     * @param businessDevelopment 查询实体
+     * @return 所有数据
+     */
+    @GetMapping("selectAll")
+    @ApiOperation("分页查询所有数据")
+    public R selectAll(Page<BusinessDevelopment> page, BusinessDevelopment businessDevelopment) {
+        return R.ok(this.businessDevelopmentService.page(page, new QueryWrapper<>(businessDevelopment)));
+    }
+
+    /**
+     * 通过主键查询单条数据
+     *
+     * @param id 主键
+     * @return 单条数据
+     */
+    @GetMapping("{id}")
+    @ApiOperation("通过主键查询单条数据")
+    public R selectOne(@PathVariable Serializable id) {
+        return R.ok(this.businessDevelopmentService.getById(id));
+    }
+
+    /**
+     * 新增数据
+     *
+     * @param businessDevelopment 实体对象
+     * @return 新增结果
+     */
+    @PostMapping("add")
+    @ApiOperation("新增数据")
+    public R insert(@RequestBody BusinessDevelopment businessDevelopment) {
+        return R.ok(this.businessDevelopmentService.save(businessDevelopment));
+    }
+
+    /**
+     * 修改数据
+     *
+     * @param businessDevelopment 实体对象
+     * @return 修改结果
+     */
+    @PostMapping("update")
+    @ApiOperation("修改数据")
+    public R update(@RequestBody BusinessDevelopment businessDevelopment) {
+        return R.ok(this.businessDevelopmentService.updateById(businessDevelopment));
+    }
+
+    /**
+     * 删除数据
+     *
+     * @param idList 主键结合
+     * @return 删除结果
+     */
+    @GetMapping("delete")
+    @ApiOperation("删除数据")
+    public R delete(@RequestParam("idList") List<Long> idList) {
+        return R.ok(this.businessDevelopmentService.removeByIds(idList));
+    }
+}
+

+ 174 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/domain/BusinessDevelopment.java

@@ -0,0 +1,174 @@
+package com.ylx.massage.domain;
+
+
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 招商代理(BusinessDevelopment)表实体类
+ *
+ * @author makejava
+ * @since 2024-07-29 16:42:48
+ */
+@SuppressWarnings("serial")
+public class BusinessDevelopment extends Model<BusinessDevelopment> {
+    //id
+    @ApiModelProperty("id")
+    private String id;
+    //代理城市
+    @ApiModelProperty("代理城市")
+    private String city;
+    //城市资源介绍
+    @ApiModelProperty("城市资源介绍")
+    private String resource;
+    //合伙人姓名
+    @ApiModelProperty("合伙人姓名")
+    private String name;
+    //手机
+    @ApiModelProperty("手机")
+    private String phoneNum;
+    //公司名称
+    @ApiModelProperty("公司名称")
+    private String company;
+    //是否从事过按摩行业(0否 ,1是)
+    @ApiModelProperty("是否从事过按摩行业(0否 ,1是)")
+    private Integer isMassage;
+    //有几年按摩行业管理经验
+    @ApiModelProperty("有几年按摩行业管理经验")
+    private String years;
+    //是否正在经营实体门店(0否, 1是)
+    @ApiModelProperty("是否正在经营实体门店(0否, 1是)")
+    private Integer isEntity;
+
+    //备注
+    @ApiModelProperty("备注")
+    private String remark;
+    //系统创建时间
+    @ApiModelProperty("系统创建时间")
+    private Date createTime;
+    //系统修改时间
+    @ApiModelProperty("系统修改时间")
+    private Date updateTime;
+    //是否删除0否1是
+    @ApiModelProperty("是否删除0否1是")
+    private Integer isDelete;
+
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getCity() {
+        return city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getResource() {
+        return resource;
+    }
+
+    public void setResource(String resource) {
+        this.resource = resource;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getPhoneNum() {
+        return phoneNum;
+    }
+
+    public void setPhoneNum(String phoneNum) {
+        this.phoneNum = phoneNum;
+    }
+
+    public String getCompany() {
+        return company;
+    }
+
+    public void setCompany(String company) {
+        this.company = company;
+    }
+
+    public Integer getIsMassage() {
+        return isMassage;
+    }
+
+    public void setIsMassage(Integer isMassage) {
+        this.isMassage = isMassage;
+    }
+
+    public String getYears() {
+        return years;
+    }
+
+    public void setYears(String years) {
+        this.years = years;
+    }
+
+    public Integer getIsEntity() {
+        return isEntity;
+    }
+
+    public void setIsEntity(Integer isEntity) {
+        this.isEntity = isEntity;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Integer getIsDelete() {
+        return isDelete;
+    }
+
+    public void setIsDelete(Integer isDelete) {
+        this.isDelete = isDelete;
+    }
+
+    /**
+     * 获取主键值
+     *
+     * @return 主键值
+     */
+    @Override
+    public Serializable pkVal() {
+        return this.id;
+    }
+}
+

+ 35 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/mapper/BusinessDevelopmentMapper.java

@@ -0,0 +1,35 @@
+package com.ylx.massage.mapper;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import com.ylx.massage.domain.BusinessDevelopment;
+
+/**
+ * 招商代理(BusinessDevelopment)表数据库访问层
+ *
+ * @author makejava
+ * @since 2024-07-29 16:42:48
+ */
+public interface BusinessDevelopmentMapper extends BaseMapper<BusinessDevelopment> {
+
+    /**
+     * 批量新增数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<BusinessDevelopment> 实例对象列表
+     * @return 影响行数
+     */
+    int insertBatch(@Param("entities") List<BusinessDevelopment> entities);
+
+    /**
+     * 批量新增或按主键更新数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<BusinessDevelopment> 实例对象列表
+     * @return 影响行数
+     * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
+     */
+    int insertOrUpdateBatch(@Param("entities") List<BusinessDevelopment> entities);
+
+}
+

+ 15 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/service/BusinessDevelopmentService.java

@@ -0,0 +1,15 @@
+package com.ylx.massage.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ylx.massage.domain.BusinessDevelopment;
+
+/**
+ * 招商代理(BusinessDevelopment)表服务接口
+ *
+ * @author makejava
+ * @since 2024-07-29 16:42:48
+ */
+public interface BusinessDevelopmentService extends IService<BusinessDevelopment> {
+
+}
+

+ 19 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/service/impl/BusinessDevelopmentServiceImpl.java

@@ -0,0 +1,19 @@
+package com.ylx.massage.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ylx.massage.mapper.BusinessDevelopmentMapper;
+import com.ylx.massage.domain.BusinessDevelopment;
+import com.ylx.massage.service.BusinessDevelopmentService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 招商代理(BusinessDevelopment)表服务实现类
+ *
+ * @author makejava
+ * @since 2024-07-29 16:42:48
+ */
+@Service("businessDevelopmentService")
+public class BusinessDevelopmentServiceImpl extends ServiceImpl<BusinessDevelopmentMapper, BusinessDevelopment> implements BusinessDevelopmentService {
+
+}
+

+ 0 - 1
nightFragrance-massage/src/main/java/com/ylx/massage/utils/WeChatUtil.java

@@ -265,7 +265,6 @@ public class WeChatUtil {
         Map<?, ?> map = JSONObject.parseObject(result, Map.class);
         log.info("notification-消息通知返回参数:{}", map);
         return map;
-
     }
 
 

+ 45 - 0
nightFragrance-massage/src/main/resources/mapper/massage/BusinessDevelopmentMapper.xml

@@ -0,0 +1,45 @@
+<?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.ylx.massage.mapper.BusinessDevelopmentMapper">
+
+    <resultMap type="com.ylx.massage.domain.BusinessDevelopment" id="BusinessDevelopmentMap">
+        <result property="id" column="id" jdbcType="VARCHAR"/>
+        <result property="city" column="city" jdbcType="VARCHAR"/>
+        <result property="resource" column="resource" jdbcType="VARCHAR"/>
+        <result property="name" column="name" jdbcType="VARCHAR"/>
+        <result property="phoneNum" column="phone_num" jdbcType="VARCHAR"/>
+        <result property="company" column="company" jdbcType="VARCHAR"/>
+        <result property="isMassage" column="is_massage" jdbcType="INTEGER"/>
+        <result property="years" column="years" jdbcType="VARCHAR"/>
+        <result property="isEntity" column="is_entity" jdbcType="INTEGER"/>
+        <result property="remark" column="remark" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+        <result property="isDelete" column="is_delete" jdbcType="INTEGER"/>
+    </resultMap>
+
+    <!-- 批量插入 -->
+    <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
+        insert into
+        ry-vue.business_development(cityresourcenamephone_numcompanyis_massageyearsis_entityremarkcreate_timeupdate_timeis_delete)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.city}#{entity.resource}#{entity.name}#{entity.phoneNum}#{entity.company}#{entity.isMassage}#{entity.years}#{entity.isEntity}#{entity.remark}#{entity.createTime}#{entity.updateTime}#{entity.isDelete})
+        </foreach>
+    </insert>
+    <!-- 批量插入或按主键更新 -->
+    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
+        insert into
+        ry-vue.business_development(cityresourcenamephone_numcompanyis_massageyearsis_entityremarkcreate_timeupdate_timeis_delete)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.city}#{entity.resource}#{entity.name}#{entity.phoneNum}#{entity.company}#{entity.isMassage}#{entity.years}#{entity.isEntity}#{entity.remark}#{entity.createTime}#{entity.updateTime}#{entity.isDelete})
+        </foreach>
+        on duplicate key update
+        city = values(city) resource = values(resource) name = values(name) phone_num = values(phone_num) company =
+        values(company) is_massage = values(is_massage) years = values(years) is_entity = values(is_entity) remark =
+        values(remark) create_time = values(create_time) update_time = values(update_time) is_delete = values(is_delete)
+    </insert>
+
+</mapper>
+