Просмотр исходного кода

优化审批流&开发车辆显示

release_toaliyun_real
luozukai 7 лет назад
Родитель
Сommit
ca9f0f40b5
2 измененных файлов: 34 добавлений и 33 удалений
  1. +3
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java
  2. +31
    -30
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java

+ 3
- 3
mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java Просмотреть файл

@@ -71,7 +71,7 @@ public class WxFlowServiceImpl implements WxFlowService {
* @param flowType
* @return
*/
public String getFlowKeyByType(int flowType){
public static String getFlowKeyByType(int flowType){
if(1 == flowType){
return EnumFlowKey.CONTRACT.getCode();
}else if(2 == flowType){
@@ -93,7 +93,7 @@ public class WxFlowServiceImpl implements WxFlowService {
rent.setApplyStatus(applyStatus);
wxRentContractService.updateApplyStatus(rent);

// 1租赁2点位wx_rent_contract 3物业wx_property_contract
// 1租赁合同 2点位合同wx_rent_contract 3物业wx_property_contract 4点位物业合同
if(contractType == 3){
WxPropertyContract wxPropertyContract = new WxPropertyContract();
wxPropertyContract.setId(businessId);
@@ -275,7 +275,7 @@ public class WxFlowServiceImpl implements WxFlowService {
continue;
}
}
// 设置最后一个发起节点
if(CollectionUtils.isNotEmpty(resultList)){
for (WxFlowRecord wxFlowRecord:resultList) {
if(wxFlowRecord.getStatus() == 1){


+ 31
- 30
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java Просмотреть файл

@@ -21,6 +21,8 @@ import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.TaskService;
import org.flowable.task.api.Task;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -81,6 +83,9 @@ public class WxRentContractServiceImpl implements WxRentContractService {
@Autowired
RuntimeService runtimeService;

@Autowired
private TaskService taskService;

@Override
public Map<String, Object> listAsPage(WxRentContract record, Integer pageIndex, Integer pageSize) {
Object rentContractStatusInfo = getRentContractStatusInfo(record);
@@ -503,7 +508,6 @@ public class WxRentContractServiceImpl implements WxRentContractService {
public void download(HttpServletRequest request, HttpServletResponse response, String tenantId) {
String id = request.getParameter("id");
WxRentContract wxRentContract = wxRentContractMapper.selectByPrimaryKey(id);
logger.info("----------id:{},getFilename:{}",id,wxRentContract.getFilename());
String filesuffix = wxRentContract.getFilepath().substring(wxRentContract.getFilepath().lastIndexOf("."));
String filename = UUID.randomUUID() + filesuffix;
String filepath = Constant.fileDirectory;
@@ -623,38 +627,35 @@ public class WxRentContractServiceImpl implements WxRentContractService {
List<Long> collect = wxRentContractMapper.getRentInvalidList(wxRentContract).stream()
.map(r -> r.getId()).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(collect)) {
// 结束审批流 by luozukai
WxFlowRecord wxFlowRecord = new WxFlowRecord();
wxFlowRecord.setIds(collect);
List<WxFlowRecord> flowRecordList = wxFlowRecordService.findList(wxFlowRecord);
if (!CollectionUtils.isEmpty(flowRecordList)) {
for (WxFlowRecord flowRecord:flowRecordList) {
try {
runtimeService.deleteProcessInstance(flowRecord.getProcessInstanceId(), "合同作废");
// 修改合同审核状态
WxRentContract rentContract = new WxRentContract();
rentContract.setId(flowRecord.getBusinessId());
rentContract.setApplyStatus(EnumRentContractAppStatus.CANCLE.getCode());
updateApplyStatus(rentContract);

// 保存审批历史入
WxFlowRecord updateRecord = new WxFlowRecord();
updateRecord.setBusinessId(flowRecord.getBusinessId());
updateRecord.setTaskId(flowRecord.getTaskId());
updateRecord.setProcessInstanceId(flowRecord.getProcessInstanceId());
updateRecord.setRemark(flowRecord.getRemark());
updateRecord.setUserId(flowRecord.getUserId());
updateRecord.setStatus(EnumFlowRecordStatus.CANCLE.getCode());
updateRecord.setBusinessType(flowRecord.getBusinessType());
updateRecord.setUserName(flowRecord.getUserName());
updateRecord.setTaskKey(flowRecord.getTaskKey());
updateRecord.setTaskName(flowRecord.getTaskName());
wxFlowRecordService.saveOrUpdate(updateRecord);
}catch (Exception e){
logger.error("deleteProcessInstance error",e);
for (Long id:collect) {
try {
logger.info("合同id:{},开始停止...",id);
//结束审批流 by luozukai
List<Task> tasks = taskService.createTaskQuery().processDefinitionKey(WxFlowServiceImpl.getFlowKeyByType(1))
.processVariableValueEquals("businessId",id).list();
if (!CollectionUtils.isEmpty(tasks)) {
for (Task task:tasks) {
logger.info("合同id:{},taskid:{}",id,task.getId());
runtimeService.deleteProcessInstance(task.getProcessInstanceId(), "合同作废");
}
}
// 修改合同审核状态
WxRentContract rentContract = new WxRentContract();
rentContract.setId(id);
rentContract.setApplyStatus(EnumRentContractAppStatus.CANCLE.getCode());
updateApplyStatus(rentContract);

// 保存审批历史入
WxFlowRecord updateRecord = new WxFlowRecord();
updateRecord.setBusinessId(id);
updateRecord.setStatus(EnumFlowRecordStatus.CANCLE.getCode());
updateRecord.setBusinessType(1);
wxFlowRecordService.saveOrUpdate(updateRecord);
}catch (Exception e){
logger.error("deleteProcessInstance error",e);
}
}

}

//把状态为签约而商户未关联的数据改为待签约状态


Загрузка…
Отмена
Сохранить