|
|
@@ -482,14 +482,15 @@ public class PayServiceImpl implements PayService {
|
|
|
|
|
|
@Override
|
|
|
public String startProcess(Map data) {
|
|
|
- Map formData = ydClient.queryData(YDParam.builder()
|
|
|
+ DDR_New ddr_new = ydClient.queryData(YDParam.builder()
|
|
|
.appType(appType)
|
|
|
.systemToken(systemToken)
|
|
|
- .formInstanceId(UtilMap.getString(data,"formInstanceId"))
|
|
|
+ .formInstanceId(UtilMap.getString(data, "formInstanceId"))
|
|
|
.build(),
|
|
|
- YDConf.FORM_QUERY.retrieve_id).getFormData();
|
|
|
-
|
|
|
- String originator = UtilMap.getString(formData, "originator");
|
|
|
+ YDConf.FORM_QUERY.retrieve_id_new);
|
|
|
+ Map formData = ddr_new.getFormData();
|
|
|
+ Map originator = ddr_new.getOriginator();
|
|
|
+ String userId = UtilMap.getString(originator, "userId");
|
|
|
|
|
|
List<Map<String, Object>> resultList = new ArrayList<>();
|
|
|
//附件
|
|
|
@@ -508,7 +509,7 @@ public class PayServiceImpl implements PayService {
|
|
|
String fileFullName = jsonObject.getString("name");
|
|
|
String url = ydClient.convertTemporaryUrl(downloadUrl, appType, systemToken);
|
|
|
|
|
|
- Map map = ddService.uploadFileFormUrlForOverflow(ddClient.getAccessToken(), "02145933103936490950", url, fileFullName, fileFullName.split("\\.")[1]);
|
|
|
+ Map map = ddService.uploadFileFormUrlForOverflow(ddClient.getAccessToken(), userId, url, fileFullName, fileFullName.split("\\.")[1]);
|
|
|
Map<String, Object> result = UtilMap.map("spaceId, fileName, fileSize, fileType, fileId", UtilMap.getString(map, "spaceId"), fileFullName,
|
|
|
UtilMap.getString(map, "size"), UtilMap.getString(map, "extension"), UtilMap.getString(map, "id"));
|
|
|
resultList.add(result);
|
|
|
@@ -517,8 +518,12 @@ public class PayServiceImpl implements PayService {
|
|
|
|
|
|
//合同编号生成方式
|
|
|
formValue.add(UtilMap.map("name, value","合同编号生成方式, 手动填写"));
|
|
|
+
|
|
|
+ key = UtilMap.getString(data, "sealType");
|
|
|
+ value = UtilMap.getString(formData, key);
|
|
|
//印章类型
|
|
|
- formValue.add(UtilMap.map("name, value","印章类型, 公章"));
|
|
|
+ formValue.add(UtilMap.map("name, value","印章类型, " + value));
|
|
|
+// formValue.add(UtilMap.map("name, value","印章类型, " + "公章"));
|
|
|
|
|
|
//合同编号
|
|
|
key = UtilMap.getString(data, "codeKey");
|
|
|
@@ -532,58 +537,79 @@ public class PayServiceImpl implements PayService {
|
|
|
|
|
|
//金额类型
|
|
|
key = UtilMap.getString(data, "amountType");
|
|
|
- value = UtilMap.getString(formData, key);
|
|
|
- formValue.add(UtilMap.map("name, value","金额类型, " + AMOUNT_TYPE.get(value)));
|
|
|
+ if ("/".equals(key)){
|
|
|
+ formValue.add(UtilMap.map("name, value","金额类型, 无金额"));
|
|
|
+ }else {
|
|
|
+ value = UtilMap.getString(formData, key);
|
|
|
+ formValue.add(UtilMap.map("name, value","金额类型, " + AMOUNT_TYPE.get(value)));
|
|
|
+ }
|
|
|
|
|
|
//合同总额(元)
|
|
|
key = UtilMap.getString(data, "totalAmount");
|
|
|
- value = UtilMap.getString(formData, key);
|
|
|
- formValue.add(UtilMap.map("name, value","合同总额(元), " + value));
|
|
|
-
|
|
|
- //固定合同期限类型
|
|
|
- formValue.add(UtilMap.map("name, value","合同期限类型, 固定期限"));
|
|
|
+ if ("/".equals(key)){
|
|
|
+ formValue.add(UtilMap.map("name, value","合同总额(元), 0"));
|
|
|
+ }else {
|
|
|
+ value = UtilMap.getString(formData, key);
|
|
|
+ formValue.add(UtilMap.map("name, value","合同总额(元), " + value));
|
|
|
+ }
|
|
|
|
|
|
//合同期限开始日期
|
|
|
key = UtilMap.getString(data, "startTime");
|
|
|
- value = UtilMap.getString(formData, key);
|
|
|
+
|
|
|
+ //固定合同期限类型
|
|
|
+ if ("/".equals(key)){
|
|
|
+ formValue.add(UtilMap.map("name, value","合同期限类型, 非固定期限"));
|
|
|
+ }else {
|
|
|
+ formValue.add(UtilMap.map("name, value","合同期限类型, 固定期限"));
|
|
|
+
|
|
|
+ value = UtilMap.getString(formData, key);
|
|
|
|
|
|
// List list = UtilMap.getList(formData, key);
|
|
|
- String startFormat = LocalDateTime.ofInstant(
|
|
|
+ String startFormat = LocalDateTime.ofInstant(
|
|
|
// Instant.ofEpochMilli(Long.parseLong(list.get(0).toString())),
|
|
|
- Instant.ofEpochMilli(Long.parseLong(value)),
|
|
|
- ZoneId.of("Asia/Shanghai")
|
|
|
- ).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
|
- formValue.add(UtilMap.map("name, value","合同期限开始日期, " + startFormat));
|
|
|
+ Instant.ofEpochMilli(Long.parseLong(value)),
|
|
|
+ ZoneId.of("Asia/Shanghai")
|
|
|
+ ).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
|
+ formValue.add(UtilMap.map("name, value","合同期限开始日期, " + startFormat));
|
|
|
|
|
|
- //合同期限结束日期
|
|
|
- key = UtilMap.getString(data, "endTime");
|
|
|
- value = UtilMap.getString(formData, key);
|
|
|
- String endFormat = LocalDateTime.ofInstant(
|
|
|
- Instant.ofEpochMilli(Long.parseLong(value)),
|
|
|
- ZoneId.of("Asia/Shanghai")
|
|
|
- ).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
|
- formValue.add(UtilMap.map("name, value","合同期限结束日期, " + endFormat));
|
|
|
+ //合同期限结束日期
|
|
|
+ key = UtilMap.getString(data, "endTime");
|
|
|
+ value = UtilMap.getString(formData, key);
|
|
|
+ String endFormat = LocalDateTime.ofInstant(
|
|
|
+ Instant.ofEpochMilli(Long.parseLong(value)),
|
|
|
+ ZoneId.of("Asia/Shanghai")
|
|
|
+ ).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
|
+ formValue.add(UtilMap.map("name, value","合同期限结束日期, " + endFormat));
|
|
|
+ }
|
|
|
|
|
|
+
|
|
|
+ //用印形式
|
|
|
+ key = UtilMap.getString(data, "useSeal");
|
|
|
+ value = UtilMap.getString(formData, key);
|
|
|
//签署方式
|
|
|
- formValue.add(UtilMap.map("name, value","签署方式, 电子签署"));
|
|
|
+ if("双方物理用印".equals(value)){
|
|
|
+ formValue.add(UtilMap.map("name, value","签署方式, 纸质签署"));
|
|
|
+ }else {
|
|
|
+ formValue.add(UtilMap.map("name, value","签署方式, 电子签署"));
|
|
|
+ }
|
|
|
|
|
|
|
|
|
if (data.containsKey("otherAttachment")){
|
|
|
//合同附件
|
|
|
key = UtilMap.getString(data, "otherAttachment");
|
|
|
value = UtilMap.getString(formData, key);
|
|
|
- resultList.clear();
|
|
|
|
|
|
//处理宜搭附件绑定至OA审批
|
|
|
jsonArray = JSONArray.parseArray(value);
|
|
|
if(ObjectUtil.isNotNull(jsonArray)&& jsonArray.size()>0){
|
|
|
+ resultList.clear();
|
|
|
jsonArray.forEach(e->{
|
|
|
JSONObject jsonObject = JSONObject.parseObject(e.toString());
|
|
|
String downloadUrl = jsonObject.getString("downloadUrl");
|
|
|
String fileFullName = jsonObject.getString("name");
|
|
|
String url = ydClient.convertTemporaryUrl(downloadUrl, appType, systemToken);
|
|
|
|
|
|
- Map map = ddService.uploadFileFormUrlForOverflow(ddClient.getAccessToken(), "02145933103936490950", url, fileFullName, fileFullName.split("\\.")[1]);
|
|
|
+ Map map = ddService.uploadFileFormUrlForOverflow(ddClient.getAccessToken(), userId, url, fileFullName, fileFullName.split("\\.")[1]);
|
|
|
Map<String, Object> result = UtilMap.map("spaceId, fileName, fileSize, fileType, fileId", UtilMap.getString(map, "spaceId"), fileFullName,
|
|
|
UtilMap.getString(map, "size"), UtilMap.getString(map, "extension"), UtilMap.getString(map, "id"));
|
|
|
resultList.add(result);
|
|
|
@@ -597,14 +623,18 @@ public class PayServiceImpl implements PayService {
|
|
|
List<Map> ourDetails = new ArrayList<>();
|
|
|
|
|
|
key = UtilMap.getString(data, "ourDetail");
|
|
|
- value = UtilMap.getString(formData, key);
|
|
|
+ String[] split = key.split(",");
|
|
|
+ for (int i = 0; i < split.length; i++) {
|
|
|
+ value = UtilMap.getString(formData, split[i]);
|
|
|
+
|
|
|
+ Map ourDetail = UtilMap.empty();
|
|
|
+ ourDetail.put("value", value);
|
|
|
+ ourDetail.put("name", "我方主体名称");
|
|
|
+ ourDetail.put("bizAlias","contract_mine_company_name");
|
|
|
|
|
|
- Map ourDetail = UtilMap.empty();
|
|
|
- ourDetail.put("value", value);
|
|
|
- ourDetail.put("name", "我方主体名称");
|
|
|
- ourDetail.put("bizAlias","contract_mine_company_name");
|
|
|
+ ourDetails.add(ourDetail);
|
|
|
+ }
|
|
|
|
|
|
- ourDetails.add(ourDetail);
|
|
|
// ourDetails.add(UtilMap.map("name, value", "我方负责人, 待补充"));
|
|
|
ourLastList.add(ourDetails);
|
|
|
formValue.add(UtilMap.map("name, value","我方信息",JSON.toJSONString(ourLastList)));
|
|
|
@@ -614,24 +644,28 @@ public class PayServiceImpl implements PayService {
|
|
|
List<Map> otherDetails = new ArrayList<>();
|
|
|
|
|
|
key = UtilMap.getString(data, "otherDetail");
|
|
|
- value = UtilMap.getString(formData, key);
|
|
|
+ split = key.split(",");
|
|
|
+ for (int i = 0; i < split.length; i++) {
|
|
|
|
|
|
- Map otherDetail = UtilMap.empty();
|
|
|
- otherDetail.put("value", value);
|
|
|
- otherDetail.put("name", "对方主体名称");
|
|
|
- otherDetail.put("bizAlias","contract_opposite_company_name");
|
|
|
+ value = UtilMap.getString(formData, split[i]);
|
|
|
|
|
|
- otherDetails.add(otherDetail);
|
|
|
+ Map otherDetail = UtilMap.empty();
|
|
|
+ otherDetail.put("value", value);
|
|
|
+ otherDetail.put("name", "对方主体名称");
|
|
|
+ otherDetail.put("bizAlias", "contract_opposite_company_name");
|
|
|
+
|
|
|
+ otherDetails.add(otherDetail);
|
|
|
+ }
|
|
|
// otherDetails.add(UtilMap.map("name, value", "对方负责人, 待补充"));
|
|
|
otherLastList.add(otherDetails);
|
|
|
formValue.add(UtilMap.map("name, value","对方信息",JSON.toJSONString(otherLastList)));
|
|
|
|
|
|
|
|
|
List<String> workingEmployeeIds = new ArrayList<>();
|
|
|
- workingEmployeeIds.add("02145933103936490950");
|
|
|
+ workingEmployeeIds.add(userId);
|
|
|
List<String> deptIdByUserId = getDeptIdByUserId(workingEmployeeIds);
|
|
|
|
|
|
- return ddClient_workflow.doProcessInstancesNew(ddClient.getAccessToken(), "02145933103936490950","PROC-CCD914BE-E89B-4E4B-B5D3-9569BF26AE22", formValue, deptIdByUserId.get(0));
|
|
|
+ return ddClient_workflow.doProcessInstancesNew(ddClient.getAccessToken(), userId,"PROC-CCD914BE-E89B-4E4B-B5D3-9569BF26AE22", formValue, deptIdByUserId.get(0));
|
|
|
}
|
|
|
|
|
|
|