浏览代码

合同修改

QuYueTing 2 天之前
父节点
当前提交
c5a8972296
共有 12 个文件被更改,包括 79 次插入115 次删除
  1. 7 7
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ContractController.java
  2. 4 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/DingDingController.java
  3. 1 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java
  4. 2 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/ContractMapper.java
  5. 3 3
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ContractService.java
  6. 23 13
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ContractServiceImpl.java
  7. 17 18
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DingDingServiceImpl.java
  8. 7 63
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ExcelExportServiceImpl.java
  9. 2 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java
  10. 1 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/BeiSenUtils.java
  11. 2 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/ExcelUtil.java
  12. 10 4
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ContractMapper.xml

+ 7 - 7
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ContractController.java

@@ -44,9 +44,9 @@ public class ContractController {
      */
      */
     @RequestMapping("/getContractPage")
     @RequestMapping("/getContractPage")
     public HttpRespMsg getContractPage (HttpServletRequest request, @RequestParam Integer pageIndex, @RequestParam Integer pageSize, String number, String name, String typeName, Integer status,
     public HttpRespMsg getContractPage (HttpServletRequest request, @RequestParam Integer pageIndex, @RequestParam Integer pageSize, String number, String name, String typeName, Integer status,
-                                        String startDate, String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId, @RequestParam(required = false) String customerOrg, @RequestParam(required = false) Integer finishStatus
-    , Integer stampDutyStatus  ){
-        return contractService.getContractPage(request,pageIndex,pageSize,number,name,typeName,status,startDate,endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,stampDutyStatus);
+                                        String startDate, String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId, @RequestParam(required = false) String customerOrg, @RequestParam(required = false) Integer finishStatus, Integer procurementWay
+    , String stampDutyStatus  ){
+        return contractService.getContractPage(request,pageIndex,pageSize,number,name,typeName,status,startDate,endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,stampDutyStatus,procurementWay);
     }
     }
 
 
     /**
     /**
@@ -54,8 +54,8 @@ public class ContractController {
      */
      */
     @RequestMapping("/exportContract")
     @RequestMapping("/exportContract")
     public HttpRespMsg exportContract (HttpServletRequest request, String number,String name,String typeName,Integer status,String startDate,
     public HttpRespMsg exportContract (HttpServletRequest request, String number,String name,String typeName,Integer status,String startDate,
-                                       String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,@RequestParam(required = false) String customerOrg,@RequestParam(required = false) Integer finishStatus,Integer stampDutyStatus){
-        return contractService.ExportContract(request,number,name,typeName,status,startDate,endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,stampDutyStatus);
+                                       String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,@RequestParam(required = false) String customerOrg,@RequestParam(required = false) Integer finishStatus,String stampDutyStatus, Integer procurementWay){
+        return contractService.ExportContract(request,number,name,typeName,status,startDate,endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,stampDutyStatus,procurementWay);
     }
     }
 
 
     /**
     /**
@@ -63,8 +63,8 @@ public class ContractController {
      */
      */
     @RequestMapping("/exportContractOneToMany")
     @RequestMapping("/exportContractOneToMany")
     public HttpRespMsg exportContractOneToMany (HttpServletRequest request, String number,String name,String typeName,Integer status,String startDate,
     public HttpRespMsg exportContractOneToMany (HttpServletRequest request, String number,String name,String typeName,Integer status,String startDate,
-                                                String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,@RequestParam(required = false) String customerOrg,@RequestParam(required = false) Integer finishStatus,Integer stampDutyStatus){
-        return contractService.exportContractOneToMany(request,number,name,typeName,status,startDate,endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,stampDutyStatus);
+                                                String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,@RequestParam(required = false) String customerOrg,@RequestParam(required = false) Integer finishStatus,String stampDutyStatus, Integer procurementWay){
+        return contractService.exportContractOneToMany(request,number,name,typeName,status,startDate,endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,stampDutyStatus,procurementWay);
     }
     }
 
 
     /**
     /**

+ 4 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/DingDingController.java

@@ -190,10 +190,14 @@ public class DingDingController {
         dingDingService.syncCardTime(companyId, userId, startDate, endDate);
         dingDingService.syncCardTime(companyId, userId, startDate, endDate);
         return new HttpRespMsg();
         return new HttpRespMsg();
     }
     }
+
     @RequestMapping("/refreshUserCardTime")
     @RequestMapping("/refreshUserCardTime")
     public HttpRespMsg refreshUserCardTime(Integer companyId, String userId, String date) {
     public HttpRespMsg refreshUserCardTime(Integer companyId, String userId, String date) {
+        //同步请假数据
+        dingDingService.syncLeaveTime(companyId, userId, date, date);
         return dingDingService.refreshUserCardTime(companyId, userId, date);
         return dingDingService.refreshUserCardTime(companyId, userId, date);
     }
     }
+
     @RequestMapping("/listUserScheduleByDay")
     @RequestMapping("/listUserScheduleByDay")
     public HttpRespMsg listUserScheduleByDay(Integer companyId, String userId, String date) {
     public HttpRespMsg listUserScheduleByDay(Integer companyId, String userId, String date) {
         HttpRespMsg msg = new HttpRespMsg();
         HttpRespMsg msg = new HttpRespMsg();

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

@@ -1482,7 +1482,6 @@ public class ReportController {
                             .and(wrapper->wrapper.eq("state",0).or().eq("state",1).or().eq("state",3))
                             .and(wrapper->wrapper.eq("state",0).or().eq("state",1).or().eq("state",3))
                             .in("create_date", dateCollect));
                             .in("create_date", dateCollect));
                     //剔除掉当前日报中的
                     //剔除掉当前日报中的
-
                     oldRelatedReportList = oldRelatedReportList.stream().filter(old->!reportList.stream().map(Report::getId).collect(Collectors.toList()).contains(old.getId())).collect(Collectors.toList());
                     oldRelatedReportList = oldRelatedReportList.stream().filter(old->!reportList.stream().map(Report::getId).collect(Collectors.toList()).contains(old.getId())).collect(Collectors.toList());
                     oldRelatedReportList.addAll(reportList);
                     oldRelatedReportList.addAll(reportList);
                     double totalWorkingTime = oldRelatedReportList.stream().mapToDouble(Report::getWorkingTime).sum();
                     double totalWorkingTime = oldRelatedReportList.stream().mapToDouble(Report::getWorkingTime).sum();
@@ -1492,7 +1491,7 @@ public class ReportController {
                     int maxPercent = userGroupMapper.selectById(reportOwner.getUserGroupId()).getNoProjectPercent();
                     int maxPercent = userGroupMapper.selectById(reportOwner.getUserGroupId()).getNoProjectPercent();
                     if(percent > maxPercent){
                     if(percent > maxPercent){
                         HttpRespMsg httpRespMsg = new HttpRespMsg();
                         HttpRespMsg httpRespMsg = new HttpRespMsg();
-                        httpRespMsg.setError("非项目工时占比不得超过"+maxPercent+"%");
+                        httpRespMsg.setError("非项目工时占比不得超过"+maxPercent+"%,当前填报已达"+percent+"%");
                         return httpRespMsg;
                         return httpRespMsg;
                     }
                     }
                 }
                 }

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

@@ -14,6 +14,6 @@ import java.util.List;
  * @since 2022-11-29
  * @since 2022-11-29
  */
  */
 public interface ContractMapper extends BaseMapper<Contract> {
 public interface ContractMapper extends BaseMapper<Contract> {
-    List<Contract> selectContract(Integer companyId, Integer pageStart, Integer pageSize, String number, String name, String typeName, Integer status, String startDate,String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,Integer stampDutyStatus );
-    Long selectContractCnt(Integer companyId, String number, String name, String typeName, Integer status, String startDate,String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,Integer stampDutyStatus);
+    List<Contract> selectContract(Integer companyId, Integer pageStart, Integer pageSize, String number, String name, String typeName, Integer status, String startDate,String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,List<Integer> stampDutyStatusList,Integer procurementWay);
+    Long selectContractCnt(Integer companyId, String number, String name, String typeName, Integer status, String startDate,String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,List<Integer> stampDutyStatusList,Integer procurementWay);
 }
 }

+ 3 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ContractService.java

@@ -21,9 +21,9 @@ import java.util.List;
  */
  */
 public interface ContractService extends IService<Contract> {
 public interface ContractService extends IService<Contract> {
 
 
-    HttpRespMsg getContractPage(HttpServletRequest request, Integer pageIndex, Integer pageSize, String number, String name, String typeName, Integer status, String startDate, String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,Integer stampDutyStatus );
+    HttpRespMsg getContractPage(HttpServletRequest request, Integer pageIndex, Integer pageSize, String number, String name, String typeName, Integer status, String startDate, String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,String stampDutyStatus, Integer procurementWay);
 
 
-    HttpRespMsg ExportContract(HttpServletRequest request, String number, String name, String typeName, Integer status, String startDate, String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,Integer stampDutyStatus);
+    HttpRespMsg ExportContract(HttpServletRequest request, String number, String name, String typeName, Integer status, String startDate, String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,String stampDutyStatus, Integer procurementWay);
 
 
     HttpRespMsg addContract(HttpServletRequest request, Contract contract, ContractCustom custom, String paymentListStr);
     HttpRespMsg addContract(HttpServletRequest request, Contract contract, ContractCustom custom, String paymentListStr);
 
 
@@ -40,5 +40,5 @@ public interface ContractService extends IService<Contract> {
     HttpRespMsg deleteContract(HttpServletRequest request, Integer id);
     HttpRespMsg deleteContract(HttpServletRequest request, Integer id);
 
 
     HttpRespMsg exportContractOneToMany(HttpServletRequest request, String number, String name, String typeName, Integer status, String startDate,
     HttpRespMsg exportContractOneToMany(HttpServletRequest request, String number, String name, String typeName, Integer status, String startDate,
-                                        String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,Integer stampDutyStatus);
+                                        String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,String stampDutyStatus, Integer procurementWay);
 }
 }

+ 23 - 13
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ContractServiceImpl.java

@@ -108,7 +108,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
     @Override
     @Override
     public HttpRespMsg getContractPage(HttpServletRequest request, Integer pageIndex, Integer pageSize, String number, String name,
     public HttpRespMsg getContractPage(HttpServletRequest request, Integer pageIndex, Integer pageSize, String number, String name,
                                        String typeName, Integer status, String startDate, String endDate,
                                        String typeName, Integer status, String startDate, String endDate,
-                                       String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,Integer stampDutyStatus ) {
+                                       String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,String stampDutyStatus, Integer procurementWay) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         try {
         try {
             String token = request.getHeader("token");
             String token = request.getHeader("token");
@@ -135,14 +135,16 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
             if (pageIndex!=null){
             if (pageIndex!=null){
                 pageStart = (pageIndex -1) * pageSize;
                 pageStart = (pageIndex -1) * pageSize;
             }
             }
-//            if (StringUtils.isNotBlank(number)){
-//                number = "%" + number + "%";
-//            }
-//            if (StringUtils.isNotBlank(name)){
-//                name = "%" + name + "%";
-//            }
-            List<Contract> contracts = contractMapper.selectContract(user.getCompanyId(), pageStart, pageSize, number, name , typeName , status, startDate,endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,stampDutyStatus);
-            Long totalCnt = contractMapper.selectContractCnt(user.getCompanyId(), number, name, typeName, status, startDate, endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,stampDutyStatus);
+            List<Integer> stampDutyStatusList = new ArrayList<>();
+            if (!StringUtils.isEmpty(stampDutyStatus)){
+                //stampDutyStatus为逗号隔开
+                String[] split = stampDutyStatus.split(",");
+                for (String s : split) {
+                    stampDutyStatusList.add(Integer.parseInt(s));
+                }
+            }
+            List<Contract> contracts = contractMapper.selectContract(user.getCompanyId(), pageStart, pageSize, number, name , typeName , status, startDate,endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,stampDutyStatusList, procurementWay);
+            Long totalCnt = contractMapper.selectContractCnt(user.getCompanyId(), number, name, typeName, status, startDate, endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,stampDutyStatusList, procurementWay);
             for (Contract contract : contracts) {
             for (Contract contract : contracts) {
                 if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
                 if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
                     contract.setCreatorName(contract.getCreatorWxCorpId());
                     contract.setCreatorName(contract.getCreatorWxCorpId());
@@ -262,7 +264,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
      */
      */
     @Override
     @Override
     public HttpRespMsg ExportContract(HttpServletRequest request, String number, String name, String typeName, Integer status,
     public HttpRespMsg ExportContract(HttpServletRequest request, String number, String name, String typeName, Integer status,
-                                      String startDate, String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,Integer stampDutyStatus) {
+                                      String startDate, String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,String stampDutyStatus, Integer procurementWay) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("token"));
         User user = userMapper.selectById(request.getHeader("token"));
         List<SysRichFunction> functionContractList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "导出合同");
         List<SysRichFunction> functionContractList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "导出合同");
@@ -272,7 +274,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
         }
         }
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
         CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", user.getCompanyId()));
         CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", user.getCompanyId()));
-        HttpRespMsg contractPage = getContractPage(request, null, null, number, name, typeName, status, startDate, endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,stampDutyStatus);
+        HttpRespMsg contractPage = getContractPage(request, null, null, number, name, typeName, status, startDate, endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,stampDutyStatus, procurementWay);
         HashMap<String, Object> resultDate = (HashMap<String, Object>) contractPage.data;
         HashMap<String, Object> resultDate = (HashMap<String, Object>) contractPage.data;
         List<ContractPageVO> data = (List<ContractPageVO>)resultDate.get("data");
         List<ContractPageVO> data = (List<ContractPageVO>)resultDate.get("data");
         List<String> headList = new ArrayList<String>();
         List<String> headList = new ArrayList<String>();
@@ -1275,7 +1277,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
     }
     }
 
 
     @Override
     @Override
-    public HttpRespMsg exportContractOneToMany(HttpServletRequest request, String number, String name, String typeName, Integer status, String startDate, String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,Integer stampDutyStatus) {
+    public HttpRespMsg exportContractOneToMany(HttpServletRequest request, String number, String name, String typeName, Integer status, String startDate, String endDate, String paymentStartDate, String paymentEndDate, Integer secTypeId,String customerOrg,Integer finishStatus,String stampDutyStatus, Integer procurementWay) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("token"));
         User user = userMapper.selectById(request.getHeader("token"));
         List<SysRichFunction> functionContractList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "导出合同");
         List<SysRichFunction> functionContractList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "导出合同");
@@ -1285,7 +1287,15 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
         }
         }
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
         CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", user.getCompanyId()));
         CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", user.getCompanyId()));
-        HttpRespMsg contractPage = getContractPage(request, null, null, number, name, typeName, status, startDate, endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,stampDutyStatus);
+        //stampDutyStatus为逗号隔开
+        List<Integer> stampDutyStatusList = new ArrayList<>();
+        if (StringUtils.isNotBlank(stampDutyStatus)){
+            String[] split = stampDutyStatus.split(",");
+            for (String s : split) {
+                stampDutyStatusList.add(Integer.parseInt(s));
+            }
+        }
+        HttpRespMsg contractPage = getContractPage(request, null, null, number, name, typeName, status, startDate, endDate, paymentStartDate, paymentEndDate, secTypeId,customerOrg,finishStatus,stampDutyStatus, procurementWay);
         HashMap<String, Object> resultDate = (HashMap<String, Object>) contractPage.data;
         HashMap<String, Object> resultDate = (HashMap<String, Object>) contractPage.data;
         List<ContractPageVO> data = (List<ContractPageVO>)resultDate.get("data");
         List<ContractPageVO> data = (List<ContractPageVO>)resultDate.get("data");
         List<String> headList = new ArrayList<String>();
         List<String> headList = new ArrayList<String>();

+ 17 - 18
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DingDingServiceImpl.java

@@ -2241,24 +2241,6 @@ public class DingDingServiceImpl implements DingDingService {
         }
         }
     }
     }
 
 
-
-    @Override
-    public void syncCardTime(Integer companyId,String userId, String startDate, String endDate) {
-        if (companyId != null) {
-            //指定的某个公司
-            CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
-            syncOneComp(dingding, userId, startDate, endDate);
-        } else {
-            //全部的
-            List<TimeType> timeTypes = timeTypeMapper.selectList(new QueryWrapper<TimeType>().eq("sync_dingding", 1));
-            List<Integer> companyIds = timeTypes.stream().map(TimeType::getCompanyId).collect(Collectors.toList());
-            List<CompanyDingding> dingdingList = companyDingdingMapper.selectList(new QueryWrapper<CompanyDingding>().in("company_id", companyIds));
-            for (CompanyDingding dingding : dingdingList) {
-                syncOneComp(dingding, userId, startDate, endDate);
-            }
-        }
-    }
-
     private void syncOneComp(CompanyDingding dingding, String targetUserId, String startDate, String endDate) {
     private void syncOneComp(CompanyDingding dingding, String targetUserId, String startDate, String endDate) {
         List<User> userList = new ArrayList<>();
         List<User> userList = new ArrayList<>();
         if (!StringUtils.isEmpty(targetUserId)) {
         if (!StringUtils.isEmpty(targetUserId)) {
@@ -2813,6 +2795,23 @@ public class DingDingServiceImpl implements DingDingService {
         return msg;
         return msg;
     }
     }
 
 
+    @Override
+    public void syncCardTime(Integer companyId,String userId, String startDate, String endDate) {
+        if (companyId != null) {
+            //指定的某个公司
+            CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
+            syncOneComp(dingding, userId, startDate, endDate);
+        } else {
+            //全部的
+            List<TimeType> timeTypes = timeTypeMapper.selectList(new QueryWrapper<TimeType>().eq("sync_dingding", 1));
+            List<Integer> companyIds = timeTypes.stream().map(TimeType::getCompanyId).collect(Collectors.toList());
+            List<CompanyDingding> dingdingList = companyDingdingMapper.selectList(new QueryWrapper<CompanyDingding>().in("company_id", companyIds));
+            for (CompanyDingding dingding : dingdingList) {
+                syncOneComp(dingding, userId, startDate, endDate);
+            }
+        }
+    }
+
     @Override
     @Override
     public HttpRespMsg refreshUserCardTime(Integer companyId, String userId, String date) {
     public HttpRespMsg refreshUserCardTime(Integer companyId, String userId, String date) {
         CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
         CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));

+ 7 - 63
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ExcelExportServiceImpl.java

@@ -334,36 +334,20 @@ public class ExcelExportServiceImpl implements ExcelExportService {
             //文件名不能含有路径,得替换掉
             //文件名不能含有路径,得替换掉
             title = title.replace("\\", "@");
             title = title.replace("\\", "@");
         }
         }
-        String resp = ExcelUtil.exportShanghaiHangKongList(totalMap, downloadPath);
-        String fileUrlSuffix = title + ".xlsx";
-        if(wxCorpInfo != null && wxCorpInfo.getSaasSyncContact() == 1){
-            FileSystemResource fileSystemResource = new FileSystemResource(path+fileUrlSuffix);
-//            String md5 = DigestUtils.md5Hex(FileUtil.readBytes(fileSystemResource.getFile()));
 
 
+        String resp = ExcelUtil.exportShanghaiHangKongList(title, totalMap, downloadPath);
+        String fileFullName = title + ".xlsx";
+        if(wxCorpInfo != null && wxCorpInfo.getSaasSyncContact() == 1){
+            FileSystemResource fileSystemResource = new FileSystemResource(downloadPath+fileFullName);
             Long checkSize = 20L*1024*1024;
             Long checkSize = 20L*1024*1024;
             if(fileSystemResource.getFile().length() >= checkSize){
             if(fileSystemResource.getFile().length() >= checkSize){
                 httpRespMsg.setError("文件过大,请缩短查询日期范围");
                 httpRespMsg.setError("文件过大,请缩短查询日期范围");
                 return httpRespMsg;
                 return httpRespMsg;
             }
             }
             String jobId = "";
             String jobId = "";
-            String mediaId = wxCorpInfoService.getTranslationMediaId(fileUrlSuffix);
-            jobId = wxCorpInfoService.syncTranslation(wxCorpInfo.getCorpid(),mediaId,fileUrlSuffix, null);
-//            if(fileSystemResource.getFile().length() >= checkSize){
-//                String tmpFileJobId = wxCorpInfoService.getTranslationJobId(fileUrlSuffix,md5,wxCorpInfo);
-//                if(!StringUtils.isEmpty(tmpFileJobId)){
-//                    String mediaId = wxCorpInfoService.getAsyncJobResult(tmpFileJobId,wxCorpInfo);
-//                    jobId = wxCorpInfoService.syncTranslation(wxCorpInfo.getCorpid(),mediaId,fileUrlSuffix, null);
-//                }
-//            }else{
-//                String mediaId = wxCorpInfoService.getTranslationMediaId(fileUrlSuffix);
-//                jobId = wxCorpInfoService.syncTranslation(wxCorpInfo.getCorpid(),mediaId,fileUrlSuffix, null);
-//            }
-
+            String mediaId = wxCorpInfoService.getTranslationMediaId(fileFullName);
+            jobId = wxCorpInfoService.syncTranslation(wxCorpInfo.getCorpid(),mediaId,fileFullName, null);
             System.out.println("上传待转译文件到企业微信, jobId==" + jobId);
             System.out.println("上传待转译文件到企业微信, jobId==" + jobId);
-//            if(StringUtils.isEmpty(jobId)){
-//                httpRespMsg.setError("转义jobId为空,请联系管理员");
-//                return httpRespMsg;
-//            }
             int i = 0;
             int i = 0;
             String syncTranslationResult = null;
             String syncTranslationResult = null;
             /**
             /**
@@ -403,47 +387,7 @@ public class ExcelExportServiceImpl implements ExcelExportService {
                 //httpRespMsg.setError("处理超时...");
                 //httpRespMsg.setError("处理超时...");
                 httpRespMsg.setError(MessageUtils.message("request.outTime"));
                 httpRespMsg.setError(MessageUtils.message("request.outTime"));
             }
             }
-        }
-        else if(dingding != null && dingding.getContactNeedTranslate() == 1){
-            User user = userMapper.selectById(request.getHeader("token"));
-            String mediaId = dingDingService.getTranslationMediaId(fileUrlSuffix,dingding);
-            String jobId = dingDingService.syncTranslation(mediaId,fileUrlSuffix, user.getDingdingUnionid(),dingding);
-            System.out.println("上传待转译文件到钉钉, jobId==" + jobId);
-            int i = 0;
-            String syncTranslationResult = null;
-            /**
-             * 异步上传转译文件的任务完成时会触发回调,在DingDingController中的callback实现了对回调的处理,存储到corpddJobCenter缓存中
-             * 此处轮询查询本地数据库,检测到有任务的回调数据时继续执行查询操作
-             */
-            long t = System.currentTimeMillis();
-            while (i < 30) {
-                if (i < 10) {
-                    Thread.sleep(300);
-                } else if (i < 20){
-                    Thread.sleep(1000);
-                } else {
-                    Thread.sleep(3000);
-                }
-                System.out.println("i=="+i+", "+LocalDateTime.now());
-                Integer status = corpddJobCenter.get(jobId);
-                if (status != null) {
-                    if (status == 1) {
-                        syncTranslationResult = dingDingService.getSyncTranslationResult(jobId,dingding);
-                        corpddJobCenter.remove(jobId);
-                    }
-                    break;
-                }
-                i++;
-            }
-            if (syncTranslationResult != null) {
-                long t2 = System.currentTimeMillis();
-                System.out.println("钉钉转译文件后地址是:"+syncTranslationResult+",耗时:" + (t2 - t) + "ms");
-                httpRespMsg.data = syncTranslationResult;
-            } else {
-                //httpRespMsg.setError("处理超时...");
-                httpRespMsg.setError(MessageUtils.message("request.outTime"));
-            }
-        }else {
+        } else {
             httpRespMsg.data = resp;
             httpRespMsg.data = resp;
         }
         }
         return httpRespMsg;
         return httpRespMsg;

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

@@ -14306,7 +14306,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
         }
         }
         totalMap.put("dataList", dataList);
         totalMap.put("dataList", dataList);
         try {
         try {
-            return excelExportService.exportShanghaiHangKongList(wxCorpInfo,dingding,"工作包令号_主项目个人工时统计表",totalMap,path);
+            String title = "工作包令号_主项目个人工时统计表_" + System.currentTimeMillis();
+            return excelExportService.exportShanghaiHangKongList(wxCorpInfo,dingding,title,totalMap,path);
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
         }
         }

+ 1 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/BeiSenUtils.java

@@ -136,6 +136,7 @@ public class BeiSenUtils {
         if (ResponseEntity.getStatusCode() == HttpStatus.OK) {
         if (ResponseEntity.getStatusCode() == HttpStatus.OK) {
             String resp= ResponseEntity.getBody();
             String resp= ResponseEntity.getBody();
             JSONObject respJson = JSONObject.parseObject(resp);
             JSONObject respJson = JSONObject.parseObject(resp);
+            System.out.println("--------返回数据-------"+respJson);
             if(respJson.getIntValue("code")==200){
             if(respJson.getIntValue("code")==200){
                 resultList.add(respJson.getJSONArray("data"));
                 resultList.add(respJson.getJSONArray("data"));
                 String nextScrollId = respJson.getString("scrollId");
                 String nextScrollId = respJson.getString("scrollId");

+ 2 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/ExcelUtil.java

@@ -1783,9 +1783,9 @@ public class ExcelUtil {
         return "/upload/"+fileName;
         return "/upload/"+fileName;
     }
     }
 
 
-    public static String exportShanghaiHangKongList(LinkedHashMap<String, Object> totalMap, String path) {
+    public static String exportShanghaiHangKongList(String title, LinkedHashMap<String, Object> totalMap, String path) {
         String result="系统提示:Excel文件导出成功!";
         String result="系统提示:Excel文件导出成功!";
-        String fileName= "工作包令号_主项目个人工时统计表"+System.currentTimeMillis()+".xlsx";
+        String fileName= title+".xlsx";
 
 
         try {
         try {
             // 创建工作簿
             // 创建工作簿

+ 10 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ContractMapper.xml

@@ -67,8 +67,11 @@
         <if test="customerOrg!=null">
         <if test="customerOrg!=null">
             and cc.customer_org like  CONCAT('%', #{customerOrg}, '%')
             and cc.customer_org like  CONCAT('%', #{customerOrg}, '%')
         </if>
         </if>
-        <if test="stampDutyStatus!=null">
-            and cc.stamp_duty_status = #{stampDutyStatus}
+        <if test="stampDutyStatusList !=null and stampDutyStatusList.size() > 0">
+            and cc.stamp_duty_status in <foreach collection="stampDutyStatusList" item="stampDutyStatus" separator="," open="(" close=")">#{stampDutyStatus}</foreach>
+        </if>
+        <if test="procurementWay!=null">
+            and cc.procurement_way = #{procurementWay}
         </if>
         </if>
         order by contract.number desc
         order by contract.number desc
         <if test="pageStart!=null and pageSize!=null">
         <if test="pageStart!=null and pageSize!=null">
@@ -112,8 +115,11 @@
         <if test="customerOrg!=null">
         <if test="customerOrg!=null">
             and cc.customer_org like  CONCAT('%', #{customerOrg}, '%')
             and cc.customer_org like  CONCAT('%', #{customerOrg}, '%')
         </if>
         </if>
-        <if test="stampDutyStatus!=null">
-            and cc.stamp_duty_status = #{stampDutyStatus}
+        <if test="stampDutyStatusList !=null and stampDutyStatusList.size() > 0">
+            and cc.stamp_duty_status in <foreach collection="stampDutyStatusList" item="stampDutyStatus" separator="," open="(" close=")">#{stampDutyStatus}</foreach>
+        </if>
+        <if test="procurementWay!=null">
+            and cc.procurement_way = #{procurementWay}
         </if>
         </if>
     </select>
     </select>
 </mapper>
 </mapper>