| @@ -3,20 +3,37 @@ package com.iformall.controller.contract; | |||||
| import com.alibaba.fastjson.JSONArray; | import com.alibaba.fastjson.JSONArray; | ||||
| import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.annotation.SystemControllerLog; | |||||
| import com.iformall.annotation.TenantIgnore; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.*; | |||||
| import com.iformall.domain.po.MallUserInfo; | |||||
| import com.iformall.domain.po.WxAllBill; | |||||
| import com.iformall.domain.po.WxContractCustomers; | |||||
| import com.iformall.domain.po.WxFinanceFees; | |||||
| import com.iformall.domain.po.WxRentContract; | |||||
| import com.iformall.domain.po.WxRentContractAgileRenevue; | |||||
| import com.iformall.domain.po.WxRentContractAgileUnDeposit; | |||||
| import com.iformall.domain.po.WxRentContractRevenueJump; | |||||
| import com.iformall.domain.po.WxUserDataRule; | |||||
| import com.iformall.domain.po.base.BaseEntity; | import com.iformall.domain.po.base.BaseEntity; | ||||
| import com.iformall.domain.po.base.BaseEntity.SortField; | |||||
| import com.iformall.domain.vo.ShopValidAreaVo; | import com.iformall.domain.vo.ShopValidAreaVo; | ||||
| import com.iformall.domain.vo.WxRentContractYearsVo; | import com.iformall.domain.vo.WxRentContractYearsVo; | ||||
| import com.iformall.enums.*; | |||||
| import com.iformall.enums.EnumAgileContractType; | |||||
| import com.iformall.enums.EnumContractCustomersStatus; | |||||
| import com.iformall.enums.EnumFeesShopTimeType; | |||||
| import com.iformall.enums.EnumRentContractAgilPriceUnit; | |||||
| import com.iformall.enums.EnumRentContractAgilSettingMethod; | |||||
| import com.iformall.enums.EnumRentContractAgilTimeUnit; | |||||
| import com.iformall.enums.EnumRentContractStatus; | |||||
| import com.iformall.enums.EnumShopUsersPrincipalType; | |||||
| import com.iformall.enums.EnumYesOrNo; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxRentContractMapper; | import com.iformall.mapper.WxRentContractMapper; | ||||
| import com.iformall.service.*; | |||||
| import com.iformall.service.WxAgileContractService; | |||||
| import com.iformall.service.WxAllBillService; | |||||
| import com.iformall.service.WxFinanceService; | |||||
| import com.iformall.service.WxMallBuildingService; | |||||
| import com.iformall.service.WxMallFloorService; | |||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| @@ -48,20 +65,14 @@ public class WxAgileContractController extends WxContractBaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxAllBillService wxAllBillService; | private WxAllBillService wxAllBillService; | ||||
| @Autowired | @Autowired | ||||
| private WxPayAccountBillService payAccountBillService; | |||||
| @Autowired | |||||
| private WxMerchantService wxMerchantService; | |||||
| @Autowired | |||||
| private WxRentContractMapper wxRentContractMapper; | private WxRentContractMapper wxRentContractMapper; | ||||
| @Autowired | @Autowired | ||||
| private WxShopService wxShopService; | |||||
| @Autowired | |||||
| WxMallBuildingService buildingService; | WxMallBuildingService buildingService; | ||||
| @Autowired | @Autowired | ||||
| WxMallFloorService floorService; | WxMallFloorService floorService; | ||||
| @Autowired | @Autowired | ||||
| WxEnergyService wxEnergyService; | |||||
| WxFinanceService wxFinanceService; | |||||
| @GetMapping("/list") | @GetMapping("/list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @@ -344,7 +355,7 @@ public class WxAgileContractController extends WxContractBaseController { | |||||
| dt.setIsDel(EnumYesOrNo.NO.getCode()); | dt.setIsDel(EnumYesOrNo.NO.getCode()); | ||||
| dt.setIsDespoit(EnumYesOrNo.YES.getCode()); | dt.setIsDespoit(EnumYesOrNo.YES.getCode()); | ||||
| dt.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | dt.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | ||||
| PageInfo<WxFinanceFees> page = wxEnergyService.feesListAsPage(dt, 1, 100,false); | |||||
| PageInfo<WxFinanceFees> page = wxFinanceService.feesListAsPage(dt, 1, 100,false); | |||||
| if (null == page) { | if (null == page) { | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -359,7 +370,7 @@ public class WxAgileContractController extends WxContractBaseController { | |||||
| dt.setIsDespoit(EnumYesOrNo.NO.getCode()); | dt.setIsDespoit(EnumYesOrNo.NO.getCode()); | ||||
| //dt.setIsPublic(EnumYesOrNo.NO.getCode()); | //dt.setIsPublic(EnumYesOrNo.NO.getCode()); | ||||
| dt.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | dt.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | ||||
| PageInfo<WxFinanceFees> page = wxEnergyService.feesListAsPage(dt, 1, 100,false); | |||||
| PageInfo<WxFinanceFees> page = wxFinanceService.feesListAsPage(dt, 1, 100,false); | |||||
| if (null == page) { | if (null == page) { | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -31,6 +31,7 @@ import com.iformall.enums.EnumYesOrNo; | |||||
| import com.iformall.enums.EnumeElectriType; | import com.iformall.enums.EnumeElectriType; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.WxEnergyService; | import com.iformall.service.WxEnergyService; | ||||
| import com.iformall.service.WxFinanceService; | |||||
| import com.iformall.service.WxMallFloorService; | import com.iformall.service.WxMallFloorService; | ||||
| import com.iformall.service.WxShopService; | import com.iformall.service.WxShopService; | ||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| @@ -69,6 +70,9 @@ public class WxEnergyController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxEnergyService wxEnergyService; | private WxEnergyService wxEnergyService; | ||||
| @Autowired | |||||
| private WxFinanceService wxFinanceService; | |||||
| @Autowired | @Autowired | ||||
| private WxMallFloorService wxMallFloorService; | private WxMallFloorService wxMallFloorService; | ||||
| @@ -578,34 +582,34 @@ public class WxEnergyController extends BaseController { | |||||
| return new ResultData(wxEnergyService.getTimeShopNumber(record)); | return new ResultData(wxEnergyService.getTimeShopNumber(record)); | ||||
| } | } | ||||
| @ApiOperation("能源科目列表") | |||||
| @GetMapping("feesList") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||||
| }) | |||||
| public ResultData feesList(@ModelAttribute WxFinanceFees record, Integer pageNum, Integer pageSize) { | |||||
| record.updateTenantInfo(getTenantInfo()); | |||||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||||
| if (null != record.getIsFeesShopQuery() && record.getIsFeesShopQuery() == EnumYesOrNo.YES.getCode()) { | |||||
| //record.setCashierType(EnumFinanceCashierType.RECEIVE.getCode()); | |||||
| //record.setFixedPrice(EnumYesOrNo.NO.getCode()); | |||||
| }else { | |||||
| } | |||||
| PageInfo<WxFinanceFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,false); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("科目新增") | |||||
| @PostMapping("saveFees") | |||||
| public ResultData saveFees(@RequestBody WxFinanceFees record) { | |||||
| record.updateTenantInfo(getTenantInfo()); | |||||
| // if (null == record.getFixedPrice()) { | |||||
| // return new ResultData(Result.ERROR,"请选择是否是一次性费用"); | |||||
| // @ApiOperation("能源科目列表") | |||||
| // @GetMapping("feesList") | |||||
| // @ApiImplicitParams({ | |||||
| // @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| // @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||||
| // }) | |||||
| // public ResultData feesList(@ModelAttribute WxFinanceFees record, Integer pageNum, Integer pageSize) { | |||||
| // record.updateTenantInfo(getTenantInfo()); | |||||
| // record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||||
| // if (null != record.getIsFeesShopQuery() && record.getIsFeesShopQuery() == EnumYesOrNo.YES.getCode()) { | |||||
| // //record.setCashierType(EnumFinanceCashierType.RECEIVE.getCode()); | |||||
| // //record.setFixedPrice(EnumYesOrNo.NO.getCode()); | |||||
| // }else { | |||||
| // } | // } | ||||
| wxEnergyService.saveOrUpdateFees(record); | |||||
| return new ResultData(); | |||||
| } | |||||
| // PageInfo<WxFinanceFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,false); | |||||
| // return new ResultData(page); | |||||
| // } | |||||
| // @ApiOperation("科目新增") | |||||
| // @PostMapping("saveFees") | |||||
| // public ResultData saveFees(@RequestBody WxFinanceFees record) { | |||||
| // record.updateTenantInfo(getTenantInfo()); | |||||
| //// if (null == record.getFixedPrice()) { | |||||
| //// return new ResultData(Result.ERROR,"请选择是否是一次性费用"); | |||||
| //// } | |||||
| // wxEnergyService.saveOrUpdateFees(record); | |||||
| // return new ResultData(); | |||||
| // } | |||||
| @ApiOperation("临时付款给商户科目新增") | @ApiOperation("临时付款给商户科目新增") | ||||
| @PostMapping("saveToPayMerchantFees") | @PostMapping("saveToPayMerchantFees") | ||||
| @@ -614,16 +618,16 @@ public class WxEnergyController extends BaseController { | |||||
| //record.setCashierType(EnumFinanceCashierType.PAY.getCode()); | //record.setCashierType(EnumFinanceCashierType.PAY.getCode()); | ||||
| //record.setFixedPrice(EnumYesOrNo.YES.getCode()); | //record.setFixedPrice(EnumYesOrNo.YES.getCode()); | ||||
| record.setIsDespoit(EnumYesOrNo.YES.getCode()); | record.setIsDespoit(EnumYesOrNo.YES.getCode()); | ||||
| wxEnergyService.saveOrUpdateFees(record); | |||||
| wxFinanceService.saveOrUpdateFees(record); | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @PostMapping("feesUpdateIsDel") | |||||
| public ResultData feesUpdateIsDel(@RequestBody WxFinanceFees record) { | |||||
| record.updateTenantInfo(getTenantInfo()); | |||||
| wxEnergyService.setFeesIsDel(record); | |||||
| return new ResultData(); | |||||
| } | |||||
| // @PostMapping("feesUpdateIsDel") | |||||
| // public ResultData feesUpdateIsDel(@RequestBody WxFinanceFees record) { | |||||
| // record.updateTenantInfo(getTenantInfo()); | |||||
| // wxFinanceService.setFeesIsDel(record); | |||||
| // return new ResultData(); | |||||
| // } | |||||
| @ApiOperation("抄表数据分页列表接口") | @ApiOperation("抄表数据分页列表接口") | ||||
| @GetMapping("readingList") | @GetMapping("readingList") | ||||
| @@ -70,8 +70,6 @@ public class WxFinanceController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxFinanceService wxFinanceService; | private WxFinanceService wxFinanceService; | ||||
| @Autowired | @Autowired | ||||
| WxEnergyService wxEnergyService; | |||||
| @Autowired | |||||
| WxFlowService wxFlowService; | WxFlowService wxFlowService; | ||||
| @GetMapping("receiveCashierTypes") | @GetMapping("receiveCashierTypes") | ||||
| @@ -97,7 +95,7 @@ public class WxFinanceController extends BaseController { | |||||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | ||||
| record.setFeesType(EnumFeesType.NOMAL.getCode()); | record.setFeesType(EnumFeesType.NOMAL.getCode()); | ||||
| //record.setCashierType(EnumFinanceCashierType.RECEIVE.getCode()); | //record.setCashierType(EnumFinanceCashierType.RECEIVE.getCode()); | ||||
| PageInfo<WxFinanceFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,false); | |||||
| PageInfo<WxFinanceFees> page = wxFinanceService.feesListAsPage(record, pageNum, pageSize,false); | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -112,7 +110,7 @@ public class WxFinanceController extends BaseController { | |||||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | ||||
| record.setFeesType(EnumFeesType.ADVANCE.getCode()); | record.setFeesType(EnumFeesType.ADVANCE.getCode()); | ||||
| //record.setCashierType(EnumFinanceCashierType.RECEIVE.getCode()); | //record.setCashierType(EnumFinanceCashierType.RECEIVE.getCode()); | ||||
| PageInfo<WxFinanceFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,true); | |||||
| PageInfo<WxFinanceFees> page = wxFinanceService.feesListAsPage(record, pageNum, pageSize,true); | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -120,7 +118,7 @@ public class WxFinanceController extends BaseController { | |||||
| @PostMapping("saveFees") | @PostMapping("saveFees") | ||||
| public ResultData saveFees(@RequestBody WxFinanceFees record) { | public ResultData saveFees(@RequestBody WxFinanceFees record) { | ||||
| record.updateTenantInfo(getTenantInfo()); | record.updateTenantInfo(getTenantInfo()); | ||||
| wxEnergyService.saveOrUpdateFees(record); | |||||
| wxFinanceService.saveOrUpdateFees(record); | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -130,14 +128,14 @@ public class WxFinanceController extends BaseController { | |||||
| record.updateTenantInfo(getTenantInfo()); | record.updateTenantInfo(getTenantInfo()); | ||||
| record.setFeesType(EnumFeesType.ADVANCE.getCode()); | record.setFeesType(EnumFeesType.ADVANCE.getCode()); | ||||
| record.setIsDespoit(EnumYesOrNo.NO.getCode()); | record.setIsDespoit(EnumYesOrNo.NO.getCode()); | ||||
| wxEnergyService.saveOrUpdateFees(record); | |||||
| wxFinanceService.saveOrUpdateFees(record); | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @PostMapping("feesUpdateIsDel") | @PostMapping("feesUpdateIsDel") | ||||
| public ResultData feesUpdateIsDel(@RequestBody WxFinanceFees record) { | public ResultData feesUpdateIsDel(@RequestBody WxFinanceFees record) { | ||||
| record.updateTenantInfo(getTenantInfo()); | record.updateTenantInfo(getTenantInfo()); | ||||
| wxEnergyService.setFeesIsDel(record); | |||||
| wxFinanceService.setFeesIsDel(record); | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -303,7 +303,7 @@ public class WxAllBillController extends BillBaseController { | |||||
| WxFinanceFees fq = new WxFinanceFees(); | WxFinanceFees fq = new WxFinanceFees(); | ||||
| fq.updateTenantInfo(wxShop); | fq.updateTenantInfo(wxShop); | ||||
| Map<Long, WxFinanceFees> feesMap = wxEnergyService.getFeesMap(fq); | |||||
| Map<Long, WxFinanceFees> feesMap = wxFinanceService.getFeesMap(fq); | |||||
| BigDecimal needpay = new BigDecimal(0); | BigDecimal needpay = new BigDecimal(0); | ||||
| BigDecimal paid = new BigDecimal(0); | BigDecimal paid = new BigDecimal(0); | ||||
| BigDecimal owe = new BigDecimal(0); | BigDecimal owe = new BigDecimal(0); | ||||
| @@ -406,7 +406,7 @@ public class WxAllBillController extends BillBaseController { | |||||
| record.updateTenantInfo(getTenantInfo()); | record.updateTenantInfo(getTenantInfo()); | ||||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | ||||
| record.setFeesType(EnumFeesType.NOMAL.getCode()); | record.setFeesType(EnumFeesType.NOMAL.getCode()); | ||||
| PageInfo<WxFinanceFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,false); | |||||
| PageInfo<WxFinanceFees> page = wxFinanceService.feesListAsPage(record, pageNum, pageSize,false); | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -420,7 +420,7 @@ public class WxAllBillController extends BillBaseController { | |||||
| record.updateTenantInfo(getTenantInfo()); | record.updateTenantInfo(getTenantInfo()); | ||||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | ||||
| record.setIsDel(EnumYesOrNo.NO.getCode()); | record.setIsDel(EnumYesOrNo.NO.getCode()); | ||||
| PageInfo<WxFinanceFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,false); | |||||
| PageInfo<WxFinanceFees> page = wxFinanceService.feesListAsPage(record, pageNum, pageSize,false); | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -750,7 +750,7 @@ public class WxAllBillController extends BillBaseController { | |||||
| if (null != list && list.size() > 0 ) { | if (null != list && list.size() > 0 ) { | ||||
| WxFinanceFees fq = new WxFinanceFees(); | WxFinanceFees fq = new WxFinanceFees(); | ||||
| fq.updateTenantInfo(wxShop); | fq.updateTenantInfo(wxShop); | ||||
| Map<Long, WxFinanceFees> feesMap = wxEnergyService.getFeesMap(fq); | |||||
| Map<Long, WxFinanceFees> feesMap = wxFinanceService.getFeesMap(fq); | |||||
| for (int i = 0 ; i < list.size(); i++) { | for (int i = 0 ; i < list.size(); i++) { | ||||
| WxAllBill be = list.get(i); | WxAllBill be = list.get(i); | ||||
| if (null != shopMap) { | if (null != shopMap) { | ||||
| @@ -821,7 +821,7 @@ public class WxAllBillController extends BillBaseController { | |||||
| if (null != list && list.size() > 0 ) { | if (null != list && list.size() > 0 ) { | ||||
| WxFinanceFees fq = new WxFinanceFees(); | WxFinanceFees fq = new WxFinanceFees(); | ||||
| fq.updateTenantInfo(wxShop); | fq.updateTenantInfo(wxShop); | ||||
| Map<Long, WxFinanceFees> feesMap = wxEnergyService.getFeesMap(fq); | |||||
| Map<Long, WxFinanceFees> feesMap = wxFinanceService.getFeesMap(fq); | |||||
| for (int i = 0 ; i < list.size(); i++) { | for (int i = 0 ; i < list.size(); i++) { | ||||
| WxAllBill be = list.get(i); | WxAllBill be = list.get(i); | ||||
| if (null != shopMap) { | if (null != shopMap) { | ||||
| @@ -41,6 +41,8 @@ public class WxRentContractAgileRenevueFees extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="款项编号",name="feesId") | @io.swagger.annotations.ApiModelProperty(value="款项编号",name="feesId") | ||||
| private Long feesId; | private Long feesId; | ||||
| @TableField(exist = false) | |||||
| private String feesName; | |||||
| @io.swagger.annotations.ApiModelProperty(value="占比比率%,默认100",name="rate") | @io.swagger.annotations.ApiModelProperty(value="占比比率%,默认100",name="rate") | ||||
| private String rate; | private String rate; | ||||
| @@ -52,16 +52,6 @@ public interface WxEnergyService { | |||||
| List<String> getTimeShopNumber(WxEnergyFeesTime record); | List<String> getTimeShopNumber(WxEnergyFeesTime record); | ||||
| List<Date> findLastTimeEndGroup(WxEnergyFeesTime record); | List<Date> findLastTimeEndGroup(WxEnergyFeesTime record); | ||||
| //费用科目 | |||||
| PageInfo<WxFinanceFees> feesListAsPage(WxFinanceFees record, Integer pageIndex, Integer pageSize,boolean isSetOff); | |||||
| void saveOrUpdateFees(WxFinanceFees record); | |||||
| WxFinanceFees getFeesById(Long id,String tenantId); | |||||
| void setFeesIsDel(WxFinanceFees record); | |||||
| Map<Long,WxFinanceFees> getFeesMap(WxFinanceFees record); | |||||
| void initEnergyFees(TenantEntity tenantEntity); | |||||
| List<Long> getAdvanceSetoffFeesids(WxFinanceFeesSetoff setoff); | |||||
| List<Long> getFeesIdList(WxFinanceFees record); | |||||
| //计算标砖 | //计算标砖 | ||||
| List<Map<String,String>> getFeesShopComponentList(WxFeesCalcuteShop record); | List<Map<String,String>> getFeesShopComponentList(WxFeesCalcuteShop record); | ||||
| void createFeesShop(WxFeesCalcuteShop record); | void createFeesShop(WxFeesCalcuteShop record); | ||||
| @@ -18,6 +18,8 @@ import com.iformall.domain.po.WxAllBill; | |||||
| import com.iformall.domain.po.WxBillPayWay; | import com.iformall.domain.po.WxBillPayWay; | ||||
| import com.iformall.domain.po.WxFeesCalcuteShop; | import com.iformall.domain.po.WxFeesCalcuteShop; | ||||
| import com.iformall.domain.po.WxFinanceCheckOut; | import com.iformall.domain.po.WxFinanceCheckOut; | ||||
| import com.iformall.domain.po.WxFinanceFees; | |||||
| import com.iformall.domain.po.WxFinanceFeesSetoff; | |||||
| import com.iformall.domain.po.WxFinanceFinish; | import com.iformall.domain.po.WxFinanceFinish; | ||||
| import com.iformall.domain.po.WxFinanceFinishReceive; | import com.iformall.domain.po.WxFinanceFinishReceive; | ||||
| import com.iformall.domain.po.WxFinanceReceive; | import com.iformall.domain.po.WxFinanceReceive; | ||||
| @@ -44,6 +46,16 @@ public interface WxFinanceService { | |||||
| Map<Long,WxBillPayWay> getPayWayMap(WxBillPayWay record); | Map<Long,WxBillPayWay> getPayWayMap(WxBillPayWay record); | ||||
| void payWayInit(TenantEntity tenantInfo); | void payWayInit(TenantEntity tenantInfo); | ||||
| //费用款项 | |||||
| PageInfo<WxFinanceFees> feesListAsPage(WxFinanceFees record, Integer pageIndex, Integer pageSize,boolean isSetOff); | |||||
| void saveOrUpdateFees(WxFinanceFees record); | |||||
| WxFinanceFees getFeesById(Long id,String tenantId); | |||||
| void setFeesIsDel(WxFinanceFees record); | |||||
| Map<Long,WxFinanceFees> getFeesMap(WxFinanceFees record); | |||||
| void initEnergyFees(TenantEntity tenantEntity); | |||||
| List<Long> getAdvanceSetoffFeesids(WxFinanceFeesSetoff setoff); | |||||
| List<Long> getFeesIdList(WxFinanceFees record); | |||||
| //收付款 | //收付款 | ||||
| PageInfo<WxFinanceReceiveVo> receiveVoListWithBillsAsPage(WxFinanceReceive record, Integer pageIndex, Integer pageSize); | PageInfo<WxFinanceReceiveVo> receiveVoListWithBillsAsPage(WxFinanceReceive record, Integer pageIndex, Integer pageSize); | ||||
| PageInfo<WxFinanceReceiveVo> receiveVoListAsPage(WxFinanceReceive record, Integer pageIndex, Integer pageSize); | PageInfo<WxFinanceReceiveVo> receiveVoListAsPage(WxFinanceReceive record, Integer pageIndex, Integer pageSize); | ||||
| @@ -50,6 +50,7 @@ import com.iformall.enums.EnumYesOrNo; | |||||
| import com.iformall.service.WxAllBillService; | import com.iformall.service.WxAllBillService; | ||||
| import com.iformall.service.WxBillActionService; | import com.iformall.service.WxBillActionService; | ||||
| import com.iformall.service.WxEnergyService; | import com.iformall.service.WxEnergyService; | ||||
| import com.iformall.service.WxFinanceService; | |||||
| import com.iformall.service.WxMallService; | import com.iformall.service.WxMallService; | ||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| import com.iformall.service.WxShopService; | import com.iformall.service.WxShopService; | ||||
| @@ -79,6 +80,9 @@ public class WxBillAllHelper { | |||||
| @Autowired | @Autowired | ||||
| private WxEnergyService wxEnergyService; | private WxEnergyService wxEnergyService; | ||||
| @Autowired | |||||
| private WxFinanceService wxFinanceService; | |||||
| public Date getDateBefore(Integer afterDays) { | public Date getDateBefore(Integer afterDays) { | ||||
| Date nowBegin = DateUtils.getDayBegin(new Date()); | Date nowBegin = DateUtils.getDayBegin(new Date()); | ||||
| //return DateUtils.getDateTimeBefore(afterDays*3600*24, nowBegin); | //return DateUtils.getDateTimeBefore(afterDays*3600*24, nowBegin); | ||||
| @@ -399,7 +403,7 @@ public class WxBillAllHelper { | |||||
| String endTimeStr = DateUtils.date2String(endTime,DateUtils.DATE_TIME_PATTERN); | String endTimeStr = DateUtils.date2String(endTime,DateUtils.DATE_TIME_PATTERN); | ||||
| boolean isUpdate = false; | boolean isUpdate = false; | ||||
| action.setBillId(bill.getId()); | action.setBillId(bill.getId()); | ||||
| WxFinanceFees fees = wxEnergyService.getFeesById(bill.getEnergyFeesId(), bill.getTenantId()); | |||||
| WxFinanceFees fees = wxFinanceService.getFeesById(bill.getEnergyFeesId(), bill.getTenantId()); | |||||
| //action.setBillType(bill.getBillType()); | //action.setBillType(bill.getBillType()); | ||||
| String oldReceivePay = bill.getReceivePay(); | String oldReceivePay = bill.getReceivePay(); | ||||
| boolean isAllReturn = false; | boolean isAllReturn = false; | ||||
| @@ -61,6 +61,7 @@ import com.iformall.mapper.WxShopMapper; | |||||
| import com.iformall.service.SysConfigService; | import com.iformall.service.SysConfigService; | ||||
| import com.iformall.service.WxAgileContractService; | import com.iformall.service.WxAgileContractService; | ||||
| import com.iformall.service.WxEnergyService; | import com.iformall.service.WxEnergyService; | ||||
| import com.iformall.service.WxFinanceService; | |||||
| import com.iformall.service.WxFlowRecordService; | import com.iformall.service.WxFlowRecordService; | ||||
| import com.iformall.service.WxMallService; | import com.iformall.service.WxMallService; | ||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| @@ -142,6 +143,10 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||||
| @Autowired | @Autowired | ||||
| WxEnergyService wxEnergyService; | WxEnergyService wxEnergyService; | ||||
| @Lazy | |||||
| @Autowired | |||||
| WxFinanceService wxFinanceService; | |||||
| @Autowired | @Autowired | ||||
| WxAllBillMapper wxAllBillMapper; | WxAllBillMapper wxAllBillMapper; | ||||
| @@ -565,7 +570,7 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||||
| WxFinanceFees fq = new WxFinanceFees(); | WxFinanceFees fq = new WxFinanceFees(); | ||||
| fq.updateTenantInfo(unDeposit); | fq.updateTenantInfo(unDeposit); | ||||
| fq.setIsDel(EnumYesOrNo.NO.getCode()); | fq.setIsDel(EnumYesOrNo.NO.getCode()); | ||||
| Map<Long, WxFinanceFees> feesMap = wxEnergyService.getFeesMap(fq); | |||||
| Map<Long, WxFinanceFees> feesMap = wxFinanceService.getFeesMap(fq); | |||||
| for (int i = 0 ; i < list.size() ; i ++) { | for (int i = 0 ; i < list.size() ; i ++) { | ||||
| WxRentContractAgileUnDeposit ud = list.get(i); | WxRentContractAgileUnDeposit ud = list.get(i); | ||||
| WxFinanceFees fees = feesMap.get(ud.getFeesId()); | WxFinanceFees fees = feesMap.get(ud.getFeesId()); | ||||
| @@ -615,7 +620,7 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||||
| } | } | ||||
| WxFinanceFees fq = new WxFinanceFees(); | WxFinanceFees fq = new WxFinanceFees(); | ||||
| fq.updateTenantInfo(wxRentContract); | fq.updateTenantInfo(wxRentContract); | ||||
| Map<Long,WxFinanceFees> typeMap = wxEnergyService.getFeesMap(fq); | |||||
| Map<Long,WxFinanceFees> typeMap = wxFinanceService.getFeesMap(fq); | |||||
| //根据关联的店铺面积来分金额 | //根据关联的店铺面积来分金额 | ||||
| Map<Long, BigDecimal> shopAreaRateMap = wxRentContract.getRentShopArea(); | Map<Long, BigDecimal> shopAreaRateMap = wxRentContract.getRentShopArea(); | ||||
| @@ -709,7 +714,7 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||||
| if (null == unDeposit.getItems() || unDeposit.getItems().size() <= 0 ) { | if (null == unDeposit.getItems() || unDeposit.getItems().size() <= 0 ) { | ||||
| return; | return; | ||||
| } | } | ||||
| WxFinanceFees fees = wxEnergyService.getFeesById(unDeposit.getFeesId(), unDeposit.getTenantId()); | |||||
| WxFinanceFees fees = wxFinanceService.getFeesById(unDeposit.getFeesId(), unDeposit.getTenantId()); | |||||
| EnumFeesShopTimeType creatRule = EnumFeesShopTimeType.getEnum(unDeposit.getFeesCreateRule()); | EnumFeesShopTimeType creatRule = EnumFeesShopTimeType.getEnum(unDeposit.getFeesCreateRule()); | ||||
| EnumRentContractAgilTimeUnit timeUnit = EnumRentContractAgilTimeUnit.getEnum(unDeposit.getTimeUnit()); | EnumRentContractAgilTimeUnit timeUnit = EnumRentContractAgilTimeUnit.getEnum(unDeposit.getTimeUnit()); | ||||
| WxRentContract contract = wxRentContractMapper.selectById(unDeposit.getRentContractId()); | WxRentContract contract = wxRentContractMapper.selectById(unDeposit.getRentContractId()); | ||||
| @@ -973,7 +978,23 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||||
| WxRentContractAgileRenevueFees iq = new WxRentContractAgileRenevueFees(); | WxRentContractAgileRenevueFees iq = new WxRentContractAgileRenevueFees(); | ||||
| iq.updateTenantInfo(tenantEntity); | iq.updateTenantInfo(tenantEntity); | ||||
| iq.setRentContractId(rentContractId); | iq.setRentContractId(rentContractId); | ||||
| return wxRentContractAgileRenevueFeesMapper.findList(iq); | |||||
| List<WxRentContractAgileRenevueFees> list = wxRentContractAgileRenevueFeesMapper.findList(iq); | |||||
| if (null != list && list.size() > 0 ) { | |||||
| WxFinanceFees fq = new WxFinanceFees(); | |||||
| fq.updateTenantInfo(tenantEntity); | |||||
| fq.setIsDel(EnumYesOrNo.NO.getCode()); | |||||
| Map<Long, WxFinanceFees> fmap = wxFinanceService.getFeesMap(fq); | |||||
| if (null != fmap) { | |||||
| for (int i = 0 ; i < list.size() ; i ++) { | |||||
| WxRentContractAgileRenevueFees rf = list.get(i); | |||||
| WxFinanceFees fee = fmap.get(rf.getFeesId()); | |||||
| if (null != fee) { | |||||
| rf.setFeesName(fee.getName()); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| return list; | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -199,7 +199,7 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||||
| WxFinanceFees fq = new WxFinanceFees(); | WxFinanceFees fq = new WxFinanceFees(); | ||||
| fq.updateTenantInfo(record); | fq.updateTenantInfo(record); | ||||
| Map<Long, WxFinanceFees> feesMap = wxEnergyService.getFeesMap(fq); | |||||
| Map<Long, WxFinanceFees> feesMap = wxFinanceService.getFeesMap(fq); | |||||
| for (int i = 0 ; i < page.getList().size() ; i ++) { | for (int i = 0 ; i < page.getList().size() ; i ++) { | ||||
| WxAllBill e = page.getList().get(i); | WxAllBill e = page.getList().get(i); | ||||
| if (null != e.getShopId()) { | if (null != e.getShopId()) { | ||||
| @@ -245,7 +245,7 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||||
| if (null != list && list.size() > 0 ){ | if (null != list && list.size() > 0 ){ | ||||
| WxFinanceFees fq = new WxFinanceFees(); | WxFinanceFees fq = new WxFinanceFees(); | ||||
| fq.updateTenantInfo(wxBillRent); | fq.updateTenantInfo(wxBillRent); | ||||
| Map<Long, WxFinanceFees> feesMap = wxEnergyService.getFeesMap(fq); | |||||
| Map<Long, WxFinanceFees> feesMap = wxFinanceService.getFeesMap(fq); | |||||
| for (int i = 0 ; i < list.size() ; i ++) { | for (int i = 0 ; i < list.size() ; i ++) { | ||||
| WxBillHotNotify hn = list.get(i); | WxBillHotNotify hn = list.get(i); | ||||
| if (null != feesMap) { | if (null != feesMap) { | ||||
| @@ -68,8 +68,6 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||||
| @Autowired | @Autowired | ||||
| WxEnergyFeesTimeShopMapper wxEnergyFeesTimeShopMapper; | WxEnergyFeesTimeShopMapper wxEnergyFeesTimeShopMapper; | ||||
| @Autowired | @Autowired | ||||
| WxFinanceFeesMapper wxEnergyFeesMapper; | |||||
| @Autowired | |||||
| WxFeesCalcuteShopMapper wxEnergyFeesShopMapper; | WxFeesCalcuteShopMapper wxEnergyFeesShopMapper; | ||||
| @Autowired | @Autowired | ||||
| WxFinanceFeesSetoffMapper wxEnergyFeesSetoffMapper; | WxFinanceFeesSetoffMapper wxEnergyFeesSetoffMapper; | ||||
| @@ -99,10 +97,12 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||||
| @Lazy | @Lazy | ||||
| @Autowired | @Autowired | ||||
| WxShopService wxShopService; | WxShopService wxShopService; | ||||
| @Lazy | @Lazy | ||||
| @Autowired | @Autowired | ||||
| WxAllBillService wxAllBillService; | WxAllBillService wxAllBillService; | ||||
| @Lazy | |||||
| @Autowired | |||||
| WxFinanceService wxFinanceService; | |||||
| @Override | @Override | ||||
| public PageInfo<WxEnergyMeter> meterListAsPage(WxEnergyMeter record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxEnergyMeter> meterListAsPage(WxEnergyMeter record, Integer pageIndex, Integer pageSize) { | ||||
| @@ -576,127 +576,6 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||||
| } | } | ||||
| @Override | |||||
| public PageInfo<WxFinanceFees> feesListAsPage(WxFinanceFees record, Integer pageIndex, Integer pageSize,boolean isSetOff) { | |||||
| // if (null == record.getCashierType()) { | |||||
| // record.setCashierType(EnumFinanceCashierType.RECEIVE.getCode()); | |||||
| // } | |||||
| PageInfo<WxFinanceFees> page = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxEnergyFeesMapper.findList(record)); | |||||
| //如果是预充费用,还需要查询可冲抵科目 | |||||
| if (isSetOff) { | |||||
| if (null != page && null != page.getList()) { | |||||
| WxFinanceFees fq = new WxFinanceFees(); | |||||
| fq.updateTenantInfo(record); | |||||
| Map<Long, WxFinanceFees> feesMap = this.getFeesMap(fq); | |||||
| for (int i = 0 ; i < page.getList().size() ; i++) { | |||||
| WxFinanceFees at = page.getList().get(i); | |||||
| WxFinanceFeesSetoff tf = new WxFinanceFeesSetoff(); | |||||
| tf.updateTenantInfo(at); | |||||
| tf.setAdvanceFeesId(at.getId()); | |||||
| at.setFeesIds(wxEnergyFeesSetoffMapper.findFeesIdList(tf)); | |||||
| at.setFeesName(at.getFeesIdsName(feesMap)); | |||||
| } | |||||
| } | |||||
| } | |||||
| return page; | |||||
| } | |||||
| @Override | |||||
| public void saveOrUpdateFees(WxFinanceFees record) { | |||||
| Date date = new Date(); | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| if (record.getId() == null) { | |||||
| record.setId(idWorker.nextId()); | |||||
| record.setCreateTime(date); | |||||
| record.setUpdateTime(date); | |||||
| //record.setIsSystem(EnumYesOrNo.NO.getCode()); | |||||
| try { | |||||
| wxEnergyFeesMapper.insert(record); | |||||
| } catch (Exception e) { | |||||
| logger.error("保存租赁账单失败,e:" + e.getMessage()); | |||||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||||
| } | |||||
| if (record.getFeesType().intValue() == EnumFeesType.ADVANCE.getCode().intValue()) { | |||||
| if (null != record.getFeesIds()) { | |||||
| for (int i = 0 ; i < record.getFeesIds().size(); i++) { | |||||
| Long feeid = record.getFeesIds().get(i); | |||||
| WxFinanceFeesSetoff tf = new WxFinanceFeesSetoff(); | |||||
| tf.updateTenantInfo(record); | |||||
| tf.setId(idWorker.nextId()); | |||||
| tf.setAdvanceFeesId(record.getId()); | |||||
| tf.setFeesId(feeid); | |||||
| tf.setCreateTime(new Date()); | |||||
| tf.setUpdateTime(new Date()); | |||||
| wxEnergyFeesSetoffMapper.insert(tf); | |||||
| } | |||||
| } | |||||
| } | |||||
| } else { | |||||
| WxFinanceFees fees = this.getFeesById(record.getId(),record.getTenantId()); | |||||
| if (null == fees) { | |||||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "记录未查询到"); | |||||
| } | |||||
| record.setUpdateTime(date); | |||||
| wxEnergyFeesMapper.updateById(record); | |||||
| //如果是预充的,则需处理管理科目 | |||||
| if (fees.getFeesType().intValue() == EnumFeesType.ADVANCE.getCode().intValue()) { | |||||
| //先删掉之前的关联 | |||||
| WxFinanceFeesSetoff fd = new WxFinanceFeesSetoff(); | |||||
| fd.updateTenantInfo(record); | |||||
| fd.setAdvanceFeesId(record.getId()); | |||||
| wxEnergyFeesSetoffMapper.deleteByAdvanceId(fd); | |||||
| if (null != record.getFeesIds()) { | |||||
| for (int i = 0 ; i < record.getFeesIds().size(); i++) { | |||||
| Long feeid = record.getFeesIds().get(i); | |||||
| WxFinanceFeesSetoff tf = new WxFinanceFeesSetoff(); | |||||
| tf.updateTenantInfo(record); | |||||
| tf.setId(idWorker.nextId()); | |||||
| tf.setAdvanceFeesId(record.getId()); | |||||
| tf.setFeesId(feeid); | |||||
| tf.setCreateTime(new Date()); | |||||
| tf.setUpdateTime(new Date()); | |||||
| wxEnergyFeesSetoffMapper.insert(tf); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public WxFinanceFees getFeesById(Long id,String tenantId) { | |||||
| return wxEnergyFeesMapper.selectById(id, tenantId); | |||||
| } | |||||
| @Override | |||||
| public void setFeesIsDel(WxFinanceFees record) { | |||||
| WxFinanceFees fees = this.getFeesById(record.getId(),record.getTenantId()); | |||||
| if (null == fees) { | |||||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "记录未查询到"); | |||||
| } | |||||
| wxEnergyFeesMapper.setIsDel(record.getId(), record.getTenantId(), record.getIsDel()); | |||||
| } | |||||
| @Override | |||||
| public Map<Long, WxFinanceFees> getFeesMap(WxFinanceFees record) { | |||||
| List<WxFinanceFees> list = wxEnergyFeesMapper.findList(record); | |||||
| if (null != list && list.size() > 0 ) { | |||||
| Map<Long,WxFinanceFees> retMap = new HashMap<Long,WxFinanceFees>(); | |||||
| for (int i = 0 ; i<list.size() ; i ++) { | |||||
| WxFinanceFees m = list.get(i); | |||||
| retMap.put(m.getId(), m); | |||||
| } | |||||
| return retMap; | |||||
| } | |||||
| return null; | |||||
| } | |||||
| @Override | |||||
| public void initEnergyFees(TenantEntity tenantEntity) { | |||||
| } | |||||
| @Override | @Override | ||||
| public List<Map<String,String>> getFeesShopComponentList(WxFeesCalcuteShop record) { | public List<Map<String,String>> getFeesShopComponentList(WxFeesCalcuteShop record) { | ||||
| WxShop shop = null; | WxShop shop = null; | ||||
| @@ -730,7 +609,7 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||||
| //新增关联 | //新增关联 | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| Date date = new Date(); | Date date = new Date(); | ||||
| WxFinanceFees fees = this.getFeesById(record.getFeesId(),record.getTenantId()); | |||||
| WxFinanceFees fees = wxFinanceService.getFeesById(record.getFeesId(),record.getTenantId()); | |||||
| WxShop sq = new WxShop(); | WxShop sq = new WxShop(); | ||||
| sq.updateTenantInfo(record); | sq.updateTenantInfo(record); | ||||
| sq.setIds(record.getShopIds()); | sq.setIds(record.getShopIds()); | ||||
| @@ -823,7 +702,7 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||||
| WxFinanceFees fq = new WxFinanceFees(); | WxFinanceFees fq = new WxFinanceFees(); | ||||
| fq.updateTenantInfo(record); | fq.updateTenantInfo(record); | ||||
| fq.setIsDel(EnumYesOrNo.NO.getCode()); | fq.setIsDel(EnumYesOrNo.NO.getCode()); | ||||
| Map<Long, WxFinanceFees> feesMap = this.getFeesMap(fq); | |||||
| Map<Long, WxFinanceFees> feesMap = wxFinanceService.getFeesMap(fq); | |||||
| Map<Long, String> floorMap = wxMallFloorService.getFloorMap(record); | Map<Long, String> floorMap = wxMallFloorService.getFloorMap(record); | ||||
| Map<Long, String> buildingMap = wxMallBuildingService.getBuildingMap(record); | Map<Long, String> buildingMap = wxMallBuildingService.getBuildingMap(record); | ||||
| List<Long> shopIdList = new ArrayList<Long>(); | List<Long> shopIdList = new ArrayList<Long>(); | ||||
| @@ -906,16 +785,6 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||||
| } | } | ||||
| } | } | ||||
| @Override | |||||
| public List<Long> getAdvanceSetoffFeesids(WxFinanceFeesSetoff setoff) { | |||||
| return wxEnergyFeesSetoffMapper.findFeesIdList(setoff); | |||||
| } | |||||
| @Override | |||||
| public List<Long> getFeesIdList(WxFinanceFees record) { | |||||
| return wxEnergyFeesMapper.findIdList(record); | |||||
| } | |||||
| @Override | @Override | ||||
| public PageInfo<WxEnergyMeterReading> readingListAsPage(WxEnergyMeterReading record, Integer pageIndex, | public PageInfo<WxEnergyMeterReading> readingListAsPage(WxEnergyMeterReading record, Integer pageIndex, | ||||
| Integer pageSize) { | Integer pageSize) { | ||||
| @@ -1147,7 +1016,7 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||||
| if (null != page && null != page.getList()) { | if (null != page && null != page.getList()) { | ||||
| WxFinanceFees fq = new WxFinanceFees(); | WxFinanceFees fq = new WxFinanceFees(); | ||||
| fq.updateTenantInfo(record); | fq.updateTenantInfo(record); | ||||
| Map<Long, WxFinanceFees> fessMap = this.getFeesMap(fq); | |||||
| Map<Long, WxFinanceFees> fessMap = wxFinanceService.getFeesMap(fq); | |||||
| for (int i = 0 ; i < page.getList().size(); i++) { | for (int i = 0 ; i < page.getList().size(); i++) { | ||||
| WxEnergyReadingCalcute c = page.getList().get(i); | WxEnergyReadingCalcute c = page.getList().get(i); | ||||
| if (null != fessMap) { | if (null != fessMap) { | ||||
| @@ -1198,7 +1067,7 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||||
| record.setShop(JSON.toJSONString(record.getShopIds())); | record.setShop(JSON.toJSONString(record.getShopIds())); | ||||
| try { | try { | ||||
| wxEnergyReadingCalcuteMapper.insert(record); | wxEnergyReadingCalcuteMapper.insert(record); | ||||
| WxFinanceFees fees = this.getFeesById(record.getFeesId(),record.getTenantId()); | |||||
| WxFinanceFees fees = wxFinanceService.getFeesById(record.getFeesId(),record.getTenantId()); | |||||
| generateCalcuteResult(fees, record, record.getShopIds()); | generateCalcuteResult(fees, record, record.getShopIds()); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("保存租赁账单失败,e:" + e.getMessage()); | logger.error("保存租赁账单失败,e:" + e.getMessage()); | ||||
| @@ -1404,7 +1273,7 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||||
| if (null != page && null != page.getList()) { | if (null != page && null != page.getList()) { | ||||
| WxFinanceFees fq = new WxFinanceFees(); | WxFinanceFees fq = new WxFinanceFees(); | ||||
| fq.updateTenantInfo(record); | fq.updateTenantInfo(record); | ||||
| Map<Long, WxFinanceFees> fessMap = this.getFeesMap(fq); | |||||
| Map<Long, WxFinanceFees> fessMap = wxFinanceService.getFeesMap(fq); | |||||
| Map<Long, String> floorMap = wxMallFloorService.getFloorMap(record); | Map<Long, String> floorMap = wxMallFloorService.getFloorMap(record); | ||||
| Map<Long, String> buildingMap = wxMallBuildingService.getBuildingMap(record); | Map<Long, String> buildingMap = wxMallBuildingService.getBuildingMap(record); | ||||
| List<Long> shopIdList = new ArrayList<Long>(); | List<Long> shopIdList = new ArrayList<Long>(); | ||||
| @@ -1560,7 +1429,7 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||||
| shopMap = wxShopService.findShopMap(sq); | shopMap = wxShopService.findShopMap(sq); | ||||
| } | } | ||||
| WxFinanceFees fees = this.getFeesById(calcute.getFeesId(), record.getTenantId()); | |||||
| WxFinanceFees fees = wxFinanceService.getFeesById(calcute.getFeesId(), record.getTenantId()); | |||||
| List<WxEnergyReadingCalcuteResult> resultList = wxEnergyReadingCalcuteResultMapper.findList(crq); | List<WxEnergyReadingCalcuteResult> resultList = wxEnergyReadingCalcuteResultMapper.findList(crq); | ||||
| if (null != resultList && resultList.size() > 0 ) { | if (null != resultList && resultList.size() > 0 ) { | ||||
| @@ -267,7 +267,7 @@ public class WxFinancePrintServiceImpl implements WxFinancePrintService { | |||||
| Map<Long, WxShopUsers> shopUserMap = wxShopService.getShopUserMap(suq); | Map<Long, WxShopUsers> shopUserMap = wxShopService.getShopUserMap(suq); | ||||
| WxFinanceFees feq = new WxFinanceFees(); | WxFinanceFees feq = new WxFinanceFees(); | ||||
| feq.setTenantId(tenantId); | feq.setTenantId(tenantId); | ||||
| Map<Long, WxFinanceFees> feesMap = wxEnergyService.getFeesMap(feq); | |||||
| Map<Long, WxFinanceFees> feesMap = wxFinanceService.getFeesMap(feq); | |||||
| //收付款单 | //收付款单 | ||||
| if (printDatatype.getCode().intValue() == EnumFinancePrintDataType.FINANCE_RECEIVE.getCode()) { | if (printDatatype.getCode().intValue() == EnumFinancePrintDataType.FINANCE_RECEIVE.getCode()) { | ||||
| WxFinanceReceive receiveq = new WxFinanceReceive(); | WxFinanceReceive receiveq = new WxFinanceReceive(); | ||||
| @@ -52,6 +52,7 @@ import com.iformall.exception.MallinkException; | |||||
| import com.iformall.mapper.WxBillPayWayMapper; | import com.iformall.mapper.WxBillPayWayMapper; | ||||
| import com.iformall.mapper.WxFinanceFeesSetoffMapper; | import com.iformall.mapper.WxFinanceFeesSetoffMapper; | ||||
| import com.iformall.mapper.WxFinanceCheckOutMapper; | import com.iformall.mapper.WxFinanceCheckOutMapper; | ||||
| import com.iformall.mapper.WxFinanceFeesMapper; | |||||
| import com.iformall.mapper.WxFinanceFinishMapper; | import com.iformall.mapper.WxFinanceFinishMapper; | ||||
| import com.iformall.mapper.WxFinanceFinishReceiveMapper; | import com.iformall.mapper.WxFinanceFinishReceiveMapper; | ||||
| import com.iformall.mapper.WxFinancePrintDataMapper; | import com.iformall.mapper.WxFinancePrintDataMapper; | ||||
| @@ -103,6 +104,8 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| @Autowired | @Autowired | ||||
| WxBillPayWayMapper wxBillPayWayMapper; | WxBillPayWayMapper wxBillPayWayMapper; | ||||
| @Autowired | @Autowired | ||||
| WxFinanceFeesMapper wxFinanceFeesMapper; | |||||
| @Autowired | |||||
| WxFinanceFeesSetoffMapper wxEnergyFeesSetoffMapper; | WxFinanceFeesSetoffMapper wxEnergyFeesSetoffMapper; | ||||
| @Autowired | @Autowired | ||||
| WxFinanceReceiveMapper wxFinanceReceiveMapper; | WxFinanceReceiveMapper wxFinanceReceiveMapper; | ||||
| @@ -252,6 +255,137 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| payway5.setUpdateTime(new Date()); | payway5.setUpdateTime(new Date()); | ||||
| wxBillPayWayMapper.insert(payway5); | wxBillPayWayMapper.insert(payway5); | ||||
| } | } | ||||
| @Override | |||||
| public PageInfo<WxFinanceFees> feesListAsPage(WxFinanceFees record, Integer pageIndex, Integer pageSize,boolean isSetOff) { | |||||
| // if (null == record.getCashierType()) { | |||||
| // record.setCashierType(EnumFinanceCashierType.RECEIVE.getCode()); | |||||
| // } | |||||
| PageInfo<WxFinanceFees> page = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxFinanceFeesMapper.findList(record)); | |||||
| //如果是预充费用,还需要查询可冲抵科目 | |||||
| if (isSetOff) { | |||||
| if (null != page && null != page.getList()) { | |||||
| WxFinanceFees fq = new WxFinanceFees(); | |||||
| fq.updateTenantInfo(record); | |||||
| Map<Long, WxFinanceFees> feesMap = this.getFeesMap(fq); | |||||
| for (int i = 0 ; i < page.getList().size() ; i++) { | |||||
| WxFinanceFees at = page.getList().get(i); | |||||
| WxFinanceFeesSetoff tf = new WxFinanceFeesSetoff(); | |||||
| tf.updateTenantInfo(at); | |||||
| tf.setAdvanceFeesId(at.getId()); | |||||
| at.setFeesIds(wxEnergyFeesSetoffMapper.findFeesIdList(tf)); | |||||
| at.setFeesName(at.getFeesIdsName(feesMap)); | |||||
| } | |||||
| } | |||||
| } | |||||
| return page; | |||||
| } | |||||
| @Override | |||||
| public void saveOrUpdateFees(WxFinanceFees record) { | |||||
| Date date = new Date(); | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| if (record.getId() == null) { | |||||
| record.setId(idWorker.nextId()); | |||||
| record.setCreateTime(date); | |||||
| record.setUpdateTime(date); | |||||
| //record.setIsSystem(EnumYesOrNo.NO.getCode()); | |||||
| try { | |||||
| wxFinanceFeesMapper.insert(record); | |||||
| } catch (Exception e) { | |||||
| logger.error("保存租赁账单失败,e:" + e.getMessage()); | |||||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||||
| } | |||||
| if (record.getFeesType().intValue() == EnumFeesType.ADVANCE.getCode().intValue()) { | |||||
| if (null != record.getFeesIds()) { | |||||
| for (int i = 0 ; i < record.getFeesIds().size(); i++) { | |||||
| Long feeid = record.getFeesIds().get(i); | |||||
| WxFinanceFeesSetoff tf = new WxFinanceFeesSetoff(); | |||||
| tf.updateTenantInfo(record); | |||||
| tf.setId(idWorker.nextId()); | |||||
| tf.setAdvanceFeesId(record.getId()); | |||||
| tf.setFeesId(feeid); | |||||
| tf.setCreateTime(new Date()); | |||||
| tf.setUpdateTime(new Date()); | |||||
| wxEnergyFeesSetoffMapper.insert(tf); | |||||
| } | |||||
| } | |||||
| } | |||||
| } else { | |||||
| WxFinanceFees fees = this.getFeesById(record.getId(),record.getTenantId()); | |||||
| if (null == fees) { | |||||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "记录未查询到"); | |||||
| } | |||||
| record.setUpdateTime(date); | |||||
| wxFinanceFeesMapper.updateById(record); | |||||
| //如果是预充的,则需处理管理科目 | |||||
| if (fees.getFeesType().intValue() == EnumFeesType.ADVANCE.getCode().intValue()) { | |||||
| //先删掉之前的关联 | |||||
| WxFinanceFeesSetoff fd = new WxFinanceFeesSetoff(); | |||||
| fd.updateTenantInfo(record); | |||||
| fd.setAdvanceFeesId(record.getId()); | |||||
| wxEnergyFeesSetoffMapper.deleteByAdvanceId(fd); | |||||
| if (null != record.getFeesIds()) { | |||||
| for (int i = 0 ; i < record.getFeesIds().size(); i++) { | |||||
| Long feeid = record.getFeesIds().get(i); | |||||
| WxFinanceFeesSetoff tf = new WxFinanceFeesSetoff(); | |||||
| tf.updateTenantInfo(record); | |||||
| tf.setId(idWorker.nextId()); | |||||
| tf.setAdvanceFeesId(record.getId()); | |||||
| tf.setFeesId(feeid); | |||||
| tf.setCreateTime(new Date()); | |||||
| tf.setUpdateTime(new Date()); | |||||
| wxEnergyFeesSetoffMapper.insert(tf); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public WxFinanceFees getFeesById(Long id,String tenantId) { | |||||
| return wxFinanceFeesMapper.selectById(id, tenantId); | |||||
| } | |||||
| @Override | |||||
| public void setFeesIsDel(WxFinanceFees record) { | |||||
| WxFinanceFees fees = this.getFeesById(record.getId(),record.getTenantId()); | |||||
| if (null == fees) { | |||||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "记录未查询到"); | |||||
| } | |||||
| wxFinanceFeesMapper.setIsDel(record.getId(), record.getTenantId(), record.getIsDel()); | |||||
| } | |||||
| @Override | |||||
| public Map<Long, WxFinanceFees> getFeesMap(WxFinanceFees record) { | |||||
| List<WxFinanceFees> list = wxFinanceFeesMapper.findList(record); | |||||
| if (null != list && list.size() > 0 ) { | |||||
| Map<Long,WxFinanceFees> retMap = new HashMap<Long,WxFinanceFees>(); | |||||
| for (int i = 0 ; i<list.size() ; i ++) { | |||||
| WxFinanceFees m = list.get(i); | |||||
| retMap.put(m.getId(), m); | |||||
| } | |||||
| return retMap; | |||||
| } | |||||
| return null; | |||||
| } | |||||
| @Override | |||||
| public void initEnergyFees(TenantEntity tenantEntity) { | |||||
| } | |||||
| @Override | |||||
| public List<Long> getAdvanceSetoffFeesids(WxFinanceFeesSetoff setoff) { | |||||
| return wxEnergyFeesSetoffMapper.findFeesIdList(setoff); | |||||
| } | |||||
| @Override | |||||
| public List<Long> getFeesIdList(WxFinanceFees record) { | |||||
| return wxFinanceFeesMapper.findIdList(record); | |||||
| } | |||||
| @Override | @Override | ||||
| public BigDecimal getBillDepositSum(WxShop record) { | public BigDecimal getBillDepositSum(WxShop record) { | ||||
| @@ -310,7 +444,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| if (null != advanceList && advanceList.size() > 0 ) { | if (null != advanceList && advanceList.size() > 0 ) { | ||||
| WxFinanceFees fat = new WxFinanceFees(); | WxFinanceFees fat = new WxFinanceFees(); | ||||
| fat.updateTenantInfo(record); | fat.updateTenantInfo(record); | ||||
| Map<Long, WxFinanceFees> advanceTypMap = wxEnergyService.getFeesMap(fat); | |||||
| Map<Long, WxFinanceFees> advanceTypMap = this.getFeesMap(fat); | |||||
| for (int i = 0 ; i < advanceList.size() ; i++) { | for (int i = 0 ; i < advanceList.size() ; i++) { | ||||
| WxAllBill at = advanceList.get(i); | WxAllBill at = advanceList.get(i); | ||||
| FinanceAdvanceBillVo vo = new FinanceAdvanceBillVo(); | FinanceAdvanceBillVo vo = new FinanceAdvanceBillVo(); | ||||
| @@ -416,7 +550,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| if (dto.getFeesId().longValue() == Constant.bill_all_deposit_id.longValue()){ | if (dto.getFeesId().longValue() == Constant.bill_all_deposit_id.longValue()){ | ||||
| WxFinanceFees fq = new WxFinanceFees(); | WxFinanceFees fq = new WxFinanceFees(); | ||||
| fq.updateTenantInfo(dto); | fq.updateTenantInfo(dto); | ||||
| setOffFeesIds = wxEnergyService.getFeesIdList(fq); | |||||
| setOffFeesIds = this.getFeesIdList(fq); | |||||
| if (null == setOffFeesIds || setOffFeesIds.size() <= 0 ) { | if (null == setOffFeesIds || setOffFeesIds.size() <= 0 ) { | ||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"未查询到押金科目"); | throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"未查询到押金科目"); | ||||
| } | } | ||||
| @@ -436,7 +570,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| WxFinanceFeesSetoff fsq = new WxFinanceFeesSetoff(); | WxFinanceFeesSetoff fsq = new WxFinanceFeesSetoff(); | ||||
| fsq.updateTenantInfo(dto); | fsq.updateTenantInfo(dto); | ||||
| fsq.setAdvanceFeesId(dto.getFeesId()); | fsq.setAdvanceFeesId(dto.getFeesId()); | ||||
| setOffFeesIds = wxEnergyService.getAdvanceSetoffFeesids(fsq); | |||||
| setOffFeesIds = this.getAdvanceSetoffFeesids(fsq); | |||||
| if (null == setOffFeesIds || setOffFeesIds.size() <= 0 ) { | if (null == setOffFeesIds || setOffFeesIds.size() <= 0 ) { | ||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"该科目未设置可冲抵科目"); | throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"该科目未设置可冲抵科目"); | ||||
| } | } | ||||
| @@ -519,7 +653,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| WxFinanceFees fq = new WxFinanceFees(); | WxFinanceFees fq = new WxFinanceFees(); | ||||
| fq.updateTenantInfo(record); | fq.updateTenantInfo(record); | ||||
| Map<Long, WxFinanceFees> fmap = wxEnergyService.getFeesMap(fq); | |||||
| Map<Long, WxFinanceFees> fmap = this.getFeesMap(fq); | |||||
| List<WxFinanceReceiveVo> volist = new ArrayList<WxFinanceReceiveVo>(); | List<WxFinanceReceiveVo> volist = new ArrayList<WxFinanceReceiveVo>(); | ||||
| for (int i = 0 ; i < page.getList().size() ; i++) { | for (int i = 0 ; i < page.getList().size() ; i++) { | ||||
| WxFinanceReceive fr = page.getList().get(i); | WxFinanceReceive fr = page.getList().get(i); | ||||
| @@ -597,7 +731,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| WxFinanceFees fq = new WxFinanceFees(); | WxFinanceFees fq = new WxFinanceFees(); | ||||
| fq.updateTenantInfo(record); | fq.updateTenantInfo(record); | ||||
| Map<Long, WxFinanceFees> fmap = wxEnergyService.getFeesMap(fq); | |||||
| Map<Long, WxFinanceFees> fmap = this.getFeesMap(fq); | |||||
| for (int i = 0 ; i < page.getList().size() ; i++) { | for (int i = 0 ; i < page.getList().size() ; i++) { | ||||
| WxFinanceReceiveBill fr = page.getList().get(i); | WxFinanceReceiveBill fr = page.getList().get(i); | ||||
| if (null != shopMap) { | if (null != shopMap) { | ||||
| @@ -998,7 +1132,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| for (int j = 0 ; j < be.getSetOffDetailList().size(); j ++ ) { | for (int j = 0 ; j < be.getSetOffDetailList().size(); j ++ ) { | ||||
| FinanceSetOffDetailVo setoffdetail = be.getSetOffDetailList().get(j); | FinanceSetOffDetailVo setoffdetail = be.getSetOffDetailList().get(j); | ||||
| WxAllBill advance = wxAllBillService.getById(addreceive, setoffdetail.getAdvanceId()); | WxAllBill advance = wxAllBillService.getById(addreceive, setoffdetail.getAdvanceId()); | ||||
| WxFinanceFees fees = wxEnergyService.getFeesById(advance.getEnergyFeesId(), addreceive.getTenantId()); | |||||
| WxFinanceFees fees = this.getFeesById(advance.getEnergyFeesId(), addreceive.getTenantId()); | |||||
| //如果是预冲 | //如果是预冲 | ||||
| if (fees.getFeesType().intValue() == EnumFeesType.ADVANCE.getCode().intValue()){ | if (fees.getFeesType().intValue() == EnumFeesType.ADVANCE.getCode().intValue()){ | ||||
| advanceMoney = advanceMoney.add(new BigDecimal(setoffdetail.getSetoff())); | advanceMoney = advanceMoney.add(new BigDecimal(setoffdetail.getSetoff())); | ||||
| @@ -1666,7 +1800,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| if (null != page && null != page.getList()) { | if (null != page && null != page.getList()) { | ||||
| WxFinanceFees fq = new WxFinanceFees(); | WxFinanceFees fq = new WxFinanceFees(); | ||||
| fq.updateTenantInfo(record); | fq.updateTenantInfo(record); | ||||
| Map<Long, WxFinanceFees> feesMap = wxEnergyService.getFeesMap(fq); | |||||
| Map<Long, WxFinanceFees> feesMap = this.getFeesMap(fq); | |||||
| for (int i = 0 ; i < page.getList().size(); i++ ) { | for (int i = 0 ; i < page.getList().size(); i++ ) { | ||||
| WxFinanceReceiveSetoff frs = page.getList().get(i); | WxFinanceReceiveSetoff frs = page.getList().get(i); | ||||
| if (null != feesMap && null != frs.getFeesId()) { | if (null != feesMap && null != frs.getFeesId()) { | ||||
| @@ -1901,7 +2035,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| if (null != pays) { | if (null != pays) { | ||||
| WxFinanceFees fq = new WxFinanceFees(); | WxFinanceFees fq = new WxFinanceFees(); | ||||
| fq.updateTenantInfo(record); | fq.updateTenantInfo(record); | ||||
| Map<Long, WxFinanceFees> feesMap = wxEnergyService.getFeesMap(fq); | |||||
| Map<Long, WxFinanceFees> feesMap = this.getFeesMap(fq); | |||||
| for (int i = 0 ; i < pays.size() ; i ++) { | for (int i = 0 ; i < pays.size() ; i ++) { | ||||
| WxFinanceReceiveBill rpw = pays.get(i); | WxFinanceReceiveBill rpw = pays.get(i); | ||||
| if (null != feesMap && null != rpw.getFeesId()) { | if (null != feesMap && null != rpw.getFeesId()) { | ||||
| @@ -165,7 +165,7 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { | |||||
| //wx_bill_pay_way | //wx_bill_pay_way | ||||
| wxFinanceService.payWayInit(wxMall.getTenantInfo()); | wxFinanceService.payWayInit(wxMall.getTenantInfo()); | ||||
| //wx_energy_fees | //wx_energy_fees | ||||
| wxEnergyService.initEnergyFees(wxMall.getTenantInfo()); | |||||
| wxFinanceService.initEnergyFees(wxMall.getTenantInfo()); | |||||
| } | } | ||||
| wxMallService.update(wxMall); | wxMallService.update(wxMall); | ||||
| } | } | ||||