|
|
@ -2,6 +2,7 @@ package com.yxt.anrui.base.biz.commoncontract; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import com.yxt.anrui.base.api.commonappendix.CommonAppendixVo; |
|
|
|
import com.yxt.anrui.base.api.commonappendix.CommonAttachTypeEnum; |
|
|
|
import com.yxt.anrui.base.api.commonappendix.PcCommonAppendixDto; |
|
|
|
import com.yxt.anrui.base.api.commoncontract.*; |
|
|
|
import com.yxt.anrui.base.biz.commonappendix.CommonAppendixService; |
|
|
@ -81,11 +82,17 @@ public class CommonContractRest implements CommonContractFeign { |
|
|
|
public ResultBean save(CommonContractDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
dto.setSid(UUID.randomUUID().toString()); |
|
|
|
CommonContract commonContract = new CommonContract(); |
|
|
|
String sid = commonContract.getSid(); |
|
|
|
BeanUtil.copyProperties(dto,commonContract); |
|
|
|
commonContract.setSid(sid); |
|
|
|
String s = ""; |
|
|
|
String attachType = ""; |
|
|
|
List<PcCommonAppendixDto> pcCommonAppendixDtoList = dto.getPcCommonAppendixDtoList(); |
|
|
|
attachType = CommonAttachTypeEnum.CONTRACT.getAttachType(); |
|
|
|
if (pcCommonAppendixDtoList.size() != 0) { |
|
|
|
for (PcCommonAppendixDto pcCommonAppendixDto : pcCommonAppendixDtoList) { |
|
|
|
commonAppendixService.saveOrUpdatePcAppendix(pcCommonAppendixDto, dto.getSid(), dto.getStaffSid()); |
|
|
|
commonAppendixService.saveOrUpdatePcAppendix(pcCommonAppendixDto, commonContract.getSid(), dto.getStaffSid(),attachType); |
|
|
|
fileUploadComponent.getUrlPrefix(); |
|
|
|
String filePath = pcCommonAppendixDto.getFilePath(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
@ -93,22 +100,37 @@ public class CommonContractRest implements CommonContractFeign { |
|
|
|
} |
|
|
|
s += filePath + ","; |
|
|
|
} |
|
|
|
dto.setAppdixUrl(s.substring(0, s.length() - 1)); |
|
|
|
commonContract.setAppdixUrl(s.substring(0, s.length() - 1)); |
|
|
|
} |
|
|
|
List<PcCommonAppendixDto> sceneSignUrlList = dto.getSceneSignUrlList(); |
|
|
|
attachType = CommonAttachTypeEnum.SCENESIGN.getAttachType(); |
|
|
|
if (sceneSignUrlList.size() != 0) { |
|
|
|
for (PcCommonAppendixDto pcCommonAppendixDto : sceneSignUrlList) { |
|
|
|
commonAppendixService.saveOrUpdatePcAppendix(pcCommonAppendixDto, commonContract.getSid(), dto.getStaffSid(),attachType); |
|
|
|
fileUploadComponent.getUrlPrefix(); |
|
|
|
String filePath = pcCommonAppendixDto.getFilePath(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
String sid = dto.getSid(); |
|
|
|
commonContractService.saveOrUpdateDto(dto); |
|
|
|
return rb.success().setData(sid); |
|
|
|
s += filePath + ","; |
|
|
|
} |
|
|
|
commonContract.setSceneSignUrl(s.substring(0, s.length() - 1)); |
|
|
|
} |
|
|
|
commonContractService.save(commonContract); |
|
|
|
return rb.success().setData(commonContract.getSid()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultBean update(CommonContractDto dto, String sid) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String s = ""; |
|
|
|
String attachType = ""; |
|
|
|
commonAppendixService.deleteFiles(sid); |
|
|
|
List<PcCommonAppendixDto> pcCommonAppendixDtoList = dto.getPcCommonAppendixDtoList(); |
|
|
|
attachType = CommonAttachTypeEnum.CONTRACT.getAttachType(); |
|
|
|
if (pcCommonAppendixDtoList != null) { |
|
|
|
for (PcCommonAppendixDto pcCommonAppendixDto : pcCommonAppendixDtoList) { |
|
|
|
commonAppendixService.saveOrUpdatePcAppendix(pcCommonAppendixDto, sid, dto.getStaffSid()); |
|
|
|
commonAppendixService.saveOrUpdatePcAppendix(pcCommonAppendixDto, sid, dto.getStaffSid(),attachType); |
|
|
|
fileUploadComponent.getUrlPrefix(); |
|
|
|
String filePath = pcCommonAppendixDto.getFilePath(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
@ -118,25 +140,27 @@ public class CommonContractRest implements CommonContractFeign { |
|
|
|
} |
|
|
|
dto.setAppdixUrl(s.substring(0, s.length() - 1)); |
|
|
|
} |
|
|
|
commonContractService.updateBySid(dto.toMap(), sid); |
|
|
|
return rb.success(); |
|
|
|
List<PcCommonAppendixDto> sceneSignUrlList = dto.getSceneSignUrlList(); |
|
|
|
attachType = CommonAttachTypeEnum.SCENESIGN.getAttachType(); |
|
|
|
if (sceneSignUrlList.size() != 0) { |
|
|
|
for (PcCommonAppendixDto pcCommonAppendixDto : sceneSignUrlList) { |
|
|
|
commonAppendixService.saveOrUpdatePcAppendix(pcCommonAppendixDto, dto.getSid(), dto.getStaffSid(),attachType); |
|
|
|
fileUploadComponent.getUrlPrefix(); |
|
|
|
String filePath = pcCommonAppendixDto.getFilePath(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultBean del(String ids) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
commonContractService.delByIds(ids); |
|
|
|
s += filePath + ","; |
|
|
|
} |
|
|
|
dto.setSceneSignUrl(s.substring(0, s.length() - 1)); |
|
|
|
} |
|
|
|
commonContractService.updateBySid(dto.toMap(), sid); |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultBean<CommonContractVo> fetchBySid(String sid) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
CommonContract commonContract = commonContractService.fetchBySid(sid); |
|
|
|
CommonContractVo commonContractVo = new CommonContractVo(); |
|
|
|
BeanUtil.copyProperties(commonContract, commonContractVo); |
|
|
|
return rb.success().setData(commonContractVo); |
|
|
|
return commonContractService.fetchAllBySid(sid); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|