| @@ -64,8 +64,12 @@ public class WxMerchantTradeDailyController extends BaseController { | |||||
| @ApiOperation("数据汇总") | @ApiOperation("数据汇总") | ||||
| @GetMapping("/summary") | @GetMapping("/summary") | ||||
| public ResultData summary(@ModelAttribute WxMerchantTradeDaily wxMerchantTradeDaily) { | public ResultData summary(@ModelAttribute WxMerchantTradeDaily wxMerchantTradeDaily) { | ||||
| logger.debug("[" + getIpAddr() + "] WxMerchantTradeDailyController::summary"); | |||||
| wxMerchantTradeDaily.updateTenantInfo(getTenantInfo()); | wxMerchantTradeDaily.updateTenantInfo(getTenantInfo()); | ||||
| WxUserDataRule dataRule = this.getCurrentDataFloors(); | |||||
| if (null != dataRule) { | |||||
| wxMerchantTradeDaily.setFloorForRule(dataRule.getFloorIds()); | |||||
| wxMerchantTradeDaily.setBusinessForRule(dataRule.getBussinessIds()); | |||||
| } | |||||
| return wxMerchantTradeDailyService.summary(wxMerchantTradeDaily); | return wxMerchantTradeDailyService.summary(wxMerchantTradeDaily); | ||||
| } | } | ||||
| @@ -7,6 +7,7 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.dto.PageMerchantMicroPayDTO; | import com.iformall.domain.dto.PageMerchantMicroPayDTO; | ||||
| import com.iformall.domain.dto.WxOrderReportDto; | import com.iformall.domain.dto.WxOrderReportDto; | ||||
| import com.iformall.domain.po.WxUserDataRule; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.PageMerchantMicroPayVO; | import com.iformall.domain.vo.PageMerchantMicroPayVO; | ||||
| import com.iformall.domain.vo.WxMerchantMicroPayVo; | import com.iformall.domain.vo.WxMerchantMicroPayVo; | ||||
| @@ -76,8 +77,12 @@ public class WxMerchantMicroPayController extends BaseController { | |||||
| @ApiOperation("商户收银分页查询") | @ApiOperation("商户收银分页查询") | ||||
| @GetMapping("/page") | @GetMapping("/page") | ||||
| public ResultData pageMerchantMicroPay(PageMerchantMicroPayDTO dto) { | public ResultData pageMerchantMicroPay(PageMerchantMicroPayDTO dto) { | ||||
| logger.debug("[" + getIpAddr() + "] WxMerchantTradeDailyController::pageMerchantMicroPay"); | |||||
| dto.updateTenantInfo(getTenantInfo()); | dto.updateTenantInfo(getTenantInfo()); | ||||
| WxUserDataRule dataRule = this.getCurrentDataFloors(); | |||||
| if (null != dataRule) { | |||||
| dto.setFloorForRule(dataRule.getFloorIds()); | |||||
| dto.setBusinessForRule(dataRule.getBussinessIds()); | |||||
| } | |||||
| PageInfo<PageMerchantMicroPayVO> page = markingDataReportService.pageMerchantMicroPay(dto); | PageInfo<PageMerchantMicroPayVO> page = markingDataReportService.pageMerchantMicroPay(dto); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -160,6 +160,7 @@ public class WxRaffleActivityController extends BaseController { | |||||
| WxRaffleActivityRecord r = new WxRaffleActivityRecord(); | WxRaffleActivityRecord r = new WxRaffleActivityRecord(); | ||||
| r.setActivityId(a.getId()); | r.setActivityId(a.getId()); | ||||
| r.updateTenantInfo(a); | r.updateTenantInfo(a); | ||||
| r.setMerchantId(getLoginBUser().getMerchantId()); | |||||
| wxCashBackActivityRecord.setMerchantId(getLoginBUser().getMerchantId()); | wxCashBackActivityRecord.setMerchantId(getLoginBUser().getMerchantId()); | ||||
| int allRecordCount = wxCashBackActivityService.getRecordCount(r); | int allRecordCount = wxCashBackActivityService.getRecordCount(r); | ||||
| @@ -5,6 +5,7 @@ import lombok.Data; | |||||
| import org.springframework.format.annotation.DateTimeFormat; | import org.springframework.format.annotation.DateTimeFormat; | ||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.List; | |||||
| /** | /** | ||||
| * a端收银记录分页查询DTO | * a端收银记录分页查询DTO | ||||
| @@ -35,4 +36,6 @@ public class PageMerchantMicroPayDTO extends TenantEntity { | |||||
| * 商户id | * 商户id | ||||
| */ | */ | ||||
| private Long merchantId; | private Long merchantId; | ||||
| private List<Long> merchantIds; | |||||
| } | } | ||||
| @@ -626,6 +626,14 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| @Override | @Override | ||||
| public PageInfo<PageMerchantMicroPayVO> pageMerchantMicroPay(PageMerchantMicroPayDTO dto) { | public PageInfo<PageMerchantMicroPayVO> pageMerchantMicroPay(PageMerchantMicroPayDTO dto) { | ||||
| if (null != dto.getFloorForRule()) { | |||||
| List<Long> mids = wxMerchantService.getFloorBuildMerchantIds(dto, dto.getFloorForRule(), null, null, 0, 0); | |||||
| if (null == mids || mids.size() <= 0 ) { | |||||
| dto.setMerchantId(-1L); | |||||
| }else { | |||||
| dto.setMerchantIds(mids); | |||||
| } | |||||
| } | |||||
| PageInfo<PageMerchantMicroPayVO> pageResult = PageHelper.startPage(dto.getPageNum(), dto.getPageSize()).doSelectPageInfo(() -> wxOrderMapper.listMerchantMicroPay(dto)); | PageInfo<PageMerchantMicroPayVO> pageResult = PageHelper.startPage(dto.getPageNum(), dto.getPageSize()).doSelectPageInfo(() -> wxOrderMapper.listMerchantMicroPay(dto)); | ||||
| Map<Long, ListMerchantVO> merchantMap = wxMerchantService.listMerchant(dto, null).stream().collect(Collectors.toMap(ListMerchantVO::getId, Function.identity())); | Map<Long, ListMerchantVO> merchantMap = wxMerchantService.listMerchant(dto, null).stream().collect(Collectors.toMap(ListMerchantVO::getId, Function.identity())); | ||||
| List<PageMerchantMicroPayVO> result = pageResult.getList().stream().map(x -> { | List<PageMerchantMicroPayVO> result = pageResult.getList().stream().map(x -> { | ||||
| @@ -1239,10 +1239,8 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| merchantIds.addAll(userMerchantIds); | merchantIds.addAll(userMerchantIds); | ||||
| } | } | ||||
| } | } | ||||
| String floorRule = StringUtils.trimToNull(record.getFloorForRule()); | |||||
| Long building = record.getBuilding(); | |||||
| Long floor = record.getFloor(); | |||||
| List<Long> floorMerchantIds = getFloorBuildMerchantIds(record, floorRule, building, floor, 0, 0); | |||||
| List<Long> floorMerchantIds = getFloorBuildingMerchantIds(record,record.getFloorForRule(),record.getBuilding(),record.getFloor()); | |||||
| if(floorMerchantIds != null){ | if(floorMerchantIds != null){ | ||||
| if(merchantIds.size() > 0){ | if(merchantIds.size() > 0){ | ||||
| merchantIds.retainAll(floorMerchantIds); | merchantIds.retainAll(floorMerchantIds); | ||||
| @@ -1293,6 +1291,12 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| // } | // } | ||||
| } | } | ||||
| private List<Long> getFloorBuildingMerchantIds(TenantEntity tenantEntity,String floorForRule,Long buildingId,Long floor) { | |||||
| String floorRule = StringUtils.trimToNull(floorForRule); | |||||
| List<Long> floorMerchantIds = getFloorBuildMerchantIds(tenantEntity, floorRule, buildingId, floor, 0, 0); | |||||
| return floorMerchantIds; | |||||
| } | |||||
| @Override | @Override | ||||
| public List<Long> getFloorBuildMerchantIds(TenantEntity tenantEntity,String floorRule,Long building,Long floor,Integer merchantShopDel,Integer shopDel ) { | public List<Long> getFloorBuildMerchantIds(TenantEntity tenantEntity,String floorRule,Long building,Long floor,Integer merchantShopDel,Integer shopDel ) { | ||||
| if (null != floorRule || null != building || null != floor) { | if (null != floorRule || null != building || null != floor) { | ||||
| @@ -1222,6 +1222,12 @@ | |||||
| <if test="merchantId != null"> | <if test="merchantId != null"> | ||||
| AND m.id = #{merchantId} | AND m.id = #{merchantId} | ||||
| </if> | </if> | ||||
| <if test=" null != merchantIds "> | |||||
| and m.id in | |||||
| <foreach collection="merchantIds" index="index" item="mIdItem" open="(" separator="," close=")"> | |||||
| #{mIdItem} | |||||
| </foreach> | |||||
| </if> | |||||
| ORDER BY | ORDER BY | ||||
| o.create_date DESC | o.create_date DESC | ||||
| </select> | </select> | ||||