| @@ -5,16 +5,19 @@ import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxBillProperty; | |||
| import com.iformall.domain.po.WxFlowRecord; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.vo.WxRentPropertyContractVo; | |||
| import com.iformall.enums.EnumContract; | |||
| import com.iformall.enums.EnumContractOperationType; | |||
| import com.iformall.enums.EnumContractType; | |||
| import com.iformall.enums.EnumFlowRecordStatus; | |||
| import com.iformall.enums.EnumRentShopType; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxPropertyContractMapper; | |||
| import com.iformall.mapper.WxRentContractMapper; | |||
| import com.iformall.service.WxFlowRecordService; | |||
| import com.iformall.service.WxPropertyContractService; | |||
| import com.iformall.service.WxRentContractService; | |||
| import com.iformall.service.WxRentPropertyContractService; | |||
| @@ -22,7 +25,9 @@ import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import org.springframework.util.CollectionUtils; | |||
| import java.util.ArrayList; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| @@ -45,6 +50,9 @@ public class WxRentPropertyContractServiceImpl implements WxRentPropertyContract | |||
| @Autowired | |||
| WxRentContractService wxRentContractService; | |||
| @Autowired | |||
| WxFlowRecordService wxFlowRecordService; | |||
| @Override | |||
| public PageInfo<WxRentPropertyContractVo> listContractVo(WxRentPropertyContractVo record, Integer pageIndex, Integer pageSize) { | |||
| @@ -75,26 +83,27 @@ public class WxRentPropertyContractServiceImpl implements WxRentPropertyContract | |||
| @Override | |||
| public ResultData getContractApplyInfo(Long rentId,Long propertyId) { | |||
| Map<String, Object> data = new HashMap<>(2); | |||
| if (null != rentId) { | |||
| Map<String, Object> rent = wxRentContractService.getById(rentId); | |||
| data.put("rent", rent); | |||
| List<Map<String, Object>> result = new ArrayList<Map<String, Object>>(); | |||
| String bussinessId = null; | |||
| if (null != rentId && null == propertyId) { | |||
| bussinessId = String.valueOf(rentId); | |||
| }else if (null == rentId && null != propertyId) { | |||
| bussinessId = String.valueOf(propertyId); | |||
| }else { | |||
| bussinessId = String.valueOf(rentId)+"_RP_"+String.valueOf(propertyId); | |||
| } | |||
| WxFlowRecord wxFlowRecord = new WxFlowRecord(); | |||
| wxFlowRecord.setBusinessId(bussinessId); | |||
| List<WxFlowRecord> flowRecordList = wxFlowRecordService.findList(wxFlowRecord); | |||
| for (WxFlowRecord wfr : flowRecordList) { | |||
| Map<String, Object> data = new HashMap<String, Object>(); | |||
| data.put("status", wfr.getStatus()); | |||
| data.put("userName", wfr.getUserName()); | |||
| data.put("remark", wfr.getRemark()); | |||
| result.add(data); | |||
| } | |||
| // WxPropertyContract wxPropertyContractQuery = new WxPropertyContract(); | |||
| // wxPropertyContractQuery.setRentContractId(id); | |||
| // WxPropertyContract propertyContract = wxPropertyContractMapper.selectOne(new QueryWrapper(wxPropertyContractQuery)); | |||
| if (null != propertyId) { | |||
| WxPropertyContract propertyContract = wxPropertyContractMapper.selectById(propertyId); | |||
| if (propertyContract != null) { | |||
| try { | |||
| Map<String, Object> property = wxPropertyContractService.getById(propertyContract.getId()); | |||
| data.put("property", property); | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| } | |||
| } | |||
| return new ResultData(data); | |||
| return new ResultData(result); | |||
| } | |||