Guo1B0 před 1 rokem
rodič
revize
bbbf37b520
17 změnil soubory, kde provedl 393 přidání a 6 odebrání
  1. 20 5
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/BusinessOpportunityController.java
  2. 21 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/BusinessProductController.java
  3. 21 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/StageController.java
  4. 2 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/BusinessOpportunity.java
  5. 73 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/BusinessProduct.java
  6. 60 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Stage.java
  7. 16 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/BusinessProductMapper.java
  8. 9 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/ClueMapper.java
  9. 16 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/StageMapper.java
  10. 16 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/BusinessProductService.java
  11. 22 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/StageService.java
  12. 20 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/BusinessProductServiceImpl.java
  13. 1 1
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ClueServiceImpl.java
  14. 46 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/StageServiceImpl.java
  15. 10 0
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/BusinessOpportunityMapper.xml
  16. 21 0
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/BusinessProductMapper.xml
  17. 19 0
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/StageMapper.xml

+ 20 - 5
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/BusinessOpportunityController.java

@@ -4,10 +4,12 @@ package com.management.platform.controller;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.management.platform.entity.BusinessOpportunity;
 import com.management.platform.entity.Clue;
+import com.management.platform.entity.Stage;
 import com.management.platform.entity.User;
 import com.management.platform.mapper.BusinessOpportunityMapper;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.BusinessOpportunityService;
+import com.management.platform.service.StageService;
 import com.management.platform.service.SysFunctionService;
 import com.management.platform.util.HttpRespMsg;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -39,6 +41,8 @@ public class BusinessOpportunityController {
     private UserMapper userMapper;
     @Resource
     private SysFunctionService sysFunctionService;
+    @Resource
+    private StageService stageService;
 
     @Resource
     private BusinessOpportunityService bOservice;
@@ -47,7 +51,7 @@ public class BusinessOpportunityController {
 
 
     @RequestMapping("insertAndUpdate")
-    public HttpRespMsg insertAndUpdate(@RequestBody BusinessOpportunity bo, HttpServletRequest request) {
+    public HttpRespMsg insertAndUpdate( BusinessOpportunity bo, HttpServletRequest request) {
         User user = userMapper.selectById(request.getHeader("Token"));
         HttpRespMsg msg = new HttpRespMsg();
         if (bo.getId() == null){
@@ -82,7 +86,7 @@ public class BusinessOpportunityController {
         return msg;
     }
     @RequestMapping("list")
-    public HttpRespMsg list(@RequestBody BusinessOpportunity bo, HttpServletRequest request) {
+    public HttpRespMsg list(BusinessOpportunity bo, HttpServletRequest request) {
         HashMap<Object, Object> r = new HashMap<>();
         User user = userMapper.selectById(request.getHeader("Token"));
         bo.setIsDelete(0);
@@ -91,14 +95,15 @@ public class BusinessOpportunityController {
         boolean isAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部商机");
         boolean isNotAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看负责部门商机");
         int i = 0;
-        if (!isAll) {
+        if (isAll) {
             list = bOservice.getAll(bo);
             i = bOservice.getTotal(bo);
-        } else if (!isNotAll) {
+        } else if (isNotAll) {
             list = bOservice.getAll1(bo, user);
             i = bOservice.getTotal1(bo, user);
         } else {
             list = bOservice.getAll2(bo, user);
+            i = bOservice.getTotal2(bo, user);
         }
         r.put("data", list);
         r.put("total",i);
@@ -108,7 +113,7 @@ public class BusinessOpportunityController {
 
     }
     @RequestMapping("deleterList")
-    public HttpRespMsg deleterList(@RequestBody BusinessOpportunity bo, HttpServletRequest request) {
+    public HttpRespMsg deleterList(BusinessOpportunity bo, HttpServletRequest request) {
         HashMap<Object, Object> r = new HashMap<>();
         User user = userMapper.selectById(request.getHeader("Token"));
         bo.setIsDelete(1);
@@ -126,6 +131,7 @@ public class BusinessOpportunityController {
             i = bOservice.getTotal1(bo, user);
         } else {
             list = bOservice.getAll2(bo, user);
+            i = bOservice.getTotal2(bo, user);
         }
         r.put("data", list);
         r.put("total",i);
@@ -133,6 +139,15 @@ public class BusinessOpportunityController {
         msg.setData(r);
         return msg;
     }
+    @RequestMapping("insertStage")
+    public HttpRespMsg insertStage(List<Stage> stages, HttpServletRequest request) {
+//        request
+        return stageService.changeStage(stages);
+    }    @RequestMapping("getStage")
+    public HttpRespMsg Stage() {
+//        request
+        return stageService.getStage();
+    }
     private BusinessOpportunity setNull(BusinessOpportunity bo) {
         if (bo.getPlate1() == "") {
             bo.setPlate1(null);

+ 21 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/BusinessProductController.java

@@ -0,0 +1,21 @@
+package com.management.platform.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-29
+ */
+@RestController
+@RequestMapping("/business-product")
+public class BusinessProductController {
+
+}
+

+ 21 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/StageController.java

@@ -0,0 +1,21 @@
+package com.management.platform.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-29
+ */
+@RestController
+@RequestMapping("/stage")
+public class StageController {
+
+}
+

+ 2 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/BusinessOpportunity.java

@@ -47,6 +47,8 @@ public class BusinessOpportunity extends Model<BusinessOpportunity> {
      */
     @TableField("contacts_id")
     private Integer contactsId;
+    @TableField(exist = false)
+    private Integer contactsName;
 
     /**
      * 客户id

+ 73 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/BusinessProduct.java

@@ -0,0 +1,73 @@
+package com.management.platform.entity;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-29
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class BusinessProduct extends Model<BusinessProduct> {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 产品id
+     */
+    @TableField("product_id")
+    private Integer productId;
+
+    /**
+     * 商机id
+     */
+    @TableField("business_id")
+    private Integer businessId;
+
+    /**
+     * 售价
+     */
+    @TableField("selling_price")
+    private BigDecimal sellingPrice;
+
+    /**
+     * 数量
+     */
+    @TableField("count")
+    private Integer count;
+
+    /**
+     * 折扣
+     */
+    @TableField("discount")
+    private BigDecimal discount;
+
+    /**
+     * 合计
+     */
+    @TableField("total")
+    private BigDecimal total;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 60 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Stage.java

@@ -0,0 +1,60 @@
+package com.management.platform.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-29
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class Stage extends Model<Stage> {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 阶段名称
+     */
+    @TableField("name")
+    private String name;
+
+    /**
+     * 进度
+     */
+    @TableField("plan")
+    private String plan;
+
+    /**
+     * 顺序
+     */
+    @TableField("seq")
+    private Integer seq;
+
+    /**
+     * 是否删除
+     */
+    @TableField("is_delete")
+    private String isDelete;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 16 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/BusinessProductMapper.java

@@ -0,0 +1,16 @@
+package com.management.platform.mapper;
+
+import com.management.platform.entity.BusinessProduct;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-29
+ */
+public interface BusinessProductMapper extends BaseMapper<BusinessProduct> {
+
+}

+ 9 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/ClueMapper.java

@@ -3,6 +3,7 @@ package com.management.platform.mapper;
 import com.management.platform.entity.Clue;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
 
 import java.util.List;
 
@@ -25,4 +26,12 @@ public interface ClueMapper extends BaseMapper<Clue> {
 
     int getTotal1(@Param("clue") Clue clue ,@Param("userId") String userId);
     int getTotal2(@Param("clue") Clue clue ,@Param("userId") String userId);
+
+    @Select("select *," +
+            "(select `name` from sys_dict where code = 'ClueSources' and id =  clue_source_id) clueSourceValue," +
+            "(select `name` from sys_dict where code = 'CustomIndustry' and id =  customer_industry_id) customerIndustryValue," +
+            "(select `name` from sys_dict where code = 'CustomLevel' and id =  customer_level_id) customerLevelValue ," +
+            "(select `name` from user where id = incharger_id ) inchargerName" +
+            " from clue where id = #{id}")
+    Clue selectById2Info(Integer id);
 }

+ 16 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/StageMapper.java

@@ -0,0 +1,16 @@
+package com.management.platform.mapper;
+
+import com.management.platform.entity.Stage;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-29
+ */
+public interface StageMapper extends BaseMapper<Stage> {
+
+}

+ 16 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/BusinessProductService.java

@@ -0,0 +1,16 @@
+package com.management.platform.service;
+
+import com.management.platform.entity.BusinessProduct;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-29
+ */
+public interface BusinessProductService extends IService<BusinessProduct> {
+
+}

+ 22 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/StageService.java

@@ -0,0 +1,22 @@
+package com.management.platform.service;
+
+import com.management.platform.entity.Stage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.management.platform.util.HttpRespMsg;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-29
+ */
+public interface StageService extends IService<Stage> {
+
+    HttpRespMsg changeStage(List<Stage> stages);
+
+    HttpRespMsg getStage();
+}

+ 20 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/BusinessProductServiceImpl.java

@@ -0,0 +1,20 @@
+package com.management.platform.service.impl;
+
+import com.management.platform.entity.BusinessProduct;
+import com.management.platform.mapper.BusinessProductMapper;
+import com.management.platform.service.BusinessProductService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-29
+ */
+@Service
+public class BusinessProductServiceImpl extends ServiceImpl<BusinessProductMapper, BusinessProduct> implements BusinessProductService {
+
+}

+ 1 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ClueServiceImpl.java

@@ -165,7 +165,7 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
 
     @Override
     public Clue getInfo(Clue clue) {
-        Clue clue1 = clueMapper.selectById(clue.getId());
+        Clue clue1 = clueMapper.selectById2Info(clue.getId());
         clue1.setClueLogList(actionLogMapper.selectByInfoList(clue1));
         clue1.setFiles(uploadFileMapper.selectByInfoList(clue1));
         List<Task> tasks = taskMapper.selectList(new QueryWrapper<Task>().in("clue_id", clue.getId()));

+ 46 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/StageServiceImpl.java

@@ -0,0 +1,46 @@
+package com.management.platform.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.management.platform.entity.Stage;
+import com.management.platform.mapper.StageMapper;
+import com.management.platform.service.StageService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.management.platform.util.HttpRespMsg;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-29
+ */
+@Service
+public class StageServiceImpl extends ServiceImpl<StageMapper, Stage> implements StageService {
+
+    @Autowired
+    private StageMapper stageMapper;
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public HttpRespMsg changeStage(List<Stage> stages) {
+        HttpRespMsg msg = new HttpRespMsg();
+        stageMapper.delete(new QueryWrapper<>());
+        for (Stage stage : stages) {
+            stageMapper.insert(stage);
+        }
+        msg.setMsg("操作成功");
+        return msg;
+    }
+
+    @Override
+    public HttpRespMsg getStage() {
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.setData(stageMapper.selectList(new QueryWrapper<Stage>().orderBy(true, false, "seq")));
+        return msg;
+    }
+}

+ 10 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/BusinessOpportunityMapper.xml

@@ -30,5 +30,15 @@
     <sql id="Base_Column_List">
         id, company_id, name, contacts_id, customer_id, product_id, amount_of_money, expected_transaction_date, stage, create_time, edit_time, creator_id, incharger_id, remark, is_delete, plate1, plate2, plate3, plate4, plate5
     </sql>
+    <select id="selectAllList" resultType="com.management.platform.entity.BusinessOpportunity">
+        select
+        <include refid="Base_Column_List"></include>,
+        (select custom_name from custom where id = customer_id) customerName,
+        (select `name` from contacts where id = contacts_id) contactsName,
+        (SELECT sum(total) from business_product WHERE business_id = id)
+        from business_opportunity
+        where company_id = #{companyId}
+        and
+    </select>
 
 </mapper>

+ 21 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/BusinessProductMapper.xml

@@ -0,0 +1,21 @@
+<?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.management.platform.mapper.BusinessProductMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.management.platform.entity.BusinessProduct">
+        <id column="id" property="id" />
+        <result column="product_id" property="productId" />
+        <result column="business_id" property="businessId" />
+        <result column="selling price" property="selling price" />
+        <result column="count" property="count" />
+        <result column="discount" property="discount" />
+        <result column="total" property="total" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, product_id, business_id, selling price, count, discount, total
+    </sql>
+
+</mapper>

+ 19 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/StageMapper.xml

@@ -0,0 +1,19 @@
+<?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.management.platform.mapper.StageMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.management.platform.entity.Stage">
+        <id column="id" property="id" />
+        <result column="name" property="name" />
+        <result column="plan" property="plan" />
+        <result column="seq" property="seq" />
+        <result column="is_delete" property="isDelete" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, name, plan, seq, is_delete
+    </sql>
+
+</mapper>