Pārlūkot izejas kodu

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

QuYueTing 5 mēneši atpakaļ
vecāks
revīzija
d9d2fcd417
12 mainītis faili ar 103 papildinājumiem un 40 dzēšanām
  1. 5 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/VisitPlanController.java
  2. 6 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/VisitPlan.java
  3. 19 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/vo/MonthActivePlanVO.java
  4. 3 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/VisitPlanMapper.java
  5. 1 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/VisitPlanService.java
  6. 32 30
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/UserCommonModuleServiceImpl.java
  7. 21 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/VisitPlanServiceImpl.java
  8. 7 1
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/VisitPlanMapper.xml
  9. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/excel/ProjectContractBonusExlceHead.java
  10. 2 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ContractBonusDetailMapper.java
  11. 5 5
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ContractBonusDetailServiceImpl.java
  12. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ContractBonusDetailMapper.xml

+ 5 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/VisitPlanController.java

@@ -130,6 +130,11 @@ public class VisitPlanController {
         return visitPlanService.getVisitPlanDetail(planId,request);
     }
 
+    @PostMapping("/getMonthActivePlan")
+    public HttpRespMsg getMonthActivePlan(@RequestParam("ym")String ym
+            ,HttpServletRequest request){
+        return visitPlanService.getMonthActivePlan(ym,request);
+    }
 
 
 //    @GetMapping("/getDelayQueue")

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

@@ -76,4 +76,10 @@ public class VisitPlan extends Model<VisitPlan> {
      */
     @TableField("corpwx_userid")
     private String corpwxUserid;
+
+    /**创建时间*/
+    @TableField(value = "create_time")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date createTime;
 }

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

@@ -0,0 +1,19 @@
+package com.management.platform.entity.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+@Data
+public class MonthActivePlanVO {
+    private Long id;
+    private String planName;
+    /**拜访时间*/
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
+    private Date visitTime;
+
+    private String ymd;
+}

+ 3 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/VisitPlanMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.management.platform.entity.VisitPlan;
 import com.management.platform.entity.dto.QueryVisitPlanDTO;
+import com.management.platform.entity.vo.MonthActivePlanVO;
 import com.management.platform.entity.vo.VisitPlanDetailVO;
 import com.management.platform.entity.vo.VisitPlanVO;
 import org.apache.ibatis.annotations.Param;
@@ -19,4 +20,6 @@ public interface VisitPlanMapper extends BaseMapper<VisitPlan> {
     VisitPlanDetailVO getDetail(@Param("planId") Long planId);
 
     List<VisitPlan> getMinuteVisitPlans(@Param("queryDate") Date queryDate);
+
+    List<MonthActivePlanVO> getMonthActivePlan(@Param("userId") String userId, @Param("ym") String ym);
 }

+ 1 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/VisitPlanService.java

@@ -20,4 +20,5 @@ public interface VisitPlanService extends IService<VisitPlan> {
 
     HttpRespMsg getVisitPlanDetail(Long planId, HttpServletRequest request);
 
+    HttpRespMsg getMonthActivePlan(String ym, HttpServletRequest request);
 }

+ 32 - 30
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/UserCommonModuleServiceImpl.java

@@ -101,11 +101,12 @@ public class UserCommonModuleServiceImpl extends ServiceImpl<UserCommonModuleMap
             return httpRespMsg;
         }
         if(StringUtils.isBlank(moduleIds)){
-            httpRespMsg.setError("模块id不能为空");
-            return httpRespMsg;
-        }
-        List<Integer> moduleIdList = Arrays.stream(moduleIds.split(",")).map(Integer::parseInt).collect(Collectors.toList());
-        //是否已存在
+            userCommonModuleMapper.delete(new LambdaQueryWrapper<UserCommonModule>()
+                    .eq(UserCommonModule::getUserId, user.getId())
+            );
+        }else{
+            List<Integer> moduleIdList = Arrays.stream(moduleIds.split(",")).map(Integer::parseInt).collect(Collectors.toList());
+            //是否已存在
 //        Integer count = userCommonModuleMapper.selectCount(new LambdaQueryWrapper<UserCommonModule>()
 //                .in(UserCommonModule::getModuleId, moduleIdList)
 //                .eq(UserCommonModule::getUserId, user.getId())
@@ -114,38 +115,39 @@ public class UserCommonModuleServiceImpl extends ServiceImpl<UserCommonModuleMap
 //            httpRespMsg.setError("已存在选中的常用模块");
 //            return httpRespMsg;
 //        }
-        //是否有权限
-        Integer roleModuleCount = sysRoleModuleMapper.selectCount(new LambdaQueryWrapper<SysRoleModule>()
-                .in(SysRoleModule::getModuleId, moduleIdList)
-                .eq(SysRoleModule::getRoleId, user.getRoleId())
-        );
-        if(roleModuleCount < moduleIdList.size()){
-            httpRespMsg.setError("无模块权限");
-            return httpRespMsg;
-        }
-        //12-20 修改为删除覆盖逻辑
-        //计算seq
+            //是否有权限
+            Integer roleModuleCount = sysRoleModuleMapper.selectCount(new LambdaQueryWrapper<SysRoleModule>()
+                    .in(SysRoleModule::getModuleId, moduleIdList)
+                    .eq(SysRoleModule::getRoleId, user.getRoleId())
+            );
+            if(roleModuleCount < moduleIdList.size()){
+                httpRespMsg.setError("无模块权限");
+                return httpRespMsg;
+            }
+            //12-20 修改为删除覆盖逻辑
+            //计算seq
 //        UserCommonModule lastModule = userCommonModuleMapper.selectOne(new LambdaQueryWrapper<UserCommonModule>()
 //                .eq(UserCommonModule::getUserId, user.getId())
 //                .orderByDesc(UserCommonModule::getSeq)
 //                .last("limit 1")
 //        );
 //        int index = null==lastModule?1:lastModule.getSeq()+1;
-        int index = 1;
-        List<UserCommonModule> toAddList = new ArrayList<>();
-        for (Integer moduleId : moduleIdList) {
-            UserCommonModule entity = new UserCommonModule();
-            entity.setModuleId(moduleId);
-            entity.setUserId(user.getId());
-            entity.setCompanyId(user.getCompanyId());
-            entity.setSeq(index);
-            toAddList.add(entity);
-            index++;
+            int index = 1;
+            List<UserCommonModule> toAddList = new ArrayList<>();
+            for (Integer moduleId : moduleIdList) {
+                UserCommonModule entity = new UserCommonModule();
+                entity.setModuleId(moduleId);
+                entity.setUserId(user.getId());
+                entity.setCompanyId(user.getCompanyId());
+                entity.setSeq(index);
+                toAddList.add(entity);
+                index++;
+            }
+            userCommonModuleMapper.delete(new LambdaQueryWrapper<UserCommonModule>()
+                    .eq(UserCommonModule::getUserId, user.getId())
+            );
+            userCommonModuleMapper.insertBatch(toAddList);
         }
-        userCommonModuleMapper.delete(new LambdaQueryWrapper<UserCommonModule>()
-                .eq(UserCommonModule::getUserId, user.getId())
-        );
-        userCommonModuleMapper.insertBatch(toAddList);
         return httpRespMsg;
     }
 

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

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.entity.*;
 import com.management.platform.entity.dto.QueryVisitPlanDTO;
+import com.management.platform.entity.vo.MonthActivePlanVO;
 import com.management.platform.entity.vo.VisitPlanDetailVO;
 import com.management.platform.entity.vo.VisitPlanVO;
 import com.management.platform.mapper.*;
@@ -20,6 +21,7 @@ import java.time.LocalDateTime;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
+import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 
 @Service
@@ -343,4 +345,23 @@ public class VisitPlanServiceImpl extends ServiceImpl<VisitPlanMapper, VisitPlan
         httpRespMsg.setData(detailVO);
         return httpRespMsg;
     }
+
+    @Override
+    public HttpRespMsg getMonthActivePlan(String ym, HttpServletRequest request) {
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
+        User user= userMapper.selectById(request.getHeader("token"));
+        if(null == user){
+            httpRespMsg.setError("用户不存在");
+            return httpRespMsg;
+        }
+        String dateformate = "^[1-9]\\d{3}-[0-9]{2}$";
+        boolean matches = Pattern.matches(dateformate,ym);
+        if(!matches){
+            httpRespMsg.setError("年月格式有误");
+            return httpRespMsg;
+        }
+        List<MonthActivePlanVO> list = visitPlanMapper.getMonthActivePlan(user.getId(),ym);
+        httpRespMsg.setData(list);
+        return httpRespMsg;
+    }
 }

+ 7 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/VisitPlanMapper.xml

@@ -5,7 +5,7 @@
 
     <sql id="baseColumns">
         id, plan_name, custom_id, custom_name, incharger_id, visit_goal, visit_time, remark, remind_type
-          , remind_time, finish_state, create_by, company_id,final_remind_time,corpwx_userid
+          , remind_time, finish_state, create_by, company_id,final_remind_time,corpwx_userid,create_time
     </sql>
 
     <select id="getPageVisitPlan" resultType="com.management.platform.entity.vo.VisitPlanVO">
@@ -60,4 +60,10 @@
         finish_state != 1
         and date_format(final_remind_time,'%Y-%m-%d %H:%i')=date_format(#{queryDate},'%Y-%m-%d %H:%i')
     </select>
+
+    <select id="getMonthActivePlan" resultType="com.management.platform.entity.vo.MonthActivePlanVO">
+        select id,plan_name,visit_time,date_format(visit_time,'%Y-%m-%d') as ymd
+        from visit_plan
+        where date_format(visit_time,'%Y-%m') = #{ym} and create_by = #{userId}
+    </select>
 </mapper>

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/excel/ProjectContractBonusExlceHead.java

@@ -4,7 +4,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
 import lombok.Data;
 
 @Data
-public class ProjectContractBonusExlceHead {
+public class ProjectContractBonusExcelHead {
     @ExcelProperty(value = "合同主体",index = 0)
     private String contract;
     @ExcelProperty(value = "项目名称",index = 1)

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ContractBonusDetailMapper.java

@@ -2,7 +2,7 @@ package com.management.platform.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.management.platform.entity.ContractBonusDetail;
-import com.management.platform.entity.excel.ProjectContractBonusExlceHead;
+import com.management.platform.entity.excel.ProjectContractBonusExcelHead;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -10,5 +10,5 @@ import java.util.List;
 public interface ContractBonusDetailMapper extends BaseMapper<ContractBonusDetail> {
     void batchInsert(@Param("toAddList") List<ContractBonusDetail> toAddBonusDetailList);
 
-    List<ProjectContractBonusExlceHead> getExportContractProjectBonus(Integer year, Integer companyId);
+    List<ProjectContractBonusExcelHead> getExportContractProjectBonus(Integer year, Integer companyId);
 }

+ 5 - 5
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ContractBonusDetailServiceImpl.java

@@ -11,7 +11,7 @@ import com.management.platform.entity.ContractBonusSummary;
 import com.management.platform.entity.User;
 import com.management.platform.entity.WxCorpInfo;
 import com.management.platform.entity.bo.BonusDataBO;
-import com.management.platform.entity.excel.ProjectContractBonusExlceHead;
+import com.management.platform.entity.excel.ProjectContractBonusExcelHead;
 import com.management.platform.entity.vo.ImportBonusTemplateVO;
 import com.management.platform.entity.vo.ProjectBonusTimeVO;
 import com.management.platform.entity.vo.ProjectBonusTotalTimeVO;
@@ -440,7 +440,7 @@ public class ContractBonusDetailServiceImpl extends ServiceImpl<ContractBonusDet
         if(null ==user){
             httpRespMsg.setError("登录凭证有误,请联系管理员");
         }
-        List<ProjectContractBonusExlceHead> contractProjectBonusList=contractBonusDetailMapper.getExportContractProjectBonus(year,user.getCompanyId());
+        List<ProjectContractBonusExcelHead> contractProjectBonusList=contractBonusDetailMapper.getExportContractProjectBonus(year,user.getCompanyId());
         httpRespMsg.setData(contractProjectBonusList);
         return httpRespMsg;
     }
@@ -456,7 +456,7 @@ public class ContractBonusDetailServiceImpl extends ServiceImpl<ContractBonusDet
                 e.printStackTrace();
             }
         }
-        List<ProjectContractBonusExlceHead> dataList=contractBonusDetailMapper.getExportContractProjectBonus(year,user.getCompanyId());
+        List<ProjectContractBonusExcelHead> dataList=contractBonusDetailMapper.getExportContractProjectBonus(year,user.getCompanyId());
 
         String fileName = null;
         try {
@@ -469,11 +469,11 @@ public class ContractBonusDetailServiceImpl extends ServiceImpl<ContractBonusDet
         response.setHeader("Content-Disposition", "attachment;filename=" + null==fileName?"file":fileName);
 
         try (ServletOutputStream outputStream = response.getOutputStream()){
-            EasyExcel.write(outputStream, ProjectContractBonusExlceHead.class)
+            EasyExcel.write(outputStream, ProjectContractBonusExcelHead.class)
                     .excelType(ExcelTypeEnum.XLSX)
                     .autoCloseStream(true)
                     .registerWriteHandler(new ExcelMergeStrategy(
-                            dataList.stream().map(ProjectContractBonusExlceHead::getContract)
+                            dataList.stream().map(ProjectContractBonusExcelHead::getContract)
                                     .collect(Collectors.toList()), 0
                     ))
 //                    .registerWriteHandler(new WidthStyleStrategy())

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ContractBonusDetailMapper.xml

@@ -25,7 +25,7 @@
 <!--        </collection>-->
 <!--    </resultMap>-->
 
-    <select id="getExportContractProjectBonus" resultType="com.management.platform.entity.excel.ProjectContractBonusExlceHead">
+    <select id="getExportContractProjectBonus" resultType="com.management.platform.entity.excel.ProjectContractBonusExcelHead">
         select tmp1.*,p.project_name as projectName
         from
             (