Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -19,7 +19,7 @@
|
|||||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<revision>3.0.41</revision>
|
<revision>3.0.42</revision>
|
||||||
<!-- Maven 相关 -->
|
<!-- Maven 相关 -->
|
||||||
<java.version>17</java.version>
|
<java.version>17</java.version>
|
||||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.zt.plat.module.api;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.module.api.dto.AccountRespDto;
|
||||||
|
import com.zt.plat.module.base.enums.ApiConstants;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@FeignClient(name = ApiConstants.NAME)
|
||||||
|
@Tag(name = "RPC 服务 - base")
|
||||||
|
public interface BaseApi {
|
||||||
|
|
||||||
|
String PREFIX = ApiConstants.PREFIX + "/base";
|
||||||
|
|
||||||
|
@GetMapping(PREFIX + "/getNoPage")
|
||||||
|
@Operation(summary = "数据查询")
|
||||||
|
List<AccountRespDto> getNoPage(@Valid AccountRespDto respVO);
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.zt.plat.module.api.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "RPC 服务 DTO")
|
||||||
|
@Data
|
||||||
|
public class AccountRespDto {
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
private String accountName;
|
||||||
|
|
||||||
|
private String bankAccount;
|
||||||
|
|
||||||
|
private String accountNumber;
|
||||||
|
|
||||||
|
private String taxNumber;
|
||||||
|
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
private String isEnable;
|
||||||
|
|
||||||
|
private String customerNumber;
|
||||||
|
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.zt.plat.module.base.enums;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.enums.RpcConstants;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API 相关的枚举
|
||||||
|
*
|
||||||
|
* @author ZT
|
||||||
|
*/
|
||||||
|
public class ApiConstants {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务名
|
||||||
|
*
|
||||||
|
* 注意,需要保证和 spring.application.name 保持一致
|
||||||
|
*/
|
||||||
|
public static final String NAME = "base-server";
|
||||||
|
|
||||||
|
public static final String PREFIX = RpcConstants.RPC_API_PREFIX + "/base";
|
||||||
|
|
||||||
|
public static final String VERSION = "1.0.0";
|
||||||
|
|
||||||
|
public static final String TABLE_FIELD_SPLY_ERP_CPN_NUM = "NUM";
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.zt.plat.module.base.api;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.module.api.BaseApi;
|
||||||
|
import com.zt.plat.module.api.dto.AccountRespDto;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.base.AccountDO;
|
||||||
|
import com.zt.plat.module.base.service.base.AccountService;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP Api 实现类
|
||||||
|
*
|
||||||
|
* @author ZT
|
||||||
|
* @author jason
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@Validated
|
||||||
|
public class BaseApiImpl implements BaseApi {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AccountService accountService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AccountRespDto> getNoPage(AccountRespDto respVO) {
|
||||||
|
return accountService.getAccountNoPage(respVO);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,10 +3,14 @@ package com.zt.plat.module.base.dal.mysql.base;
|
|||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.module.api.dto.AccountRespDto;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.AccountPageReqVO;
|
import com.zt.plat.module.base.controller.admin.base.vo.AccountPageReqVO;
|
||||||
|
import com.zt.plat.module.base.controller.admin.base.vo.AccountRespVO;
|
||||||
import com.zt.plat.module.base.dal.dataobject.base.AccountDO;
|
import com.zt.plat.module.base.dal.dataobject.base.AccountDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 账户条款 Mapper
|
* 账户条款 Mapper
|
||||||
*
|
*
|
||||||
@@ -31,4 +35,18 @@ public interface AccountMapper extends BaseMapperX<AccountDO> {
|
|||||||
.orderByDesc(AccountDO::getId));
|
.orderByDesc(AccountDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<AccountDO> selectNoPage(AccountRespDto reqVO){
|
||||||
|
return selectList(new LambdaQueryWrapperX<AccountDO>()
|
||||||
|
.eqIfPresent(AccountDO::getType, reqVO.getType())
|
||||||
|
.likeIfPresent(AccountDO::getAccountName, reqVO.getAccountName())
|
||||||
|
.likeIfPresent(AccountDO::getAddress, reqVO.getAddress())
|
||||||
|
.likeIfPresent(AccountDO::getPhone, reqVO.getPhone())
|
||||||
|
.eqIfPresent(AccountDO::getBankAccount, reqVO.getBankAccount())
|
||||||
|
.eqIfPresent(AccountDO::getCustomerName, reqVO.getCustomerName())
|
||||||
|
.eqIfPresent(AccountDO::getCustomerNumber, reqVO.getCustomerNumber())
|
||||||
|
.eqIfPresent(AccountDO::getIsEnable, reqVO.getIsEnable())
|
||||||
|
.eqIfPresent(AccountDO::getAccountNumber, reqVO.getAccountNumber())
|
||||||
|
.eqIfPresent(AccountDO::getTaxNumber, reqVO.getTaxNumber())
|
||||||
|
.orderByDesc(AccountDO::getId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -7,6 +7,7 @@ import com.zt.plat.module.base.controller.admin.base.vo.CompanyRelativityPageReq
|
|||||||
import com.zt.plat.module.base.dal.dataobject.base.CompanyRelaDeptDO;
|
import com.zt.plat.module.base.dal.dataobject.base.CompanyRelaDeptDO;
|
||||||
import com.zt.plat.module.base.dal.dataobject.base.CompanyRelativityDO;
|
import com.zt.plat.module.base.dal.dataobject.base.CompanyRelativityDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -27,4 +28,6 @@ public interface CompanyRelativityMapper extends BaseMapperX<CompanyRelativityDO
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<CompanyRelaDeptDO> getPageByReq(CompanyRelativityPageReqVO pageReqVO);
|
List<CompanyRelaDeptDO> getPageByReq(CompanyRelativityPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
void removeByIds(@Param("ids")List<Long> ids);
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.zt.plat.module.base.service.base;
|
package com.zt.plat.module.base.service.base;
|
||||||
|
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.module.api.dto.AccountRespDto;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.AccountPageReqVO;
|
import com.zt.plat.module.base.controller.admin.base.vo.AccountPageReqVO;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.AccountRespVO;
|
import com.zt.plat.module.base.controller.admin.base.vo.AccountRespVO;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.AccountSaveReqVO;
|
import com.zt.plat.module.base.controller.admin.base.vo.AccountSaveReqVO;
|
||||||
@@ -67,4 +68,6 @@ public interface AccountService {
|
|||||||
* @param saveReqVOS 账户条款
|
* @param saveReqVOS 账户条款
|
||||||
*/
|
*/
|
||||||
void enableAccountList(List<AccountSaveReqVO> saveReqVOS);
|
void enableAccountList(List<AccountSaveReqVO> saveReqVOS);
|
||||||
|
|
||||||
|
List<AccountRespDto> getAccountNoPage(AccountRespDto respVO);
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,7 @@ package com.zt.plat.module.base.service.base;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import com.zt.plat.module.api.dto.AccountRespDto;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.AccountPageReqVO;
|
import com.zt.plat.module.base.controller.admin.base.vo.AccountPageReqVO;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.AccountRespVO;
|
import com.zt.plat.module.base.controller.admin.base.vo.AccountRespVO;
|
||||||
import com.zt.plat.module.base.controller.admin.base.vo.AccountSaveReqVO;
|
import com.zt.plat.module.base.controller.admin.base.vo.AccountSaveReqVO;
|
||||||
@@ -96,4 +97,9 @@ public class AccountServiceImpl implements AccountService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AccountRespDto> getAccountNoPage(AccountRespDto respVO) {
|
||||||
|
List<AccountDO> entityList = accountMapper.selectNoPage(respVO);
|
||||||
|
return BeanUtils.toBean(entityList, AccountRespDto.class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -64,7 +64,7 @@ public class CompanyRelativityServiceImpl implements CompanyRelativityService {
|
|||||||
// 校验存在
|
// 校验存在
|
||||||
validateCompanyRelativityExists(ids);
|
validateCompanyRelativityExists(ids);
|
||||||
// 删除
|
// 删除
|
||||||
companyRelativityMapper.deleteByIds(ids);
|
companyRelativityMapper.removeByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validateCompanyRelativityExists(List<Long> ids) {
|
private void validateCompanyRelativityExists(List<Long> ids) {
|
||||||
|
|||||||
@@ -43,4 +43,11 @@
|
|||||||
and d.DEPT_SOURCE = #{departmentSource}
|
and d.DEPT_SOURCE = #{departmentSource}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<delete id="removeByIds">
|
||||||
|
delete from SPLY_CPN_REL where ID in
|
||||||
|
<foreach item="ids" collection="list" separator="," open="(" close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -23,4 +23,5 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode CONTRACT_STATUS_NOT_APPROVAL = new ErrorCode(1_027_000_008, "{}状态合同不允许审核");
|
ErrorCode CONTRACT_STATUS_NOT_APPROVAL = new ErrorCode(1_027_000_008, "{}状态合同不允许审核");
|
||||||
ErrorCode CONTRACT_ERP_COMPANY_PLEASE_BIND = new ErrorCode(1_027_000_009, "请先绑定{}ERP公司信息");
|
ErrorCode CONTRACT_ERP_COMPANY_PLEASE_BIND = new ErrorCode(1_027_000_009, "请先绑定{}ERP公司信息");
|
||||||
ErrorCode CONTRACT_STATUS_NOT_DELETE = new ErrorCode(1_027_000_010, "{}状态合同不允许删除");
|
ErrorCode CONTRACT_STATUS_NOT_DELETE = new ErrorCode(1_027_000_010, "{}状态合同不允许删除");
|
||||||
|
ErrorCode CONTRACT_ERP_RCV_DLVY_NOT_EXISTS = new ErrorCode(1_027_000_010, "不存在的收支类型或收支类型为空");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ public class TableFieldConstants {
|
|||||||
public static final String BSE_CTRT_MAIN_CTRT_PPR_NUM = "CTRT_PPR_NUM";
|
public static final String BSE_CTRT_MAIN_CTRT_PPR_NUM = "CTRT_PPR_NUM";
|
||||||
public static final String BSE_CTRT_MAIN_CTRT_PPR_NUM_LABEL = "合同编号";
|
public static final String BSE_CTRT_MAIN_CTRT_PPR_NUM_LABEL = "合同编号";
|
||||||
// 甲方公司编号
|
// 甲方公司编号
|
||||||
|
public static final String BSE_CTRT_MAIN_PRCH_CPN_NUM = "PRCH_CPN_NUM";
|
||||||
public static final String BSE_CTRT_MAIN_PRCH_CPN_NUM_LABEL = "甲方公司编号";
|
public static final String BSE_CTRT_MAIN_PRCH_CPN_NUM_LABEL = "甲方公司编号";
|
||||||
// 甲方公司名称
|
// 甲方公司名称
|
||||||
public static final String BSE_CTRT_MAIN_PRCH_CPN_NAME_LABEL = "甲方公司名称";
|
public static final String BSE_CTRT_MAIN_PRCH_CPN_NAME_LABEL = "甲方公司名称";
|
||||||
@@ -28,6 +29,7 @@ public class TableFieldConstants {
|
|||||||
// 甲方法定代表人
|
// 甲方法定代表人
|
||||||
public static final String BSE_CTRT_MAIN_PRCH_LDR_LABEL = "甲方法定代表人";
|
public static final String BSE_CTRT_MAIN_PRCH_LDR_LABEL = "甲方法定代表人";
|
||||||
// 乙方公司编号
|
// 乙方公司编号
|
||||||
|
public static final String BSE_CTRT_MAIN_SALE_CPN_NUM = "SALE_CPN_NUM_LABEL";
|
||||||
public static final String BSE_CTRT_MAIN_SALE_CPN_NUM_LABEL = "乙方公司编号";
|
public static final String BSE_CTRT_MAIN_SALE_CPN_NUM_LABEL = "乙方公司编号";
|
||||||
// 乙方公司名称
|
// 乙方公司名称
|
||||||
public static final String BSE_CTRT_MAIN_SALE_CPN_NAME_LABEL = "乙方公司名称";
|
public static final String BSE_CTRT_MAIN_SALE_CPN_NAME_LABEL = "乙方公司名称";
|
||||||
@@ -135,4 +137,10 @@ public class TableFieldConstants {
|
|||||||
/* 实例条款值表 */
|
/* 实例条款值表 */
|
||||||
// 关联实例主键
|
// 关联实例主键
|
||||||
public static final String BSE_TMPL_INSC_ITM_INSC_ID = "INSC_ID";
|
public static final String BSE_TMPL_INSC_ITM_INSC_ID = "INSC_ID";
|
||||||
|
|
||||||
|
/* 业务关联表 */
|
||||||
|
// 上游主键
|
||||||
|
public static final String BSE_SYS_REL_UP_ID = "UP_ID";
|
||||||
|
// 下游主键
|
||||||
|
public static final String BSE_SYS_REL_DOWN_ID = "DOWN_ID";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ package com.zt.plat.module.contractorder.enums.contract;
|
|||||||
*/
|
*/
|
||||||
public enum DictEnum {
|
public enum DictEnum {
|
||||||
|
|
||||||
|
/** 业务关联类型 */
|
||||||
|
BSE_SYS_REL_TP_ORDER("订单","ORDER",null),
|
||||||
|
BSE_SYS_REL_TP_CONTRACT("合同","CONTRACT",null),
|
||||||
/** 提交ERP合同状态 */
|
/** 提交ERP合同状态 */
|
||||||
SUBMIT_ERP_CTRT_STS_EF("正在执行","EF","其它所有状态"),
|
SUBMIT_ERP_CTRT_STS_EF("正在执行","EF","其它所有状态"),
|
||||||
SUBMIT_ERP_CTRT_STS_BFZT("部分暂停","BFZT",null),
|
SUBMIT_ERP_CTRT_STS_BFZT("部分暂停","BFZT",null),
|
||||||
|
|||||||
@@ -100,28 +100,28 @@ public class ContractController implements BusinessControllerMarker {
|
|||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
@PostMapping("/download")
|
@PostMapping("/download")
|
||||||
@Operation(summary = "下载文件")
|
@Operation(summary = "下载文件 TODO")
|
||||||
@PreAuthorize("@ss.hasPermission('base:contract:download')")
|
@PreAuthorize("@ss.hasPermission('base:contract:download')")
|
||||||
public void download() {
|
public void download() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
@PostMapping("/preview")
|
@PostMapping("/preview")
|
||||||
@Operation(summary = "预览文件")
|
@Operation(summary = "预览文件 TODO")
|
||||||
@PreAuthorize("@ss.hasPermission('base:contract:preview')")
|
@PreAuthorize("@ss.hasPermission('base:contract:preview')")
|
||||||
public void preview() {
|
public void preview() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
@PostMapping("/complete")
|
@PostMapping("/complete")
|
||||||
@Operation(summary = "完结")
|
@Operation(summary = "完结 TODO")
|
||||||
@PreAuthorize("@ss.hasPermission('base:contract:complete')")
|
@PreAuthorize("@ss.hasPermission('base:contract:complete')")
|
||||||
public void complete() {
|
public void complete() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
@PostMapping("/archive")
|
@PostMapping("/archive")
|
||||||
@Operation(summary = "归档")
|
@Operation(summary = "归档 TODO")
|
||||||
@PreAuthorize("@ss.hasPermission('base:contract:archive')")
|
@PreAuthorize("@ss.hasPermission('base:contract:archive')")
|
||||||
public void archive() {
|
public void archive() {
|
||||||
}
|
}
|
||||||
@@ -135,7 +135,7 @@ public class ContractController implements BusinessControllerMarker {
|
|||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
@PostMapping("/approval")
|
@PostMapping("/approval")
|
||||||
@Operation(summary = "合同审批")
|
@Operation(summary = "合同审批 TODO")
|
||||||
@PreAuthorize("@ss.hasPermission('base:contract:approval')")
|
@PreAuthorize("@ss.hasPermission('base:contract:approval')")
|
||||||
public CommonResult<String> approval(@Valid @RequestBody ApprovalReqVO reqVO) {
|
public CommonResult<String> approval(@Valid @RequestBody ApprovalReqVO reqVO) {
|
||||||
return success(contractService.approval(reqVO));
|
return success(contractService.approval(reqVO));
|
||||||
@@ -143,7 +143,7 @@ public class ContractController implements BusinessControllerMarker {
|
|||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
@PostMapping("/view/approval")
|
@PostMapping("/view/approval")
|
||||||
@Operation(summary = "查看审批")
|
@Operation(summary = "查看审批 TODO")
|
||||||
@PreAuthorize("@ss.hasPermission('base:contract:approval')")
|
@PreAuthorize("@ss.hasPermission('base:contract:approval')")
|
||||||
public void viewApproval() {
|
public void viewApproval() {
|
||||||
}
|
}
|
||||||
@@ -154,4 +154,39 @@ public class ContractController implements BusinessControllerMarker {
|
|||||||
public CommonResult<List<String>> submitErp(@RequestBody List<Long> ids) {
|
public CommonResult<List<String>> submitErp(@RequestBody List<Long> ids) {
|
||||||
return success(contractService.submitErp(ids));
|
return success(contractService.submitErp(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list/up-not-relation")
|
||||||
|
@Operation(summary = "获得上游未关联合同列表")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:contract:relation')")
|
||||||
|
public CommonResult<List<ContractRespVO>> getListUpNotRelation(@RequestParam("id") Long id) {
|
||||||
|
return success(contractService.getListUpNotRelation(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list/down-not-relation")
|
||||||
|
@Operation(summary = "获得下游未关联合同列表")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:contract:relation')")
|
||||||
|
public CommonResult<List<ContractRespVO>> getListDownNotRelation(@RequestParam("id") Long id) {
|
||||||
|
return success(contractService.getListDownNotRelation(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get/up-relation")
|
||||||
|
@Operation(summary = "获得上游关联的合同数据")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:contract:relation')")
|
||||||
|
public CommonResult<ContractRespVO> getUpRelation(@RequestParam("id") Long id) {
|
||||||
|
return success(contractService.getUpRelation(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get/down-relation")
|
||||||
|
@Operation(summary = "获得下游关联的合同数据")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:contract:relation')")
|
||||||
|
public CommonResult<ContractRespVO> getDownRelation(@RequestParam("id") Long id) {
|
||||||
|
return success(contractService.getDownRelation(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/relation")
|
||||||
|
@Operation(summary = "关联合同")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:contract:relation')")
|
||||||
|
public CommonResult<Boolean> relation(@RequestBody RelationReqVo reqVo) {
|
||||||
|
return success(contractService.relation(reqVo));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
|
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONArray;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import com.zt.plat.module.base.controller.admin.templtp.vo.TemplateInstanceDataSaveReqVO;
|
import com.zt.plat.module.base.controller.admin.templtp.vo.TemplateInstanceDataSaveReqVO;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
@@ -34,7 +35,7 @@ public class ContractSaveReqVO {
|
|||||||
private String fileObject;
|
private String fileObject;
|
||||||
|
|
||||||
@Schema(description = "其它附件对象存储")
|
@Schema(description = "其它附件对象存储")
|
||||||
private String fileObjectOther;
|
private JSONArray fileObjectOther;
|
||||||
|
|
||||||
// 合同基本信息
|
// 合同基本信息
|
||||||
@Schema(description = "甲方公司编号;如果是采购合同,查询组织机构自动带出,且与ERP(HTQDZTBH)对应,如果是销售合同,手动选择,且与ERP(WLDWBH)对应。", example = "甲方公司编号")
|
@Schema(description = "甲方公司编号;如果是采购合同,查询组织机构自动带出,且与ERP(HTQDZTBH)对应,如果是销售合同,手动选择,且与ERP(WLDWBH)对应。", example = "甲方公司编号")
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.zt.plat.module.contractorder.controller.admin.contract.vo.contract;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 合同关联请求对象 Request VO")
|
||||||
|
@Data
|
||||||
|
public class RelationReqVo {
|
||||||
|
|
||||||
|
@Schema(description = "上游主键", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "上游主键不能为空")
|
||||||
|
private Long upId;
|
||||||
|
|
||||||
|
@Schema(description = "下游主键", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "下游主键不能为空")
|
||||||
|
private Long downId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package com.zt.plat.module.contractorder.dal.dataobject.contract;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务关联 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@TableName("bse_sys_rel")
|
||||||
|
@KeySequence("bse_sys_rel_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class SystemRelativityDO extends BusinessBaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 上游主键
|
||||||
|
*/
|
||||||
|
@TableField("UP_ID")
|
||||||
|
private Long upId;
|
||||||
|
/**
|
||||||
|
* 下游主键
|
||||||
|
*/
|
||||||
|
@TableField("DOWN_ID")
|
||||||
|
private Long downId;
|
||||||
|
/**
|
||||||
|
* 方式系统;内关联/系统外关联
|
||||||
|
*/
|
||||||
|
@TableField("WY")
|
||||||
|
private String way;
|
||||||
|
/**
|
||||||
|
* 类型;合同/订单
|
||||||
|
*/
|
||||||
|
@TableField("STS")
|
||||||
|
private String status;
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.zt.plat.module.contractorder.dal.mysql.contract;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.zt.plat.module.contractorder.dal.dataobject.contract.SystemRelativityDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务关联 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SystemRelativityMapper extends BaseMapperX<SystemRelativityDO> {
|
||||||
|
}
|
||||||
@@ -119,4 +119,44 @@ public interface ContractService {
|
|||||||
* @return 合同信息
|
* @return 合同信息
|
||||||
*/
|
*/
|
||||||
ContractRespVO getBySystemContractNumber(String systemContractNumber);
|
ContractRespVO getBySystemContractNumber(String systemContractNumber);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得上游未关联合同列表
|
||||||
|
*
|
||||||
|
* @param id 合同ID
|
||||||
|
* @return 上游未关联的合同列表
|
||||||
|
*/
|
||||||
|
List<ContractRespVO> getListUpNotRelation(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得下游未关联合同列表
|
||||||
|
*
|
||||||
|
* @param id 合同ID
|
||||||
|
* @return 下游未关联的合同列表
|
||||||
|
*/
|
||||||
|
List<ContractRespVO> getListDownNotRelation(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得上游关联的合同数据
|
||||||
|
*
|
||||||
|
* @param id 合同ID
|
||||||
|
* @return 关联的上游合同数据
|
||||||
|
*/
|
||||||
|
ContractRespVO getUpRelation(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得下游关联的合同数据
|
||||||
|
*
|
||||||
|
* @param id 合同ID
|
||||||
|
* @return 关联的下游合同数据
|
||||||
|
*/
|
||||||
|
ContractRespVO getDownRelation(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联合同
|
||||||
|
*
|
||||||
|
* @param reqVo 上下游合同ID
|
||||||
|
* @return 关联结果
|
||||||
|
*/
|
||||||
|
Boolean relation(RelationReqVo reqVo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -93,6 +94,8 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
private ErpCompanyService erpCompanyService;
|
private ErpCompanyService erpCompanyService;
|
||||||
@Resource
|
@Resource
|
||||||
private ErpContractService erpContractService;
|
private ErpContractService erpContractService;
|
||||||
|
@Resource
|
||||||
|
private SystemRelativityMapper systemRelativityMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<ContractMainDO> getContractPage(ContractPageReqVO pageReqVO) {
|
public PageResult<ContractMainDO> getContractPage(ContractPageReqVO pageReqVO) {
|
||||||
@@ -462,6 +465,194 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
return respVO;
|
return respVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ContractRespVO> getListUpNotRelation(Long id) {
|
||||||
|
|
||||||
|
// 查询合同信息
|
||||||
|
ContractMainDO contractMainDO = contractMainMapper.selectById(id);
|
||||||
|
if (contractMainDO == null) {
|
||||||
|
throw exception(CONTRACT_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 收支性质
|
||||||
|
String direction = contractMainDO.getDirection();
|
||||||
|
// 甲方公司编号
|
||||||
|
String purchaseCompanyNumber = contractMainDO.getPurchaseCompanyNumber();
|
||||||
|
// 乙方公司编号
|
||||||
|
String salesCompanyNumber = contractMainDO.getSalesCompanyNumber();
|
||||||
|
|
||||||
|
// 已关联的上游合同id集合
|
||||||
|
List<SystemRelativityDO> systemRelativityDOS = systemRelativityMapper.selectList();
|
||||||
|
LinkedHashSet<Long> relationIds = new LinkedHashSet<>();
|
||||||
|
if (systemRelativityDOS!= null && !systemRelativityDOS.isEmpty()) {
|
||||||
|
systemRelativityDOS.forEach(systemRelativityDO -> {
|
||||||
|
relationIds.add(systemRelativityDO.getUpId());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回结果集
|
||||||
|
List<ContractRespVO> result = new ArrayList<>();
|
||||||
|
if (DictEnum.ERP_RCV_DLVY_INCOME.getCode().equals(direction)) { // 收入
|
||||||
|
// 如果“收支性质”字段为收入,用“甲方公司编号”字段筛选“合同主信息”表中字段等于“乙方公司编号”的数据
|
||||||
|
if (StringUtils.isEmpty(purchaseCompanyNumber)) {
|
||||||
|
// 甲方公司编号不存在
|
||||||
|
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_PRCH_CPN_NUM_LABEL);
|
||||||
|
}
|
||||||
|
// 查询条件
|
||||||
|
LambdaQueryWrapperX<ContractMainDO> conditon = new LambdaQueryWrapperX<>();
|
||||||
|
conditon.eq(ContractMainDO::getSalesCompanyNumber, purchaseCompanyNumber);
|
||||||
|
if (!relationIds.isEmpty()) {
|
||||||
|
conditon.notIn(ContractMainDO::getId, relationIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询
|
||||||
|
List<ContractMainDO> contractMainDOS = contractMainMapper.selectList(conditon);
|
||||||
|
result = BeanUtils.toBean(contractMainDOS, ContractRespVO.class);
|
||||||
|
} else if (DictEnum.ERP_RCV_DLVY_EXPENSES.getCode().equals(direction)){ // 支出
|
||||||
|
// 如果“收支性质”字段为支出,用“乙方公司编号”字段筛选“合同主信息”表中字段等于“甲方公司编号”的数据
|
||||||
|
if (StringUtils.isEmpty(salesCompanyNumber)) {
|
||||||
|
// 乙方公司编号不存在
|
||||||
|
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_SALE_CPN_NUM_LABEL);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询条件
|
||||||
|
LambdaQueryWrapperX<ContractMainDO> conditon = new LambdaQueryWrapperX<>();
|
||||||
|
conditon.eq(ContractMainDO::getPurchaseCompanyNumber, salesCompanyNumber);
|
||||||
|
if (!relationIds.isEmpty()) {
|
||||||
|
conditon.notIn(ContractMainDO::getId, relationIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询
|
||||||
|
List<ContractMainDO> contractMainDOS = contractMainMapper.selectList(conditon);
|
||||||
|
result = BeanUtils.toBean(contractMainDOS, ContractRespVO.class);
|
||||||
|
} else {
|
||||||
|
// 不存在的收支类型或收支类型为空
|
||||||
|
throw exception(CONTRACT_ERP_RCV_DLVY_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ContractRespVO> getListDownNotRelation(Long id) {
|
||||||
|
|
||||||
|
// 查询合同信息
|
||||||
|
ContractMainDO contractMainDO = contractMainMapper.selectById(id);
|
||||||
|
if (contractMainDO == null) {
|
||||||
|
throw exception(CONTRACT_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 收支性质
|
||||||
|
String direction = contractMainDO.getDirection();
|
||||||
|
// 甲方公司编号
|
||||||
|
String purchaseCompanyNumber = contractMainDO.getPurchaseCompanyNumber();
|
||||||
|
// 乙方公司编号
|
||||||
|
String salesCompanyNumber = contractMainDO.getSalesCompanyNumber();
|
||||||
|
|
||||||
|
// 已关联的上游合同id集合
|
||||||
|
List<SystemRelativityDO> systemRelativityDOS = systemRelativityMapper.selectList();
|
||||||
|
LinkedHashSet<Long> relationIds = new LinkedHashSet<>();
|
||||||
|
if (systemRelativityDOS!= null && !systemRelativityDOS.isEmpty()) {
|
||||||
|
systemRelativityDOS.forEach(systemRelativityDO -> {
|
||||||
|
relationIds.add(systemRelativityDO.getDownId());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回结果集
|
||||||
|
List<ContractRespVO> result = new ArrayList<>();
|
||||||
|
if (DictEnum.ERP_RCV_DLVY_INCOME.getCode().equals(direction)) { // 收入
|
||||||
|
// 如果“收支性质”字段为收入,用“甲方公司编号”字段筛选“合同主信息”表中字段等于“乙方公司编号”的数据
|
||||||
|
if (StringUtils.isEmpty(purchaseCompanyNumber)) {
|
||||||
|
// 甲方公司编号不存在
|
||||||
|
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_PRCH_CPN_NUM_LABEL);
|
||||||
|
}
|
||||||
|
// 查询条件
|
||||||
|
LambdaQueryWrapperX<ContractMainDO> conditon = new LambdaQueryWrapperX<>();
|
||||||
|
conditon.eq(ContractMainDO::getSalesCompanyNumber, purchaseCompanyNumber);
|
||||||
|
if (!relationIds.isEmpty()) {
|
||||||
|
conditon.notIn(ContractMainDO::getId, relationIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询
|
||||||
|
List<ContractMainDO> contractMainDOS = contractMainMapper.selectList(conditon);
|
||||||
|
result = BeanUtils.toBean(contractMainDOS, ContractRespVO.class);
|
||||||
|
} else if (DictEnum.ERP_RCV_DLVY_EXPENSES.getCode().equals(direction)){ // 支出
|
||||||
|
// 如果“收支性质”字段为支出,用“乙方公司编号”字段筛选“合同主信息”表中字段等于“甲方公司编号”的数据
|
||||||
|
if (StringUtils.isEmpty(salesCompanyNumber)) {
|
||||||
|
// 乙方公司编号不存在
|
||||||
|
throw exception(CONTRACT_DATA_NOT_EXISTS, TableFieldConstants.BSE_CTRT_MAIN_SALE_CPN_NUM_LABEL);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询条件
|
||||||
|
LambdaQueryWrapperX<ContractMainDO> conditon = new LambdaQueryWrapperX<>();
|
||||||
|
conditon.eq(ContractMainDO::getPurchaseCompanyNumber, salesCompanyNumber);
|
||||||
|
if (!relationIds.isEmpty()) {
|
||||||
|
conditon.notIn(ContractMainDO::getId, relationIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询
|
||||||
|
List<ContractMainDO> contractMainDOS = contractMainMapper.selectList(conditon);
|
||||||
|
result = BeanUtils.toBean(contractMainDOS, ContractRespVO.class);
|
||||||
|
} else {
|
||||||
|
// 不存在的收支类型或收支类型为空
|
||||||
|
throw exception(CONTRACT_ERP_RCV_DLVY_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ContractRespVO getUpRelation(Long id) {
|
||||||
|
|
||||||
|
// 查询合同信息
|
||||||
|
if (contractMainMapper.selectById(id) == null) {
|
||||||
|
throw exception(CONTRACT_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询关联表
|
||||||
|
SystemRelativityDO systemRelativityDO = systemRelativityMapper.selectOne(TableFieldConstants.BSE_SYS_REL_DOWN_ID, id);
|
||||||
|
if (systemRelativityDO == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 上游合同ID
|
||||||
|
Long upId = systemRelativityDO.getUpId();
|
||||||
|
|
||||||
|
// 获取上游合同信息
|
||||||
|
ContractMainDO contractMainDO = contractMainMapper.selectById(upId);
|
||||||
|
if (contractMainDO == null) {
|
||||||
|
throw exception(CONTRACT_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
return BeanUtils.toBean(contractMainDO, ContractRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ContractRespVO getDownRelation(Long id) {
|
||||||
|
|
||||||
|
// 查询合同信息
|
||||||
|
if (contractMainMapper.selectById(id) == null) {
|
||||||
|
throw exception(CONTRACT_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询关联表
|
||||||
|
SystemRelativityDO systemRelativityDO = systemRelativityMapper.selectOne(TableFieldConstants.BSE_SYS_REL_UP_ID, id);
|
||||||
|
if (systemRelativityDO == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下游合同ID
|
||||||
|
Long upId = systemRelativityDO.getUpId();
|
||||||
|
|
||||||
|
// 获取下游合同信息
|
||||||
|
ContractMainDO contractMainDO = contractMainMapper.selectById(upId);
|
||||||
|
if (contractMainDO == null) {
|
||||||
|
throw exception(CONTRACT_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
return BeanUtils.toBean(contractMainDO, ContractRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public Boolean update(ContractSaveReqVO reqVO) {
|
public Boolean update(ContractSaveReqVO reqVO) {
|
||||||
@@ -859,26 +1050,6 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取合同ID集合
|
|
||||||
*
|
|
||||||
* @param contractName 合同名称
|
|
||||||
* @param contractPaperNumber 合同编号
|
|
||||||
* @return 合同ID集合
|
|
||||||
*/
|
|
||||||
private List<Long> getContractIds(String contractName, String contractPaperNumber) {
|
|
||||||
List<Long> contractIds = new ArrayList<>();
|
|
||||||
List<ContractMainDO> contractMainDOS = contractMainMapper.selectList(new LambdaQueryWrapperX<ContractMainDO>()
|
|
||||||
.likeIfPresent(ContractMainDO::getContractName, contractName)
|
|
||||||
.likeIfPresent(ContractMainDO::getContractPaperNumber, contractPaperNumber));
|
|
||||||
if (CollectionUtils.isNotEmpty(contractMainDOS)) {
|
|
||||||
contractIds = contractMainDOS.stream()
|
|
||||||
.map(contractMainDO -> contractMainDO.getId())
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
return contractIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<NotRespVO> getNots(NotsQueryReqVO queryReqVO) {
|
public List<NotRespVO> getNots(NotsQueryReqVO queryReqVO) {
|
||||||
// 查合同ID集合
|
// 查合同ID集合
|
||||||
@@ -1061,22 +1232,22 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
// 客商编号:SPLR_NUM 根据合同主表的收支方向判断,如果为“支出”,值为“ERP乙方公司编码”,反之为“ERP甲方公司编码”
|
// 客商编号:SPLR_NUM 根据合同主表的收支方向判断,如果为“支出”,值为“ERP乙方公司编码”,反之为“ERP甲方公司编码”
|
||||||
// 客商名称:SPLR_NAME 根据合同主表的收支方向判断,如果为“支出”,值为“ERP乙方公司名称”,反之为“ERP甲方公司名称”
|
// 客商名称:SPLR_NAME 根据合同主表的收支方向判断,如果为“支出”,值为“ERP乙方公司名称”,反之为“ERP甲方公司名称”
|
||||||
if (DictEnum.ERP_RCV_DLVY_EXPENSES.getCode().equals(contractMainDO.getDirection())) {
|
if (DictEnum.ERP_RCV_DLVY_EXPENSES.getCode().equals(contractMainDO.getDirection())) {
|
||||||
erpContractVO.setSupplierNumber(contractMainDO.getSalesCompanyNumber());
|
erpContractVO.setSupplierNumber(contractMainDO.getErpSalesCompanyNumber());
|
||||||
erpContractVO.setSupplierName(contractMainDO.getSalesCompanyName());
|
erpContractVO.setSupplierName(contractMainDO.getErpSalesCompanyName());
|
||||||
} else if (DictEnum.ERP_RCV_DLVY_INCOME.getCode().equals(contractMainDO.getDirection())) {
|
} else if (DictEnum.ERP_RCV_DLVY_INCOME.getCode().equals(contractMainDO.getDirection())) {
|
||||||
erpContractVO.setSupplierNumber(contractMainDO.getPurchaseCompanyNumber());
|
erpContractVO.setSupplierNumber(contractMainDO.getErpPurchaseCompanyNumber());
|
||||||
erpContractVO.setSupplierName(contractMainDO.getPurchaseCompanyName());
|
erpContractVO.setSupplierName(contractMainDO.getErpPurchaseCompanyName());
|
||||||
}
|
}
|
||||||
// 代理方:AGT
|
// 代理方:AGT
|
||||||
erpContractVO.setAgent(contractMainDO.getAgent());
|
erpContractVO.setAgent(contractMainDO.getAgent());
|
||||||
// 合同实施主体编号:CTRT_IMPL_NUM 根据合同主表的收支方向判断,如果为“支出”,值为“ERP甲方公司编码”,反之为“ERP乙方公司编码”
|
// 合同实施主体编号:CTRT_IMPL_NUM 根据合同主表的收支方向判断,如果为“支出”,值为“ERP甲方公司编码”,反之为“ERP乙方公司编码”
|
||||||
// 合同签订主体编号:CTRT_SGN_NUM 根据合同主表的收支方向判断,如果为“支出”,值为“ERP甲方公司名称”,反之为“ERP乙方公司名称”
|
// 合同签订主体编号:CTRT_SGN_NUM 根据合同主表的收支方向判断,如果为“支出”,值为“ERP甲方公司名称”,反之为“ERP乙方公司名称”
|
||||||
if (DictEnum.ERP_RCV_DLVY_EXPENSES.getCode().equals(contractMainDO.getDirection())) {
|
if (DictEnum.ERP_RCV_DLVY_EXPENSES.getCode().equals(contractMainDO.getDirection())) {
|
||||||
erpContractVO.setContractImplementNumber(contractMainDO.getPurchaseCompanyNumber());
|
erpContractVO.setContractImplementNumber(contractMainDO.getErpPurchaseCompanyNumber());
|
||||||
erpContractVO.setContractSignNumber(contractMainDO.getPurchaseCompanyName());
|
erpContractVO.setContractSignNumber(contractMainDO.getErpPurchaseCompanyName());
|
||||||
} else if (DictEnum.ERP_RCV_DLVY_INCOME.getCode().equals(contractMainDO.getDirection())) {
|
} else if (DictEnum.ERP_RCV_DLVY_INCOME.getCode().equals(contractMainDO.getDirection())) {
|
||||||
erpContractVO.setContractImplementNumber(contractMainDO.getSalesCompanyNumber());
|
erpContractVO.setContractImplementNumber(contractMainDO.getErpSalesCompanyNumber());
|
||||||
erpContractVO.setContractSignNumber(contractMainDO.getSalesCompanyName());
|
erpContractVO.setContractSignNumber(contractMainDO.getErpSalesCompanyName());
|
||||||
}
|
}
|
||||||
// 合同签订日期:SGN_DT
|
// 合同签订日期:SGN_DT
|
||||||
if (contractMainDO.getSignDate() != null) {
|
if (contractMainDO.getSignDate() != null) {
|
||||||
@@ -1171,6 +1342,16 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean relation(RelationReqVo reqVo) {
|
||||||
|
SystemRelativityDO saveDO = new SystemRelativityDO();
|
||||||
|
saveDO.setStatus(DictEnum.BSE_SYS_REL_TP_CONTRACT.getCode());
|
||||||
|
saveDO.setUpId(reqVo.getUpId());
|
||||||
|
saveDO.setDownId(reqVo.getDownId());
|
||||||
|
int insert = systemRelativityMapper.insert(saveDO);
|
||||||
|
return insert > 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验合同内容
|
* 校验合同内容
|
||||||
*
|
*
|
||||||
@@ -1393,4 +1574,24 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
}
|
}
|
||||||
return numPrefix + "-" + num;
|
return numPrefix + "-" + num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取合同ID集合
|
||||||
|
*
|
||||||
|
* @param contractName 合同名称
|
||||||
|
* @param contractPaperNumber 合同编号
|
||||||
|
* @return 合同ID集合
|
||||||
|
*/
|
||||||
|
private List<Long> getContractIds(String contractName, String contractPaperNumber) {
|
||||||
|
List<Long> contractIds = new ArrayList<>();
|
||||||
|
List<ContractMainDO> contractMainDOS = contractMainMapper.selectList(new LambdaQueryWrapperX<ContractMainDO>()
|
||||||
|
.likeIfPresent(ContractMainDO::getContractName, contractName)
|
||||||
|
.likeIfPresent(ContractMainDO::getContractPaperNumber, contractPaperNumber));
|
||||||
|
if (CollectionUtils.isNotEmpty(contractMainDOS)) {
|
||||||
|
contractIds = contractMainDOS.stream()
|
||||||
|
.map(contractMainDO -> contractMainDO.getId())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
return contractIds;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,12 @@
|
|||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-module-base-api</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 业务组件 -->
|
<!-- 业务组件 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.zt.plat</groupId>
|
<groupId>com.zt.plat</groupId>
|
||||||
|
|||||||
@@ -125,4 +125,12 @@ public class ErpCompanyController {
|
|||||||
return success(TEST);
|
return success(TEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/test2")
|
||||||
|
@Operation(summary = "获取base的账户条款")
|
||||||
|
@PreAuthorize("@ss.hasPermission('sply:erp-company:get')")
|
||||||
|
public CommonResult<String> test2() {
|
||||||
|
String TEST = erpCompanyService.test2();
|
||||||
|
return success(TEST);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -74,4 +74,6 @@ public interface ErpCompanyService {
|
|||||||
void test();
|
void test();
|
||||||
|
|
||||||
String test1();
|
String test1();
|
||||||
|
|
||||||
|
String test2();
|
||||||
}
|
}
|
||||||
@@ -7,6 +7,8 @@ import com.xxl.job.core.handler.annotation.XxlJob;
|
|||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.module.api.BaseApi;
|
||||||
|
import com.zt.plat.module.api.dto.AccountRespDto;
|
||||||
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpCompanyPageReqVO;
|
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpCompanyPageReqVO;
|
||||||
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpCompanyRespVO;
|
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpCompanyRespVO;
|
||||||
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpCompanySaveReqVO;
|
import com.zt.plat.module.erp.controller.admin.erp.vo.ErpCompanySaveReqVO;
|
||||||
@@ -57,6 +59,8 @@ public class ErpCompanyServiceImpl implements ErpCompanyService {
|
|||||||
private String erpAddress;
|
private String erpAddress;
|
||||||
@Value("${erp.sapsys}")
|
@Value("${erp.sapsys}")
|
||||||
private String sapsys;
|
private String sapsys;
|
||||||
|
@Resource
|
||||||
|
private BaseApi baseApi;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ErpCompanyRespVO createErpCompany(ErpCompanySaveReqVO createReqVO) {
|
public ErpCompanyRespVO createErpCompany(ErpCompanySaveReqVO createReqVO) {
|
||||||
@@ -289,4 +293,12 @@ public class ErpCompanyServiceImpl implements ErpCompanyService {
|
|||||||
return url + requestEntity;
|
return url + requestEntity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String test2() {
|
||||||
|
AccountRespDto respVO = new AccountRespDto();
|
||||||
|
respVO.setCustomerNumber("50000760");
|
||||||
|
List<AccountRespDto> dtos = baseApi.getNoPage(respVO);
|
||||||
|
return dtos.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user