Parcourir la source

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

QuYueTing il y a 1 mois
Parent
commit
a035bc1ca8
13 fichiers modifiés avec 1062 ajouts et 565 suppressions
  1. 5 0
      fhKeeper/formulahousekeeper/management-crm/pom.xml
  2. 15 1
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/CompanyController.java
  3. 20 2
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/SysFormController.java
  4. 6 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Company.java
  5. 54 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Task.java
  6. 4 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/dto/TaskDto.java
  7. 6 3
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/vo/TasKVo.java
  8. 13 17
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/SysFormServiceImpl.java
  9. 874 539
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java
  10. 52 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/VisitPlanServiceImpl.java
  11. 1 1
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/util/CodeGenerator.java
  12. 3 1
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/CompanyMapper.xml
  13. 9 1
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/TaskMapper.xml

+ 5 - 0
fhKeeper/formulahousekeeper/management-crm/pom.xml

@@ -194,6 +194,11 @@
             <artifactId>spring-boot-devtools</artifactId>
             <version>2.0.1.RELEASE</version>
         </dependency>
+         <dependency>
+             <groupId>org.apache.velocity</groupId>
+             <artifactId>velocity-engine-core</artifactId>
+             <version>2.0</version>
+         </dependency>
 
     </dependencies>
 

+ 15 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/CompanyController.java

@@ -2,6 +2,7 @@ package com.management.platform.controller;
 
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.management.platform.constant.Constant;
 import com.management.platform.entity.*;
 import com.management.platform.mapper.*;
@@ -17,7 +18,6 @@ import org.springframework.web.bind.annotation.RestController;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 
 /**
@@ -49,6 +49,9 @@ public class CompanyController {
     @Resource
     private ExpenseMainTypeService expenseMainTypeService;
 
+    @Resource
+    private SysFormMapper sysFormMapper;
+
     @RequestMapping("/testTimeout")
     public HttpRespMsg testTimeout(){
         HttpRespMsg msg = new HttpRespMsg();
@@ -224,5 +227,16 @@ public class CompanyController {
         return msg;
     }
 
+    @RequestMapping("/editCompanyToSimpleAndSysFormConfig")
+    public HttpRespMsg editCompanyToSimpleAndSysFormConfig(Integer simpleMode ,String config,HttpServletRequest request){
+        HttpRespMsg msg = new HttpRespMsg();
+        String token = request.getHeader("token");
+        User user = userMapper.selectById(token);
+        Company company = companyMapper.selectById(user.getCompanyId());
+        companyMapper.update(null,new UpdateWrapper<Company>().set("is_simple",simpleMode).eq("id",company.getId()));
+        sysFormMapper.update(null,new UpdateWrapper<SysForm>().set("config",config).eq("id",company.getId()).eq("code","tasks"));
+        return msg;
+    }
+
 }
 

+ 20 - 2
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/SysFormController.java

@@ -8,9 +8,11 @@ import com.management.platform.mapper.CompanyMapper;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.SysFormService;
 import com.management.platform.util.HttpRespMsg;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
-import javax.annotation.Priority;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.util.List;
@@ -73,6 +75,22 @@ public class SysFormController {
                 }
             }
         }
+        if (!sysFormList.isEmpty()&&company.getIsSimple()==1){
+            String customerNameKey = "客户名称";
+            String contactNameKey = "联系人姓名";
+            String companyPhoneKey = "公司电话";
+            String contactPhoneKey = "联系人电话";
+
+            sysFormList.stream()
+                    .filter(sysForm -> "Customer".equals(sysForm.getCode()))
+                    .forEach(sysForm -> {
+                        String config = sysForm.getConfig();
+                        String result = config
+                                .replace(customerNameKey, contactNameKey)
+                                .replace(companyPhoneKey, contactPhoneKey);
+                        sysForm.setConfig(result);
+                    });
+        }
         msg.setData(sysFormList);
         return msg;
     }

+ 6 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Company.java

@@ -157,6 +157,12 @@ public class Company extends Model<Company> {
     @TableField("version_control")
     private Integer versionControl;
 
+    /**
+     * 默认0, 1表示简易模式
+     */
+    @TableField("is_simple")
+    private Integer isSimple;
+
     @Override
     protected Serializable pkVal() {
         return this.id;

+ 54 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Task.java

@@ -11,6 +11,7 @@ import lombok.experimental.Accessors;
 import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.util.Date;
@@ -268,6 +269,59 @@ public class Task extends Model<Task> {
     @TableField(exist = false)
     private List<String> executorNames;
 
+    /**
+     * 客户类型 0居民住家/ 1商业区/ 2其他类型
+     */
+    @TableField("custom_type")
+    private Integer customType;
+
+    /**
+     * 预约工作内容
+     */
+    @TableField("appoint_content")
+    private String appointContent;
+
+    /**
+     * 预约金额
+     */
+    @TableField("appoint_money")
+    private BigDecimal appointMoney;
+
+    /**
+     * 实际工作内容
+     */
+    @TableField("really_content")
+    private String reallyContent;
+
+    /**
+     * 实际金额
+     */
+    @TableField("really_money")
+    private BigDecimal reallyMoney;
+
+    /**
+     * 付款状态 0未付款 ,1付款
+     */
+    @TableField("pay_type")
+    private Integer payType;
+
+    /**
+     * 付款方式 0Paynow, 1Cash, 2Wechat
+     */
+    @TableField("pay_way")
+    private Integer payWay;
+
+    /**
+     * 用户反馈
+     */
+    @TableField("user_back")
+    private String userBack;
+
+    /**
+     * 备注
+     */
+    @TableField("remark")
+    private String remark;
 
     @Override
     protected Serializable pkVal() {

+ 4 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/dto/TaskDto.java

@@ -27,6 +27,10 @@ public class TaskDto extends Task {
     private String clueName;
     private String phone;
 
+    private String customTypeName;//客户类型名称
+    private String payTypeName;//付款状态
+    private String payWayName;//付款方式名称
+
     private Integer departmentId;
     private String departmentIdByMyselfOrNull;
 

+ 6 - 3
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/vo/TasKVo.java

@@ -1,13 +1,12 @@
 package com.management.platform.entity.vo;
 
-import com.management.platform.entity.*;
+import com.management.platform.entity.Task;
+import com.management.platform.entity.TaskLog;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
-import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
 
 @EqualsAndHashCode(callSuper = true)
 @Data
@@ -28,6 +27,10 @@ public class TasKVo extends Task {
     private String contactsName;
     private String contactsPhone;
 
+    private String customTypeName;//客户类型名称
+    private String payTypeName;//付款状态
+    private String payWayName;//付款方式名称
+
 
     private List<String> taskExecutors;
 

+ 13 - 17
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/SysFormServiceImpl.java

@@ -4,35 +4,24 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.management.platform.entity.*;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.management.platform.entity.Company;
+import com.management.platform.entity.SysForm;
 import com.management.platform.mapper.CompanyMapper;
 import com.management.platform.mapper.SysFormMapper;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.SysFormService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.util.ExcelUtil;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.MessageUtils;
-import org.apache.poi.hssf.usermodel.*;
-import org.apache.poi.ss.usermodel.*;
-import org.apache.poi.ss.util.CellRangeAddressList;
-import org.apache.poi.xssf.streaming.SXSSFCell;
-import org.apache.poi.xssf.streaming.SXSSFRow;
-import org.apache.poi.xssf.streaming.SXSSFSheet;
-import org.apache.poi.xssf.streaming.SXSSFWorkbook;
-import org.apache.poi.xssf.usermodel.XSSFColor;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
-import java.io.File;
-import java.io.FileOutputStream;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -69,6 +58,7 @@ public class SysFormServiceImpl extends ServiceImpl<SysFormMapper, SysForm> impl
             msg.setError("当前表单未配置模板,请先完成模板配置");
             return msg;
         }
+
         if (!code.equals("Contract")) {
             String config = sysForm.getConfig();
             JSONObject configOb = JSON.parseObject(config);
@@ -89,7 +79,7 @@ public class SysFormServiceImpl extends ServiceImpl<SysFormMapper, SysForm> impl
                     heads.add(item.getString("label"));
                 }
             }
-            if (code.equals("Business")){
+            if (code.equals("Business")) {
                 for (int i = 0; i < heads.size(); i++) {
                     String s = heads.get(i);
                     if (s.contains("商机")) {
@@ -98,9 +88,15 @@ public class SysFormServiceImpl extends ServiceImpl<SysFormMapper, SysForm> impl
                     }
                 }
             }
-        }else {
-            Collections.addAll(heads,"合同编号","合同名称","合同金额","合同类型","计划开始时间","计划结束时间","部门","自定义字段","备注","是否已回款","回款日期","金额","是否已开票","开票日期","发票种类","税率","税额");
+            if (company.getIsSimple()==1 &&code.equals("Task")){
+                heads.clear();
+                Collections.addAll(heads, "任务名称", "执行人", "开始时间", "截止时间", "客户名称","客户类型", "预约工作内容", "预约金额", "实际工作内容", "实际金额", "用户反馈");
+            }
+        }
+        else {
+            Collections.addAll(heads, "合同编号", "合同名称", "合同金额", "合同类型", "计划开始时间", "计划结束时间", "部门", "自定义字段", "备注", "是否已回款", "回款日期", "金额", "是否已开票", "开票日期", "发票种类", "税率", "税额");
         }
+
         List<List<String>> allList = new ArrayList<>();
         allList.add(heads);
         String title;

Fichier diff supprimé car celui-ci est trop grand
+ 874 - 539
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java


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

@@ -32,6 +32,14 @@ public class VisitPlanServiceImpl extends ServiceImpl<VisitPlanMapper, VisitPlan
 //    @Qualifier(value = "VisitPlanThreadPool")
 //    ThreadPoolTaskExecutor threadPoolTaskExecutor;
 
+    private final static String customTypeName0="居民住家";
+    private final static String customTypeName1="商业区";
+    private final static  String customTypeName2="其他类型";
+
+
+    private final static String payWayName0="Paynow";
+    private final static String payWayName1="Cash";
+    private final static  String payWayName2="Wechat";
 
     @Resource
     private VisitPlanMapper visitPlanMapper;
@@ -402,6 +410,28 @@ public class VisitPlanServiceImpl extends ServiceImpl<VisitPlanMapper, VisitPlan
                     taskDto.setTaskLogs(collect);
                 }
             }
+            if (taskDto.getCustomType()!=null&&taskDto.getCustomType()==0){
+                //0居民住家/ 1商业区/ 2其他类型
+                taskDto.setCustomTypeName(customTypeName0);
+            } else if (taskDto.getCustomType() != null && taskDto.getCustomType() == 1) {
+                taskDto.setCustomTypeName(customTypeName1);
+            }else if (taskDto.getCustomType() != null && taskDto.getCustomType() == 2) {
+                taskDto.setCustomTypeName(customTypeName2);
+            }
+
+            if (taskDto.getPayType()!=null&&taskDto.getPayType()==0){
+                taskDto.setPayTypeName("未付款");
+            } else if (taskDto.getPayType()!=null&&taskDto.getPayType()==1) {
+                taskDto.setPayTypeName("已付款");
+            }
+
+            if (taskDto.getPayWay()!=null&&taskDto.getPayWay()==0){
+                taskDto.setPayWayName(payWayName0);
+            } else if (taskDto.getPayWay() != null && taskDto.getPayWay() == 1) {
+                taskDto.setPayWayName(payWayName1);
+            }else if (taskDto.getPayWay() != null && taskDto.getPayWay() == 2) {
+                taskDto.setPayWayName(payWayName2);
+            }
         }
 
         HashMap<String, Object> map = new HashMap<>();
@@ -483,6 +513,28 @@ public class VisitPlanServiceImpl extends ServiceImpl<VisitPlanMapper, VisitPlan
                     taskDto.setTaskLogs(collect);
                 }
             }
+            if (taskDto.getCustomType()!=null&&taskDto.getCustomType()==0){
+                //0居民住家/ 1商业区/ 2其他类型
+                taskDto.setCustomTypeName(customTypeName0);
+            } else if (taskDto.getCustomType() != null && taskDto.getCustomType() == 1) {
+                taskDto.setCustomTypeName(customTypeName1);
+            }else if (taskDto.getCustomType() != null && taskDto.getCustomType() == 2) {
+                taskDto.setCustomTypeName(customTypeName2);
+            }
+
+            if (taskDto.getPayType()!=null&&taskDto.getPayType()==0){
+                taskDto.setPayTypeName("未付款");
+            } else if (taskDto.getPayType()!=null&&taskDto.getPayType()==1) {
+                taskDto.setPayTypeName("已付款");
+            }
+
+            if (taskDto.getPayWay()!=null&&taskDto.getPayWay()==0){
+                taskDto.setPayWayName(payWayName0);
+            } else if (taskDto.getPayWay() != null && taskDto.getPayWay() == 1) {
+                taskDto.setPayWayName(payWayName1);
+            }else if (taskDto.getPayWay() != null && taskDto.getPayWay() == 2) {
+                taskDto.setPayWayName(payWayName2);
+            }
         }
 
         Map<LocalDate, List<TaskDto>> dailyTasks = new LinkedHashMap<>();

+ 1 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/util/CodeGenerator.java

@@ -92,7 +92,7 @@ public class CodeGenerator {
 
         // 数据源配置
         DataSourceConfig dsc = new DataSourceConfig();
-        dsc.setUrl("jdbc:mysql://47.101.180.183:17089/man_crm?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8");
+        dsc.setUrl("jdbc:mysql://1.94.62.58:17089/man_crm?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8");
 //        dsc.setSchemaName("public");
         dsc.setDriverName("com.mysql.cj.jdbc.Driver");
         dsc.setUsername("root");

+ 3 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/CompanyMapper.xml

@@ -25,11 +25,13 @@
         <result column="reg_from" property="regFrom" />
         <result column="non_project_simple" property="nonProjectSimple" />
         <result column="is_exist_business" property="isExistBusiness" />
+        <result column="version_control" property="versionControl" />
+        <result column="is_simple" property="isSimple" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, company_name, staff_count_max, expiration_date, set_meal, package_worktime, package_project, package_contract, package_oa, package_etimecard, package_expense, package_customer, package_engineering, package_simple, package_finance, package_provider, is_international, create_date, reg_from, non_project_simple, is_exist_business
+        id, company_name, staff_count_max, expiration_date, set_meal, package_worktime, package_project, package_contract, package_oa, package_etimecard, package_expense, package_customer, package_engineering, package_simple, package_finance, package_provider, is_international, create_date, reg_from, non_project_simple, is_exist_business, version_control, is_simple
     </sql>
 
 </mapper>

Fichier diff supprimé car celui-ci est trop grand
+ 9 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/TaskMapper.xml