|
|
|
@@ -14,10 +14,7 @@ import com.iformall.domain.vo.WxRentPropertyContractVo; |
|
|
|
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.service.*; |
|
|
|
import com.iformall.utils.DateUtils; |
|
|
|
import com.iformall.utils.DownFileUtil; |
|
|
|
import com.iformall.utils.PriceUtil; |
|
|
|
@@ -105,6 +102,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
@Autowired |
|
|
|
WxFlowRecordMapper wxFlowRecordMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxPropertyContractService wxPropertyContractService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public Map<String, Object> listAsPage(WxRentContract record, Integer pageIndex, Integer pageSize) { |
|
|
|
Object rentContractStatusInfo = getRentContractStatusInfo(record); |
|
|
|
@@ -118,11 +118,11 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData getById(Long id) { |
|
|
|
public Map<String, Object> getById(Long id) { |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
WxRentContract wxRentContract = wxRentContractMapper.selectByPrimaryKey(id); |
|
|
|
if (wxRentContract == null) { |
|
|
|
return new ResultData(ErrorCode.RENT_CONTRACT_IS_NOT_FOUND); |
|
|
|
throw new MallinkException(ErrorCode.RENT_CONTRACT_IS_NOT_FOUND); |
|
|
|
} |
|
|
|
|
|
|
|
//init dateDiff |
|
|
|
@@ -242,7 +242,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
List<WxBillRent> resultList = wxBillRentMapper.findList(wxBillRent); |
|
|
|
result.put("previewBillRentList",resultList); |
|
|
|
|
|
|
|
return new ResultData(Result.SUCCESS, "查询成功", result); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(rollbackFor = {Exception.class}) |
|
|
|
@@ -1841,6 +1841,26 @@ public class WxRentContractServiceImpl implements WxRentContractService { |
|
|
|
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxRentContractMapper.listContractVo(record)); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData getContractInfo(Long id) { |
|
|
|
Map<String, Object> data = new HashMap<>(); |
|
|
|
Map<String, Object> rent = getById(id); |
|
|
|
data.put("rent", rent); |
|
|
|
WxPropertyContract wxPropertyContractQuery = new WxPropertyContract(); |
|
|
|
wxPropertyContractQuery.setRentContractId(id); |
|
|
|
WxPropertyContract wxPropertyContract = wxPropertyContractMapper.select(wxPropertyContractQuery).parallelStream() |
|
|
|
.filter(p -> p.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode()) || |
|
|
|
p.getStatus().equals(EnumRentContractStatus.RENT_PAID.getCode()) || |
|
|
|
p.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode())) |
|
|
|
.findFirst().orElseGet(null); |
|
|
|
data.put("property", wxPropertyContract); |
|
|
|
if (wxPropertyContract != null) { |
|
|
|
Map<String, Object> property = wxPropertyContractService.getById(wxPropertyContract.getRentContractId()); |
|
|
|
data.put("property", property); |
|
|
|
} |
|
|
|
return new ResultData(data); |
|
|
|
} |
|
|
|
|
|
|
|
public static double getMonthNeedPay(Double price,Date start,Date end){ |
|
|
|
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM"); |
|
|
|
|