Min hai 1 ano
pai
achega
f5d2d13dc3

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

@@ -6,10 +6,7 @@ import com.management.platform.entity.SysForm;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.SysFormService;
 import com.management.platform.util.HttpRespMsg;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Priority;
 import javax.annotation.Resource;
@@ -44,8 +41,8 @@ public class SysFormController {
         return msg;
     }
 
-    @RequestMapping("/getListByCode")
-    public HttpRespMsg getListByCode(@RequestParam String code){
+    @GetMapping("/getListByCode/{code}")
+    public HttpRespMsg getListByCode(@PathVariable(name="code") String code){
         HttpRespMsg msg=new HttpRespMsg();
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         List<SysForm> sysFormList = sysFormService.list(new LambdaQueryWrapper<SysForm>().eq(SysForm::getCompanyId, companyId).eq(SysForm::getCode, code));

+ 1 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/SysForm.java

@@ -67,4 +67,4 @@ public class SysForm extends Model<SysForm> {
         return this.id;
     }
 
-}
+}  

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

@@ -594,7 +594,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         List<SysModule> moduleList = sysModuleMapper.selectList(queryWrapper);
 
         //过滤一下,这个角色选中的模块
-        moduleList = moduleList.stream().filter(m->ids.contains(m.getId())).collect(Collectors.toList());
+        moduleList = moduleList.stream().filter(m->ids.contains(m.getId())||m.getIsMenu()==false).collect(Collectors.toList());
         if (company.getPackageEngineering() == 1) {
             //生成虚拟的两个审核放进去
             SysModule proModule = new SysModule();

+ 20 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserWithBeisenController.java

@@ -98,7 +98,7 @@ public class UserWithBeisenController {
         }
         List<UserWithBeisen> allBeisenList = userWithBeisenService.list(new LambdaQueryWrapper<UserWithBeisen>().eq(UserWithBeisen::getCompanyId, companyId));
         List<UserWithBeisen> userWithBeisenList=new ArrayList<>();
-        JSONArray swipingCards = BeiSenUtils.getSwipingCards(createDate,beisenConfig.getAppKey(),beisenConfig.getAppSecret());
+        JSONArray swipingCards = BeiSenUtils.getSwipingCards(createDate,beisenConfig.getAppKey(),beisenConfig.getAppSecret(),1,300);
         httpRespMsg.setData(swipingCards);
         return httpRespMsg;
     }
@@ -106,12 +106,29 @@ public class UserWithBeisenController {
     @RequestMapping("/getSwipingCardsTest")
     public HttpRespMsg getSwipingCardsTest(String createDate){
         HttpRespMsg httpRespMsg=new HttpRespMsg();
-        Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
-        JSONArray swipingCards = BeiSenUtils.getSwipingCards(createDate,"70FD83474FB946E5A6A122BB2989E8D9","F494856D0BCC49D18C63429D4F2CB42EDE9480D5C075449E9C97E7AEA5C7D9E1");
+        JSONArray swipingCards = BeiSenUtils.getSwipingCards(createDate,"70FD83474FB946E5A6A122BB2989E8D9","F494856D0BCC49D18C63429D4F2CB42EDE9480D5C075449E9C97E7AEA5C7D9E1",1,300);
         System.out.println("获取到的打卡数据====>"+swipingCards.toJSONString());
         httpRespMsg.setData(swipingCards);
         return httpRespMsg;
     }
 
+    @RequestMapping("/getOverTimeListTest")
+    public HttpRespMsg getOverTimeListTest(String createDate){
+        HttpRespMsg httpRespMsg=new HttpRespMsg();
+        JSONArray swipingCards = BeiSenUtils.getOverTimeList(createDate,"70FD83474FB946E5A6A122BB2989E8D9","F494856D0BCC49D18C63429D4F2CB42EDE9480D5C075449E9C97E7AEA5C7D9E1",1,300);
+        System.out.println("获取到的加班那数据====>"+swipingCards.toJSONString());
+        httpRespMsg.setData(swipingCards);
+        return httpRespMsg;
+    }
+
+    @RequestMapping("/getAttendanceStatisticsTest")
+    public HttpRespMsg getAttendanceStatisticsTest(String startDate,String endDate){
+        HttpRespMsg httpRespMsg=new HttpRespMsg();
+        JSONArray swipingCards = BeiSenUtils.getAttendanceStatistics(startDate,endDate,"70FD83474FB946E5A6A122BB2989E8D9","F494856D0BCC49D18C63429D4F2CB42EDE9480D5C075449E9C97E7AEA5C7D9E1",1,300);
+        System.out.println("获取到的考勤数据====>"+swipingCards.toJSONString());
+        httpRespMsg.setData(swipingCards);
+        return httpRespMsg;
+    }
+
 }
 

+ 99 - 7
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/BeiSenUtils.java

@@ -80,6 +80,9 @@ public class BeiSenUtils {
         return result;
     }
 
+    /**
+     * 获取人员数据
+     * */
     public static List<JSONArray> getByTimeWindow(String scrollId,String startTime,String stopTime,String appkey,String appSecret){
         List<JSONArray> resultList=new ArrayList<>();
         String url = "https://openapi.italent.cn/TenantBaseExternal/api/v5/Employee/GetByTimeWindow";
@@ -117,7 +120,10 @@ public class BeiSenUtils {
         return resultList;
     }
 
-    public static JSONArray getSwipingCards(String createDate,String appkey,String appSecret){
+    /**
+     * 获取打卡数据
+     * */
+    public static JSONArray getSwipingCards(String createDate,String appkey,String appSecret,Integer pageIndex,Integer pageSize){
         String url = "https://openapi.italent.cn/AttendanceOpen/api/v1/SwipingCardData/GetSwipingCards";
         HttpHeaders headers = new HttpHeaders();
         RestTemplate restTemplate = new RestTemplate();
@@ -128,25 +134,111 @@ public class BeiSenUtils {
         headers.add("Authorization","Bearer "+accessToken);
         JSONObject requestMap = new JSONObject();
         requestMap.put("PunchCardDate",createDate);
-        requestMap.put("pageIndex","1");
-        requestMap.put("pageSize","300");
+        requestMap.put("PageIndex",pageIndex);
+        requestMap.put("PageSize",pageSize);
         System.out.println("--------headers请求头数据-------"+headers);
         System.out.println("--------requestMap请求参数-------"+requestMap);
         HttpEntity<JSONObject> entity = new HttpEntity<>(requestMap, headers);
         ResponseEntity<String> ResponseEntity = restTemplate.postForEntity(url, entity, String.class);
+        JSONArray lastJSONArray=new JSONArray();
+        JSONArray target=new JSONArray();
         if (ResponseEntity.getStatusCode() == HttpStatus.OK) {
             String resp= ResponseEntity.getBody();
             JSONObject respJson = JSONObject.parseObject(resp);
             if(respJson.getIntValue("code")==200){
                 JSONObject data = respJson.getJSONObject("Data");
-                JSONArray resultData = data.getJSONArray("SwipingCardDetails");
-                return resultData;
+                target = data.getJSONArray("SwipingCardDetails");
+                lastJSONArray.addAll(target);
+                if (target.size()>0){
+                    pageIndex++;
+                    JSONArray swipingCardDetails = getSwipingCards(createDate, appkey, appSecret, pageIndex, pageSize);
+                    lastJSONArray.addAll(swipingCardDetails);
+                }
             }
         }
-        //todo:景昱 计算工作时长 默认工作日 8小时+当天人员加班(审核状态:通过)时长 非工作日考勤数据以加班数据为准
+        return lastJSONArray;
+    }
+
 
+    /**
+     * 获取加班数据
+     * */
+    public static JSONArray getOverTimeList(String createDate,String appkey,String appSecret,Integer pageIndex,Integer pageSize){
+        String url = "https://openapi.italent.cn/AttendanceOpen/api/v1/AttendanceOvertime/GetOverTimeList";
+        HttpHeaders headers = new HttpHeaders();
+        RestTemplate restTemplate = new RestTemplate();
+        MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
+        headers.setContentType(type);
+        String accessToken = getToken(appkey,appSecret);
+        System.out.println("--------Bearer TOKEN--------"+accessToken);
+        headers.add("Authorization","Bearer "+accessToken);
+        JSONObject requestMap = new JSONObject();
+        requestMap.put("OverTimeDate",createDate);
+        requestMap.put("PageIndex",pageIndex);
+        requestMap.put("PageSize",pageSize);
+        System.out.println("--------headers请求头数据-------"+headers);
+        System.out.println("--------requestMap请求参数-------"+requestMap);
+        HttpEntity<JSONObject> entity = new HttpEntity<>(requestMap, headers);
+        ResponseEntity<String> ResponseEntity = restTemplate.postForEntity(url, entity, String.class);
+        JSONArray lastJSONArray=new JSONArray();
+        if (ResponseEntity.getStatusCode() == HttpStatus.OK) {
+            String resp= ResponseEntity.getBody();
+            JSONObject respJson = JSONObject.parseObject(resp);
+            if(respJson.getIntValue("code")==200){
+                JSONObject data = respJson.getJSONObject("Data");
+                JSONArray target = data.getJSONArray("OverTimeList");
+                lastJSONArray.addAll(target);
+                if (target.size()>0){
+                    pageIndex++;
+                    JSONArray overTimeList = getOverTimeList(createDate, appkey, appSecret, pageIndex, pageSize);
+                    lastJSONArray.addAll(overTimeList);
+                }
+            }
+        }
+        //todo:景昱 计算工作时长 默认工作日 8小时+当天人员加班(审核状态:通过)时长 非工作日考勤数据以加班数据为准
         //todo:如何分页 循环调用接口 当天接口返回数据为空 取消调用
-        return new JSONArray();
+        return lastJSONArray;
+    }
+
+
+
+    /**
+     * 获取考勤数据
+     * */
+    public static JSONArray getAttendanceStatistics(String startDate,String endDate,String appkey,String appSecret,Integer pageIndex,Integer pageSize){
+        String url = "https://openapi.italent.cn/AttendanceOpen/api/v1/AttendanceStatistics/get";
+        HttpHeaders headers = new HttpHeaders();
+        RestTemplate restTemplate = new RestTemplate();
+        MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
+        headers.setContentType(type);
+        String accessToken = getToken(appkey,appSecret);
+        System.out.println("--------Bearer TOKEN--------"+accessToken);
+        headers.add("Authorization","Bearer "+accessToken);
+        JSONObject requestMap = new JSONObject();
+        requestMap.put("StartDate",startDate);
+        requestMap.put("StopDate",endDate);
+        requestMap.put("PageIndex",pageIndex);
+        requestMap.put("PageSize",pageSize);
+        System.out.println("--------headers请求头数据-------"+headers);
+        System.out.println("--------requestMap请求参数-------"+requestMap);
+        HttpEntity<JSONObject> entity = new HttpEntity<>(requestMap, headers);
+        ResponseEntity<String> ResponseEntity = restTemplate.postForEntity(url, entity, String.class);
+        JSONArray lastJSONArray=new JSONArray();
+        if (ResponseEntity.getStatusCode() == HttpStatus.OK) {
+            String resp= ResponseEntity.getBody();
+            JSONObject respJson = JSONObject.parseObject(resp);
+            if(respJson.getIntValue("code")==200){
+                JSONObject data = respJson.getJSONObject("Data");
+                JSONArray target = data.getJSONArray("Items");
+                lastJSONArray.addAll(target);
+                if (target.size()>0){
+                    pageIndex++;
+                    JSONArray overTimeList = getAttendanceStatistics(startDate,endDate, appkey, appSecret, pageIndex, pageSize);
+                    lastJSONArray.addAll(overTimeList);
+                }
+            }
+        }
+        return lastJSONArray;
     }
 
 }

+ 2 - 2
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/ReportController.java

@@ -1524,7 +1524,7 @@ public class ReportController {
 
     //人员工时工价表
     @RequestMapping("getPersonWorkHoursWagesList")
-    public HttpRespMsg getPersonWorkHoursWagesList(String deptId,String userId,String startDate,String endDate,Integer pageIndex,Integer pageSize){
+    public HttpRespMsg getPersonWorkHoursWagesList(Integer deptId,String userId,String startDate,String endDate,Integer pageIndex,Integer pageSize){
         return reportService.getPersonWorkHoursWagesList(deptId,userId,startDate,endDate,pageIndex,pageSize);
     }
 
@@ -1534,7 +1534,7 @@ public class ReportController {
     }
 
     @RequestMapping("exportPersonWorkHoursWorkTime")
-    public HttpRespMsg exportPersonWorkHoursWorkTime(String deptId,String userId,String startDate,String endDate){
+    public HttpRespMsg exportPersonWorkHoursWorkTime(Integer deptId,String userId,String startDate,String endDate){
         return reportService.exportPersonWorkHoursWorkTime(deptId,userId,startDate,endDate);
     }
 

+ 1 - 1
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/ReportMapper.java

@@ -182,7 +182,7 @@ public interface ReportMapper extends BaseMapper<Report> {
 
     List<Map<String, Object>> getCcReportByDate(@Param("date") String date, @Param("id") String id, @Param("state") Integer state);
 
-    List<Map<String, Object>> getPersonWorkHoursWagesList(Integer companyId, String startDate, String endDate, String deptId, String userId);
+    List<Map<String, Object>> getPersonWorkHoursWagesList(Integer companyId, String startDate, String endDate,@Param("list") List<Integer> deptId, String userId);
 
     List<Map<String, Object>> getPersonWorkHoursWagesDetail(String date, String userId, Integer companyId,String startDate,String endDate,Integer checkStatus,Integer detailStatus);
 

+ 2 - 2
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/ReportService.java

@@ -117,11 +117,11 @@ public interface ReportService extends IService<Report> {
 
     HttpRespMsg getChekerList(Integer checkType, Integer deptId);
 
-    HttpRespMsg getPersonWorkHoursWagesList(String deptId, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize);
+    HttpRespMsg getPersonWorkHoursWagesList(Integer deptId, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize);
 
     HttpRespMsg getPersonWorkHoursWagesDetail(String date, String userId,String startDate,String endDate,Integer checkStatus,Integer detailStatus);
 
-    HttpRespMsg exportPersonWorkHoursWorkTime(String deptId, String userId, String startDate, String endDate);
+    HttpRespMsg exportPersonWorkHoursWorkTime(Integer deptId, String userId, String startDate, String endDate);
 
     HttpRespMsg getProcedureRealTimeProgressList(String deptId, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize);
 

+ 8 - 5
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -4014,7 +4014,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
 //    }
 
     @Override
-    public HttpRespMsg getPersonWorkHoursWagesList(String deptId, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize) {
+    public HttpRespMsg getPersonWorkHoursWagesList(Integer deptId, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize) {
         HttpRespMsg httpRespMsg=new HttpRespMsg();
         HashMap resultMap=new HashMap();
         DateTimeFormatter dtf=DateTimeFormatter.ofPattern("yyyy-MM-dd");
@@ -4031,13 +4031,16 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         boolean canViewAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部人员工时工价");
         QueryWrapper<User> queryWrapper=new QueryWrapper();
         queryWrapper.eq("company_id",companyId);
-        if(!StringUtils.isEmpty(deptId)){
-            queryWrapper.eq("department_id",deptId);
+        List<Integer> deptIds=new ArrayList<>();
+        if(deptId!=null){
+            deptIds = getBranchDepartment(Integer.valueOf(deptId), departmentList);
+            deptIds.add(Integer.valueOf(deptId));
+            queryWrapper.in("department_id",deptIds);
         }
         if(!StringUtils.isEmpty(userId)){
             queryWrapper.eq("id",userId);
         }
-        List<Map<String,Object>> personWorkHoursWagesList=reportMapper.getPersonWorkHoursWagesList(companyId,startDate,endDate,deptId,userId);
+        List<Map<String,Object>> personWorkHoursWagesList=reportMapper.getPersonWorkHoursWagesList(companyId,startDate,endDate,deptIds,userId);
         if(!canViewAll){
             /*作为工长看到的数据*/
             List<Plan> plans = planMapper.selectList(new QueryWrapper<Plan>().eq("foreman_id", user.getId()));
@@ -4236,7 +4239,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     }
 
     @Override
-    public HttpRespMsg exportPersonWorkHoursWorkTime(String deptId, String userId, String startDate, String endDate) {
+    public HttpRespMsg exportPersonWorkHoursWorkTime(Integer deptId, String userId, String startDate, String endDate) {
         HttpRespMsg respMsg = getPersonWorkHoursWagesList(deptId, userId, startDate, endDate, -1, -1);
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         HashMap resultMap= (HashMap) respMsg.data;

+ 5 - 2
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/ReportMapper.xml

@@ -140,8 +140,11 @@
         left join user b on a.creator_id=b.id
         left join department c on c.department_id=b.department_id
         where a.company_id=#{companyId}
-        <if test="deptId!=null and deptId!=''">
-            and c.department_id=#{deptId}
+        <if test="list!=null and list.size()>0">
+            and c.department_id in
+            <foreach collection="list" close=")" open="(" item="item" separator=",">
+                #{item}
+            </foreach>
         </if>
         <if test="userId!=null and userId!=''">
             and b.id=#{userId}

+ 2 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/expense/expense.vue

@@ -1881,7 +1881,8 @@ export default {
       this.http.post(this.port.project.list, {},
         res => {
           if (res.code == "ok") {
-            this.projectList = res.data;
+            //费用报销界面选择项目只针对进行中的
+            this.projectList = res.data.filter(i =>i.status==1);
           } else {
             this.$message({
               message: res.msg,