|
|
|
@@ -10,6 +10,7 @@ import com.iformall.domain.po.*; |
|
|
|
import com.iformall.enums.*; |
|
|
|
import com.iformall.exception.MallinkException; |
|
|
|
import com.iformall.mapper.*; |
|
|
|
import com.iformall.service.WxFlowService; |
|
|
|
import com.iformall.service.WxPropertyContractService; |
|
|
|
import com.iformall.utils.Constant; |
|
|
|
import org.slf4j.Logger; |
|
|
|
@@ -50,6 +51,9 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService |
|
|
|
@Autowired |
|
|
|
WxRentContractMapper wxRentContractMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxFlowService wxFlowService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public Map<String, Object> listAsPage(WxPropertyContract record, Integer pageIndex, Integer pageSize) { |
|
|
|
Object rentContractStatusInfo = getRentContractStatusInfo(record); |
|
|
|
@@ -96,7 +100,8 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData saveOrUpdate(WxPropertyContract record, Long userId) { |
|
|
|
@Transactional(rollbackFor = {Exception.class}) |
|
|
|
public ResultData saveOrUpdate(WxPropertyContract record, Long userId,String userName) { |
|
|
|
|
|
|
|
if (null == record.getShopId()) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "shopId不能为空"); |
|
|
|
@@ -149,6 +154,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService |
|
|
|
} |
|
|
|
|
|
|
|
//保存物业合同信息 |
|
|
|
String message = ""; |
|
|
|
if (record.getId() == null) { |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
record.setId(idWorker.nextId()); |
|
|
|
@@ -177,7 +183,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService |
|
|
|
logger.error("保存物业合同信息失败,e:" + e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); |
|
|
|
} |
|
|
|
return new ResultData(Result.SUCCESS, "保存物业合同信息成功", record); |
|
|
|
message = "保存物业合同信息成功"; |
|
|
|
} else {//更新物业合同信息 |
|
|
|
WxPropertyContract wxPropertyContract = wxPropertyContractMapper.selectByPrimaryKey(record.getId()); |
|
|
|
if (wxPropertyContract == null) { |
|
|
|
@@ -207,8 +213,24 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService |
|
|
|
logger.error("更新物业合同信息失败,e:" + e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); |
|
|
|
} |
|
|
|
return new ResultData(Result.SUCCESS, "更新物业合同信息成功", record); |
|
|
|
message = "更新物业合同信息成功"; |
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
record.getFlowParams().put("businessId",record.getId().toString()); |
|
|
|
record.getFlowParams().put("supplement",false); |
|
|
|
wxFlowService.start(record.getFlowParams(),userId,userName,record.getTenantId()); |
|
|
|
|
|
|
|
// 合同状态改成待签约 |
|
|
|
WxPropertyContract updateRentContract = new WxPropertyContract(); |
|
|
|
updateRentContract.setId(record.getId()); |
|
|
|
updateRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode()); |
|
|
|
wxPropertyContractMapper.updateStatus(updateRentContract); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("启动审批流失败,e:" + e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.FLOW_FAIL.getCode(), "FLOW FAILD " + e.getMessage()); |
|
|
|
} |
|
|
|
return new ResultData(Result.SUCCESS, message, record); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
|