|
|
|
@@ -13,6 +13,7 @@ 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; |
|
|
|
@@ -86,6 +87,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
@Autowired |
|
|
|
private TaskService taskService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WxFlowService wxFlowService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public Map<String, Object> listAsPage(WxRentContract record, Integer pageIndex, Integer pageSize) { |
|
|
|
Object rentContractStatusInfo = getRentContractStatusInfo(record); |
|
|
|
@@ -132,7 +136,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
|
|
|
|
@Transactional(rollbackFor = {Exception.class}) |
|
|
|
@Override |
|
|
|
public ResultData save(WxRentContract record, Long userId) { |
|
|
|
public ResultData save(WxRentContract record,Long userId,String userName) { |
|
|
|
//保存租赁合同信息 |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
record.setId(idWorker.nextId()); |
|
|
|
@@ -185,6 +189,18 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
logger.error("保存租赁合同信息失败,e:" + e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); |
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
// 如果是补录,启动审批流 |
|
|
|
if(record.getMerchantId() != null && record.getFlowParams() != null){ |
|
|
|
record.getFlowParams().put("businessId",record.getId()); |
|
|
|
wxFlowService.start(record.getFlowParams(),userId,userName,record.getTenantId()); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("启动审批流失败,e:" + e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.FLOW_FAIL.getCode(), "FLOW FAILD " + e.getMessage()); |
|
|
|
} |
|
|
|
|
|
|
|
return new ResultData(Result.SUCCESS, "保存租赁合同信息成功", record); |
|
|
|
} |
|
|
|
|
|
|
|
|