|
|
|
@@ -181,22 +181,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
return new ResultData(ErrorCode.RENT_CONTRACT_WITH_SHOP_IS_FOUND); |
|
|
|
} |
|
|
|
wxRentContractMapper.insertSelective(record); |
|
|
|
//建立账单 |
|
|
|
if (record.getMerchantId() != null && record.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) |
|
|
|
&& record.getReceivePeriod() != null && record.getDeposit() > 0 && record.getPrice() > 0) { |
|
|
|
WxBillRent wxBillRent = new WxBillRent(); |
|
|
|
wxBillRent.setMerchantId(record.getMerchantId()); |
|
|
|
List<Map<String, Object>> billRentList = wxBillRentMapper.queryBillRentList(wxBillRent); |
|
|
|
if (billRentList.size() == 0) { |
|
|
|
WxMerchant wxMerchant = new WxMerchant(); |
|
|
|
wxMerchant.setId(record.getMerchantId()); |
|
|
|
wxMerchant.setTenantId(record.getTenantId()); |
|
|
|
//租金 |
|
|
|
buildRent(wxMerchant, userId); |
|
|
|
//押金 |
|
|
|
buildDeposit(wxMerchant, userId); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("保存租赁合同信息失败,e:" + e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); |
|
|
|
@@ -257,27 +241,10 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
return new ResultData(ErrorCode.RENT_CONTRACT_WITH_SHOP_IS_FOUND); |
|
|
|
} |
|
|
|
wxRentContractMapper.updateByPrimaryKeySelective(record); |
|
|
|
//建立账单 |
|
|
|
/*if (record.getMerchantId() != null && record.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) |
|
|
|
&& record.getReceivePeriod() != null && record.getDeposit() > 0 && record.getPrice() > 0) { |
|
|
|
WxBillRent wxBillRent = new WxBillRent(); |
|
|
|
wxBillRent.setMerchantId(record.getMerchantId()); |
|
|
|
List<Map<String, Object>> billRentList = wxBillRentMapper.queryBillRentList(wxBillRent); |
|
|
|
if (billRentList.size() == 0) { |
|
|
|
WxMerchant wxMerchant = new WxMerchant(); |
|
|
|
wxMerchant.setId(record.getMerchantId()); |
|
|
|
wxMerchant.setTenantId(record.getTenantId()); |
|
|
|
//租金 |
|
|
|
buildRent(wxMerchant, userId); |
|
|
|
//押金 |
|
|
|
buildDeposit(wxMerchant, userId); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("更新租赁合同信息失败,e:" + e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); |
|
|
|
} |
|
|
|
// return new ResultData(Result.SUCCESS, "更新租赁合同信息成功"); |
|
|
|
return new ResultData(Result.SUCCESS, "保存租赁合同信息成功", wxRentContract); |
|
|
|
} |
|
|
|
|
|
|
|
@@ -815,7 +782,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData updateRentContractStatus(Long id, Long userId) { |
|
|
|
public ResultData updateRentContractStatus(Long id) { |
|
|
|
if (id == null) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); |
|
|
|
} |
|
|
|
@@ -840,9 +807,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
wxMerchant.setId(record.getMerchantId()); |
|
|
|
wxMerchant.setTenantId(record.getTenantId()); |
|
|
|
//租金 |
|
|
|
buildRent(wxMerchant, userId); |
|
|
|
buildRent(wxMerchant, null); |
|
|
|
//押金 |
|
|
|
buildDeposit(wxMerchant, userId); |
|
|
|
buildDeposit(wxMerchant, null); |
|
|
|
} |
|
|
|
} |
|
|
|
return new ResultData(Result.SUCCESS, "操作成功"); |
|
|
|
|