| @@ -77,16 +77,6 @@ public class WxRentContractController extends WxContractBaseController { | |||
| return new ResultData(map); | |||
| } | |||
| /** | |||
| * 获取免租期 | |||
| */ | |||
| @GetMapping("getFreePeriod") | |||
| public ResultData getFreePeriod(@ModelAttribute WxRentContract wxRentContract) { | |||
| //查询 | |||
| WxRentContract contract = wxRentContractService.selectById(wxRentContract.getId()); | |||
| return new ResultData(wxRentContractService.getFreePeriods(contract)); | |||
| } | |||
| /** | |||
| * 作废 | |||
| * @param wxRentContract | |||
| @@ -134,16 +134,13 @@ public class WxRentContract extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "店铺编号串", name = "shopIdStr") | |||
| private String shopIdStr; | |||
| @io.swagger.annotations.ApiModelProperty(value = "类型EnumRentContractType", name = "type") | |||
| @io.swagger.annotations.ApiModelProperty(value = "类型EnumAgileContractType", name = "type") | |||
| private Integer type; | |||
| @TableField(exist = false) | |||
| private String typeName; | |||
| @TableField(exist = false) | |||
| private List<Integer> typeList; | |||
| // @io.swagger.annotations.ApiModelProperty(value = "取高时保底方式EnumRentRenevueMinimunMethod", name = "revenueMinimumMethod") | |||
| // private Integer revenueMinimumMethod; | |||
| @io.swagger.annotations.ApiModelProperty(value = "审核状态, 0未审核 1审核中 2审核通过 3驳回", name = "applyStatus") | |||
| private Integer applyStatus; | |||
| @@ -185,10 +182,6 @@ public class WxRentContract extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "免租期说明", name = "freePeriodRemark") | |||
| private String freePeriodRemark; | |||
| // @io.swagger.annotations.ApiModelProperty(value = "合同类型EnumRentAgileType", name = "agileType") | |||
| // private Integer agileType = EnumRentAgileType.AGILE.getCode(); | |||
| public List<Long> shopIdsByRentInfo() { | |||
| List<Long> shopList = Lists.newArrayList(); | |||
| String rentInfo = this.getRentInfo(); | |||
| @@ -64,6 +64,9 @@ public class WxRentContractAgileRenevue extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="updateTime",name="updateTime") | |||
| private Date updatetime; | |||
| @io.swagger.annotations.ApiModelProperty(value="最低扣点销售额",name="limitRevenue") | |||
| private String limitRevenue; | |||
| @TableField(exist = false) | |||
| private List<WxRentContractAgileRenevueItem> items; | |||
| @@ -39,6 +39,9 @@ public class WxRentContractAgileRenevueFees extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="updateTime",name="updateTime") | |||
| private Date updatetime; | |||
| @io.swagger.annotations.ApiModelProperty(value="款项编号",name="feesId") | |||
| private Long feesId; | |||
| @io.swagger.annotations.ApiModelProperty(value="占比比率%,默认100",name="rate") | |||
| private String rate; | |||
| @@ -53,5 +53,10 @@ public class WxRentContractAgileRenevueItem extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="页面用的字段",name="isFree") | |||
| private Integer isFather; | |||
| @TableField(exist = false) | |||
| private Date validBeginTime; | |||
| @TableField(exist = false) | |||
| private Date validEndTime; | |||
| } | |||
| @@ -27,12 +27,9 @@ public class WxRentContractRevenueSales extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="updateTime",name="updateTime") | |||
| private Date updateTime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租金合同编号", name = "rentContractId") | |||
| @io.swagger.annotations.ApiModelProperty(value = "合同编号", name = "rentContractId") | |||
| private Long rentContractId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "物业合同编号", name = "propertyContractId") | |||
| private Long propertyContractId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "账单开始日期", name = "starttime") | |||
| private Date starttime; | |||
| @TableField(exist = false) | |||
| @@ -0,0 +1,38 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| */ | |||
| public enum EnumAgileContractType { | |||
| AREA(1, "面积"), | |||
| RENEVUE(2, "联营扣点"), | |||
| RENEVUE_UP(3, "面积与联营扣点取高") | |||
| ; | |||
| public static EnumAgileContractType getEnum(Integer code) { | |||
| for (EnumAgileContractType value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumAgileContractType(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -55,5 +55,7 @@ public interface WxAllBillMapper extends CommonMapper<WxAllBill, Long> { | |||
| void updateContractCusName(WxAllBill wxBillRent); | |||
| void transferCusName(WxAllBill wxBillRent); | |||
| BigDecimal getReceivePaySum(WxAllBill wxBillRent); | |||
| } | |||
| @@ -16,6 +16,8 @@ public interface WxRentContractAgileUnDepositMapper extends CommonMapper<WxRentC | |||
| List<Long> findIdList(WxRentContractAgileUnDeposit wxBillRent); | |||
| List<Long> findFeesIdList(WxRentContractAgileUnDeposit wxBillRent); | |||
| void updateJoinRenevueUp(WxRentContractAgileUnDeposit wxBillRent); | |||
| } | |||
| @@ -7,6 +7,7 @@ import com.iformall.domain.po.WxContractCustomers; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.po.WxRentContractAgileDeposit; | |||
| import com.iformall.domain.po.WxRentContractAgileRenevue; | |||
| import com.iformall.domain.po.WxRentContractAgileRenevueFees; | |||
| import com.iformall.domain.po.WxRentContractAgileRenevueItem; | |||
| import com.iformall.domain.po.WxRentContractAgileUnDeposit; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| @@ -39,6 +40,8 @@ public interface WxAgileContractService { | |||
| List<WxRentContractAgileUnDeposit> findUnDepositList(WxRentContractAgileUnDeposit unDeposit); | |||
| List<Long> findUnDepositFeesIdList(WxRentContractAgileUnDeposit unDeposit); | |||
| void createUnDepositBill(WxRentContractAgileUnDeposit unDeposit,MallUserInfo user); | |||
| WxRentContractAgileRenevue findRenevueByContract(Long rentContractId,TenantEntity tenantEntity); | |||
| @@ -51,6 +54,10 @@ public interface WxAgileContractService { | |||
| List<WxRentContractAgileRenevueItem> findRenevueItemListByContract(Long rentContractId,TenantEntity tenantEntity); | |||
| List<WxRentContractAgileRenevueFees> findRenevueFeesListByContract(Long rentContractId,TenantEntity tenantEntity); | |||
| WxRentContractAgileRenevueItem findOneRenevueItemByTime(Long rentContractId,TenantEntity tenantEntity,Date begin,Date end); | |||
| List<Long> findBuildingFloorContractIds(TenantEntity tenantEntity,String floorRule,Long building,Long floor,List<Long> shopIds,Integer shopDel); | |||
| List<Long> findShopContractIds(TenantEntity tenantEntity,List<Long> shopIds); | |||
| @@ -51,21 +51,6 @@ public interface WxRentContractService { | |||
| //Map<String, Object> getById(Long id,Integer noBillList); | |||
| WxRentContract selectById(Long id); | |||
| /** | |||
| * 保存或更新实体 | |||
| * @param record | |||
| * @param userId | |||
| * @param userName | |||
| * @return | |||
| */ | |||
| //ResultData save(WxRentContract record,MallUserInfo user,String userName,Date oldRentStartDate); | |||
| //ResultData update(WxRentContract record, MallUserInfo user,String userName,int from,Date oldRentStartDate,boolean writeComplate,boolean setRevenJumps); | |||
| //ResultData updateOneStep(WxRentContract record, MallUserInfo user,String userName,int from,Date oldRentStartDate,boolean writeComplate); | |||
| //ResultData updateRentStartTime(WxRentContract record, MallUserInfo user); | |||
| /** | |||
| * 根据Id删除实体 | |||
| * | |||
| @@ -76,62 +61,28 @@ public interface WxRentContractService { | |||
| void download(HttpServletRequest request, HttpServletResponse response); | |||
| //Object getRentContractStatusInfo(WxRentContract record); | |||
| ResultData updateRentContract(WxRentContract wxRentContract); | |||
| PageInfo<WxRentContract> getRenevueContractList(WxRentContract rentContract, Integer pageNum, Integer pageSize); | |||
| //void exportContract(HttpServletRequest request, HttpServletResponse response, Long rentId,Long propertyId); | |||
| //ResultData updateFile(WxRentContract wxRentContract, MallUserInfo user,String userName,boolean writeComplate); | |||
| ResultData updateRentContractStatus(Long id,boolean buildPropertyBill); | |||
| List<Long> getShopIds(WxRentContract record) ; | |||
| void updateApplyStatus(WxRentContract wxRentContract); | |||
| List<Date> getYearList(int years,int month,Date rentalStartDate,Date endContractTime ); | |||
| //List<WxAllBill> buildRent(MallUserInfo user,WxRentContract rentContract,Integer isPreview,boolean saveDb); | |||
| //void buildDeposit( TenantEntity tenantEntity,MallUserInfo user,Long rentContractId); | |||
| //void updateInvalidContract(Long rentContractId); | |||
| //ResultData hasRentStatus(WxRentContract wxRentContract); | |||
| //ResultData hasContractNumber(WxRentContract wxRentContract); | |||
| //Integer getShopType(WxRentContract wxRentContract); | |||
| ResultData endContract(WxRentContract wxRentContract,MallUserInfo userInfo); | |||
| //void updatePropertyPreviewBill(WxRentContract record); | |||
| //Map<String, Object> updateStatus(WxRentContract record); | |||
| WxRentContract getByBill(WxAllBill billRent); | |||
| //Map<Long,WxRentContract> selectRentContractByShopIds(Collection<Long> shopIds, String shopIdsRegexp, TenantEntity tenantEntity); | |||
| //int selectContractCountByShopId(WxRentContract wxRentContract); | |||
| //ResultData getContractByContractNumber(WxRentContract wxRentContract); | |||
| ResultData apply(WxRentContract wxRentContract,MallUserInfo user); | |||
| void renewal(WxRentContract wxRentContract,MallUserInfo user); | |||
| /** | |||
| * 合同正常到期 | |||
| * @param | |||
| */ | |||
| void outDateContract(WxMall wxMall); | |||
| //查询还有多少天到期的合同 | |||
| //List<WxRentContract> findToOutDateContracts(TenantEntity tenantEntity); | |||
| /** | |||
| * 已签约未计租 变为计租中 | |||
| * @param wxMall | |||
| @@ -146,14 +97,8 @@ public interface WxRentContractService { | |||
| List<WxRentContract> findToEndContractList(WxRentContract record); | |||
| void calcuteByTradeDaily(WxRentContract wxRentContract); | |||
| void deletePrewBill(WxRentContract wxRentContract); | |||
| List<RentContractFreePeriodVo> getFreePeriods(WxRentContract wxRentContract); | |||
| //void saveFreePeriods(WxRentContract wxRentContract); | |||
| List<WxRentContractRevenueSales> getContractSales(WxRentContract wxRentContract); | |||
| WxRentContractRevenueSetSalesVo setRevenueSales(MallUserInfo user,WxRentContract rentcontract,String sales,Date startime, Date endtime); | |||
| @@ -164,8 +109,6 @@ public interface WxRentContractService { | |||
| List<WxRentContractRevenueJump> findJumpList(WxRentContractRevenueJump jump); | |||
| //List<WxRentContractYearsVo> getRentContractYears(WxRentContract rentContract); | |||
| BigDecimal calcuteContractUsedShopArea(WxRentContract wxRentContract,Long shopId); | |||
| } | |||
| @@ -274,7 +274,7 @@ public class WxRentContractAgileHelper { | |||
| * @param end | |||
| * @return | |||
| */ | |||
| private static String getMonthNeedPay(List<Date> freeDays,Integer decimalSize,BigDecimal price,Date start,Date end, | |||
| public static String getMonthNeedPay(List<Date> freeDays,Integer decimalSize,BigDecimal price,Date start,Date end, | |||
| EnumRentContractAgilTimeUnit timeUnit,int time,EnumRentDayPriceCalcute dayPriceRule,Integer monthAvageDays){ | |||
| SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); | |||
| SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM"); | |||
| @@ -555,6 +555,11 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||
| } | |||
| return list; | |||
| } | |||
| @Override | |||
| public List<Long> findUnDepositFeesIdList(WxRentContractAgileUnDeposit unDeposit) { | |||
| return wxRentContractAgileUnDepositMapper.findFeesIdList(unDeposit); | |||
| } | |||
| @Override | |||
| @@ -918,6 +923,29 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||
| iq.setSortColumn("begin_time asc"); | |||
| return wxRentContractAgileRenevueItemMapper.findList(iq); | |||
| } | |||
| @Override | |||
| public List<WxRentContractAgileRenevueFees> findRenevueFeesListByContract(Long rentContractId,TenantEntity tenantEntity) { | |||
| WxRentContractAgileRenevueFees iq = new WxRentContractAgileRenevueFees(); | |||
| iq.updateTenantInfo(tenantEntity); | |||
| iq.setRentContractId(rentContractId); | |||
| return wxRentContractAgileRenevueFeesMapper.findList(iq); | |||
| } | |||
| @Override | |||
| public WxRentContractAgileRenevueItem findOneRenevueItemByTime(Long rentContractId,TenantEntity tenantEntity,Date begin,Date end) { | |||
| WxRentContractAgileRenevueItem iq = new WxRentContractAgileRenevueItem(); | |||
| iq.updateTenantInfo(tenantEntity); | |||
| iq.setRentContractId(rentContractId); | |||
| iq.setValidBeginTime(begin); | |||
| iq.setValidEndTime(end);; | |||
| iq.setSortColumn("begin_time asc"); | |||
| List<WxRentContractAgileRenevueItem> items = wxRentContractAgileRenevueItemMapper.findList(iq); | |||
| if (null == items || items.size() <= 0 ) { | |||
| return null; | |||
| } | |||
| return items.get(0); | |||
| } | |||
| @Override | |||
| public List<Long> findBuildingFloorContractIds(TenantEntity tenantEntity, String floorRule, Long building, | |||
| @@ -1062,6 +1090,25 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||
| } | |||
| } | |||
| // WxRentContractRevenue | |||
| // WxRentContractRevenueItem | |||
| // WxRentContractRevenueFees | |||
| WxRentContractRevenueJump crjq = new WxRentContractRevenueJump(); | |||
| crjq.updateTenantInfo(rentContract); | |||
| crjq.setRentContractId(rentContract.getId()); | |||
| List<WxRentContractRevenueJump> jumpList = wxRentContractRevenueJumpMapper.findList(crjq); | |||
| if ( null != jumpList && jumpList.size() > 0 ) { | |||
| for (int i = 0 ; i < jumpList.size(); i++) { | |||
| WxRentContractRevenueJump rj = jumpList.get(i); | |||
| rj.setRentContractId(newContractId); | |||
| rj.setId(idWorker.nextId()); | |||
| rj.setCreateTime(new Date()); | |||
| rj.setUpdateTime(new Date()); | |||
| wxRentContractRevenueJumpMapper.insert(rj); | |||
| } | |||
| } | |||
| rentContract.setId(newContractId); | |||
| rentContract.setCreatetime(new Date()); | |||
| rentContract.setCreateBy(user.getId()); | |||
| @@ -449,5 +449,13 @@ | |||
| </update> | |||
| <select id="getReceivePaySum" parameterType="com.iformall.domain.po.WxAllBill" resultType="DECIMAL"> | |||
| select sum(CAST(ifnull(receive_pay,'0') AS DECIMAL(20,2)) | |||
| from wx_all_bill | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| </mapper> | |||
| @@ -10,11 +10,12 @@ | |||
| <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/> | |||
| <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime"/> | |||
| <result column="rate" jdbcType="VARCHAR" property="rate" /> | |||
| <result column="fees_id" jdbcType="BIGINT" property="feesId" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`rent_contract_id`,`agile_renevue_id`, | |||
| `createtime`,`updatetime`,`rate` | |||
| `createtime`,`updatetime`,`rate`,`fees_id` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -28,6 +29,7 @@ | |||
| </if> | |||
| <if test=" null != rentContractId ">and `rent_contract_id` = #{rentContractId}</if> | |||
| <if test=" null != agileRenevueId ">and `agile_renevue_id` = #{agileRenevueId}</if> | |||
| <if test=" null != feesId ">and `fees_id` = #{feesId}</if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| @@ -33,6 +33,8 @@ | |||
| <if test=" null != rentContractId ">and `rent_contract_id` = #{rentContractId}</if> | |||
| <if test=" null != renevueId ">and `renevue_id` = #{renevueId}</if> | |||
| <if test=" null != isFather ">and `is_father` = #{isFather}</if> | |||
| <if test=" null != validBeginTime ">and `begin_time` <= #{validBeginTime}</if> | |||
| <if test=" null != validEndTime ">and `end_time` >= #{validEndTime}</if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| @@ -12,11 +12,12 @@ | |||
| <result column="fees_create_rule" jdbcType="INTEGER" property="feesCreateRule"/> | |||
| <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/> | |||
| <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime"/> | |||
| <result column="limit_revenue" jdbcType="VARCHAR" property="limitRevenue"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`rent_contract_id`, | |||
| `time_period`,`time_unit`,`calcute_time`,`fees_create_rule`,`createtime`,`updatetime` | |||
| `time_period`,`time_unit`,`calcute_time`,`fees_create_rule`,`createtime`,`updatetime`,`limit_revenue` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -56,6 +56,12 @@ | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="findFeesIdList" parameterType="com.iformall.domain.po.WxRentContractAgileUnDeposit" resultType="Long"> | |||
| select distinct fees_id | |||
| from wx_rent_contract_agile_un_deposit | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| @@ -8,7 +8,6 @@ | |||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | |||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | |||
| <result column="rent_contract_id" jdbcType="BIGINT" property="rentContractId"/> | |||
| <result column="property_contract_id" jdbcType="BIGINT" property="propertyContractId"/> | |||
| <result column="starttime" jdbcType="TIMESTAMP" property="starttime"/> | |||
| <result column="endtime" jdbcType="TIMESTAMP" property="endtime"/> | |||
| <result column="sale_money" jdbcType="VARCHAR" property="saleMoney"/> | |||
| @@ -21,7 +20,7 @@ | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`rent_contract_id`,`property_contract_id`,`starttime`,`endtime`, | |||
| `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`rent_contract_id`,`starttime`,`endtime`, | |||
| `sale_money`,`sale_money_valid`,`calcute_money`,`remark`,`is_confirm`,`is_calcute` | |||
| </sql> | |||
| @@ -35,7 +34,6 @@ | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != rentContractId ">and `rent_contract_id` = #{rentContractId}</if> | |||
| <if test=" null != propertyContractId ">and `property_contract_id` = #{propertyContractId}</if> | |||
| <if test=" null != starttime ">and `starttime` >= #{starttime}</if> | |||
| <if test=" null != starttimeEqual ">and `starttime` = #{starttimeEqual}</if> | |||
| <if test=" null != endtime ">and `endtime` <= #{endtime}</if> | |||