Merge remote-tracking branch 'origin/dev' into test
This commit is contained in:
@@ -7,6 +7,7 @@ import com.zt.plat.module.base.controller.admin.templtp.onlyoffice.service.OnlyO
|
|||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.annotation.security.PermitAll;
|
import jakarta.annotation.security.PermitAll;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -14,6 +15,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/base/onlyoffice")
|
@RequestMapping("/base/onlyoffice")
|
||||||
@Tag(name = "管理后台 - onlyOffice回调")
|
@Tag(name = "管理后台 - onlyOffice回调")
|
||||||
@@ -31,19 +33,21 @@ public class OnlyOfficeCallbackController {
|
|||||||
@PostMapping("/callback/{id}")
|
@PostMapping("/callback/{id}")
|
||||||
@PermitAll
|
@PermitAll
|
||||||
@TenantIgnore
|
@TenantIgnore
|
||||||
public ResponseEntity<Map<String, Integer>> handleCallback(@RequestBody OnlyOfficeCallback callback, @PathVariable String id,@RequestParam("fileName") String fileName) {
|
public ResponseEntity<Map<String, Object>> handleCallback(@RequestBody OnlyOfficeCallback callback, @PathVariable String id,@RequestParam("fileName") String fileName) {
|
||||||
// 处理回调逻辑
|
// 处理回调逻辑
|
||||||
callbackService.processCallback(callback,id,fileName);
|
callbackService.processCallback(callback,id,fileName);
|
||||||
|
log.info("回调参数:【{}】",callback.toString());
|
||||||
// 返回必须的响应,否则OnlyOffice会显示错误
|
// 返回必须的响应,否则OnlyOffice会显示错误
|
||||||
Map<String, Integer> response = new HashMap<>();
|
Map<String, Object> response = new HashMap<>();
|
||||||
response.put("error", 0);
|
response.put("error", 0);
|
||||||
|
// response.put("version", 100);
|
||||||
return new ResponseEntity<>(response, HttpStatus.OK);
|
return new ResponseEntity<>(response, HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理OnlyOffice文档编辑服务发送的回调
|
* 处理OnlyOffice文档编辑服务发送的回调
|
||||||
*/
|
*/
|
||||||
@PostMapping("/contract /callback/{id}")
|
@PostMapping("/contract/callback/{id}")
|
||||||
@PermitAll
|
@PermitAll
|
||||||
@TenantIgnore
|
@TenantIgnore
|
||||||
public ResponseEntity<Map<String, Integer>> handleContractCallback(@RequestBody OnlyOfficeCallback callback, @PathVariable String id,@RequestParam("fileName") String fileName) {
|
public ResponseEntity<Map<String, Integer>> handleContractCallback(@RequestBody OnlyOfficeCallback callback, @PathVariable String id,@RequestParam("fileName") String fileName) {
|
||||||
@@ -52,6 +56,7 @@ public class OnlyOfficeCallbackController {
|
|||||||
// 返回必须的响应,否则OnlyOffice会显示错误
|
// 返回必须的响应,否则OnlyOffice会显示错误
|
||||||
Map<String, Integer> response = new HashMap<>();
|
Map<String, Integer> response = new HashMap<>();
|
||||||
response.put("error", 0);
|
response.put("error", 0);
|
||||||
|
// response.put("version", 0);
|
||||||
return new ResponseEntity<>(response, HttpStatus.OK);
|
return new ResponseEntity<>(response, HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ public class OnlyOfficeCallbackServiceImpl implements OnlyOfficeCallbackService
|
|||||||
fileInfo.put("id",String.valueOf(fileRespDTO.getId()));
|
fileInfo.put("id",String.valueOf(fileRespDTO.getId()));
|
||||||
fileInfo.put("name", fileRespDTO.getName());
|
fileInfo.put("name", fileRespDTO.getName());
|
||||||
fileInfo.put("directory", fileRespDTO.getDirectory());
|
fileInfo.put("directory", fileRespDTO.getDirectory());
|
||||||
|
fileInfo.put("key", callback.getKey());
|
||||||
templateInstanceService.updateTemplateInstanceFileUrlByInstanceId(id, JSONObject.toJSONString(fileInfo));
|
templateInstanceService.updateTemplateInstanceFileUrlByInstanceId(id, JSONObject.toJSONString(fileInfo));
|
||||||
} else {
|
} else {
|
||||||
// 创建文件失败,处理错误
|
// 创建文件失败,处理错误
|
||||||
@@ -352,6 +353,7 @@ public class OnlyOfficeCallbackServiceImpl implements OnlyOfficeCallbackService
|
|||||||
fileInfo.put("id",String.valueOf(fileRespDTO.getId()));
|
fileInfo.put("id",String.valueOf(fileRespDTO.getId()));
|
||||||
fileInfo.put("name", fileRespDTO.getName());
|
fileInfo.put("name", fileRespDTO.getName());
|
||||||
fileInfo.put("directory", fileRespDTO.getDirectory());
|
fileInfo.put("directory", fileRespDTO.getDirectory());
|
||||||
|
fileInfo.put("key", callback.getKey());
|
||||||
templateInstanceService.updateTemplateInstanceFileUrlByInstanceId(id, JSONObject.toJSONString(fileInfo));
|
templateInstanceService.updateTemplateInstanceFileUrlByInstanceId(id, JSONObject.toJSONString(fileInfo));
|
||||||
} else {
|
} else {
|
||||||
// 创建文件失败,处理错误
|
// 创建文件失败,处理错误
|
||||||
|
|||||||
@@ -16,6 +16,11 @@ public class TemplateInstanceDataRespVO {
|
|||||||
@ExcelProperty("主键")
|
@ExcelProperty("主键")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "字段名字", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("字段名字")
|
||||||
|
private String fldName;
|
||||||
|
|
||||||
@Schema(description = "关联实例主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25824")
|
@Schema(description = "关联实例主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25824")
|
||||||
@ExcelProperty("关联实例主键")
|
@ExcelProperty("关联实例主键")
|
||||||
private String inscId;
|
private String inscId;
|
||||||
@@ -24,6 +29,10 @@ public class TemplateInstanceDataRespVO {
|
|||||||
@ExcelProperty("字段标识;关联字段库")
|
@ExcelProperty("字段标识;关联字段库")
|
||||||
private String fldKy;
|
private String fldKy;
|
||||||
|
|
||||||
|
@Schema(description = "字段結構", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("字段結構;")
|
||||||
|
private String fldDoc;
|
||||||
|
|
||||||
@Schema(description = "用户填写的值", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "用户填写的值", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@ExcelProperty("用户填写的值")
|
@ExcelProperty("用户填写的值")
|
||||||
private String fldVal;
|
private String fldVal;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.base.controller.admin.templtp.vo;
|
package com.zt.plat.module.base.controller.admin.templtp.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
|
|||||||
@@ -44,4 +44,12 @@ public class TemplateInstanceDataDO extends BusinessBaseDO {
|
|||||||
@TableField("FLD_VAL")
|
@TableField("FLD_VAL")
|
||||||
private String fldVal;
|
private String fldVal;
|
||||||
|
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String fldName;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String fldDoc;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class TemplateInstanceItemServiceImpl implements TemplateInstanceItemServ
|
|||||||
@Override
|
@Override
|
||||||
public void updateTemplateInstanceItem(TemplateInstanceItemSaveReqVO updateReqVO) {
|
public void updateTemplateInstanceItem(TemplateInstanceItemSaveReqVO updateReqVO) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
validateTemplateInstanceItemExists(updateReqVO.getInscId());
|
validateTemplateInstanceItemExists(updateReqVO.getId());
|
||||||
// 更新
|
// 更新
|
||||||
TemplateInstanceItemDO updateObj = BeanUtils.toBean(updateReqVO, TemplateInstanceItemDO.class);
|
TemplateInstanceItemDO updateObj = BeanUtils.toBean(updateReqVO, TemplateInstanceItemDO.class);
|
||||||
templateInstanceItemMapper.updateById(updateObj);
|
templateInstanceItemMapper.updateById(updateObj);
|
||||||
|
|||||||
@@ -217,18 +217,18 @@ public class TemplateInstanceServiceImpl implements TemplateInstanceService {
|
|||||||
// 校验当前状态是否能够进行发布
|
// 校验当前状态是否能够进行发布
|
||||||
publishReqVOS.forEach(reqVO -> {
|
publishReqVOS.forEach(reqVO -> {
|
||||||
TemplateInstanceDO templateInstanceDO = templateInstanceMapper.selectById(reqVO.getId());
|
TemplateInstanceDO templateInstanceDO = templateInstanceMapper.selectById(reqVO.getId());
|
||||||
if (templateInstanceDO.getCntt()==null||templateInstanceDO.getCntt().isEmpty()){
|
if (templateInstanceDO.getCntt() == null || templateInstanceDO.getCntt().isEmpty()) {
|
||||||
throw exception(TEMPLATE_INSTANCE_FILE_NOT_EXISTS);
|
throw exception(TEMPLATE_INSTANCE_FILE_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
String currentStatus = reqVO.getCurrentStatus();
|
String currentStatus = reqVO.getCurrentStatus();
|
||||||
if (currentStatus.isEmpty()) {
|
if (currentStatus.isEmpty()) {
|
||||||
currentStatus =templateInstanceDO.getSts();
|
currentStatus = templateInstanceDO.getSts();
|
||||||
}
|
}
|
||||||
PublishStatusEnum status = PublishStatusEnum.fromCode(currentStatus);
|
PublishStatusEnum status = PublishStatusEnum.fromCode(currentStatus);
|
||||||
boolean transitionAllowed = false;
|
boolean transitionAllowed = false;
|
||||||
if (status != null) {
|
if (status != null) {
|
||||||
transitionAllowed = status.isTransitionAllowed(TmplStsEnum.DRAFT.getCode());
|
transitionAllowed = status.isTransitionAllowed(TmplStsEnum.DRAFT.getCode());
|
||||||
if (!transitionAllowed){
|
if (!transitionAllowed) {
|
||||||
transitionAllowed = status.isTransitionAllowed(TmplStsEnum.START.getCode());
|
transitionAllowed = status.isTransitionAllowed(TmplStsEnum.START.getCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -286,7 +286,7 @@ public class TemplateInstanceServiceImpl implements TemplateInstanceService {
|
|||||||
newTpInstanceDO.setTenantId(templateInstanceDO.getTenantId());
|
newTpInstanceDO.setTenantId(templateInstanceDO.getTenantId());
|
||||||
newTpInstanceDO.setVer(incrementVersion(templateInstanceDO.getVer()));
|
newTpInstanceDO.setVer(incrementVersion(templateInstanceDO.getVer()));
|
||||||
newTpInstanceDO.setPublishTime(LocalDateTime.now());
|
newTpInstanceDO.setPublishTime(LocalDateTime.now());
|
||||||
newTpInstanceDO.setOrigCntt(templateInstanceDO.getCntt()!=null?templateInstanceDO.getCntt():templateInstanceDO.getOrigCntt());//模板实例内容,默认为上一个版本的当前文件内容
|
newTpInstanceDO.setOrigCntt(templateInstanceDO.getCntt() != null ? templateInstanceDO.getCntt() : templateInstanceDO.getOrigCntt());//模板实例内容,默认为上一个版本的当前文件内容
|
||||||
newTpInstanceDO.setCreateTime(null);
|
newTpInstanceDO.setCreateTime(null);
|
||||||
newTpInstanceDO.setUpdateTime(null);
|
newTpInstanceDO.setUpdateTime(null);
|
||||||
templateInstanceMapper.insert(newTpInstanceDO);
|
templateInstanceMapper.insert(newTpInstanceDO);
|
||||||
@@ -409,9 +409,19 @@ public class TemplateInstanceServiceImpl implements TemplateInstanceService {
|
|||||||
|
|
||||||
// 实例数据
|
// 实例数据
|
||||||
private List<TemplateInstanceDataRespVO> setTemplateInstanceDataRespVOS(Long id) {
|
private List<TemplateInstanceDataRespVO> setTemplateInstanceDataRespVOS(Long id) {
|
||||||
return BeanUtils.toBean(templateInstanceDataMapper.selectList(new LambdaQueryWrapper<TemplateInstanceDataDO>()
|
List<TemplateInstanceDataRespVO> templateInstanceDataRespVOS = BeanUtils.toBean(templateInstanceDataMapper.selectList(new LambdaQueryWrapper<TemplateInstanceDataDO>()
|
||||||
.eq(TemplateInstanceDataDO::getInscId, id)
|
.eq(TemplateInstanceDataDO::getInscId, id)
|
||||||
.eq(TemplateInstanceDataDO::getCompanyId, CompanyContextHolder.getCompanyId())), TemplateInstanceDataRespVO.class);
|
.eq(TemplateInstanceDataDO::getCompanyId, CompanyContextHolder.getCompanyId())), TemplateInstanceDataRespVO.class);
|
||||||
|
List<TmplTpFldDO> tmplTpListByValKeys = tmplTpFldService.getTmplTpListByValKeys(templateInstanceDataRespVOS.stream().map(TemplateInstanceDataRespVO::getFldKy).toList());
|
||||||
|
templateInstanceDataRespVOS.forEach(templateInstanceDataRespVO -> {
|
||||||
|
tmplTpListByValKeys.forEach(tmplTpFldDO -> {
|
||||||
|
if (templateInstanceDataRespVO.getFldKy().equals(tmplTpFldDO.getFldKy())) {
|
||||||
|
templateInstanceDataRespVO.setFldName(tmplTpFldDO.getFldName());
|
||||||
|
templateInstanceDataRespVO.setFldDoc(tmplTpFldDO.getFldDoc());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return templateInstanceDataRespVOS;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validateStatusCanDelete(List<Long> ids) {
|
private void validateStatusCanDelete(List<Long> ids) {
|
||||||
@@ -470,11 +480,11 @@ public class TemplateInstanceServiceImpl implements TemplateInstanceService {
|
|||||||
List<String> itmIds = templateInstanceItemMapper.selectList(new LambdaQueryWrapper<TemplateInstanceItemDO>().eq(TemplateInstanceItemDO::getInscId, id)).stream().map(TemplateInstanceItemDO::getItmId).toList();
|
List<String> itmIds = templateInstanceItemMapper.selectList(new LambdaQueryWrapper<TemplateInstanceItemDO>().eq(TemplateInstanceItemDO::getInscId, id)).stream().map(TemplateInstanceItemDO::getItmId).toList();
|
||||||
|
|
||||||
// 例模版条款去条款库查询条款信息
|
// 例模版条款去条款库查询条款信息
|
||||||
if (!itmIds.isEmpty()){
|
if (!itmIds.isEmpty()) {
|
||||||
List<TmplItmRespVO> tmplItmRespVOS = BeanUtils.toBean(tmplItmService.listTmplItmByIds(itmIds), TmplItmRespVO.class);
|
List<TmplItmRespVO> tmplItmRespVOS = BeanUtils.toBean(tmplItmService.listTmplItmByIds(itmIds), TmplItmRespVO.class);
|
||||||
fieldAndClauseRespVO.setTmplItmRespVOS(BeanUtils.toBean(tmplItmRespVOS, TmplItmRespVO.class));
|
fieldAndClauseRespVO.setTmplItmRespVOS(BeanUtils.toBean(tmplItmRespVOS, TmplItmRespVO.class));
|
||||||
}
|
}
|
||||||
if (!valKeys.isEmpty()){
|
if (!valKeys.isEmpty()) {
|
||||||
//例模版字段去字段库查询字段信息
|
//例模版字段去字段库查询字段信息
|
||||||
List<TmplTpFldDO> tmplTpListByValKeys = tmplTpFldService.getTmplTpListByValKeys(valKeys);
|
List<TmplTpFldDO> tmplTpListByValKeys = tmplTpFldService.getTmplTpListByValKeys(valKeys);
|
||||||
fieldAndClauseRespVO.setTmplFldRespVOS(BeanUtils.toBean(tmplTpListByValKeys, TmplFldRespVO.class));
|
fieldAndClauseRespVO.setTmplFldRespVOS(BeanUtils.toBean(tmplTpListByValKeys, TmplFldRespVO.class));
|
||||||
|
|||||||
@@ -96,6 +96,9 @@ public class TmplTpFldServiceImpl extends ServiceImpl<TmplTpFldMapper, TmplTpFld
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TmplTpFldDO> getTmplTpListByValKeys(List<String> valNames) {
|
public List<TmplTpFldDO> getTmplTpListByValKeys(List<String> valNames) {
|
||||||
|
if (CollUtil.isEmpty(valNames)){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
return baseMapper.selectList(new LambdaQueryWrapper<TmplTpFldDO>().in(TmplTpFldDO::getFldKy, valNames));
|
return baseMapper.selectList(new LambdaQueryWrapper<TmplTpFldDO>().in(TmplTpFldDO::getFldKy, valNames));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ package com.zt.plat.module.contractorder.api;
|
|||||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
import com.zt.plat.module.contractorder.api.dto.contract.ContractRespDTO;
|
import com.zt.plat.module.contractorder.api.dto.contract.ContractRespDTO;
|
||||||
|
import com.zt.plat.module.contractorder.api.dto.order.PrchOrdDtlDTO;
|
||||||
import com.zt.plat.module.contractorder.api.dto.order.PurchaseOrderWithDetailsDTO;
|
import com.zt.plat.module.contractorder.api.dto.order.PurchaseOrderWithDetailsDTO;
|
||||||
import com.zt.plat.module.contractorder.api.dto.order.SalesOrdDtlDTO;
|
import com.zt.plat.module.contractorder.api.dto.order.SalesOrdDtlDTO;
|
||||||
import com.zt.plat.module.contractorder.api.vo.contract.international.IntContract;
|
import com.zt.plat.module.contractorder.api.vo.contract.international.IntContract;
|
||||||
@@ -56,4 +57,14 @@ public interface ContractApi {
|
|||||||
@GetMapping(PREFIX + "/sales-order-detail-by-ids")
|
@GetMapping(PREFIX + "/sales-order-detail-by-ids")
|
||||||
@Operation(summary = "通过消费订单详情id批量获取消费订单详情")
|
@Operation(summary = "通过消费订单详情id批量获取消费订单详情")
|
||||||
CommonResult<List<SalesOrdDtlDTO>> getSalesOrderDetailByIds(@RequestParam("ids") List<Long> ids);
|
CommonResult<List<SalesOrdDtlDTO>> getSalesOrderDetailByIds(@RequestParam("ids") List<Long> ids);
|
||||||
|
|
||||||
|
@GetMapping(PREFIX + "/po-order-detail-by-id")
|
||||||
|
@Operation(summary = "通过采购订单详情id获取消费订单详情")
|
||||||
|
CommonResult<PrchOrdDtlDTO> getPoOrderDetailById(@RequestParam("id") Long id);
|
||||||
|
|
||||||
|
@GetMapping(PREFIX + "/po-order-detail-by-ids")
|
||||||
|
@Operation(summary = "通过采购订单详情id批量获取消费订单详情")
|
||||||
|
CommonResult<List<PrchOrdDtlDTO>> getPoOrderDetailByIds(@RequestParam("ids") List<Long> ids);
|
||||||
|
|
||||||
|
//销售采购融合。主子表
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user