winter 1 год назад
Родитель
Сommit
694c4f9519
3 измененных файлов: 42 добавлений и 18 удалений
  1. +2
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java
  2. +2
    -2
      mallinkService/src/main/java/com/iformall/service/WxRentContractService.java
  3. +38
    -14
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java

+ 2
- 2
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java Просмотреть файл

@@ -796,7 +796,7 @@ public class WxRentContractController extends WxContractBaseController {
if (null == wxRentContract.getSalesStartTime() || null == wxRentContract.getSalesEndTime()) { if (null == wxRentContract.getSalesStartTime() || null == wxRentContract.getSalesEndTime()) {
return new ResultData(Result.ERROR, "时间不能为空"); return new ResultData(Result.ERROR, "时间不能为空");
} }
return new ResultData(wxRentContractService.setRevenueSales(rentContract,wxRentContract.getSalesMoney(),wxRentContract.getSalesStartTime(),wxRentContract.getSalesEndTime(),wxRentContract.getPropertyContractId()));
return new ResultData(wxRentContractService.setRevenueSales(this.getUser(),rentContract,wxRentContract.getSalesMoney(),wxRentContract.getSalesStartTime(),wxRentContract.getSalesEndTime(),wxRentContract.getPropertyContractId()));
} }
//查询合同年限 //查询合同年限
@@ -850,7 +850,7 @@ public class WxRentContractController extends WxContractBaseController {
return new ResultData(Result.ERROR, "合同未设置跳点,不用做汇算"); return new ResultData(Result.ERROR, "合同未设置跳点,不用做汇算");
} }
rentContract.setPropertyContractId(wxRentContract.getPropertyContractId()); rentContract.setPropertyContractId(wxRentContract.getPropertyContractId());
return new ResultData(wxRentContractService.calcuteYearsRevenueRentUp(rentContract));
return new ResultData(wxRentContractService.calcuteYearsRevenueRentUp(this.getUser(),rentContract));
} }
//查询合同年度汇算账单列表 //查询合同年度汇算账单列表


+ 2
- 2
mallinkService/src/main/java/com/iformall/service/WxRentContractService.java Просмотреть файл

@@ -150,11 +150,11 @@ public interface WxRentContractService {
List<WxRentContractRevenueSales> getContractSales(WxRentContract wxRentContract); List<WxRentContractRevenueSales> getContractSales(WxRentContract wxRentContract);
WxRentContractRevenueSetSalesVo setRevenueSales(WxRentContract rentcontract,String sales,Date startime, Date endtime,Long propertyContractId);
WxRentContractRevenueSetSalesVo setRevenueSales(MallUserInfo user,WxRentContract rentcontract,String sales,Date startime, Date endtime,Long propertyContractId);
void setContractSalesConfirm(WxRentContract wxRentContract); void setContractSalesConfirm(WxRentContract wxRentContract);
WxRentContractYearsSumVo calcuteYearsRevenueRentUp(WxRentContract rentcontract);
WxRentContractYearsSumVo calcuteYearsRevenueRentUp(MallUserInfo user,WxRentContract rentcontract);
List<WxRentContractRevenueJump> findJumpList(WxRentContractRevenueJump jump); List<WxRentContractRevenueJump> findJumpList(WxRentContractRevenueJump jump);


+ 38
- 14
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java Просмотреть файл

@@ -2768,7 +2768,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class})
@Override @Override
public WxRentContractRevenueSetSalesVo setRevenueSales(WxRentContract rentcontract, String sales, Date startime, Date endtime, Long propertyContractId) {
public WxRentContractRevenueSetSalesVo setRevenueSales(MallUserInfo user,WxRentContract rentcontract, String sales, Date startime, Date endtime, Long propertyContractId) {
//如果账单存在缴费,付款,减免,冲抵,等情况,则不允许。 //如果账单存在缴费,付款,减免,冲抵,等情况,则不允许。
WxAllBill bq = wxBillAllHelper.generateRentContractQueryBill(rentcontract, rentcontract.getId(),startime,endtime); WxAllBill bq = wxBillAllHelper.generateRentContractQueryBill(rentcontract, rentcontract.getId(),startime,endtime);
List<WxAllBill> rentBillList = wxAllBillMapper.findList(bq); List<WxAllBill> rentBillList = wxAllBillMapper.findList(bq);
@@ -2945,10 +2945,10 @@ public class WxRentContractServiceImpl implements WxRentContractService {
sale.setUpdateTime(new Date()); sale.setUpdateTime(new Date());
wxRentContractRevenueSalesMapper.insert(sale); wxRentContractRevenueSalesMapper.insert(sale);
} }
return handleBills(sb,rentcontract,propertyContractId,needpay,rentBillList,startime,endtime,EnumBillExtraCreateFrom.RNET_REVENUE_SALES,propertyBillList,rentPriceArrs,bussinessManagerPriceArrs,operationManagerPriceArrs,propertyContractArrs,yearIndex);
return handleBills(user,sb,rentcontract,propertyContractId,needpay,rentBillList,startime,endtime,EnumBillExtraCreateFrom.RNET_REVENUE_SALES,propertyBillList,rentPriceArrs,bussinessManagerPriceArrs,operationManagerPriceArrs,propertyContractArrs,yearIndex);
} }
private WxRentContractRevenueSetSalesVo handleBills(StringBuffer sb,WxRentContract rentcontract,Long propertyContractId, String needpay,List<WxAllBill> rentBillList,Date startDate,Date endDate,
private WxRentContractRevenueSetSalesVo handleBills(MallUserInfo user,StringBuffer sb,WxRentContract rentcontract,Long propertyContractId, String needpay,List<WxAllBill> rentBillList,Date startDate,Date endDate,
EnumBillExtraCreateFrom createFrom,List<WxAllBill> propertyBillList,String[] rentPriceArrs,String[] bussinessManagerPriceArrs,String[] operationManagerPriceArrs,String[] propertyContractArrs,int yearIndex) { EnumBillExtraCreateFrom createFrom,List<WxAllBill> propertyBillList,String[] rentPriceArrs,String[] bussinessManagerPriceArrs,String[] operationManagerPriceArrs,String[] propertyContractArrs,int yearIndex) {
//计算资金分摊的比例 租金,商业管理费,营业管理费,物业费。每个科目税点不一样,这样分摊能降低成本 //计算资金分摊的比例 租金,商业管理费,营业管理费,物业费。每个科目税点不一样,这样分摊能降低成本
@@ -3000,13 +3000,13 @@ public class WxRentContractServiceImpl implements WxRentContractService {
suq.setStatus(EnumShopUsersStatus.LIVE.getCode()); suq.setStatus(EnumShopUsersStatus.LIVE.getCode());
Map<Long,WxShopUsers> shopUserMap = wxShopService.getShopUserMap(suq); Map<Long,WxShopUsers> shopUserMap = wxShopService.getShopUserMap(suq);
List<WxAllBill> rentBill = generateRentBill(shopIdList,shopUserMap,shopAreaRateMap,rentcontract,rentBillList,rentneedpay,rentRate,startDate,endDate,createFrom);
List<WxAllBill> rentBill = generateRentBill(user,shopIdList,shopUserMap,shopAreaRateMap,rentcontract,rentBillList,rentneedpay,rentRate,startDate,endDate,createFrom);
List<WxAllBill> propeBill = generatePropertyBill(shopIdList,shopUserMap,shopAreaRateMap,rentcontract, propertyContractId,propertyBillList,startDate,endDate, needpay, propertyRate,createFrom);
List<WxAllBill> propeBill = generatePropertyBill(user,shopIdList,shopUserMap,shopAreaRateMap,rentcontract, propertyContractId,propertyBillList,startDate,endDate, needpay, propertyRate,createFrom);
List<WxAllBill> bmbill = generateManageBill(shopIdList,shopUserMap,shopAreaRateMap,rentcontract, startDate,endDate, needpay, bussinessRate, EnumBillAllType.RENT_BUSSINESS_MANAGE,createFrom);
List<WxAllBill> bmbill = generateManageBill(user,shopIdList,shopUserMap,shopAreaRateMap,rentcontract, startDate,endDate, needpay, bussinessRate, EnumBillAllType.RENT_BUSSINESS_MANAGE,createFrom);
List<WxAllBill> ombill = generateManageBill(shopIdList,shopUserMap,shopAreaRateMap,rentcontract, startDate,endDate, needpay, operaterRate, EnumBillAllType.RENT_OPERATION_MANAGE,createFrom);
List<WxAllBill> ombill = generateManageBill(user,shopIdList,shopUserMap,shopAreaRateMap,rentcontract, startDate,endDate, needpay, operaterRate, EnumBillAllType.RENT_OPERATION_MANAGE,createFrom);
WxRentContractRevenueSetSalesVo vo = new WxRentContractRevenueSetSalesVo(); WxRentContractRevenueSetSalesVo vo = new WxRentContractRevenueSetSalesVo();
vo.setTotal(needpay); vo.setTotal(needpay);
@@ -3026,7 +3026,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
} }
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class})
public List<WxAllBill> generateManageBill(List<Long> shopIds,Map<Long,WxShopUsers> shopUserMap,Map<Long, BigDecimal> shopAreaRateMap,WxRentContract rentcontract,
public List<WxAllBill> generateManageBill(MallUserInfo user,List<Long> shopIds,Map<Long,WxShopUsers> shopUserMap,Map<Long, BigDecimal> shopAreaRateMap,WxRentContract rentcontract,
Date starttime, Date endtime,String total,String rate,EnumBillAllType type,EnumBillExtraCreateFrom createFrom) { Date starttime, Date endtime,String total,String rate,EnumBillAllType type,EnumBillExtraCreateFrom createFrom) {
WxAllBill bussinessmanageBill = new WxAllBill(); WxAllBill bussinessmanageBill = new WxAllBill();
bussinessmanageBill.updateTenantInfo(rentcontract); bussinessmanageBill.updateTenantInfo(rentcontract);
@@ -3047,6 +3047,8 @@ public class WxRentContractServiceImpl implements WxRentContractService {
b.setReceivePay("0"); b.setReceivePay("0");
b.setBillRemark("账单金额重新计算生成新账单,原账单金额变为0"); b.setBillRemark("账单金额重新计算生成新账单,原账单金额变为0");
b.setUpdatetime(new Date()); b.setUpdatetime(new Date());
b.setUpdateBy(user.getId());
b.setUpdateByName(user.getName());
wxAllBillMapper.updateById(b); wxAllBillMapper.updateById(b);
} }
} }
@@ -3077,13 +3079,19 @@ public class WxRentContractServiceImpl implements WxRentContractService {
} }
b.setCusName(cusName); b.setCusName(cusName);
b.setCreatetime(new Date()); b.setCreatetime(new Date());
b.setCreateBy(user.getId());
b.setCreateByName(user.getName());
b.setUpdatetime(new Date()); b.setUpdatetime(new Date());
b.setUpdateBy(user.getId());
b.setUpdateByName(user.getName());
b.setPriceDetail(""); b.setPriceDetail("");
b.setNeedPay(newmoney); b.setNeedPay(newmoney);
b.setReceivePay(newmoney); b.setReceivePay(newmoney);
b.setPay("0"); b.setPay("0");
b.setStarttime(starttime); b.setStarttime(starttime);
b.setEndtime(endtime); b.setEndtime(endtime);
b.setReceiveDate(starttime);
b.setPeriod(WxRentContractHelper.getPeriod(starttime));
b.setBillRemark(createFrom.getMessage()+"自动计算创建,科目总计分摊比率为:"+rate+",总应收金额为:"+bussinessmoney+"元,"+",本铺分担比例"+shoprate.toEngineeringString()); b.setBillRemark(createFrom.getMessage()+"自动计算创建,科目总计分摊比率为:"+rate+",总应收金额为:"+bussinessmoney+"元,"+",本铺分担比例"+shoprate.toEngineeringString());
b.setExtraCreateFrom(createFrom.getCode()); b.setExtraCreateFrom(createFrom.getCode());
b.setMoneyChangeDetail("自动计算创建,科目总计分摊比率为:"+rate+",总应收金额为:"+bussinessmoney+"元,"+",本铺分担比例"+shoprate.toEngineeringString()); b.setMoneyChangeDetail("自动计算创建,科目总计分摊比率为:"+rate+",总应收金额为:"+bussinessmoney+"元,"+",本铺分担比例"+shoprate.toEngineeringString());
@@ -3097,7 +3105,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
} }
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class})
public List<WxAllBill> generatePropertyBill(List<Long> shopIds,Map<Long,WxShopUsers> shopUserMap,Map<Long, BigDecimal> shopAreaRateMap,WxRentContract rentcontract,
public List<WxAllBill> generatePropertyBill(MallUserInfo user,List<Long> shopIds,Map<Long,WxShopUsers> shopUserMap,Map<Long, BigDecimal> shopAreaRateMap,WxRentContract rentcontract,
Long propertyContractId,List<WxAllBill> propertyBillList,Date starttime,Date endtime,String total,String rate,EnumBillExtraCreateFrom createFrom) { Long propertyContractId,List<WxAllBill> propertyBillList,Date starttime,Date endtime,String total,String rate,EnumBillExtraCreateFrom createFrom) {
String bussinessmoney = new BigDecimal(total).multiply(new BigDecimal(rate)).setScale(rentcontract.getDecimalSize(),BigDecimal.ROUND_HALF_UP).toPlainString(); String bussinessmoney = new BigDecimal(total).multiply(new BigDecimal(rate)).setScale(rentcontract.getDecimalSize(),BigDecimal.ROUND_HALF_UP).toPlainString();
if (null != propertyBillList ) { if (null != propertyBillList ) {
@@ -3108,6 +3116,8 @@ public class WxRentContractServiceImpl implements WxRentContractService {
_rb.setReceivePay("0"); _rb.setReceivePay("0");
_rb.setBillRemark("账单金额重新计算生成新账单,原账单金额变为0"); _rb.setBillRemark("账单金额重新计算生成新账单,原账单金额变为0");
_rb.setUpdatetime(new Date()); _rb.setUpdatetime(new Date());
_rb.setUpdateBy(user.getId());
_rb.setUpdateByName(user.getName());
wxAllBillMapper.updateById(_rb); wxAllBillMapper.updateById(_rb);
} }
} }
@@ -3139,13 +3149,19 @@ public class WxRentContractServiceImpl implements WxRentContractService {
} }
bmbill.setCusName(cusName); bmbill.setCusName(cusName);
bmbill.setCreatetime(new Date()); bmbill.setCreatetime(new Date());
bmbill.setCreateBy(user.getId());
bmbill.setCreateByName(user.getName());
bmbill.setUpdatetime(new Date()); bmbill.setUpdatetime(new Date());
bmbill.setUpdateBy(user.getId());
bmbill.setUpdateByName(user.getName());
bmbill.setPriceDetail(""); bmbill.setPriceDetail("");
bmbill.setNeedPay(bussinessmoney); bmbill.setNeedPay(bussinessmoney);
bmbill.setReceivePay(bussinessmoney); bmbill.setReceivePay(bussinessmoney);
bmbill.setPay("0"); bmbill.setPay("0");
bmbill.setStarttime(starttime); bmbill.setStarttime(starttime);
bmbill.setEndtime(endtime); bmbill.setEndtime(endtime);
bmbill.setReceiveDate(starttime);
bmbill.setPeriod(WxRentContractHelper.getPeriod(starttime));
bmbill.setBillRemark(createFrom.getMessage()+".自动计算创建,科目分摊比率为:"+rate+",总应收金额为:"+bussinessmoney+"元,"+",本铺分担比例"+shoprate.toEngineeringString()); bmbill.setBillRemark(createFrom.getMessage()+".自动计算创建,科目分摊比率为:"+rate+",总应收金额为:"+bussinessmoney+"元,"+",本铺分担比例"+shoprate.toEngineeringString());
bmbill.setExtraCreateFrom(createFrom.getCode()); bmbill.setExtraCreateFrom(createFrom.getCode());
bmbill.setMoneyChangeDetail("自动计算创建,科目分摊比率为:"+rate+",总应收金额为:"+bussinessmoney+"元,"+",本铺分担比例"+shoprate.toEngineeringString()); bmbill.setMoneyChangeDetail("自动计算创建,科目分摊比率为:"+rate+",总应收金额为:"+bussinessmoney+"元,"+",本铺分担比例"+shoprate.toEngineeringString());
@@ -3159,7 +3175,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
} }
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class})
public List<WxAllBill> generateRentBill(List<Long> shopIds,Map<Long,WxShopUsers> shopUserMap,Map<Long, BigDecimal> shopAreaRateMap,WxRentContract rentcontract,
public List<WxAllBill> generateRentBill(MallUserInfo user,List<Long> shopIds,Map<Long,WxShopUsers> shopUserMap,Map<Long, BigDecimal> shopAreaRateMap,WxRentContract rentcontract,
List<WxAllBill> rentBillList,String money,String rate,Date starttime,Date endtime,EnumBillExtraCreateFrom createFrom) { List<WxAllBill> rentBillList,String money,String rate,Date starttime,Date endtime,EnumBillExtraCreateFrom createFrom) {
//rentBillList , 如果是多个房间,则就有几个租金账单 //rentBillList , 如果是多个房间,则就有几个租金账单
if (null != rentBillList && rentBillList.size() > 0 ) { if (null != rentBillList && rentBillList.size() > 0 ) {
@@ -3170,6 +3186,8 @@ public class WxRentContractServiceImpl implements WxRentContractService {
b.setReceivePay("0"); b.setReceivePay("0");
b.setBillRemark("账单金额重新计算生成新账单,原账单金额变为0"); b.setBillRemark("账单金额重新计算生成新账单,原账单金额变为0");
b.setUpdatetime(new Date()); b.setUpdatetime(new Date());
b.setUpdateBy(user.getId());
b.setUpdateByName(user.getName());
wxAllBillMapper.updateById(b); wxAllBillMapper.updateById(b);
} }
} }
@@ -3198,13 +3216,19 @@ public class WxRentContractServiceImpl implements WxRentContractService {
} }
bmbill.setCusName(cusName); bmbill.setCusName(cusName);
bmbill.setCreatetime(new Date()); bmbill.setCreatetime(new Date());
bmbill.setCreateBy(user.getId());
bmbill.setCreateByName(user.getName());
bmbill.setUpdatetime(new Date()); bmbill.setUpdatetime(new Date());
bmbill.setUpdateBy(user.getId());
bmbill.setUpdateByName(user.getName());
bmbill.setPriceDetail(""); bmbill.setPriceDetail("");
bmbill.setNeedPay(new BigDecimal(money).multiply(shoprate).toPlainString()); bmbill.setNeedPay(new BigDecimal(money).multiply(shoprate).toPlainString());
bmbill.setReceivePay(bmbill.getNeedPay()); bmbill.setReceivePay(bmbill.getNeedPay());
bmbill.setPay("0"); bmbill.setPay("0");
bmbill.setStarttime(starttime); bmbill.setStarttime(starttime);
bmbill.setEndtime(endtime); bmbill.setEndtime(endtime);
bmbill.setReceiveDate(starttime);
bmbill.setPeriod(WxRentContractHelper.getPeriod(starttime));
bmbill.setBillRemark(createFrom.getMessage()+".自动计算创建,科目分摊比例为"+rate+",计算总应收金额为:"+money+"元,"+",本铺分担比例"+shoprate.toEngineeringString()); bmbill.setBillRemark(createFrom.getMessage()+".自动计算创建,科目分摊比例为"+rate+",计算总应收金额为:"+money+"元,"+",本铺分担比例"+shoprate.toEngineeringString());
bmbill.setExtraCreateFrom(createFrom.getCode()); bmbill.setExtraCreateFrom(createFrom.getCode());
bmbill.setMoneyChangeDetail("自动计算创建,科目分摊比例为"+rate+",计算总应收金额为:"+money+"元,"+",本铺分担比例"+shoprate.toEngineeringString()); bmbill.setMoneyChangeDetail("自动计算创建,科目分摊比例为"+rate+",计算总应收金额为:"+money+"元,"+",本铺分担比例"+shoprate.toEngineeringString());
@@ -3226,7 +3250,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class})
@Override @Override
public WxRentContractYearsSumVo calcuteYearsRevenueRentUp(WxRentContract rentcontract) {
public WxRentContractYearsSumVo calcuteYearsRevenueRentUp(MallUserInfo user,WxRentContract rentcontract) {
//查询销售总数 //查询销售总数
WxRentContractRevenueSales rsq = new WxRentContractRevenueSales(); WxRentContractRevenueSales rsq = new WxRentContractRevenueSales();
rsq.updateTenantInfo(rentcontract); rsq.updateTenantInfo(rentcontract);
@@ -3319,14 +3343,14 @@ public class WxRentContractServiceImpl implements WxRentContractService {
vo.setBillReceivePay(receivepay.toPlainString()); vo.setBillReceivePay(receivepay.toPlainString());
if ( new BigDecimal(vo.getOwe()).compareTo(new BigDecimal(0)) > 0) { if ( new BigDecimal(vo.getOwe()).compareTo(new BigDecimal(0)) > 0) {
WxRentContractRevenueSetSalesVo svo = handelHuiSuanBills(rentcontract,vo.getOwe());
WxRentContractRevenueSetSalesVo svo = handelHuiSuanBills(user,rentcontract,vo.getOwe());
vo.setBillList(svo.getBillList()); vo.setBillList(svo.getBillList());
} }
return vo; return vo;
} }
private WxRentContractRevenueSetSalesVo handelHuiSuanBills(WxRentContract rentcontract,String owe) {
private WxRentContractRevenueSetSalesVo handelHuiSuanBills(MallUserInfo user,WxRentContract rentcontract,String owe) {
//计算每一年的基数 //计算每一年的基数
List<String[]> priceArrs = WxRentContractHelper.calcuteRentAndRevenuePrice(rentcontract); List<String[]> priceArrs = WxRentContractHelper.calcuteRentAndRevenuePrice(rentcontract);
String[] rentPriceArrs = priceArrs.get(0); String[] rentPriceArrs = priceArrs.get(0);
@@ -3351,7 +3375,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
yearIndex = 0; yearIndex = 0;
} }
StringBuffer sb = new StringBuffer(""); StringBuffer sb = new StringBuffer("");
return handleBills(sb,rentcontract,null,owe,null,rentcontract.getYearsBegin(),rentcontract.getYearsEnd(),EnumBillExtraCreateFrom.RNET_TIAODIAN_HUISUAN,null,rentPriceArrs,bussinessManagerPriceArrs,operationManagerPriceArrs,propertyContractArrs,yearIndex);
return handleBills(user,sb,rentcontract,null,owe,null,rentcontract.getYearsBegin(),rentcontract.getYearsEnd(),EnumBillExtraCreateFrom.RNET_TIAODIAN_HUISUAN,null,rentPriceArrs,bussinessManagerPriceArrs,operationManagerPriceArrs,propertyContractArrs,yearIndex);
} }


Загрузка…
Отмена
Сохранить