Merge remote-tracking branch 'base-version/main' into dev

This commit is contained in:
chenbowen
2025-09-23 10:17:18 +08:00
4 changed files with 28 additions and 18 deletions

View File

@@ -1,5 +1,6 @@
package com.zt.plat.module.template.controller.admin.contract;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import com.zt.plat.framework.business.annotation.FileUploadController;
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
@@ -19,7 +20,6 @@ import com.zt.plat.module.template.controller.admin.contract.vo.DemoContractResp
import com.zt.plat.module.template.controller.admin.contract.vo.DemoContractSaveReqVO;
import com.zt.plat.module.template.dal.dataobject.contract.DemoContractDO;
import com.zt.plat.module.template.service.contract.DemoContractService;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;

View File

@@ -4,10 +4,11 @@ import com.zt.plat.module.infra.api.config.ConfigApi;
import com.zt.plat.module.infra.api.file.FileApi;
import com.zt.plat.module.infra.api.websocket.WebSocketSenderApi;
import com.zt.plat.module.system.api.dept.DeptApi;
import com.zt.plat.module.system.api.sequence.SequenceApi;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Configuration;
@Configuration(value = "templateRpcConfiguration", proxyBeanMethods = false)
@EnableFeignClients(clients = {FileApi.class, WebSocketSenderApi.class, ConfigApi.class, DeptApi.class})
@EnableFeignClients(clients = {FileApi.class, WebSocketSenderApi.class, ConfigApi.class, DeptApi.class, SequenceApi.class})
public class RpcConfiguration {
}

View File

@@ -1,24 +1,23 @@
package com.zt.plat.module.template.service.contract;
import cn.hutool.core.collection.CollUtil;
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.template.controller.admin.contract.vo.*;
import com.zt.plat.module.template.dal.dataobject.contract.DemoContractDO;
import com.zt.plat.framework.common.pojo.CommonResult;
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 com.zt.plat.module.system.api.sequence.SequenceApi;
import com.zt.plat.module.template.controller.admin.contract.vo.DemoContractPageReqVO;
import com.zt.plat.module.template.controller.admin.contract.vo.DemoContractRespVO;
import com.zt.plat.module.template.controller.admin.contract.vo.DemoContractSaveReqVO;
import com.zt.plat.module.template.dal.dataobject.contract.DemoContractDO;
import com.zt.plat.module.template.dal.mysql.contract.DemoContractMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import java.util.List;
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.template.enums.ErrorCodeConstants.*;
import static com.zt.plat.module.template.enums.ErrorCodeConstants.DEMO_CONTRACT_NOT_EXISTS;
/**
* 合同 Service 实现类
@@ -32,10 +31,15 @@ public class DemoContractServiceImpl implements DemoContractService {
@Resource
private DemoContractMapper demoContractMapper;
@Resource
private SequenceApi sequenceApi;
@Override
public DemoContractRespVO createDemoContract(DemoContractSaveReqVO createReqVO) {
// 插入
DemoContractDO demoContract = BeanUtils.toBean(createReqVO, DemoContractDO.class);
CommonResult<String> seq = sequenceApi.getNextSequence("SEQ", null, null);
demoContract.setCode(seq.getData());
demoContractMapper.insert(demoContract);
// 返回
return BeanUtils.toBean(demoContract, DemoContractRespVO.class);