新增通过消费订单明细id获取明细

This commit is contained in:
潘荣晟
2025-11-06 16:06:16 +08:00
parent 48b9209fd1
commit 292d4a534d
16 changed files with 328 additions and 26 deletions

View File

@@ -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,12 +33,14 @@ 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);
} }
@@ -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);
} }
} }

View File

@@ -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 {
// 创建文件失败,处理错误 // 创建文件失败,处理错误

View File

@@ -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;

View File

@@ -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.*;

View File

@@ -44,4 +44,8 @@ public class TemplateInstanceDataDO extends BusinessBaseDO {
@TableField("FLD_VAL") @TableField("FLD_VAL")
private String fldVal; private String fldVal;
@TableField(exist = false)
private String fldName;
} }

View File

@@ -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);

View File

@@ -409,9 +409,18 @@ 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());
}
});
});
return templateInstanceDataRespVOS;
} }
private void validateStatusCanDelete(List<Long> ids) { private void validateStatusCanDelete(List<Long> ids) {

View File

@@ -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));
} }

View File

@@ -133,7 +133,6 @@ public class SalesOrderSaveReqVO {
private String erpSalesCompanyName; private String erpSalesCompanyName;
@Schema(description = "ERP状态(字典: ERP_REQ_STS)", example = "2") @Schema(description = "ERP状态(字典: ERP_REQ_STS)", example = "2")
private String erpStatus; private String erpStatus;
@@ -172,17 +171,10 @@ public class SalesOrderSaveReqVO {
@ExcelProperty("订单分类") @ExcelProperty("订单分类")
private String splyBsnTp; private String splyBsnTp;
/**
* 销售组织编码
*
*/
@Schema(description = "销售组织编码", example = "2") @Schema(description = "销售组织编码", example = "2")
@ExcelProperty("销售组织编码") @ExcelProperty("销售组织编码")
private String saleOrgzCd; private String saleOrgzCd;
/**
* 销售组织名称
*
*/
@Schema(description = "销售组织名称", example = "2") @Schema(description = "销售组织名称", example = "2")
@ExcelProperty("销售组织名称") @ExcelProperty("销售组织名称")
private String saleOrgzName; private String saleOrgzName;
@@ -200,4 +192,10 @@ public class SalesOrderSaveReqVO {
@Schema(description = "产品组编码") @Schema(description = "产品组编码")
@ExcelProperty("产品组编码") @ExcelProperty("产品组编码")
private String pdtGrpCdg; private String pdtGrpCdg;
@Schema(description = "付款方名称")
@ExcelProperty("付款方名称")
private String payerName;
@Schema(description = "付款方编码")
@ExcelProperty("付款方编码")
private String payerNum;
} }

View File

@@ -295,7 +295,7 @@ public class SalesOrderDO extends BusinessBaseDO {
* 付款方名称 * 付款方名称
* *
*/ */
@TableField("PYER_NUM") @TableField("PYER_NAME")
private String payerName; private String payerName;
/** /**
* 付款方编码 * 付款方编码
@@ -303,9 +303,9 @@ public class SalesOrderDO extends BusinessBaseDO {
*/ */
@TableField("PYER_NUM") @TableField("PYER_NUM")
private String payerNum; private String payerNum;
/** // /**
* 税码 // * 税码
*/ // */
@TableField("TAX_NUM") // @TableField("TAX_NUM")
private String taxNum; // private String taxNum;
} }

Some files were not shown because too many files have changed in this diff Show More