| @@ -4,18 +4,17 @@ import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.MallUserInfo; | |||||
| import com.iformall.domain.po.WxRentContract; | |||||
| import com.iformall.domain.vo.WxRentPropertyContractVo; | import com.iformall.domain.vo.WxRentPropertyContractVo; | ||||
| import com.iformall.service.WxRentContractService; | |||||
| import com.iformall.service.WxRentPropertyContractService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | |||||
| import org.springframework.web.bind.annotation.ModelAttribute; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| /** | /** | ||||
| * @author gongbiao | * @author gongbiao | ||||
| @@ -26,7 +25,7 @@ public class WxRentPropertyContractController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | @Autowired | ||||
| private WxRentContractService wxRentContractService; | |||||
| private WxRentPropertyContractService wxRentPropertyContractService; | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @@ -39,7 +38,7 @@ public class WxRentPropertyContractController extends BaseController { | |||||
| wxRentPropertyContractVo = new WxRentPropertyContractVo(); | wxRentPropertyContractVo = new WxRentPropertyContractVo(); | ||||
| } | } | ||||
| wxRentPropertyContractVo.setTenantId(getTenantId()); | wxRentPropertyContractVo.setTenantId(getTenantId()); | ||||
| final PageInfo<WxRentPropertyContractVo> page = wxRentContractService.listContractVo(wxRentPropertyContractVo, pageNum, pageSize); | |||||
| final PageInfo<WxRentPropertyContractVo> page = wxRentPropertyContractService.listContractVo(wxRentPropertyContractVo, pageNum, pageSize); | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -49,7 +48,16 @@ public class WxRentPropertyContractController extends BaseController { | |||||
| @SystemControllerLog(description = "租赁物业合同-根据id查询接口") | @SystemControllerLog(description = "租赁物业合同-根据id查询接口") | ||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] wxRentPropertyContract::findById"); | logger.debug("[" + getIpAddr() + "] wxRentPropertyContract::findById"); | ||||
| return wxRentContractService.getContractInfo(id); | |||||
| return wxRentPropertyContractService.getContractInfo(id); | |||||
| } | |||||
| @PostMapping("insertRentForCreate") | |||||
| @SystemControllerLog(description = "租赁合同-添加") | |||||
| public ResultData insertRent(@RequestBody WxRentContract wxRentContract) { | |||||
| logger.debug("[" + getIpAddr() + "] wxRentPropertyContract::insertRentForCreate"); | |||||
| MallUserInfo user = getUser(); | |||||
| wxRentContract.setTenantId(user.getTenantId()); | |||||
| return wxRentPropertyContractService.insertRentForCreate(wxRentContract); | |||||
| } | } | ||||
| } | } | ||||
| @@ -88,8 +88,4 @@ public interface WxRentContractService { | |||||
| Integer getShopType(WxRentContract wxRentContract); | Integer getShopType(WxRentContract wxRentContract); | ||||
| PageInfo<WxRentPropertyContractVo> listContractVo(WxRentPropertyContractVo wxRentPropertyContractVo, Integer pageNum, Integer pageSize); | |||||
| ResultData getContractInfo(Long id); | |||||
| } | } | ||||
| @@ -0,0 +1,19 @@ | |||||
| package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxRentContract; | |||||
| import com.iformall.domain.vo.WxRentPropertyContractVo; | |||||
| /** | |||||
| * @author gongbiao | |||||
| */ | |||||
| public interface WxRentPropertyContractService { | |||||
| PageInfo<WxRentPropertyContractVo> listContractVo(WxRentPropertyContractVo wxRentPropertyContractVo, Integer pageNum, Integer pageSize); | |||||
| ResultData getContractInfo(Long id); | |||||
| ResultData insertRentForCreate(WxRentContract wxRentContract); | |||||
| } | |||||
| @@ -10,7 +10,6 @@ import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.vo.BillTimeVo; | import com.iformall.domain.vo.BillTimeVo; | ||||
| import com.iformall.domain.vo.WxRentPropertyContractVo; | |||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| @@ -25,16 +24,17 @@ import org.apache.shiro.SecurityUtils; | |||||
| import org.flowable.engine.RuntimeService; | import org.flowable.engine.RuntimeService; | ||||
| import org.flowable.engine.TaskService; | import org.flowable.engine.TaskService; | ||||
| import org.flowable.task.api.Task; | import org.flowable.task.api.Task; | ||||
| import org.joda.time.DateTime; | |||||
| import org.joda.time.Months; | |||||
| import org.joda.time.format.DateTimeFormat; | |||||
| import org.joda.time.format.DateTimeFormatter; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
| import org.springframework.util.CollectionUtils; | import org.springframework.util.CollectionUtils; | ||||
| import org.joda.time.DateTime; | |||||
| import org.joda.time.Months; | |||||
| import org.joda.time.format.DateTimeFormat; | |||||
| import org.joda.time.format.DateTimeFormatter; | |||||
| import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| import java.io.File; | import java.io.File; | ||||
| @@ -1857,31 +1857,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| return wxRentContractMapper.getShopType(wxRentContract); | return wxRentContractMapper.getShopType(wxRentContract); | ||||
| } | } | ||||
| @Override | |||||
| public PageInfo<WxRentPropertyContractVo> listContractVo(WxRentPropertyContractVo record, Integer pageIndex, Integer pageSize) { | |||||
| 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){ | public static double getMonthNeedPay(Double price,Date start,Date end){ | ||||
| SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); | SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); | ||||
| SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM"); | SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM"); | ||||
| @@ -0,0 +1,121 @@ | |||||
| package com.iformall.service.impl; | |||||
| import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxPropertyContract; | |||||
| import com.iformall.domain.po.WxRentContract; | |||||
| import com.iformall.domain.vo.WxRentPropertyContractVo; | |||||
| import com.iformall.enums.EnumRentContractStatus; | |||||
| import com.iformall.mapper.*; | |||||
| import com.iformall.service.*; | |||||
| import org.flowable.engine.RuntimeService; | |||||
| import org.flowable.engine.TaskService; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import java.util.HashMap; | |||||
| import java.util.Map; | |||||
| /** | |||||
| * @author gongbiao | |||||
| */ | |||||
| @Service | |||||
| public class WxRentPropertyContractServiceImpl implements WxRentPropertyContractService { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private String fmUploadDir; | |||||
| @Autowired | |||||
| WxRentContractMapper wxRentContractMapper; | |||||
| @Autowired | |||||
| WxShopMapper wxShopMapper; | |||||
| @Autowired | |||||
| WxMerchantService wxMerchantService; | |||||
| @Autowired | |||||
| WxBillRentMapper wxBillRentMapper; | |||||
| @Autowired | |||||
| WxBillDepositMapper wxBillDepositMapper; | |||||
| @Autowired | |||||
| WxPropertyContractMapper wxPropertyContractMapper; | |||||
| @Autowired | |||||
| WxMerchantMapper wxMerchantMapper; | |||||
| @Autowired | |||||
| WxBusinessMapper wxBusinessMapper; | |||||
| @Autowired | |||||
| WxMallMapper wxMallMapper; | |||||
| @Autowired | |||||
| WxBrandMapper WxBrandMapper; | |||||
| @Autowired | |||||
| WxFlowRecordService wxFlowRecordService; | |||||
| @Autowired | |||||
| RuntimeService runtimeService; | |||||
| @Autowired | |||||
| private TaskService taskService; | |||||
| @Autowired | |||||
| private WxFlowService wxFlowService; | |||||
| @Autowired | |||||
| WxMerchantShopMapper wxMerchantShopMapper; | |||||
| @Autowired | |||||
| WxFlowRecordMapper wxFlowRecordMapper; | |||||
| @Autowired | |||||
| WxPropertyContractService wxPropertyContractService; | |||||
| @Autowired | |||||
| WxRentContractService wxRentontractService; | |||||
| @Override | |||||
| public PageInfo<WxRentPropertyContractVo> listContractVo(WxRentPropertyContractVo record, Integer pageIndex, Integer pageSize) { | |||||
| 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 = wxRentontractService.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); | |||||
| } | |||||
| @Override | |||||
| public ResultData insertRentForCreate(WxRentContract wxRentContract) { | |||||
| return null; | |||||
| } | |||||
| } | |||||