|
@@ -54,7 +54,9 @@ import org.flowable.bpmn.model.FlowNode;
|
|
|
//import org.flowable.task.api.Task;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
@@ -66,6 +68,9 @@ import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
import java.util.stream.Collectors;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.core.env.Environment;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
|
|
|
/**
|
|
|
* @author: 王强
|
|
@@ -73,17 +78,15 @@ import java.util.stream.Collectors;
|
|
|
**/
|
|
|
@Service
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
+@Component
|
|
|
public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, CwProjectReport> {
|
|
|
|
|
|
- private static final String HTTPTOP = Global.getConfig("signature_http_top");
|
|
|
- private static final String COMPANYROUNDSEALID = Global.getConfig("company_round_seal_id");
|
|
|
- private static final String COMPANYROUNDSEALIDVERTICAL = Global.getConfig("company_round_seal_id_vertical");
|
|
|
- private static final String COMPANYPARTIESSEALID = Global.getConfig("company_parties_seal_id");
|
|
|
- private static final String APPROVALCATEGORYID = Global.getConfig("approval_category_id");
|
|
|
- private static final String APPROVALYCCATEGORYID = Global.getConfig("approval_YC_category_id");
|
|
|
- private static final String REPORTCATEGORYID = Global.getConfig("report_category_id");
|
|
|
- private static final String REPORTYCCATEGORYID = Global.getConfig("report_YC_category_id");
|
|
|
- private static final String JUDGEMENTCATEGORYID = Global.getConfig("judgement_category_id");
|
|
|
+ @Value("${signature_http_top}")
|
|
|
+ private static String HTTPTOP;
|
|
|
+ @Value("${approval_category_id}")
|
|
|
+ private static String APPROVALCATEGORYID;
|
|
|
+ @Autowired
|
|
|
+ private Environment environment;
|
|
|
|
|
|
@Resource
|
|
|
private CwProjectReportMapper reportMapper;
|
|
@@ -140,6 +143,17 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
@Resource
|
|
|
private CwProjectRecordsService cwProjectRecordsService;
|
|
|
|
|
|
+
|
|
|
+ public String getApprovalCategoryId() {
|
|
|
+ return environment.getProperty("approval_category_id");
|
|
|
+ // 使用myProperty的值
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getSignatureHttpTop() {
|
|
|
+ return environment.getProperty("signature_http_top");
|
|
|
+ // 使用myProperty的值
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 保存项目以及其他相关信息
|
|
|
* @param reportData
|
|
@@ -149,7 +163,7 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
public String saveForm(CwProjectReportData reportData) throws Exception{
|
|
|
if (StringUtils.isNotEmpty(reportData.getId())){
|
|
|
|
|
|
- CwProjectReport report = reportMapper.selectById(reportData.getId());
|
|
|
+ CwProjectReport report = reportMapper.getById(reportData.getId());
|
|
|
if (report != null){
|
|
|
reportData.setCreateBy(reportData.getCreateBy());
|
|
|
return update(reportData);
|
|
@@ -171,7 +185,7 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
BeanUtils.copyProperties(reportData, report);
|
|
|
report.setUpdateById(userDTO.getId());
|
|
|
report.setUpdateTime(new Date());
|
|
|
- reportMapper.updateById(report);
|
|
|
+ reportMapper.updateCwProjectReportDataById(report);
|
|
|
//修改新增行数据
|
|
|
CwProjectInfoData infoData = infoMapper.selectInfoByReportId(report.getId());
|
|
|
infoData.setServedUnitName(report.getServedUnitName());
|
|
@@ -182,7 +196,7 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
infoData.setServedUnitId(report.getServedUnitId());
|
|
|
infoData.setUpdateById(UserUtils.getCurrentUserDTO().getId());
|
|
|
infoData.setUpdateTime(new Date());
|
|
|
- infoMapper.updateById(infoData);
|
|
|
+ infoMapper.updateCwProjectInfoDataById(infoData);
|
|
|
|
|
|
//对上传的文件数据进行持久化操作
|
|
|
List<ProjectReportWorkAttachmentDTO> cwFileInfoList = report.getCwFileInfoList();
|
|
@@ -1930,8 +1944,8 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
}else{
|
|
|
path = "/attachment-file/";
|
|
|
}
|
|
|
- String aliyunUrl = Global.getAliyunUrl();
|
|
|
- String aliDownloadUrl = Global.getAliDownloadUrl();
|
|
|
+ String aliyunUrl = "http://cdn.gangwaninfo.com";
|
|
|
+ String aliDownloadUrl = "http://oss.gangwaninfo.com";
|
|
|
|
|
|
//获取文件生成的documentId
|
|
|
List<String> documentList = Lists.newArrayList();
|
|
@@ -2256,7 +2270,8 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
SignatureContract signatureContract = new SignatureContract();
|
|
|
signatureContract.setDocuments(documentList);
|
|
|
//审定单用印流程id
|
|
|
- signatureContract.setCategoryId(APPROVALCATEGORYID);
|
|
|
+ String approvalCategoryId = getApprovalCategoryId();
|
|
|
+ signatureContract.setCategoryId(approvalCategoryId);
|
|
|
signatureContract.setSend(true);
|
|
|
signatureContract.setSignatories(signatories);
|
|
|
signatureContract.setSn("");
|
|
@@ -2265,7 +2280,8 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
System.out.println(json.toString());
|
|
|
long s5=System.currentTimeMillis();
|
|
|
System.out.println(json.toString());
|
|
|
- String contractIdMapStr = SignaturePostUtil.sendPostApplicationJson(HTTPTOP + "/contract/createbycategory", json.toString());
|
|
|
+ String signatureHttpTop = getSignatureHttpTop();
|
|
|
+ String contractIdMapStr = SignaturePostUtil.sendPostApplicationJson(signatureHttpTop + "/contract/createbycategory", json.toString());
|
|
|
long s6=System.currentTimeMillis();
|
|
|
System.out.println("获取合同id获取时间:" + (s6 - s5));
|
|
|
hashMap = JSON.parseObject(contractIdMapStr, HashMap.class);
|
|
@@ -2274,7 +2290,7 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
}
|
|
|
|
|
|
public CwProjectReportData queryBySignatureId(String signatureId) {
|
|
|
- CwProjectReportSignature cwProjectReportSignature = cwProjectReportSignatureMapper.selectById(signatureId);
|
|
|
+ CwProjectReportSignature cwProjectReportSignature = cwProjectReportSignatureMapper.getInfoById(signatureId);
|
|
|
if (ObjectUtil.isNotEmpty(cwProjectReportSignature)){
|
|
|
if (StringUtils.isNotBlank(cwProjectReportSignature.getReportId())){
|
|
|
return this.queryById(cwProjectReportSignature.getReportId());
|
|
@@ -3062,4 +3078,10 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
}
|
|
|
return reportData;
|
|
|
}
|
|
|
+
|
|
|
+ public void updateCwProjectReportDataById(CwProjectReport report){
|
|
|
+ if(StringUtils.isNotBlank(report.getId())){
|
|
|
+ reportMapper.updateCwProjectReportDataById(report);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|