|
|
@@ -62,6 +62,7 @@ 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; |
|
|
|
|
|
import com.iformall.utils.DateUtils; |
|
|
|
|
|
|
|
|
import io.swagger.annotations.Api; |
|
|
import io.swagger.annotations.Api; |
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
@@ -75,6 +76,7 @@ import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
import java.math.BigDecimal; |
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.Calendar; |
|
|
import java.util.Date; |
|
|
import java.util.Date; |
|
|
import java.util.HashMap; |
|
|
import java.util.HashMap; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
@@ -384,28 +386,100 @@ public class WxMallAdminController extends BaseController { |
|
|
@ApiOperation("抄表数据分页列表接口") |
|
|
@ApiOperation("抄表数据分页列表接口") |
|
|
@GetMapping("shopMeterList") |
|
|
@GetMapping("shopMeterList") |
|
|
public ResultData shopMeterList(@ModelAttribute WxEnergyMeter record) { |
|
|
public ResultData shopMeterList(@ModelAttribute WxEnergyMeter record) { |
|
|
|
|
|
if (StringUtils.isBlank(record.getSearchKey())) { |
|
|
|
|
|
return new ResultData(); |
|
|
|
|
|
} |
|
|
record.setIsDel(EnumYesOrNo.NO.getCode()); |
|
|
record.setIsDel(EnumYesOrNo.NO.getCode()); |
|
|
setQueryDataRule(record); |
|
|
setQueryDataRule(record); |
|
|
|
|
|
|
|
|
WxEnergyMeterShopFloor sfq = new WxEnergyMeterShopFloor(); |
|
|
|
|
|
sfq.updateTenantInfo(record); |
|
|
|
|
|
sfq.setType(EnumEnergyMeterShopFloorType.SHOP.getCode()); |
|
|
|
|
|
if (StringUtils.isNotBlank(record.getShopNumber())) { |
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(record.getSearchKey())) { |
|
|
|
|
|
WxEnergyMeterShopFloor sfq = new WxEnergyMeterShopFloor(); |
|
|
|
|
|
sfq.updateTenantInfo(record); |
|
|
|
|
|
sfq.setType(EnumEnergyMeterShopFloorType.SHOP.getCode()); |
|
|
WxShop sq = new WxShop(); |
|
|
WxShop sq = new WxShop(); |
|
|
sq.updateTenantInfo(record); |
|
|
sq.updateTenantInfo(record); |
|
|
sq.setShopNumber(record.getShopNumber()); |
|
|
|
|
|
|
|
|
sq.setShopNumber(record.getSearchKey()); |
|
|
List<Long> sids = wxShopService.getShopIds(sq); |
|
|
List<Long> sids = wxShopService.getShopIds(sq); |
|
|
if (null == sids || sids.size() <= 0 ) { |
|
|
|
|
|
return new ResultData(); |
|
|
|
|
|
} |
|
|
|
|
|
sfq.setAliseIdList(sids); |
|
|
|
|
|
|
|
|
if (null != sids && sids.size() > 0 ) { |
|
|
|
|
|
sfq.setAliseIdList(sids); |
|
|
|
|
|
List<Long> mids = wxEnergyService.getMeterIdList(sfq); |
|
|
|
|
|
if (null != mids && mids.size() > 0 ) { |
|
|
|
|
|
record.setIds(mids); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
record.setOrName(record.getSearchKey()); |
|
|
|
|
|
} |
|
|
|
|
|
record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); |
|
|
|
|
|
PageInfo<WxEnergyMeter> page = wxEnergyService.meterListAsPage(record, 1, 1000); |
|
|
|
|
|
return new ResultData(page); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("费用区间所属年月") |
|
|
|
|
|
@GetMapping("periodList") |
|
|
|
|
|
public ResultData periodList() { |
|
|
|
|
|
String[] peroids = new String[3]; |
|
|
|
|
|
String date_pattern_month = "yyyyMM"; |
|
|
|
|
|
Date start1 = DateUtils.getTimeAfterMonths(-2, new Date()); |
|
|
|
|
|
start1 = DateUtils.getFirstDayForCurrMonth(start1); |
|
|
|
|
|
peroids[0] = DateUtils.date2String(start1,date_pattern_month); |
|
|
|
|
|
|
|
|
|
|
|
Date start2 = DateUtils.getTimeAfterMonths(1, start1); |
|
|
|
|
|
peroids[1] = DateUtils.date2String(start2,date_pattern_month); |
|
|
|
|
|
|
|
|
|
|
|
Date start3 = DateUtils.getTimeAfterMonths(1, start2); |
|
|
|
|
|
peroids[2] = DateUtils.date2String(start3,date_pattern_month); |
|
|
|
|
|
|
|
|
|
|
|
return new ResultData(peroids); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("费用区间自动时间") |
|
|
|
|
|
@PostMapping("periodAutoTimes") |
|
|
|
|
|
public ResultData periodAutoTimes(@ModelAttribute WxEnergyFeesTime record) { |
|
|
|
|
|
List<Date> dateList = wxEnergyService.findLastTimeEndGroup(record); |
|
|
|
|
|
if (null != dateList && dateList.size() > 1 ) { |
|
|
|
|
|
return new ResultData(Result.ERROR,"所选店铺表类型最近一次结束时间不相同,不能一起增加"); |
|
|
} |
|
|
} |
|
|
sfq.setAliseId(record.getShopId()); |
|
|
|
|
|
List<Long> mids = wxEnergyService.getMeterIdList(sfq); |
|
|
|
|
|
if (null == mids || mids.size() <= 0 ) { |
|
|
|
|
|
|
|
|
Date start = null; |
|
|
|
|
|
if (null == dateList || dateList.size() <= 0 ) { |
|
|
|
|
|
//之前没有的话,就从年月第一天开始 |
|
|
|
|
|
start = DateUtils.stringToDate(record.getPeriod()+"01", DateUtils.DATE_PATTERN_NOSPACE); |
|
|
|
|
|
}else { |
|
|
|
|
|
//开始时间取接受时间后的一天 |
|
|
|
|
|
start = DateUtils.getTimeAfterDays(1, dateList.get(0)); |
|
|
|
|
|
start = DateUtils.getDayBegin(start); |
|
|
|
|
|
} |
|
|
|
|
|
Date end = DateUtils.getTimeAfterMonths(1, start); |
|
|
|
|
|
Map retMap = new HashMap(); |
|
|
|
|
|
retMap.put("startTime", start); |
|
|
|
|
|
retMap.put("endTime", end); |
|
|
|
|
|
return new ResultData(retMap); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("查询抄表时间") |
|
|
|
|
|
@GetMapping("shopMeterList") |
|
|
|
|
|
public ResultData shopMeterList(@ModelAttribute WxEnergyMeter record) { |
|
|
|
|
|
if (StringUtils.isBlank(record.getSearchKey())) { |
|
|
return new ResultData(); |
|
|
return new ResultData(); |
|
|
} |
|
|
} |
|
|
record.setIds(mids); |
|
|
|
|
|
|
|
|
record.setIsDel(EnumYesOrNo.NO.getCode()); |
|
|
|
|
|
setQueryDataRule(record); |
|
|
|
|
|
if (StringUtils.isNotBlank(record.getSearchKey())) { |
|
|
|
|
|
WxEnergyMeterShopFloor sfq = new WxEnergyMeterShopFloor(); |
|
|
|
|
|
sfq.updateTenantInfo(record); |
|
|
|
|
|
sfq.setType(EnumEnergyMeterShopFloorType.SHOP.getCode()); |
|
|
|
|
|
WxShop sq = new WxShop(); |
|
|
|
|
|
sq.updateTenantInfo(record); |
|
|
|
|
|
sq.setShopNumber(record.getSearchKey()); |
|
|
|
|
|
List<Long> sids = wxShopService.getShopIds(sq); |
|
|
|
|
|
if (null != sids && sids.size() > 0 ) { |
|
|
|
|
|
sfq.setAliseIdList(sids); |
|
|
|
|
|
List<Long> mids = wxEnergyService.getMeterIdList(sfq); |
|
|
|
|
|
if (null != mids && mids.size() > 0 ) { |
|
|
|
|
|
record.setIds(mids); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
record.setOrName(record.getSearchKey()); |
|
|
|
|
|
} |
|
|
record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); |
|
|
record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); |
|
|
PageInfo<WxEnergyMeter> page = wxEnergyService.meterListAsPage(record, 1, 1000); |
|
|
PageInfo<WxEnergyMeter> page = wxEnergyService.meterListAsPage(record, 1, 1000); |
|
|
return new ResultData(page); |
|
|
return new ResultData(page); |
|
|
|