新增业务逻辑
This commit is contained in:
@@ -25,7 +25,13 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode NOT_FOUND_CLASS= new ErrorCode(1_027_000_516, "找不到对应的类");
|
ErrorCode NOT_FOUND_CLASS= new ErrorCode(1_027_000_516, "找不到对应的类");
|
||||||
ErrorCode UTIL_NOT_INIT= new ErrorCode(1_027_000_517, "工具类为未初始化");
|
ErrorCode UTIL_NOT_INIT= new ErrorCode(1_027_000_517, "工具类为未初始化");
|
||||||
ErrorCode TMPL_INS_FLD_CODE_EXISTS = new ErrorCode(1_027_000_518, "字段已存在");
|
ErrorCode TMPL_INS_FLD_CODE_EXISTS = new ErrorCode(1_027_000_518, "字段已存在");
|
||||||
ErrorCode TMPL_ITM_EXISTS = new ErrorCode(1_027_000_503, "模板条款已存在");
|
ErrorCode TMPL_ITM_EXISTS = new ErrorCode(1_027_000_519, "模板条款已存在");
|
||||||
|
ErrorCode TMPL_INSC_BSN_REL_NOT_EXISTS = new ErrorCode(1_027_000_539, "模板实例与业务中间不存在");
|
||||||
|
ErrorCode TEMPLATE_INSTANCE_FILE_NOT_EXISTS = new ErrorCode(1_027_000_520, "模板实例文件不存在");
|
||||||
|
ErrorCode FILE_PULL_EER = new ErrorCode(1_027_000_521, "文件获取失败");
|
||||||
|
ErrorCode FILE_UPLOAD_EER = new ErrorCode(1_027_000_523, "文件上传失败");
|
||||||
|
ErrorCode TMPL_INSC_ITM_BSN_NOT_EXISTS = new ErrorCode(1_027_000_524, "业务实例条款不存在");
|
||||||
|
ErrorCode TMPL_INSC_DAT_BSN_NOT_EXISTS = new ErrorCode(1_027_000_530, "业务实例字段不存在");
|
||||||
//Illegal operation type
|
//Illegal operation type
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,123 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp;
|
||||||
|
|
||||||
|
import com.zt.plat.module.base.controller.admin.templtp.vo.TmplInscBsnRelPageReqVO;
|
||||||
|
import com.zt.plat.module.base.controller.admin.templtp.vo.TmplInscBsnRelRespVO;
|
||||||
|
import com.zt.plat.module.base.controller.admin.templtp.vo.TmplInscBsnRelSaveReqVO;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.tmpltp.TmplInscBsnRelDO;
|
||||||
|
import com.zt.plat.module.base.service.tmpltp.TmplInscBsnRelService;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import jakarta.servlet.http.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 模板实例与业务中间")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/base/tmpl-insc-bsn-rel")
|
||||||
|
@Validated
|
||||||
|
public class TmplInscBsnRelController implements BusinessControllerMarker {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TmplInscBsnRelService tmplInscBsnRelService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建模板实例与业务中间")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-bsn-rel:create')")
|
||||||
|
public CommonResult<TmplInscBsnRelRespVO> createTmplInscBsnRel(@Valid @RequestBody TmplInscBsnRelSaveReqVO createReqVO) {
|
||||||
|
return success(tmplInscBsnRelService.createTmplInscBsnRel(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新模板实例与业务中间")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-bsn-rel:update')")
|
||||||
|
public CommonResult<Boolean> updateTmplInscBsnRel(@Valid @RequestBody TmplInscBsnRelSaveReqVO updateReqVO) {
|
||||||
|
tmplInscBsnRelService.updateTmplInscBsnRel(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除模板实例与业务中间")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-bsn-rel:delete')")
|
||||||
|
public CommonResult<Boolean> deleteTmplInscBsnRel(@RequestParam("id") Long id) {
|
||||||
|
tmplInscBsnRelService.deleteTmplInscBsnRel(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除模板实例与业务中间")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-bsn-rel:delete')")
|
||||||
|
public CommonResult<Boolean> deleteTmplInscBsnRelList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
tmplInscBsnRelService.deleteTmplInscBsnRelListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得模板实例与业务中间")
|
||||||
|
@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);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得模板实例与业务中间分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-bsn-rel:query')")
|
||||||
|
public CommonResult<PageResult<TmplInscBsnRelRespVO>> getTmplInscBsnRelPage(@Valid TmplInscBsnRelPageReqVO pageReqVO) {
|
||||||
|
PageResult<TmplInscBsnRelDO> pageResult = tmplInscBsnRelService.getTmplInscBsnRelPage(pageReqVO);
|
||||||
|
PageResult<TmplInscBsnRelRespVO> tmplInscBsnRelRespVOPageResult = BeanUtils.toBean(pageResult, TmplInscBsnRelRespVO.class);
|
||||||
|
tmplInscBsnRelRespVOPageResult.getList().forEach(tmplInscBsnRelRespVO -> {
|
||||||
|
if (tmplInscBsnRelRespVO != null) {
|
||||||
|
tmplInscBsnRelService.getTmplInscBsnRelDetails(tmplInscBsnRelRespVO);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return success(tmplInscBsnRelRespVOPageResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出模板实例与业务中间 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-bsn-rel:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportTmplInscBsnRelExcel(@Valid TmplInscBsnRelPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<TmplInscBsnRelDO> list = tmplInscBsnRelService.getTmplInscBsnRelPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "模板实例与业务中间.xls", "数据", TmplInscBsnRelRespVO.class,
|
||||||
|
BeanUtils.toBean(list, TmplInscBsnRelRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp;
|
||||||
|
|
||||||
|
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.*;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import jakarta.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.base.controller.admin.templtp.vo.*;
|
||||||
|
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 业务实例字段值")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/base/tmpl-insc-dat-bsn")
|
||||||
|
@Validated
|
||||||
|
public class TmplInscDatBsnController implements BusinessControllerMarker {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TmplInscDatBsnService tmplInscDatBsnService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建业务实例字段值")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-dat-bsn:create')")
|
||||||
|
public CommonResult<TmplInscDatBsnRespVO> createTmplInscDatBsn(@Valid @RequestBody TmplInscDatBsnSaveReqVO createReqVO) {
|
||||||
|
return success(tmplInscDatBsnService.createTmplInscDatBsn(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新业务实例字段值")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-dat-bsn:update')")
|
||||||
|
public CommonResult<Boolean> updateTmplInscDatBsn(@Valid @RequestBody TmplInscDatBsnSaveReqVO updateReqVO) {
|
||||||
|
tmplInscDatBsnService.updateTmplInscDatBsn(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除业务实例字段值")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-dat-bsn:delete')")
|
||||||
|
public CommonResult<Boolean> deleteTmplInscDatBsn(@RequestParam("id") String id) {
|
||||||
|
tmplInscDatBsnService.deleteTmplInscDatBsn(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除业务实例字段值")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-dat-bsn:delete')")
|
||||||
|
public CommonResult<Boolean> deleteTmplInscDatBsnList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
tmplInscDatBsnService.deleteTmplInscDatBsnListByIds(req.getIds().stream().map(String::valueOf).toList());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得业务实例字段值")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@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));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得业务实例字段值分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-dat-bsn:query')")
|
||||||
|
public CommonResult<PageResult<TmplInscDatBsnRespVO>> getTmplInscDatBsnPage(@Valid TmplInscDatBsnPageReqVO pageReqVO) {
|
||||||
|
PageResult<TmplInscDatBsnDO> pageResult = tmplInscDatBsnService.getTmplInscDatBsnPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, TmplInscDatBsnRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出业务实例字段值 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-dat-bsn:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportTmplInscDatBsnExcel(@Valid TmplInscDatBsnPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<TmplInscDatBsnDO> list = tmplInscDatBsnService.getTmplInscDatBsnPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "业务实例字段值.xls", "数据", TmplInscDatBsnRespVO.class,
|
||||||
|
BeanUtils.toBean(list, TmplInscDatBsnRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp;
|
||||||
|
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.tmpltp.TmplInscItmBsnDO;
|
||||||
|
import com.zt.plat.module.base.service.tmpltp.TmplInscItmBsnService;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import jakarta.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.base.controller.admin.templtp.vo.*;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 业务实例条款值")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/base/tmpl-insc-itm-bsn")
|
||||||
|
@Validated
|
||||||
|
public class TmplInscItmBsnController implements BusinessControllerMarker {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TmplInscItmBsnService tmplInscItmBsnService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建业务实例条款值")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-itm-bsn:create')")
|
||||||
|
public CommonResult<TmplInscItmBsnRespVO> createTmplInscItmBsn(@Valid @RequestBody TmplInscItmBsnSaveReqVO createReqVO) {
|
||||||
|
return success(tmplInscItmBsnService.createTmplInscItmBsn(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新业务实例条款值")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-itm-bsn:update')")
|
||||||
|
public CommonResult<Boolean> updateTmplInscItmBsn(@Valid @RequestBody TmplInscItmBsnSaveReqVO updateReqVO) {
|
||||||
|
tmplInscItmBsnService.updateTmplInscItmBsn(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除业务实例条款值")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-itm-bsn:delete')")
|
||||||
|
public CommonResult<Boolean> deleteTmplInscItmBsn(@RequestParam("id") String id) {
|
||||||
|
tmplInscItmBsnService.deleteTmplInscItmBsn(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除业务实例条款值")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-itm-bsn:delete')")
|
||||||
|
public CommonResult<Boolean> deleteTmplInscItmBsnList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
tmplInscItmBsnService.deleteTmplInscItmBsnListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得业务实例条款值")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-itm-bsn:query')")
|
||||||
|
public CommonResult<TmplInscItmBsnRespVO> getTmplInscItmBsn(@RequestParam("id") String id) {
|
||||||
|
TmplInscItmBsnDO tmplInscItmBsn = tmplInscItmBsnService.getTmplInscItmBsn(id);
|
||||||
|
return success(BeanUtils.toBean(tmplInscItmBsn, TmplInscItmBsnRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得业务实例条款值分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-itm-bsn:query')")
|
||||||
|
public CommonResult<PageResult<TmplInscItmBsnRespVO>> getTmplInscItmBsnPage(@Valid TmplInscItmBsnPageReqVO pageReqVO) {
|
||||||
|
PageResult<TmplInscItmBsnDO> pageResult = tmplInscItmBsnService.getTmplInscItmBsnPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, TmplInscItmBsnRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出业务实例条款值 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-itm-bsn:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportTmplInscItmBsnExcel(@Valid TmplInscItmBsnPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<TmplInscItmBsnDO> list = tmplInscItmBsnService.getTmplInscItmBsnPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "业务实例条款值.xls", "数据", TmplInscItmBsnRespVO.class,
|
||||||
|
BeanUtils.toBean(list, TmplInscItmBsnRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 模板实例与业务中间分页 Request VO")
|
||||||
|
@Data
|
||||||
|
public class TmplInscBsnRelPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "业务主键", example = "30969")
|
||||||
|
private Long bsnId;
|
||||||
|
|
||||||
|
@Schema(description = "实例主键", example = "10551")
|
||||||
|
private String inscId;
|
||||||
|
|
||||||
|
@Schema(description = "文件内容")
|
||||||
|
private String cntt;
|
||||||
|
|
||||||
|
@Schema(description = "版本号,如v1.0")
|
||||||
|
private String ver;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp.vo;
|
||||||
|
|
||||||
|
import com.zt.plat.module.system.api.dept.dto.DeptRespDTO;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 模板实例与业务中间 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class TmplInscBsnRelRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14132")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "业务主键", example = "30969")
|
||||||
|
@ExcelProperty("业务主键")
|
||||||
|
private Long bsnId;
|
||||||
|
|
||||||
|
@Schema(description = "实例主键", example = "10551")
|
||||||
|
@ExcelProperty("实例主键")
|
||||||
|
private String inscId;
|
||||||
|
|
||||||
|
@Schema(description = "文件内容")
|
||||||
|
@ExcelProperty("文件内容")
|
||||||
|
private String cntt;
|
||||||
|
|
||||||
|
@Schema(description = "版本号,如v1.0")
|
||||||
|
@ExcelProperty("版本号,如v1.0")
|
||||||
|
private String ver;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "使用部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
|
||||||
|
private List<String> deptIds;
|
||||||
|
|
||||||
|
|
||||||
|
@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<DeptRespDTO> DeptRespVOS;
|
||||||
|
|
||||||
|
@Schema(description = "模版实例名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "测试分类名称")
|
||||||
|
@ExcelProperty("模版实例名称")
|
||||||
|
private String inscName;
|
||||||
|
|
||||||
|
@Schema(description = "业务实例字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
|
||||||
|
@ExcelProperty("业务实例字段")
|
||||||
|
private List<TmplInscDatBsnRespVO> tmplInscDatBsnRespVOS;
|
||||||
|
|
||||||
|
@Schema(description = "业务实例条款", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
|
||||||
|
@ExcelProperty("业务实例条款")
|
||||||
|
private List<TmplInscItmBsnRespVO> tmplInscItmBsnRespVOS;
|
||||||
|
|
||||||
|
@Schema(description = "创建人", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建人")
|
||||||
|
private String creator;
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 模板实例与业务中间新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class TmplInscBsnRelSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14132")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "业务主键", example = "30969")
|
||||||
|
private Long bsnId;
|
||||||
|
|
||||||
|
@Schema(description = "实例主键", example = "10551")
|
||||||
|
private String inscId;
|
||||||
|
|
||||||
|
@Schema(description = "文件内容")
|
||||||
|
private String cntt;
|
||||||
|
|
||||||
|
@Schema(description = "版本号,如v1.0")
|
||||||
|
private String ver;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 业务实例字段值分页 Request VO")
|
||||||
|
@Data
|
||||||
|
public class TmplInscDatBsnPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "关联中间表业务主键", example = "4270")
|
||||||
|
private String bsnId;
|
||||||
|
|
||||||
|
@Schema(description = "字段标识,关联字段库")
|
||||||
|
private String inscFldId;
|
||||||
|
|
||||||
|
@Schema(description = "用户填写的值")
|
||||||
|
private String fldVal;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDate[] createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.*;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 业务实例字段值 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class TmplInscDatBsnRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "8260")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "关联中间表业务主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4270")
|
||||||
|
@ExcelProperty("关联中间表业务主键")
|
||||||
|
private String bsnId;
|
||||||
|
|
||||||
|
@Schema(description = "字段标识,关联实例字段库", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("字段主键,关联实例字段库")
|
||||||
|
private String inscFldId;
|
||||||
|
|
||||||
|
@Schema(description = "用户填写的值")
|
||||||
|
@ExcelProperty("用户填写的值")
|
||||||
|
private String fldVal;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "字段标识")
|
||||||
|
@ExcelProperty("字段标识")
|
||||||
|
private String fldKy;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDate createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 业务实例字段值新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class TmplInscDatBsnSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "8260")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "关联中间表业务主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4270")
|
||||||
|
@NotEmpty(message = "关联中间表业务主键不能为空")
|
||||||
|
private String bsnId;
|
||||||
|
|
||||||
|
@Schema(description = "字段标识,关联实例字段库", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "字段标识,关联实例字段库不能为空")
|
||||||
|
private String inscFldId;
|
||||||
|
|
||||||
|
@Schema(description = "用户填写的值")
|
||||||
|
private String fldVal;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 业务实例条款值分页 Request VO")
|
||||||
|
@Data
|
||||||
|
public class TmplInscItmBsnPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "关联中间表业务主键", example = "17128")
|
||||||
|
private String bsnId;
|
||||||
|
|
||||||
|
@Schema(description = "实例条款主键,关联实例字段库", example = "15878")
|
||||||
|
private String instceItmId;
|
||||||
|
|
||||||
|
@Schema(description = "用户填写的值")
|
||||||
|
private String val;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDate[] createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.*;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 业务实例条款值 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class TmplInscItmBsnRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "30559")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "关联中间表业务主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "17128")
|
||||||
|
@ExcelProperty("关联中间表业务主键")
|
||||||
|
private String bsnId;
|
||||||
|
|
||||||
|
@Schema(description = "实例条款主键,关联实例字段库", requiredMode = Schema.RequiredMode.REQUIRED, example = "15878")
|
||||||
|
@ExcelProperty("实例条款主键,关联字段库")
|
||||||
|
private String inscItmId;
|
||||||
|
|
||||||
|
@Schema(description = "用户填写的值")
|
||||||
|
@ExcelProperty("用户填写的值")
|
||||||
|
private String val;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDate createTime;
|
||||||
|
|
||||||
|
@Schema(description = "条款名", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("条款名")
|
||||||
|
private String itmName;
|
||||||
|
|
||||||
|
@Schema(description = "条款主键", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("条款主键")
|
||||||
|
private String itmId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 业务实例条款值新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class TmplInscItmBsnSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "30559")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "关联中间表业务主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "17128")
|
||||||
|
@NotEmpty(message = "关联中间表业务主键不能为空")
|
||||||
|
private String bsnId;
|
||||||
|
|
||||||
|
@Schema(description = "实例条款主键,关联实例字段库", requiredMode = Schema.RequiredMode.REQUIRED, example = "15878")
|
||||||
|
@NotEmpty(message = "实例条款主键,关联实例字段库不能为空")
|
||||||
|
private String instceItmId;
|
||||||
|
|
||||||
|
@Schema(description = "用户填写的值")
|
||||||
|
private String val;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package com.zt.plat.module.base.dal.dataobject.tmpltp;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
|
/**
|
||||||
|
* 模板实例与业务中间 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@TableName("bse_tmpl_insc_bsn_rel")
|
||||||
|
@KeySequence("bse_tmpl_insc_bsn_rel_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class TmplInscBsnRelDO extends BusinessBaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 业务主键
|
||||||
|
*/
|
||||||
|
@TableField("BSN_ID")
|
||||||
|
private Long bsnId;
|
||||||
|
/**
|
||||||
|
* 实例主键
|
||||||
|
*/
|
||||||
|
@TableField("INSC_ID")
|
||||||
|
private String inscId;
|
||||||
|
/**
|
||||||
|
* 文件内容
|
||||||
|
*/
|
||||||
|
@TableField("CNTT")
|
||||||
|
private String cntt;
|
||||||
|
/**
|
||||||
|
* 版本号,如v1.0
|
||||||
|
*/
|
||||||
|
@TableField("VER")
|
||||||
|
private String ver;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.zt.plat.module.base.dal.dataobject.tmpltp;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
|
/**
|
||||||
|
* 业务实例字段值 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@TableName("bse_tmpl_insc_dat_bsn")
|
||||||
|
@KeySequence("bse_tmpl_insc_dat_bsn_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class TmplInscDatBsnDO extends BusinessBaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.INPUT)
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 关联中间表业务主键
|
||||||
|
*/
|
||||||
|
@TableField("BSN_ID")
|
||||||
|
private String bsnId;
|
||||||
|
/**
|
||||||
|
* 字段标识,关联字段库
|
||||||
|
*/
|
||||||
|
@TableField("INSC_FLD_ID")
|
||||||
|
private String inscFldId;
|
||||||
|
/**
|
||||||
|
* 用户填写的值
|
||||||
|
*/
|
||||||
|
@TableField("FLD_VAL")
|
||||||
|
private String fldVal;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.zt.plat.module.base.dal.dataobject.tmpltp;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
|
/**
|
||||||
|
* 业务实例条款值 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@TableName("bse_tmpl_insc_itm_bsn")
|
||||||
|
@KeySequence("bse_tmpl_insc_itm_bsn_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class TmplInscItmBsnDO extends BusinessBaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.INPUT)
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 关联中间表业务主键
|
||||||
|
*/
|
||||||
|
@TableField("BSN_ID")
|
||||||
|
private String bsnId;
|
||||||
|
/**
|
||||||
|
* 条款库主键,关联字段库
|
||||||
|
*/
|
||||||
|
@TableField("INSC_ITM_ID")
|
||||||
|
private String inscItmId;
|
||||||
|
/**
|
||||||
|
* 用户填写的值
|
||||||
|
*/
|
||||||
|
@TableField("VAL")
|
||||||
|
private String val;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.zt.plat.module.base.dal.mysql.tmpltp;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
|
||||||
|
import com.zt.plat.module.base.controller.admin.templtp.vo.TmplInscBsnRelPageReqVO;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.tmpltp.TmplInscBsnRelDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模板实例与业务中间 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface TmplInscBsnRelMapper extends BaseMapperX<TmplInscBsnRelDO> {
|
||||||
|
|
||||||
|
default PageResult<TmplInscBsnRelDO> selectPage(TmplInscBsnRelPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<TmplInscBsnRelDO>()
|
||||||
|
.eqIfPresent(TmplInscBsnRelDO::getBsnId, reqVO.getBsnId())
|
||||||
|
.eqIfPresent(TmplInscBsnRelDO::getInscId, reqVO.getInscId())
|
||||||
|
.eqIfPresent(TmplInscBsnRelDO::getCntt, reqVO.getCntt())
|
||||||
|
.eqIfPresent(TmplInscBsnRelDO::getVer, reqVO.getVer())
|
||||||
|
.betweenIfPresent(TmplInscBsnRelDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(TmplInscBsnRelDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.zt.plat.module.base.dal.mysql.tmpltp;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.tmpltp.TmplInscDatBsnDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import com.zt.plat.module.base.controller.admin.templtp.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务实例字段值 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface TmplInscDatBsnMapper extends BaseMapperX<TmplInscDatBsnDO> {
|
||||||
|
|
||||||
|
default PageResult<TmplInscDatBsnDO> selectPage(TmplInscDatBsnPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<TmplInscDatBsnDO>()
|
||||||
|
.eqIfPresent(TmplInscDatBsnDO::getBsnId, reqVO.getBsnId())
|
||||||
|
.eqIfPresent(TmplInscDatBsnDO::getInscFldId, reqVO.getInscFldId())
|
||||||
|
.eqIfPresent(TmplInscDatBsnDO::getFldVal, reqVO.getFldVal())
|
||||||
|
.betweenIfPresent(TmplInscDatBsnDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(TmplInscDatBsnDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.zt.plat.module.base.dal.mysql.tmpltp;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.tmpltp.TmplInscItmBsnDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import com.zt.plat.module.base.controller.admin.templtp.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务实例条款值 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface TmplInscItmBsnMapper extends BaseMapperX<TmplInscItmBsnDO> {
|
||||||
|
|
||||||
|
default PageResult<TmplInscItmBsnDO> selectPage(TmplInscItmBsnPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<TmplInscItmBsnDO>()
|
||||||
|
.eqIfPresent(TmplInscItmBsnDO::getBsnId, reqVO.getBsnId())
|
||||||
|
.eqIfPresent(TmplInscItmBsnDO::getInscItmId, reqVO.getInstceItmId())
|
||||||
|
.eqIfPresent(TmplInscItmBsnDO::getVal, reqVO.getVal())
|
||||||
|
.betweenIfPresent(TmplInscItmBsnDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(TmplInscItmBsnDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -135,4 +135,10 @@ public interface TemplateInstanceService {
|
|||||||
* @return 获取结果
|
* @return 获取结果
|
||||||
*/
|
*/
|
||||||
FieldAndClauseRespVO getFieldAndClauseDetail(@Valid @NotEmpty(message = "模版实例id不能为空") String id);
|
FieldAndClauseRespVO getFieldAndClauseDetail(@Valid @NotEmpty(message = "模版实例id不能为空") String id);
|
||||||
|
/**
|
||||||
|
* 获取模版实例详情
|
||||||
|
* @param id 模版实例id
|
||||||
|
* @return 获取结果
|
||||||
|
*/
|
||||||
|
TemplateInstanceRespVO getTemplateInstance(@Valid @NotEmpty(message = "模版实例id不能为空") String id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -479,4 +479,9 @@ public class TemplateInstanceServiceImpl implements TemplateInstanceService {
|
|||||||
return fieldAndClauseRespVO;
|
return fieldAndClauseRespVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TemplateInstanceRespVO getTemplateInstance(String id) {
|
||||||
|
return BeanUtils.toBean(templateInstanceMapper.selectById(id), TemplateInstanceRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
package com.zt.plat.module.base.service.tmpltp;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.base.controller.admin.templtp.vo.TmplInscBsnRelPageReqVO;
|
||||||
|
import com.zt.plat.module.base.controller.admin.templtp.vo.TmplInscBsnRelRespVO;
|
||||||
|
import com.zt.plat.module.base.controller.admin.templtp.vo.TmplInscBsnRelSaveReqVO;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.tmpltp.TmplInscBsnRelDO;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模板实例与业务中间 Service 接口
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
public interface TmplInscBsnRelService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建模板实例与业务中间
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
TmplInscBsnRelRespVO createTmplInscBsnRel(@Valid TmplInscBsnRelSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新模板实例与业务中间
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateTmplInscBsnRel(@Valid TmplInscBsnRelSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除模板实例与业务中间
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteTmplInscBsnRel(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除模板实例与业务中间
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteTmplInscBsnRelListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得模板实例与业务中间
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 模板实例与业务中间
|
||||||
|
*/
|
||||||
|
TmplInscBsnRelDO getTmplInscBsnRel(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得模板实例与业务中间分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 模板实例与业务中间分页
|
||||||
|
*/
|
||||||
|
PageResult<TmplInscBsnRelDO> getTmplInscBsnRelPage(TmplInscBsnRelPageReqVO pageReqVO);
|
||||||
|
/**
|
||||||
|
* 获取详情
|
||||||
|
*
|
||||||
|
* @param tmplInscBsnRelRespVO 类
|
||||||
|
*/
|
||||||
|
void getTmplInscBsnRelDetails(TmplInscBsnRelRespVO tmplInscBsnRelRespVO);
|
||||||
|
}
|
||||||
@@ -0,0 +1,276 @@
|
|||||||
|
package com.zt.plat.module.base.service.tmpltp;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.extra.spring.SpringUtil;
|
||||||
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
|
import com.zt.plat.framework.tenant.core.context.CompanyContextHolder;
|
||||||
|
import com.zt.plat.module.base.controller.admin.templtp.vo.*;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.tmpltp.*;
|
||||||
|
import com.zt.plat.module.base.dal.mysql.tmpltp.*;
|
||||||
|
import com.zt.plat.module.infra.api.file.FileApi;
|
||||||
|
import com.zt.plat.module.infra.api.file.dto.FileCreateReqDTO;
|
||||||
|
import com.zt.plat.module.infra.api.file.dto.FileRespDTO;
|
||||||
|
import com.zt.plat.module.system.api.dept.DeptApi;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.zt.plat.module.infra.enums.ErrorCodeConstants.FILE_NOT_EXISTS;
|
||||||
|
import static com.zt.plat.module.tmpltp.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模板实例与业务中间 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class TmplInscBsnRelServiceImpl implements TmplInscBsnRelService {
|
||||||
|
@Resource
|
||||||
|
private DeptApi deptApi;
|
||||||
|
@Resource
|
||||||
|
private TmplInscBsnRelMapper tmplInscBsnRelMapper;
|
||||||
|
@Resource
|
||||||
|
private TemplateInstanceService templateInstanceService;
|
||||||
|
private TmplInscDatBsnService tmplInscDatBsnService;
|
||||||
|
@Resource
|
||||||
|
private TmplInscItmBsnService tmplInscItmBsnService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TmplInscBsnRelRespVO createTmplInscBsnRel(TmplInscBsnRelSaveReqVO createReqVO) {
|
||||||
|
TemplateInstanceRespVO templateInstance = templateInstanceService.getTemplateInstance(createReqVO.getInscId());
|
||||||
|
if (templateInstance == null) {
|
||||||
|
throw exception(TEMPLATE_INSTANCE_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
String type = "cntt";
|
||||||
|
if (templateInstance.getCntt().isEmpty() && templateInstance.getOrigCntt().isEmpty()) {
|
||||||
|
throw exception(TEMPLATE_INSTANCE_FILE_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
if (templateInstance.getCntt().isEmpty()) {
|
||||||
|
type = "origCntt";
|
||||||
|
}
|
||||||
|
//下载文件并且上传文件
|
||||||
|
fileUpload(createReqVO, templateInstance, type);
|
||||||
|
// 插入
|
||||||
|
TmplInscBsnRelDO tmplInscBsnRel = BeanUtils.toBean(createReqVO, TmplInscBsnRelDO.class);
|
||||||
|
tmplInscBsnRelMapper.insert(tmplInscBsnRel);
|
||||||
|
// 返回
|
||||||
|
return BeanUtils.toBean(tmplInscBsnRel, TmplInscBsnRelRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateTmplInscBsnRel(TmplInscBsnRelSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateTmplInscBsnRelExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
TmplInscBsnRelDO updateObj = BeanUtils.toBean(updateReqVO, TmplInscBsnRelDO.class);
|
||||||
|
tmplInscBsnRelMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void deleteTmplInscBsnRel(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateTmplInscBsnRelExists(id);
|
||||||
|
// 删除
|
||||||
|
tmplInscBsnRelMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void deleteTmplInscBsnRelListByIds(List<Long> ids) {
|
||||||
|
// 校验存在
|
||||||
|
validateTmplInscBsnRelExists(ids);
|
||||||
|
// 删除
|
||||||
|
//删除业务实例字段值
|
||||||
|
deleteFldOrItmByIds(tmplInscBsnRelMapper.selectByIds(ids).stream().map(TmplInscBsnRelDO::getBsnId).map(String::valueOf).toList(), tmplInscDatBsnService);
|
||||||
|
//删除业务实例字段值
|
||||||
|
deleteFldOrItmByIds(tmplInscBsnRelMapper.selectByIds(ids).stream().map(TmplInscBsnRelDO::getBsnId).map(String::valueOf).toList(), tmplInscItmBsnService);
|
||||||
|
tmplInscBsnRelMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateTmplInscBsnRelExists(List<Long> ids) {
|
||||||
|
List<TmplInscBsnRelDO> list = tmplInscBsnRelMapper.selectByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||||
|
throw exception(TMPL_INSC_BSN_REL_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateTmplInscBsnRelExists(Long id) {
|
||||||
|
if (tmplInscBsnRelMapper.selectById(id) == null) {
|
||||||
|
throw exception(TMPL_INSC_BSN_REL_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TmplInscBsnRelDO getTmplInscBsnRel(Long id) {
|
||||||
|
return tmplInscBsnRelMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<TmplInscBsnRelDO> getTmplInscBsnRelPage(TmplInscBsnRelPageReqVO pageReqVO) {
|
||||||
|
return tmplInscBsnRelMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getTmplInscBsnRelDetails(TmplInscBsnRelRespVO tmplInscBsnRelRespVO) {
|
||||||
|
tmplInscBsnRelRespVO.setDeptIds(setDeptData(tmplInscBsnRelRespVO));//获取部门使用范围
|
||||||
|
tmplInscBsnRelRespVO.setInstanceItemRespVOS(setInstanceItemRespVOS(tmplInscBsnRelRespVO));//获取条款;
|
||||||
|
tmplInscBsnRelRespVO.setTemplateInstanceDataRespVOS(setTemplateInstanceDataRespVOS(tmplInscBsnRelRespVO)); // 实例字段
|
||||||
|
//业务条款
|
||||||
|
tmplInscBsnRelRespVO.setTmplInscItmBsnRespVOS(setTmplInscItmBsnRespVOS(tmplInscBsnRelRespVO));
|
||||||
|
//业务字段
|
||||||
|
tmplInscBsnRelRespVO.setTmplInscDatBsnRespVOS(setTmplInscDatBsnRespVOS(tmplInscBsnRelRespVO));
|
||||||
|
if (!tmplInscBsnRelRespVO.getDeptIds().isEmpty()) {
|
||||||
|
tmplInscBsnRelRespVO.setDeptRespVOS(deptApi.getDeptList(tmplInscBsnRelRespVO.getDeptIds().stream().map(Long::valueOf).toList()).getData()); // 部门详情
|
||||||
|
}
|
||||||
|
TemplateInstanceRespVO templateInstance = SpringUtil.getBean(TemplateInstanceService.class).getTemplateInstance(tmplInscBsnRelRespVO.getInscId());
|
||||||
|
if (templateInstance != null) {
|
||||||
|
tmplInscBsnRelRespVO.setInscName(!templateInstance.getName().isEmpty() ? templateInstance.getName() : "分类未命名");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//业务条款
|
||||||
|
private List<TmplInscItmBsnRespVO> setTmplInscItmBsnRespVOS(TmplInscBsnRelRespVO tmplInscBsnRelRespVO) {
|
||||||
|
List<TmplInscItmBsnRespVO> tmplInscItmBsnRespVOS = BeanUtils.toBean(SpringUtil.getBean(TmplInscItmBsnMapper.class).selectList(new LambdaQueryWrapper<TmplInscItmBsnDO>()
|
||||||
|
.eq(TmplInscItmBsnDO::getBsnId, tmplInscBsnRelRespVO.getBsnId())
|
||||||
|
), TmplInscItmBsnRespVO.class);
|
||||||
|
tmplInscItmBsnRespVOS.forEach(tmplInscItmBsnRespVO -> {
|
||||||
|
tmplInscBsnRelRespVO.getInstanceItemRespVOS().forEach(instanceItemRespVO -> {
|
||||||
|
if (tmplInscItmBsnRespVO.getInscItmId().equals(instanceItemRespVO.getId())){
|
||||||
|
tmplInscItmBsnRespVO.setItmName(instanceItemRespVO.getItmName());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return tmplInscItmBsnRespVOS;
|
||||||
|
}
|
||||||
|
|
||||||
|
//业务字段
|
||||||
|
private List<TmplInscDatBsnRespVO> setTmplInscDatBsnRespVOS(TmplInscBsnRelRespVO tmplInscBsnRelRespVO) {
|
||||||
|
List<TmplInscDatBsnRespVO> tmplInscDatBsnRespVOS = BeanUtils.toBean(SpringUtil.getBean(TmplInscDatBsnMapper.class).selectList(new LambdaQueryWrapper<TmplInscDatBsnDO>()), TmplInscDatBsnRespVO.class);
|
||||||
|
|
||||||
|
tmplInscDatBsnRespVOS.forEach(tmplInscDatBsnRespVO -> tmplInscBsnRelRespVO.getTemplateInstanceDataRespVOS().forEach(templateInstanceDataRespVO -> {
|
||||||
|
if (templateInstanceDataRespVO.getId().toString().equals(tmplInscDatBsnRespVO.getInscFldId())) {
|
||||||
|
// tmplInscDatBsnRespVO.setFldVal(templateInstanceDataRespVO.getFldKy());
|
||||||
|
tmplInscDatBsnRespVO.setFldKy(templateInstanceDataRespVO.getFldKy());
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
return tmplInscDatBsnRespVOS;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 实例数据
|
||||||
|
private List<TemplateInstanceDataRespVO> setTemplateInstanceDataRespVOS(TmplInscBsnRelRespVO tmplInscBsnRelRespVO) {
|
||||||
|
return BeanUtils.toBean(SpringUtil.getBean(TemplateInstanceDataMapper.class).selectList(new LambdaQueryWrapper<TemplateInstanceDataDO>()
|
||||||
|
.eq(TemplateInstanceDataDO::getInscId, tmplInscBsnRelRespVO.getInscId())
|
||||||
|
.eq(TemplateInstanceDataDO::getCompanyId, CompanyContextHolder.getCompanyId())), TemplateInstanceDataRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 条款
|
||||||
|
private List<TemplateInstanceItemRespVO> setInstanceItemRespVOS(TmplInscBsnRelRespVO tmplInscBsnRelRespVO) {
|
||||||
|
List<TemplateInstanceItemDO> templateInstanceItemDOS = SpringUtil.getBean(TemplateInstanceItemMapper.class).selectList(new LambdaQueryWrapper<TemplateInstanceItemDO>()
|
||||||
|
.eq(TemplateInstanceItemDO::getInscId, tmplInscBsnRelRespVO.getInscId())
|
||||||
|
.eq(TemplateInstanceItemDO::getCompanyId, CompanyContextHolder.getCompanyId()));
|
||||||
|
List<TemplateInstanceItemRespVO> templateInstanceItemRespVOS = BeanUtils.toBean(templateInstanceItemDOS, TemplateInstanceItemRespVO.class);
|
||||||
|
TmplItmMapper tmplItmMapper = SpringUtil.getBean(TmplItmMapper.class);
|
||||||
|
List<String> ids = templateInstanceItemRespVOS.stream().map(TemplateInstanceItemRespVO::getItmId).toList();
|
||||||
|
if (ids.isEmpty()) {
|
||||||
|
return templateInstanceItemRespVOS;
|
||||||
|
}
|
||||||
|
List<TmplItmDO> tmplItmDOS = tmplItmMapper.selectByIds(ids);
|
||||||
|
tmplItmDOS.forEach(tmplItmDO -> {
|
||||||
|
templateInstanceItemRespVOS.forEach(templateInstanceItemRespVO -> {
|
||||||
|
if (templateInstanceItemRespVO.getItmId().equals(tmplItmDO.getId())) {
|
||||||
|
templateInstanceItemRespVO.setItmName(tmplItmDO.getItmName());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return templateInstanceItemRespVOS;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<String> setDeptData(TmplInscBsnRelRespVO tmplInscBsnRelRespVO) {
|
||||||
|
Long loginUserCompanyId = SecurityFrameworkUtils.getLoginUserCompanyId();
|
||||||
|
return SpringUtil.getBean(DepartmentInstanceRelativityMapper.class).selectList(new LambdaQueryWrapper<DepartmentInstanceRelativityDO>()
|
||||||
|
.eq(DepartmentInstanceRelativityDO::getTemplateInstanceId, tmplInscBsnRelRespVO.getInscId())
|
||||||
|
.eq(DepartmentInstanceRelativityDO::getCompanyId, loginUserCompanyId)
|
||||||
|
)
|
||||||
|
.stream()
|
||||||
|
.map(DepartmentInstanceRelativityDO::getCompanyDepartmentId)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fileUpload(TmplInscBsnRelSaveReqVO createReqVO, TemplateInstanceRespVO templateInstance, String type) {
|
||||||
|
String id = "";
|
||||||
|
FileRespDTO fileRespDTO = null;
|
||||||
|
FileApi fileApi = SpringUtil.getBean(FileApi.class);
|
||||||
|
if (Objects.equals(type, "cntt")) {
|
||||||
|
id = JSONObject.parseObject(templateInstance.getCntt()).get("id").toString();
|
||||||
|
CommonResult<FileRespDTO> file = fileApi.getFile(Long.valueOf(id));
|
||||||
|
if (!file.isSuccess()) {
|
||||||
|
throw exception(FILE_PULL_EER);
|
||||||
|
}
|
||||||
|
fileRespDTO = file.getData();
|
||||||
|
} else if (Objects.equals(type, "origCntt")) {
|
||||||
|
JSONArray jsonArray = JSONArray.parseArray(templateInstance.getOrigCntt());
|
||||||
|
if (jsonArray != null && !jsonArray.isEmpty()) {
|
||||||
|
JSONObject firstObj = jsonArray.getJSONObject(0);
|
||||||
|
id = firstObj.getString("id");
|
||||||
|
CommonResult<FileRespDTO> file = fileApi.getFile(Long.valueOf(id));
|
||||||
|
if (!file.isSuccess()) {
|
||||||
|
throw exception(FILE_PULL_EER);
|
||||||
|
}
|
||||||
|
fileRespDTO = file.getData();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
throw exception(ILLEGAL_OPERATION_TYPE);
|
||||||
|
}
|
||||||
|
if (fileRespDTO == null) {
|
||||||
|
throw exception(FILE_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
FileCreateReqDTO fileCreateReqDTO = new FileCreateReqDTO();
|
||||||
|
fileCreateReqDTO.setName(fileRespDTO.getName())
|
||||||
|
.setDirectory("模版合同")
|
||||||
|
.setType(fileCreateReqDTO.getType())
|
||||||
|
.setContent(fileRespDTO.getContent());
|
||||||
|
log.info("==================下载文件成功,开始上传文件==================");
|
||||||
|
CommonResult<FileRespDTO> fileWithReturn = fileApi.createFileWithReturn(fileCreateReqDTO);
|
||||||
|
if (!fileWithReturn.isSuccess()) {
|
||||||
|
throw exception(FILE_UPLOAD_EER);
|
||||||
|
}
|
||||||
|
log.info("=====================上传文件成功=============================");
|
||||||
|
Map<String, Object> fileInfo = new HashMap<>();
|
||||||
|
fileInfo.put("id", String.valueOf(fileRespDTO.getId()));
|
||||||
|
fileInfo.put("name", fileRespDTO.getName());
|
||||||
|
fileInfo.put("directory", fileRespDTO.getDirectory());
|
||||||
|
createReqVO.setCntt(JSONObject.toJSONString(fileInfo));
|
||||||
|
log.info("创建的文件信息【{}】", fileInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
private <T> void deleteFldOrItmByIds(List<String> ids, T t) {
|
||||||
|
if (CollUtil.isEmpty(ids)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (t instanceof TmplInscDatBsnService) {
|
||||||
|
((TmplInscDatBsnService) t).deleteTmplInscDatBsnListByBsnIds(ids);
|
||||||
|
log.info("删除业务实例字段值【{}】", ids);
|
||||||
|
} else if (t instanceof TmplInscItmBsnService) {
|
||||||
|
((TmplInscItmBsnService) t).deleteTmplInscDatBsnListByBsnIds(ids);
|
||||||
|
log.info("删除业务实例条款值【{}】", ids);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
package com.zt.plat.module.base.service.tmpltp;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.tmpltp.TmplInscDatBsnDO;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import com.zt.plat.module.base.controller.admin.templtp.vo.*;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务实例字段值 Service 接口
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
public interface TmplInscDatBsnService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建业务实例字段值
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
TmplInscDatBsnRespVO createTmplInscDatBsn(@Valid TmplInscDatBsnSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新业务实例字段值
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateTmplInscDatBsn(@Valid TmplInscDatBsnSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除业务实例字段值
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteTmplInscDatBsn(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除业务实例字段值
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteTmplInscDatBsnListByIds(List<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得业务实例字段值
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 业务实例字段值
|
||||||
|
*/
|
||||||
|
TmplInscDatBsnDO getTmplInscDatBsn(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得业务实例字段值分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 业务实例字段值分页
|
||||||
|
*/
|
||||||
|
PageResult<TmplInscDatBsnDO> getTmplInscDatBsnPage(TmplInscDatBsnPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过业务id删除业务字段
|
||||||
|
*
|
||||||
|
* @param ids 业务id
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void deleteTmplInscDatBsnListByBsnIds(@Valid @NotEmpty(message = "业务编号不能为空") List<String> ids);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
package com.zt.plat.module.base.service.tmpltp;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.zt.plat.framework.tenant.core.aop.CompanyVisitIgnore;
|
||||||
|
import com.zt.plat.framework.tenant.core.aop.TenantIgnore;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.tmpltp.TmplInscDatBsnDO;
|
||||||
|
import com.zt.plat.module.base.dal.mysql.tmpltp.TmplInscDatBsnMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
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;
|
||||||
|
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_DAT_BSN_NOT_EXISTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务实例字段值 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class TmplInscDatBsnServiceImpl implements TmplInscDatBsnService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TmplInscDatBsnMapper tmplInscDatBsnMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TmplInscDatBsnRespVO createTmplInscDatBsn(TmplInscDatBsnSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
TmplInscDatBsnDO tmplInscDatBsn = BeanUtils.toBean(createReqVO, TmplInscDatBsnDO.class);
|
||||||
|
tmplInscDatBsnMapper.insert(tmplInscDatBsn);
|
||||||
|
// 返回
|
||||||
|
return BeanUtils.toBean(tmplInscDatBsn, TmplInscDatBsnRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateTmplInscDatBsn(TmplInscDatBsnSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateTmplInscDatBsnExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
TmplInscDatBsnDO updateObj = BeanUtils.toBean(updateReqVO, TmplInscDatBsnDO.class);
|
||||||
|
tmplInscDatBsnMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteTmplInscDatBsn(String id) {
|
||||||
|
// 校验存在
|
||||||
|
validateTmplInscDatBsnExists(id);
|
||||||
|
// 删除
|
||||||
|
tmplInscDatBsnMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteTmplInscDatBsnListByIds(List<String> ids) {
|
||||||
|
// 校验存在
|
||||||
|
validateTmplInscDatBsnExists(ids);
|
||||||
|
// 删除
|
||||||
|
tmplInscDatBsnMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateTmplInscDatBsnExists(List<String> ids) {
|
||||||
|
List<TmplInscDatBsnDO> list = tmplInscDatBsnMapper.selectByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||||
|
throw exception(TMPL_INSC_DAT_BSN_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateTmplInscDatBsnExists(String id) {
|
||||||
|
if (tmplInscDatBsnMapper.selectById(id) == null) {
|
||||||
|
throw exception(TMPL_INSC_DAT_BSN_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TmplInscDatBsnDO getTmplInscDatBsn(String id) {
|
||||||
|
return tmplInscDatBsnMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<TmplInscDatBsnDO> getTmplInscDatBsnPage(TmplInscDatBsnPageReqVO pageReqVO) {
|
||||||
|
return tmplInscDatBsnMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@TenantIgnore
|
||||||
|
public void deleteTmplInscDatBsnListByBsnIds(List<String> ids) {
|
||||||
|
tmplInscDatBsnMapper.update(new LambdaUpdateWrapper<TmplInscDatBsnDO>().in(TmplInscDatBsnDO::getBsnId, ids).set(TmplInscDatBsnDO::getDeleted, 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
package com.zt.plat.module.base.service.tmpltp;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.tmpltp.TmplInscItmBsnDO;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import com.zt.plat.module.base.controller.admin.templtp.vo.*;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务实例条款值 Service 接口
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
public interface TmplInscItmBsnService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建业务实例条款值
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
TmplInscItmBsnRespVO createTmplInscItmBsn(@Valid TmplInscItmBsnSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新业务实例条款值
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateTmplInscItmBsn(@Valid TmplInscItmBsnSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除业务实例条款值
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteTmplInscItmBsn(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除业务实例条款值
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteTmplInscItmBsnListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得业务实例条款值
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 业务实例条款值
|
||||||
|
*/
|
||||||
|
TmplInscItmBsnDO getTmplInscItmBsn(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得业务实例条款值分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 业务实例条款值分页
|
||||||
|
*/
|
||||||
|
PageResult<TmplInscItmBsnDO> getTmplInscItmBsnPage(TmplInscItmBsnPageReqVO pageReqVO);
|
||||||
|
/**
|
||||||
|
* 批量删除业务实例字段值
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteTmplInscDatBsnListByBsnIds(@Valid @NotEmpty(message = "业务编号不能为空") List<String> ids);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
package com.zt.plat.module.base.service.tmpltp;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.zt.plat.framework.tenant.core.aop.TenantIgnore;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.tmpltp.TmplInscDatBsnDO;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.tmpltp.TmplInscItmBsnDO;
|
||||||
|
import com.zt.plat.module.base.dal.mysql.tmpltp.TmplInscItmBsnMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
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;
|
||||||
|
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_NOT_EXISTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务实例条款值 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class TmplInscItmBsnServiceImpl implements TmplInscItmBsnService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TmplInscItmBsnMapper tmplInscItmBsnMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TmplInscItmBsnRespVO createTmplInscItmBsn(TmplInscItmBsnSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
TmplInscItmBsnDO tmplInscItmBsn = BeanUtils.toBean(createReqVO, TmplInscItmBsnDO.class);
|
||||||
|
tmplInscItmBsnMapper.insert(tmplInscItmBsn);
|
||||||
|
// 返回
|
||||||
|
return BeanUtils.toBean(tmplInscItmBsn, TmplInscItmBsnRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateTmplInscItmBsn(TmplInscItmBsnSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateTmplInscItmBsnExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
TmplInscItmBsnDO updateObj = BeanUtils.toBean(updateReqVO, TmplInscItmBsnDO.class);
|
||||||
|
tmplInscItmBsnMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteTmplInscItmBsn(String id) {
|
||||||
|
// 校验存在
|
||||||
|
validateTmplInscItmBsnExists(id);
|
||||||
|
// 删除
|
||||||
|
tmplInscItmBsnMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteTmplInscItmBsnListByIds(List<Long> ids) {
|
||||||
|
// 校验存在
|
||||||
|
validateTmplInscItmBsnExists(ids);
|
||||||
|
// 删除
|
||||||
|
tmplInscItmBsnMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateTmplInscItmBsnExists(List<Long> ids) {
|
||||||
|
List<TmplInscItmBsnDO> list = tmplInscItmBsnMapper.selectByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||||
|
throw exception(TMPL_INSC_ITM_BSN_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateTmplInscItmBsnExists(String id) {
|
||||||
|
if (tmplInscItmBsnMapper.selectById(id) == null) {
|
||||||
|
throw exception(TMPL_INSC_ITM_BSN_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TmplInscItmBsnDO getTmplInscItmBsn(String id) {
|
||||||
|
return tmplInscItmBsnMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<TmplInscItmBsnDO> getTmplInscItmBsnPage(TmplInscItmBsnPageReqVO pageReqVO) {
|
||||||
|
return tmplInscItmBsnMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@TenantIgnore
|
||||||
|
public void deleteTmplInscDatBsnListByBsnIds(List<String> ids) {
|
||||||
|
tmplInscItmBsnMapper.update(new LambdaUpdateWrapper<TmplInscItmBsnDO>().in(TmplInscItmBsnDO::getBsnId, ids).set(TmplInscItmBsnDO::getDeleted, 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.zt.plat.module.base.dal.dao.tmplinscbsnrel.TmplInscBsnRelMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user