| @@ -248,13 +248,10 @@ public class WxMerchantController extends BaseController { | |||||
| @ApiOperation("获取商户ID,名称接口") | @ApiOperation("获取商户ID,名称接口") | ||||
| @GetMapping("IdAndNamelist") | @GetMapping("IdAndNamelist") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "type", value = "类型", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true) | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true) | ||||
| }) | }) | ||||
| public ResultData IdAndNamelist(Integer type,Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::list"); | |||||
| WxMerchant wxMerchant = new WxMerchant(); | |||||
| public ResultData IdAndNamelist(@ModelAttribute WxMerchant wxMerchant,Integer pageNum, Integer pageSize) { | |||||
| wxMerchant.updateTenantInfo(getTenantInfo()); | wxMerchant.updateTenantInfo(getTenantInfo()); | ||||
| wxMerchant.setSortColumns(BaseEntity.SortField.TopTime_DESC); | wxMerchant.setSortColumns(BaseEntity.SortField.TopTime_DESC); | ||||
| wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); | ||||
| @@ -267,6 +264,9 @@ public class WxMerchantController extends BaseController { | |||||
| wxMerchant.setBusinessForRule(dataRule.getBussinessIds()); | wxMerchant.setBusinessForRule(dataRule.getBussinessIds()); | ||||
| wxMerchant.setShopTypeForRule(dataRule.getShopTypes()); | wxMerchant.setShopTypeForRule(dataRule.getShopTypes()); | ||||
| } | } | ||||
| if (null == wxMerchant.getIsPrivate()) { | |||||
| wxMerchant.setIsPrivate(EnumYesOrNo.NO.getCode()); | |||||
| } | |||||
| return new ResultData(wxMerchantService.queryIdAndNames(wxMerchant)); | return new ResultData(wxMerchantService.queryIdAndNames(wxMerchant)); | ||||
| } | } | ||||
| @@ -21,6 +21,7 @@ import com.iformall.domain.po.WxMallBuilding; | |||||
| import com.iformall.domain.po.WxMallFloor; | import com.iformall.domain.po.WxMallFloor; | ||||
| import com.iformall.domain.po.WxShop; | import com.iformall.domain.po.WxShop; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.enums.EnumBillAllType; | |||||
| import com.iformall.enums.EnumEnergyMeterPhysicsType; | import com.iformall.enums.EnumEnergyMeterPhysicsType; | ||||
| import com.iformall.enums.EnumYesOrNo; | import com.iformall.enums.EnumYesOrNo; | ||||
| import com.iformall.mapper.WxEnergyMeterMapper; | import com.iformall.mapper.WxEnergyMeterMapper; | ||||
| @@ -188,7 +189,8 @@ public class WxEnergyHelper { | |||||
| if (StringUtils.isBlank(shopfee.getPrice())) { | if (StringUtils.isBlank(shopfee.getPrice())) { | ||||
| return "0"; | return "0"; | ||||
| } | } | ||||
| if (shopfee.getIsPublic() == EnumYesOrNo.YES.getCode()) { | |||||
| //如果是公摊,或者非能源费用,则用公式计算 | |||||
| if (shopfee.getIsPublic() == EnumYesOrNo.YES.getCode() || fees.getBillType() != EnumBillAllType.DAILY.getCode()) { | |||||
| //替代占位符为真实数据 | //替代占位符为真实数据 | ||||
| //公摊总表数据,根据公摊总表下的公共表来查询所有的读数 | //公摊总表数据,根据公摊总表下的公共表来查询所有的读数 | ||||
| Map<Long,BigDecimal> meterNumberMap = null; | Map<Long,BigDecimal> meterNumberMap = null; | ||||
| @@ -217,7 +219,7 @@ public class WxEnergyHelper { | |||||
| } | } | ||||
| return "0"; | return "0"; | ||||
| }else { | }else { | ||||
| //如果是用户能耗 | |||||
| if (null == userMeterList || userMeterList.size() <= 0 ) { | if (null == userMeterList || userMeterList.size() <= 0 ) { | ||||
| return "0"; | return "0"; | ||||
| } | } | ||||
| @@ -1225,6 +1225,13 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||||
| } | } | ||||
| } | } | ||||
| /** | |||||
| * 计算 | |||||
| * 如果是公摊,肯定是能源费用,则从抄表数据里面取读数,然后计算 | |||||
| * 如果是用户能源费用,则从抄表数据中读取数 | |||||
| * 如果是非能源科目数据,则从公式计算。 | |||||
| * | |||||
| */ | |||||
| public void generateCalcuteResult(WxEnergyFees fees,WxEnergyReadingCalcute record,List<Long> shopIds) { | public void generateCalcuteResult(WxEnergyFees fees,WxEnergyReadingCalcute record,List<Long> shopIds) { | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| WxShop shq = new WxShop(); | WxShop shq = new WxShop(); | ||||
| @@ -1313,15 +1320,18 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"店铺"+shop.getShopNumber()+"未设置抄表区间"); | throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"店铺"+shop.getShopNumber()+"未设置抄表区间"); | ||||
| } | } | ||||
| //一个年月,一个店铺应该只有一个周期 | //一个年月,一个店铺应该只有一个周期 | ||||
| WxEnergyFeesTime tq = new WxEnergyFeesTime(); | |||||
| tq.updateTenantInfo(record); | |||||
| tq.setIds(timeIds); | |||||
| tq.setPeriod(record.getPeriod()); | |||||
| List<WxEnergyFeesTime> timelist = wxEnergyFeesTimeMapper.findList(tq); | |||||
| if (null == timelist || timelist.size() <= 0 ) { | |||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"店铺"+shop.getShopNumber()+"未设置抄表区间"); | |||||
| WxEnergyFeesTime time = null; | |||||
| if (fees.getBillType() == EnumBillAllType.DAILY.getCode()) { | |||||
| WxEnergyFeesTime tq = new WxEnergyFeesTime(); | |||||
| tq.updateTenantInfo(record); | |||||
| tq.setIds(timeIds); | |||||
| tq.setPeriod(record.getPeriod()); | |||||
| List<WxEnergyFeesTime> timelist = wxEnergyFeesTimeMapper.findList(tq); | |||||
| if (null == timelist || timelist.size() <= 0 ) { | |||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"店铺"+shop.getShopNumber()+"未设置抄表区间"); | |||||
| } | |||||
| time = timelist.get(0); | |||||
| } | } | ||||
| WxEnergyFeesTime time = timelist.get(0); | |||||
| //根据店铺查询绑定的科目 | //根据店铺查询绑定的科目 | ||||
| WxEnergyFeesShop csq = new WxEnergyFeesShop(); | WxEnergyFeesShop csq = new WxEnergyFeesShop(); | ||||