Merge branch 'dev' into 'test'

国贸2.0系统推送合同回调:消息固定R_JG_MY_00应答,_interfaceType__固定传R_MY_JG_10

See merge request jygk/dsc-base!18
This commit is contained in:
孙承赐
2025-11-11 10:31:06 +00:00
37 changed files with 488 additions and 172 deletions

View File

@@ -105,3 +105,41 @@ justauth:
prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE:: prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟 timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟
erp:
address: hana-dev.yncic.com
sapsys: ZTDEV203
eplat:
share:
#ePlat共享服务请求地址前缀
urlPrex: http://10.1.7.110
#ePlat分配的clientId
clientId: ztjgj5gsJ2uU20900h9j
#ePlat分配的密钥
clientSecret: DC82AD38EA764719B6DC7D71AAB4856C
seata:
enabled: true
application-id: base-server
tx-service-group: dev_tx_group
enable-auto-data-source-proxy: true
data-source-proxy-mode: AT
registry:
type: file
config:
type: file
service:
vgroupMapping:
default_tx_group: default
dev_tx_group: default
test_tx_group: default
prod_tx_group: default
default:
grouplist: 172.16.46.63:30088
client:
tm:
defaultGlobalTransactionTimeout: 60000
undo:
logTable: undo_log
dataValidation: true
logSerialization: jackson

View File

@@ -95,3 +95,41 @@ zt:
access-log: # 访问日志的配置项 access-log: # 访问日志的配置项
enable: true enable: true
erp:
address: hana-dev.yncic.com
sapsys: ZTDEV203
eplat:
share:
#ePlat共享服务请求地址前缀
urlPrex: http://10.1.7.110
#ePlat分配的clientId
clientId: ztjgj5gsJ2uU20900h9j
#ePlat分配的密钥
clientSecret: DC82AD38EA764719B6DC7D71AAB4856C
seata:
enabled: true
application-id: base-server
tx-service-group: dev_tx_group
enable-auto-data-source-proxy: true
data-source-proxy-mode: AT
registry:
type: file
config:
type: file
service:
vgroupMapping:
default_tx_group: default
dev_tx_group: default
test_tx_group: default
prod_tx_group: default
default:
grouplist: 172.16.46.63:30088
client:
tm:
defaultGlobalTransactionTimeout: 60000
undo:
logTable: undo_log
dataValidation: true
logSerialization: jackson

View File

@@ -32,6 +32,8 @@ public interface ErrorCodeConstants {
ErrorCode FILE_UPLOAD_EER = new ErrorCode(1_027_000_523, "文件上传失败"); 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_ITM_BSN_NOT_EXISTS = new ErrorCode(1_027_000_524, "业务实例条款不存在");
ErrorCode TMPL_INSC_DAT_BSN_NOT_EXISTS = new ErrorCode(1_027_000_530, "业务实例字段不存在"); ErrorCode TMPL_INSC_DAT_BSN_NOT_EXISTS = new ErrorCode(1_027_000_530, "业务实例字段不存在");
ErrorCode TMPL_INSC_ITM_BSN_EXISTS = new ErrorCode(1_027_000_540, "业务实例条款已存在");
ErrorCode TMPL_INSC_DAT_BSN_EXISTS = new ErrorCode(1_027_000_541, "业务实例条款已存在");
//Illegal operation type //Illegal operation type
} }

View File

@@ -85,12 +85,7 @@ public class TmplInscBsnRelController implements BusinessControllerMarker {
@Parameter(name = "id", description = "编号", required = true, example = "1024") @Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-bsn-rel:query')") @PreAuthorize("@ss.hasPermission('base:tmpl-insc-bsn-rel:query')")
public CommonResult<TmplInscBsnRelRespVO> getTmplInscBsnRel(@RequestParam("id") Long id) { public CommonResult<TmplInscBsnRelRespVO> getTmplInscBsnRel(@RequestParam("id") Long id) {
TmplInscBsnRelDO tmplInscBsnRel = tmplInscBsnRelService.getTmplInscBsnRel(id); return success(tmplInscBsnRelService.getTmplInscBsnRel(id));
TmplInscBsnRelRespVO tmplInscBsnRelRespVO = BeanUtils.toBean(tmplInscBsnRel, TmplInscBsnRelRespVO.class);
if (tmplInscBsnRelRespVO != null) {
tmplInscBsnRelService.getTmplInscBsnRelDetails(tmplInscBsnRelRespVO);
}
return success(tmplInscBsnRelRespVO);
} }
@GetMapping("/page") @GetMapping("/page")
@@ -120,4 +115,19 @@ public class TmplInscBsnRelController implements BusinessControllerMarker {
BeanUtils.toBean(list, TmplInscBsnRelRespVO.class)); BeanUtils.toBean(list, TmplInscBsnRelRespVO.class));
} }
@GetMapping("/value-info")
@Operation(summary = "根据合Id和实例Id获取字段和条款")
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-bsn-rel:query')")
public CommonResult<Map<String, Object>> valueInfo(@RequestParam("cttId") @Valid @NotEmpty(message = "合同Id不能为空") String cttId, @RequestParam("inscId") @Valid @NotEmpty(message = "模版实例id不能为空") String inscId) {
return success(tmplInscBsnRelService.valueInfo(cttId, inscId));
}
@GetMapping("/bsn-info")
@Operation(summary = "根据合id和实例id获取中间表")
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-bsn-rel:query')")
public CommonResult<TmplInscBsnRelRespVO> bseInfo(@RequestParam("cttId") @Valid @NotEmpty(message = "合同Id不能为空") String cttId, @RequestParam("inscId") @Valid @NotEmpty(message = "模版实例id不能为空") String inscId) {
return success(tmplInscBsnRelService.bseInfo(cttId, inscId));
}
} }

View File

@@ -5,6 +5,8 @@ import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.module.base.controller.admin.templtp.onlyoffice.pojo.Action; import com.zt.plat.module.base.controller.admin.templtp.onlyoffice.pojo.Action;
import com.zt.plat.module.base.controller.admin.templtp.onlyoffice.pojo.History; import com.zt.plat.module.base.controller.admin.templtp.onlyoffice.pojo.History;
import com.zt.plat.module.base.controller.admin.templtp.onlyoffice.pojo.OnlyOfficeCallback; import com.zt.plat.module.base.controller.admin.templtp.onlyoffice.pojo.OnlyOfficeCallback;
import com.zt.plat.module.base.dal.dataobject.tmpltp.TmplInscBsnRelDO;
import com.zt.plat.module.base.dal.mysql.tmpltp.TmplInscBsnRelMapper;
import com.zt.plat.module.base.service.tmpltp.TemplateInstanceService; import com.zt.plat.module.base.service.tmpltp.TemplateInstanceService;
import com.zt.plat.module.infra.api.file.FileApi; 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.FileCreateReqDTO;
@@ -29,7 +31,7 @@ import static com.zt.plat.module.base.controller.admin.templtp.onlyoffice.util.U
public class OnlyOfficeCallbackServiceImpl implements OnlyOfficeCallbackService { public class OnlyOfficeCallbackServiceImpl implements OnlyOfficeCallbackService {
private final FileApi fileApi; private final FileApi fileApi;
private final TemplateInstanceService templateInstanceService; private final TemplateInstanceService templateInstanceService;
private final TmplInscBsnRelMapper tmplInscBsnRelMapper;
@Override @Override
public void processCallback(OnlyOfficeCallback callback, String id,String fileName) { public void processCallback(OnlyOfficeCallback callback, String id,String fileName) {
log.info("收到OnlyOffice文档回调: {}", callback.getKey()); log.info("收到OnlyOffice文档回调: {}", callback.getKey());
@@ -354,7 +356,10 @@ public class OnlyOfficeCallbackServiceImpl implements OnlyOfficeCallbackService
fileInfo.put("name", fileRespDTO.getName()); fileInfo.put("name", fileRespDTO.getName());
fileInfo.put("directory", fileRespDTO.getDirectory()); fileInfo.put("directory", fileRespDTO.getDirectory());
fileInfo.put("key", callback.getKey()); fileInfo.put("key", callback.getKey());
templateInstanceService.updateTemplateInstanceFileUrlByInstanceId(id, JSONObject.toJSONString(fileInfo)); TmplInscBsnRelDO createReqVO = new TmplInscBsnRelDO();
createReqVO.setId(Long.valueOf(id));
createReqVO.setCntt(JSONObject.toJSONString(fileInfo));
tmplInscBsnRelMapper.updateById(createReqVO);
} else { } else {
// 创建文件失败,处理错误 // 创建文件失败,处理错误
log.error("文件创建失败,错误信息:{}", result.getMsg()); log.error("文件创建失败,错误信息:{}", result.getMsg());

View File

@@ -8,7 +8,7 @@ import java.util.List;
@Schema(description = "管理后台 - 合同动态表单 响应 VO") @Schema(description = "管理后台 - 合同动态表单 响应 VO")
@Data @Data
public class FieldAndClauseRespVO { public class FieldAndClauseRespVO {
@Schema(description = "模板分类") @Schema(description = "模板字段")
List<TmplFldRespVO> tmplFldRespVOS; List<TmplFldRespVO> tmplFldRespVOS;
@Schema(description = "条款") @Schema(description = "条款")
List<TmplItmRespVO> tmplItmRespVOS; List<TmplItmRespVO> tmplItmRespVOS;

View File

@@ -42,18 +42,18 @@ public class TmplInscBsnRelRespVO {
private List<String> deptIds; private List<String> deptIds;
@Schema(description = "实例字段;这个是实例字段绑定的字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "") // @Schema(description = "实例字段;这个是实例字段绑定的字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
private List<TemplateInstanceDataRespVO> templateInstanceDataRespVOS; // private List<TemplateInstanceDataRespVO> templateInstanceDataRespVOS;
@Schema(description = "实例条款;这个是实例条款绑定的条款;", requiredMode = Schema.RequiredMode.REQUIRED, example = "") // @Schema(description = "实例条款;这个是实例条款绑定的条款;", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
private List<TemplateInstanceItemRespVO> instanceItemRespVOS; // private List<TemplateInstanceItemRespVO> instanceItemRespVOS;
@Schema(description = "使用部门编", requiredMode = Schema.RequiredMode.REQUIRED, example = "") @Schema(description = "使用部门编", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
private List<DeptRespDTO> DeptRespVOS; private List<DeptRespDTO> DeptRespVOS;
@Schema(description = "模版实例名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "测试分类名称") // @Schema(description = "模版实例名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "测试分类名称")
@ExcelProperty("模版实例名称") // @ExcelProperty("模版实例名称")
private String inscName; // private String inscName;
@Schema(description = "业务实例字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "") @Schema(description = "业务实例字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
@ExcelProperty("业务实例字段") @ExcelProperty("业务实例字段")

View File

@@ -53,7 +53,7 @@ public interface TmplInscBsnRelService {
* @param id 编号 * @param id 编号
* @return 模板实例与业务中间 * @return 模板实例与业务中间
*/ */
TmplInscBsnRelDO getTmplInscBsnRel(Long id); TmplInscBsnRelRespVO getTmplInscBsnRel(Long id);
/** /**
* 获得模板实例与业务中间分页 * 获得模板实例与业务中间分页
@@ -70,9 +70,22 @@ public interface TmplInscBsnRelService {
void getTmplInscBsnRelDetails(TmplInscBsnRelRespVO tmplInscBsnRelRespVO); void getTmplInscBsnRelDetails(TmplInscBsnRelRespVO tmplInscBsnRelRespVO);
/** /**
* 新cntt * 新cntt
* *
* @param bsnId ,params * @param bsnId ,params
*/ */
void updateCntt(Long bsnId,String params); void updateCntt(Long bsnId,String params);
/**
* 获取字段和条款
*
* @param cttId ,inscId
*/
Map<String,Object> valueInfo(String cttId,String inscId);
/**
* 获取中间表
*
* @param cttId ,inscId
*/
TmplInscBsnRelRespVO bseInfo(String cttId,String inscId);
} }

View File

@@ -23,10 +23,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import java.util.HashMap; import java.util.*;
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.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.module.infra.enums.ErrorCodeConstants.FILE_NOT_EXISTS; import static com.zt.plat.module.infra.enums.ErrorCodeConstants.FILE_NOT_EXISTS;
@@ -47,32 +44,37 @@ public class TmplInscBsnRelServiceImpl implements TmplInscBsnRelService {
private TmplInscBsnRelMapper tmplInscBsnRelMapper; private TmplInscBsnRelMapper tmplInscBsnRelMapper;
@Resource @Resource
private TemplateInstanceService templateInstanceService; private TemplateInstanceService templateInstanceService;
@Resource
private TmplInscDatBsnService tmplInscDatBsnService; private TmplInscDatBsnService tmplInscDatBsnService;
@Resource @Resource
private TmplInscItmBsnService tmplInscItmBsnService; private TmplInscItmBsnService tmplInscItmBsnService;
@Override @Override
@Transactional(rollbackFor = Exception.class)
public TmplInscBsnRelRespVO createTmplInscBsnRel(TmplInscBsnRelSaveReqVO createReqVO) { public TmplInscBsnRelRespVO createTmplInscBsnRel(TmplInscBsnRelSaveReqVO createReqVO) {
TemplateInstanceRespVO templateInstance = templateInstanceService.getTemplateInstance(createReqVO.getInscId()); // TemplateInstanceRespVO templateInstance = templateInstanceService.getTemplateInstance(createReqVO.getInscId());
if (templateInstance == null) { // if (templateInstance == null) {
throw exception(TEMPLATE_INSTANCE_NOT_EXISTS); // throw exception(TEMPLATE_INSTANCE_NOT_EXISTS);
} // }
String type = "cntt"; // String type = "cntt";
if (templateInstance.getCntt().isEmpty() && templateInstance.getOrigCntt().isEmpty()) { // if (templateInstance.getCntt().isEmpty() && templateInstance.getOrigCntt().isEmpty()) {
throw exception(TEMPLATE_INSTANCE_FILE_NOT_EXISTS); // throw exception(TEMPLATE_INSTANCE_FILE_NOT_EXISTS);
} // }
if (templateInstance.getCntt().isEmpty()) { // if (templateInstance.getCntt().isEmpty()) {
type = "origCntt"; // type = "origCntt";
} // }
//下载文件并且上传文件 // //下载文件并且上传文件
fileUpload(createReqVO, templateInstance, type); // fileUpload(createReqVO, templateInstance, type);
// 插入 // 插入
TmplInscBsnRelDO tmplInscBsnRel = BeanUtils.toBean(createReqVO, TmplInscBsnRelDO.class); TmplInscBsnRelDO tmplInscBsnRel = BeanUtils.toBean(createReqVO, TmplInscBsnRelDO.class);
// tmplInscBsnRel.setBsnId(Long.valueOf(createReqVO.getUuid()));
tmplInscBsnRelMapper.insert(tmplInscBsnRel); tmplInscBsnRelMapper.insert(tmplInscBsnRel);
// 返回 // 返回
return BeanUtils.toBean(tmplInscBsnRel, TmplInscBsnRelRespVO.class); return BeanUtils.toBean(tmplInscBsnRel, TmplInscBsnRelRespVO.class);
} }
@Override @Override
public void updateTmplInscBsnRel(TmplInscBsnRelSaveReqVO updateReqVO) { public void updateTmplInscBsnRel(TmplInscBsnRelSaveReqVO updateReqVO) {
// 校验存在 // 校验存在
@@ -83,7 +85,7 @@ public class TmplInscBsnRelServiceImpl implements TmplInscBsnRelService {
} }
@Override @Override
@Transactional @Transactional(rollbackFor = Exception.class)
public void deleteTmplInscBsnRel(Long id) { public void deleteTmplInscBsnRel(Long id) {
// 校验存在 // 校验存在
validateTmplInscBsnRelExists(id); validateTmplInscBsnRelExists(id);
@@ -92,11 +94,10 @@ public class TmplInscBsnRelServiceImpl implements TmplInscBsnRelService {
} }
@Override @Override
@Transactional @Transactional(rollbackFor = Exception.class)
public void deleteTmplInscBsnRelListByIds(List<Long> ids) { public void deleteTmplInscBsnRelListByIds(List<Long> ids) {
// 校验存在 // 校验存在
validateTmplInscBsnRelExists(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(), tmplInscDatBsnService);
//删除业务实例字段值 //删除业务实例字段值
@@ -118,8 +119,14 @@ public class TmplInscBsnRelServiceImpl implements TmplInscBsnRelService {
} }
@Override @Override
public TmplInscBsnRelDO getTmplInscBsnRel(Long id) { public TmplInscBsnRelRespVO getTmplInscBsnRel(Long id) {
return tmplInscBsnRelMapper.selectById(id); TmplInscBsnRelDO tmplInscBsnRelDO = tmplInscBsnRelMapper.selectById(id);
TmplInscBsnRelRespVO tmplInscBsnRelRespVO = BeanUtils.toBean(tmplInscBsnRelDO, TmplInscBsnRelRespVO.class);
if (tmplInscBsnRelRespVO != null){
getTmplInscBsnRelDetails(tmplInscBsnRelRespVO);
}
return tmplInscBsnRelRespVO;
} }
@Override @Override
@@ -130,8 +137,8 @@ public class TmplInscBsnRelServiceImpl implements TmplInscBsnRelService {
@Override @Override
public void getTmplInscBsnRelDetails(TmplInscBsnRelRespVO tmplInscBsnRelRespVO) { public void getTmplInscBsnRelDetails(TmplInscBsnRelRespVO tmplInscBsnRelRespVO) {
tmplInscBsnRelRespVO.setDeptIds(setDeptData(tmplInscBsnRelRespVO));//获取部门使用范围 tmplInscBsnRelRespVO.setDeptIds(setDeptData(tmplInscBsnRelRespVO));//获取部门使用范围
tmplInscBsnRelRespVO.setInstanceItemRespVOS(setInstanceItemRespVOS(tmplInscBsnRelRespVO));//获取条款; // tmplInscBsnRelRespVO.setInstanceItemRespVOS(setInstanceItemRespVOS(tmplInscBsnRelRespVO));//获取条款;
tmplInscBsnRelRespVO.setTemplateInstanceDataRespVOS(setTemplateInstanceDataRespVOS(tmplInscBsnRelRespVO)); // 实例字段 // tmplInscBsnRelRespVO.setTemplateInstanceDataRespVOS(setTemplateInstanceDataRespVOS(tmplInscBsnRelRespVO)); // 实例字段
//业务条款 //业务条款
tmplInscBsnRelRespVO.setTmplInscItmBsnRespVOS(setTmplInscItmBsnRespVOS(tmplInscBsnRelRespVO)); tmplInscBsnRelRespVO.setTmplInscItmBsnRespVOS(setTmplInscItmBsnRespVOS(tmplInscBsnRelRespVO));
//业务字段 //业务字段
@@ -140,9 +147,9 @@ public class TmplInscBsnRelServiceImpl implements TmplInscBsnRelService {
tmplInscBsnRelRespVO.setDeptRespVOS(deptApi.getDeptList(tmplInscBsnRelRespVO.getDeptIds().stream().map(Long::valueOf).toList()).getData()); // 部门详情 tmplInscBsnRelRespVO.setDeptRespVOS(deptApi.getDeptList(tmplInscBsnRelRespVO.getDeptIds().stream().map(Long::valueOf).toList()).getData()); // 部门详情
} }
TemplateInstanceRespVO templateInstance = SpringUtil.getBean(TemplateInstanceService.class).getTemplateInstance(tmplInscBsnRelRespVO.getInscId()); TemplateInstanceRespVO templateInstance = SpringUtil.getBean(TemplateInstanceService.class).getTemplateInstance(tmplInscBsnRelRespVO.getInscId());
if (templateInstance != null) { // if (templateInstance != null) {
tmplInscBsnRelRespVO.setInscName(!templateInstance.getName().isEmpty() ? templateInstance.getName() : "分类未命名"); // tmplInscBsnRelRespVO.setInscName(!templateInstance.getName().isEmpty() ? templateInstance.getName() : "分类未命名");
} // }
} }
@Override @Override
@@ -154,23 +161,24 @@ public class TmplInscBsnRelServiceImpl implements TmplInscBsnRelService {
throw exception(TEMPLATE_INSTANCE_FILE_NOT_EXISTS); throw exception(TEMPLATE_INSTANCE_FILE_NOT_EXISTS);
} }
TmplInscBsnRelDO tmplInscBsnRelDO = tmplInscBsnRelDOS.get(0); TmplInscBsnRelDO tmplInscBsnRelDO = tmplInscBsnRelDOS.get(0);
tmplInscBsnRelDO.setCntt( params); tmplInscBsnRelDO.setCntt(params);
tmplInscBsnRelMapper.updateById(tmplInscBsnRelDO); tmplInscBsnRelMapper.updateById(tmplInscBsnRelDO);
log.info("更新业务实例cntt字段值成功"); log.info("更新业务实例cntt字段值成功");
} }
//业务条款 //业务条款
private List<TmplInscItmBsnRespVO> setTmplInscItmBsnRespVOS(TmplInscBsnRelRespVO tmplInscBsnRelRespVO) { private List<TmplInscItmBsnRespVO> setTmplInscItmBsnRespVOS(TmplInscBsnRelRespVO tmplInscBsnRelRespVO) {
List<TmplInscItmBsnRespVO> tmplInscItmBsnRespVOS = BeanUtils.toBean(SpringUtil.getBean(TmplInscItmBsnMapper.class).selectList(new LambdaQueryWrapper<TmplInscItmBsnDO>() List<TmplInscItmBsnRespVO> tmplInscItmBsnRespVOS = BeanUtils.toBean(SpringUtil.getBean(TmplInscItmBsnMapper.class).selectList(new LambdaQueryWrapper<TmplInscItmBsnDO>()
.eq(TmplInscItmBsnDO::getBsnId, tmplInscBsnRelRespVO.getBsnId()) .eq(TmplInscItmBsnDO::getBsnId, tmplInscBsnRelRespVO.getBsnId())
), TmplInscItmBsnRespVO.class); ), TmplInscItmBsnRespVO.class);
tmplInscItmBsnRespVOS.forEach(tmplInscItmBsnRespVO -> { // tmplInscItmBsnRespVOS.forEach(tmplInscItmBsnRespVO -> {
tmplInscBsnRelRespVO.getInstanceItemRespVOS().forEach(instanceItemRespVO -> { // tmplInscBsnRelRespVO.getInstanceItemRespVOS().forEach(instanceItemRespVO -> {
if (tmplInscItmBsnRespVO.getInscItmId().equals(instanceItemRespVO.getId())) { // if (tmplInscItmBsnRespVO.getInscItmId().equals(instanceItemRespVO.getId())) {
tmplInscItmBsnRespVO.setItmName(instanceItemRespVO.getItmName()); // tmplInscItmBsnRespVO.setItmName(instanceItemRespVO.getItmName());
} // }
}); // });
}); // });
return tmplInscItmBsnRespVOS; return tmplInscItmBsnRespVOS;
} }
@@ -178,12 +186,12 @@ public class TmplInscBsnRelServiceImpl implements TmplInscBsnRelService {
private List<TmplInscDatBsnRespVO> setTmplInscDatBsnRespVOS(TmplInscBsnRelRespVO tmplInscBsnRelRespVO) { private List<TmplInscDatBsnRespVO> setTmplInscDatBsnRespVOS(TmplInscBsnRelRespVO tmplInscBsnRelRespVO) {
List<TmplInscDatBsnRespVO> tmplInscDatBsnRespVOS = BeanUtils.toBean(SpringUtil.getBean(TmplInscDatBsnMapper.class).selectList(new LambdaQueryWrapper<TmplInscDatBsnDO>()), TmplInscDatBsnRespVO.class); List<TmplInscDatBsnRespVO> tmplInscDatBsnRespVOS = BeanUtils.toBean(SpringUtil.getBean(TmplInscDatBsnMapper.class).selectList(new LambdaQueryWrapper<TmplInscDatBsnDO>()), TmplInscDatBsnRespVO.class);
tmplInscDatBsnRespVOS.forEach(tmplInscDatBsnRespVO -> tmplInscBsnRelRespVO.getTemplateInstanceDataRespVOS().forEach(templateInstanceDataRespVO -> { // tmplInscDatBsnRespVOS.forEach(tmplInscDatBsnRespVO -> tmplInscBsnRelRespVO.getTemplateInstanceDataRespVOS().forEach(templateInstanceDataRespVO -> {
if (templateInstanceDataRespVO.getId().toString().equals(tmplInscDatBsnRespVO.getInscFldId())) { // if (templateInstanceDataRespVO.getId().toString().equals(tmplInscDatBsnRespVO.getInscFldId())) {
// tmplInscDatBsnRespVO.setFldVal(templateInstanceDataRespVO.getFldKy()); // tmplInscDatBsnRespVO.setFldVal(templateInstanceDataRespVO.getFldKy());
tmplInscDatBsnRespVO.setFldKy(templateInstanceDataRespVO.getFldKy()); // tmplInscDatBsnRespVO.setFldKy(templateInstanceDataRespVO.getFldKy());
} // }
})); // }));
return tmplInscDatBsnRespVOS; return tmplInscDatBsnRespVOS;
} }
@@ -288,5 +296,69 @@ public class TmplInscBsnRelServiceImpl implements TmplInscBsnRelService {
} }
} }
@Override
public Map<String, Object> valueInfo(String cttId, String inscId) {
// 1、通过实例和合同Id获取业务
TmplInscBsnRelDO tmplInscBsnRelDO = tmplInscBsnRelMapper.selectOne(
TmplInscBsnRelDO::getBsnId, cttId,
TmplInscBsnRelDO::getInscId, inscId
);
if (tmplInscBsnRelDO == null) {
throw exception(TMPL_INSC_BSN_REL_NOT_EXISTS);
}
List<ValueInfo> valueInfoS = new ArrayList<>();
// 2、获取绑定的字段
List<TmplInscDatBsnRespVO> tmplInscDatBsnList = tmplInscDatBsnService
.getTmplInscDatBsnListByBsnId(String.valueOf(tmplInscBsnRelDO.getBsnId()));
Optional.ofNullable(tmplInscDatBsnList)
.ifPresent(list -> list.forEach(tmplInscDatBsnRespVO -> {
ValueInfo valueInfo = new ValueInfo(
tmplInscDatBsnRespVO.getId(),
tmplInscDatBsnRespVO.getFldKy(),
tmplInscDatBsnRespVO.getFldVal(),
"field",
tmplInscDatBsnRespVO.getInscFldId()
);
valueInfoS.add(valueInfo);
}));
// 3、获取条款
List<TmplInscItmBsnRespVO> tmplInscItmBsnList = tmplInscItmBsnService.getTmplInscItmBsnList(String.valueOf(tmplInscBsnRelDO.getBsnId()));
Optional.ofNullable(tmplInscItmBsnList)
.ifPresent(list -> list.forEach(tmplInscItmBsnRespVO -> {
ValueInfo valueInfo = new ValueInfo(
tmplInscItmBsnRespVO.getId(),
tmplInscItmBsnRespVO.getItmName(),
tmplInscItmBsnRespVO.getVal(),
"item",
tmplInscItmBsnRespVO.getItmId()
);
valueInfoS.add(valueInfo);
}));
return Map.of("data", valueInfoS, "id", tmplInscBsnRelDO.getId());
}
@Override
public TmplInscBsnRelRespVO bseInfo(String cttId, String inscId) {
TmplInscBsnRelDO tmplInscBsnRelDO = tmplInscBsnRelMapper.selectOne(
TmplInscBsnRelDO::getBsnId, cttId,
TmplInscBsnRelDO::getInscId, inscId
);
return BeanUtils.toBean(tmplInscBsnRelDO, TmplInscBsnRelRespVO.class);
}
private record ValueInfo(
String id,
String label,
String value,
String type,
String codeNumber
) {
}
} }

View File

@@ -69,5 +69,12 @@ public interface TmplInscDatBsnService {
* *
*/ */
void deleteTmplInscDatBsnListByBsnIds(@Valid @NotEmpty(message = "业务编号不能为空") List<String> ids); void deleteTmplInscDatBsnListByBsnIds(@Valid @NotEmpty(message = "业务编号不能为空") List<String> ids);
/**
* 通过业务id查询业务字段
*
* @param id 业务id
*
*/
List<TmplInscDatBsnRespVO> getTmplInscDatBsnListByBsnId(@Valid @NotEmpty(message = "业务编号不能为空") String id);
} }

View File

@@ -24,6 +24,7 @@ import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.e
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList; 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.framework.common.util.collection.CollectionUtils.diffList;
import static com.zt.plat.module.base.enums.ErrorCodeConstants.*; import static com.zt.plat.module.base.enums.ErrorCodeConstants.*;
import static com.zt.plat.module.tmpltp.enums.ErrorCodeConstants.TMPL_INSC_DAT_BSN_EXISTS;
import static com.zt.plat.module.tmpltp.enums.ErrorCodeConstants.TMPL_INSC_DAT_BSN_NOT_EXISTS; import static com.zt.plat.module.tmpltp.enums.ErrorCodeConstants.TMPL_INSC_DAT_BSN_NOT_EXISTS;
/** /**
@@ -40,12 +41,20 @@ public class TmplInscDatBsnServiceImpl implements TmplInscDatBsnService {
@Override @Override
public TmplInscDatBsnRespVO createTmplInscDatBsn(TmplInscDatBsnSaveReqVO createReqVO) { public TmplInscDatBsnRespVO createTmplInscDatBsn(TmplInscDatBsnSaveReqVO createReqVO) {
//判断存在
validateTmplInscDatBsnExistsByKey(createReqVO);
// 插入 // 插入
TmplInscDatBsnDO tmplInscDatBsn = BeanUtils.toBean(createReqVO, TmplInscDatBsnDO.class); TmplInscDatBsnDO tmplInscDatBsn = BeanUtils.toBean(createReqVO, TmplInscDatBsnDO.class);
tmplInscDatBsnMapper.insert(tmplInscDatBsn); tmplInscDatBsnMapper.insert(tmplInscDatBsn);
// 返回 // 返回
return BeanUtils.toBean(tmplInscDatBsn, TmplInscDatBsnRespVO.class); return BeanUtils.toBean(tmplInscDatBsn, TmplInscDatBsnRespVO.class);
} }
private void validateTmplInscDatBsnExistsByKey(TmplInscDatBsnSaveReqVO createReqVO) {
List<TmplInscDatBsnDO> tmplInscDatBsnDOS = tmplInscDatBsnMapper.selectList(TmplInscDatBsnDO::getInscFldId, createReqVO.getInscFldId());
if (!tmplInscDatBsnDOS.isEmpty()) {
throw exception(TMPL_INSC_DAT_BSN_EXISTS);
}
}
@Override @Override
public void updateTmplInscDatBsn(TmplInscDatBsnSaveReqVO updateReqVO) { public void updateTmplInscDatBsn(TmplInscDatBsnSaveReqVO updateReqVO) {
@@ -101,4 +110,10 @@ public class TmplInscDatBsnServiceImpl implements TmplInscDatBsnService {
tmplInscDatBsnMapper.update(new LambdaUpdateWrapper<TmplInscDatBsnDO>().in(TmplInscDatBsnDO::getBsnId, ids).set(TmplInscDatBsnDO::getDeleted, 1)); tmplInscDatBsnMapper.update(new LambdaUpdateWrapper<TmplInscDatBsnDO>().in(TmplInscDatBsnDO::getBsnId, ids).set(TmplInscDatBsnDO::getDeleted, 1));
} }
@Override
public List<TmplInscDatBsnRespVO> getTmplInscDatBsnListByBsnId(String id) {
List<TmplInscDatBsnDO> tmplInscDatBsnDOS = tmplInscDatBsnMapper.selectList(TmplInscDatBsnDO::getBsnId, id);
return BeanUtils.toBean(tmplInscDatBsnDOS, TmplInscDatBsnRespVO.class);
}
} }

View File

@@ -67,5 +67,12 @@ public interface TmplInscItmBsnService {
* @param ids 编号 * @param ids 编号
*/ */
void deleteTmplInscDatBsnListByBsnIds(@Valid @NotEmpty(message = "业务编号不能为空") List<String> ids); void deleteTmplInscDatBsnListByBsnIds(@Valid @NotEmpty(message = "业务编号不能为空") List<String> ids);
/**
* 获取条款值列表
*
* @param bsnId 业务编号
* @return TmplInscItmBsnRespVO
*/
List<TmplInscItmBsnRespVO> getTmplInscItmBsnList(@Valid @NotEmpty(message = "创建信息不能为空")String bsnId);
} }

View File

@@ -12,6 +12,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.*; import java.util.*;
import com.zt.plat.module.base.controller.admin.templtp.vo.*; 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.PageResult;
@@ -19,11 +20,11 @@ import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.util.object.BeanUtils; 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.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.convertList;
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList; 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.base.enums.ErrorCodeConstants.*;
import static com.zt.plat.module.tmpltp.enums.ErrorCodeConstants.TMPL_INSC_ITM_BSN_EXISTS;
import static com.zt.plat.module.tmpltp.enums.ErrorCodeConstants.TMPL_INSC_ITM_BSN_NOT_EXISTS; import static com.zt.plat.module.tmpltp.enums.ErrorCodeConstants.TMPL_INSC_ITM_BSN_NOT_EXISTS;
/** /**
@@ -40,6 +41,8 @@ public class TmplInscItmBsnServiceImpl implements TmplInscItmBsnService {
@Override @Override
public TmplInscItmBsnRespVO createTmplInscItmBsn(TmplInscItmBsnSaveReqVO createReqVO) { public TmplInscItmBsnRespVO createTmplInscItmBsn(TmplInscItmBsnSaveReqVO createReqVO) {
//校验存在
validateTmplInscItmBsnExistsByKey(createReqVO);
// 插入 // 插入
TmplInscItmBsnDO tmplInscItmBsn = BeanUtils.toBean(createReqVO, TmplInscItmBsnDO.class); TmplInscItmBsnDO tmplInscItmBsn = BeanUtils.toBean(createReqVO, TmplInscItmBsnDO.class);
tmplInscItmBsnMapper.insert(tmplInscItmBsn); tmplInscItmBsnMapper.insert(tmplInscItmBsn);
@@ -47,6 +50,13 @@ public class TmplInscItmBsnServiceImpl implements TmplInscItmBsnService {
return BeanUtils.toBean(tmplInscItmBsn, TmplInscItmBsnRespVO.class); return BeanUtils.toBean(tmplInscItmBsn, TmplInscItmBsnRespVO.class);
} }
void validateTmplInscItmBsnExistsByKey(TmplInscItmBsnSaveReqVO createReqVO) {
List<TmplInscItmBsnDO> tmplInscItmBsnDOS = tmplInscItmBsnMapper.selectList(TmplInscItmBsnDO::getBsnId, createReqVO.getBsnId(), TmplInscItmBsnDO::getInscItmId, createReqVO.getBsnId());
if (!tmplInscItmBsnDOS.isEmpty()){
throw exception(TMPL_INSC_ITM_BSN_EXISTS);
}
}
@Override @Override
public void updateTmplInscItmBsn(TmplInscItmBsnSaveReqVO updateReqVO) { public void updateTmplInscItmBsn(TmplInscItmBsnSaveReqVO updateReqVO) {
// 校验存在 // 校验存在
@@ -65,12 +75,12 @@ public class TmplInscItmBsnServiceImpl implements TmplInscItmBsnService {
} }
@Override @Override
public void deleteTmplInscItmBsnListByIds(List<Long> ids) { public void deleteTmplInscItmBsnListByIds(List<Long> ids) {
// 校验存在 // 校验存在
validateTmplInscItmBsnExists(ids); validateTmplInscItmBsnExists(ids);
// 删除 // 删除
tmplInscItmBsnMapper.deleteByIds(ids); tmplInscItmBsnMapper.deleteByIds(ids);
} }
private void validateTmplInscItmBsnExists(List<Long> ids) { private void validateTmplInscItmBsnExists(List<Long> ids) {
List<TmplInscItmBsnDO> list = tmplInscItmBsnMapper.selectByIds(ids); List<TmplInscItmBsnDO> list = tmplInscItmBsnMapper.selectByIds(ids);
@@ -101,4 +111,10 @@ public class TmplInscItmBsnServiceImpl implements TmplInscItmBsnService {
tmplInscItmBsnMapper.update(new LambdaUpdateWrapper<TmplInscItmBsnDO>().in(TmplInscItmBsnDO::getBsnId, ids).set(TmplInscItmBsnDO::getDeleted, 1)); tmplInscItmBsnMapper.update(new LambdaUpdateWrapper<TmplInscItmBsnDO>().in(TmplInscItmBsnDO::getBsnId, ids).set(TmplInscItmBsnDO::getDeleted, 1));
} }
@Override
public List<TmplInscItmBsnRespVO> getTmplInscItmBsnList(String bsnId) {
List<TmplInscItmBsnDO> tmplInscItmBsnDOS = tmplInscItmBsnMapper.selectList(TmplInscItmBsnDO::getBsnId, bsnId);
return BeanUtils.toBean(tmplInscItmBsnDOS, TmplInscItmBsnRespVO.class);
}
} }

View File

@@ -236,6 +236,12 @@ public class ContractRespDTO {
@Schema(description = "代理方名称") @Schema(description = "代理方名称")
private String agentName; private String agentName;
@Schema(description = "货权转移类型(字典ASY_MTNG_TP)")
private String meteringType;
@Schema(description = "模板中间表ID")
private Long businessId;
// 物料信息 // 物料信息
private List<DetailRespDTO> detail; private List<DetailRespDTO> detail;

View File

@@ -283,6 +283,11 @@ public class OrderDTO {
*/ */
@TableField("PYER_NUM") @TableField("PYER_NUM")
private String payerNum; private String payerNum;
/**
* 货权准转移类型
*/
private String meteringType;
/** /**
* 订单明细 * 订单明细

View File

@@ -198,6 +198,11 @@ public class PurchaseOrderWithDetailsDTO {
* 税码 * 税码
*/ */
private String taxNum; private String taxNum;
/**
* 货权准转移类型
*/
private String meteringType;
/** /**
* 采购订单明细 * 采购订单明细
*/ */

View File

@@ -1,8 +1,8 @@
package com.zt.plat.module.contractorder.api.vo.contract; package com.zt.plat.module.contractorder.api.vo.contract;
import com.zt.plat.module.base.controller.admin.templtp.vo.TemplateInstanceDataRespVO; import com.zt.plat.module.base.controller.admin.templtp.vo.TmplInscDatBsnRespVO;
import com.zt.plat.module.base.controller.admin.templtp.vo.TemplateInstanceItemRespVO; import com.zt.plat.module.base.controller.admin.templtp.vo.TmplInscItmBsnRespVO;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
@@ -242,14 +242,20 @@ public class ContractRespVO {
@Schema(description = "代理方名称") @Schema(description = "代理方名称")
private String agentName; private String agentName;
@Schema(description = "货权转移类型(字典ASY_MTNG_TP)")
private String meteringType;
@Schema(description = "模板中间表ID")
private Long businessId;
// 物料信息 // 物料信息
private List<DetailRespVO> detail; private List<DetailRespVO> detail;
// 合同动态表单 // 合同动态字段
private List<TemplateInstanceDataRespVO> dynamicsFields; private List<TmplInscDatBsnRespVO> dynamicsFields;
// 合同动态条款 // 合同动态条款
private List<TemplateInstanceItemRespVO> dynamicsItems; private List<TmplInscItmBsnRespVO> dynamicsItems;
// 价款结算条款 // 价款结算条款
private List<FormulaRespVO> formulas; private List<FormulaRespVO> formulas;

View File

@@ -1,7 +1,8 @@
package com.zt.plat.module.contractorder.api.vo.contract; package com.zt.plat.module.contractorder.api.vo.contract;
import cn.hutool.json.JSONArray; import cn.hutool.json.JSONArray;
import com.zt.plat.module.base.controller.admin.templtp.vo.TemplateInstanceDataSaveReqVO; import com.zt.plat.module.base.controller.admin.templtp.vo.TmplInscDatBsnSaveReqVO;
import com.zt.plat.module.base.controller.admin.templtp.vo.TmplInscItmBsnSaveReqVO;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
@@ -211,11 +212,20 @@ public class ContractSaveReqVO {
@Schema(description = "代理方名称") @Schema(description = "代理方名称")
private String agentName; private String agentName;
@Schema(description = "货权转移类型(字典ASY_MTNG_TP)")
private String meteringType;
@Schema(description = "模板中间表ID")
private Long businessId;
// 物料信息 // 物料信息
private List<DetailSaveReqVO> detail; private List<DetailSaveReqVO> detail;
// 合同动态表单 // 合同动态字段
private List<TemplateInstanceDataSaveReqVO> dynamicsFields; private List<TmplInscDatBsnSaveReqVO> dynamicsFields;
// 合同动态条款
private List<TmplInscItmBsnSaveReqVO> dynamicsItems;
// 价款结算条款 // 价款结算条款
private List<FormulaSaveReqVO> formulas; private List<FormulaSaveReqVO> formulas;

View File

@@ -10,9 +10,9 @@ public class RelationReqVo {
@Schema(description = "上游主键", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "上游主键", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "上游主键不能为空") @NotBlank(message = "上游主键不能为空")
private Long upId; private String upId;
@Schema(description = "下游主键", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "下游主键", requiredMode = Schema.RequiredMode.REQUIRED)
@NotBlank(message = "下游主键不能为空") @NotBlank(message = "下游主键不能为空")
private Long downId; private String downId;
} }

View File

@@ -39,10 +39,10 @@ public class IntContract {
private String contractType; // 合同类型 (货运;货代;仓储;保险) private String contractType; // 合同类型 (货运;货代;仓储;保险)
@Schema(description = "是否非标准合同文本") @Schema(description = "是否非标准合同文本")
private String textType; // 是否非标准合同文本 private String textType; // 是否非标准合同文本
@Schema(description = "合同有效期起 (格式: yyyyMMdd)") @Schema(description = "合同有效期起")
private String contractStartDate; // 合同有效期起 (格式: yyyyMMdd) private String contractStartDate; // 合同有效期起
@Schema(description = "合同有效期止 (格式: yyyyMMdd)") @Schema(description = "合同有效期止")
private String contractEndDate; // 合同有效期止 (格式: yyyyMMdd) private String contractEndDate; // 合同有效期止
@Schema(description = "是否固定单价 (0-浮动, 1-固定)") @Schema(description = "是否固定单价 (0-浮动, 1-固定)")
private String priceType; // 是否固定单价 (0-浮动, 1-固定) private String priceType; // 是否固定单价 (0-浮动, 1-固定)
@Schema(description = "合同币种") @Schema(description = "合同币种")
@@ -97,8 +97,8 @@ public class IntContract {
private String approvePassDate; // 拟签通过日期 private String approvePassDate; // 拟签通过日期
@Schema(description = "签约地 (40-签约必填)") @Schema(description = "签约地 (40-签约必填)")
private String signSite; // 签约地 (40-签约必填) private String signSite; // 签约地 (40-签约必填)
@Schema(description = "签约日期 (40-签约必填, 格式: yyyyMMdd)") @Schema(description = "签约日期 (40-签约必填)")
private String signDate; // 签约日期 (40-签约必填, 格式: yyyyMMdd) private String signDate; // 签约日期 (40-签约必填)
@Schema(description = "对方签约人 (40-签约必填)") @Schema(description = "对方签约人 (40-签约必填)")
private String signFirstPerson; // 对方签约人 (40-签约必填) private String signFirstPerson; // 对方签约人 (40-签约必填)
@Schema(description = "我方签约人工号 (40-签约必填)") @Schema(description = "我方签约人工号 (40-签约必填)")

View File

@@ -36,6 +36,7 @@ import com.zt.plat.module.erp.controller.admin.erp.vo.ErpContractSaveReqVO;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@@ -44,9 +45,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.time.LocalDate; import java.time.*;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -178,7 +177,7 @@ public class ContractApiImpl implements ContractApi {
SystemRelativityDO systemRelativityDO = systemRelativityMapper.selectOne("UP_ID", externalId); SystemRelativityDO systemRelativityDO = systemRelativityMapper.selectOne("UP_ID", externalId);
if ("I".equals(operateFlag)) { if ("I".equals(operateFlag)) {
if (systemRelativityDO != null && systemRelativityDO.getDownId() != null) { // 修改合同 if (systemRelativityDO != null && systemRelativityDO.getDownId() != null) { // 修改合同
contractId = systemRelativityDO.getDownId(); contractId = Long.parseLong(systemRelativityDO.getDownId());
contractMainDO.setId(contractId); contractMainDO.setId(contractId);
contractMainMapper.updateById(contractMainDO); contractMainMapper.updateById(contractMainDO);
} else { // 新增合同 } else { // 新增合同
@@ -187,15 +186,15 @@ public class ContractApiImpl implements ContractApi {
// 生成关联数据 // 生成关联数据
SystemRelativityDO saveRelation = new SystemRelativityDO(); SystemRelativityDO saveRelation = new SystemRelativityDO();
saveRelation.setUpId(Long.parseLong(externalId)); saveRelation.setUpId(externalId);
saveRelation.setDownId(contractId); saveRelation.setDownId(contractId.toString());
saveRelation.setWay(DictEnum.BSE_SYS_REL_WY_EXTERNAL.getCode()); saveRelation.setWay(DictEnum.BSE_SYS_REL_WY_EXTERNAL.getCode());
saveRelation.setStatus(DictEnum.BSE_SYS_REL_TP_CONTRACT.getCode()); saveRelation.setStatus(DictEnum.BSE_SYS_REL_TP_CONTRACT.getCode());
systemRelativityMapper.insert(saveRelation); systemRelativityMapper.insert(saveRelation);
} }
} else if ("D".equals(operateFlag)) { } else if ("D".equals(operateFlag)) {
if (systemRelativityDO == null || systemRelativityDO.getDownId() == null) throw exception(CONTRACT_NOT_EXISTS); if (systemRelativityDO == null || systemRelativityDO.getDownId() == null) throw exception(CONTRACT_NOT_EXISTS);
contractId = systemRelativityDO.getDownId(); contractId = Long.parseLong(systemRelativityDO.getDownId());
contractMainMapper.deleteById(contractId); contractMainMapper.deleteById(contractId);
// 删除动态条款信息 // 删除动态条款信息
contractOtherFormMapper.delete("CTRT_MAIN_ID", contractId.toString()); contractOtherFormMapper.delete("CTRT_MAIN_ID", contractId.toString());
@@ -378,17 +377,17 @@ public class ContractApiImpl implements ContractApi {
// 返回数据 // 返回数据
IntPushContractRespVO body = new IntPushContractRespVO(); IntPushContractRespVO body = new IntPushContractRespVO();
body.set__requestId_(pushReqVO.get__requestId_()); body.set__requestId_(pushReqVO.get__requestId_());
body.set__interfaceType__(pushReqVO.get__interfaceType__()); body.set__interfaceType__("R_MY_JG_10");
body.setBusiBillCode(pushReqVO.getBusiBillCode()); body.setBusiBillCode(pushReqVO.getBusiBillCode());
body.setCode(code); body.setCode(code);
body.setMessage(String.format("推送合同[%s]%s", pushReqVO.getData().getContractCode(), code >= 0 ? "成功" : "失败:" + msg)); body.setMessage(String.format("推送合同[%s]%s", pushReqVO.getBusiBillCode(), code >= 0 ? "成功" : "失败:" + msg));
body.setDatetime(DateTimeFormatter.ofPattern("yyyyMMddHHmmss").format(LocalDateTime.now())); body.setDatetime(DateTimeFormatter.ofPattern("yyyyMMddHHmmss").format(LocalDateTime.now()));
body.setSystem("JYGK"); body.setSystem("JYGK");
body.setOperateFlag(pushReqVO.getOperateFlag()); body.setOperateFlag(pushReqVO.getOperateFlag());
// 回调参数 // 回调参数
JSONObject req = new JSONObject(); JSONObject req = new JSONObject();
req.set("messageKey", pushReqVO.getBusiBillCode()); req.set("messageKey", "R_JG_MY_00");
req.set("messageBody", body); req.set("messageBody", body);
try { try {
log.info("国贸系统推送合同回调参数:{}",req); log.info("国贸系统推送合同回调参数:{}",req);
@@ -565,13 +564,21 @@ public class ContractApiImpl implements ContractApi {
// 是否虚拟合同 默认值:否(0) // 是否虚拟合同 默认值:否(0)
contractMainDO.setContractVirtual(DictEnum.ERP_CTRT_YN_NO.getCode()); contractMainDO.setContractVirtual(DictEnum.ERP_CTRT_YN_NO.getCode());
// 代理方 默认值:NULL // 代理方 默认值:NULL
// 签署日期 -> 签约日期 (40-签约必填, 格式: yyyyMMdd) // 签署日期 -> 签约日期 (40-签约必填)
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); if (StringUtils.isNotEmpty(reqVO.getSignDate())) {
contractMainDO.setSignDate(LocalDateTime.parse(reqVO.getSignDate()+"000000", formatter)); contractMainDO.setSignDate(Instant.ofEpochMilli(Long.parseLong(reqVO.getSignDate()))
// 开始日期 -> 合同有效期起 (格式: yyyyMMdd) .atZone(ZoneId.systemDefault()).toLocalDateTime());
contractMainDO.setStartDate(LocalDateTime.parse(reqVO.getContractStartDate()+"000000", formatter)); }
// 结束日期 -> 合同有效期止 (格式: yyyyMMdd) // 开始日期 -> 合同有效期
contractMainDO.setEndDate(LocalDateTime.parse(reqVO.getContractEndDate()+"000000", formatter)); if (StringUtils.isNotEmpty(reqVO.getContractStartDate())) {
contractMainDO.setStartDate(Instant.ofEpochMilli(Long.parseLong(reqVO.getContractStartDate()))
.atZone(ZoneId.systemDefault()).toLocalDateTime());
}
// 结束日期 -> 合同有效期止
if (StringUtils.isNotEmpty(reqVO.getContractEndDate())) {
contractMainDO.setEndDate(Instant.ofEpochMilli(Long.parseLong(reqVO.getContractEndDate()))
.atZone(ZoneId.systemDefault()).toLocalDateTime());
}
// 币种 -> 合同币种 // 币种 -> 合同币种
contractMainDO.setCurrency(reqVO.getCurrencyCode()); contractMainDO.setCurrency(reqVO.getCurrencyCode());
// 原币金额 -> 预估含税总金额 // 原币金额 -> 预估含税总金额

View File

@@ -7,9 +7,9 @@ import lombok.Data;
@Schema(description = "关联订单请求参数 VO") @Schema(description = "关联订单请求参数 VO")
public class LinkOrderReqVO { public class LinkOrderReqVO {
@Schema(description = "上游订单号") @Schema(description = "上游订单号")
private Long upOrderId; private String upOrderId;
@Schema(description = "下游订单号") @Schema(description = "下游订单号")
private Long downOrderId; private String downOrderId;
@Schema(description = "关联订单类型") @Schema(description = "关联订单类型")
private String linkOrderType; private String linkOrderType;
} }

View File

@@ -1,5 +1,6 @@
package com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo; package com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.*; import lombok.*;
import java.util.*; import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@@ -133,5 +134,8 @@ public class PurchaseOrderPageReqVO extends PageParam {
@Schema(description = "订单分类") @Schema(description = "订单分类")
private String splyBsnTp; private String splyBsnTp;
@Schema(description = "货权转移类型(字典ASY_MTNG_TP)")
private String meteringType;
} }

View File

@@ -196,4 +196,8 @@ public class PurchaseOrderRespVO {
@ExcelProperty(" 审批意见") @ExcelProperty(" 审批意见")
private String reviewOpinion; private String reviewOpinion;
@Schema(description = "货权转移类型(字典ASY_MTNG_TP)")
@ExcelProperty("货权转移类型(字典ASY_MTNG_TP)")
private String meteringType;
} }

View File

@@ -178,4 +178,21 @@ public class PurchaseOrderSaveReqVO {
@Schema(description = "订单分类(字典SPLY_BSN_TP)", example = "2") @Schema(description = "订单分类(字典SPLY_BSN_TP)", example = "2")
@ExcelProperty("订单分类") @ExcelProperty("订单分类")
private String splyBsnTp; private String splyBsnTp;
@Schema(description = "货权转移类型(字典ASY_MTNG_TP)")
@ExcelProperty("货权转移类型(字典ASY_MTNG_TP)")
private String meteringType;
@Schema(description = "产品组名")
@ExcelProperty("产品组名")
private String pdtGrpName;
@Schema(description = "产品组编码")
@ExcelProperty("产品组编码")
private String pdtGrpCdg;
@Schema(description = "付款方名称")
@ExcelProperty("付款方名称")
private String payerName;
@Schema(description = "付款方编码")
@ExcelProperty("付款方编码")
private String payerNum;
} }

View File

@@ -156,4 +156,7 @@ public class SalesOrderPageReqVO extends PageParam {
@ExcelProperty("产品组编码") @ExcelProperty("产品组编码")
private String pdtGrpCdg; private String pdtGrpCdg;
@Schema(description = "货权转移类型(字典ASY_MTNG_TP)")
private String meteringType;
} }

View File

@@ -220,5 +220,8 @@ public class SalesOrderRespVO {
@Schema(description = "付款方编码") @Schema(description = "付款方编码")
@ExcelProperty("付款方编码") @ExcelProperty("付款方编码")
private String payerNum; private String payerNum;
@Schema(description = "货权转移类型(字典ASY_MTNG_TP)")
@ExcelProperty("货权转移类型(字典ASY_MTNG_TP)")
private String meteringType;
} }

View File

@@ -198,4 +198,8 @@ public class SalesOrderSaveReqVO {
@Schema(description = "付款方编码") @Schema(description = "付款方编码")
@ExcelProperty("付款方编码") @ExcelProperty("付款方编码")
private String payerNum; private String payerNum;
@Schema(description = "货权转移类型(字典ASY_MTNG_TP)")
@ExcelProperty("货权转移类型(字典ASY_MTNG_TP)")
private String meteringType;
} }

View File

@@ -3,6 +3,7 @@ package com.zt.plat.module.contractorder.dal.dataobject.contract;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
import lombok.*; import lombok.*;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@@ -205,12 +206,12 @@ public class ContractMainDO extends BusinessBaseDO {
@TableField("RMK") @TableField("RMK")
private String remark; private String remark;
/** /**
* 施工类型编号;与ERP(HTLXBH)对应,拓展信息 * 施工类型编号(字典:ERP_CTRT_HTLXBH);与ERP(HTLXBH)对应,拓展信息
*/ */
@TableField("CON_TP_NUM") @TableField("CON_TP_NUM")
private String constructionTypeNumber; private String constructionTypeNumber;
/** /**
* 施工类型名称;与ERP(HTLXMC)对应,拓展信息 * 施工类型名称(字典:ERP_CTRT_HTLXBH);与ERP(HTLXMC)对应,拓展信息
*/ */
@TableField("CON_TP_NAME") @TableField("CON_TP_NAME")
private String constructionTypeName; private String constructionTypeName;
@@ -399,4 +400,14 @@ public class ContractMainDO extends BusinessBaseDO {
*/ */
@TableField("AGT_NAME") @TableField("AGT_NAME")
private String agentName; private String agentName;
/**
* 货权转移类型(字典ASY_MTNG_TP)
*/
@TableField("MTNG_TP")
private String meteringType;
/**
* 模板中间表ID
*/
@TableField("BSN_ID")
private Long businessId;
} }

View File

@@ -31,12 +31,12 @@ public class SystemRelativityDO extends BusinessBaseDO {
* 上游主键 * 上游主键
*/ */
@TableField("UP_ID") @TableField("UP_ID")
private Long upId; private String upId;
/** /**
* 下游主键 * 下游主键
*/ */
@TableField("DOWN_ID") @TableField("DOWN_ID")
private Long downId; private String downId;
/** /**
* 方式系统;内关联/系统外关联 * 方式系统;内关联/系统外关联
*/ */

View File

@@ -283,4 +283,10 @@ public class PurchaseOrderDO extends BusinessBaseDO {
*/ */
@TableField("TAX_RTE") @TableField("TAX_RTE")
private BigDecimal taxRte; private BigDecimal taxRte;
/**
* 货权准转移类型
*/
@TableField("MTRG_TP")
private String meteringType;
} }

View File

@@ -303,9 +303,8 @@ public class SalesOrderDO extends BusinessBaseDO {
*/ */
@TableField("PYER_NUM") @TableField("PYER_NUM")
private String payerNum; private String payerNum;
// /** /**
// * 税码 * 货权准转移类型
// */ */
// @TableField("TAX_NUM") private String meteringType;
// private String taxNum;
} }

View File

@@ -61,6 +61,7 @@ public interface PurchaseOrderMapper extends BaseMapperX<PurchaseOrderDO> {
.eqIfPresent(PurchaseOrderDO::getSplyBsnTp, reqVO.getSplyBsnTp() != null ? reqVO.getSplyBsnTp() : "PUR") .eqIfPresent(PurchaseOrderDO::getSplyBsnTp, reqVO.getSplyBsnTp() != null ? reqVO.getSplyBsnTp() : "PUR")
.eqIfPresent(PurchaseOrderDO::getCause, reqVO.getCause()) .eqIfPresent(PurchaseOrderDO::getCause, reqVO.getCause())
.eqIfPresent(PurchaseOrderDO::getStatus, reqVO.getStatus()) .eqIfPresent(PurchaseOrderDO::getStatus, reqVO.getStatus())
.eqIfPresent(PurchaseOrderDO::getMeteringType, reqVO.getMeteringType())
.likeIfPresent(PurchaseOrderDO::getPurchaseGroupName, reqVO.getPurchaseGroupName()) .likeIfPresent(PurchaseOrderDO::getPurchaseGroupName, reqVO.getPurchaseGroupName())
.orderByDesc(PurchaseOrderDO::getId)); .orderByDesc(PurchaseOrderDO::getId));
} }

View File

@@ -27,6 +27,7 @@ public interface SalesOrderMapper extends BaseMapperX<SalesOrderDO> {
.eqIfPresent(SalesOrderDO::getSupplierNumber, reqVO.getSupplierNumber()) .eqIfPresent(SalesOrderDO::getSupplierNumber, reqVO.getSupplierNumber())
.likeIfPresent(SalesOrderDO::getSupplierName, reqVO.getSupplierName()) .likeIfPresent(SalesOrderDO::getSupplierName, reqVO.getSupplierName())
.eqIfPresent(SalesOrderDO::getType, reqVO.getType()) .eqIfPresent(SalesOrderDO::getType, reqVO.getType())
.eqIfPresent(SalesOrderDO::getMeteringType, reqVO.getMeteringType())
.betweenIfPresent(SalesOrderDO::getVoucherDate, reqVO.getVoucherDate()) .betweenIfPresent(SalesOrderDO::getVoucherDate, reqVO.getVoucherDate())
.eqIfPresent(SalesOrderDO::getPurchaseOrganizationCustomsDeclaration, reqVO.getPurchaseOrganizationCustomsDeclaration()) .eqIfPresent(SalesOrderDO::getPurchaseOrganizationCustomsDeclaration, reqVO.getPurchaseOrganizationCustomsDeclaration())
.likeIfPresent(SalesOrderDO::getReceiveFactoryName, reqVO.getReceiveFactoryName()) .likeIfPresent(SalesOrderDO::getReceiveFactoryName, reqVO.getReceiveFactoryName())

View File

@@ -12,15 +12,18 @@ 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.framework.security.core.util.SecurityFrameworkUtils; import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
import com.zt.plat.framework.tenant.core.context.CompanyContextHolder; import com.zt.plat.framework.tenant.core.context.CompanyContextHolder;
import com.zt.plat.module.base.controller.admin.templtp.vo.TemplateInstanceDataRespVO; import com.zt.plat.module.base.controller.admin.templtp.vo.TmplInscBsnRelRespVO;
import com.zt.plat.module.base.controller.admin.templtp.vo.TemplateInstanceItemRespVO; import com.zt.plat.module.base.controller.admin.templtp.vo.TmplInscBsnRelSaveReqVO;
import com.zt.plat.module.base.dal.dataobject.tmpltp.TemplateInstanceDataDO; import com.zt.plat.module.base.controller.admin.templtp.vo.TmplInscDatBsnSaveReqVO;
import com.zt.plat.module.base.dal.dataobject.tmpltp.TemplateInstanceItemDO; import com.zt.plat.module.base.controller.admin.templtp.vo.TmplInscItmBsnSaveReqVO;
import com.zt.plat.module.base.dal.dataobject.tmpltp.TmplInscBsnRelDO; import com.zt.plat.module.base.dal.dataobject.tmpltp.TmplInscBsnRelDO;
import com.zt.plat.module.base.dal.mysql.tmpltp.TemplateInstanceDataMapper; import com.zt.plat.module.base.dal.mysql.tmpltp.TemplateInstanceDataMapper;
import com.zt.plat.module.base.dal.mysql.tmpltp.TemplateInstanceItemMapper; import com.zt.plat.module.base.dal.mysql.tmpltp.TemplateInstanceItemMapper;
import com.zt.plat.module.base.dal.mysql.tmpltp.TmplInscBsnRelMapper; import com.zt.plat.module.base.dal.mysql.tmpltp.TmplInscBsnRelMapper;
import com.zt.plat.module.base.service.tmpltp.TemplateInstanceDataService; import com.zt.plat.module.base.service.tmpltp.TemplateInstanceDataService;
import com.zt.plat.module.base.service.tmpltp.TmplInscBsnRelService;
import com.zt.plat.module.base.service.tmpltp.TmplInscDatBsnService;
import com.zt.plat.module.base.service.tmpltp.TmplInscItmBsnService;
import com.zt.plat.module.bpm.api.task.BpmProcessInstanceApi; import com.zt.plat.module.bpm.api.task.BpmProcessInstanceApi;
import com.zt.plat.module.bpm.api.task.BpmTaskApi; import com.zt.plat.module.bpm.api.task.BpmTaskApi;
import com.zt.plat.module.bpm.api.task.dto.*; import com.zt.plat.module.bpm.api.task.dto.*;
@@ -120,6 +123,12 @@ public class ContractServiceImpl implements ContractService {
private FileApi fileApi; private FileApi fileApi;
@Resource @Resource
private TmplInscBsnRelMapper tmplInscBsnRelMapper; private TmplInscBsnRelMapper tmplInscBsnRelMapper;
@Resource
private TmplInscBsnRelService tmplInscBsnRelService;
@Resource
private TmplInscDatBsnService tmplInscDatBsnService;
@Resource
private TmplInscItmBsnService tmplInscItmBsnService;
@Override @Override
public PageResult<ContractMainDO> getContractPage(ContractPageReqVO pageReqVO) { public PageResult<ContractMainDO> getContractPage(ContractPageReqVO pageReqVO) {
@@ -276,22 +285,31 @@ public class ContractServiceImpl implements ContractService {
}); });
} }
// 合同动态表单 // 合同动态表单及条款
List<TemplateInstanceDataDO> templateInstanceDataDOS = new ArrayList<>(); // 更新关联主表
if (reqVO.getDynamicsFields() != null && !reqVO.getDynamicsFields().isEmpty()) { TmplInscBsnRelSaveReqVO tmplInscBsnRelSaveReqVO = new TmplInscBsnRelSaveReqVO();
reqVO.getDynamicsFields().forEach(dynamicsField -> { tmplInscBsnRelSaveReqVO.setId(reqVO.getBusinessId());
TemplateInstanceDataDO templateInstanceDataDO = new TemplateInstanceDataDO(); tmplInscBsnRelSaveReqVO.setBsnId(contractId);
BeanUtils.copyProperties(dynamicsField, templateInstanceDataDO); tmplInscBsnRelService.updateTmplInscBsnRel(tmplInscBsnRelSaveReqVO);
templateInstanceDataDO.setInscId(reqVO.getInstanceId().toString()); // 保存动态字段
templateInstanceDataDOS.add(templateInstanceDataDO); List<TmplInscDatBsnSaveReqVO> dynamicsFields = reqVO.getDynamicsFields();
if (dynamicsFields != null && !dynamicsFields.isEmpty()) {
dynamicsFields.forEach(dynamicsField -> {
dynamicsField.setBsnId(reqVO.getBusinessId().toString());
tmplInscDatBsnService.createTmplInscDatBsn(dynamicsField);
}); });
} }
// 更新合同动态表单值 // 保存动态条款
if (!templateInstanceDataDOS.isEmpty()) { List<TmplInscItmBsnSaveReqVO> dynamicsItems = reqVO.getDynamicsItems();
templateInstanceDataService.setTemplateInstanceData(templateInstanceDataDOS); if (dynamicsItems != null && !dynamicsItems.isEmpty()) {
dynamicsItems.forEach(dynamicsItem -> {
dynamicsItem.setBsnId(reqVO.getBusinessId().toString());
tmplInscItmBsnService.createTmplInscItmBsn(dynamicsItem);
});
} }
return contractMainDO.getId();
return contractId;
} }
@Override @Override
@@ -372,19 +390,12 @@ public class ContractServiceImpl implements ContractService {
respVO.setNots(BeanUtils.toBean(notDOS, NotRespVO.class)); respVO.setNots(BeanUtils.toBean(notDOS, NotRespVO.class));
} }
// 查询并设置合同动态表单 // 查询合同动态字段及条款
List<TemplateInstanceDataDO> templateInstanceDataDOS = templateInstanceDataMapper TmplInscBsnRelRespVO tmplInscBsnRel = tmplInscBsnRelService.getTmplInscBsnRel(contractMainDO.getBusinessId());
.selectList(TableFieldConstants.BSE_TMPL_INSC_DAT_INSC_ID, contractMainDO.getInstanceId()); // 设置合同动态字段
if (templateInstanceDataDOS != null && !templateInstanceDataDOS.isEmpty()) { respVO.setDynamicsFields(tmplInscBsnRel.getTmplInscDatBsnRespVOS());
respVO.setDynamicsFields(BeanUtils.toBean(templateInstanceDataDOS, TemplateInstanceDataRespVO.class)); // 设置合同动态条款
} respVO.setDynamicsItems(tmplInscBsnRel.getTmplInscItmBsnRespVOS());
// 查询并设置合同动态条款
List<TemplateInstanceItemDO> templateInstanceItemDOS = templateInstanceItemMapper
.selectList(TableFieldConstants.BSE_TMPL_INSC_ITM_INSC_ID, contractMainDO.getInstanceId());
if (templateInstanceItemDOS != null && !templateInstanceItemDOS.isEmpty()) {
respVO.setDynamicsItems(BeanUtils.toBean(templateInstanceItemDOS, TemplateInstanceItemRespVO.class));
}
return respVO; return respVO;
} }
@@ -466,19 +477,12 @@ public class ContractServiceImpl implements ContractService {
respVO.setNots(BeanUtils.toBean(notDOS, NotRespVO.class)); respVO.setNots(BeanUtils.toBean(notDOS, NotRespVO.class));
} }
// 查询并设置合同动态表单 // 查询合同动态字段及条款
List<TemplateInstanceDataDO> templateInstanceDataDOS = templateInstanceDataMapper TmplInscBsnRelRespVO tmplInscBsnRel = tmplInscBsnRelService.getTmplInscBsnRel(contractMainDO.getBusinessId());
.selectList(TableFieldConstants.BSE_TMPL_INSC_DAT_INSC_ID, contractMainDO.getInstanceId()); // 设置合同动态字段
if (templateInstanceDataDOS != null && !templateInstanceDataDOS.isEmpty()) { respVO.setDynamicsFields(tmplInscBsnRel.getTmplInscDatBsnRespVOS());
respVO.setDynamicsFields(BeanUtils.toBean(templateInstanceDataDOS, TemplateInstanceDataRespVO.class)); // 设置合同动态条款
} respVO.setDynamicsItems(tmplInscBsnRel.getTmplInscItmBsnRespVOS());
// 查询并设置合同动态条款
List<TemplateInstanceItemDO> templateInstanceItemDOS = templateInstanceItemMapper
.selectList(TableFieldConstants.BSE_TMPL_INSC_ITM_INSC_ID, contractMainDO.getInstanceId());
if (templateInstanceItemDOS != null && !templateInstanceItemDOS.isEmpty()) {
respVO.setDynamicsItems(BeanUtils.toBean(templateInstanceItemDOS, TemplateInstanceItemRespVO.class));
}
return respVO; return respVO;
} }
@@ -501,7 +505,7 @@ public class ContractServiceImpl implements ContractService {
// 已关联的上游合同id集合 // 已关联的上游合同id集合
List<SystemRelativityDO> systemRelativityDOS = systemRelativityMapper.selectList(); List<SystemRelativityDO> systemRelativityDOS = systemRelativityMapper.selectList();
LinkedHashSet<Long> relationIds = new LinkedHashSet<>(); LinkedHashSet<String> relationIds = new LinkedHashSet<>();
if (systemRelativityDOS!= null && !systemRelativityDOS.isEmpty()) { if (systemRelativityDOS!= null && !systemRelativityDOS.isEmpty()) {
systemRelativityDOS.forEach(systemRelativityDO -> { systemRelativityDOS.forEach(systemRelativityDO -> {
relationIds.add(systemRelativityDO.getUpId()); relationIds.add(systemRelativityDO.getUpId());
@@ -569,7 +573,7 @@ public class ContractServiceImpl implements ContractService {
// 已关联的上游合同id集合 // 已关联的上游合同id集合
List<SystemRelativityDO> systemRelativityDOS = systemRelativityMapper.selectList(); List<SystemRelativityDO> systemRelativityDOS = systemRelativityMapper.selectList();
LinkedHashSet<Long> relationIds = new LinkedHashSet<>(); LinkedHashSet<String> relationIds = new LinkedHashSet<>();
if (systemRelativityDOS!= null && !systemRelativityDOS.isEmpty()) { if (systemRelativityDOS!= null && !systemRelativityDOS.isEmpty()) {
systemRelativityDOS.forEach(systemRelativityDO -> { systemRelativityDOS.forEach(systemRelativityDO -> {
relationIds.add(systemRelativityDO.getDownId()); relationIds.add(systemRelativityDO.getDownId());
@@ -634,7 +638,7 @@ public class ContractServiceImpl implements ContractService {
} }
// 上游合同ID // 上游合同ID
Long upId = systemRelativityDO.getUpId(); String upId = systemRelativityDO.getUpId();
// 获取上游合同信息 // 获取上游合同信息
ContractMainDO contractMainDO = contractMainMapper.selectById(upId); ContractMainDO contractMainDO = contractMainMapper.selectById(upId);
@@ -660,7 +664,7 @@ public class ContractServiceImpl implements ContractService {
} }
// 下游合同ID // 下游合同ID
Long upId = systemRelativityDO.getUpId(); String upId = systemRelativityDO.getUpId();
// 获取下游合同信息 // 获取下游合同信息
ContractMainDO contractMainDO = contractMainMapper.selectById(upId); ContractMainDO contractMainDO = contractMainMapper.selectById(upId);
@@ -900,19 +904,17 @@ public class ContractServiceImpl implements ContractService {
}); });
} }
// 合同动态表单 // 更新合同动态字段
List<TemplateInstanceDataDO> templateInstanceDataDOS = new ArrayList<>();
if (reqVO.getDynamicsFields() != null && !reqVO.getDynamicsFields().isEmpty()) { if (reqVO.getDynamicsFields() != null && !reqVO.getDynamicsFields().isEmpty()) {
reqVO.getDynamicsFields().forEach(dynamicsField -> { reqVO.getDynamicsFields().forEach(field -> {
TemplateInstanceDataDO templateInstanceDataDO = new TemplateInstanceDataDO(); tmplInscDatBsnService.updateTmplInscDatBsn(field);
BeanUtils.copyProperties(dynamicsField, templateInstanceDataDO);
templateInstanceDataDO.setInscId(reqVO.getInstanceId().toString());
templateInstanceDataDOS.add(templateInstanceDataDO);
}); });
} }
// 更新合同动态表单 // 更新合同动态表单
if (!templateInstanceDataDOS.isEmpty()) { if (reqVO.getDynamicsItems() != null && !reqVO.getDynamicsItems().isEmpty()) {
templateInstanceDataService.setTemplateInstanceData(templateInstanceDataDOS); reqVO.getDynamicsItems().forEach(item -> {
tmplInscItmBsnService.updateTmplInscItmBsn(item);
});
} }
// 合同状态更新 // 合同状态更新
@@ -1980,7 +1982,7 @@ public class ContractServiceImpl implements ContractService {
// 单据名称(拼音) // 单据名称(拼音)
String documentName = "XTHT"; String documentName = "XTHT";
// 公司编码 // 公司编码
String companyId = CompanyContextHolder.getCompanyId().toString(); String companyId = CompanyContextHolder.getCompanyId()!= null ? CompanyContextHolder.getCompanyId().toString() : "";
// 年月日 // 年月日
String yearMounth8Bit = LocalDate.now() String yearMounth8Bit = LocalDate.now()
.format(DateTimeFormatter.ofPattern(DateConstants.DATE_FORMAT_YEAR_MONTH_DAY_8_BIT)); .format(DateTimeFormatter.ofPattern(DateConstants.DATE_FORMAT_YEAR_MONTH_DAY_8_BIT));

View File

@@ -6,12 +6,13 @@ import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.zt.plat.framework.common.pojo.CommonResult; 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.security.core.util.SecurityFrameworkUtils;
import com.zt.plat.module.bpm.api.task.BpmProcessInstanceApi; import com.zt.plat.module.bpm.api.task.BpmProcessInstanceApi;
import com.zt.plat.module.bpm.api.task.BpmTaskApi; import com.zt.plat.module.bpm.api.task.BpmTaskApi;
import com.zt.plat.module.bpm.api.task.dto.*; import com.zt.plat.module.bpm.api.task.dto.*;
import com.zt.plat.module.bpm.enums.task.BpmProcessInstanceStatusEnum; import com.zt.plat.module.bpm.enums.task.BpmProcessInstanceStatusEnum;
import com.zt.plat.module.bpm.enums.task.BpmTaskStatusEnum;
import com.zt.plat.module.contractorder.api.vo.contract.ContractRespVO; import com.zt.plat.module.contractorder.api.vo.contract.ContractRespVO;
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.*; import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.*;
import com.zt.plat.module.contractorder.dal.dataobject.contract.SystemRelativityDO; import com.zt.plat.module.contractorder.dal.dataobject.contract.SystemRelativityDO;
@@ -30,22 +31,17 @@ import com.zt.plat.module.erp.service.erp.ErpOrderService;
import com.zt.plat.module.system.api.sequence.SequenceApi; import com.zt.plat.module.system.api.sequence.SequenceApi;
import com.zt.plat.module.system.api.user.AdminUserApi; import com.zt.plat.module.system.api.user.AdminUserApi;
import com.zt.plat.module.system.api.user.dto.AdminUserRespDTO; import com.zt.plat.module.system.api.user.dto.AdminUserRespDTO;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
import com.zt.plat.framework.common.pojo.PageResult;
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.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.module.contractorder.enums.ErrorCodeConstants.CONTRACT_ORDER_EXISTS; import static com.zt.plat.module.contractorder.enums.ErrorCodeConstants.CONTRACT_ORDER_EXISTS;
@@ -491,8 +487,8 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
SystemRelativityDO saveDO = new SystemRelativityDO(); SystemRelativityDO saveDO = new SystemRelativityDO();
saveDO.setStatus(DictEnum.BSE_SYS_REL_TP_ORDER.getCode()); saveDO.setStatus(DictEnum.BSE_SYS_REL_TP_ORDER.getCode());
saveDO.setUpId(LinkOrderReqVO.getUpOrderId()); saveDO.setUpId(LinkOrderReqVO.getUpOrderId().toString());
saveDO.setDownId(LinkOrderReqVO.getDownOrderId()); saveDO.setDownId(LinkOrderReqVO.getDownOrderId().toString());
//判断订单有没有关联过 //判断订单有没有关联过
if (systemRelativityMapper.selectCount(new LambdaQueryWrapper<SystemRelativityDO>().eq(SystemRelativityDO::getUpId, saveDO.getUpId()).eq(SystemRelativityDO::getDownId, saveDO.getDownId())) > 0) { if (systemRelativityMapper.selectCount(new LambdaQueryWrapper<SystemRelativityDO>().eq(SystemRelativityDO::getUpId, saveDO.getUpId()).eq(SystemRelativityDO::getDownId, saveDO.getDownId())) > 0) {
throw exception(CONTRACT_ORDER_EXISTS); throw exception(CONTRACT_ORDER_EXISTS);

View File

@@ -19,6 +19,7 @@
po.SPLR_NUM, po.SPLR_NUM,
po.SPLR_NAME, po.SPLR_NAME,
po.TP, po.TP,
po.MTRG_TP,
po.VCHR_DT, po.VCHR_DT,
po.PRCH_ORGZ_CD, po.PRCH_ORGZ_CD,
po.RCV_FACT_NAME, po.RCV_FACT_NAME,
@@ -143,6 +144,7 @@
po.PPR_CTRT_NUM, po.PPR_CTRT_NUM,
po.AGR_NUM, po.AGR_NUM,
po.RMK, po.RMK,
po.MTRG_TP,
po.UNT, po.UNT,
po.AGT_NUM, po.AGT_NUM,
po.AGT_NAME, po.AGT_NAME,
@@ -264,6 +266,7 @@
<result column="PPR_CTRT_NUM" property="paperContractNumber"/> <result column="PPR_CTRT_NUM" property="paperContractNumber"/>
<result column="AGR_NUM" property="agreementNumber"/> <result column="AGR_NUM" property="agreementNumber"/>
<result column="RMK" property="remark"/> <result column="RMK" property="remark"/>
<result column="MTRG_TP" property="meteringType"/>
<result column="AGT_NUM" property="agentNumber"/> <result column="AGT_NUM" property="agentNumber"/>
<result column="AGT_NAME" property="agentName"/> <result column="AGT_NAME" property="agentName"/>
<result column="CTRT_NUM" property="contractNumber"/> <result column="CTRT_NUM" property="contractNumber"/>