Commit 41167741 authored by hongguangwu's avatar hongguangwu

MVP1.7.16-去掉电子签的审核日志

parent 0afa14a7
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
/**
* 法大大专业版公司信息表
*
* @author hgw
* @date 2025-10-22 17:43:17
*/
@Data
@TableName("t_fasc_company")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "法大大专业版公司信息表")
public class TFascCompany extends BaseEntity {
/**
* id
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("id")
@Schema(description = "id")
private String id;
/**
* 公司主体
*/
@ExcelAttribute(name = "公司主体", maxLength = 100)
@Length(max = 100, message = "公司主体不能超过100个字符")
@ExcelProperty("公司主体")
@Schema(description = "公司主体")
private String companyName;
/**
* APPID
*/
@ExcelAttribute(name = "APPID", maxLength = 100)
@Length(max = 100, message = "APPID不能超过100个字符")
@ExcelProperty("APPID")
@Schema(description = "APPID")
private String appId;
/**
* AppSecret
*/
@ExcelAttribute(name = "AppSecret", maxLength = 100)
@Length(max = 100, message = "AppSecret不能超过100个字符")
@ExcelProperty("AppSecret")
@Schema(description = "AppSecret")
private String appSecret;
/**
* AppUrl
*/
@ExcelAttribute(name = "AppUrl", maxLength = 100)
@Length(max = 100, message = "AppUrl不能超过100个字符")
@ExcelProperty("AppUrl")
@Schema(description = "AppUrl")
private String appUrl;
/**
* openId
*/
@ExcelAttribute(name = "openId", maxLength = 100)
@Length(max = 100, message = "openId不能超过100个字符")
@ExcelProperty("openId")
@Schema(description = "openId")
private String openId;
}
......@@ -51,6 +51,14 @@ public class TFascTemplate extends BaseEntity {
@ExcelProperty("id")
@Schema(description = "id")
private String id;
/**
* 公司主体Id
*/
@ExcelAttribute(name = "公司主体Id", maxLength = 100)
@Length(max = 100, message = "公司主体Id不能超过100个字符")
@ExcelProperty("公司主体Id")
@Schema(description = "公司主体Id")
private String companyId;
/**
* 公司主体
*/
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TFascCompany;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 法大大专业版公司信息表
*
* @author hgw
* @date 2025-10-22 17:43:17
*/
@Mapper
public interface TFascCompanyMapper extends BaseMapper<TFascCompany> {
/**
* 法大大专业版公司信息表简单分页查询
* @return
*/
List<TFascCompany> getTFascCompanyAllList();
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TFascCompany;
import java.util.List;
/**
* 法大大专业版公司信息表
*
* @author hgw
* @date 2025-10-22 17:43:17
*/
public interface TFascCompanyService extends IService<TFascCompany> {
/**
* 法大大专业版公司信息表简单分页查询
*
* @return
*/
List<TFascCompany> getTFascCompanyAllList();
}
......@@ -57,106 +57,114 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
private final TEmployeeContractPreMapper tEmployeeContractPreMapper;
private final TEmployeeContractInfoMapper tEmployeeContractInfoMapper;
private final TAttaInfoMapper tAttaInfoMapper;
private final TFascCompanyService tFascCompanyService;
private final OSSUtil ossUtil;
private final static String FASC_NO_CONTRACT = "未找到合同自动化";
private final static String FASC_NO_EMP_CONTRACT = "未找到自动生成的员工合同";
private final static String FASC_NO_TEMPLATE = "未找到新法大大模板";
private static final String FASC_NO_CONTRACT = "未找到合同自动化";
private static final String FASC_NO_EMP_CONTRACT = "未找到自动生成的员工合同";
private static final String FASC_NO_TEMPLATE = "未找到新法大大模板";
@Override
public R<String> getTemplate(String templateName) throws ApiException {
// templateName 签署任务模板名称
List<SignTemplateListInfo> list = fascUtil.getTemplateList(templateName, tFascPushLogService);
if (list != null && !list.isEmpty()) {
List<TFascTemplate> tList = new ArrayList<>();
List<TFascTemplateDetail> detailList = new ArrayList<>();
fascUtil.getTemplateDetailList(list, tList, detailList, tFascPushLogService);
// 拉取到数据再更新:
if (!tList.isEmpty() && !detailList.isEmpty()) {
String editContent1 = "定时任务同步,拉取到数据";
String editContent2 = "定时任务同步,法大大无该数据";
List<TFascTemplate> updateMain = new ArrayList<>();
List<TFascTemplateDetail> updateDetail = new ArrayList<>();
List<TFascTemplate> allMain = tFascTemplateService.getTFascTemplateListAll(null);
List<TFascTemplateDetail> allDetail = tFascTemplateDetailService.getTFascTemplateDetailList(null);
List<TFascEditLog> logList = new ArrayList<>();
if (allMain == null || allMain.isEmpty()) {
// 都是新的:
tFascTemplateService.saveBatch(tList);
tFascTemplateDetailService.saveOrUpdateBatch(detailList);
for (TFascTemplate t : tList) {
this.addFascLogToList(t.getId(), CommonConstants.ONE_STRING, editContent1, logList);
}
for (TFascTemplateDetail t : detailList) {
this.addFascLogToList(t.getId(), CommonConstants.TWO_STRING, editContent1, logList);
}
} else {
// 混合老新数据
Map<String, TFascTemplate> oldMainMap = new HashMap<>();
Map<String, TFascTemplateDetail> oldDetailMap = new HashMap<>();
for (TFascTemplate t : allMain) {
oldMainMap.put(t.getSignTemplateId(), t);
}
for (TFascTemplateDetail t : allDetail) {
oldDetailMap.put(t.getSignTemplateId() + CommonConstants.DOWN_LINE_STRING + t.getFascFieldId(), t);
}
// 主表:
TFascTemplate oldMain;
String logId;
for (TFascTemplate t : tList) {
oldMain = oldMainMap.get(t.getSignTemplateId());
if (oldMain != null) {
t.setId(oldMain.getId());
List<TFascCompany> companyList = tFascCompanyService.getTFascCompanyAllList();
if (companyList != null && !companyList.isEmpty()) {
for (TFascCompany company : companyList) {
// templateName 签署任务模板名称
List<SignTemplateListInfo> list = fascUtil.getTemplateList(templateName, tFascPushLogService, company);
if (list != null && !list.isEmpty()) {
List<TFascTemplate> tList = new ArrayList<>();
List<TFascTemplateDetail> detailList = new ArrayList<>();
fascUtil.getTemplateDetailList(list, tList, detailList, tFascPushLogService, company);
// 拉取到数据再更新:
if (!tList.isEmpty() && !detailList.isEmpty()) {
String editContent1 = "定时任务同步,拉取到数据";
String editContent2 = "定时任务同步,法大大无该数据";
List<TFascTemplate> updateMain = new ArrayList<>();
List<TFascTemplateDetail> updateDetail = new ArrayList<>();
List<TFascTemplate> allMain = tFascTemplateService.getTFascTemplateListAll(null);
List<TFascTemplateDetail> allDetail = tFascTemplateDetailService.getTFascTemplateDetailList(null);
List<TFascEditLog> logList = new ArrayList<>();
if (allMain == null || allMain.isEmpty()) {
// 都是新的:
tFascTemplateService.saveBatch(tList);
tFascTemplateDetailService.saveOrUpdateBatch(detailList);
for (TFascTemplate t : tList) {
this.addFascLogToList(t.getId(), CommonConstants.ONE_STRING, editContent1, logList);
}
for (TFascTemplateDetail t : detailList) {
this.addFascLogToList(t.getId(), CommonConstants.TWO_STRING, editContent1, logList);
}
} else {
logId = String.valueOf(UUID.randomUUID()).replaceAll("-", "");
t.setId(logId);
// 混合老新数据
Map<String, TFascTemplate> oldMainMap = new HashMap<>();
Map<String, TFascTemplateDetail> oldDetailMap = new HashMap<>();
for (TFascTemplate t : allMain) {
oldMainMap.put(t.getSignTemplateId(), t);
}
for (TFascTemplateDetail t : allDetail) {
oldDetailMap.put(t.getSignTemplateId() + CommonConstants.DOWN_LINE_STRING + t.getFascFieldId(), t);
}
// 主表:
TFascTemplate oldMain;
String logId;
for (TFascTemplate t : tList) {
oldMain = oldMainMap.get(t.getSignTemplateId());
if (oldMain != null) {
t.setId(oldMain.getId());
} else {
logId = String.valueOf(UUID.randomUUID()).replaceAll("-", "");
t.setId(logId);
}
this.addFascLogToList(t.getId(), CommonConstants.ONE_STRING, editContent1, logList);
updateMain.add(t);
oldMainMap.remove(t.getSignTemplateId());
}
for (TFascTemplate t : oldMainMap.values()) {
this.addFascLogToList(t.getId(), CommonConstants.ONE_STRING, editContent2, logList);
t.setDeleteFlag(CommonConstants.DELETE_FLAG);
updateMain.add(t);
}
// 映射表:
TFascTemplateDetail oldDetail;
for (TFascTemplateDetail t : detailList) {
oldDetail = oldDetailMap.get(t.getSignTemplateId() + CommonConstants.DOWN_LINE_STRING + t.getFascFieldId());
if (oldDetail != null) {
t.setId(oldDetail.getId());
t.setHrField(oldDetail.getHrField());
t.setHrFieldId(oldDetail.getHrFieldId());
} else {
logId = String.valueOf(UUID.randomUUID()).replaceAll("-", "");
t.setId(logId);
}
this.addFascLogToList(t.getId(), CommonConstants.TWO_STRING, editContent1, logList);
updateDetail.add(t);
oldDetailMap.remove(t.getSignTemplateId() + CommonConstants.DOWN_LINE_STRING + t.getFascFieldId());
}
for (TFascTemplateDetail t : oldDetailMap.values()) {
this.addFascLogToList(t.getId(), CommonConstants.TWO_STRING, editContent2, logList);
t.setDeleteFlag(CommonConstants.DELETE_FLAG);
updateDetail.add(t);
}
}
this.addFascLogToList(t.getId(), CommonConstants.ONE_STRING, editContent1, logList);
updateMain.add(t);
oldMainMap.remove(t.getSignTemplateId());
}
for (TFascTemplate t : oldMainMap.values()) {
this.addFascLogToList(t.getId(), CommonConstants.ONE_STRING, editContent2, logList);
t.setDeleteFlag(CommonConstants.DELETE_FLAG);
updateMain.add(t);
}
// 映射表:
TFascTemplateDetail oldDetail;
for (TFascTemplateDetail t : detailList) {
oldDetail = oldDetailMap.get(t.getSignTemplateId() + CommonConstants.DOWN_LINE_STRING + t.getFascFieldId());
if (oldDetail != null) {
t.setId(oldDetail.getId());
t.setHrField(oldDetail.getHrField());
t.setHrFieldId(oldDetail.getHrFieldId());
} else {
logId = String.valueOf(UUID.randomUUID()).replaceAll("-", "");
t.setId(logId);
// 更新日志
if (!logList.isEmpty()) {
tFascEditLogService.saveBatch(logList);
}
this.addFascLogToList(t.getId(), CommonConstants.TWO_STRING, editContent1, logList);
updateDetail.add(t);
oldDetailMap.remove(t.getSignTemplateId() + CommonConstants.DOWN_LINE_STRING + t.getFascFieldId());
}
for (TFascTemplateDetail t : oldDetailMap.values()) {
this.addFascLogToList(t.getId(), CommonConstants.TWO_STRING, editContent2, logList);
t.setDeleteFlag(CommonConstants.DELETE_FLAG);
updateDetail.add(t);
// 更新模板
if (!updateMain.isEmpty()) {
tFascTemplateService.saveOrUpdateBatch(updateMain);
}
// 更新模板映射
if (!updateDetail.isEmpty()) {
tFascTemplateDetailService.saveOrUpdateBatch(updateDetail);
}
// 重新刷新主模板表的必填是否已填
tFascTemplateDetailService.initFascTemplateIsMust(null);
}
}
// 更新日志
if (!logList.isEmpty()) {
tFascEditLogService.saveBatch(logList);
}
// 更新模板
if (!updateMain.isEmpty()) {
tFascTemplateService.saveOrUpdateBatch(updateMain);
}
// 更新模板映射
if (!updateDetail.isEmpty()) {
tFascTemplateDetailService.saveOrUpdateBatch(updateDetail);
}
// 重新刷新主模板表的必填是否已填
tFascTemplateDetailService.initFascTemplateIsMust(null);
}
}
return R.ok();
......@@ -166,7 +174,17 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
@Override
public R<String> getTemplateDetailUrl(String signTemplateId) throws ApiException {
// templateName 签署任务模板名称
return fascUtil.getTemplateDetailUrl(signTemplateId, tFascPushLogService);
TFascCompany company = null;
TFascTemplate tFascTemplate = tFascTemplateService.getOne(Wrappers.<TFascTemplate>query()
.lambda().eq(TFascTemplate::getSignTemplateId, signTemplateId)
.last(CommonConstants.LAST_ONE_SQL));
if (tFascTemplate != null && Common.isNotNull(tFascTemplate.getCompanyId())) {
company = tFascCompanyService.getById(tFascTemplate.getCompanyId());
}
if (company == null) {
return R.failed("无公司信息,请检查数据!");
}
return fascUtil.getTemplateDetailUrl(signTemplateId, tFascPushLogService, company);
}
/**
......@@ -231,7 +249,9 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
List<TFascTemplateDetail> detailList = tFascTemplateDetailService.getTFascTemplateDetailList(detail);
// - 判断是否入职超过1个月——接口入口做了
R<String> requestInfo = fascUtil.submitContract(contract, tFascPushLogService, tEmployeeContractPreMapper, tFascTemplate, detailList);
TFascCompany company = tFascCompanyService.getById(tFascTemplate.getCompanyId());
R<String> requestInfo = fascUtil.submitContract(contract, tFascPushLogService, tEmployeeContractPreMapper, tFascTemplate, detailList, company);
return requestInfo;
}
......@@ -254,9 +274,25 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
return R.failed("无requestId,请检查数据");
}
// TODO - 判断什么状态撤销等,需要产品定
TFascCompany company = getTFascCompany(contract);
if (company == null) {
return R.failed("无公司信息,请检查数据!");
}
return fascUtil.cancelTask(contract, tFascPushLogService, tEmployeeContractPreMapper, company);
return fascUtil.cancelTask(contract, tFascPushLogService, tEmployeeContractPreMapper);
}
private TFascCompany getTFascCompany(TEmployeeContractPre contract) {
TFascCompany company = null;
if (Common.isNotNull(contract.getFadadaTemplateId())) {
TFascTemplate tFascTemplate = tFascTemplateService.getOne(Wrappers.<TFascTemplate>query()
.lambda().eq(TFascTemplate::getSignTemplateId, contract.getFadadaTemplateId())
.last(CommonConstants.LAST_ONE_SQL));
if (tFascTemplate != null && Common.isNotNull(tFascTemplate.getCompanyId())) {
company = tFascCompanyService.getById(tFascTemplate.getCompanyId());
}
}
return company;
}
/**
......@@ -278,7 +314,11 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
}
// TODO - 判断什么状态催办等,需要产品定
return fascUtil.urgeTask(contract, tFascPushLogService, tEmployeeContractPreMapper);
TFascCompany company = getTFascCompany(contract);
if (company == null) {
return R.failed("无公司信息,请检查数据!");
}
return fascUtil.urgeTask(contract, tFascPushLogService, tEmployeeContractPreMapper, company);
}
/**
......@@ -299,7 +339,11 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
// return R.failed("无requestId,请检查数据")
return false;
}
return fascUtil.getFileByRequestId(contract, tFascPushLogService, tAttaInfoMapper, ossUtil);
TFascCompany company = getTFascCompany(contract);
if (company == null) {
return false;
}
return fascUtil.getFileByRequestId(contract, tFascPushLogService, tAttaInfoMapper, ossUtil, company);
}
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TFascCompany;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TFascCompanyMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TFascCompanyService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 法大大专业版公司信息表
*
* @author hgw
* @date 2025-10-22 17:43:17
*/
@Log4j2
@Service
public class TFascCompanyServiceImpl extends ServiceImpl<TFascCompanyMapper, TFascCompany> implements TFascCompanyService {
/**
* 法大大专业版公司信息表简单分页查询
*
* @return
*/
@Override
public List<TFascCompany> getTFascCompanyAllList() {
return baseMapper.getTFascCompanyAllList();
}
}
......@@ -55,7 +55,7 @@ public class FascUtil {
@Autowired
private RedisTemplate redisTemplate;
@Autowired
private FascConfig fascConfig;
//private FascConfig fascConfig;
private static final SerializerFeature[] features = new SerializerFeature[]{
WriteMapNullValue, WriteNullNumberAsZero, WriteNullListAsEmpty,
......@@ -68,14 +68,14 @@ public class FascUtil {
* @Date: 2023/7/28 14:46
* @return: java.lang.String
**/
public String getFascToken(OpenApiClient openApiClient) throws ApiException {
public String getFascToken(OpenApiClient openApiClient, TFascCompany company) throws ApiException {
String tokenKey = CacheConstants.FASC_ACCOSS_TOKEN;
Object wxToken = redisTemplate.opsForValue().get(tokenKey);
if (null != wxToken) {
return String.valueOf(wxToken);
}
if (openApiClient == null) {
openApiClient = new OpenApiClient(fascConfig.getAppId(), fascConfig.getAppSecret(), fascConfig.getAppUrl());
openApiClient = new OpenApiClient(company.getAppId(), company.getAppSecret(), company.getAppUrl());
}
ServiceClient serviceClient = new ServiceClient(openApiClient);
BaseRes<AccessTokenRes> res = serviceClient.getAccessToken();
......@@ -97,18 +97,18 @@ public class FascUtil {
* @Date: 2025/10/10 17:59
* @return: java.util.List<com.fasc.open.api.v5_1.res.template.SignTemplateListInfo>
**/
public List<SignTemplateListInfo> getTemplateList(String templateName, TFascPushLogService tFascPushLogService)
public List<SignTemplateListInfo> getTemplateList(String templateName, TFascPushLogService tFascPushLogService, TFascCompany company)
throws ApiException {
OpenApiClient openApiClient = new OpenApiClient(fascConfig.getAppId(), fascConfig.getAppSecret(), fascConfig.getAppUrl());
OpenApiClient openApiClient = new OpenApiClient(company.getAppId(), company.getAppSecret(), company.getAppUrl());
TemplateClient templateClient = new TemplateClient(openApiClient);
String accessToken = this.getFascToken(openApiClient);
String accessToken = this.getFascToken(openApiClient, company);
GetSignTemplateListReq getSignTemplateListReq = new GetSignTemplateListReq();
getSignTemplateListReq.setListPageNo(1);
getSignTemplateListReq.setListPageSize(100);
OpenId ownerId = new OpenId();
ownerId.setIdType(CacheConstants.FASC_ID_TYPE);
ownerId.setOpenId(fascConfig.getOpenId());
ownerId.setOpenId(company.getOpenId());
getSignTemplateListReq.setOwnerId(ownerId);
SignTemplateListFilterInfo signTemplateListFilterInfo = new SignTemplateListFilterInfo();
if (Common.isNotNull(templateName)) {
......@@ -122,7 +122,7 @@ public class FascUtil {
// 新增推送日志
TFascPushLog pushLog = new TFascPushLog();
pushLog.setTransReferenceId(fascConfig.getOpenId());
pushLog.setTransReferenceId(company.getOpenId());
pushLog.setPushData(JSON.toJSONString(getSignTemplateListReq, features));
pushLog.setTaskStatus(CommonConstants.ZERO_STRING);
pushLog.setTypeKey("获取所有模板");
......@@ -148,7 +148,7 @@ public class FascUtil {
getSignTemplateListReq.setListPageNo(i);
pushLog = new TFascPushLog();
pushLog.setTransReferenceId(fascConfig.getOpenId());
pushLog.setTransReferenceId(company.getOpenId());
pushLog.setPushData(JSON.toJSONString(getSignTemplateListReq, features));
pushLog.setTaskStatus(CommonConstants.ZERO_STRING);
pushLog.setTypeKey(pushLog.getId() + "获取所有模板" + i);
......@@ -181,14 +181,15 @@ public class FascUtil {
* @return: void
**/
public void getTemplateDetailList(List<SignTemplateListInfo> templateList, List<TFascTemplate> tList
, List<TFascTemplateDetail> detailList, TFascPushLogService tFascPushLogService) throws ApiException {
OpenApiClient openApiClient = new OpenApiClient(fascConfig.getAppId(), fascConfig.getAppSecret(), fascConfig.getAppUrl());
, List<TFascTemplateDetail> detailList, TFascPushLogService tFascPushLogService
, TFascCompany company) throws ApiException {
OpenApiClient openApiClient = new OpenApiClient(company.getAppId(), company.getAppSecret(), company.getAppUrl());
TemplateClient templateClient = new TemplateClient(openApiClient);
String accessToken = this.getFascToken(openApiClient);
String accessToken = this.getFascToken(openApiClient, company);
OpenId openId = new OpenId();
openId.setIdType(CacheConstants.FASC_ID_TYPE);
openId.setOpenId(fascConfig.getOpenId());
openId.setOpenId(company.getOpenId());
List<DocumentInfo> list = null;
if (templateList != null && !templateList.isEmpty()) {
// 调用查询模板详情接口
......@@ -211,8 +212,9 @@ public class FascUtil {
template.setSignTemplateStatus(mainInfo.getSignTemplateStatus());
template.setFascCreateTime(LocalDateTimeUtils.coverStringToLDT(mainInfo.getCreateTime()));
template.setUpdateTime(LocalDateTimeUtils.coverStringToLDT(mainInfo.getUpdateTime()));
// 有可能不对:template.setCompanyName(mainInfo.getCatalogName());
template.setCompanyName(mainInfo.getCatalogName());
template.setCompanyId(company.getId());
template.setCompanyName(company.getCompanyName());
template.setCreatorMemberName(mainInfo.getCreatorMemberName());
template.setDeleteFlag(CommonConstants.NOT_DELETE_FLAG);
tList.add(template);
......@@ -224,7 +226,7 @@ public class FascUtil {
// 新增推送日志
TFascPushLog pushLog = new TFascPushLog();
pushLog.setTransReferenceId(fascConfig.getOpenId());
pushLog.setTransReferenceId(company.getOpenId());
pushLog.setPushData(JSON.toJSONString(signTemplateDetailReq, features));
pushLog.setTaskStatus(CommonConstants.ZERO_STRING);
pushLog.setTypeKey("获取所有明细映射");
......@@ -312,12 +314,12 @@ public class FascUtil {
public R<String> submitContract(TEmployeeContractPre contract, TFascPushLogService tFascPushLogService
, TEmployeeContractPreMapper tEmployeeContractPreMapper
, TFascTemplate tFascTemplate, List<TFascTemplateDetail> detailList) throws ApiException {
OpenApiClient openApiClient = new OpenApiClient(fascConfig.getAppId(), fascConfig.getAppSecret(), fascConfig.getAppUrl());
String accessToken = this.getFascToken(openApiClient);
, TFascTemplate tFascTemplate, List<TFascTemplateDetail> detailList, TFascCompany company) throws ApiException {
OpenApiClient openApiClient = new OpenApiClient(company.getAppId(), company.getAppSecret(), company.getAppUrl());
String accessToken = this.getFascToken(openApiClient, company);
OpenId openId = new OpenId();
openId.setIdType(CacheConstants.FASC_ID_TYPE);
openId.setOpenId(fascConfig.getOpenId());
openId.setOpenId(company.getOpenId());
SignTaskClient signTaskClient = new SignTaskClient(openApiClient);
CreateWithTemplateReq createWithTemplateReq = new CreateWithTemplateReq();
......@@ -331,10 +333,10 @@ public class FascUtil {
createWithTemplateReq.setSignTemplateId(contract.getFadadaTemplateId());
// 核心代码:设置参与方列表
createWithTemplateReq.setActors(this.buildActors(contract));
createWithTemplateReq.setActors(this.buildActors(contract, company));
// 新增推送日志
TFascPushLog pushLog = new TFascPushLog();
pushLog.setTransReferenceId(fascConfig.getOpenId());
pushLog.setTransReferenceId(company.getOpenId());
pushLog.setPushData(JSON.toJSONString(createWithTemplateReq, features));
pushLog.setTaskStatus(CommonConstants.ZERO_STRING);
String empIdCard = contract.getEmpIdcard();
......@@ -505,11 +507,11 @@ public class FascUtil {
/**
* 构建参与方列表
*/
private List<AddActorsTempInfo> buildActors(TEmployeeContractPre contract) {
private List<AddActorsTempInfo> buildActors(TEmployeeContractPre contract, TFascCompany company) {
List<AddActorsTempInfo> actors = new ArrayList<>();
// 添加企业方(甲方)
actors.add(buildCompanyActor(contract));
actors.add(buildCompanyActor(contract, company));
// 核心代码:添加员工方(乙方)
actors.add(buildEmployeeActor(contract));
......@@ -520,7 +522,7 @@ public class FascUtil {
/**
* 构建企业方参与方
*/
private AddActorsTempInfo buildCompanyActor(TEmployeeContractPre contract) {
private AddActorsTempInfo buildCompanyActor(TEmployeeContractPre contract, TFascCompany company) {
AddActorsTempInfo companyActor = new AddActorsTempInfo();
......@@ -535,7 +537,7 @@ public class FascUtil {
actor.setPermissions(Collections.singletonList("sign"));
// 企业OpenId
actor.setActorOpenId(fascConfig.getOpenId());
actor.setActorOpenId(company.getOpenId());
// 通知设置
actor.setSendNotification(true);
......@@ -583,9 +585,9 @@ public class FascUtil {
// 撤销签署
public R<String> cancelTask(TEmployeeContractPre contract, TFascPushLogService tFascPushLogService
, TEmployeeContractPreMapper tEmployeeContractPreMapper) throws ApiException {
OpenApiClient openApiClient = new OpenApiClient(fascConfig.getAppId(), fascConfig.getAppSecret(), fascConfig.getAppUrl());
String accessToken = this.getFascToken(openApiClient);
, TEmployeeContractPreMapper tEmployeeContractPreMapper, TFascCompany company) throws ApiException {
OpenApiClient openApiClient = new OpenApiClient(company.getAppId(), company.getAppSecret(), company.getAppUrl());
String accessToken = this.getFascToken(openApiClient, company);
SignTaskClient signTaskClient = new SignTaskClient(openApiClient);
SignTaskCancelReq signTaskCancelReq = new SignTaskCancelReq();
......@@ -593,7 +595,7 @@ public class FascUtil {
signTaskCancelReq.setAccessToken(accessToken);
// 新增推送日志
TFascPushLog pushLog = new TFascPushLog();
pushLog.setTransReferenceId(fascConfig.getOpenId());
pushLog.setTransReferenceId(company.getOpenId());
pushLog.setPushData(JSON.toJSONString(signTaskCancelReq, features));
pushLog.setTaskStatus(CommonConstants.ZERO_STRING);
String empIdCard = contract.getEmpIdcard();
......@@ -629,9 +631,9 @@ public class FascUtil {
// 催办
public R<String> urgeTask(TEmployeeContractPre contract, TFascPushLogService tFascPushLogService
, TEmployeeContractPreMapper tEmployeeContractPreMapper) throws ApiException {
OpenApiClient openApiClient = new OpenApiClient(fascConfig.getAppId(), fascConfig.getAppSecret(), fascConfig.getAppUrl());
String accessToken = this.getFascToken(openApiClient);
, TEmployeeContractPreMapper tEmployeeContractPreMapper, TFascCompany company) throws ApiException {
OpenApiClient openApiClient = new OpenApiClient(company.getAppId(), company.getAppSecret(), company.getAppUrl());
String accessToken = this.getFascToken(openApiClient, company);
SignTaskClient signTaskClient = new SignTaskClient(openApiClient);
SignTaskBaseReq signTaskBaseReq = new SignTaskBaseReq();
......@@ -640,7 +642,7 @@ public class FascUtil {
// 新增推送日志
TFascPushLog pushLog = new TFascPushLog();
pushLog.setTransReferenceId(fascConfig.getOpenId());
pushLog.setTransReferenceId(company.getOpenId());
pushLog.setPushData(JSON.toJSONString(signTaskClient, features));
pushLog.setTaskStatus(CommonConstants.ZERO_STRING);
String empIdCard = contract.getEmpIdcard();
......@@ -667,20 +669,20 @@ public class FascUtil {
// 获取模板详情预览链接
public R<String> getTemplateDetailUrl(String signTemplateId, TFascPushLogService tFascPushLogService) throws ApiException {
OpenApiClient openApiClient = new OpenApiClient(fascConfig.getAppId(), fascConfig.getAppSecret(), fascConfig.getAppUrl());
String accessToken = this.getFascToken(openApiClient);
public R<String> getTemplateDetailUrl(String signTemplateId, TFascPushLogService tFascPushLogService, TFascCompany company) throws ApiException {
OpenApiClient openApiClient = new OpenApiClient(company.getAppId(), company.getAppSecret(), company.getAppUrl());
String accessToken = this.getFascToken(openApiClient, company);
TemplateClient templateClient = new TemplateClient(openApiClient) ;
GetTemplatePreviewUrlReq getTemplatePreviewUrlReq = new GetTemplatePreviewUrlReq() ;
getTemplatePreviewUrlReq.setOpenCorpId(fascConfig.getOpenId()) ;
getTemplatePreviewUrlReq.setOpenCorpId(company.getOpenId()) ;
getTemplatePreviewUrlReq.setTemplateId(signTemplateId) ;
getTemplatePreviewUrlReq.setAccessToken(accessToken) ;
// 新增推送日志
TFascPushLog pushLog = new TFascPushLog();
pushLog.setTransReferenceId(fascConfig.getOpenId());
pushLog.setTransReferenceId(company.getOpenId());
pushLog.setPushData(JSON.toJSONString(templateClient, features));
pushLog.setTaskStatus(CommonConstants.ZERO_STRING);
pushLog.setTypeKey("获取模板详情预览链接,signTemplateId:" + signTemplateId);
......@@ -704,9 +706,9 @@ public class FascUtil {
// 获取附件
public boolean getFileByRequestId(TEmployeeContractPre contract, TFascPushLogService tFascPushLogService
, TAttaInfoMapper tAttaInfoMapper, OSSUtil ossUtil) throws ApiException {
OpenApiClient openApiClient = new OpenApiClient(fascConfig.getAppId(), fascConfig.getAppSecret(), fascConfig.getAppUrl());
String accessToken = this.getFascToken(openApiClient);
, TAttaInfoMapper tAttaInfoMapper, OSSUtil ossUtil, TFascCompany company) throws ApiException {
OpenApiClient openApiClient = new OpenApiClient(company.getAppId(), company.getAppSecret(), company.getAppUrl());
String accessToken = this.getFascToken(openApiClient, company);
SignTaskClient signTaskClient = new SignTaskClient(openApiClient);
SignTaskGetFileReq signTaskGetFileReq = new SignTaskGetFileReq();
......@@ -715,7 +717,7 @@ public class FascUtil {
// 新增推送日志
TFascPushLog pushLog = new TFascPushLog();
pushLog.setTransReferenceId(fascConfig.getOpenId());
pushLog.setTransReferenceId(company.getOpenId());
pushLog.setPushData(JSON.toJSONString(signTaskClient, features));
pushLog.setTaskStatus(CommonConstants.ZERO_STRING);
String empIdCard = contract.getEmpIdcard();
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.archives.mapper.TFascCompanyMapper">
<resultMap id="tFascCompanyMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TFascCompany">
<id property="id" column="id"/>
<result property="companyName" column="company_name"/>
<result property="appId" column="app_id"/>
<result property="openId" column="open_id"/>
<result property="appSecret" column="app_secret"/>
<result property="appUrl" column="app_url"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.company_name,
a.app_id,
a.app_secret,
a.app_url,
a.open_id,
a.CREATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME
</sql>
<sql id="tFascCompany_where">
<if test="tFascCompany != null">
<if test="tFascCompany.id != null and tFascCompany.id.trim() != ''">
AND a.id = #{tFascCompany.id}
</if>
<if test="tFascCompany.companyName != null and tFascCompany.companyName.trim() != ''">
AND a.company_name = #{tFascCompany.companyName}
</if>
<if test="tFascCompany.appId != null and tFascCompany.appId.trim() != ''">
AND a.app_id = #{tFascCompany.appId}
</if>
<if test="tFascCompany.appSecret != null and tFascCompany.appSecret.trim() != ''">
AND a.app_secret = #{tFascCompany.appSecret}
</if>
<if test="tFascCompany.appUrl != null and tFascCompany.appUrl.trim() != ''">
AND a.app_url = #{tFascCompany.appUrl}
</if>
<if test="tFascCompany.createBy != null and tFascCompany.createBy.trim() != ''">
AND a.CREATE_BY = #{tFascCompany.createBy}
</if>
<if test="tFascCompany.createName != null and tFascCompany.createName.trim() != ''">
AND a.CREATE_NAME = #{tFascCompany.createName}
</if>
<if test="tFascCompany.createTime != null">
AND a.CREATE_TIME = #{tFascCompany.createTime}
</if>
<if test="tFascCompany.updateBy != null and tFascCompany.updateBy.trim() != ''">
AND a.UPDATE_BY = #{tFascCompany.updateBy}
</if>
<if test="tFascCompany.updateTime != null">
AND a.UPDATE_TIME = #{tFascCompany.updateTime}
</if>
</if>
</sql>
<select id="getTFascCompanyAllList" resultMap="tFascCompanyMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_fasc_company a
<where>
1=1
<include refid="tFascCompany_where"/>
</where>
</select>
</mapper>
......@@ -25,6 +25,7 @@
<resultMap id="tFascTemplateMap" type="com.yifu.cloud.plus.v1.yifu.archives.entity.TFascTemplate">
<id property="id" column="id"/>
<result property="companyId" column="company_id"/>
<result property="companyName" column="company_name"/>
<result property="signName" column="sign_name"/>
<result property="signOpenId" column="sign_open_id"/>
......@@ -65,6 +66,7 @@
</resultMap>
<sql id="Base_Column_List">
a.id,
a.company_id,
a.company_name,
a.sign_name,
a.sign_open_id,
......@@ -89,6 +91,9 @@
<if test="tFascTemplate.id != null and tFascTemplate.id.trim() != ''">
AND a.id = #{tFascTemplate.id}
</if>
<if test="tFascTemplate.companyId != null and tFascTemplate.companyId.trim() != ''">
AND a.company_id like concat('%', #{tFascTemplate.companyId}, '%')
</if>
<if test="tFascTemplate.companyName != null and tFascTemplate.companyName.trim() != ''">
AND a.company_name like concat('%', #{tFascTemplate.companyName}, '%')
</if>
......
......@@ -45,8 +45,8 @@
<result property="medicalStartDateReduce" column="MEDICAL_START_DATE_REDUCE"/>
<result property="socialEndDateReduce" column="SOCIAL_END_DATE_REDUCE"/>
<result property="medicalEndDateReduce" column="MEDICAL_END_DATE_REDUCE"/>
<result property="SOCIAL_PRE_REDUCE_START_DATE" column="SOCIAL_PRE_REDUCE_START_DATE"/>
<result property="SOCIAL_PRE_REDUCE_END_DATE" column="SOCIAL_PRE_REDUCE_END_DATE"/>
<result property="socialPreReduceStartDate" column="SOCIAL_PRE_REDUCE_START_DATE"/>
<result property="socialPreReduceEndDate" column="SOCIAL_PRE_REDUCE_END_DATE"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment