合同模版优化

This commit is contained in:
潘荣晟
2025-12-03 17:58:05 +08:00
parent b510dfa731
commit 3a5ec948fd
5 changed files with 76 additions and 70 deletions

View File

@@ -1,5 +1,6 @@
package com.zt.plat.module.base.controller.admin.templtp;
import cn.hutool.core.collection.CollUtil;
import com.zt.plat.module.base.dal.dataobject.tmpltp.TmplInscDatBsnDO;
import com.zt.plat.module.base.service.tmpltp.TmplInscDatBsnService;
import org.springframework.web.bind.annotation.*;
@@ -82,7 +83,9 @@ public class TmplInscDatBsnController implements BusinessControllerMarker {
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-dat-bsn:query')")
public CommonResult<TmplInscDatBsnRespVO> getTmplInscDatBsn(@RequestParam("id") String id) {
TmplInscDatBsnDO tmplInscDatBsn = tmplInscDatBsnService.getTmplInscDatBsn(id);
return success(BeanUtils.toBean(tmplInscDatBsn, TmplInscDatBsnRespVO.class));
TmplInscDatBsnRespVO tmplInscDatBsnRespVO = BeanUtils.toBean(tmplInscDatBsn, TmplInscDatBsnRespVO.class);
tmplInscDatBsnRespVO.setFldVal(CollUtil.toList(tmplInscDatBsn.getFldVal().split(",")));
return success(tmplInscDatBsnRespVO);
}
@GetMapping("/page")

View File

@@ -26,12 +26,12 @@ public class TmplInscDatBsnRespVO {
@Schema(description = "用户填写的值")
@ExcelProperty("用户填写的值")
private String fldVal;
private List<String> fldVal;
@Schema(description = "字段标识")
@ExcelProperty("字段标识")
private String fldKy;
private List<String> fldKy;

View File

@@ -22,6 +22,6 @@ public class TmplInscDatBsnSaveReqVO {
private String inscFldId;
@Schema(description = "用户填写的值")
private Object fldVal;
private String fldVal;
}

View File

@@ -11,9 +11,11 @@ import com.zt.plat.module.base.controller.admin.templtp.vo.TmplInscDatBsnSaveReq
import com.zt.plat.module.base.dal.dataobject.tmpltp.TmplInscDatBsnDO;
import com.zt.plat.module.base.dal.mysql.tmpltp.TmplInscDatBsnMapper;
import jakarta.annotation.Resource;
import jodd.util.ArraysUtil;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import java.util.Arrays;
import java.util.List;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
@@ -37,13 +39,13 @@ public class TmplInscDatBsnServiceImpl implements TmplInscDatBsnService {
//判断存在
validateTmplInscDatBsnExistsByKey(createReqVO);
// 插入
String fldVal=createReqVO.getFldVal().toString();
createReqVO.setFldVal(null);// 兼容前端传入数组或者字符串
TmplInscDatBsnDO tmplInscDatBsn = BeanUtils.toBean(createReqVO, TmplInscDatBsnDO.class);
tmplInscDatBsn.setFldVal(fldVal);
tmplInscDatBsnMapper.insert(tmplInscDatBsn);
// 返回
return BeanUtils.toBean(tmplInscDatBsn, TmplInscDatBsnRespVO.class);
TmplInscDatBsnRespVO tmplInscDatBsnRespVO = BeanUtils.toBean(tmplInscDatBsn, TmplInscDatBsnRespVO.class);
tmplInscDatBsnRespVO.setFldVal(CollUtil.toList(tmplInscDatBsn.getFldVal().split(",")));
return tmplInscDatBsnRespVO;
}
private void validateTmplInscDatBsnExistsByKey(TmplInscDatBsnSaveReqVO createReqVO) {
List<TmplInscDatBsnDO> tmplInscDatBsnDOS = tmplInscDatBsnMapper.selectList(TmplInscDatBsnDO::getInscFldId, createReqVO.getInscFldId(),TmplInscDatBsnDO::getBsnId, createReqVO.getBsnId());