|
@@ -8,7 +8,9 @@ import java.util.Map; |
|
@@ -8,7 +8,9 @@ import java.util.Map; |
|
8
|
import cn.hutool.core.convert.Convert;
|
8
|
import cn.hutool.core.convert.Convert;
|
|
9
|
import cn.hutool.core.util.ObjectUtil;
|
9
|
import cn.hutool.core.util.ObjectUtil;
|
|
10
|
import com.baomidou.mybatisplus.annotation.TableName;
|
10
|
import com.baomidou.mybatisplus.annotation.TableName;
|
|
|
|
11
|
+import com.ruoyi.common.businessworkflow.domain.TblBusinessWorkflow;
|
|
11
|
import com.ruoyi.common.businessworkflow.domain.bo.TblBusinessWorkflowBo;
|
12
|
import com.ruoyi.common.businessworkflow.domain.bo.TblBusinessWorkflowBo;
|
|
|
|
13
|
+import com.ruoyi.common.businessworkflow.domain.vo.TblBusinessWorkflowVo;
|
|
12
|
import com.ruoyi.common.businessworkflow.service.ITblBusinessWorkflowService;
|
14
|
import com.ruoyi.common.businessworkflow.service.ITblBusinessWorkflowService;
|
|
13
|
import com.ruoyi.compliancemanagement.domain.TblContract;
|
15
|
import com.ruoyi.compliancemanagement.domain.TblContract;
|
|
14
|
import com.ruoyi.compliancemanagement.model.TblContractModel;
|
16
|
import com.ruoyi.compliancemanagement.model.TblContractModel;
|
|
@@ -133,6 +135,7 @@ public class TblContractController extends BaseController { |
|
@@ -133,6 +135,7 @@ public class TblContractController extends BaseController { |
|
133
|
@Validated(AddGroup.class) @RequestBody TblContractBo bo) {
|
135
|
@Validated(AddGroup.class) @RequestBody TblContractBo bo) {
|
|
134
|
// Matter matter = new Matter();
|
136
|
// Matter matter = new Matter();
|
|
135
|
String procDefId = "Process_1721195856340:1:7aca8265-489a-11ef-a778-421c839c76ba";
|
137
|
String procDefId = "Process_1721195856340:1:7aca8265-489a-11ef-a778-421c839c76ba";
|
|
|
|
138
|
+ bo.setStatus("0");
|
|
136
|
iTblContractService.insertByBo(bo);
|
139
|
iTblContractService.insertByBo(bo);
|
|
137
|
Long id = bo.getId();
|
140
|
Long id = bo.getId();
|
|
138
|
//Long id = sLeaveService.create(studentLeave,matterKey);
|
141
|
//Long id = sLeaveService.create(studentLeave,matterKey);
|
|
@@ -144,7 +147,7 @@ public class TblContractController extends BaseController { |
|
@@ -144,7 +147,7 @@ public class TblContractController extends BaseController { |
|
144
|
// 合同名称
|
147
|
// 合同名称
|
|
145
|
variables.put("contractName",bo.getContractName());
|
148
|
variables.put("contractName",bo.getContractName());
|
|
146
|
// 合同类型
|
149
|
// 合同类型
|
|
147
|
- variables.put("contractType",Long.valueOf(bo.getContractType()));
|
150
|
+ variables.put("contractType",bo.getContractType());
|
|
148
|
// 合同金额
|
151
|
// 合同金额
|
|
149
|
variables.put("contractAmount", bo.getContractAmount());
|
152
|
variables.put("contractAmount", bo.getContractAmount());
|
|
150
|
// 生效日期
|
153
|
// 生效日期
|
|
@@ -215,17 +218,94 @@ public class TblContractController extends BaseController { |
|
@@ -215,17 +218,94 @@ public class TblContractController extends BaseController { |
|
215
|
/**
|
218
|
/**
|
|
216
|
* 修改【请填写功能名称】
|
219
|
* 修改【请填写功能名称】
|
|
217
|
*/
|
220
|
*/
|
|
|
|
221
|
+ @Transactional(rollbackFor = Exception.class)
|
|
218
|
@SaCheckPermission("system:contract:edit")
|
222
|
@SaCheckPermission("system:contract:edit")
|
|
219
|
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
|
223
|
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
|
|
220
|
@RepeatSubmit()
|
224
|
@RepeatSubmit()
|
|
221
|
@PutMapping()
|
225
|
@PutMapping()
|
|
222
|
- public R<Void> edit(@Validated(EditGroup.class) @RequestBody TblContractBo bo) {
|
|
|
|
223
|
- return toAjax(iTblContractService.updateByBo(bo));
|
226
|
+ public R<Void> edit(@RequestParam(value = "procDefId")String procDefId,@Validated(EditGroup.class) @RequestBody TblContractBo bo) {
|
|
|
|
227
|
+ bo.setStatus("0");
|
|
|
|
228
|
+ iTblContractService.updateByBo(bo);
|
|
|
|
229
|
+ Long id = bo.getId();
|
|
|
|
230
|
+ //Long id = sLeaveService.create(studentLeave,matterKey);
|
|
|
|
231
|
+ if (id > 0 || id != null){
|
|
|
|
232
|
+ Map<String, Object> variables = new HashMap<>();
|
|
|
|
233
|
+ // fromSource用来标识此事项是提交来源是客户端还是移动端
|
|
|
|
234
|
+ //合同编号
|
|
|
|
235
|
+ variables.put("contractno", bo.getContractno());
|
|
|
|
236
|
+ // 合同名称
|
|
|
|
237
|
+ variables.put("contractName",bo.getContractName());
|
|
|
|
238
|
+ // 合同类型
|
|
|
|
239
|
+ variables.put("contractType",bo.getContractType());
|
|
|
|
240
|
+ // 合同金额
|
|
|
|
241
|
+ variables.put("contractAmount", bo.getContractAmount());
|
|
|
|
242
|
+ // 生效日期
|
|
|
|
243
|
+ variables.put("effectiveDate", bo.getEffectiveDate());
|
|
|
|
244
|
+ // 到期日期
|
|
|
|
245
|
+ variables.put("expirationDate", bo.getExpirationDate());
|
|
|
|
246
|
+ // 甲方
|
|
|
|
247
|
+ variables.put("partyA", bo.getPartyA());
|
|
|
|
248
|
+ // 甲方链接地址
|
|
|
|
249
|
+ variables.put("partyAAddress", bo.getPartyAAddress());
|
|
|
|
250
|
+ // 乙方
|
|
|
|
251
|
+ variables.put("partyB", bo.getPartyB());
|
|
|
|
252
|
+ // 乙方链接地址
|
|
|
|
253
|
+ variables.put("partyBAddress", bo.getPartyBAddress());
|
|
|
|
254
|
+ // 付款方式
|
|
|
|
255
|
+ variables.put("paymentMethod", bo.getPaymentMethod());
|
|
|
|
256
|
+ // 签订日期
|
|
|
|
257
|
+ variables.put("signingDate", bo.getSigningDate());
|
|
|
|
258
|
+ // 标的物信息
|
|
|
|
259
|
+ variables.put("subjectInformation", bo.getSubjectInformation());
|
|
|
|
260
|
+ // 附件
|
|
|
|
261
|
+ variables.put("attachments", bo.getAttachments());
|
|
|
|
262
|
+ // 变更原因
|
|
|
|
263
|
+ variables.put("reasonChange", bo.getReasonChange());
|
|
|
|
264
|
+ // 变更内容
|
|
|
|
265
|
+ variables.put("reasonText", bo.getReasonText());
|
|
|
|
266
|
+ // 启动流程
|
|
|
|
267
|
+ ProcessInstance processInstance = iWfProcessService.startProcessByDefId(procDefId, variables);
|
|
|
|
268
|
+ if(null != processInstance){
|
|
|
|
269
|
+
|
|
|
|
270
|
+ // 获取流程状态
|
|
|
|
271
|
+ HistoricVariableInstance processStatusVariable = historyService.createHistoricVariableInstanceQuery()
|
|
|
|
272
|
+ .processInstanceId(processInstance.getProcessInstanceId())
|
|
|
|
273
|
+ .variableName(ProcessConstants.PROCESS_STATUS_KEY)
|
|
|
|
274
|
+ .singleResult();
|
|
|
|
275
|
+ String processStatus = null;
|
|
|
|
276
|
+ if (ObjectUtil.isNotNull(processStatusVariable)) {
|
|
|
|
277
|
+ processStatus = Convert.toStr(processStatusVariable.getValue());
|
|
|
|
278
|
+ }
|
|
|
|
279
|
+
|
|
|
|
280
|
+ HistoricProcessInstanceQuery historicProcessInstanceQuery = historyService.createHistoricProcessInstanceQuery()
|
|
|
|
281
|
+ .processDefinitionId(procDefId);
|
|
|
|
282
|
+ List<HistoricProcessInstance> historicProcessInstances = historicProcessInstanceQuery.list();
|
|
|
|
283
|
+ // 兼容旧流程
|
|
|
|
284
|
+ if (processStatus == null) {
|
|
|
|
285
|
+ processStatus = ObjectUtil.isNull(historicProcessInstances.get(0).getEndTime()) ? ProcessStatus.RUNNING.getStatus() : ProcessStatus.COMPLETED.getStatus();
|
|
|
|
286
|
+ }
|
|
|
|
287
|
+ TblBusinessWorkflow tblBusinessWorkflow = iTblBusinessWorkflowService.queryByOne(id);
|
|
|
|
288
|
+ TblBusinessWorkflowBo tblBusinessWorkflowBo = new TblBusinessWorkflowBo();
|
|
|
|
289
|
+ tblBusinessWorkflowBo.setBusinessId(id);
|
|
|
|
290
|
+ tblBusinessWorkflowBo.setId(tblBusinessWorkflow.getId());
|
|
|
|
291
|
+ tblBusinessWorkflowBo.setProcInsId(processInstance.getProcessInstanceId());
|
|
|
|
292
|
+ tblBusinessWorkflowBo.setProcDefId(procDefId);
|
|
|
|
293
|
+ tblBusinessWorkflowBo.setDeployId(processInstance.getDeploymentId());
|
|
|
|
294
|
+ tblBusinessWorkflowBo.setProcessStatus(processStatus);
|
|
|
|
295
|
+ TableName table = TblContract.class.getAnnotation(TableName.class);
|
|
|
|
296
|
+ tblBusinessWorkflowBo.setTableName(table.value());
|
|
|
|
297
|
+ iTblBusinessWorkflowService.updateByBo(tblBusinessWorkflowBo);
|
|
|
|
298
|
+// iTblContractService.updateProcInsIdById(processInstance.getProcessInstanceId(),id);
|
|
|
|
299
|
+ }
|
|
|
|
300
|
+ return R.ok("成功");
|
|
|
|
301
|
+ }else{
|
|
|
|
302
|
+ return R.fail("系统故障!");
|
|
|
|
303
|
+ }
|
|
224
|
}
|
304
|
}
|
|
225
|
|
305
|
|
|
226
|
@RepeatSubmit()
|
306
|
@RepeatSubmit()
|
|
227
|
@PostMapping("/updateSealByContractno")
|
307
|
@PostMapping("/updateSealByContractno")
|
|
228
|
- public R<Void> updateSealByContractno( @RequestBody TblContractBo bo) {
|
308
|
+ public R<Void> updateSealByContractno(@RequestBody TblContractBo bo) {
|
|
229
|
String contractno = bo.getContractno();
|
309
|
String contractno = bo.getContractno();
|
|
230
|
String sealContract = bo.getSealContract();
|
310
|
String sealContract = bo.getSealContract();
|
|
231
|
return toAjax(iTblContractService.updateSealByContractno(contractno,sealContract));
|
311
|
return toAjax(iTblContractService.updateSealByContractno(contractno,sealContract));
|