Przeglądaj źródła

1. 修复设备工时统计bug
2. 修复企业微信同步新员工进来时没有自动参与项目的bug

QuYueTing 1 miesiąc temu
rodzic
commit
3d1dc25801

+ 18 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -195,6 +195,8 @@ public class WeiXinCorpController {
 
     @Resource
     private RedisUtil redisUtil;
+    @Autowired
+    private ProjectDeptRelateMapper projectDeptRelateMapper;
 
     public class Item {
         public String jsTicket = null;
@@ -2585,6 +2587,22 @@ public class WeiXinCorpController {
                     }*/
                     List<String> stringList = newUserList.stream().filter(u -> u != null && org.apache.commons.lang3.StringUtils.isNotEmpty(u.getCorpwxUserid())).map(User::getCorpwxUserid).distinct().collect(Collectors.toList());
                     wxCorpInfoService.getUserByCompanyIdAndTransferLicenseBatch(companyId,stringList);
+                    //员工的部门如果全部参与了项目,那这个员工也自动变成项目参与人
+                    List<Participation> autoAddParticiList = new ArrayList<>();
+                    for (User user : newUserList) {
+                        List<ProjectDeptRelate> joinProjectList = projectDeptRelateMapper.selectList(new QueryWrapper<ProjectDeptRelate>().eq("department_id", user.getDepartmentId()));
+                        if (joinProjectList.size() > 0) {
+                            for (ProjectDeptRelate projectDeptRelate : joinProjectList) {
+                                Participation participation = new Participation();
+                                participation.setUserId(user.getId());
+                                participation.setProjectId(projectDeptRelate.getProjectId());
+                                autoAddParticiList.add(participation);
+                            }
+                        }
+                    }
+                    if (autoAddParticiList.size() > 0) {
+                        participationMapper.insertBatch(autoAddParticiList);
+                    }
                 }
             }
             //姓名,部门,账号的同步更新

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

@@ -391,7 +391,7 @@ public class DeviceLogServiceImpl extends ServiceImpl<DeviceLogMapper, DeviceLog
         Integer companyId = targetUser.getCompanyId();
         List<Map<String, Object>> sumProjectList =deviceLogMapper.selectListGroupByProject(companyId,startDate,endDate,projectId);
         List<Device> deviceList = deviceMapper.selectList(new QueryWrapper<Device>().eq("company_id", companyId));
-        List<DeviceLog> deviceLogs = deviceLogMapper.selectList(new QueryWrapper<DeviceLog>().between("create_date", startDate, endDate).isNotNull("end_time"));
+        List<DeviceLog> deviceLogs = deviceLogMapper.selectList(new QueryWrapper<DeviceLog>().between("start_time", startDate, endDate).isNotNull("end_time"));
 
         ArrayList<List<String>> allList = new ArrayList<>();
         List<String> headList = new ArrayList<String>();

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

@@ -48,7 +48,7 @@
         inner JOIN device_log dl on p.id=dl.project_id
         <where>
             <if test="startDate !=null and startDate!='' and endDate !=null and endDate!='' ">
-                and dl.create_date BETWEEN #{startDate} and #{endDate}
+                and dl.start_time BETWEEN #{startDate} and #{endDate}
             </if>
             <if test="companyId!=null">
                 and p.company_id=#{companyId}