Commit 7ba27a0c authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/MVP1.7.18' into MVP1.7.18

parents e2f5885b 552ed67a
...@@ -21,6 +21,7 @@ import com.alibaba.excel.annotation.ExcelProperty; ...@@ -21,6 +21,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
...@@ -28,6 +29,8 @@ import lombok.Data; ...@@ -28,6 +29,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.Length;
import java.time.LocalDateTime;
/** /**
* 法大大专业版公司信息表 * 法大大专业版公司信息表
* *
...@@ -95,5 +98,27 @@ public class TFascCompany extends BaseEntity { ...@@ -95,5 +98,27 @@ public class TFascCompany extends BaseEntity {
@ExcelProperty("场景码") @ExcelProperty("场景码")
@Schema(description = "场景码") @Schema(description = "场景码")
private String businessId; private String businessId;
/**
* 是否删除:0未删除1已删除
*/
@ExcelAttribute(name = "是否删除", maxLength = 1)
@Length(max = 1, message = "是否删除不能超过1个字符")
@ExcelProperty("是否删除")
@Schema(description = "是否删除")
private String deleteFlag;
/**
* 删除人姓名
*/
@ExcelAttribute(name = "删除人姓名", maxLength = 64)
@Length(max = 64, message = "删除人姓名不能超过64个字符")
@ExcelProperty("删除人姓名")
@Schema(description = "删除人姓名")
private String deleteName;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@ExcelAttribute(name = "删除时间")
@ExcelProperty("删除时间")
@Schema(description = "删除时间")
private LocalDateTime deleteTime;
} }
...@@ -11,10 +11,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.FascService; ...@@ -11,10 +11,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.FascService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TFascPushLogService; import com.yifu.cloud.plus.v1.yifu.archives.service.TFascPushLogService;
import com.yifu.cloud.plus.v1.yifu.archives.utils.DoFascTask; import com.yifu.cloud.plus.v1.yifu.archives.utils.DoFascTask;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner; import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
...@@ -22,13 +20,12 @@ import lombok.RequiredArgsConstructor; ...@@ -22,13 +20,12 @@ import lombok.RequiredArgsConstructor;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.*; import java.util.HashMap;
import java.util.Map;
/** /**
* @auther huyc * @auther huyc
...@@ -55,6 +52,30 @@ public class FascController { ...@@ -55,6 +52,30 @@ public class FascController {
private static String FASC_BIZ_CONTENT = "bizContent"; private static String FASC_BIZ_CONTENT = "bizContent";
private static String FASC_SUCCESS = "success"; private static String FASC_SUCCESS = "success";
/**
* @Description: 获取新建模板的Url
* @Author: hgw
* @Date: 2025/9/26 16:21
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(description = "获取新建模板的Url")
@GetMapping("/getCreateNewTemplate")
public R<String> getCreateNewTemplate(@RequestParam String companyId) {
return fascService.getCreateNewTemplate(companyId);
}
/**
* @Description: 获取编辑模板的url
* @Author: hgw
* @Date: 2025/9/26 16:21
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(description = "获取编辑模板的url")
@GetMapping("/getEditNewTemplate")
public R<String> getEditNewTemplate(@RequestParam String id) {
return fascService.getEditNewTemplate(id);
}
/** /**
* @Description: 获取模板 * @Description: 获取模板
* @Author: hgw * @Author: hgw
......
/*
* 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.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TFascCompany;
import com.yifu.cloud.plus.v1.yifu.archives.service.TFascCompanyService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
import java.util.List;
/**
* 法大大专业版公司信息表
*
* @author hgw
* @date 2025-10-22 17:43:17
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tfasccompany")
@Tag(name = "法大大专业版公司信息表管理")
public class TFascCompanyController {
private final TFascCompanyService tFascCompanyService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tFascCompany 法大大专业版公司信息表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TFascCompany>> getTFascCompanyPage(Page<TFascCompany> page, TFascCompany tFascCompany) {
return new R<>(tFascCompanyService.getTFascCompanyPage(page, tFascCompany));
}
/**
* 获取全量列表
*/
@Operation(description = "获取全量列表")
@GetMapping("/getTFascCompanyAllList")
public R<List<TFascCompany>> getTFascCompanyAllList(@RequestParam(required = false) String companyName) {
return new R<>(tFascCompanyService.getTFascCompanyAllList(companyName));
}
/**
* 通过id查询法大大专业版公司信息表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}")
public R<TFascCompany> getById(@PathVariable("id") String id) {
return R.ok(tFascCompanyService.getById(id));
}
/**
* 新增法大大专业版公司信息表
*
* @param tFascCompany 法大大专业版公司信息表
* @return R
*/
@Operation(summary = "新增法大大专业版公司信息表", description = "新增法大大专业版公司信息表:hasPermission('archives_tfasccompany_add')")
@SysLog("新增法大大专业版公司信息表")
@PostMapping
@PreAuthorize("@pms.hasPermission('archives_tfasccompany_add')")
public R<Boolean> save(@RequestBody TFascCompany tFascCompany) {
if (Common.isEmpty(tFascCompany.getCompanyName())) {
return R.failed("请填写公司主体!");
}
int num = tFascCompanyService.getTFascCompanyByNameAndId(tFascCompany.getCompanyName(), null);
if (num > 0) {
return R.failed("该公司主体已存在,请勿重复配置!");
}
R<Boolean> failed = judgeFieldMust(tFascCompany);
if (failed != null) {
return failed;
}
return R.ok(tFascCompanyService.save(tFascCompany));
}
private R<Boolean> judgeFieldMust(TFascCompany tFascCompany) {
if (Common.isEmpty(tFascCompany.getAppId())) {
return R.failed("请填写appId!");
} else if (tFascCompany.getAppId().length() > CommonConstants.INTEGER_HUNDRED) {
return R.failed("appId不能超过100个字符!");
}
if (Common.isEmpty(tFascCompany.getAppSecret())) {
return R.failed("请填写appSecret!");
} else if (tFascCompany.getAppSecret().length() > CommonConstants.INTEGER_HUNDRED) {
return R.failed("appSecret不能超过100个字符!");
}
if (Common.isEmpty(tFascCompany.getAppUrl())) {
return R.failed("请填写appUrl!");
} else if (tFascCompany.getAppUrl().length() > CommonConstants.INTEGER_HUNDRED) {
return R.failed("appUrl不能超过100个字符!");
}
if (Common.isEmpty(tFascCompany.getOpenId())) {
return R.failed("请填写openCorpId!");
} else if (tFascCompany.getOpenId().length() > CommonConstants.INTEGER_HUNDRED) {
return R.failed("openCorpId不能超过100个字符!");
}
if (Common.isEmpty(tFascCompany.getAppUrl())) {
return R.failed("请填写appUrl!");
} else if (tFascCompany.getAppUrl().length() > CommonConstants.INTEGER_HUNDRED) {
return R.failed("appUrl不能超过100个字符!");
}
if (Common.isEmpty(tFascCompany.getBusinessId())) {
return R.failed("请填写businessId!");
} else if (tFascCompany.getBusinessId().length() > CommonConstants.INTEGER_HUNDRED) {
return R.failed("businessId不能超过100个字符!");
}
return null;
}
/**
* 修改法大大专业版公司信息表
*
* @param tFascCompany 法大大专业版公司信息表
* @return R
*/
@Operation(summary = "修改法大大专业版公司信息表", description = "修改法大大专业版公司信息表:hasPermission('archives_tfasccompany_edit')")
@SysLog("修改法大大专业版公司信息表")
@PutMapping
@PreAuthorize("@pms.hasPermission('archives_tfasccompany_edit')")
public R<Boolean> updateById(@RequestBody TFascCompany tFascCompany) {
if (Common.isEmpty(tFascCompany.getId())) {
return R.failed("请传参ID!");
}
if (Common.isEmpty(tFascCompany.getCompanyName())) {
return R.failed("请传参公司主体!");
}
int num = tFascCompanyService.getTFascCompanyByNameAndId(tFascCompany.getCompanyName(), tFascCompany.getId());
if (num > 0) {
return R.failed("该公司主体已存在,请勿重复配置!");
}
R<Boolean> failed = judgeFieldMust(tFascCompany);
if (failed != null) {
return failed;
}
return R.ok(tFascCompanyService.updateById(tFascCompany));
}
/**
* 通过id删除法大大专业版公司信息表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除法大大专业版公司信息表", description = "通过id删除法大大专业版公司信息表:hasPermission('archives_tfasccompany_del')")
@SysLog("通过id删除法大大专业版公司信息表")
@GetMapping("/deleteCompanyById")
@PreAuthorize("@pms.hasPermission('archives_tfasccompany_del')")
public R<String> deleteCompanyById(@RequestParam String id) {
if (CommonConstants.ONE_STRING.equals(id)) {
return R.failed("请勿删除此条数据!");
}
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getNickname())) {
return R.failed("请登录!");
}
TFascCompany tFascCompany = tFascCompanyService.getById(id);
if (tFascCompany == null || Common.isEmpty(tFascCompany.getId())) {
return R.failed("根据ID未找到数据!");
} else {
tFascCompany.setDeleteFlag(CommonConstants.DELETE_FLAG);
tFascCompany.setDeleteName(user.getNickname());
tFascCompany.setDeleteTime(LocalDateTime.now());
tFascCompanyService.updateById(tFascCompany);
return R.ok("已删除!");
}
}
}
...@@ -18,8 +18,11 @@ ...@@ -18,8 +18,11 @@
package com.yifu.cloud.plus.v1.yifu.archives.mapper; package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TFascCompany; import com.yifu.cloud.plus.v1.yifu.archives.entity.TFascCompany;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -35,5 +38,11 @@ public interface TFascCompanyMapper extends BaseMapper<TFascCompany> { ...@@ -35,5 +38,11 @@ public interface TFascCompanyMapper extends BaseMapper<TFascCompany> {
* 法大大专业版公司信息表简单分页查询 * 法大大专业版公司信息表简单分页查询
* @return * @return
*/ */
List<TFascCompany> getTFascCompanyAllList(); List<TFascCompany> getTFascCompanyAllList(@Param("companyName") String companyName);
IPage<TFascCompany> getTFascCompanyPage(Page<TFascCompany> page, @Param("tFascCompany") TFascCompany tFascCompany);
// 查重
int getTFascCompanyByNameAndId(@Param("companyName") String companyName, @Param("id") String id);
} }
...@@ -30,9 +30,15 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R; ...@@ -30,9 +30,15 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
*/ */
public interface FascService extends IService<FddContractInfo> { public interface FascService extends IService<FddContractInfo> {
// 获取新建模板的url
R<String> getCreateNewTemplate(String companyId);
// 获取编辑模板的url(id:模板列表的id)
R<String> getEditNewTemplate(String id);
// 获取模板 // 获取模板
R<String> getTemplate(String templateName) throws ApiException; R<String> getTemplate(String templateName) throws ApiException;
// 获取模板详情预览链接 // 获取模板详情预览链接
R<String> getTemplateDetailUrl(String signTemplateId) throws ApiException; R<String> getTemplateDetailUrl(String signTemplateId) throws ApiException;
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
package com.yifu.cloud.plus.v1.yifu.archives.service; package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TFascCompany; import com.yifu.cloud.plus.v1.yifu.archives.entity.TFascCompany;
...@@ -34,5 +36,11 @@ public interface TFascCompanyService extends IService<TFascCompany> { ...@@ -34,5 +36,11 @@ public interface TFascCompanyService extends IService<TFascCompany> {
* *
* @return * @return
*/ */
List<TFascCompany> getTFascCompanyAllList(); List<TFascCompany> getTFascCompanyAllList(String companyName);
IPage<TFascCompany> getTFascCompanyPage(Page<TFascCompany> page, TFascCompany tFascCompany);
// 查重
int getTFascCompanyByNameAndId(String companyName, String id);
} }
...@@ -72,6 +72,39 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr ...@@ -72,6 +72,39 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
private static final Logger logger = LoggerFactory.getLogger(FascService.class); private static final Logger logger = LoggerFactory.getLogger(FascService.class);
// 获取新建模板的url
@Override
public R<String> getCreateNewTemplate(String companyId) {
if (Common.isEmpty(companyId)) {
return R.failed("请传参公司ID!");
}
TFascCompany company = tFascCompanyService.getById(companyId);
if (company == null || Common.isEmpty(company.getId())) {
return R.failed("未找到公司信息,请刷新后重试!");
}
return fascUtil.getCreateNewTemplate(tFascPushLogService, company);
}
// 获取新建模板的url
@Override
public R<String> getEditNewTemplate(String id) {
if (Common.isEmpty(id)) {
return R.failed("请传参列表ID!");
}
TFascTemplate tFascTemplate = tFascTemplateService.getById(id);
if (tFascTemplate == null || Common.isEmpty(tFascTemplate.getId())) {
return R.failed("未找到模板信息,请刷新后重试!");
}
if (Common.isEmpty(tFascTemplate.getSignTemplateId()) || Common.isEmpty(tFascTemplate.getCompanyId())) {
return R.failed("模板信息缺失,请刷新后重试!");
}
TFascCompany company = tFascCompanyService.getById(tFascTemplate.getCompanyId());
if (company == null || Common.isEmpty(company.getId())) {
return R.failed("未找到公司信息,请刷新后重试!");
}
return fascUtil.getEditNewTemplate(tFascPushLogService, tFascTemplate.getSignTemplateId(), company);
}
@Override @Override
public R<String> getTemplate(String templateName) throws ApiException { public R<String> getTemplate(String templateName) throws ApiException {
...@@ -82,7 +115,7 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr ...@@ -82,7 +115,7 @@ public class FascServiceImpl extends ServiceImpl<FddContractInfoMapper, FddContr
userId = user.getId(); userId = user.getId();
userName = user.getNickname(); userName = user.getNickname();
} }
List<TFascCompany> companyList = tFascCompanyService.getTFascCompanyAllList(); List<TFascCompany> companyList = tFascCompanyService.getTFascCompanyAllList(null);
if (companyList != null && !companyList.isEmpty()) { if (companyList != null && !companyList.isEmpty()) {
// templateName 签署任务模板名称 // templateName 签署任务模板名称
List<TFascTemplate> tList ; List<TFascTemplate> tList ;
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
*/ */
package com.yifu.cloud.plus.v1.yifu.archives.service.impl; package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.entity.TFascCompany;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TFascCompanyMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TFascCompanyMapper;
...@@ -40,7 +42,18 @@ public class TFascCompanyServiceImpl extends ServiceImpl<TFascCompanyMapper, TFa ...@@ -40,7 +42,18 @@ public class TFascCompanyServiceImpl extends ServiceImpl<TFascCompanyMapper, TFa
* @return * @return
*/ */
@Override @Override
public List<TFascCompany> getTFascCompanyAllList() { public List<TFascCompany> getTFascCompanyAllList(String companyName) {
return baseMapper.getTFascCompanyAllList(); return baseMapper.getTFascCompanyAllList(companyName);
}
@Override
public IPage<TFascCompany> getTFascCompanyPage(Page<TFascCompany> page, TFascCompany tFascCompany){
return baseMapper.getTFascCompanyPage(page,tFascCompany);
}
// 查重
@Override
public int getTFascCompanyByNameAndId(String companyName, String id) {
return baseMapper.getTFascCompanyByNameAndId(companyName,id);
} }
} }
...@@ -12,10 +12,7 @@ import com.fasc.open.api.v5_1.client.ServiceClient; ...@@ -12,10 +12,7 @@ import com.fasc.open.api.v5_1.client.ServiceClient;
import com.fasc.open.api.v5_1.client.SignTaskClient; import com.fasc.open.api.v5_1.client.SignTaskClient;
import com.fasc.open.api.v5_1.client.TemplateClient; import com.fasc.open.api.v5_1.client.TemplateClient;
import com.fasc.open.api.v5_1.req.signtask.*; import com.fasc.open.api.v5_1.req.signtask.*;
import com.fasc.open.api.v5_1.req.template.GetSignTemplateListReq; import com.fasc.open.api.v5_1.req.template.*;
import com.fasc.open.api.v5_1.req.template.GetTemplatePreviewUrlReq;
import com.fasc.open.api.v5_1.req.template.SignTemplateDetailReq;
import com.fasc.open.api.v5_1.req.template.SignTemplateListFilterInfo;
import com.fasc.open.api.v5_1.res.service.AccessTokenRes; import com.fasc.open.api.v5_1.res.service.AccessTokenRes;
import com.fasc.open.api.v5_1.res.signtask.CreateSignTaskRes; import com.fasc.open.api.v5_1.res.signtask.CreateSignTaskRes;
import com.fasc.open.api.v5_1.res.signtask.SignTaskGetFileRes; import com.fasc.open.api.v5_1.res.signtask.SignTaskGetFileRes;
...@@ -97,6 +94,92 @@ public class FascUtil { ...@@ -97,6 +94,92 @@ public class FascUtil {
return token; return token;
} }
/**
* @Description: 获取新建模板的url
* @Author: hgw
* @Date: 2025-12-11 15:06:54
**/
public R<String> getCreateNewTemplate(TFascPushLogService tFascPushLogService, TFascCompany company) {
try {
OpenApiClient openApiClient = new OpenApiClient(company.getAppId(), company.getAppSecret(), company.getAppUrl());
String accessToken = this.getFascToken(openApiClient, company);
TemplateClient templateClient = new TemplateClient(openApiClient);
GetTemplateCreateUrlReq getTemplateCreateUrlReq = new GetTemplateCreateUrlReq();
getTemplateCreateUrlReq.setOpenCorpId(company.getOpenId());
getTemplateCreateUrlReq.setType("sign");
getTemplateCreateUrlReq.setAccessToken(accessToken);
// 新增推送日志
TFascPushLog pushLog = new TFascPushLog();
pushLog.setTransReferenceId(company.getOpenId());
pushLog.setPushData(JSON.toJSONString(templateClient, features));
pushLog.setTaskStatus(CommonConstants.ZERO_STRING);
pushLog.setTypeKey("获取新建模板的url,CompanyName:" + company.getCompanyName());
pushLog.setTypeName("获取新建模板的url");
pushLog.setContractId(company.getId());
tFascPushLogService.save(pushLog);
BaseRes<GetTemplateCreateUrlRes> res = templateClient.getTemplateCreateUrl(getTemplateCreateUrlReq);
if (res != null) {
pushLog.setReturnData(JSON.toJSONString(res, features));
pushLog.setTaskStatus(res.isSuccess() ? CommonConstants.ONE_STRING : CommonConstants.TWO_STRING);
tFascPushLogService.updateById(pushLog);
if (res.isSuccess() && Common.isNotNull(res.getData())) {
return R.ok(res.getData().getTemplateCreateUrl());
} else {
return R.failed(res.getMsg());
}
}
return R.failed("res无返回");
} catch (Exception e) {
return R.failed("获取新建模板的url失败:" + e.getMessage());
}
}
/**
* @Description: 获取模板编辑的url
* @Author: hgw
* @Date: 2025-12-11 15:06:54
**/
public R<String> getEditNewTemplate(TFascPushLogService tFascPushLogService, String signTemplateId, TFascCompany company) {
try {
OpenApiClient openApiClient = new OpenApiClient(company.getAppId(), company.getAppSecret(), company.getAppUrl());
String accessToken = this.getFascToken(openApiClient, company);
TemplateClient templateClient = new TemplateClient(openApiClient);
GetTemplateEditUrlReq getTemplateEditUrlReq = new GetTemplateEditUrlReq() ;
getTemplateEditUrlReq.setOpenCorpId(company.getOpenId()) ;
getTemplateEditUrlReq.setTemplateId(signTemplateId) ;
getTemplateEditUrlReq.setAccessToken(accessToken) ;
// 新增推送日志
TFascPushLog pushLog = new TFascPushLog();
pushLog.setTransReferenceId(company.getOpenId());
pushLog.setPushData(JSON.toJSONString(getTemplateEditUrlReq, features));
pushLog.setTaskStatus(CommonConstants.ZERO_STRING);
pushLog.setTypeKey("获取模板编辑的url,signTemplateId:" + signTemplateId);
pushLog.setTypeName("获取模板编辑的url");
pushLog.setContractId(company.getId());
tFascPushLogService.save(pushLog);
BaseRes<GetTemplateEditUrlRes> res = templateClient.getTemplateEditUrl(getTemplateEditUrlReq) ;
if (res != null) {
pushLog.setReturnData(JSON.toJSONString(res, features));
pushLog.setTaskStatus(res.isSuccess() ? CommonConstants.ONE_STRING : CommonConstants.TWO_STRING);
tFascPushLogService.updateById(pushLog);
if (res.isSuccess() && Common.isNotNull(res.getData())) {
return R.ok(res.getData().getTemplateEditUrl());
} else {
return R.failed(res.getMsg());
}
}
return R.failed("res无返回");
} catch (Exception e) {
return R.failed("获取模板编辑的url:" + e.getMessage());
}
}
/** /**
* @Description: 获取模板 * @Description: 获取模板
* @Author: hgw * @Author: hgw
......
...@@ -36,6 +36,9 @@ ...@@ -36,6 +36,9 @@
<result property="updateBy" column="UPDATE_BY"/> <result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/> <result property="updateTime" column="UPDATE_TIME"/>
<result property="businessId" column="business_id"/> <result property="businessId" column="business_id"/>
<result property="deleteFlag" column="DELETE_FLAG"/>
<result property="deleteName" column="DELETE_NAME"/>
<result property="deleteTime" column="DELETE_TIME"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
a.id, a.id,
...@@ -49,7 +52,10 @@ ...@@ -49,7 +52,10 @@
a.CREATE_TIME, a.CREATE_TIME,
a.UPDATE_BY, a.UPDATE_BY,
a.UPDATE_TIME, a.UPDATE_TIME,
a.business_id a.business_id,
a.DELETE_FLAG,
a.DELETE_NAME,
a.DELETE_TIME
</sql> </sql>
<sql id="tFascCompany_where"> <sql id="tFascCompany_where">
<if test="tFascCompany != null"> <if test="tFascCompany != null">
...@@ -57,7 +63,7 @@ ...@@ -57,7 +63,7 @@
AND a.id = #{tFascCompany.id} AND a.id = #{tFascCompany.id}
</if> </if>
<if test="tFascCompany.companyName != null and tFascCompany.companyName.trim() != ''"> <if test="tFascCompany.companyName != null and tFascCompany.companyName.trim() != ''">
AND a.company_name = #{tFascCompany.companyName} AND a.company_name like concat('%', #{tFascCompany.companyName}, '%')
</if> </if>
<if test="tFascCompany.appId != null and tFascCompany.appId.trim() != ''"> <if test="tFascCompany.appId != null and tFascCompany.appId.trim() != ''">
AND a.app_id = #{tFascCompany.appId} AND a.app_id = #{tFascCompany.appId}
...@@ -86,12 +92,37 @@ ...@@ -86,12 +92,37 @@
</if> </if>
</sql> </sql>
<select id="getTFascCompanyAllList" resultMap="tFascCompanyMap"> <select id="getTFascCompanyAllList" resultMap="tFascCompanyMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_fasc_company a
where a.DELETE_FLAG = '0'
<if test="companyName != null and companyName.trim() != ''">
AND a.company_name like concat('%', #{companyName}, '%')
</if>
order by a.CREATE_TIME asc
</select>
<!--tFascCompany简单分页查询,排序顺序,为了总公司在第一位-->
<select id="getTFascCompanyPage" resultMap="tFascCompanyMap">
SELECT SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
FROM t_fasc_company a FROM t_fasc_company a
<where> <where>
1=1 a.DELETE_FLAG = '0'
<include refid="tFascCompany_where"/> <include refid="tFascCompany_where"/>
</where> </where>
order by a.CREATE_TIME asc
</select> </select>
<!--查重 -->
<select id="getTFascCompanyByNameAndId" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_fasc_company a
where a.DELETE_FLAG = '0' and a.company_name = #{companyName}
<if test="id != null and id.trim() != ''">
AND a.id != #{id}
</if>
</select>
</mapper> </mapper>
...@@ -483,7 +483,11 @@ public class SocialFriendConfig { ...@@ -483,7 +483,11 @@ public class SocialFriendConfig {
} }
} else { } else {
if (Common.isNotNull(vo.getYbsfqzcb())) { if (Common.isNotNull(vo.getYbsfqzcb())) {
tszdxx.put("ybsfqzcb", vo.getYbsfqzcb()); if (CommonConstants.ONE_STRING.equals(vo.getYbsfqzcb())) {
tszdxx.put("ybsfqzcb", "是");
} else if (CommonConstants.ZERO_STRING.equals(vo.getYbsfqzcb())) {
tszdxx.put("ybsfqzcb", "否");
}
} }
// 增员、减员必填 // 增员、减员必填
tszdxx.put("qyzgjbylbxcbdjb", arr); tszdxx.put("qyzgjbylbxcbdjb", arr);
......
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