| @@ -12,6 +12,7 @@ import com.iformall.controller.base.BaseController; | |||||
| import com.iformall.domain.po.WxFlowModel; | import com.iformall.domain.po.WxFlowModel; | ||||
| import com.iformall.domain.po.WxPropertyContract; | import com.iformall.domain.po.WxPropertyContract; | ||||
| import com.iformall.domain.po.WxRentContract; | import com.iformall.domain.po.WxRentContract; | ||||
| import com.iformall.domain.vo.WxRentPropertyContractVo; | |||||
| import com.iformall.enums.EnumContractOperationType; | import com.iformall.enums.EnumContractOperationType; | ||||
| import com.iformall.enums.EnumFlowContractType; | import com.iformall.enums.EnumFlowContractType; | ||||
| import com.iformall.enums.EnumFlowKey; | import com.iformall.enums.EnumFlowKey; | ||||
| @@ -48,6 +49,22 @@ public class WxContractBaseController extends BaseController{ | |||||
| return map; | return map; | ||||
| } | } | ||||
| protected boolean rentPropertyHasWorkFlow(WxRentPropertyContractVo rpvo) { | |||||
| WxFlowModel wxFlowModel = new WxFlowModel(); | |||||
| if (rpvo.getRentShopType().intValue() == EnumRentShopType.SHOP.getCode().intValue()) { | |||||
| wxFlowModel.setFlowType(EnumFlowContractType.WHOLE_SHOP.getCode()); | |||||
| }else if (rpvo.getRentShopType().intValue() == EnumRentShopType.POINT.getCode().intValue()) { | |||||
| wxFlowModel.setFlowType(EnumFlowContractType.WHOLE_POINT.getCode()); | |||||
| } | |||||
| wxFlowModel.updateTenantInfo(rpvo); | |||||
| List<WxFlowModel> flows = wxFlowService.getModelBybusiness(wxFlowModel); | |||||
| if (null != flows && flows.size() > 0) { | |||||
| return true; | |||||
| } | |||||
| return false; | |||||
| } | |||||
| protected boolean rentContractHasWorkFlow(WxRentContract wxRentContract) { | protected boolean rentContractHasWorkFlow(WxRentContract wxRentContract) { | ||||
| WxFlowModel wxFlowModel = new WxFlowModel(); | WxFlowModel wxFlowModel = new WxFlowModel(); | ||||
| @@ -1,5 +1,6 @@ | |||||
| package com.iformall.controller.contract; | package com.iformall.controller.contract; | ||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.annotation.UserDataRuleAnnotation; | import com.iformall.annotation.UserDataRuleAnnotation; | ||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| @@ -36,6 +37,7 @@ import javax.servlet.http.HttpServletRequest; | |||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.HashMap; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | import java.util.Map; | ||||
| @@ -67,7 +69,23 @@ public class WxPropertyContractController extends WxContractBaseController { | |||||
| wxPropertyContract = new WxPropertyContract(); | wxPropertyContract = new WxPropertyContract(); | ||||
| } | } | ||||
| wxPropertyContract.updateTenantInfo(getTenantInfo()); | wxPropertyContract.updateTenantInfo(getTenantInfo()); | ||||
| Map<String, Object> result = wxPropertyContractService.listAsPage(wxPropertyContract, pageNum, pageSize); | |||||
| Map<String, Object> result = new HashMap<>(); | |||||
| PageInfo<WxPropertyContract> pageInfo = wxPropertyContractService.listAsPage(wxPropertyContract, pageNum, pageSize); | |||||
| Integer hasFlow = null; | |||||
| if (null != pageInfo && null != pageInfo.getList()) { | |||||
| for (WxPropertyContract wpc : pageInfo.getList()) { | |||||
| if (null == hasFlow) { | |||||
| if(propertyContractHasWorkFlow(wpc)) { | |||||
| hasFlow = 1; | |||||
| }else { | |||||
| hasFlow = 0; | |||||
| } | |||||
| } | |||||
| wpc.setFlowHas(hasFlow); | |||||
| } | |||||
| } | |||||
| result.put("pageInfo", pageInfo); | |||||
| return new ResultData(result); | return new ResultData(result); | ||||
| } | } | ||||
| @@ -87,7 +87,22 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| wxRentContract.updateTenantInfo(getTenantInfo()); | wxRentContract.updateTenantInfo(getTenantInfo()); | ||||
| wxRentContract.setSortColumns(SortField.Createtime_DESC); | wxRentContract.setSortColumns(SortField.Createtime_DESC); | ||||
| //Map<String, Object> result = wxRentContractService.listAsPage(wxRentContract, pageNum, pageSize); | //Map<String, Object> result = wxRentContractService.listAsPage(wxRentContract, pageNum, pageSize); | ||||
| return new ResultData(wxRentContractService.getRentContractList(wxRentContract, pageNum, pageSize)); | |||||
| PageInfo<WxRentContract> page = wxRentContractService.getRentContractList(wxRentContract, pageNum, pageSize); | |||||
| Integer hasFlow = null; | |||||
| if (null != page && null != page.getList()) { | |||||
| for (WxRentContract wrc: page.getList()) { | |||||
| if (null == hasFlow) { | |||||
| if(rentContractHasWorkFlow(wrc)) { | |||||
| hasFlow = 1; | |||||
| }else { | |||||
| hasFlow = 0; | |||||
| } | |||||
| } | |||||
| wrc.setFlowHas(hasFlow); | |||||
| } | |||||
| } | |||||
| return new ResultData(page); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -39,7 +39,21 @@ public class WxRentPropertyContractController extends WxContractBaseController { | |||||
| wxRentPropertyContractVo = new WxRentPropertyContractVo(); | wxRentPropertyContractVo = new WxRentPropertyContractVo(); | ||||
| } | } | ||||
| wxRentPropertyContractVo.updateTenantInfo(getTenantInfo()); | wxRentPropertyContractVo.updateTenantInfo(getTenantInfo()); | ||||
| final PageInfo<WxRentPropertyContractVo> page = wxRentPropertyContractService.listContractVo(wxRentPropertyContractVo, pageNum, pageSize); | |||||
| PageInfo<WxRentPropertyContractVo> page = wxRentPropertyContractService.listContractVo(wxRentPropertyContractVo, pageNum, pageSize); | |||||
| Integer hasFlow = null; | |||||
| if (null != page && null != page.getList()) { | |||||
| for (WxRentPropertyContractVo wrc: page.getList()) { | |||||
| if (null == hasFlow) { | |||||
| if(rentPropertyHasWorkFlow(wrc)) { | |||||
| hasFlow = 1; | |||||
| }else { | |||||
| hasFlow = 0; | |||||
| } | |||||
| } | |||||
| wrc.setFlowHas(hasFlow); | |||||
| } | |||||
| } | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -183,6 +183,10 @@ public class WxPropertyContract extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "审批备注", name = "remark") | @io.swagger.annotations.ApiModelProperty(value = "审批备注", name = "remark") | ||||
| private String remark; | private String remark; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "是否有工作流 1:有 0:无", name = "flowHas") | |||||
| @TableField(exist = false) | |||||
| private Integer flowHas; | |||||
| // public Integer getAdjustPeriod() { | // public Integer getAdjustPeriod() { | ||||
| // if(EnumPriceUnit.D.getCode().equals(this.getPriceUnit()) && EnumRentContractAdjustPeriod.ADJUST_PERIOD_MONTH.getCode().equals(adjustPeriod)){ | // if(EnumPriceUnit.D.getCode().equals(this.getPriceUnit()) && EnumRentContractAdjustPeriod.ADJUST_PERIOD_MONTH.getCode().equals(adjustPeriod)){ | ||||
| @@ -250,6 +250,11 @@ public class WxRentContract extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "查询店铺", name = "queryShopId") | @io.swagger.annotations.ApiModelProperty(value = "查询店铺", name = "queryShopId") | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Long queryShopId; | private Long queryShopId; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "是否有工作流 1:有 0:无", name = "flowHas") | |||||
| @TableField(exist = false) | |||||
| private Integer flowHas; | |||||
| public void setAdjustPeriodHandle() { | public void setAdjustPeriodHandle() { | ||||
| if(EnumPriceUnit.D.getCode().equals(this.getPriceUnit()) && EnumRentContractAdjustPeriod.ADJUST_PERIOD_MONTH.getCode().equals(adjustPeriod)){ | if(EnumPriceUnit.D.getCode().equals(this.getPriceUnit()) && EnumRentContractAdjustPeriod.ADJUST_PERIOD_MONTH.getCode().equals(adjustPeriod)){ | ||||
| @@ -1,5 +1,6 @@ | |||||
| package com.iformall.domain.vo; | package com.iformall.domain.vo; | ||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
| @@ -80,5 +81,8 @@ public class WxRentPropertyContractVo extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "联营扣点-时间范围 1年2月3周期", name = "busDiscountTime") | @io.swagger.annotations.ApiModelProperty(value = "联营扣点-时间范围 1年2月3周期", name = "busDiscountTime") | ||||
| private Integer busDiscountTime; | private Integer busDiscountTime; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "是否有工作流 1:有 0:无", name = "flowHas") | |||||
| private Integer flowHas; | |||||
| } | } | ||||
| @@ -1,5 +1,6 @@ | |||||
| package com.iformall.service; | package com.iformall.service; | ||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| import com.iformall.domain.po.WxBillProperty; | import com.iformall.domain.po.WxBillProperty; | ||||
| @@ -28,7 +29,7 @@ public interface WxPropertyContractService { | |||||
| * @param pageSize | * @param pageSize | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| Map<String, Object> listAsPage(WxPropertyContract record, Integer pageIndex, Integer pageSize); | |||||
| PageInfo<WxPropertyContract> listAsPage(WxPropertyContract record, Integer pageIndex, Integer pageSize); | |||||
| /** | /** | ||||
| * 根据Id获得实体 | * 根据Id获得实体 | ||||
| @@ -77,15 +77,15 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| WxPayAccountBillService wxPayAccountBillService; | WxPayAccountBillService wxPayAccountBillService; | ||||
| @Override | @Override | ||||
| public Map<String, Object> listAsPage(WxPropertyContract record, Integer pageIndex, Integer pageSize) { | |||||
| public PageInfo<WxPropertyContract> listAsPage(WxPropertyContract record, Integer pageIndex, Integer pageSize) { | |||||
| //Object rentContractStatusInfo = getRentContractStatusInfo(record); | //Object rentContractStatusInfo = getRentContractStatusInfo(record); | ||||
| //PageHelper.startPage(pageIndex, pageSize); | //PageHelper.startPage(pageIndex, pageSize); | ||||
| //List<Map<String, Object>> rentContractData = wxPropertyContractMapper.queryPropertyContractData(record); | //List<Map<String, Object>> rentContractData = wxPropertyContractMapper.queryPropertyContractData(record); | ||||
| Map<String, Object> result = new HashMap<>(); | |||||
| PageInfo<WxPropertyContract> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxPropertyContractMapper.findList(record)); | |||||
| //Map<String, Object> result = new HashMap<>(); | |||||
| PageInfo<WxPropertyContract> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxPropertyContractMapper.findList(record)); | |||||
| //result.put("rentContractStatusInfo", rentContractStatusInfo); | //result.put("rentContractStatusInfo", rentContractStatusInfo); | ||||
| result.put("pageInfo", pageInfo); | |||||
| return result; | |||||
| //result.put("pageInfo", pageInfo); | |||||
| return pageInfo; | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -42,6 +42,7 @@ | |||||
| <result column="rent_price" property="rentPrice"/> | <result column="rent_price" property="rentPrice"/> | ||||
| <result column="subject_name" property="subjectName"/> | <result column="subject_name" property="subjectName"/> | ||||
| <result column="rent_start_type" property="rentStartType"/> | <result column="rent_start_type" property="rentStartType"/> | ||||
| <result column="rent_shop_type" jdbcType="INTEGER" property="rentShopType"/> | |||||
| <result column="operation_type" property="operationType"/> | <result column="operation_type" property="operationType"/> | ||||
| <result column="late_pay_ratio" property="latePayRatio"/> | <result column="late_pay_ratio" property="latePayRatio"/> | ||||
| @@ -52,7 +53,7 @@ | |||||
| `id`,`merchant_id`,`price`,`rental_start_date`,`rental_end_date`, | `id`,`merchant_id`,`price`,`rental_start_date`,`rental_end_date`, | ||||
| `sign_date`,`receive_period`,`tenant_id`,`parent_tenant_id`,`filepath`,`status`,`contract_number`, | `sign_date`,`receive_period`,`tenant_id`,`parent_tenant_id`,`filepath`,`status`,`contract_number`, | ||||
| `deposit`,`pay_date`,`is_del`,`merchant_name`,`brand`,`business_id`, | `deposit`,`pay_date`,`is_del`,`merchant_name`,`brand`,`business_id`, | ||||
| `shop_type`,`updatetime`,`createtime`,`rent_area`, | |||||
| `shop_type`,`updatetime`,`createtime`,`rent_area`,`rent_shop_type`, | |||||
| `link_person`,`link_phone`,`pay_account`,`filename`,`lease`,`rent_contract_id`, | `link_person`,`link_phone`,`pay_account`,`filename`,`lease`,`rent_contract_id`, | ||||
| `start_date`,`end_date`,`apply_status`,`adjust_period`,`business_type`,adjust_ratio,`rent_info`, | `start_date`,`end_date`,`apply_status`,`adjust_period`,`business_type`,adjust_ratio,`rent_info`, | ||||
| `file_names`,price_unit,rent_price,subject_name,rent_start_type,`operation_type`,late_pay_ratio,late_pay_day | `file_names`,price_unit,rent_price,subject_name,rent_start_type,`operation_type`,late_pay_ratio,late_pay_day | ||||
| @@ -516,6 +516,8 @@ | |||||
| <resultMap id="contractMap" type="com.iformall.domain.vo.WxRentPropertyContractVo"> | <resultMap id="contractMap" type="com.iformall.domain.vo.WxRentPropertyContractVo"> | ||||
| <id column="id" property="id"/> | <id column="id" property="id"/> | ||||
| <result column="tenant_id" property="tenantId"/> | |||||
| <result column="parent_tenant_id" property="parentTenantId"/> | |||||
| <result column="rent_id" property="rentId"/> | <result column="rent_id" property="rentId"/> | ||||
| <result column="property_id" property="propertyId"/> | <result column="property_id" property="propertyId"/> | ||||
| <result column="shop_name" property="shopName"/> | <result column="shop_name" property="shopName"/> | ||||
| @@ -540,7 +542,7 @@ | |||||
| <select id="listContractVo" parameterType="com.iformall.domain.vo.WxRentPropertyContractVo" resultMap="contractMap"> | <select id="listContractVo" parameterType="com.iformall.domain.vo.WxRentPropertyContractVo" resultMap="contractMap"> | ||||
| select rc.id,rc.id as rent_id, pc.id as property_id, rc.merchant_name,rc.rental_start_date,rc.rental_end_date,rc.`status`, | |||||
| select rc.id,rc.tenant_id,rc.parent_tenant_id,rc.id as rent_id, pc.id as property_id, rc.merchant_name,rc.rental_start_date,rc.rental_end_date,rc.`status`, | |||||
| rc.price as rent_price,rc.contract_number,rc.shop_name,rc.type,rc.apply_status, | rc.price as rent_price,rc.contract_number,rc.shop_name,rc.type,rc.apply_status, | ||||
| rc.rent_shop_type,rc.rent_info,pc.price as property_price,rc.merchant_id,pc.`status` as property_status, | rc.rent_shop_type,rc.rent_info,pc.price as property_price,rc.merchant_id,pc.`status` as property_status, | ||||
| rc.price_unit as rent_price_unit,pc.price_unit as property_price_unit, | rc.price_unit as rent_price_unit,pc.price_unit as property_price_unit, | ||||