| @@ -161,7 +161,7 @@ public class WxPropertyContractController extends WxContractBaseController { | |||||
| result.put("pageInfo", pageInfo); | result.put("pageInfo", pageInfo); | ||||
| return new ResultData(result); | return new ResultData(result); | ||||
| } | } | ||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxPropertyContract wxPropertyContract) { | public ResultData add(@RequestBody WxPropertyContract wxPropertyContract) { | ||||
| logger.debug("[" + getIpAddr() + "] WxPropertyContractController::add"); | logger.debug("[" + getIpAddr() + "] WxPropertyContractController::add"); | ||||
| @@ -1,14 +1,24 @@ | |||||
| package com.iformall.controller.market; | package com.iformall.controller.market; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.WxFeesStandards; | import com.iformall.domain.po.WxFeesStandards; | ||||
| import com.iformall.domain.po.base.BaseEntity; | import com.iformall.domain.po.base.BaseEntity; | ||||
| import com.iformall.enums.EnumFeesStandardsCalcuteUnit; | |||||
| import com.iformall.enums.EnumFeesStandardsTimeUnit; | |||||
| import com.iformall.enums.EnumFeesStandardsType; | |||||
| import com.iformall.service.WxFeesStandardsService; | import com.iformall.service.WxFeesStandardsService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import java.util.ArrayList; | |||||
| import java.util.HashMap; | |||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -50,5 +60,52 @@ public class WxFeesStandardsController extends BaseController { | |||||
| WxFeesStandards record = wxFeesStandardsService.getById(id,getTenantInfo().getTenantId()); | WxFeesStandards record = wxFeesStandardsService.getById(id,getTenantInfo().getTenantId()); | ||||
| return new ResultData(record); | return new ResultData(record); | ||||
| } | } | ||||
| @ApiOperation("查询某一个类型费用标砖列表") | |||||
| @GetMapping("typeList") | |||||
| public ResultData typeList(Integer type) { | |||||
| if (null == type) { | |||||
| return new ResultData(Result.ERROR,"参数错误"); | |||||
| } | |||||
| WxFeesStandards record = new WxFeesStandards(); | |||||
| record.updateTenantInfo(getTenantInfo()); | |||||
| record.setType(type); | |||||
| return new ResultData(wxFeesStandardsService.list(record)); | |||||
| } | |||||
| @ApiOperation("查询某一个类型计量单位列表") | |||||
| @GetMapping("typeCalcuteUnitList") | |||||
| public ResultData typeCalcuteUnitList(Integer type) { | |||||
| if (null == type) { | |||||
| return new ResultData(Result.ERROR,"参数错误"); | |||||
| } | |||||
| List<EnumFeesStandardsCalcuteUnit> enumList = EnumFeesStandardsType.getCalucuteUnites(type); | |||||
| if (null != enumList) { | |||||
| Map<Integer,String> retMap = new HashMap<Integer,String>(); | |||||
| for (int i = 0 ; i < enumList.size(); i++) { | |||||
| EnumFeesStandardsCalcuteUnit cu = enumList.get(i); | |||||
| retMap.put(cu.getCode(), cu.getMessage()); | |||||
| } | |||||
| return new ResultData(retMap); | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("查询某一个类型时间单位列表") | |||||
| @GetMapping("typeTimeUnitList") | |||||
| public ResultData typeTimeUnitList(Integer type) { | |||||
| if (null == type) { | |||||
| return new ResultData(Result.ERROR,"参数错误"); | |||||
| } | |||||
| List<EnumFeesStandardsTimeUnit> enumList = EnumFeesStandardsType.getTimeUnites(type); | |||||
| if (null != enumList) { | |||||
| Map<Integer,String> retMap = new HashMap<Integer,String>(); | |||||
| for (int i = 0 ; i < enumList.size(); i++) { | |||||
| EnumFeesStandardsTimeUnit cu = enumList.get(i); | |||||
| retMap.put(cu.getCode(), cu.getMessage()); | |||||
| } | |||||
| return new ResultData(retMap); | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| } | } | ||||
| @@ -0,0 +1,7 @@ | |||||
| ALTER TABLE wx_property_contract ADD COLUMN create_type INT(1) NOT NULL DEFAULT 1 COMMENT '创建方式' ; | |||||
| ALTER TABLE wx_property_contract ADD COLUMN shop_ids VARCHAR(100) COMMENT '店铺ids,根据店铺创建' ; | |||||
| ALTER TABLE wx_property_contract ADD COLUMN shop_numbers VARCHAR(100) COMMENT '店铺ids,根据店铺创建' ; | |||||
| ALTER TABLE wx_rent_contract ADD COLUMN price_detail TEXT COMMENT '费用详细说明' AFTER rent_price; | |||||
| ALTER TABLE wx_property_contract ADD COLUMN price_detail TEXT COMMENT '费用详细说明' AFTER rent_price; | |||||
| ALTER TABLE wx_property_contract ADD COLUMN fees_standards_info TEXT COMMENT '其他标准费用信息' ; | |||||
| @@ -1,7 +1,12 @@ | |||||
| package com.iformall.domain.po; | package com.iformall.domain.po; | ||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.enums.EnumFeesStandardsCalcuteUnit; | |||||
| import com.iformall.enums.EnumFeesStandardsTimeUnit; | |||||
| import com.iformall.enums.EnumYesOrNo; | |||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | import lombok.ToString; | ||||
| @@ -30,12 +35,44 @@ public class WxFeesStandards extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "单价", name = "price") | @io.swagger.annotations.ApiModelProperty(value = "单价", name = "price") | ||||
| private String price; | private String price; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "类型EnumFeesStandardsType", name = "type") | @io.swagger.annotations.ApiModelProperty(value = "类型EnumFeesStandardsType", name = "type") | ||||
| private Integer type; | |||||
| private Integer type; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "是否一次性费用EnumYesOrNo", name = "fixedPrice") | @io.swagger.annotations.ApiModelProperty(value = "是否一次性费用EnumYesOrNo", name = "fixedPrice") | ||||
| private Integer fixedPrice; | private Integer fixedPrice; | ||||
| @TableField(exist = false) | |||||
| private String fixedPriceName; | |||||
| public String getFixedPriceName() { | |||||
| if (null != fixedPrice) { | |||||
| if (fixedPrice.intValue() == EnumYesOrNo.YES.getCode().intValue()) { | |||||
| return "一次性费用"; | |||||
| }else { | |||||
| return "非一次性费用"; | |||||
| } | |||||
| } | |||||
| return ""; | |||||
| } | |||||
| @io.swagger.annotations.ApiModelProperty(value = "计量单位EnumFeesStandardsCalcuteUnit【非固定费用使用】", name = "calcuteUnit") | @io.swagger.annotations.ApiModelProperty(value = "计量单位EnumFeesStandardsCalcuteUnit【非固定费用使用】", name = "calcuteUnit") | ||||
| private Integer calcuteUnit; | private Integer calcuteUnit; | ||||
| @TableField(exist = false) | |||||
| private String calcuteUnitName; | |||||
| public String getCalcuteUnitName() { | |||||
| if (null != calcuteUnit) { | |||||
| EnumFeesStandardsCalcuteUnit.getEnum(calcuteUnit).getMessage(); | |||||
| } | |||||
| return ""; | |||||
| } | |||||
| @io.swagger.annotations.ApiModelProperty(value = "时间单位EnumFeesStandardsTimeUnit【非固定费用使用】", name = "timeUnit") | @io.swagger.annotations.ApiModelProperty(value = "时间单位EnumFeesStandardsTimeUnit【非固定费用使用】", name = "timeUnit") | ||||
| private Integer timeUnit; | private Integer timeUnit; | ||||
| @TableField(exist = false) | |||||
| private String timeUnitName; | |||||
| public String getTimeUnitName() { | |||||
| if (null != timeUnit) { | |||||
| EnumFeesStandardsTimeUnit.getEnum(timeUnit).getMessage(); | |||||
| } | |||||
| return ""; | |||||
| } | |||||
| } | } | ||||
| @@ -1,5 +1,6 @@ | |||||
| package com.iformall.domain.po; | package com.iformall.domain.po; | ||||
| import com.alibaba.fastjson.JSON; | |||||
| import com.alibaba.fastjson.JSONArray; | import com.alibaba.fastjson.JSONArray; | ||||
| import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
| import com.baomidou.mybatisplus.annotation.TableField; | import com.baomidou.mybatisplus.annotation.TableField; | ||||
| @@ -215,6 +216,9 @@ public class WxPropertyContract extends TenantEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Integer flowHas; | private Integer flowHas; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "其他标准费用信息", name = "feesStandardsInfo") | |||||
| private String feesStandardsInfo; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "到期提醒提前天数", name = "outDateNotifyDays") | @io.swagger.annotations.ApiModelProperty(value = "到期提醒提前天数", name = "outDateNotifyDays") | ||||
| private Integer outDateNotifyDays; | private Integer outDateNotifyDays; | ||||
| @@ -297,11 +301,22 @@ public class WxPropertyContract extends TenantEntity { | |||||
| } | } | ||||
| return shopList; | return shopList; | ||||
| } | } | ||||
| public List<WxFeesStandards> getFeesStardarsList() { | |||||
| if (StringUtils.isNotBlank(feesStandardsInfo)) { | |||||
| return JSON.parseArray(feesStandardsInfo, WxFeesStandards.class); | |||||
| } | |||||
| return null; | |||||
| } | |||||
| @io.swagger.annotations.ApiModelProperty(value = "合同类型", name = "contractType") | @io.swagger.annotations.ApiModelProperty(value = "合同类型", name = "contractType") | ||||
| private Integer contractType; | private Integer contractType; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private List<Long> merchantIds; | private List<Long> merchantIds; | ||||
| @TableField(exist = false) | |||||
| List<WxFeesStandards> feeStandards; | |||||
| } | } | ||||
| @@ -41,7 +41,8 @@ public enum EnumContractReceivePeriodUnit { | |||||
| public static Calendar getAfterCalendarDay(Calendar instance,int period,int unit) { | public static Calendar getAfterCalendarDay(Calendar instance,int period,int unit) { | ||||
| if (unit == MONTH.getCode().intValue()) { | if (unit == MONTH.getCode().intValue()) { | ||||
| instance.add(Calendar.MONTH, period); | instance.add(Calendar.MONTH, period); | ||||
| instance.add(Calendar.DATE, -1); | |||||
| //instance.add(Calendar.DATE, -1); | |||||
| instance.add(Calendar.SECOND, -1); | |||||
| //几个季度之后 | //几个季度之后 | ||||
| }else if (unit == QUARTER.getCode().intValue()) { | }else if (unit == QUARTER.getCode().intValue()) { | ||||
| instance = DateUtils.getAfterQuaterStartDay(instance.getTime(), period); | instance = DateUtils.getAfterQuaterStartDay(instance.getTime(), period); | ||||
| @@ -60,7 +61,8 @@ public enum EnumContractReceivePeriodUnit { | |||||
| Calendar instance = Calendar.getInstance(); | Calendar instance = Calendar.getInstance(); | ||||
| instance.setTime(firstDay); | instance.setTime(firstDay); | ||||
| instance.add(Calendar.MONTH, period); | instance.add(Calendar.MONTH, period); | ||||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||||
| //instance.add(Calendar.DAY_OF_MONTH, -1); | |||||
| instance.add(Calendar.SECOND, -1); | |||||
| } | } | ||||
| //几个季度之后 | //几个季度之后 | ||||
| }else if (unit == QUARTER.getCode().intValue()) { | }else if (unit == QUARTER.getCode().intValue()) { | ||||
| @@ -71,4 +73,13 @@ public enum EnumContractReceivePeriodUnit { | |||||
| return date; | return date; | ||||
| } | } | ||||
| public static void main(String[] args) { | |||||
| Date date = DateUtils.stringToDate("2024-02-03 00:00:00", DateUtils.DATE_TIME_PATTERN); | |||||
| Calendar instance = Calendar.getInstance(); | |||||
| instance.setTime(date); | |||||
| System.out.println(DateUtils.format(getAfterCalendarDay(instance, 3, 1).getTime(),DateUtils.DATE_TIME_PATTERN)); | |||||
| System.out.println(DateUtils.format(getAfterCalendarDay(instance, 3, 2).getTime(),DateUtils.DATE_TIME_PATTERN)); | |||||
| System.out.println(DateUtils.getLastDayForMonth(date)); | |||||
| } | |||||
| } | } | ||||
| @@ -1,5 +1,7 @@ | |||||
| package com.iformall.service; | package com.iformall.service; | ||||
| import java.util.List; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.WxFeesStandards; | import com.iformall.domain.po.WxFeesStandards; | ||||
| @@ -15,6 +17,8 @@ public interface WxFeesStandardsService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| PageInfo<WxFeesStandards> listAsPage(WxFeesStandards record, Integer pageIndex, Integer pageSize); | PageInfo<WxFeesStandards> listAsPage(WxFeesStandards record, Integer pageIndex, Integer pageSize); | ||||
| List<WxFeesStandards> list(WxFeesStandards record); | |||||
| /** | /** | ||||
| * id+tenantId | * id+tenantId | ||||
| @@ -22,4 +26,6 @@ public interface WxFeesStandardsService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| WxFeesStandards getById(Long id, String tenantId); | WxFeesStandards getById(Long id, String tenantId); | ||||
| } | } | ||||
| @@ -421,8 +421,9 @@ public class WxRentContractHelper { | |||||
| //判断是否满足整月 | //判断是否满足整月 | ||||
| Calendar instance = Calendar.getInstance(); | Calendar instance = Calendar.getInstance(); | ||||
| instance.setTime(startDate); | instance.setTime(startDate); | ||||
| instance.add(dayType, receivePeriod); | |||||
| instance.add(Calendar.DATE, -1); | |||||
| // instance.add(dayType, receivePeriod); | |||||
| // instance.add(Calendar.DATE, -1); | |||||
| instance = EnumContractReceivePeriodUnit.getAfterCalendarDay(instance, receivePeriod, dayType); | |||||
| if(sd.format(instance.getTime()).equals(sd.format(endDate))){ | if(sd.format(instance.getTime()).equals(sd.format(endDate))){ | ||||
| int months = WxRentContractHelper.getMonths(sdM.format(startDate)+"-01",sdM.format(DateUtils.getDaySet(endDate,Calendar.DATE,1))+"-01"); | int months = WxRentContractHelper.getMonths(sdM.format(startDate)+"-01",sdM.format(DateUtils.getDaySet(endDate,Calendar.DATE,1))+"-01"); | ||||
| needpay = new BigDecimal(months).multiply(priceD).setScale(wxRentContract.getDecimalSize(), RoundingMode.HALF_UP).toPlainString(); | needpay = new BigDecimal(months).multiply(priceD).setScale(wxRentContract.getDecimalSize(), RoundingMode.HALF_UP).toPlainString(); | ||||
| @@ -522,8 +523,9 @@ public class WxRentContractHelper { | |||||
| }else{ | }else{ | ||||
| Calendar instance = Calendar.getInstance(); | Calendar instance = Calendar.getInstance(); | ||||
| instance.setTime(start); | instance.setTime(start); | ||||
| instance.add(dayType, receivePeriod); | |||||
| instance.add(Calendar.DATE, -1); | |||||
| // instance.add(dayType, receivePeriod); | |||||
| // instance.add(Calendar.DATE, -1); | |||||
| instance = EnumContractReceivePeriodUnit.getAfterCalendarDay(instance, receivePeriod, receivePeriod); | |||||
| if(sd.format(instance.getTime()).equals(sd.format(end))){ | if(sd.format(instance.getTime()).equals(sd.format(end))){ | ||||
| isFullMonth = true; | isFullMonth = true; | ||||
| } | } | ||||
| @@ -5,6 +5,9 @@ import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.mapper.WxFeesStandardsMapper; | import com.iformall.mapper.WxFeesStandardsMapper; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import java.util.List; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -30,5 +33,10 @@ public class WxFeesStandardsServiceImpl implements WxFeesStandardsService { | |||||
| recordQ.setTenantId(tenantId); | recordQ.setTenantId(tenantId); | ||||
| return wxFeesStandardsMapper.getById(recordQ); | return wxFeesStandardsMapper.getById(recordQ); | ||||
| } | } | ||||
| @Override | |||||
| public List<WxFeesStandards> list(WxFeesStandards record) { | |||||
| return wxFeesStandardsMapper.findList(record); | |||||
| } | |||||
| } | } | ||||
| @@ -669,6 +669,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| BillTimeVo billTimeVo = billTimeVoList.get(i); | BillTimeVo billTimeVo = billTimeVoList.get(i); | ||||
| //计算金额 | //计算金额 | ||||
| String needpay = "0"; | String needpay = "0"; | ||||
| //结算其他金额 | |||||
| boolean flag = false; | boolean flag = false; | ||||
| if(yearList.size() > 1) { | if(yearList.size() > 1) { | ||||
| @@ -3042,7 +3042,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| list.add(timeVo); | list.add(timeVo); | ||||
| //next | //next | ||||
| start = DateUtils.getDaySet(timeVo.getEndDate(),Calendar.DATE,1); | |||||
| //start = DateUtils.getDaySet(timeVo.getEndDate(),Calendar.DATE,1); | |||||
| start = DateUtils.getDaySet(timeVo.getEndDate(),Calendar.SECOND,1); | |||||
| if(start.after(end)) { | if(start.after(end)) { | ||||
| break; | break; | ||||
| @@ -60,13 +60,14 @@ | |||||
| <result column="shop_ids" jdbcType="VARCHAR" property="shopIds"/> | <result column="shop_ids" jdbcType="VARCHAR" property="shopIds"/> | ||||
| <result column="shop_numbers" jdbcType="VARCHAR" property="shopNumbers"/> | <result column="shop_numbers" jdbcType="VARCHAR" property="shopNumbers"/> | ||||
| <result column="price_detail" jdbcType="VARCHAR" property="priceDetail"/> | <result column="price_detail" jdbcType="VARCHAR" property="priceDetail"/> | ||||
| <result column="fees_standards_info" jdbcType="VARCHAR" property="feesStandardsInfo"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`merchant_id`,`decimal_size`,`price`,`rental_start_date`,`rental_end_date`,`create_type`,`shop_ids`,`shop_numbers`, | `id`,`merchant_id`,`decimal_size`,`price`,`rental_start_date`,`rental_end_date`,`create_type`,`shop_ids`,`shop_numbers`, | ||||
| `sign_date`,`receive_period`,`tenant_id`,`parent_tenant_id`,`filepath`,`status`,`contract_number`,`price_detail`, | `sign_date`,`receive_period`,`tenant_id`,`parent_tenant_id`,`filepath`,`status`,`contract_number`,`price_detail`, | ||||
| `deposit`,`pay_date`,`is_del`,`merchant_name`,`brand`,`business_id`,`receive_period_unit`, | `deposit`,`pay_date`,`is_del`,`merchant_name`,`brand`,`business_id`,`receive_period_unit`, | ||||
| `shop_type`,`updatetime`,`createtime`,`rent_area`,`rent_shop_type`, | |||||
| `shop_type`,`updatetime`,`createtime`,`rent_area`,`rent_shop_type`,`fees_standards_info`, | |||||
| `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`,fixed_price, | `start_date`,`end_date`,`apply_status`,`adjust_period`,`business_type`,adjust_ratio,`rent_info`,fixed_price, | ||||
| `file_names`,price_unit,rent_price,subject_name,rent_start_type,`operation_type`,late_pay_ratio,late_pay_day,end_contract_time,out_date_notify_days,out_date_notify_phone | `file_names`,price_unit,rent_price,subject_name,rent_start_type,`operation_type`,late_pay_ratio,late_pay_day,end_contract_time,out_date_notify_days,out_date_notify_phone | ||||