Merge branch 'dev' into 'test'

国贸2.0系统推送合同回调:消息固定R_JG_MY_00应答,_interfaceType__固定传R_MY_JG_10

See merge request jygk/dsc-base!18
This commit is contained in:
孙承赐
2025-11-11 10:31:06 +00:00
37 changed files with 488 additions and 172 deletions

View File

@@ -85,12 +85,7 @@ public class TmplInscBsnRelController implements BusinessControllerMarker {
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-bsn-rel:query')")
public CommonResult<TmplInscBsnRelRespVO> getTmplInscBsnRel(@RequestParam("id") Long id) {
TmplInscBsnRelDO tmplInscBsnRel = tmplInscBsnRelService.getTmplInscBsnRel(id);
TmplInscBsnRelRespVO tmplInscBsnRelRespVO = BeanUtils.toBean(tmplInscBsnRel, TmplInscBsnRelRespVO.class);
if (tmplInscBsnRelRespVO != null) {
tmplInscBsnRelService.getTmplInscBsnRelDetails(tmplInscBsnRelRespVO);
}
return success(tmplInscBsnRelRespVO);
return success(tmplInscBsnRelService.getTmplInscBsnRel(id));
}
@GetMapping("/page")
@@ -120,4 +115,19 @@ public class TmplInscBsnRelController implements BusinessControllerMarker {
BeanUtils.toBean(list, TmplInscBsnRelRespVO.class));
}
@GetMapping("/value-info")
@Operation(summary = "根据合Id和实例Id获取字段和条款")
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-bsn-rel:query')")
public CommonResult<Map<String, Object>> valueInfo(@RequestParam("cttId") @Valid @NotEmpty(message = "合同Id不能为空") String cttId, @RequestParam("inscId") @Valid @NotEmpty(message = "模版实例id不能为空") String inscId) {
return success(tmplInscBsnRelService.valueInfo(cttId, inscId));
}
@GetMapping("/bsn-info")
@Operation(summary = "根据合id和实例id获取中间表")
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-bsn-rel:query')")
public CommonResult<TmplInscBsnRelRespVO> bseInfo(@RequestParam("cttId") @Valid @NotEmpty(message = "合同Id不能为空") String cttId, @RequestParam("inscId") @Valid @NotEmpty(message = "模版实例id不能为空") String inscId) {
return success(tmplInscBsnRelService.bseInfo(cttId, inscId));
}
}

View File

@@ -5,6 +5,8 @@ import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.module.base.controller.admin.templtp.onlyoffice.pojo.Action;
import com.zt.plat.module.base.controller.admin.templtp.onlyoffice.pojo.History;
import com.zt.plat.module.base.controller.admin.templtp.onlyoffice.pojo.OnlyOfficeCallback;
import com.zt.plat.module.base.dal.dataobject.tmpltp.TmplInscBsnRelDO;
import com.zt.plat.module.base.dal.mysql.tmpltp.TmplInscBsnRelMapper;
import com.zt.plat.module.base.service.tmpltp.TemplateInstanceService;
import com.zt.plat.module.infra.api.file.FileApi;
import com.zt.plat.module.infra.api.file.dto.FileCreateReqDTO;
@@ -29,7 +31,7 @@ import static com.zt.plat.module.base.controller.admin.templtp.onlyoffice.util.U
public class OnlyOfficeCallbackServiceImpl implements OnlyOfficeCallbackService {
private final FileApi fileApi;
private final TemplateInstanceService templateInstanceService;
private final TmplInscBsnRelMapper tmplInscBsnRelMapper;
@Override
public void processCallback(OnlyOfficeCallback callback, String id,String fileName) {
log.info("收到OnlyOffice文档回调: {}", callback.getKey());
@@ -354,7 +356,10 @@ public class OnlyOfficeCallbackServiceImpl implements OnlyOfficeCallbackService
fileInfo.put("name", fileRespDTO.getName());
fileInfo.put("directory", fileRespDTO.getDirectory());
fileInfo.put("key", callback.getKey());
templateInstanceService.updateTemplateInstanceFileUrlByInstanceId(id, JSONObject.toJSONString(fileInfo));
TmplInscBsnRelDO createReqVO = new TmplInscBsnRelDO();
createReqVO.setId(Long.valueOf(id));
createReqVO.setCntt(JSONObject.toJSONString(fileInfo));
tmplInscBsnRelMapper.updateById(createReqVO);
} else {
// 创建文件失败,处理错误
log.error("文件创建失败,错误信息:{}", result.getMsg());

View File

@@ -8,7 +8,7 @@ import java.util.List;
@Schema(description = "管理后台 - 合同动态表单 响应 VO")
@Data
public class FieldAndClauseRespVO {
@Schema(description = "模板分类")
@Schema(description = "模板字段")
List<TmplFldRespVO> tmplFldRespVOS;
@Schema(description = "条款")
List<TmplItmRespVO> tmplItmRespVOS;

View File

@@ -42,18 +42,18 @@ public class TmplInscBsnRelRespVO {
private List<String> deptIds;
@Schema(description = "实例字段;这个是实例字段绑定的字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
private List<TemplateInstanceDataRespVO> templateInstanceDataRespVOS;
// @Schema(description = "实例字段;这个是实例字段绑定的字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
// private List<TemplateInstanceDataRespVO> templateInstanceDataRespVOS;
@Schema(description = "实例条款;这个是实例条款绑定的条款;", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
private List<TemplateInstanceItemRespVO> instanceItemRespVOS;
// @Schema(description = "实例条款;这个是实例条款绑定的条款;", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
// private List<TemplateInstanceItemRespVO> instanceItemRespVOS;
@Schema(description = "使用部门编", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
private List<DeptRespDTO> DeptRespVOS;
@Schema(description = "模版实例名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "测试分类名称")
@ExcelProperty("模版实例名称")
private String inscName;
// @Schema(description = "模版实例名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "测试分类名称")
// @ExcelProperty("模版实例名称")
// private String inscName;
@Schema(description = "业务实例字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
@ExcelProperty("业务实例字段")

View File

@@ -53,7 +53,7 @@ public interface TmplInscBsnRelService {
* @param id 编号
* @return 模板实例与业务中间
*/
TmplInscBsnRelDO getTmplInscBsnRel(Long id);
TmplInscBsnRelRespVO getTmplInscBsnRel(Long id);
/**
* 获得模板实例与业务中间分页
@@ -70,9 +70,22 @@ public interface TmplInscBsnRelService {
void getTmplInscBsnRelDetails(TmplInscBsnRelRespVO tmplInscBsnRelRespVO);
/**
* 新cntt
* 新cntt
*
* @param bsnId ,params
*/
void updateCntt(Long bsnId,String params);
/**
* 获取字段和条款
*
* @param cttId ,inscId
*/
Map<String,Object> valueInfo(String cttId,String inscId);
/**
* 获取中间表
*
* @param cttId ,inscId
*/
TmplInscBsnRelRespVO bseInfo(String cttId,String inscId);
}

View File

@@ -69,5 +69,12 @@ public interface TmplInscDatBsnService {
*
*/
void deleteTmplInscDatBsnListByBsnIds(@Valid @NotEmpty(message = "业务编号不能为空") List<String> ids);
/**
* 通过业务id查询业务字段
*
* @param id 业务id
*
*/
List<TmplInscDatBsnRespVO> getTmplInscDatBsnListByBsnId(@Valid @NotEmpty(message = "业务编号不能为空") String id);
}

View File

@@ -24,6 +24,7 @@ import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.e
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
import static com.zt.plat.module.base.enums.ErrorCodeConstants.*;
import static com.zt.plat.module.tmpltp.enums.ErrorCodeConstants.TMPL_INSC_DAT_BSN_EXISTS;
import static com.zt.plat.module.tmpltp.enums.ErrorCodeConstants.TMPL_INSC_DAT_BSN_NOT_EXISTS;
/**
@@ -40,12 +41,20 @@ public class TmplInscDatBsnServiceImpl implements TmplInscDatBsnService {
@Override
public TmplInscDatBsnRespVO createTmplInscDatBsn(TmplInscDatBsnSaveReqVO createReqVO) {
//判断存在
validateTmplInscDatBsnExistsByKey(createReqVO);
// 插入
TmplInscDatBsnDO tmplInscDatBsn = BeanUtils.toBean(createReqVO, TmplInscDatBsnDO.class);
tmplInscDatBsnMapper.insert(tmplInscDatBsn);
// 返回
return BeanUtils.toBean(tmplInscDatBsn, TmplInscDatBsnRespVO.class);
}
private void validateTmplInscDatBsnExistsByKey(TmplInscDatBsnSaveReqVO createReqVO) {
List<TmplInscDatBsnDO> tmplInscDatBsnDOS = tmplInscDatBsnMapper.selectList(TmplInscDatBsnDO::getInscFldId, createReqVO.getInscFldId());
if (!tmplInscDatBsnDOS.isEmpty()) {
throw exception(TMPL_INSC_DAT_BSN_EXISTS);
}
}
@Override
public void updateTmplInscDatBsn(TmplInscDatBsnSaveReqVO updateReqVO) {
@@ -101,4 +110,10 @@ public class TmplInscDatBsnServiceImpl implements TmplInscDatBsnService {
tmplInscDatBsnMapper.update(new LambdaUpdateWrapper<TmplInscDatBsnDO>().in(TmplInscDatBsnDO::getBsnId, ids).set(TmplInscDatBsnDO::getDeleted, 1));
}
@Override
public List<TmplInscDatBsnRespVO> getTmplInscDatBsnListByBsnId(String id) {
List<TmplInscDatBsnDO> tmplInscDatBsnDOS = tmplInscDatBsnMapper.selectList(TmplInscDatBsnDO::getBsnId, id);
return BeanUtils.toBean(tmplInscDatBsnDOS, TmplInscDatBsnRespVO.class);
}
}

View File

@@ -67,5 +67,12 @@ public interface TmplInscItmBsnService {
* @param ids 编号
*/
void deleteTmplInscDatBsnListByBsnIds(@Valid @NotEmpty(message = "业务编号不能为空") List<String> ids);
/**
* 获取条款值列表
*
* @param bsnId 业务编号
* @return TmplInscItmBsnRespVO
*/
List<TmplInscItmBsnRespVO> getTmplInscItmBsnList(@Valid @NotEmpty(message = "创建信息不能为空")String bsnId);
}

View File

@@ -12,6 +12,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import com.zt.plat.module.base.controller.admin.templtp.vo.*;
import com.zt.plat.framework.common.pojo.PageResult;
@@ -19,11 +20,11 @@ import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.util.object.BeanUtils;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
import static com.zt.plat.module.base.enums.ErrorCodeConstants.*;
import static com.zt.plat.module.tmpltp.enums.ErrorCodeConstants.TMPL_INSC_ITM_BSN_EXISTS;
import static com.zt.plat.module.tmpltp.enums.ErrorCodeConstants.TMPL_INSC_ITM_BSN_NOT_EXISTS;
/**
@@ -40,6 +41,8 @@ public class TmplInscItmBsnServiceImpl implements TmplInscItmBsnService {
@Override
public TmplInscItmBsnRespVO createTmplInscItmBsn(TmplInscItmBsnSaveReqVO createReqVO) {
//校验存在
validateTmplInscItmBsnExistsByKey(createReqVO);
// 插入
TmplInscItmBsnDO tmplInscItmBsn = BeanUtils.toBean(createReqVO, TmplInscItmBsnDO.class);
tmplInscItmBsnMapper.insert(tmplInscItmBsn);
@@ -47,6 +50,13 @@ public class TmplInscItmBsnServiceImpl implements TmplInscItmBsnService {
return BeanUtils.toBean(tmplInscItmBsn, TmplInscItmBsnRespVO.class);
}
void validateTmplInscItmBsnExistsByKey(TmplInscItmBsnSaveReqVO createReqVO) {
List<TmplInscItmBsnDO> tmplInscItmBsnDOS = tmplInscItmBsnMapper.selectList(TmplInscItmBsnDO::getBsnId, createReqVO.getBsnId(), TmplInscItmBsnDO::getInscItmId, createReqVO.getBsnId());
if (!tmplInscItmBsnDOS.isEmpty()){
throw exception(TMPL_INSC_ITM_BSN_EXISTS);
}
}
@Override
public void updateTmplInscItmBsn(TmplInscItmBsnSaveReqVO updateReqVO) {
// 校验存在
@@ -65,12 +75,12 @@ public class TmplInscItmBsnServiceImpl implements TmplInscItmBsnService {
}
@Override
public void deleteTmplInscItmBsnListByIds(List<Long> ids) {
public void deleteTmplInscItmBsnListByIds(List<Long> ids) {
// 校验存在
validateTmplInscItmBsnExists(ids);
// 删除
tmplInscItmBsnMapper.deleteByIds(ids);
}
}
private void validateTmplInscItmBsnExists(List<Long> ids) {
List<TmplInscItmBsnDO> list = tmplInscItmBsnMapper.selectByIds(ids);
@@ -101,4 +111,10 @@ public class TmplInscItmBsnServiceImpl implements TmplInscItmBsnService {
tmplInscItmBsnMapper.update(new LambdaUpdateWrapper<TmplInscItmBsnDO>().in(TmplInscItmBsnDO::getBsnId, ids).set(TmplInscItmBsnDO::getDeleted, 1));
}
@Override
public List<TmplInscItmBsnRespVO> getTmplInscItmBsnList(String bsnId) {
List<TmplInscItmBsnDO> tmplInscItmBsnDOS = tmplInscItmBsnMapper.selectList(TmplInscItmBsnDO::getBsnId, bsnId);
return BeanUtils.toBean(tmplInscItmBsnDOS, TmplInscItmBsnRespVO.class);
}
}