Merge branch 'refs/heads/dev' into test
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -19,7 +19,7 @@
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
<properties>
|
||||
<revision>3.0.41</revision>
|
||||
<revision>3.0.42</revision>
|
||||
<!-- Maven 相关 -->
|
||||
<java.version>17</java.version>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
|
||||
@@ -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.CompanyRelativityDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -27,4 +28,6 @@ public interface CompanyRelativityMapper extends BaseMapperX<CompanyRelativityDO
|
||||
}
|
||||
|
||||
List<CompanyRelaDeptDO> getPageByReq(CompanyRelativityPageReqVO pageReqVO);
|
||||
|
||||
void removeByIds(@Param("ids")List<Long> ids);
|
||||
}
|
||||
@@ -64,7 +64,7 @@ public class CompanyRelativityServiceImpl implements CompanyRelativityService {
|
||||
// 校验存在
|
||||
validateCompanyRelativityExists(ids);
|
||||
// 删除
|
||||
companyRelativityMapper.deleteByIds(ids);
|
||||
companyRelativityMapper.removeByIds(ids);
|
||||
}
|
||||
|
||||
private void validateCompanyRelativityExists(List<Long> ids) {
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
left join SPLY_ERP_CPN c on r.ERP_NUM = c.NUM
|
||||
where d.DELETED = 0
|
||||
and d.IS_COMPANY = 1
|
||||
and r.DELETED = 0
|
||||
<if test="name != null">
|
||||
and d.NAME = #{name}
|
||||
</if>
|
||||
@@ -44,4 +43,11 @@
|
||||
and d.DEPT_SOURCE = #{departmentSource}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<delete id="removeByIds">
|
||||
delete from SPLY_CPN_REL where ID in
|
||||
<foreach item="ids" collection="list" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -5,6 +5,9 @@ package com.zt.plat.module.contractorder.enums.contract;
|
||||
*/
|
||||
public enum DictEnum {
|
||||
|
||||
/** 业务关联类型 */
|
||||
BSE_SYS_REL_TP_ORDER("订单","ORDER",null),
|
||||
BSE_SYS_REL_TP_CONTRACT("合同","CONTRACT",null),
|
||||
/** 提交ERP合同状态 */
|
||||
SUBMIT_ERP_CTRT_STS_EF("正在执行","EF","其它所有状态"),
|
||||
SUBMIT_ERP_CTRT_STS_BFZT("部分暂停","BFZT",null),
|
||||
|
||||
@@ -100,28 +100,28 @@ public class ContractController implements BusinessControllerMarker {
|
||||
|
||||
// TODO
|
||||
@PostMapping("/download")
|
||||
@Operation(summary = "下载文件")
|
||||
@Operation(summary = "下载文件 TODO")
|
||||
@PreAuthorize("@ss.hasPermission('base:contract:download')")
|
||||
public void download() {
|
||||
}
|
||||
|
||||
// TODO
|
||||
@PostMapping("/preview")
|
||||
@Operation(summary = "预览文件")
|
||||
@Operation(summary = "预览文件 TODO")
|
||||
@PreAuthorize("@ss.hasPermission('base:contract:preview')")
|
||||
public void preview() {
|
||||
}
|
||||
|
||||
// TODO
|
||||
@PostMapping("/complete")
|
||||
@Operation(summary = "完结")
|
||||
@Operation(summary = "完结 TODO")
|
||||
@PreAuthorize("@ss.hasPermission('base:contract:complete')")
|
||||
public void complete() {
|
||||
}
|
||||
|
||||
// TODO
|
||||
@PostMapping("/archive")
|
||||
@Operation(summary = "归档")
|
||||
@Operation(summary = "归档 TODO")
|
||||
@PreAuthorize("@ss.hasPermission('base:contract:archive')")
|
||||
public void archive() {
|
||||
}
|
||||
@@ -135,7 +135,7 @@ public class ContractController implements BusinessControllerMarker {
|
||||
|
||||
// TODO
|
||||
@PostMapping("/approval")
|
||||
@Operation(summary = "合同审批")
|
||||
@Operation(summary = "合同审批 TODO")
|
||||
@PreAuthorize("@ss.hasPermission('base:contract:approval')")
|
||||
public CommonResult<String> approval(@Valid @RequestBody ApprovalReqVO reqVO) {
|
||||
return success(contractService.approval(reqVO));
|
||||
@@ -143,7 +143,7 @@ public class ContractController implements BusinessControllerMarker {
|
||||
|
||||
// TODO
|
||||
@PostMapping("/view/approval")
|
||||
@Operation(summary = "查看审批")
|
||||
@Operation(summary = "查看审批 TODO")
|
||||
@PreAuthorize("@ss.hasPermission('base:contract:approval')")
|
||||
public void viewApproval() {
|
||||
}
|
||||
@@ -157,29 +157,36 @@ public class ContractController implements BusinessControllerMarker {
|
||||
|
||||
@GetMapping("/list/up-not-relation")
|
||||
@Operation(summary = "获得上游未关联合同列表")
|
||||
@PreAuthorize("@ss.hasPermission('base:contract:get')")
|
||||
@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:get')")
|
||||
@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:get')")
|
||||
@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:get')")
|
||||
@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;
|
||||
|
||||
import cn.hutool.json.JSONArray;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.zt.plat.module.base.controller.admin.templtp.vo.TemplateInstanceDataSaveReqVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -34,7 +35,7 @@ public class ContractSaveReqVO {
|
||||
private String fileObject;
|
||||
|
||||
@Schema(description = "其它附件对象存储")
|
||||
private String fileObjectOther;
|
||||
private JSONArray fileObjectOther;
|
||||
|
||||
// 合同基本信息
|
||||
@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;
|
||||
}
|
||||
@@ -151,4 +151,12 @@ public interface ContractService {
|
||||
* @return 关联的下游合同数据
|
||||
*/
|
||||
ContractRespVO getDownRelation(Long id);
|
||||
|
||||
/**
|
||||
* 关联合同
|
||||
*
|
||||
* @param reqVo 上下游合同ID
|
||||
* @return 关联结果
|
||||
*/
|
||||
Boolean relation(RelationReqVo reqVo);
|
||||
}
|
||||
|
||||
@@ -1050,26 +1050,6 @@ public class ContractServiceImpl implements ContractService {
|
||||
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
|
||||
public List<NotRespVO> getNots(NotsQueryReqVO queryReqVO) {
|
||||
// 查合同ID集合
|
||||
@@ -1252,22 +1232,22 @@ public class ContractServiceImpl implements ContractService {
|
||||
// 客商编号:SPLR_NUM 根据合同主表的收支方向判断,如果为“支出”,值为“ERP乙方公司编码”,反之为“ERP甲方公司编码”
|
||||
// 客商名称:SPLR_NAME 根据合同主表的收支方向判断,如果为“支出”,值为“ERP乙方公司名称”,反之为“ERP甲方公司名称”
|
||||
if (DictEnum.ERP_RCV_DLVY_EXPENSES.getCode().equals(contractMainDO.getDirection())) {
|
||||
erpContractVO.setSupplierNumber(contractMainDO.getSalesCompanyNumber());
|
||||
erpContractVO.setSupplierName(contractMainDO.getSalesCompanyName());
|
||||
erpContractVO.setSupplierNumber(contractMainDO.getErpSalesCompanyNumber());
|
||||
erpContractVO.setSupplierName(contractMainDO.getErpSalesCompanyName());
|
||||
} else if (DictEnum.ERP_RCV_DLVY_INCOME.getCode().equals(contractMainDO.getDirection())) {
|
||||
erpContractVO.setSupplierNumber(contractMainDO.getPurchaseCompanyNumber());
|
||||
erpContractVO.setSupplierName(contractMainDO.getPurchaseCompanyName());
|
||||
erpContractVO.setSupplierNumber(contractMainDO.getErpPurchaseCompanyNumber());
|
||||
erpContractVO.setSupplierName(contractMainDO.getErpPurchaseCompanyName());
|
||||
}
|
||||
// 代理方:AGT
|
||||
erpContractVO.setAgent(contractMainDO.getAgent());
|
||||
// 合同实施主体编号:CTRT_IMPL_NUM 根据合同主表的收支方向判断,如果为“支出”,值为“ERP甲方公司编码”,反之为“ERP乙方公司编码”
|
||||
// 合同签订主体编号:CTRT_SGN_NUM 根据合同主表的收支方向判断,如果为“支出”,值为“ERP甲方公司名称”,反之为“ERP乙方公司名称”
|
||||
if (DictEnum.ERP_RCV_DLVY_EXPENSES.getCode().equals(contractMainDO.getDirection())) {
|
||||
erpContractVO.setContractImplementNumber(contractMainDO.getPurchaseCompanyNumber());
|
||||
erpContractVO.setContractSignNumber(contractMainDO.getPurchaseCompanyName());
|
||||
erpContractVO.setContractImplementNumber(contractMainDO.getErpPurchaseCompanyNumber());
|
||||
erpContractVO.setContractSignNumber(contractMainDO.getErpPurchaseCompanyName());
|
||||
} else if (DictEnum.ERP_RCV_DLVY_INCOME.getCode().equals(contractMainDO.getDirection())) {
|
||||
erpContractVO.setContractImplementNumber(contractMainDO.getSalesCompanyNumber());
|
||||
erpContractVO.setContractSignNumber(contractMainDO.getSalesCompanyName());
|
||||
erpContractVO.setContractImplementNumber(contractMainDO.getErpSalesCompanyNumber());
|
||||
erpContractVO.setContractSignNumber(contractMainDO.getErpSalesCompanyName());
|
||||
}
|
||||
// 合同签订日期:SGN_DT
|
||||
if (contractMainDO.getSignDate() != null) {
|
||||
@@ -1362,6 +1342,16 @@ public class ContractServiceImpl implements ContractService {
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验合同内容
|
||||
*
|
||||
@@ -1584,4 +1574,24 @@ public class ContractServiceImpl implements ContractService {
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user