yusm 3 kuukautta sitten
vanhempi
commit
fac9a4df0c

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

@@ -234,7 +234,7 @@ public class CompanyController {
         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"));
+        sysFormMapper.update(null,new UpdateWrapper<SysForm>().set("config",config).eq("company_id",company.getId()).eq("code","tasks"));
         return msg;
     }
 

+ 26 - 3
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/SysFormController.java

@@ -1,6 +1,8 @@
 package com.management.platform.controller;
 
 
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.management.platform.entity.Company;
 import com.management.platform.entity.SysForm;
@@ -76,8 +78,8 @@ public class SysFormController {
             }
         }
         if (!sysFormList.isEmpty()&&company.getIsSimple()==1){
-            String customerNameKey = "客户名称";
-            String contactNameKey = "联系人姓名";
+//            String customerNameKey = "客户名称";
+//            String contactNameKey = "联系人姓名";
             String companyPhoneKey = "公司电话";
             String contactPhoneKey = "联系人电话";
 
@@ -86,10 +88,31 @@ public class SysFormController {
                     .forEach(sysForm -> {
                         String config = sysForm.getConfig();
                         String result = config
-                                .replace(customerNameKey, contactNameKey)
+//                                .replace(customerNameKey, contactNameKey)
                                 .replace(companyPhoneKey, contactPhoneKey);
                         sysForm.setConfig(result);
                     });
+            for (SysForm sysForm : sysFormList) {
+                if (sysForm.getCode().equals("business")){
+                    String config = sysForm.getConfig();
+                    JSONObject jsonObject = JSONArray.parseObject(config);
+                    JSONArray list = jsonObject.getJSONArray("list");
+                    JSONObject object1 = list.getJSONObject(1);
+                    JSONArray columns = object1.getJSONArray("columns");
+
+                    // 删除下标为 1 的 JSON 对象,确保下标有效
+                    if (columns.size() > 1) {
+                        columns.remove(1);
+                    }
+
+                    // 更新 columns
+                    object1.put("columns", columns);
+                    list.set(1, object1); // 更新 list 中的对象
+                    jsonObject.put("list", list); // 更新 jsonObject 中的 list
+                    sysForm.setConfig(jsonObject.toJSONString()); // 更新 sysForm 的配置
+
+                }
+            }
         }
         msg.setData(sysFormList);
         return msg;

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

@@ -30,6 +30,8 @@ public class TasKVo extends Task {
     private String customTypeName;//客户类型名称
     private String payTypeName;//付款状态
     private String payWayName;//付款方式名称
+    private String companyPhone;
+    private String contactsTel;
 
 
     private List<String> taskExecutors;

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

@@ -250,6 +250,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
         String token = String.valueOf(request.getHeader("Token"));
         User user = userMapper.selectById(token);
         taskDto.setCompanyId(user.getCompanyId());
+        Company company = companyMapper.selectById(user.getCompanyId());
         List<TaskExecutor> taskExecutorList = taskExecutorMapper.selectList(new LambdaQueryWrapper<TaskExecutor>().eq(TaskExecutor::getCompanyId,user.getCompanyId()));
         List<TaskLog> taskLogList = taskLogMapper.selectList(new LambdaQueryWrapper<TaskLog>().eq(TaskLog::getCompanyId,user.getCompanyId()).orderByDesc(TaskLog::getModTime));
         taskDto.setPageIndex((taskDto.getPageIndex()-1)*taskDto.getPageSize());
@@ -287,6 +288,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                     tasKVo.setTaskLogs(collect);
                 }
             }
+            if (company.getIsSimple()==1){
+                if (StringUtils.isNotEmpty(tasKVo.getCompanyPhone())){
+                    tasKVo.setContactsTel(tasKVo.getCompanyPhone());
+                }
+            }
+
 
         }
         List<TasKVo> taskVoTotalList= taskMapper.getPageListTotalTask(taskDto);
@@ -1373,7 +1380,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
         }else {
             dataList.clear();
             List<String> heads = new ArrayList<>();
-            Collections.addAll(heads, "任务名称", "执行人", "开始时间", "截止时间", "客户名称","客户类型", "预约工作内容", "预约金额", "实际工作内容", "实际金额", "用户反馈");
+            Collections.addAll(heads, "任务名称", "执行人", "开始时间", "截止时间", "客户名称","客户类型", "预约工作内容", "预约金额", "实际工作内容", "实际金额","付款状态","用户反馈");
             dataList.add(heads);
             for (TasKVo tasKVo : taskVoList){
                 List<String> item = new ArrayList<>();
@@ -1425,6 +1432,16 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                 item.add(tasKVo.getAppointMoney()==null ? BigDecimal.ZERO.toString() : tasKVo.getAppointMoney().toString());
                 item.add(StringUtils.isEmpty(tasKVo.getReallyContent()) ? "" : tasKVo.getReallyContent());
                 item.add(tasKVo.getReallyMoney()==null ? BigDecimal.ZERO.toString() : tasKVo.getReallyMoney().toString());
+                if (tasKVo.getPayType()!=null){
+                    Integer payType = tasKVo.getPayType();
+                    if (payType==0){
+                        item.add("未付款");
+                    }else if(payType==1) {
+                        item.add("已付款");
+                    }else {
+                        item.add("");
+                    }
+                }else item.add("");
                 item.add(StringUtils.isEmpty(tasKVo.getUserBack()) ? "" : tasKVo.getUserBack());
 
                 dataList.add(item);
@@ -1620,6 +1637,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
     public HttpRespMsg pageTasksByPin(TaskDto taskDto, HttpServletRequest request) {
         String token = String.valueOf(request.getHeader("Token"));
         User user = userMapper.selectById(token);
+        Company company = companyMapper.selectById(user.getCompanyId());
         taskDto.setCompanyId(user.getCompanyId());
         List<TaskExecutor> taskExecutorList = taskExecutorMapper.selectList(new LambdaQueryWrapper<TaskExecutor>().eq(TaskExecutor::getCompanyId,user.getCompanyId()));
         List<TaskLog> taskLogList = taskLogMapper.selectList(new LambdaQueryWrapper<TaskLog>().eq(TaskLog::getCompanyId,user.getCompanyId()).orderByDesc(TaskLog::getModTime));
@@ -1701,6 +1719,13 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                 tasKVo.setPayWayName(payWayName2);
             }
 
+            if (company.getIsSimple()==1){
+                if (StringUtils.isNotEmpty(tasKVo.getCompanyPhone())){
+                    //contactsPhone
+                    tasKVo.setContactsPhone(tasKVo.getCompanyPhone());
+                }
+            }
+
         }
         List<TasKVo> taskVoTotalList= taskMapper.getPageListTotalTask(taskDto);
         HttpRespMsg msg = new HttpRespMsg();
@@ -1741,6 +1766,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
         TasKVo tasKVo = new TasKVo();
         Task task = taskMapper.selectById(id);
         User user = userMapper.selectById(request.getHeader("Token"));
+        Company company = companyMapper.selectById(user.getCompanyId());
 //        WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
 //        CompanyDingding dingding = companyDingdingMapper.selectOne(new LambdaQueryWrapper<CompanyDingding>().eq(CompanyDingding::getCompanyId, user.getCompanyId()));
 
@@ -1785,6 +1811,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                 Custom custom = customMapper.selectById(task.getCustomId());
                 if (custom!=null){
                     tasKVo.setCustomName(custom.getCustomName());
+                    if (company.getIsSimple()==1){
+                        if (StringUtils.isNotEmpty(custom.getCompanyPhone())){
+                            //contactsPhone
+                            tasKVo.setContactsPhone(custom.getCompanyPhone());
+                        }
+                    }
                 }
             }
             if (task.getBusinessOpportunityId()!=null){
@@ -1809,6 +1841,28 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                 tasKVo.setTaskLogs(taskLogList);
             }
         }
+        if (tasKVo.getCustomType()!=null&&tasKVo.getCustomType()==0){
+            //0居民住家/ 1商业区/ 2其他类型
+            tasKVo.setCustomTypeName(customTypeName0);
+        } else if (tasKVo.getCustomType() != null && tasKVo.getCustomType() == 1) {
+            tasKVo.setCustomTypeName(customTypeName1);
+        }else if (tasKVo.getCustomType() != null && tasKVo.getCustomType() == 2) {
+            tasKVo.setCustomTypeName(customTypeName2);
+        }
+
+        if (tasKVo.getPayType()!=null&&tasKVo.getPayType()==0){
+            tasKVo.setPayTypeName("未付款");
+        } else if (tasKVo.getPayType()!=null&&tasKVo.getPayType()==1) {
+            tasKVo.setPayTypeName("已付款");
+        }
+
+        if (tasKVo.getPayWay()!=null&&tasKVo.getPayWay()==0){
+            tasKVo.setPayWayName(payWayName0);
+        } else if (tasKVo.getPayWay() != null && tasKVo.getPayWay() == 1) {
+            tasKVo.setPayWayName(payWayName1);
+        }else if (tasKVo.getPayWay() != null && tasKVo.getPayWay() == 2) {
+            tasKVo.setPayWayName(payWayName2);
+        }
         respMsg.setData(tasKVo);
         return respMsg;
     }

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

@@ -328,6 +328,10 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 
                     }
                 }*/
+                if (company.getIsSimple()==1){
+                    List<SysModule> collect = userVO.getModuleList().stream().filter(m -> !"联系人".equals(m.getName()) && !"销售订单".equals(m.getName())).collect(Collectors.toList());
+                    userVO.setModuleList(collect);
+                }
                 httpRespMsg.data = userVO;
             }else {
                 httpRespMsg.setError(MessageUtils.message("user.pwdError"));

+ 3 - 2
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/TaskMapper.xml

@@ -97,6 +97,7 @@
         <result column="clue_name" property="clueName"/>
         <result column="contacts_name" property="contactsName"/>
         <result column="contacts_phone" property="contactsPhone"/>
+        <result column="company_phone" property="companyPhone"/>
     </resultMap>
 
     <resultMap id="TaskPinVoMap" type="com.management.platform.entity.vo.TasKVo">
@@ -152,7 +153,7 @@
                business_opportunity.name businessName,
               `sales_order`.order_name ,
                clue.clue_name,
-               contacts.name contacts_name ,contacts.phone contacts_phone
+               contacts.name contacts_name ,contacts.phone contacts_phone,custom.company_phone
         from task
             left join  custom on task.custom_id=custom.id
             left join  business_opportunity on task.business_opportunity_id=business_opportunity.id
@@ -381,7 +382,7 @@
         business_opportunity.name businessName,
         `sales_order`.order_name ,
         clue.clue_name,
-        contacts.name contacts_name ,contacts.phone contacts_phone
+        contacts.name contacts_name ,contacts.phone contacts_phone,custom.company_phone
         from task
         left join  custom on task.custom_id=custom.id
         left join  business_opportunity on task.business_opportunity_id=business_opportunity.id