| @@ -35,7 +35,6 @@ public class WxMallBuildingController extends BaseController { | |||||
| @ApiOperation("获取楼层楼座数据") | @ApiOperation("获取楼层楼座数据") | ||||
| @GetMapping("getbuildingfloorlist") | @GetMapping("getbuildingfloorlist") | ||||
| @SystemControllerLog(description = "商城-楼座-获取楼层楼座数据") | |||||
| public ResultData getbuildingfloorlist(WxMallBuilding wxMallBuilding) { | public ResultData getbuildingfloorlist(WxMallBuilding wxMallBuilding) { | ||||
| wxMallBuilding.updateTenantInfo(getTenantInfo()); | wxMallBuilding.updateTenantInfo(getTenantInfo()); | ||||
| WxUserDataRule dataRule = this.getCurrentDataFloors(); | WxUserDataRule dataRule = this.getCurrentDataFloors(); | ||||
| @@ -49,7 +48,6 @@ public class WxMallBuildingController extends BaseController { | |||||
| @ApiOperation("保存楼层楼座地图") | @ApiOperation("保存楼层楼座地图") | ||||
| @PostMapping("saveFloorImg") | @PostMapping("saveFloorImg") | ||||
| @SystemControllerLog(description = "商城-楼座/楼层-保存地图") | |||||
| public ResultData saveFloorImg(@RequestBody List<WxMallBuilding> record) { | public ResultData saveFloorImg(@RequestBody List<WxMallBuilding> record) { | ||||
| logger.debug("[" + getIpAddr() + "] WxMallBuildingController::addBuildingAndFloor"); | logger.debug("[" + getIpAddr() + "] WxMallBuildingController::addBuildingAndFloor"); | ||||
| if(record == null && record.size() > 0) { | if(record == null && record.size() > 0) { | ||||
| @@ -76,7 +74,6 @@ public class WxMallBuildingController extends BaseController { | |||||
| @ApiOperation("保存楼层楼座面积") | @ApiOperation("保存楼层楼座面积") | ||||
| @PostMapping("saveFloorArea") | @PostMapping("saveFloorArea") | ||||
| @SystemControllerLog(description = "商城-楼座/楼层-保存面积") | |||||
| public ResultData saveFloorArea(@RequestBody WxMallFloor record) { | public ResultData saveFloorArea(@RequestBody WxMallFloor record) { | ||||
| logger.debug("[" + getIpAddr() + "] WxMallBuildingController::addBuildingAndFloor"); | logger.debug("[" + getIpAddr() + "] WxMallBuildingController::addBuildingAndFloor"); | ||||
| if(record == null) { | if(record == null) { | ||||
| @@ -788,5 +788,25 @@ public class WxAllBillController extends BillBaseController { | |||||
| record.setIsPreview(EnumYesOrNo.NO.getCode()); | record.setIsPreview(EnumYesOrNo.NO.getCode()); | ||||
| return new ResultData(wxAllBillService.getBillMonthSum(record)); | return new ResultData(wxAllBillService.getBillMonthSum(record)); | ||||
| } | } | ||||
| //增加临时费用 | |||||
| @PostMapping("addOtherBill") | |||||
| public ResultData addOtherBill(@RequestBody WxAllBill record) { | |||||
| record.updateTenantInfo(getTenantInfo()); | |||||
| if (StringUtils.isBlank(record.getReceivePay()) || new BigDecimal(record.getReceivePay()).compareTo(new BigDecimal(0)) <= 0 ) { | |||||
| return new ResultData(Result.ERROR,"请输入正确金额"); | |||||
| } | |||||
| WxMerchant merchant = wxMerchantService.selectById(record.getMerchantId()); | |||||
| record.setMerchantId(merchant.getId()); | |||||
| record.setRentShopType(merchant.getRentShopType()); | |||||
| record.setNeedPay(record.getReceivePay()); | |||||
| record.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||||
| record.setIsPreview(EnumYesOrNo.NO.getCode()); | |||||
| billAllHelper.saveOrUpdateBill(record, getUser()); | |||||
| return new ResultData(); | |||||
| //return wxBillAllService.updateReceivePay(wxBillAll, getUser(),false); | |||||
| } | |||||
| } | } | ||||
| @@ -1,81 +0,0 @@ | |||||
| package com.iformall.controller; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxEnergyFees; | |||||
| import com.iformall.domain.po.WxEnergyFeesTime; | |||||
| import com.iformall.domain.po.WxEnergyMeterReading; | |||||
| import com.iformall.domain.po.base.BaseEntity; | |||||
| import com.iformall.enums.EnumEnergyMeterType; | |||||
| import com.iformall.enums.EnumYesOrNo; | |||||
| import com.iformall.service.WxEnergyService; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.GetMapping; | |||||
| import org.springframework.web.bind.annotation.ModelAttribute; | |||||
| import org.springframework.web.bind.annotation.PostMapping; | |||||
| import org.springframework.web.bind.annotation.RequestBody; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| import java.util.HashMap; | |||||
| import java.util.Map; | |||||
| @RestController | |||||
| @RequestMapping("/api/energy") | |||||
| @Api(description = "能源相关接口") | |||||
| public class WxEnergyController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxEnergyService wxEnergyService; | |||||
| @ApiOperation("表类型") | |||||
| @GetMapping("meterList") | |||||
| public ResultData timeList() { | |||||
| Map retMap = new HashMap(); | |||||
| for (EnumEnergyMeterType mem : EnumEnergyMeterType.values()) { | |||||
| retMap.put(mem.getCode(), mem.getMessage()); | |||||
| } | |||||
| return new ResultData(retMap); | |||||
| } | |||||
| @ApiOperation("费用区间列表") | |||||
| @GetMapping("timeList") | |||||
| public ResultData timeList(@ModelAttribute WxEnergyFeesTime record) { | |||||
| record.updateTenantInfo(getTenantInfo()); | |||||
| record.setIsDel(EnumYesOrNo.NO.getCode()); | |||||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||||
| PageInfo<WxEnergyFeesTime> page = wxEnergyService.timeListAsPage(record, 1, 1000); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @PostMapping("commit") | |||||
| public ResultData feesUpdateIsDel(@RequestBody WxEnergyMeterReading record) { | |||||
| record.updateTenantInfo(getTenantInfo()); | |||||
| wxEnergyService.commitReading(record,this.getLoginMallUserInfo()); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("抄表数据分页列表接口") | |||||
| @GetMapping("readingList") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||||
| }) | |||||
| public ResultData readingList(@ModelAttribute WxEnergyMeterReading record, Integer pageNum, Integer pageSize) { | |||||
| record.updateTenantInfo(getTenantInfo()); | |||||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||||
| PageInfo<WxEnergyMeterReading> page = wxEnergyService.readingListAsPage(record, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| } | |||||
| @@ -14,11 +14,15 @@ import com.iformall.domain.po.SysConfig; | |||||
| import com.iformall.domain.po.WxAllBill; | import com.iformall.domain.po.WxAllBill; | ||||
| import com.iformall.domain.po.WxBillAction; | import com.iformall.domain.po.WxBillAction; | ||||
| import com.iformall.domain.po.WxCouponOrder; | import com.iformall.domain.po.WxCouponOrder; | ||||
| import com.iformall.domain.po.WxEnergyFeesTime; | |||||
| import com.iformall.domain.po.WxEnergyMeterReading; | |||||
| import com.iformall.domain.po.WxFlowModel; | import com.iformall.domain.po.WxFlowModel; | ||||
| import com.iformall.domain.po.WxMallBuilding; | |||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.WxMerchantBUser; | import com.iformall.domain.po.WxMerchantBUser; | ||||
| import com.iformall.domain.po.WxShop; | import com.iformall.domain.po.WxShop; | ||||
| import com.iformall.domain.po.WxUserDataRule; | import com.iformall.domain.po.WxUserDataRule; | ||||
| import com.iformall.domain.po.base.BaseEntity; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | import com.iformall.domain.vo.WxBillHotNotify; | ||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| @@ -30,6 +34,7 @@ import com.iformall.enums.EnumBillOweOrNearType; | |||||
| import com.iformall.enums.EnumBillUpdateType; | import com.iformall.enums.EnumBillUpdateType; | ||||
| import com.iformall.enums.EnumCouponOrderStatus; | import com.iformall.enums.EnumCouponOrderStatus; | ||||
| import com.iformall.enums.EnumCouponType; | import com.iformall.enums.EnumCouponType; | ||||
| import com.iformall.enums.EnumEnergyMeterType; | |||||
| import com.iformall.enums.EnumFilterSettle; | import com.iformall.enums.EnumFilterSettle; | ||||
| import com.iformall.enums.EnumFlowKey; | import com.iformall.enums.EnumFlowKey; | ||||
| import com.iformall.enums.EnumMenuType; | import com.iformall.enums.EnumMenuType; | ||||
| @@ -46,8 +51,11 @@ import com.iformall.service.WxBillActionService; | |||||
| import com.iformall.service.WxBillSettleService; | import com.iformall.service.WxBillSettleService; | ||||
| import com.iformall.service.WxChartDataService; | import com.iformall.service.WxChartDataService; | ||||
| import com.iformall.service.WxCouponOrderService; | import com.iformall.service.WxCouponOrderService; | ||||
| import com.iformall.service.WxEnergyService; | |||||
| import com.iformall.service.WxFlowService; | import com.iformall.service.WxFlowService; | ||||
| import com.iformall.service.WxMallBuildingService; | |||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| import com.iformall.service.WxShopService; | |||||
| import com.iformall.service.WxUserDataRuleService; | import com.iformall.service.WxUserDataRuleService; | ||||
| import com.iformall.service.helper.WxBillAllHelper; | import com.iformall.service.helper.WxBillAllHelper; | ||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| @@ -100,6 +108,12 @@ public class WxMallAdminController extends BaseController { | |||||
| private WxCouponOrderService wxCouponOrderService; | private WxCouponOrderService wxCouponOrderService; | ||||
| @Autowired | @Autowired | ||||
| WxAllBillService wxAllBillService; | WxAllBillService wxAllBillService; | ||||
| @Autowired | |||||
| private WxMallBuildingService wxMallBuildingService; | |||||
| @Autowired | |||||
| private WxShopService wxShopService; | |||||
| @Autowired | |||||
| private WxEnergyService wxEnergyService; | |||||
| private WxUserDataRule getCurrentDataFloors(MallUserInfo user) { | private WxUserDataRule getCurrentDataFloors(MallUserInfo user) { | ||||
| @@ -121,6 +135,7 @@ public class WxMallAdminController extends BaseController { | |||||
| if (null != dataRule) { | if (null != dataRule) { | ||||
| tenantEntity.setFloorForRule(dataRule.getFloorIds()); | tenantEntity.setFloorForRule(dataRule.getFloorIds()); | ||||
| tenantEntity.setBusinessForRule(dataRule.getBussinessIds()); | tenantEntity.setBusinessForRule(dataRule.getBussinessIds()); | ||||
| tenantEntity.setShopTypeForRule(dataRule.getShopType()); | |||||
| } | } | ||||
| } | } | ||||
| @@ -322,23 +337,64 @@ public class WxMallAdminController extends BaseController { | |||||
| return new ResultData(retMap); | return new ResultData(retMap); | ||||
| } | } | ||||
| @GetMapping("billDailyTypes") | |||||
| public ResultData billDailyTypes() { | |||||
| Map<Integer,String> tmap = new HashMap<Integer,String>(); | |||||
| for (EnumBillDailyType t : EnumBillDailyType.values()) { | |||||
| tmap.put(t.getCode(), t.getMessage()); | |||||
| @ApiOperation("表类型") | |||||
| @GetMapping("meterList") | |||||
| public ResultData timeList() { | |||||
| Map retMap = new HashMap(); | |||||
| for (EnumEnergyMeterType mem : EnumEnergyMeterType.values()) { | |||||
| retMap.put(mem.getCode(), mem.getMessage()); | |||||
| } | } | ||||
| return new ResultData(tmap); | |||||
| } | |||||
| return new ResultData(retMap); | |||||
| } | |||||
| @PostMapping("billDailyAdd") | |||||
| public ResultData add(@RequestBody WxAllBill wxBillDaily) { | |||||
| setQueryDataRule(wxBillDaily); | |||||
| wxBillDaily.setPayWay(null); | |||||
| wxBillDaily.setPayDate(null); | |||||
| wxBillDaily.setBillRemark(wxBillDaily.getBillRemark()); | |||||
| return wxAllBillService.saveOrUpdate(wxBillDaily, this.getLoginMallUserInfo()); | |||||
| @ApiOperation("费用区间列表") | |||||
| @GetMapping("timeList") | |||||
| public ResultData timeList(@ModelAttribute WxEnergyFeesTime record) { | |||||
| setQueryDataRule(record); | |||||
| record.setIsDel(EnumYesOrNo.NO.getCode()); | |||||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||||
| PageInfo<WxEnergyFeesTime> page = wxEnergyService.timeListAsPage(record, 1, 1000); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("获取楼层楼座数据") | |||||
| @GetMapping("getbuildingfloorlist") | |||||
| public ResultData getbuildingfloorlist(WxMallBuilding wxMallBuilding) { | |||||
| setQueryDataRule(wxMallBuilding); | |||||
| return wxMallBuildingService.getBuildingFloorList(wxMallBuilding,this.getLoginMallUserInfo()); | |||||
| } | } | ||||
| @ApiOperation("查询店铺分页列表接口") | |||||
| @GetMapping("shopList") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData shopList(@ModelAttribute WxShop wxShop, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxShop){ | |||||
| wxShop = new WxShop(); | |||||
| } | |||||
| wxShop.setSortColumns(BaseEntity.SortField.CreateDate_DESC,BaseEntity.SortField.Id_DESC); | |||||
| setQueryDataRule(wxShop); | |||||
| final PageInfo<Map<String, Object>> page = wxShopService.listMapAsPage(wxShop, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("抄表数据分页列表接口") | |||||
| @GetMapping("readingList") | |||||
| public ResultData readingList(@ModelAttribute WxEnergyMeterReading record) { | |||||
| record.updateTenantInfo(getTenantInfo()); | |||||
| record.setIsDel(EnumYesOrNo.NO.getCode()); | |||||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||||
| PageInfo<WxEnergyMeterReading> page = wxEnergyService.readingListAsPage(record, 1, 1000); | |||||
| return new ResultData(page); | |||||
| } | |||||
| //能源抄表费用 | |||||
| @PostMapping("commitEnergyReading") | |||||
| public ResultData commitEnergyReading(@RequestBody WxEnergyMeterReading record) { | |||||
| record.updateTenantInfo(getTenantInfo()); | |||||
| wxEnergyService.commitReading(record,this.getLoginMallUserInfo()); | |||||
| return new ResultData(); | |||||
| } | |||||
| } | } | ||||
| @@ -426,21 +426,34 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||||
| @Override | @Override | ||||
| public void createReading(WxEnergyMeterReading record,MallUserInfo userInfo) { | public void createReading(WxEnergyMeterReading record,MallUserInfo userInfo) { | ||||
| //根据 | |||||
| Date date = new Date(); | Date date = new Date(); | ||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| record.setId(idWorker.nextId()); | |||||
| record.setCreateTime(date); | |||||
| record.setCreateBy(userInfo.getId()); | |||||
| record.setCreateByName(userInfo.getName()); | |||||
| record.setUpdateTime(date); | |||||
| record.setUpdateBy(userInfo.getId()); | |||||
| record.setUpdateByName(userInfo.getName()); | |||||
| try { | |||||
| wxEnergyMeterReadingMapper.insert(record); | |||||
| } catch (Exception e) { | |||||
| logger.error("保存租赁账单失败,e:" + e.getMessage()); | |||||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||||
| } | |||||
| if (null == record.getId()) { | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| record.setId(idWorker.nextId()); | |||||
| record.setCreateTime(date); | |||||
| record.setCreateBy(userInfo.getId()); | |||||
| record.setCreateByName(userInfo.getName()); | |||||
| record.setUpdateTime(date); | |||||
| record.setUpdateBy(userInfo.getId()); | |||||
| record.setUpdateByName(userInfo.getName()); | |||||
| try { | |||||
| wxEnergyMeterReadingMapper.insert(record); | |||||
| } catch (Exception e) { | |||||
| logger.error("保存租赁账单失败,e:" + e.getMessage()); | |||||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||||
| } | |||||
| }else { | |||||
| record.setUpdateTime(date); | |||||
| record.setUpdateBy(userInfo.getId()); | |||||
| record.setUpdateByName(userInfo.getName()); | |||||
| try { | |||||
| wxEnergyMeterReadingMapper.updateById(record); | |||||
| } catch (Exception e) { | |||||
| logger.error("保存租赁账单失败,e:" + e.getMessage()); | |||||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -504,7 +517,7 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||||
| @Override | @Override | ||||
| public void commitReading(WxEnergyMeterReading record, MallUserInfo userInfo) { | public void commitReading(WxEnergyMeterReading record, MallUserInfo userInfo) { | ||||
| if (null == record.getMeterReadingList()) { | |||||
| if (null != record.getMeterReadingList()) { | |||||
| WxShop sq = new WxShop(); | WxShop sq = new WxShop(); | ||||
| sq.updateTenantInfo(record); | sq.updateTenantInfo(record); | ||||
| Map<Long, WxShop> shopMap = wxShopService.findShopMap(sq); | Map<Long, WxShop> shopMap = wxShopService.findShopMap(sq); | ||||