| | |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.YwContractBillMapper; |
| | | import com.doumee.dao.business.YwContractRoomMapper; |
| | | import com.doumee.dao.business.model.YwContract; |
| | | import com.doumee.dao.business.model.YwContractBill; |
| | | import com.doumee.dao.business.model.YwContractRoom; |
| | | import com.doumee.dao.business.model.YwCustomer; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.system.MultifileMapper; |
| | | import com.doumee.dao.system.model.Multifile; |
| | | import com.doumee.service.business.YwContractBillService; |
| | |
| | | || Objects.isNull(ywContractBill.getCompanyId()) |
| | | || Objects.isNull(ywContractBill.getStartDate()) |
| | | || Objects.isNull(ywContractBill.getEndDate()) |
| | | || com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(ywContractBill.getYwContractRoomList()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | LoginUserInfo loginUserInfo = ywContractBill.getLoginUserInfo(); |
| | | ywContractBill.setReceivableFee(ywContractBill.getTotleFee()); |
| | | ywContractBill.setCreateDate(new Date()); |
| | | ywContractBill.setCreator(loginUserInfo.getId()); |
| | | ywContractBill.setIsdeleted(Constants.ZERO); |
| | |
| | | multifile.setCreator(loginUserInfo.getId()); |
| | | multifile.setCreateDate(new Date()); |
| | | multifile.setIsdeleted(Constants.ZERO); |
| | | multifile.setObjType(Constants.MultiFile.FN_PATROL_POINT_FILE.getKey()); |
| | | multifile.setObjType(Constants.MultiFile.FN_CONTRACT_BILL_FILE.getKey()); |
| | | multifile.setObjId(ywContractBill.getId()); |
| | | } |
| | | multifileMapper.insert(ywContractBill.getMultifileList()); |
| | |
| | | IPage<YwContractBill> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | MPJLambdaWrapper<YwContractBill> queryWrapper = new MPJLambdaWrapper<>(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | |
| | | YwContractBill model = pageWrap.getModel(); |
| | | |
| | | ywContractBillMapper.selectJoinPage(page,YwContractBill.class, |
| | | queryWrapper.selectAll(YwContractBill.class) |
| | | .selectAs(YwContract::getCode,YwContractBill::getContractCode) |
| | | .selectAs(YwCustomer::getName,YwContractBill::getCustomerName) |
| | | .leftJoin(YwContract.class,YwContract::getId,YwContractBill::getContractId) |
| | | .leftJoin(YwCustomer.class,YwCustomer::getId,YwContract::getRenterId) |
| | | .eq(YwContractBill::getIsdeleted,Constants.ZERO) |
| | | .like(Objects.nonNull(model)&&StringUtils.isNotBlank(model.getCustomerName()), |
| | | YwCustomer::getName,model.getCustomerName()) |
| | | .eq(Objects.nonNull(model)&&Objects.nonNull(model.getStatus()), |
| | | YwContractBill::getStatus,model.getStatus()) |
| | | .eq(Objects.nonNull(model)&&Objects.nonNull(model.getPayStatus()), |
| | | YwContractBill::getPayStatus,model.getPayStatus()) |
| | | .eq(Objects.nonNull(model)&&Objects.nonNull(model.getType()), |
| | | YwContractBill::getType,model.getType()) |
| | | .ge(YwContractBill::getPlanPayDate, Utils.Date.getStart(model.getPlanPayDateStart())) |
| | | .le(YwContractBill::getPlanPayDate, Utils.Date.getEnd(model.getPlanPayDateEnd())) ) |
| | | ; |
| | | |
| | | return PageData.from(ywContractBillMapper.selectPage(page, queryWrapper)); |