| @@ -0,0 +1,65 @@ | |||
| package com.iformall.controller; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxBillProperty; | |||
| import com.iformall.service.WxBillPropertyService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.Map; | |||
| @RestController | |||
| @RequestMapping("wxBillProperty") | |||
| public class WxBillPropertyController extends BaseController | |||
| { | |||
| @Autowired | |||
| private WxBillPropertyService wxBillPropertyService; | |||
| private Logger logger = LoggerFactory.getLogger(WxBillPropertyController.class); | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||
| public ResultData list(@ModelAttribute WxBillProperty wxBillProperty, Integer pageNum, Integer pageSize) { | |||
| if (null == wxBillProperty) wxBillProperty = new WxBillProperty(); | |||
| wxBillProperty.setTenantId(getTenantId()); | |||
| PageInfo<Map<String, Object>> result = wxBillPropertyService.listAsPage(wxBillProperty, pageNum, pageSize); | |||
| return new ResultData(result); | |||
| } | |||
| @PostMapping("add") | |||
| public ResultData add(@RequestBody WxBillProperty wxBillProperty) { | |||
| wxBillProperty.setTenantId(getTenantId()); | |||
| wxBillPropertyService.saveOrUpdate(wxBillProperty); | |||
| return new ResultData(); | |||
| } | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxBillProperty wxBillProperty) { | |||
| wxBillPropertyService.saveOrUpdate(wxBillProperty); | |||
| return new ResultData(); | |||
| } | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name="id",value="id",dataType="String", paramType = "query",required=true) | |||
| public ResultData delete(Long id) { | |||
| wxBillPropertyService.deleteById(id); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData findById(Long id) { | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxBillPropertyService.getById(id)); | |||
| } | |||
| } | |||
| @@ -0,0 +1,68 @@ | |||
| package com.iformall.controller; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxBillPropertyDeposit; | |||
| import com.iformall.service.WxBillPropertyDepositService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.Map; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @RestController | |||
| @RequestMapping("wxBillPropertyDeposit") | |||
| public class WxBillPropertyDepositController extends BaseController | |||
| { | |||
| @Autowired | |||
| private WxBillPropertyDepositService wxBillPropertyDepositService; | |||
| private Logger logger = LoggerFactory.getLogger(WxBillPropertyDepositController.class); | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||
| public ResultData list(@ModelAttribute WxBillPropertyDeposit wxBillPropertyDeposit, Integer pageNum, Integer pageSize) { | |||
| if (null == wxBillPropertyDeposit) wxBillPropertyDeposit = new WxBillPropertyDeposit(); | |||
| wxBillPropertyDeposit.setTenantId(getTenantId()); | |||
| PageInfo<Map<String, Object>> result = wxBillPropertyDepositService.listAsPage(wxBillPropertyDeposit, pageNum, pageSize); | |||
| return new ResultData(result); | |||
| } | |||
| @PostMapping("add") | |||
| public ResultData add(@RequestBody WxBillPropertyDeposit wxBillPropertyDeposit) { | |||
| wxBillPropertyDeposit.setTenantId(getTenantId()); | |||
| wxBillPropertyDepositService.saveOrUpdate(wxBillPropertyDeposit); | |||
| return new ResultData(); | |||
| } | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxBillPropertyDeposit wxBillPropertyDeposit) { | |||
| wxBillPropertyDepositService.saveOrUpdate(wxBillPropertyDeposit); | |||
| return new ResultData(); | |||
| } | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData delete(Long id) { | |||
| wxBillPropertyDepositService.deleteById(id); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData findById(Long id) { | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxBillPropertyDepositService.getById(id)); | |||
| } | |||
| } | |||
| @@ -0,0 +1,89 @@ | |||
| package com.iformall.controller; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import com.iformall.service.WxPropertyContractService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.util.Map; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @RestController | |||
| @RequestMapping("wxPropertyContract") | |||
| public class WxPropertyContractController extends BaseController | |||
| { | |||
| @Autowired | |||
| private WxPropertyContractService wxPropertyContractService; | |||
| private Logger logger = LoggerFactory.getLogger(WxPropertyContractController.class); | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||
| public ResultData list(@ModelAttribute WxPropertyContract wxPropertyContract,Integer pageNum, Integer pageSize) { | |||
| if (null == wxPropertyContract){ | |||
| wxPropertyContract = new WxPropertyContract(); | |||
| } | |||
| wxPropertyContract.setTenantId(getTenantId()); | |||
| Map<String, Object> result = wxPropertyContractService.listAsPage(wxPropertyContract, pageNum, pageSize); | |||
| return new ResultData(result); | |||
| } | |||
| @PostMapping("add") | |||
| public ResultData add(@RequestBody WxPropertyContract wxPropertyContract) { | |||
| wxPropertyContract.setTenantId(getTenantId()); | |||
| return wxPropertyContractService.saveOrUpdate(wxPropertyContract); | |||
| } | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxPropertyContract wxPropertyContract) { | |||
| return wxPropertyContractService.saveOrUpdate(wxPropertyContract); | |||
| } | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData delete(Long id) { | |||
| wxPropertyContractService.deleteById(id); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData findById(Long id) { | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxPropertyContractService.getById(id)); | |||
| } | |||
| @RequestMapping("/download") | |||
| public void download(HttpServletRequest request, HttpServletResponse response){ | |||
| wxPropertyContractService.download(request,response,getTenantId()); | |||
| } | |||
| @GetMapping("/getRentContractStatusInfo") | |||
| public ResultData getRentContractStatusInfo() { | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxPropertyContractService.getRentContractStatusInfo(getTenantId())); | |||
| } | |||
| @GetMapping("/endRentContract") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| public ResultData endRentContract(Long id) { | |||
| return wxPropertyContractService.endRentContract(id); | |||
| } | |||
| @GetMapping("/getRentContractList") | |||
| public ResultData getRentContractList() { | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxPropertyContractService.getRentContractList(getTenantId())); | |||
| } | |||
| } | |||
| @@ -11,7 +11,7 @@ import java.util.List; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @Table(name = "wx_bill_deposit") | |||
| @Table(name = "wx_bill_rent_deposit") | |||
| public class WxBillDeposit implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @@ -0,0 +1,259 @@ | |||
| package com.iformall.domain.po; | |||
| import javax.persistence.Id; | |||
| import javax.persistence.Table; | |||
| import javax.persistence.Transient; | |||
| import java.io.Serializable; | |||
| import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| @Table(name = "wx_bill_property") | |||
| public class WxBillProperty implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getSortColumns() { | |||
| return sortColumns; | |||
| } | |||
| public List<Long> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<Long> ids) { | |||
| this.ids = ids; | |||
| } | |||
| /*租金合同ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租金合同ID",name="rentContractId") | |||
| private Long rentContractId; | |||
| /*实际应收金额**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="receivePay") | |||
| private Integer receivePay; | |||
| /*实收金额**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="实收金额",name="pay") | |||
| private Integer pay; | |||
| /*收款日期**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="收款日期",name="receiveDate") | |||
| private Date receiveDate; | |||
| /*到账日期**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="到账日期",name="payDate") | |||
| private Date payDate; | |||
| /*创建时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createtime") | |||
| private Date createtime; | |||
| /*逾期天数**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay") | |||
| private Long expiredDay; | |||
| /*租户**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户",name="tenantId") | |||
| private String tenantId; | |||
| /*欠缴**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="欠缴",name="owe") | |||
| private Integer owe; | |||
| /*账单状态1未到期2待缴3欠缴4已结清**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="账单状态1未到期2待缴3欠缴4已结清",name="status") | |||
| private Integer status; | |||
| /*是否删除 是1否0 未到期不显示**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="是否删除 是1否0 未到期不显示",name="isDel") | |||
| private Integer isDel; | |||
| /*应收金额**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="应收金额",name="needPay") | |||
| private Integer needPay; | |||
| /*商户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId") | |||
| private Long merchantId; | |||
| /*账号ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="账号ID",name="userId") | |||
| private Long userId; | |||
| /*商铺ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商铺ID",name="shopId") | |||
| private Long shopId; | |||
| /*更新时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime") | |||
| private Date updatetime; | |||
| public Long getRentContractId() { | |||
| return rentContractId; | |||
| } | |||
| public void setRentContractId(Long _rentContractId) { | |||
| rentContractId = _rentContractId; | |||
| } | |||
| public Integer getReceivePay() { | |||
| return receivePay; | |||
| } | |||
| public void setReceivePay(Integer _receivePay) { | |||
| receivePay = _receivePay; | |||
| } | |||
| public Integer getPay() { | |||
| return pay; | |||
| } | |||
| public void setPay(Integer _pay) { | |||
| pay = _pay; | |||
| } | |||
| public Date getReceiveDate() { | |||
| return receiveDate; | |||
| } | |||
| public void setReceiveDate(Date _receiveDate) { | |||
| receiveDate = _receiveDate; | |||
| } | |||
| public Date getPayDate() { | |||
| return payDate; | |||
| } | |||
| public void setPayDate(Date _payDate) { | |||
| payDate = _payDate; | |||
| } | |||
| public Date getCreatetime() { | |||
| return createtime; | |||
| } | |||
| public void setCreatetime(Date _createtime) { | |||
| createtime = _createtime; | |||
| } | |||
| public Long getExpiredDay() { | |||
| return expiredDay; | |||
| } | |||
| public void setExpiredDay(Long _expiredDay) { | |||
| expiredDay = _expiredDay; | |||
| } | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public Integer getOwe() { | |||
| return owe; | |||
| } | |||
| public void setOwe(Integer _owe) { | |||
| owe = _owe; | |||
| } | |||
| public Integer getStatus() { | |||
| return status; | |||
| } | |||
| public void setStatus(Integer _status) { | |||
| status = _status; | |||
| } | |||
| public Integer getIsDel() { | |||
| return isDel; | |||
| } | |||
| public void setIsDel(Integer _isDel) { | |||
| isDel = _isDel; | |||
| } | |||
| public Integer getNeedPay() { | |||
| return needPay; | |||
| } | |||
| public void setNeedPay(Integer _needPay) { | |||
| needPay = _needPay; | |||
| } | |||
| public Long getMerchantId() { | |||
| return merchantId; | |||
| } | |||
| public void setMerchantId(Long _merchantId) { | |||
| merchantId = _merchantId; | |||
| } | |||
| public Long getUserId() { | |||
| return userId; | |||
| } | |||
| public void setUserId(Long _userId) { | |||
| userId = _userId; | |||
| } | |||
| public Long getShopId() { | |||
| return shopId; | |||
| } | |||
| public void setShopId(Long _shopId) { | |||
| shopId = _shopId; | |||
| } | |||
| public Date getUpdatetime() { | |||
| return updatetime; | |||
| } | |||
| public void setUpdatetime(Date _updatetime) { | |||
| updatetime = _updatetime; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,RentContractId_ASC("`rentContractId` ASC"),RentContractId_DESC("`rentContractId` DESC") | |||
| ,ReceivePay_ASC("`receivePay` ASC"),ReceivePay_DESC("`receivePay` DESC") | |||
| ,Pay_ASC("`pay` ASC"),Pay_DESC("`pay` DESC") | |||
| ,ReceiveDate_ASC("`receiveDate` ASC"),ReceiveDate_DESC("`receiveDate` DESC") | |||
| ,PayDate_ASC("`payDate` ASC"),PayDate_DESC("`payDate` DESC") | |||
| ,Createtime_ASC("`createtime` ASC"),Createtime_DESC("`createtime` DESC") | |||
| ,ExpiredDay_ASC("`expiredDay` ASC"),ExpiredDay_DESC("`expiredDay` DESC") | |||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||
| ,Owe_ASC("`owe` ASC"),Owe_DESC("`owe` DESC") | |||
| ,Status_ASC("`status` ASC"),Status_DESC("`status` DESC") | |||
| ,IsDel_ASC("`isDel` ASC"),IsDel_DESC("`isDel` DESC") | |||
| ,NeedPay_ASC("`needPay` ASC"),NeedPay_DESC("`needPay` DESC") | |||
| ,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC") | |||
| ,UserId_ASC("`userId` ASC"),UserId_DESC("`userId` DESC") | |||
| ,ShopId_ASC("`shopId` ASC"),ShopId_DESC("`shopId` DESC") | |||
| ,Updatetime_ASC("`updatetime` ASC"),Updatetime_DESC("`updatetime` DESC") | |||
| ; | |||
| private String value; | |||
| Field(String value){ | |||
| this.value = value; | |||
| } | |||
| public String getValue() { | |||
| return value; | |||
| } | |||
| public void setCol(String value) { | |||
| this.value = value; | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return this.getValue(); | |||
| } | |||
| } | |||
| public void setSortColumns(Field... fields) | |||
| { | |||
| if (fields == null || fields.length == 0) { | |||
| return; | |||
| } | |||
| for (int k = 0; k < fields.length; k++) { | |||
| if (fields[k] == null) { | |||
| return; | |||
| } | |||
| } | |||
| StringBuilder sb = new StringBuilder(fields[0].toString()); | |||
| for (int k = 1; k < fields.length; k++) { | |||
| sb.append(","); | |||
| sb.append(fields[k].toString()); | |||
| } | |||
| } | |||
| public void setSortColumns(String sortColumns) | |||
| { | |||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||
| return; | |||
| } | |||
| if (sortColumns.contains(",")) { | |||
| String[] cols = sortColumns.split(","); | |||
| List<Field> fList = new ArrayList(); | |||
| for (int k = 0; k < cols.length; k++) { | |||
| fList.add(Field.valueOf(cols[k])); | |||
| } | |||
| this.setSortColumns(fList.toArray(new Field[fList.size()])); | |||
| } else { | |||
| this.setSortColumns(Field.valueOf(sortColumns)); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,259 @@ | |||
| package com.iformall.domain.po; | |||
| import javax.persistence.Id; | |||
| import javax.persistence.Table; | |||
| import javax.persistence.Transient; | |||
| import java.io.Serializable; | |||
| import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| @Table(name = "wx_bill_property_deposit") | |||
| public class WxBillPropertyDeposit implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getSortColumns() { | |||
| return sortColumns; | |||
| } | |||
| public List<Long> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<Long> ids) { | |||
| this.ids = ids; | |||
| } | |||
| /*租金合同ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租金合同ID",name="rentContractId") | |||
| private Long rentContractId; | |||
| /*实际应收金额**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="receivePay") | |||
| private Integer receivePay; | |||
| /*实收金额**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="实收金额",name="pay") | |||
| private Integer pay; | |||
| /*收款日期**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="收款日期",name="receiveDate") | |||
| private Date receiveDate; | |||
| /*到账日期**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="到账日期",name="payDate") | |||
| private Date payDate; | |||
| /*创建时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createtime") | |||
| private Date createtime; | |||
| /*逾期天数**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="逾期天数",name="expiredDay") | |||
| private Long expiredDay; | |||
| /*租户**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户",name="tenantId") | |||
| private String tenantId; | |||
| /*欠缴**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="欠缴",name="owe") | |||
| private Integer owe; | |||
| /*账单状态1未到期2待缴3欠缴4已结清**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="账单状态1未到期2待缴3欠缴4已结清",name="status") | |||
| private Integer status; | |||
| /*是否删除 是1否0 未到期不显示**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="是否删除 是1否0 未到期不显示",name="isDel") | |||
| private Integer isDel; | |||
| /*应收金额**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="应收金额",name="needPay") | |||
| private Integer needPay; | |||
| /*商户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId") | |||
| private Long merchantId; | |||
| /*账号ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="账号ID",name="userId") | |||
| private Long userId; | |||
| /*商铺ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商铺ID",name="shopId") | |||
| private Long shopId; | |||
| /*更新时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime") | |||
| private Date updatetime; | |||
| public Long getRentContractId() { | |||
| return rentContractId; | |||
| } | |||
| public void setRentContractId(Long _rentContractId) { | |||
| rentContractId = _rentContractId; | |||
| } | |||
| public Integer getReceivePay() { | |||
| return receivePay; | |||
| } | |||
| public void setReceivePay(Integer _receivePay) { | |||
| receivePay = _receivePay; | |||
| } | |||
| public Integer getPay() { | |||
| return pay; | |||
| } | |||
| public void setPay(Integer _pay) { | |||
| pay = _pay; | |||
| } | |||
| public Date getReceiveDate() { | |||
| return receiveDate; | |||
| } | |||
| public void setReceiveDate(Date _receiveDate) { | |||
| receiveDate = _receiveDate; | |||
| } | |||
| public Date getPayDate() { | |||
| return payDate; | |||
| } | |||
| public void setPayDate(Date _payDate) { | |||
| payDate = _payDate; | |||
| } | |||
| public Date getCreatetime() { | |||
| return createtime; | |||
| } | |||
| public void setCreatetime(Date _createtime) { | |||
| createtime = _createtime; | |||
| } | |||
| public Long getExpiredDay() { | |||
| return expiredDay; | |||
| } | |||
| public void setExpiredDay(Long _expiredDay) { | |||
| expiredDay = _expiredDay; | |||
| } | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public Integer getOwe() { | |||
| return owe; | |||
| } | |||
| public void setOwe(Integer _owe) { | |||
| owe = _owe; | |||
| } | |||
| public Integer getStatus() { | |||
| return status; | |||
| } | |||
| public void setStatus(Integer _status) { | |||
| status = _status; | |||
| } | |||
| public Integer getIsDel() { | |||
| return isDel; | |||
| } | |||
| public void setIsDel(Integer _isDel) { | |||
| isDel = _isDel; | |||
| } | |||
| public Integer getNeedPay() { | |||
| return needPay; | |||
| } | |||
| public void setNeedPay(Integer _needPay) { | |||
| needPay = _needPay; | |||
| } | |||
| public Long getMerchantId() { | |||
| return merchantId; | |||
| } | |||
| public void setMerchantId(Long _merchantId) { | |||
| merchantId = _merchantId; | |||
| } | |||
| public Long getUserId() { | |||
| return userId; | |||
| } | |||
| public void setUserId(Long _userId) { | |||
| userId = _userId; | |||
| } | |||
| public Long getShopId() { | |||
| return shopId; | |||
| } | |||
| public void setShopId(Long _shopId) { | |||
| shopId = _shopId; | |||
| } | |||
| public Date getUpdatetime() { | |||
| return updatetime; | |||
| } | |||
| public void setUpdatetime(Date _updatetime) { | |||
| updatetime = _updatetime; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,RentContractId_ASC("`rentContractId` ASC"),RentContractId_DESC("`rentContractId` DESC") | |||
| ,ReceivePay_ASC("`receivePay` ASC"),ReceivePay_DESC("`receivePay` DESC") | |||
| ,Pay_ASC("`pay` ASC"),Pay_DESC("`pay` DESC") | |||
| ,ReceiveDate_ASC("`receiveDate` ASC"),ReceiveDate_DESC("`receiveDate` DESC") | |||
| ,PayDate_ASC("`payDate` ASC"),PayDate_DESC("`payDate` DESC") | |||
| ,Createtime_ASC("`createtime` ASC"),Createtime_DESC("`createtime` DESC") | |||
| ,ExpiredDay_ASC("`expiredDay` ASC"),ExpiredDay_DESC("`expiredDay` DESC") | |||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||
| ,Owe_ASC("`owe` ASC"),Owe_DESC("`owe` DESC") | |||
| ,Status_ASC("`status` ASC"),Status_DESC("`status` DESC") | |||
| ,IsDel_ASC("`isDel` ASC"),IsDel_DESC("`isDel` DESC") | |||
| ,NeedPay_ASC("`needPay` ASC"),NeedPay_DESC("`needPay` DESC") | |||
| ,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC") | |||
| ,UserId_ASC("`userId` ASC"),UserId_DESC("`userId` DESC") | |||
| ,ShopId_ASC("`shopId` ASC"),ShopId_DESC("`shopId` DESC") | |||
| ,Updatetime_ASC("`updatetime` ASC"),Updatetime_DESC("`updatetime` DESC") | |||
| ; | |||
| private String value; | |||
| Field(String value){ | |||
| this.value = value; | |||
| } | |||
| public String getValue() { | |||
| return value; | |||
| } | |||
| public void setCol(String value) { | |||
| this.value = value; | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return this.getValue(); | |||
| } | |||
| } | |||
| public void setSortColumns(Field... fields) | |||
| { | |||
| if (fields == null || fields.length == 0) { | |||
| return; | |||
| } | |||
| for (int k = 0; k < fields.length; k++) { | |||
| if (fields[k] == null) { | |||
| return; | |||
| } | |||
| } | |||
| StringBuilder sb = new StringBuilder(fields[0].toString()); | |||
| for (int k = 1; k < fields.length; k++) { | |||
| sb.append(","); | |||
| sb.append(fields[k].toString()); | |||
| } | |||
| } | |||
| public void setSortColumns(String sortColumns) | |||
| { | |||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||
| return; | |||
| } | |||
| if (sortColumns.contains(",")) { | |||
| String[] cols = sortColumns.split(","); | |||
| List<Field> fList = new ArrayList(); | |||
| for (int k = 0; k < cols.length; k++) { | |||
| fList.add(Field.valueOf(cols[k])); | |||
| } | |||
| this.setSortColumns(fList.toArray(new Field[fList.size()])); | |||
| } else { | |||
| this.setSortColumns(Field.valueOf(sortColumns)); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,382 @@ | |||
| package com.iformall.domain.po; | |||
| import javax.persistence.Id; | |||
| import javax.persistence.Table; | |||
| import javax.persistence.Transient; | |||
| import java.io.Serializable; | |||
| import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @Table(name = "wx_property_contract") | |||
| public class WxPropertyContract implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getSortColumns() { | |||
| return sortColumns; | |||
| } | |||
| public List<Long> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<Long> ids) { | |||
| this.ids = ids; | |||
| } | |||
| @Transient | |||
| private String shopNumber; | |||
| public String getShopNumber() { | |||
| return shopNumber; | |||
| } | |||
| public void setShopNumber(String shopNumber) { | |||
| this.shopNumber = shopNumber; | |||
| } | |||
| /*商户**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户",name="merchantId") | |||
| private Long merchantId; | |||
| /*月租金/分成(分)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="物业费(分)",name="price") | |||
| private Integer price; | |||
| /*计租开始时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="计租开始时间",name="rentalStartDate") | |||
| private Date rentalStartDate; | |||
| /*计租结束时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="计租结束时间",name="rentalEndDate") | |||
| private Date rentalEndDate; | |||
| /*签定合同时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="签定合同时间",name="signDate") | |||
| private Date signDate; | |||
| /*付款周期**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="付款周期",name="receivePeriod") | |||
| private Integer receivePeriod; | |||
| /*租户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private String tenantId; | |||
| /*合同文件路径**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="合同文件路径",name="filepath") | |||
| private String filepath; | |||
| /*合同进度状态1待签约2已签约未记租3计租中4提前终止5合同到期**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="合同进度状态1待签约2已签约未记租3计租中4提前终止5合同到期",name="status") | |||
| private Integer status; | |||
| /*合同编号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="合同编号",name="contractNumber") | |||
| private String contractNumber; | |||
| /*押金**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="押金",name="deposit") | |||
| private Integer deposit; | |||
| /*交租日 计租开始时间减去交租日的天数为基数 提前多少日交租**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="交租日 计租开始时间减去交租日的天数为基数 提前多少日交租",name="payDate") | |||
| private Integer payDate; | |||
| /*是否删除1是0否**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="是否删除1是0否",name="isDel") | |||
| private Integer isDel; | |||
| /*商户名称**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户名称",name="merchantName") | |||
| private String merchantName; | |||
| /*经营品牌**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="经营品牌",name="brand") | |||
| private String brand; | |||
| /*经营业态ID:参照wx_business表**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="经营业态ID:参照wx_business表",name="businessId") | |||
| private Long businessId; | |||
| /*店铺类型:1直营店2加盟店3个体店4旗舰店**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="店铺类型:1直营店2加盟店3个体店4旗舰店",name="shopType") | |||
| private Integer shopType; | |||
| /*商铺ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商铺ID",name="shopId") | |||
| private Long shopId; | |||
| /*更新时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime") | |||
| private Date updatetime; | |||
| /*创建时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createtime") | |||
| private Date createtime; | |||
| /*计租面积**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="计租面积",name="rentArea") | |||
| private String rentArea; | |||
| /*联系人**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="联系人",name="linkPerson") | |||
| private String linkPerson; | |||
| /*联系电话**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="联系电话",name="linkPhone") | |||
| private String linkPhone; | |||
| /*支付账号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="支付账号",name="payAccount") | |||
| private String payAccount; | |||
| /*上传文件名**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="上传文件名",name="filename") | |||
| private String filename; | |||
| /*租期:月**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租期:月",name="lease") | |||
| private Integer lease; | |||
| /*租金合同ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租金合同ID",name="rentContractId") | |||
| private Long rentContractId; | |||
| public Long getMerchantId() { | |||
| return merchantId; | |||
| } | |||
| public void setMerchantId(Long _merchantId) { | |||
| merchantId = _merchantId; | |||
| } | |||
| public Integer getPrice() { | |||
| return price; | |||
| } | |||
| public void setPrice(Integer _price) { | |||
| price = _price; | |||
| } | |||
| public Date getRentalStartDate() { | |||
| return rentalStartDate; | |||
| } | |||
| public void setRentalStartDate(Date _rentalStartDate) { | |||
| rentalStartDate = _rentalStartDate; | |||
| } | |||
| public Date getRentalEndDate() { | |||
| return rentalEndDate; | |||
| } | |||
| public void setRentalEndDate(Date _rentalEndDate) { | |||
| rentalEndDate = _rentalEndDate; | |||
| } | |||
| public Date getSignDate() { | |||
| return signDate; | |||
| } | |||
| public void setSignDate(Date _signDate) { | |||
| signDate = _signDate; | |||
| } | |||
| public Integer getReceivePeriod() { | |||
| return receivePeriod; | |||
| } | |||
| public void setReceivePeriod(Integer _receivePeriod) { | |||
| receivePeriod = _receivePeriod; | |||
| } | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public String getFilepath() { | |||
| return filepath; | |||
| } | |||
| public void setFilepath(String _filepath) { | |||
| filepath = _filepath; | |||
| } | |||
| public Integer getStatus() { | |||
| return status; | |||
| } | |||
| public void setStatus(Integer _status) { | |||
| status = _status; | |||
| } | |||
| public String getContractNumber() { | |||
| return contractNumber; | |||
| } | |||
| public void setContractNumber(String _contractNumber) { | |||
| contractNumber = _contractNumber; | |||
| } | |||
| public Integer getDeposit() { | |||
| return deposit; | |||
| } | |||
| public void setDeposit(Integer _deposit) { | |||
| deposit = _deposit; | |||
| } | |||
| public Integer getPayDate() { | |||
| return payDate; | |||
| } | |||
| public void setPayDate(Integer _payDate) { | |||
| payDate = _payDate; | |||
| } | |||
| public Integer getIsDel() { | |||
| return isDel; | |||
| } | |||
| public void setIsDel(Integer _isDel) { | |||
| isDel = _isDel; | |||
| } | |||
| public String getMerchantName() { | |||
| return merchantName; | |||
| } | |||
| public void setMerchantName(String _merchantName) { | |||
| merchantName = _merchantName; | |||
| } | |||
| public String getBrand() { | |||
| return brand; | |||
| } | |||
| public void setBrand(String _brand) { | |||
| brand = _brand; | |||
| } | |||
| public Long getBusinessId() { | |||
| return businessId; | |||
| } | |||
| public void setBusinessId(Long _businessId) { | |||
| businessId = _businessId; | |||
| } | |||
| public Integer getShopType() { | |||
| return shopType; | |||
| } | |||
| public void setShopType(Integer _shopType) { | |||
| shopType = _shopType; | |||
| } | |||
| public Long getShopId() { | |||
| return shopId; | |||
| } | |||
| public void setShopId(Long _shopId) { | |||
| shopId = _shopId; | |||
| } | |||
| public Date getUpdatetime() { | |||
| return updatetime; | |||
| } | |||
| public void setUpdatetime(Date _updatetime) { | |||
| updatetime = _updatetime; | |||
| } | |||
| public Date getCreatetime() { | |||
| return createtime; | |||
| } | |||
| public void setCreatetime(Date _createtime) { | |||
| createtime = _createtime; | |||
| } | |||
| public String getRentArea() { | |||
| return rentArea; | |||
| } | |||
| public void setRentArea(String _rentArea) { | |||
| rentArea = _rentArea; | |||
| } | |||
| public String getLinkPerson() { | |||
| return linkPerson; | |||
| } | |||
| public void setLinkPerson(String _linkPerson) { | |||
| linkPerson = _linkPerson; | |||
| } | |||
| public String getLinkPhone() { | |||
| return linkPhone; | |||
| } | |||
| public void setLinkPhone(String _linkPhone) { | |||
| linkPhone = _linkPhone; | |||
| } | |||
| public String getPayAccount() { | |||
| return payAccount; | |||
| } | |||
| public void setPayAccount(String _payAccount) { | |||
| payAccount = _payAccount; | |||
| } | |||
| public String getFilename() { | |||
| return filename; | |||
| } | |||
| public void setFilename(String _filename) { | |||
| filename = _filename; | |||
| } | |||
| public Integer getLease() { | |||
| return lease; | |||
| } | |||
| public void setLease(Integer _lease) { | |||
| lease = _lease; | |||
| } | |||
| public Long getRentContractId() { | |||
| return rentContractId; | |||
| } | |||
| public void setRentContractId(Long _rentContractId) { | |||
| rentContractId = _rentContractId; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC") | |||
| ,Price_ASC("`price` ASC"),Price_DESC("`price` DESC") | |||
| ,RentalStartDate_ASC("`rentalStartDate` ASC"),RentalStartDate_DESC("`rentalStartDate` DESC") | |||
| ,RentalEndDate_ASC("`rentalEndDate` ASC"),RentalEndDate_DESC("`rentalEndDate` DESC") | |||
| ,SignDate_ASC("`signDate` ASC"),SignDate_DESC("`signDate` DESC") | |||
| ,ReceivePeriod_ASC("`receivePeriod` ASC"),ReceivePeriod_DESC("`receivePeriod` DESC") | |||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||
| ,Filepath_ASC("`filepath` ASC"),Filepath_DESC("`filepath` DESC") | |||
| ,Status_ASC("`status` ASC"),Status_DESC("`status` DESC") | |||
| ,ContractNumber_ASC("`contractNumber` ASC"),ContractNumber_DESC("`contractNumber` DESC") | |||
| ,Deposit_ASC("`deposit` ASC"),Deposit_DESC("`deposit` DESC") | |||
| ,PayDate_ASC("`payDate` ASC"),PayDate_DESC("`payDate` DESC") | |||
| ,IsDel_ASC("`isDel` ASC"),IsDel_DESC("`isDel` DESC") | |||
| ,MerchantName_ASC("`merchantName` ASC"),MerchantName_DESC("`merchantName` DESC") | |||
| ,Brand_ASC("`brand` ASC"),Brand_DESC("`brand` DESC") | |||
| ,BusinessId_ASC("`businessId` ASC"),BusinessId_DESC("`businessId` DESC") | |||
| ,ShopType_ASC("`shopType` ASC"),ShopType_DESC("`shopType` DESC") | |||
| ,ShopId_ASC("`shopId` ASC"),ShopId_DESC("`shopId` DESC") | |||
| ,Updatetime_ASC("`updatetime` ASC"),Updatetime_DESC("`updatetime` DESC") | |||
| ,Createtime_ASC("`createtime` ASC"),Createtime_DESC("`createtime` DESC") | |||
| ,RentArea_ASC("`rentArea` ASC"),RentArea_DESC("`rentArea` DESC") | |||
| ,LinkPerson_ASC("`linkPerson` ASC"),LinkPerson_DESC("`linkPerson` DESC") | |||
| ,LinkPhone_ASC("`linkPhone` ASC"),LinkPhone_DESC("`linkPhone` DESC") | |||
| ,PayAccount_ASC("`payAccount` ASC"),PayAccount_DESC("`payAccount` DESC") | |||
| ,Filename_ASC("`filename` ASC"),Filename_DESC("`filename` DESC") | |||
| ,Lease_ASC("`lease` ASC"),Lease_DESC("`lease` DESC") | |||
| ,RentContractId_ASC("`rentContractId` ASC"),RentContractId_DESC("`rentContractId` DESC") | |||
| ; | |||
| private String value; | |||
| Field(String value){ | |||
| this.value = value; | |||
| } | |||
| public String getValue() { | |||
| return value; | |||
| } | |||
| public void setCol(String value) { | |||
| this.value = value; | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return this.getValue(); | |||
| } | |||
| } | |||
| public void setSortColumns(Field... fields) | |||
| { | |||
| if (fields == null || fields.length == 0) { | |||
| return; | |||
| } | |||
| for (int k = 0; k < fields.length; k++) { | |||
| if (fields[k] == null) { | |||
| return; | |||
| } | |||
| } | |||
| StringBuilder sb = new StringBuilder(fields[0].toString()); | |||
| for (int k = 1; k < fields.length; k++) { | |||
| sb.append(","); | |||
| sb.append(fields[k].toString()); | |||
| } | |||
| } | |||
| public void setSortColumns(String sortColumns) | |||
| { | |||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||
| return; | |||
| } | |||
| if (sortColumns.contains(",")) { | |||
| String[] cols = sortColumns.split(","); | |||
| List<Field> fList = new ArrayList(); | |||
| for (int k = 0; k < cols.length; k++) { | |||
| fList.add(Field.valueOf(cols[k])); | |||
| } | |||
| this.setSortColumns(fList.toArray(new Field[fList.size()])); | |||
| } else { | |||
| this.setSortColumns(Field.valueOf(sortColumns)); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,27 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxBillPropertyDeposit; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| public interface WxBillPropertyDepositMapper extends CommonMapper<WxBillPropertyDeposit, String> { | |||
| List<WxBillPropertyDeposit> findList(WxBillPropertyDeposit wxBillPropertyDeposit); | |||
| List<Map<String,Object>> queryBillDepositList(WxBillPropertyDeposit record); | |||
| Map<String,Object> queryPayInfo(Map<String,Object> params); | |||
| void updateNotPaidStatus(Map<String,Object> params); | |||
| void updateWaitPayStatus(Map<String,Object> params); | |||
| } | |||
| @@ -0,0 +1,27 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxBillProperty; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| public interface WxBillPropertyMapper extends CommonMapper<WxBillProperty, String> { | |||
| List<WxBillProperty> findList(WxBillProperty wxBillProperty); | |||
| List<Map<String,Object>> queryBillRentList(WxBillProperty record); | |||
| Map<String,Object> queryPayInfo(Map<String,Object> params); | |||
| void updateNotPaidStatus(Map<String,Object> params); | |||
| void updateWaitPayStatus(Map<String,Object> params); | |||
| } | |||
| @@ -0,0 +1,41 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| public interface WxPropertyContractMapper extends CommonMapper<WxPropertyContract, String> { | |||
| List<WxPropertyContract> findList(WxPropertyContract wxPropertyContract); | |||
| List<Map<String,Object>> queryRentContractData(WxPropertyContract wxRentContract); | |||
| int queryRentContractWaitSignStatus(WxPropertyContract wxRentContract); | |||
| int queryRentContractEndSoonStatus(WxPropertyContract wxRentContract); | |||
| int queryRentContractPaidStatus(WxPropertyContract wxRentContract); | |||
| int queryRentContractEndStatus(WxPropertyContract wxRentContract); | |||
| int updateRentContractEndSoonStatus(WxPropertyContract wxRentContract); | |||
| int updateRentContractPaidStatus(WxPropertyContract wxRentContract); | |||
| int updateRentContractEndStatus(WxPropertyContract wxRentContract); | |||
| void updateRentWaitSignStatus(WxPropertyContract wxRentContract); | |||
| void updateRentInvalidStatus(WxPropertyContract wxRentContract); | |||
| List<WxPropertyContract> getRentContractList(String tenantId); | |||
| } | |||
| @@ -0,0 +1,57 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxBillDeposit; | |||
| import com.iformall.domain.po.WxBillPropertyDeposit; | |||
| import java.util.Map; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| public interface WxBillPropertyDepositService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param offset | |||
| * @param limit | |||
| * @param record | |||
| * @return | |||
| */ | |||
| PageInfo<Map<String, Object>> listAsPage(WxBillPropertyDeposit record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| Map<String, Object> getById(Long id); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| ResultData saveOrUpdate(WxBillPropertyDeposit record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| * | |||
| * @param id | |||
| */ | |||
| void deleteById(Long id); | |||
| ResultData updatePaid(Long id); | |||
| } | |||
| @@ -0,0 +1,56 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxBillProperty; | |||
| import com.iformall.domain.po.WxBillRent; | |||
| import java.util.Map; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| public interface WxBillPropertyService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param offset | |||
| * @param limit | |||
| * @param record | |||
| * @return | |||
| */ | |||
| PageInfo<Map<String, Object>> listAsPage(WxBillProperty record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| Map<String, Object> getById(Long id); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| ResultData saveOrUpdate(WxBillProperty record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| * | |||
| * @param id | |||
| */ | |||
| void deleteById(Long id); | |||
| Object findByMerchantId(Long id); | |||
| ResultData updatePaid(Long id); | |||
| } | |||
| @@ -0,0 +1,62 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.util.Map; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| public interface WxPropertyContractService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param offset | |||
| * @param limit | |||
| * @return | |||
| */ | |||
| Map<String, Object> listAsPage(WxPropertyContract record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| WxPropertyContract getById(Long id); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| ResultData saveOrUpdate(WxPropertyContract record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| * | |||
| * @param id | |||
| */ | |||
| void deleteById(Long id); | |||
| void download(HttpServletRequest request, HttpServletResponse response, String tenantId); | |||
| Object getRentContractStatusInfo(String tenantId); | |||
| ResultData endRentContract(Long id); | |||
| Object getRentContractList(String tenantId); | |||
| } | |||
| @@ -0,0 +1,144 @@ | |||
| package com.iformall.service.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxBillDeposit; | |||
| import com.iformall.domain.po.WxBillPropertyDeposit; | |||
| import com.iformall.enums.EnumBillRentStatus; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxBillPropertyDepositMapper; | |||
| import com.iformall.service.WxBillPropertyDepositService; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import org.springframework.transaction.annotation.Transactional; | |||
| import java.util.*; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @Service | |||
| public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxBillPropertyDepositMapper wxBillPropertyDepositMapper; | |||
| @Override | |||
| public PageInfo<Map<String, Object>> listAsPage(WxBillPropertyDeposit record, Integer pageIndex, Integer pageSize) { | |||
| //更新逾期天数及状态 | |||
| updateNotPaidStatus(record); | |||
| //更新待缴的状态 | |||
| updateWaidPayStatus(record); | |||
| PageHelper.startPage(pageIndex, pageSize); | |||
| List<Map<String, Object>> billDepositList = wxBillPropertyDepositMapper.queryBillDepositList(record); | |||
| PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(billDepositList); | |||
| return pageInfo; | |||
| } | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| public void updateWaidPayStatus(WxBillPropertyDeposit record) { | |||
| Map<String, Object> params = new HashMap<>(); | |||
| params.put("tenantId", record.getTenantId()); | |||
| params.put("waitPay", EnumBillRentStatus.WAIT_PAY.getCode()); | |||
| params.put("paid", EnumBillRentStatus.PAID.getCode()); | |||
| try { | |||
| wxBillPropertyDepositMapper.updateWaitPayStatus(params); | |||
| } catch (Exception e) { | |||
| logger.error("更新物业待缴账单状态失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| } | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| public void updateNotPaidStatus(WxBillPropertyDeposit record) { | |||
| Map<String, Object> params = new HashMap<>(); | |||
| params.put("tenantId", record.getTenantId()); | |||
| params.put("notPaid", EnumBillRentStatus.NOT_PAID.getCode()); | |||
| params.put("paid", EnumBillRentStatus.PAID.getCode()); | |||
| try { | |||
| wxBillPropertyDepositMapper.updateNotPaidStatus(params); | |||
| } catch (Exception e) { | |||
| logger.error("更新物业欠缴账单状态失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| } | |||
| @Override | |||
| public Map<String, Object> getById(Long id) { | |||
| WxBillPropertyDeposit record = new WxBillPropertyDeposit(); | |||
| record.setId(id); | |||
| return wxBillPropertyDepositMapper.queryBillDepositList(record).get(0); | |||
| } | |||
| @Override | |||
| public ResultData saveOrUpdate(WxBillPropertyDeposit record) { | |||
| if (record.getId() == null) { | |||
| logger.info("新增物业押金账单"); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| Date date = new Date(); | |||
| record.setCreatetime(date); | |||
| record.setUpdatetime(date); | |||
| try { | |||
| wxBillPropertyDepositMapper.insertSelective(record); | |||
| } catch (Exception e) { | |||
| logger.error("保存物业押金账单失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| return new ResultData(Result.SUCCESS, "保存物业押金账单成功"); | |||
| } else { | |||
| logger.info("更新押金账单"); | |||
| WxBillPropertyDeposit wxBillDeposit = wxBillPropertyDepositMapper.selectByPrimaryKey(record.getId()); | |||
| wxBillDeposit.setPayDate(record.getPayDate()); | |||
| wxBillDeposit.setPay(record.getPay()*100); | |||
| wxBillDeposit.setReceivePay(record.getReceivePay()*100); | |||
| wxBillDeposit.setOwe(record.getOwe()*100); | |||
| wxBillDeposit.setStatus(record.getPay().equals(record.getReceivePay())?EnumBillRentStatus.PAID.getCode():wxBillDeposit.getStatus()); | |||
| wxBillDeposit.setUpdatetime(new Date()); | |||
| try { | |||
| wxBillPropertyDepositMapper.updateByPrimaryKeySelective(wxBillDeposit); | |||
| } catch (Exception e) { | |||
| logger.error("更新物业押金账单失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| return new ResultData(Result.SUCCESS, "更新物业押金账单成功"); | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| wxBillPropertyDepositMapper.deleteByPrimaryKey(id); | |||
| } | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| @Override | |||
| public ResultData updatePaid(Long id) { | |||
| WxBillPropertyDeposit wxBillDeposit = wxBillPropertyDepositMapper.selectByPrimaryKey(id); | |||
| wxBillDeposit.setStatus(EnumBillRentStatus.PAID.getCode()); | |||
| try { | |||
| wxBillPropertyDepositMapper.updateByPrimaryKeySelective(wxBillDeposit); | |||
| } catch (Exception e) { | |||
| logger.error("物业押金结单失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| return new ResultData(Result.SUCCESS, "物业押金结单成功"); | |||
| } | |||
| } | |||
| @@ -0,0 +1,148 @@ | |||
| package com.iformall.service.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxBillProperty; | |||
| import com.iformall.domain.po.WxBillPropertyDeposit; | |||
| import com.iformall.domain.po.WxBillRent; | |||
| import com.iformall.enums.EnumBillRentStatus; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxBillPropertyMapper; | |||
| import com.iformall.service.WxBillPropertyService; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import org.springframework.transaction.annotation.Transactional; | |||
| import java.util.*; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @Service | |||
| public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxBillPropertyMapper wxBillPropertyMapper; | |||
| @Override | |||
| public PageInfo<Map<String, Object>> listAsPage(WxBillProperty record, Integer pageIndex, Integer pageSize) { | |||
| //更新逾期天数及状态 | |||
| updateNotPaidStatus(record); | |||
| //更新待缴的状态 | |||
| updateWaidPayStatus(record); | |||
| PageHelper.startPage(pageIndex, pageSize); | |||
| List<Map<String, Object>> billRentList = wxBillPropertyMapper.queryBillRentList(record); | |||
| PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(billRentList); | |||
| return pageInfo; | |||
| } | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| public void updateWaidPayStatus(WxBillProperty record) { | |||
| Map<String, Object> params = new HashMap<>(); | |||
| params.put("tenantId", record.getTenantId()); | |||
| params.put("waitPay", EnumBillRentStatus.WAIT_PAY.getCode()); | |||
| params.put("paid", EnumBillRentStatus.PAID.getCode()); | |||
| try { | |||
| wxBillPropertyMapper.updateWaitPayStatus(params); | |||
| } catch (Exception e) { | |||
| logger.error("更新物业待缴账单状态失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| } | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| public void updateNotPaidStatus(WxBillProperty record) { | |||
| Map<String, Object> params = new HashMap<>(); | |||
| params.put("tenantId", record.getTenantId()); | |||
| params.put("notPaid", EnumBillRentStatus.NOT_PAID.getCode()); | |||
| params.put("paid", EnumBillRentStatus.PAID.getCode()); | |||
| try { | |||
| wxBillPropertyMapper.updateNotPaidStatus(params); | |||
| } catch (Exception e) { | |||
| logger.error("更新物业欠缴账单状态失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| } | |||
| @Override | |||
| public Map<String, Object> getById(Long id) { | |||
| WxBillProperty record = new WxBillProperty(); | |||
| record.setId(id); | |||
| return wxBillPropertyMapper.queryBillRentList(record).get(0); | |||
| } | |||
| @Override | |||
| public ResultData saveOrUpdate(WxBillProperty record) { | |||
| if (record.getId() == null) { | |||
| logger.info("新增物业账单"); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| Date date = new Date(); | |||
| record.setCreatetime(date); | |||
| record.setUpdatetime(date); | |||
| try { | |||
| wxBillPropertyMapper.insertSelective(record); | |||
| } catch (Exception e) { | |||
| logger.error("保存物业账单失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| return new ResultData(Result.SUCCESS, "保存物业账单成功"); | |||
| } else { | |||
| logger.info("更新物业账单"); | |||
| WxBillProperty wxBillRent = wxBillPropertyMapper.selectByPrimaryKey(record.getId()); | |||
| wxBillRent.setPayDate(record.getPayDate()); | |||
| wxBillRent.setPay(record.getPay()*100); | |||
| wxBillRent.setReceivePay(record.getReceivePay()*100); | |||
| wxBillRent.setOwe(record.getOwe()*100); | |||
| wxBillRent.setStatus(record.getPay().equals(record.getReceivePay())?EnumBillRentStatus.PAID.getCode():wxBillRent.getStatus()); | |||
| wxBillRent.setUpdatetime(new Date()); | |||
| try { | |||
| wxBillPropertyMapper.updateByPrimaryKeySelective(wxBillRent); | |||
| } catch (Exception e) { | |||
| logger.error("更新物业账单失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| return new ResultData(Result.SUCCESS, "更新物业账单成功"); | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| wxBillPropertyMapper.deleteByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public Object findByMerchantId(Long id) { | |||
| WxBillProperty record = new WxBillProperty(); | |||
| record.setMerchantId(id); | |||
| return wxBillPropertyMapper.queryBillRentList(record); | |||
| } | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| @Override | |||
| public ResultData updatePaid(Long id) { | |||
| WxBillProperty wxBillRent = wxBillPropertyMapper.selectByPrimaryKey(id); | |||
| wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode()); | |||
| try { | |||
| wxBillPropertyMapper.updateByPrimaryKeySelective(wxBillRent); | |||
| } catch (Exception e) { | |||
| logger.error("结单失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| return new ResultData(Result.SUCCESS, "结单成功"); | |||
| } | |||
| } | |||
| @@ -0,0 +1,383 @@ | |||
| package com.iformall.service.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.enums.EnumBillRentStatus; | |||
| import com.iformall.enums.EnumRentContractStatus; | |||
| import com.iformall.enums.EnumShopStatus; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxBillPropertyDepositMapper; | |||
| import com.iformall.mapper.WxBillPropertyMapper; | |||
| import com.iformall.mapper.WxPropertyContractMapper; | |||
| import com.iformall.mapper.WxShopMapper; | |||
| import com.iformall.service.WxPropertyContractService; | |||
| import com.iformall.utils.Constant; | |||
| import org.apache.shiro.SecurityUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import org.springframework.transaction.annotation.Transactional; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.io.*; | |||
| import java.net.HttpURLConnection; | |||
| import java.net.URL; | |||
| import java.util.*; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @Service | |||
| public class WxPropertyContractServiceImpl implements WxPropertyContractService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxPropertyContractMapper wxPropertyContractMapper; | |||
| @Autowired | |||
| WxShopMapper wxShopMapper; | |||
| @Autowired | |||
| WxBillPropertyMapper wxBillPropertyMapper; | |||
| @Autowired | |||
| WxBillPropertyDepositMapper wxBillPropertyDepositMapper; | |||
| @Override | |||
| public Map<String, Object> listAsPage(WxPropertyContract record, Integer pageIndex, Integer pageSize) { | |||
| Object rentContractStatusInfo = getRentContractStatusInfo(record.getTenantId()); | |||
| PageHelper.startPage(pageIndex, pageSize); | |||
| List<Map<String, Object>> rentContractData = wxPropertyContractMapper.queryRentContractData(record); | |||
| PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(rentContractData); | |||
| Map<String, Object> result = new HashMap<>(); | |||
| result.put("rentContractStatusInfo", rentContractStatusInfo); | |||
| result.put("pageInfo", pageInfo); | |||
| return result; | |||
| } | |||
| @Override | |||
| public WxPropertyContract getById(Long id) { | |||
| return wxPropertyContractMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public ResultData saveOrUpdate(WxPropertyContract record) { | |||
| return null; | |||
| } | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| public void buildDeposit(WxMerchant wxMerchant) { | |||
| MallUserInfo user = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute("userSession"); | |||
| WxPropertyContract wxPropertyContract = new WxPropertyContract(); | |||
| wxPropertyContract.setMerchantId(wxMerchant.getId()); | |||
| List<WxPropertyContract> list = wxPropertyContractMapper.findList(wxPropertyContract); | |||
| if (list.size() > 0) { | |||
| wxPropertyContract = list.get(0); | |||
| Integer receivePeriod = wxPropertyContract.getReceivePeriod(); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| WxBillPropertyDeposit wxBillDeposit = new WxBillPropertyDeposit(); | |||
| wxBillDeposit.setId(idWorker.nextId()); | |||
| wxBillDeposit.setRentContractId(wxPropertyContract.getId()); | |||
| wxBillDeposit.setReceivePay(0); | |||
| wxBillDeposit.setPay(0); | |||
| int needpay = wxPropertyContract.getDeposit(); | |||
| wxBillDeposit.setNeedPay(needpay); | |||
| wxBillDeposit.setOwe(needpay); | |||
| Date date = new Date(); | |||
| Calendar instance = Calendar.getInstance(); | |||
| instance.setTime(wxPropertyContract.getRentalStartDate()); | |||
| instance.add(Calendar.MONTH, receivePeriod.intValue()); | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| Date time = instance.getTime(); | |||
| wxBillDeposit.setReceiveDate(time); | |||
| //截止收租日在当前时间之前 | |||
| if (wxBillDeposit.getReceiveDate().before(date)) { | |||
| long day = (time.getTime() - date.getTime()) / (24 * 60 * 60 * 1000); | |||
| wxBillDeposit.setStatus(EnumBillRentStatus.NOT_PAID.getCode()); | |||
| wxBillDeposit.setExpiredDay(day); | |||
| wxBillDeposit.setReceiveDate(time); | |||
| } else { | |||
| wxBillDeposit.setStatus(EnumBillRentStatus.WAIT_PAY.getCode()); | |||
| wxBillDeposit.setExpiredDay(0L); | |||
| wxBillDeposit.setReceiveDate(time); | |||
| } | |||
| wxBillDeposit.setTenantId(wxMerchant.getTenantId()); | |||
| wxBillDeposit.setIsDel(0); | |||
| wxBillDeposit.setMerchantId(wxMerchant.getId()); | |||
| wxBillDeposit.setUserId(user.getId()); | |||
| wxBillDeposit.setShopId(wxPropertyContract.getShopId()); | |||
| wxBillDeposit.setCreatetime(date); | |||
| wxBillDeposit.setUpdatetime(date); | |||
| try { | |||
| wxBillPropertyDepositMapper.insertSelective(wxBillDeposit); | |||
| } catch (Exception e) { | |||
| logger.error("添加押金账单失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| } | |||
| } | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| public void buildRent(WxMerchant wxMerchant) { | |||
| //获取用户 | |||
| MallUserInfo user = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute("userSession"); | |||
| //根据商户ID找出合同 | |||
| WxPropertyContract wxPropertyContract = new WxPropertyContract(); | |||
| wxPropertyContract.setMerchantId(wxMerchant.getId()); | |||
| List<WxPropertyContract> list = wxPropertyContractMapper.findList(wxPropertyContract); | |||
| if (list.size() > 0) { | |||
| wxPropertyContract = list.get(0); | |||
| Integer receivePeriod = wxPropertyContract.getReceivePeriod(); | |||
| int paycount = 12 / receivePeriod.intValue(); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| for (int i = 0; i < paycount; i++) { | |||
| WxBillProperty wxBillRent = new WxBillProperty(); | |||
| wxBillRent.setId(idWorker.nextId()); | |||
| wxBillRent.setRentContractId(wxPropertyContract.getId()); | |||
| wxBillRent.setReceivePay(0); | |||
| wxBillRent.setPay(0); | |||
| int needpay = wxPropertyContract.getPrice(); | |||
| wxBillRent.setNeedPay(needpay); | |||
| wxBillRent.setOwe(needpay); | |||
| Date date = new Date(); | |||
| Calendar instance = Calendar.getInstance(); | |||
| instance.setTime(wxPropertyContract.getRentalStartDate()); | |||
| instance.add(Calendar.MONTH, receivePeriod.intValue() * i); | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| Date time = instance.getTime(); | |||
| wxBillRent.setReceiveDate(time); | |||
| //截止收租日在当前时间之前 | |||
| if (wxBillRent.getReceiveDate().before(date)) { | |||
| long day = (time.getTime() - date.getTime()) / (24 * 60 * 60 * 1000); | |||
| wxBillRent.setStatus(EnumBillRentStatus.NOT_PAID.getCode()); | |||
| wxBillRent.setExpiredDay(day); | |||
| wxBillRent.setReceiveDate(time); | |||
| } else {//截止收租日在当前时间之后 | |||
| Calendar now = Calendar.getInstance(); | |||
| now.add(Calendar.MONTH, receivePeriod.intValue()); | |||
| Date currenttime = now.getTime(); | |||
| //当前日期加上周期后小于截止收租日就是没有到期,否则当前待缴 | |||
| if (currenttime.before(wxBillRent.getReceiveDate())) { | |||
| wxBillRent.setStatus(EnumBillRentStatus.NOT_EXPIRED.getCode()); | |||
| wxBillRent.setExpiredDay(0L); | |||
| wxBillRent.setReceiveDate(time); | |||
| } else { | |||
| wxBillRent.setStatus(EnumBillRentStatus.WAIT_PAY.getCode()); | |||
| wxBillRent.setExpiredDay(0L); | |||
| wxBillRent.setReceiveDate(time); | |||
| } | |||
| } | |||
| wxBillRent.setTenantId(wxMerchant.getTenantId()); | |||
| wxBillRent.setIsDel(0); | |||
| wxBillRent.setMerchantId(wxMerchant.getId()); | |||
| wxBillRent.setUserId(user.getId()); | |||
| wxBillRent.setShopId(wxPropertyContract.getShopId()); | |||
| wxBillRent.setCreatetime(date); | |||
| wxBillRent.setUpdatetime(date); | |||
| try { | |||
| wxBillPropertyMapper.insertSelective(wxBillRent); | |||
| } catch (Exception e) { | |||
| logger.error("添加租赁账单失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| wxPropertyContractMapper.deleteByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public void download(HttpServletRequest request, HttpServletResponse response, String tenantId) { | |||
| String id = request.getParameter("id"); | |||
| WxPropertyContract wxPropertyContract = wxPropertyContractMapper.selectByPrimaryKey(id); | |||
| String filesuffix = wxPropertyContract.getFilepath().substring(wxPropertyContract.getFilepath().lastIndexOf(".")); | |||
| String filename = UUID.randomUUID() + filesuffix; | |||
| String filepath = Constant.fileDirectory; | |||
| String destPath = filepath + filename; | |||
| File dest = new File(destPath); | |||
| File pDest = dest.getParentFile(); | |||
| if (!pDest.exists()) { | |||
| pDest.mkdirs(); | |||
| } | |||
| try { | |||
| downLoadFromUrl(wxPropertyContract.getFilepath(), filename, filepath); | |||
| downFile(destPath, wxPropertyContract.getFilename(), response, request); | |||
| org.apache.commons.io.FileUtils.forceDelete(dest); | |||
| } catch (IOException e) { | |||
| logger.info("创建本地文件失败" + e.getMessage()); | |||
| } | |||
| } | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| @Override | |||
| public Object getRentContractStatusInfo(String tenantId) { | |||
| Map<String, Object> resultData = new HashMap(); | |||
| //商铺信息 | |||
| Map<String, Object> shopparams = new HashMap<>(); | |||
| shopparams.put("tenantId", tenantId); | |||
| shopparams.put("status", EnumShopStatus.NOT_RENT.getCode()); | |||
| Map<String, Object> shopLeftInfo = wxShopMapper.queryShopLeftInfo(shopparams); | |||
| resultData.put("shopLeftInfo", shopLeftInfo); | |||
| //需要更新的状态 | |||
| resultData.putAll(updateStatus(tenantId)); | |||
| return resultData; | |||
| } | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| @Override | |||
| public ResultData endRentContract(Long id) { | |||
| WxPropertyContract wxPropertyContract = wxPropertyContractMapper.selectByPrimaryKey(id); | |||
| wxPropertyContract.setStatus(EnumRentContractStatus.CONTRACT_TERMINATE.getCode()); | |||
| try { | |||
| wxPropertyContractMapper.updateByPrimaryKeySelective(wxPropertyContract); | |||
| //停用商户 | |||
| // wxMerchantService.disable(wxRentContract.getMerchantId()); | |||
| } catch (MallinkException e) { | |||
| logger.info("终止合同失败:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| return new ResultData(Result.SUCCESS, "操作成功"); | |||
| } | |||
| @Override | |||
| public Object getRentContractList(String tenantId) { | |||
| return wxPropertyContractMapper.getRentContractList(tenantId); | |||
| } | |||
| public Map<String, Object> updateStatus(String tenantId) { | |||
| Map<String, Object> resultData = new HashMap(); | |||
| WxPropertyContract wxRentContract = new WxPropertyContract(); | |||
| wxRentContract.setTenantId(tenantId); | |||
| //作废合同 | |||
| wxRentContract.setStatus(EnumRentContractStatus.INVALID.getCode()); | |||
| wxPropertyContractMapper.updateRentInvalidStatus(wxRentContract); | |||
| //待签约 | |||
| wxRentContract.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode()); | |||
| wxPropertyContractMapper.updateRentWaitSignStatus(wxRentContract); | |||
| int waitSignCount = wxPropertyContractMapper.queryRentContractWaitSignStatus(wxRentContract); | |||
| resultData.put("waitSignCount", waitSignCount); | |||
| //计租中 | |||
| wxRentContract.setStatus(EnumRentContractStatus.RENT_PAID.getCode()); | |||
| int rendPaidCount = wxPropertyContractMapper.queryRentContractPaidStatus(wxRentContract); | |||
| wxPropertyContractMapper.updateRentContractPaidStatus(wxRentContract); | |||
| resultData.put("rendPaidCount", rendPaidCount); | |||
| //将到期 | |||
| wxRentContract.setStatus(EnumRentContractStatus.CONTRACT_END_SOON.getCode()); | |||
| int endSoonCount = wxPropertyContractMapper.queryRentContractEndSoonStatus(wxRentContract); | |||
| wxPropertyContractMapper.updateRentContractEndSoonStatus(wxRentContract); | |||
| resultData.put("endSoonCount", endSoonCount); | |||
| //到期 | |||
| wxRentContract.setStatus(EnumRentContractStatus.CONTRACT_END.getCode()); | |||
| int endCount = wxPropertyContractMapper.queryRentContractEndStatus(wxRentContract); | |||
| wxPropertyContractMapper.updateRentContractEndStatus(wxRentContract); | |||
| resultData.put("endCount", endCount); | |||
| return resultData; | |||
| } | |||
| public static void downLoadFromUrl(String urlStr, String fileName, String savePath) throws IOException { | |||
| URL url = new URL(urlStr); | |||
| HttpURLConnection conn = (HttpURLConnection) url.openConnection(); | |||
| //设置超时间为3秒 | |||
| conn.setConnectTimeout(3 * 1000); | |||
| //防止屏蔽程序抓取而返回403错误 | |||
| conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)"); | |||
| //得到输入流 | |||
| InputStream inputStream = conn.getInputStream(); | |||
| //获取自己数组 | |||
| byte[] getData = readInputStream(inputStream); | |||
| //文件保存位置 | |||
| File saveDir = new File(savePath); | |||
| if (!saveDir.exists()) { | |||
| saveDir.mkdir(); | |||
| } | |||
| File file = new File(saveDir + File.separator + fileName); | |||
| FileOutputStream fos = new FileOutputStream(file); | |||
| fos.write(getData); | |||
| if (fos != null) { | |||
| fos.close(); | |||
| } | |||
| if (inputStream != null) { | |||
| inputStream.close(); | |||
| } | |||
| System.out.println("info:" + url + " download success"); | |||
| } | |||
| public static byte[] readInputStream(InputStream inputStream) throws IOException { | |||
| byte[] buffer = new byte[1024]; | |||
| int len = 0; | |||
| ByteArrayOutputStream bos = new ByteArrayOutputStream(); | |||
| while ((len = inputStream.read(buffer)) != -1) { | |||
| bos.write(buffer, 0, len); | |||
| } | |||
| bos.close(); | |||
| return bos.toByteArray(); | |||
| } | |||
| public void downFile(String filePath, String filename, HttpServletResponse response, | |||
| HttpServletRequest req) { | |||
| try { | |||
| response.reset(); | |||
| response.setContentType("bin"); | |||
| String agent = req.getHeader("user-agent"); | |||
| if (agent.contains("Firefox")) { | |||
| response.setHeader("Content-disposition", "attachment; filename=" + new String(filename.getBytes("GB2312"), "ISO-8859-1")); | |||
| } else { | |||
| response.setHeader("Content-disposition", "attachment; filename=" + java.net.URLEncoder.encode(filename, "UTF-8")); | |||
| } | |||
| // 循环取出流中的数据 | |||
| byte[] b = new byte[1024]; | |||
| int len; | |||
| InputStream inStream = new FileInputStream(filePath); | |||
| while ((len = inStream.read(b)) > 0) | |||
| response.getOutputStream().write(b, 0, len); | |||
| inStream.close(); | |||
| } catch (Exception e) { | |||
| logger.info("下载合同失败" + e.getMessage()); | |||
| e.printStackTrace(); | |||
| } | |||
| } | |||
| } | |||
| @@ -71,7 +71,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| Map<String, Object> result = new HashMap<>(); | |||
| WxRentContract wxRentContract = wxRentContractMapper.selectByPrimaryKey(id); | |||
| wxRentContract.setPrice(wxRentContract.getPrice() != null ? wxRentContract.getPrice() / 100 : 0); | |||
| wxRentContract.setDeposit(wxRentContract.getDeposit() != null ? wxRentContract.getDeposit() * 100 : 0); | |||
| wxRentContract.setDeposit(wxRentContract.getDeposit() != null ? wxRentContract.getDeposit() / 100 : 0); | |||
| result.put("wxRentContract", wxRentContract); | |||
| //关联的商户 | |||
| @@ -54,7 +54,7 @@ | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxBillDeposit" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_bill_deposit | |||
| select <include refid="allColumns" /> from wx_bill_rent_deposit | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| @@ -64,7 +64,7 @@ | |||
| br.`pay_date` payDate,br.`createtime`,br.`expired_day` expiredDay,br.`owe`,br.`status`, | |||
| br.`need_pay` needPay,m.`name` merchantName,s.shop_number shopNumber,br.`updatetime`, | |||
| br.`merchant_id` merchantId | |||
| from wx_bill_deposit br left join wx_merchant m on br.merchant_id=m.id | |||
| from wx_bill_rent_deposit br left join wx_merchant m on br.merchant_id=m.id | |||
| left join wx_shop s on br.shop_id=s.id | |||
| <where> | |||
| <if test=" null != id ">and br.`id` = #{id}</if> | |||
| @@ -79,19 +79,19 @@ | |||
| </select> | |||
| <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | |||
| select sum(receive_pay) receivepay,sum(pay) pay,tenant_id from wx_bill_deposit | |||
| select sum(receive_pay) receivepay,sum(pay) pay,tenant_id from wx_bill_rent_deposit | |||
| where tenant_id=#{tenantId} and date_format(receive_date,'%Y-%m')=#{receiveDate} | |||
| group by tenant_id | |||
| </select> | |||
| <update id="updateNotPaidStatus" parameterType="hashmap"> | |||
| update wx_bill_deposit set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date) | |||
| update wx_bill_rent_deposit set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date) | |||
| where tenant_id=#{tenantId} and status!=#{paid} and DATEDIFF(now(),receive_date)>0 | |||
| </update> | |||
| <update id="updateWaitPayStatus" parameterType="hashmap"> | |||
| update wx_bill_deposit set status=#{waitPay} where id in( | |||
| select a.id from (select br.id,rc.receive_period,br.rent_contract_id,br.receive_date from wx_bill_deposit br | |||
| update wx_bill_rent_deposit set status=#{waitPay} where id in( | |||
| select a.id from (select br.id,rc.receive_period,br.rent_contract_id,br.receive_date from wx_bill_rent_deposit br | |||
| left join wx_rent_contract rc on br.rent_contract_id=rc.id | |||
| where br.tenant_id=#{tenantId} and br.status!=#{paid} and now() < br.receive_date | |||
| and DATE_ADD(now(),INTERVAL 1 MONTH)>br.receive_date) a) | |||
| @@ -0,0 +1,102 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxBillPropertyDepositMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxBillPropertyDeposit"> | |||
| <id column="id" jdbcType="INTEGER" property="id" /> | |||
| <result column="rent_contract_id" jdbcType="INTEGER" property="rentContractId" /> | |||
| <result column="receive_pay" jdbcType="INTEGER" property="receivePay" /> | |||
| <result column="pay" jdbcType="INTEGER" property="pay" /> | |||
| <result column="receive_date" jdbcType="TIMESTAMP" property="receiveDate" /> | |||
| <result column="pay_date" jdbcType="TIMESTAMP" property="payDate" /> | |||
| <result column="createtime" jdbcType="TIMESTAMP" property="createtime" /> | |||
| <result column="expired_day" jdbcType="INTEGER" property="expiredDay" /> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||
| <result column="owe" jdbcType="INTEGER" property="owe" /> | |||
| <result column="status" jdbcType="INTEGER" property="status" /> | |||
| <result column="is_del" jdbcType="INTEGER" property="isDel" /> | |||
| <result column="need_pay" jdbcType="INTEGER" property="needPay" /> | |||
| <result column="merchant_id" jdbcType="INTEGER" property="merchantId" /> | |||
| <result column="user_id" jdbcType="INTEGER" property="userId" /> | |||
| <result column="shop_id" jdbcType="INTEGER" property="shopId" /> | |||
| <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`rent_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`,`tenant_id`,`owe`,`status`,`is_del`,`need_pay`,`merchant_id`,`user_id`,`shop_id`,`updatetime` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> and `id` = #{id} </if> | |||
| <if test=" null != rentContractId "> and `rent_contract_id` = #{rentContractId} </if> | |||
| <if test=" null != receivePay "> and `receive_pay` = #{receivePay} </if> | |||
| <if test=" null != pay "> and `pay` = #{pay} </if> | |||
| <if test=" null != receiveDate "> and `receive_date` = #{receiveDate} </if> | |||
| <if test=" null != payDate "> and `pay_date` = #{payDate} </if> | |||
| <if test=" null != createtime "> and `createtime` = #{createtime} </if> | |||
| <if test=" null != expiredDay "> and `expired_day` = #{expiredDay} </if> | |||
| <if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if> | |||
| <if test=" null != owe "> and `owe` = #{owe} </if> | |||
| <if test=" null != status "> and `status` = #{status} </if> | |||
| <if test=" null != isDel "> and `is_del` = #{isDel} </if> | |||
| <if test=" null != needPay "> and `need_pay` = #{needPay} </if> | |||
| <if test=" null != merchantId "> and `merchant_id` = #{merchantId} </if> | |||
| <if test=" null != userId "> and `user_id` = #{userId} </if> | |||
| <if test=" null != shopId "> and `shop_id` = #{shopId} </if> | |||
| <if test=" null != updatetime "> and `updatetime` = #{updatetime} </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxBillPropertyDeposit" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_bill_property_deposit | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <select id="queryBillDepositList" parameterType="com.iformall.domain.po.WxRentContract" resultType="hashmap"> | |||
| select br.`id`,br.`receive_pay` receivePay,br.`pay`,br.`receive_date` receiveDate, | |||
| br.`pay_date` payDate,br.`createtime`,br.`expired_day` expiredDay,br.`owe`,br.`status`, | |||
| br.`need_pay` needPay,m.`name` merchantName,s.shop_number shopNumber,br.`updatetime`, | |||
| br.`merchant_id` merchantId | |||
| from wx_bill_property_deposit br left join wx_merchant m on br.merchant_id=m.id | |||
| left join wx_shop s on br.shop_id=s.id | |||
| <where> | |||
| <if test=" null != id ">and br.`id` = #{id}</if> | |||
| <if test=" null != merchantId ">and br.`merchant_id` = #{merchantId}</if> | |||
| <if test=" null != merchantName and ''!=merchantName ">and m.`name` like concat('%',#{merchantName},'%')</if> | |||
| <if test=" null != tenantId ">and br.`tenant_id` = #{tenantId}</if> | |||
| <if test=" null != status ">and br.`status` = #{status}</if> | |||
| <if test=" null != isDel ">and br.`is_del` = #{isDel}</if> | |||
| </where> | |||
| order by id | |||
| </select> | |||
| <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | |||
| select sum(receive_pay) receivepay,sum(pay) pay,tenant_id from wx_bill_property_deposit | |||
| where tenant_id=#{tenantId} and date_format(receive_date,'%Y-%m')=#{receiveDate} | |||
| group by tenant_id | |||
| </select> | |||
| <update id="updateNotPaidStatus" parameterType="hashmap"> | |||
| update wx_bill_property_deposit set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date) | |||
| where tenant_id=#{tenantId} and status!=#{paid} and DATEDIFF(now(),receive_date)>0 | |||
| </update> | |||
| <update id="updateWaitPayStatus" parameterType="hashmap"> | |||
| update wx_bill_property_deposit set status=#{waitPay} where id in( | |||
| select a.id from (select br.id,rc.receive_period,br.rent_contract_id,br.receive_date from wx_bill_property_deposit br | |||
| left join wx_rent_contract rc on br.rent_contract_id=rc.id | |||
| where br.tenant_id=#{tenantId} and br.status!=#{paid} and now() < br.receive_date | |||
| and DATE_ADD(now(),INTERVAL 1 MONTH)>br.receive_date) a) | |||
| </update> | |||
| </mapper> | |||
| @@ -0,0 +1,102 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxBillPropertyMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxBillProperty"> | |||
| <id column="id" jdbcType="INTEGER" property="id" /> | |||
| <result column="rent_contract_id" jdbcType="INTEGER" property="rentContractId" /> | |||
| <result column="receive_pay" jdbcType="INTEGER" property="receivePay" /> | |||
| <result column="pay" jdbcType="INTEGER" property="pay" /> | |||
| <result column="receive_date" jdbcType="TIMESTAMP" property="receiveDate" /> | |||
| <result column="pay_date" jdbcType="TIMESTAMP" property="payDate" /> | |||
| <result column="createtime" jdbcType="TIMESTAMP" property="createtime" /> | |||
| <result column="expired_day" jdbcType="INTEGER" property="expiredDay" /> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||
| <result column="owe" jdbcType="INTEGER" property="owe" /> | |||
| <result column="status" jdbcType="INTEGER" property="status" /> | |||
| <result column="is_del" jdbcType="INTEGER" property="isDel" /> | |||
| <result column="need_pay" jdbcType="INTEGER" property="needPay" /> | |||
| <result column="merchant_id" jdbcType="INTEGER" property="merchantId" /> | |||
| <result column="user_id" jdbcType="INTEGER" property="userId" /> | |||
| <result column="shop_id" jdbcType="INTEGER" property="shopId" /> | |||
| <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`rent_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`,`tenant_id`,`owe`,`status`,`is_del`,`need_pay`,`merchant_id`,`user_id`,`shop_id`,`updatetime` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> and `id` = #{id} </if> | |||
| <if test=" null != rentContractId "> and `rent_contract_id` = #{rentContractId} </if> | |||
| <if test=" null != receivePay "> and `receive_pay` = #{receivePay} </if> | |||
| <if test=" null != pay "> and `pay` = #{pay} </if> | |||
| <if test=" null != receiveDate "> and `receive_date` = #{receiveDate} </if> | |||
| <if test=" null != payDate "> and `pay_date` = #{payDate} </if> | |||
| <if test=" null != createtime "> and `createtime` = #{createtime} </if> | |||
| <if test=" null != expiredDay "> and `expired_day` = #{expiredDay} </if> | |||
| <if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if> | |||
| <if test=" null != owe "> and `owe` = #{owe} </if> | |||
| <if test=" null != status "> and `status` = #{status} </if> | |||
| <if test=" null != isDel "> and `is_del` = #{isDel} </if> | |||
| <if test=" null != needPay "> and `need_pay` = #{needPay} </if> | |||
| <if test=" null != merchantId "> and `merchant_id` = #{merchantId} </if> | |||
| <if test=" null != userId "> and `user_id` = #{userId} </if> | |||
| <if test=" null != shopId "> and `shop_id` = #{shopId} </if> | |||
| <if test=" null != updatetime "> and `updatetime` = #{updatetime} </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxBillProperty" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_bill_property | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <select id="queryBillDepositList" parameterType="com.iformall.domain.po.WxRentContract" resultType="hashmap"> | |||
| select br.`id`,br.`receive_pay` receivePay,br.`pay`,br.`receive_date` receiveDate, | |||
| br.`pay_date` payDate,br.`createtime`,br.`expired_day` expiredDay,br.`owe`,br.`status`, | |||
| br.`need_pay` needPay,m.`name` merchantName,s.shop_number shopNumber,br.`updatetime`, | |||
| br.`merchant_id` merchantId | |||
| from wx_bill_property br left join wx_merchant m on br.merchant_id=m.id | |||
| left join wx_shop s on br.shop_id=s.id | |||
| <where> | |||
| <if test=" null != id ">and br.`id` = #{id}</if> | |||
| <if test=" null != merchantId ">and br.`merchant_id` = #{merchantId}</if> | |||
| <if test=" null != merchantName and ''!=merchantName ">and m.`name` like concat('%',#{merchantName},'%')</if> | |||
| <if test=" null != tenantId ">and br.`tenant_id` = #{tenantId}</if> | |||
| <if test=" null != status ">and br.`status` = #{status}</if> | |||
| <if test=" null != isDel ">and br.`is_del` = #{isDel}</if> | |||
| </where> | |||
| order by id | |||
| </select> | |||
| <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | |||
| select sum(receive_pay) receivepay,sum(pay) pay,tenant_id from wx_bill_property | |||
| where tenant_id=#{tenantId} and date_format(receive_date,'%Y-%m')=#{receiveDate} | |||
| group by tenant_id | |||
| </select> | |||
| <update id="updateNotPaidStatus" parameterType="hashmap"> | |||
| update wx_bill_property set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date) | |||
| where tenant_id=#{tenantId} and status!=#{paid} and DATEDIFF(now(),receive_date)>0 | |||
| </update> | |||
| <update id="updateWaitPayStatus" parameterType="hashmap"> | |||
| update wx_bill_property set status=#{waitPay} where id in( | |||
| select a.id from (select br.id,rc.receive_period,br.rent_contract_id,br.receive_date from wx_bill_property br | |||
| left join wx_rent_contract rc on br.rent_contract_id=rc.id | |||
| where br.tenant_id=#{tenantId} and br.status!=#{paid} and now() < br.receive_date | |||
| and DATE_ADD(now(),INTERVAL 1 MONTH)>br.receive_date) a) | |||
| </update> | |||
| </mapper> | |||
| @@ -0,0 +1,144 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxPropertyContractMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxPropertyContract"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="merchant_id" jdbcType="BIGINT" property="merchantId" /> | |||
| <result column="price" jdbcType="INTEGER" property="price" /> | |||
| <result column="rental_start_date" jdbcType="TIMESTAMP" property="rentalStartDate" /> | |||
| <result column="rental_end_date" jdbcType="TIMESTAMP" property="rentalEndDate" /> | |||
| <result column="sign_date" jdbcType="TIMESTAMP" property="signDate" /> | |||
| <result column="receive_period" jdbcType="INTEGER" property="receivePeriod" /> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||
| <result column="filepath" jdbcType="VARCHAR" property="filepath" /> | |||
| <result column="status" jdbcType="INTEGER" property="status" /> | |||
| <result column="contract_number" jdbcType="VARCHAR" property="contractNumber" /> | |||
| <result column="deposit" jdbcType="INTEGER" property="deposit" /> | |||
| <result column="pay_date" jdbcType="INTEGER" property="payDate" /> | |||
| <result column="is_del" jdbcType="INTEGER" property="isDel" /> | |||
| <result column="merchant_name" jdbcType="VARCHAR" property="merchantName" /> | |||
| <result column="brand" jdbcType="VARCHAR" property="brand" /> | |||
| <result column="business_id" jdbcType="BIGINT" property="businessId" /> | |||
| <result column="shop_type" jdbcType="INTEGER" property="shopType" /> | |||
| <result column="shop_id" jdbcType="BIGINT" property="shopId" /> | |||
| <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" /> | |||
| <result column="createtime" jdbcType="TIMESTAMP" property="createtime" /> | |||
| <result column="rent_area" jdbcType="VARCHAR" property="rentArea" /> | |||
| <result column="link_person" jdbcType="VARCHAR" property="linkPerson" /> | |||
| <result column="link_phone" jdbcType="VARCHAR" property="linkPhone" /> | |||
| <result column="pay_account" jdbcType="VARCHAR" property="payAccount" /> | |||
| <result column="filename" jdbcType="VARCHAR" property="filename" /> | |||
| <result column="lease" jdbcType="INTEGER" property="lease" /> | |||
| <result column="rent_contract_id" jdbcType="BIGINT" property="rentContractId" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`merchant_id`,`price`,`rental_start_date`,`rental_end_date`,`sign_date`,`receive_period`,`tenant_id`,`filepath`,`status`,`contract_number`,`deposit`,`pay_date`,`is_del`,`merchant_name`,`brand`,`business_id`,`shop_type`,`shop_id`,`updatetime`,`createtime`,`rent_area`,`link_person`,`link_phone`,`pay_account`,`filename`,`lease`,`rent_contract_id` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> and `id` = #{id} </if> | |||
| <if test=" null != merchantId "> and `merchant_id` = #{merchantId} </if> | |||
| <if test=" null != price "> and `price` = #{price} </if> | |||
| <if test=" null != rentalStartDate "> and `rental_start_date` = #{rentalStartDate} </if> | |||
| <if test=" null != rentalEndDate "> and `rental_end_date` = #{rentalEndDate} </if> | |||
| <if test=" null != signDate "> and `sign_date` = #{signDate} </if> | |||
| <if test=" null != receivePeriod "> and `receive_period` = #{receivePeriod} </if> | |||
| <if test=" null != tenantId "> and `tenant_id` = #{tenantId} </if> | |||
| <if test=" null != filepath "> and `filepath` = #{filepath} </if> | |||
| <if test=" null != status "> and `status` = #{status} </if> | |||
| <if test=" null != contractNumber "> and `contract_number` = #{contractNumber} </if> | |||
| <if test=" null != deposit "> and `deposit` = #{deposit} </if> | |||
| <if test=" null != payDate "> and `pay_date` = #{payDate} </if> | |||
| <if test=" null != isDel "> and `is_del` = #{isDel} </if> | |||
| <if test=" null != merchantName "> and `merchant_name` = #{merchantName} </if> | |||
| <if test=" null != brand "> and `brand` = #{brand} </if> | |||
| <if test=" null != businessId "> and `business_id` = #{businessId} </if> | |||
| <if test=" null != shopType "> and `shop_type` = #{shopType} </if> | |||
| <if test=" null != shopId "> and `shop_id` = #{shopId} </if> | |||
| <if test=" null != updatetime "> and `updatetime` = #{updatetime} </if> | |||
| <if test=" null != createtime "> and `createtime` = #{createtime} </if> | |||
| <if test=" null != rentArea "> and `rent_area` = #{rentArea} </if> | |||
| <if test=" null != linkPerson "> and `link_person` = #{linkPerson} </if> | |||
| <if test=" null != linkPhone "> and `link_phone` = #{linkPhone} </if> | |||
| <if test=" null != payAccount "> and `pay_account` = #{payAccount} </if> | |||
| <if test=" null != filename "> and `filename` = #{filename} </if> | |||
| <if test=" null != lease "> and `lease` = #{lease} </if> | |||
| <if test=" null != rentContractId "> and `rent_contract_id` = #{rentContractId} </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxPropertyContract" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_property_contract | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <select id="queryRentContractData" resultType="hashmap" parameterType="com.iformall.domain.po.WxRentContract"> | |||
| select rc.id,rc.merchant_name merchantName,rc.rental_start_date rentalStartDate,rc.rental_end_date rentalEndDate,rc.`status`, | |||
| rc.price,rc.contract_number contractNumber,s.shop_number shopNumber,f.floor_name floorName,b.building_name buildingName, | |||
| rc.lease,rc.filepath,rc.filename,rc.pay_account payAccount,rc.sign_date signDate | |||
| from wx_property_contract rc | |||
| left join wx_shop s on rc.shop_id=s.id | |||
| left join wx_mall_floor f on s.floor=f.id | |||
| left join wx_mall_building b on s.building=b.id | |||
| <where> | |||
| rc.tenant_id=#{tenantId} | |||
| <if test=" null != merchantName and merchantName!=''">and rc.`merchant_name` like concat('%',#{merchantName},'%')</if> | |||
| <if test=" null != shopNumber and shopNumber!=''">and s.`shop_number` like concat('%',#{shopNumber},'%')</if> | |||
| <if test=" null != status ">and rc.`status` = #{status}</if> | |||
| </where> | |||
| order by rc.id desc | |||
| </select> | |||
| <select id="queryRentContractWaitSignStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract"> | |||
| select count(id) from wx_property_contract where tenant_id=#{tenantId} and status=#{status} | |||
| </select> | |||
| <select id="queryRentContractEndSoonStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract"> | |||
| select count(id) from wx_property_contract where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and DATEDIFF(rental_end_date,now()) <= 30 | |||
| </select> | |||
| <select id="queryRentContractPaidStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract"> | |||
| select count(id) from wx_property_contract where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and rental_start_date <= now() and rental_end_date >= now() | |||
| </select> | |||
| <select id="queryRentContractEndStatus" resultType="int" parameterType="com.iformall.domain.po.WxRentContract"> | |||
| select count(id) from wx_property_contract where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and rental_end_date <now() | |||
| </select> | |||
| <update id="updateRentContractEndSoonStatus" parameterType="com.iformall.domain.po.WxRentContract"> | |||
| update wx_property_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and DATEDIFF(rental_end_date,now()) <= 30 | |||
| </update> | |||
| <update id="updateRentContractPaidStatus" parameterType="com.iformall.domain.po.WxRentContract"> | |||
| update wx_property_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and rental_start_date <= now() and rental_end_date >= now() | |||
| </update> | |||
| <update id="updateRentContractEndStatus" parameterType="com.iformall.domain.po.WxRentContract"> | |||
| update wx_property_contract set status=#{status} where tenant_id=#{tenantId} and status!=1 and status!=6 and status!=7 and rental_end_date <now() | |||
| </update> | |||
| <update id="updateRentWaitSignStatus" parameterType="com.iformall.domain.po.WxRentContract"> | |||
| update wx_property_contract set status=#{status} where tenant_id=#{tenantId} and status!=7 and merchant_id is null | |||
| </update> | |||
| <update id="updateRentInvalidStatus" parameterType="com.iformall.domain.po.WxRentContract"> | |||
| update wx_property_contract set status=#{status} where shop_id in ( | |||
| select s.shop_id from (SELECT shop_id FROM wx_property_contract WHERE tenant_id = #{tenantId} and merchant_id is not null and status!=6 | |||
| )s) and merchant_id is null and tenant_id=#{tenantId} | |||
| </update> | |||
| <select id="getRentContractList" parameterType="String" resultType="com.iformall.domain.po.WxRentContract"> | |||
| select rc.*,s.shop_number from wx_property_contract rc left join wx_shop s on rc.shop_id=s.id | |||
| where rc.status not in(1,6,7) and rc.tenant_id=#{tenantId} | |||
| </select> | |||
| </mapper> | |||