| @@ -666,6 +666,27 @@ public class WxAgileContractController extends WxContractBaseController { | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| /** | |||||
| * 设置合同跳点汇算是否按照实际天数来算 | |||||
| */ | |||||
| @PostMapping("setRevenueJumpByRealDays") | |||||
| public ResultData setRevenueJumpByRealDays(@RequestBody WxRentContract rentContract) { | |||||
| if (null == rentContract.getId() || null == rentContract.getRevenueJumpByRealDays()) { | |||||
| return new ResultData(Result.ERROR,"参数错误"); | |||||
| } | |||||
| rentContract.updateTenantInfo(getTenantInfo()); | |||||
| WxRentContract rc = wxAgileContractService.selectById(rentContract.getId()); | |||||
| if (null == rc) { | |||||
| return new ResultData(Result.ERROR,"合同未查询到"); | |||||
| } | |||||
| try { | |||||
| wxAgileContractService.updateRevenueJumpByRealDays(rentContract); | |||||
| }catch(Exception e) { | |||||
| return new ResultData(Result.ERROR,"保存信息失败:"+e.getMessage()); | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("billList") | @GetMapping("billList") | ||||
| @@ -413,6 +413,22 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| return new ResultData(wxRentContractService.setRevenueSales(this.getUser(),rentContract,wxRentContract.getSalesMoney(),wxRentContract.getSalesStartTime(),wxRentContract.getSalesEndTime())); | return new ResultData(wxRentContractService.setRevenueSales(this.getUser(),rentContract,wxRentContract.getSalesMoney(),wxRentContract.getSalesStartTime(),wxRentContract.getSalesEndTime())); | ||||
| } | } | ||||
| //查询合同年度汇算账单列表 | |||||
| @GetMapping("getRevenueSalesBills") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData getRevenueSalesBills(@ModelAttribute WxRentContract wxRentContract, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxRentContract) wxRentContract = new WxRentContract(); | |||||
| WxRentContract rentContract = wxRentContractMapper.selectById(wxRentContract.getId()); | |||||
| WxAllBill billd = new WxAllBill(); | |||||
| billd.updateTenantInfo(rentContract); | |||||
| billd.setRentContractId(rentContract.getId()); | |||||
| billd.setExtraCreateFrom(EnumBillExtraCreateFrom.RNET_REVENUE_SALES.getCode()); | |||||
| billd.setStarttimeEqual(wxRentContract.getSalesStartTime()); | |||||
| return new ResultData(wxAllBillService.listAsPage(billd,pageNum,pageSize)); | |||||
| } | |||||
| //查询合同年限 | //查询合同年限 | ||||
| @GetMapping("getContractYears") | @GetMapping("getContractYears") | ||||
| public ResultData getContractYears(@ModelAttribute WxRentContract wxRentContract) { | public ResultData getContractYears(@ModelAttribute WxRentContract wxRentContract) { | ||||
| @@ -123,6 +123,8 @@ public class WxRentContract extends TenantEntity { | |||||
| private String remark; | private String remark; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "来源ID,用于履约中合同修改影子数据", name = "orginId") | @io.swagger.annotations.ApiModelProperty(value = "来源ID,用于履约中合同修改影子数据", name = "orginId") | ||||
| private Long orginId; | private Long orginId; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "跳点汇算是否按照实际天数来计算EnumYesOrNo", name = "revenueJumpByRealDays") | |||||
| private Integer revenueJumpByRealDays; | |||||
| public List<Long> shopIdsByRentInfo() { | public List<Long> shopIdsByRentInfo() { | ||||
| List<Long> shopList = Lists.newArrayList(); | List<Long> shopList = Lists.newArrayList(); | ||||
| @@ -42,4 +42,6 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Long> | |||||
| List<WxRentContract> findToEndContractList(WxRentContract rentContract); | List<WxRentContract> findToEndContractList(WxRentContract rentContract); | ||||
| void setOrgIdNull(@Param("tenantId") String tenantId,@Param("id") Long id,@Param("orgId") Long orgId); | void setOrgIdNull(@Param("tenantId") String tenantId,@Param("id") Long id,@Param("orgId") Long orgId); | ||||
| void setRevenueJumpByRealDays(WxRentContract rentContract); | |||||
| } | } | ||||
| @@ -92,4 +92,6 @@ public interface WxAgileContractService { | |||||
| void deleteContract(Long id,TenantEntity tenantEntity); | void deleteContract(Long id,TenantEntity tenantEntity); | ||||
| void deleteContractFees(Long id,TenantEntity tenantEntity); | void deleteContractFees(Long id,TenantEntity tenantEntity); | ||||
| void updateRevenueJumpByRealDays(WxRentContract rentContract); | |||||
| } | } | ||||
| @@ -1333,7 +1333,7 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||||
| ari.setRentContractId(newContractId); | ari.setRentContractId(newContractId); | ||||
| ari.setRenevueId(renevueId); | ari.setRenevueId(renevueId); | ||||
| ari.setBeginTime(rentContract.getRentalStartDate()); | ari.setBeginTime(rentContract.getRentalStartDate()); | ||||
| ari.setBeginTime(rentContract.getRentalEndDate()); | |||||
| ari.setEndTime(rentContract.getRentalEndDate()); | |||||
| ari.setRate("0"); | ari.setRate("0"); | ||||
| ari.setIsFree(EnumYesOrNo.NO.getCode()); | ari.setIsFree(EnumYesOrNo.NO.getCode()); | ||||
| ari.setIsFather(EnumYesOrNo.YES.getCode()); | ari.setIsFather(EnumYesOrNo.YES.getCode()); | ||||
| @@ -1518,4 +1518,9 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||||
| brDel.setIsPreview(EnumYesOrNo.YES.getCode()); | brDel.setIsPreview(EnumYesOrNo.YES.getCode()); | ||||
| wxAllBillMapper.deletePreviewBill(brDel); | wxAllBillMapper.deletePreviewBill(brDel); | ||||
| } | } | ||||
| @Override | |||||
| public void updateRevenueJumpByRealDays(WxRentContract rentContract) { | |||||
| wxRentContractMapper.setRevenueJumpByRealDays(rentContract); | |||||
| } | |||||
| } | } | ||||
| @@ -1284,18 +1284,22 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| BigDecimal jumpRevenuePay = jumppays[0]; | BigDecimal jumpRevenuePay = jumppays[0]; | ||||
| //BigDecimal jumpRentPay = jumppays[1]; | //BigDecimal jumpRentPay = jumppays[1]; | ||||
| //销售收入不满足一年怎么算。 | |||||
| int yearDays = DateUtils.daysBetween(rentcontract.getYearsBegin(), rentcontract.getYearsEnd())+1; | |||||
| //闰年是366 | |||||
| if (yearDays >= 365) { | |||||
| }else { | |||||
| if (rentcontract.getDayPriceCalcute().intValue() == EnumRentDayPriceCalcute.AVERAGE_DAYS.getCode()) { | |||||
| jumpRevenuePay = jumpRevenuePay.multiply(new BigDecimal(yearDays)).divide(new BigDecimal(12*rentcontract.getMonthAverageDays()),rentcontract.getDecimalSize(),BigDecimal.ROUND_HALF_UP); | |||||
| if (null != rentcontract.getRevenueJumpByRealDays() && rentcontract.getRevenueJumpByRealDays().intValue() == EnumYesOrNo.YES.getCode()) { | |||||
| //销售收入不满足一年怎么算。 | |||||
| int yearDays = DateUtils.daysBetween(rentcontract.getYearsBegin(), rentcontract.getYearsEnd())+1; | |||||
| //闰年是366 | |||||
| if (yearDays >= 365) { | |||||
| }else { | }else { | ||||
| jumpRevenuePay = jumpRevenuePay.multiply(new BigDecimal(yearDays)).divide(new BigDecimal(365),rentcontract.getDecimalSize(),BigDecimal.ROUND_HALF_UP); | |||||
| if (rentcontract.getDayPriceCalcute().intValue() == EnumRentDayPriceCalcute.AVERAGE_DAYS.getCode()) { | |||||
| jumpRevenuePay = jumpRevenuePay.multiply(new BigDecimal(yearDays)).divide(new BigDecimal(12*rentcontract.getMonthAverageDays()),rentcontract.getDecimalSize(),BigDecimal.ROUND_HALF_UP); | |||||
| }else { | |||||
| jumpRevenuePay = jumpRevenuePay.multiply(new BigDecimal(yearDays)).divide(new BigDecimal(365),rentcontract.getDecimalSize(),BigDecimal.ROUND_HALF_UP); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| //查询未删除的参与扣点计算的非押金账单或者录入销售额生成的账单之和 | //查询未删除的参与扣点计算的非押金账单或者录入销售额生成的账单之和 | ||||
| BigDecimal receivepay = getAllRenevueBillsReceivePayTotal(rentcontract,rentcontract.getYearsBegin(),rentcontract.getYearsEnd()); | BigDecimal receivepay = getAllRenevueBillsReceivePayTotal(rentcontract,rentcontract.getYearsBegin(),rentcontract.getYearsEnd()); | ||||
| if (null == receivepay ){ | if (null == receivepay ){ | ||||
| @@ -37,6 +37,7 @@ | |||||
| <result column="shop_id_str" jdbcType="VARCHAR" property="shopIdStr"/> | <result column="shop_id_str" jdbcType="VARCHAR" property="shopIdStr"/> | ||||
| <result column="remark" jdbcType="VARCHAR" property="remark"/> | <result column="remark" jdbcType="VARCHAR" property="remark"/> | ||||
| <result column="orgin_id" jdbcType="BIGINT" property="orginId"/> | <result column="orgin_id" jdbcType="BIGINT" property="orginId"/> | ||||
| <result column="revenue_jump_by_real_days" jdbcType="BIGINT" property="revenueJumpByRealDays"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| @@ -51,7 +52,7 @@ | |||||
| `apply_status`,`create_by_name`,`update_by_name`, | `apply_status`,`create_by_name`,`update_by_name`, | ||||
| `rent_info`, `file_names`, | `rent_info`, `file_names`, | ||||
| shop_id_str, | shop_id_str, | ||||
| design_file,remark,orgin_id | |||||
| design_file,remark,orgin_id,revenue_jump_by_real_days | |||||
| </sql> | </sql> | ||||
| @@ -60,6 +61,7 @@ | |||||
| <if test=" null != id ">and `id` = #{id}</if> | <if test=" null != id ">and `id` = #{id}</if> | ||||
| <if test=" null != fromId ">and `from_id` = #{fromId}</if> | <if test=" null != fromId ">and `from_id` = #{fromId}</if> | ||||
| <if test=" null != orginId ">and `orgin_id` = #{orginId}</if> | <if test=" null != orginId ">and `orgin_id` = #{orginId}</if> | ||||
| <if test=" null != revenueJumpByRealDays ">and `revenue_jump_by_real_days` = #{revenueJumpByRealDays}</if> | |||||
| <if test=" null != customersId ">and `customers_id` = #{customersId}</if> | <if test=" null != customersId ">and `customers_id` = #{customersId}</if> | ||||
| <if test=" null != rentalStartDate and '' != rentalStartDate">and `rental_start_date` = #{rentalStartDate}</if> | <if test=" null != rentalStartDate and '' != rentalStartDate">and `rental_start_date` = #{rentalStartDate}</if> | ||||
| <if test=" null != rentalEndDate and '' != rentalEndDate">and `rental_end_date` = #{rentalEndDate}</if> | <if test=" null != rentalEndDate and '' != rentalEndDate">and `rental_end_date` = #{rentalEndDate}</if> | ||||
| @@ -247,5 +249,9 @@ | |||||
| update wx_rent_contract set orgin_id = null,remark=concat('来自',#{orgId},'编辑') where id = #{id} and `tenant_id` = #{tenantId} | update wx_rent_contract set orgin_id = null,remark=concat('来自',#{orgId},'编辑') where id = #{id} and `tenant_id` = #{tenantId} | ||||
| </update> | </update> | ||||
| <update id = "setRevenueJumpByRealDays" parameterType="com.iformall.domain.po.WxRentContract" > | |||||
| update wx_rent_contract set revenue_jump_by_real_days = #{revenueJumpByRealDays} where id = #{id} and `tenant_id` = #{tenantId} | |||||
| </update> | |||||
| </mapper> | </mapper> | ||||