|
|
|
@@ -12,6 +12,8 @@ import com.iformall.domain.po.*; |
|
|
|
import com.iformall.enums.*; |
|
|
|
import com.iformall.exception.MallinkException; |
|
|
|
import com.iformall.mapper.*; |
|
|
|
import com.iformall.service.WxFlowRecordService; |
|
|
|
import com.iformall.service.WxFlowService; |
|
|
|
import com.iformall.service.WxMerchantService; |
|
|
|
import com.iformall.service.WxRentContractService; |
|
|
|
import com.iformall.utils.Constant; |
|
|
|
@@ -19,12 +21,14 @@ import com.iformall.utils.DateUtils; |
|
|
|
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.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.util.Assert; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
@@ -73,6 +77,12 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
@Autowired |
|
|
|
WxBrandMapper WxBrandMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxFlowRecordService wxFlowRecordService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
RuntimeService runtimeService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public Map<String, Object> listAsPage(WxRentContract record, Integer pageIndex, Integer pageSize) { |
|
|
|
Object rentContractStatusInfo = getRentContractStatusInfo(record.getTenantId()); |
|
|
|
@@ -611,9 +621,39 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
//审核流程中止 |
|
|
|
List<Long> collect = wxRentContractMapper.getRentInvalidList(wxRentContract).stream() |
|
|
|
.map(r -> r.getId()).collect(Collectors.toList()); |
|
|
|
if (!collect.isEmpty()) { |
|
|
|
//中止 |
|
|
|
//todo:结束审批流 by luozukai |
|
|
|
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.REJECT.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); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//把状态为签约而商户未关联的数据改为待签约状态 |
|
|
|
|