ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/dto/StaffTotalDto.java
@@ -19,6 +19,12 @@ @ApiModelProperty(value = "商户id") private Long shopId; @ApiModelProperty(value = "活动来源1平台活动2店铺活动") private Integer activityFrom; @ApiModelProperty(value = "活动类型1秒杀") private Integer activityType; @ApiModelProperty(value = "活动id") private String activityId; ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/RemoteOrderFallbackFactory.java
@@ -4,11 +4,8 @@ import com.ruoyi.system.api.domain.dto.BirthdayGiftSendDto; import com.ruoyi.system.api.domain.dto.MerBaseDto; import com.ruoyi.system.api.domain.dto.MgtBasePlatformDto; import com.ruoyi.system.api.domain.vo.MgtBulletinBoardVo; import com.ruoyi.system.api.domain.vo.MgtMapIntTotalVo; import com.ruoyi.system.api.domain.vo.*; import com.ruoyi.system.api.service.RemoteOrderService; import com.ruoyi.system.api.domain.vo.AppOrderTotalVo; import com.ruoyi.system.api.domain.vo.MerHomeShopTotalVo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cloud.openfeign.FallbackFactory; @@ -68,6 +65,16 @@ public R autoCancelOrder(String orderId) { return R.fail("自动取消订单失败:" + throwable.getMessage()); } @Override public R<List<MgtMapBigTotalVo>> shopSalesRank(List<Long> shopIdList) { return R.fail("获取销售排行失败:" + throwable.getMessage()); } @Override public R<MerHomeShopTotalVo> getShopServiceTotal(Long shopId) { return R.fail("获取商户服务统计失败:" + throwable.getMessage()); } }; } } ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/service/RemoteOrderService.java
@@ -5,10 +5,7 @@ import com.ruoyi.system.api.domain.dto.BirthdayGiftSendDto; import com.ruoyi.system.api.domain.dto.MerBaseDto; import com.ruoyi.system.api.domain.dto.MgtBasePlatformDto; import com.ruoyi.system.api.domain.vo.AppOrderTotalVo; import com.ruoyi.system.api.domain.vo.MerHomeShopTotalVo; import com.ruoyi.system.api.domain.vo.MgtBulletinBoardVo; import com.ruoyi.system.api.domain.vo.MgtMapIntTotalVo; import com.ruoyi.system.api.domain.vo.*; import com.ruoyi.system.api.factory.RemoteOrderFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; @@ -76,4 +73,18 @@ */ @PostMapping("/order/autoCancelOrder") public R autoCancelOrder(@RequestBody String orderId); @PostMapping("/order/shopSalesRank") public R<List<MgtMapBigTotalVo>> shopSalesRank(@RequestBody List<Long> shopIdList); /** * @description 获取商户服务统计 * @author jqs * @date 2023/8/24 18:29 * @param shopId * @return R<MerHomeShopTotalVo> */ @PostMapping("/order/getShopServiceTotal") public R<MerHomeShopTotalVo> getShopServiceTotal(@RequestBody Long shopId); } ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/domain/dto/StaffActivityListDto.java
@@ -14,6 +14,8 @@ @Data public class StaffActivityListDto extends StaffBaseDto { @ApiModelProperty(value = "活动来源1平台活动2店铺活动") private Integer activityFrom; @ApiModelProperty(value = "活动类型1秒杀") private Integer activityType; ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/domain/vo/MgtActivityListVo.java
@@ -16,6 +16,9 @@ @ApiModelProperty(value = "活动id") private String activityId; @ApiModelProperty(value = "活动类型1秒杀") private Integer activityType; @ApiModelProperty(value = "活动名称") private String activityName; ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/activity/ActivityServiceImpl.java
@@ -651,10 +651,4 @@ return activityMapper.listStaffActivity(staffActivityListDto); } private void createActivityCode(String activityId){ } } ruoyi-modules/ruoyi-goods/src/main/resources/mapper/activity/ActivityMapper.xml
@@ -164,6 +164,7 @@ <select id="listStaffActivity" resultType="com.ruoyi.goods.domain.vo.MgtActivityListVo"> SELECT ta.activity_id activityId, 1 activityType, ta.activity_name activityName FROM t_activity ta WHERE ta.del_flag = 0 ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/domain/vo/MgtMemberSuggestPageVo.java
@@ -26,57 +26,57 @@ @Excel(name = "用户昵称", width = 30, sort = 1) @ApiModelProperty(value = "用户昵称") private String userNickName; @Excel(name = "用户性别", width = 30, sort = 3) @Excel(name = "性别", width = 30, sort = 3) @ApiModelProperty(value = "用户性别") private String gender; @Excel(name = "用户手机", width = 30, sort = 4) @Excel(name = "用户手机号", width = 30, sort = 4) @ApiModelProperty(value = "用户手机") private String userMobile; @Excel(name = "建议类型", width = 30, sort = 5) @ApiModelProperty(value = "建议类型1.平台2.门店") private String suggestType; @Excel(name = "建议内容", width = 30, sort = 6) @Excel(name = "建议内容", width = 30, sort = 7) @ApiModelProperty(value = "建议内容") private String suggestContent; @Excel(name = "平台回复内容", width = 30, sort = 8) @Excel(name = "平台回复内容", width = 30, sort = 9) @ApiModelProperty(value = "平台回复内容") private String replayContent; @Excel(name = "商户回复内容", width = 30, sort = 7) @Excel(name = "店铺回复内容", width = 30, sort = 8) @ApiModelProperty(value = "商户回复内容") private String shopReplayContent; @Excel(name = "建议状态", width = 30, sort = 9) @Excel(name = "状态", width = 30, sort = 10) @ApiModelProperty(value = "建议状态") private String suggestStatus; @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 10) @Excel(name = "提交时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 11) @ApiModelProperty(value = "创建时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date createTime; @Excel(name = "平台回复人", width = 30, sort = 11) @Excel(name = "平台回复人", width = 30, sort = 12) @ApiModelProperty(value = "回复人姓名") private String replayUserName; @Excel(name = "平台回复时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 13) @Excel(name = "平台回复时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 14) @ApiModelProperty(value = "回复时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date replayTime; @Excel(name = "平台响应时间", width = 30, sort = 15) @Excel(name = "平台响应时间", width = 30, sort = 16) @ApiModelProperty(value = "平台响应时间") private String responseTime; @ApiModelProperty(value = "商户id") private Long shopId; @Excel(name = "商户名", width = 30) @Excel(name = "店铺名称", width = 30, sort = 6) @ApiModelProperty(value = "商户名") private String shopName; @Excel(name = "商户回复人", width = 30, sort = 12) @Excel(name = "店铺回复人", width = 30, sort = 13) @ApiModelProperty(value = "商户回复人姓名") private String shopReplayUserName; @Excel(name = "商户回复时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 14) @Excel(name = "店铺回复时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 15) @ApiModelProperty(value = "商户回复时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date shopReplayTime; @Excel(name = "商户响应时间", width = 30, sort = 16) @Excel(name = "店铺响应时间", width = 30, sort = 17) @ApiModelProperty(value = "商户响应时间") private String shopResponseTime; @Excel(name = "建议标签", width = 30, sort = 17) @Excel(name = "建议标签", width = 30, sort = 18) @ApiModelProperty(value = "建议标签") private String suggestTags; ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/controller/concole/OrderController.java
@@ -6,10 +6,7 @@ import com.ruoyi.system.api.domain.dto.BirthdayGiftSendDto; import com.ruoyi.system.api.domain.dto.MerBaseDto; import com.ruoyi.system.api.domain.dto.MgtBasePlatformDto; import com.ruoyi.system.api.domain.vo.AppOrderTotalVo; import com.ruoyi.system.api.domain.vo.MerHomeShopTotalVo; import com.ruoyi.system.api.domain.vo.MgtBulletinBoardVo; import com.ruoyi.system.api.domain.vo.MgtMapIntTotalVo; import com.ruoyi.system.api.domain.vo.*; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -119,4 +116,31 @@ orderService.autoCancelOrder(orderId); return R.ok(); } /** * @description 销量排行 * @author jqs * @date 2023/8/24 18:24 * @param shopIdList * @return R<List<MgtMapBigTotalVo>> */ @PostMapping("/shopSalesRank") public R<List<MgtMapBigTotalVo>> shopSalesRank(@RequestBody List<Long> shopIdList){ List<MgtMapBigTotalVo> mapIntTotalVoList= orderService.shopSalesRank(shopIdList); return R.ok(mapIntTotalVoList); } /** * @description 获取商户服务统计 * @author jqs * @date 2023/8/24 18:29 * @param shopId * @return R<MerHomeShopTotalVo> */ @PostMapping("/getShopServiceTotal") public R<MerHomeShopTotalVo> getShopServiceTotal(@RequestBody Long shopId){ MerHomeShopTotalVo homeShopTotalVo= orderService.getShopServiceTotal(shopId); return R.ok(homeShopTotalVo); } } ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/mapper/order/OrderMapper.java
@@ -279,6 +279,15 @@ /** * @description * @author jqs * @date 2023/6/20 15:50 * @param mgtBaseShopDto * @return MgtTotalDataTotalVo */ MgtTotalDataTotalVo getTotalDataMemberTotal(@Param("param")MgtBaseShopDto mgtBaseShopDto); /** * @description * @author jqs * @date 2023/6/20 18:16 * @param * @return Integer @@ -652,4 +661,13 @@ * @return */ List<MerOrderPageVo> pageMerMemberPayOrder(Page page,@Param("param") MerMemberNoClearOrderDto merOrderPageDto); /** * @description 获取销售排行 * @author jqs * @date 2023/8/24 18:00 * @param shopIdList * @return List<MgtMapIntTotalVo> */ List<MgtMapBigTotalVo> shopSalesRank(@Param("shopIdList")List<Long> shopIdList); } ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java
@@ -2926,8 +2926,9 @@ @Override public MgtTotalDataTotalVo getTotalDataTotal(MgtBaseShopDto mgtBaseShopDto) { //获取人数统计 //营业额 BigDecimal salesTotal = orderMapper.shopSalesTotal(mgtBaseShopDto); MgtTotalDataTotalVo mgtTotalDataTotalVo = orderMapper.getTotalDataTotal(mgtBaseShopDto); // 获取当月时间 LocalDate currentDate = LocalDate.now(); LocalDate firstDayOfMonth = currentDate.withDayOfMonth(1); @@ -2937,13 +2938,18 @@ String lastDayOfMonthStr = lastDayOfMonth.format(formatter); mgtBaseShopDto.setStartDate(firstDayOfMonthStr); mgtBaseShopDto.setEndDate(lastDayOfMonthStr); // MgtTotalDataTotalVo mgtTotalDataTotalVo = orderMapper.getTotalDataTotal(mgtBaseShopDto); mgtTotalDataTotalVo.setSalesTotal(salesTotal); //总进店人数 体验人数 体验开单人数 没体验开单人数 MgtTotalDataTotalVo mgtTotalDataMemberTotalVo = orderMapper.getTotalDataMemberTotal(mgtBaseShopDto); mgtTotalDataTotalVo.setOnlyExperiencePerson(mgtTotalDataMemberTotalVo.getOnlyExperiencePerson()); mgtTotalDataTotalVo.setExperienceCyclePerson(mgtTotalDataMemberTotalVo.getExperienceCyclePerson()); mgtTotalDataTotalVo.setOnlyCyclePerson(mgtTotalDataMemberTotalVo.getOnlyCyclePerson()); mgtTotalDataTotalVo.setOrderPerson(mgtTotalDataMemberTotalVo.getOrderPerson()); //续单人数 Integer reorderPerson = orderMapper.getReorderPerson(mgtBaseShopDto); mgtTotalDataTotalVo.setReorderPerson(reorderPerson); //回头客 Integer returnedPerson = orderMapper.getReturnedPerson(mgtBaseShopDto); mgtTotalDataTotalVo.setSalesTotal(salesTotal); mgtTotalDataTotalVo.setReorderPerson(reorderPerson); mgtTotalDataTotalVo.setReturnedPerson(returnedPerson); return mgtTotalDataTotalVo; } @@ -4158,11 +4164,14 @@ */ @Override public StaffActivityOrderTotalVo getStaffActivityOrderTotal(StaffTotalDto staffTotalDto) { StaffActivityOrderTotalVo staffActivityOrderTotalVo = orderMapper.getStaffActivityOrderTotal(staffTotalDto); StaffActivityOrderTotalVo staffActivityOrderGoodsTotalVo = orderMapper.getStaffActivityOrderGoodsTotal(staffTotalDto); staffActivityOrderTotalVo.setCycleTotal(staffActivityOrderGoodsTotalVo.getCycleTotal()); staffActivityOrderTotalVo.setServiceTotal(staffActivityOrderGoodsTotalVo.getServiceTotal()); staffActivityOrderTotalVo.setExperienceTotal(staffActivityOrderGoodsTotalVo.getExperienceTotal()); StaffActivityOrderTotalVo staffActivityOrderTotalVo = new StaffActivityOrderTotalVo(); if(staffTotalDto.getActivityFrom()==1){ staffActivityOrderTotalVo = orderMapper.getStaffActivityOrderTotal(staffTotalDto); StaffActivityOrderTotalVo staffActivityOrderGoodsTotalVo = orderMapper.getStaffActivityOrderGoodsTotal(staffTotalDto); staffActivityOrderTotalVo.setCycleTotal(staffActivityOrderGoodsTotalVo.getCycleTotal()); staffActivityOrderTotalVo.setServiceTotal(staffActivityOrderGoodsTotalVo.getServiceTotal()); staffActivityOrderTotalVo.setExperienceTotal(staffActivityOrderGoodsTotalVo.getExperienceTotal()); } return staffActivityOrderTotalVo; } @@ -4175,7 +4184,10 @@ */ @Override public StaffActivityTotalVo getStaffActivityTotal(StaffTotalDto staffTotalDto) { StaffActivityTotalVo staffActivityTotalVo = orderMapper.getStaffActivityTotal(staffTotalDto); StaffActivityTotalVo staffActivityTotalVo = new StaffActivityTotalVo(); if(staffTotalDto.getActivityFrom()==1){ staffActivityTotalVo = orderMapper.getStaffActivityTotal(staffTotalDto); } return staffActivityTotalVo; } @@ -4241,19 +4253,21 @@ orderDistributionTotalVo.setOrderTotalValue(orderTotalValue); orderDistributionTotalVo.setOrderMoneyValue(orderMoneyValue); }*/ List<MgtMapTotalPlusVo> mgtMapTotalPlusVoList = orderMapper.listStaffActivityOrderDistributionTotal(staffTotalDto); if (mgtMapTotalPlusVoList != null && !mgtMapTotalPlusVoList.isEmpty()) { String[] orderTotalKey = new String[mgtMapTotalPlusVoList.size()]; Integer[] orderTotalValue = new Integer[mgtMapTotalPlusVoList.size()]; BigDecimal[] orderMoneyValue = new BigDecimal[mgtMapTotalPlusVoList.size()]; MgtMapTotalPlusVo mgtMapTotalPlusVo; for (int i = 0; i < mgtMapTotalPlusVoList.size(); i++) { mgtMapTotalPlusVo = mgtMapTotalPlusVoList.get(i); orderTotalKey[i] = mgtMapTotalPlusVo.getMapKey(); orderTotalValue[i] = mgtMapTotalPlusVo.getMapValueFirst(); orderMoneyValue[i] = mgtMapTotalPlusVo.getMapValueSecond(); if(staffTotalDto.getActivityFrom()==1){ List<MgtMapTotalPlusVo> mgtMapTotalPlusVoList = orderMapper.listStaffActivityOrderDistributionTotal(staffTotalDto); if (mgtMapTotalPlusVoList != null && !mgtMapTotalPlusVoList.isEmpty()) { String[] orderTotalKey = new String[mgtMapTotalPlusVoList.size()]; Integer[] orderTotalValue = new Integer[mgtMapTotalPlusVoList.size()]; BigDecimal[] orderMoneyValue = new BigDecimal[mgtMapTotalPlusVoList.size()]; MgtMapTotalPlusVo mgtMapTotalPlusVo; for (int i = 0; i < mgtMapTotalPlusVoList.size(); i++) { mgtMapTotalPlusVo = mgtMapTotalPlusVoList.get(i); orderTotalKey[i] = mgtMapTotalPlusVo.getMapKey(); orderTotalValue[i] = mgtMapTotalPlusVo.getMapValueFirst(); orderMoneyValue[i] = mgtMapTotalPlusVo.getMapValueSecond(); } orderDistributionTotalVo = fillOrderTotalKeyAndValuesToRecentFiveDays(orderTotalKey,orderTotalValue,orderMoneyValue); } orderDistributionTotalVo = fillOrderTotalKeyAndValuesToRecentFiveDays(orderTotalKey,orderTotalValue,orderMoneyValue); } // 返回订单分布总数对象 return orderDistributionTotalVo; @@ -4321,37 +4335,39 @@ @Override public MerOrderTypeTotalVo getStaffOrderTypeTotal(StaffTotalDto staffTotalDto) { MerOrderTypeTotalVo orderTypeTotalVo = new MerOrderTypeTotalVo(); //获取商品分类销售数据 List<MgtMapTotalPlusVo> MgtMapIntTotalVoGoodsType = orderMapper.listStaffOrderTotalGoodsType(staffTotalDto); List<MgtMapIntTotalVo> goodsTypeTotalList = new ArrayList<>(); List<MgtMapBigTotalVo> goodsTypeMoneyList = new ArrayList<>(); if (MgtMapIntTotalVoGoodsType != null && MgtMapIntTotalVoGoodsType.size() > 0) { MgtMapIntTotalVo MgtMapIntTotalVo; MgtMapBigTotalVo mgtMapBigTotalVo; // 遍历不同商品类型的会员数列表,设置商品类型数组和对应的会员数数组 for (int i = 0; i < MgtMapIntTotalVoGoodsType.size(); i++) { MgtMapIntTotalVo = new MgtMapIntTotalVo(); mgtMapBigTotalVo = new MgtMapBigTotalVo(); MgtMapIntTotalVo.setMapValue(MgtMapIntTotalVoGoodsType.get(i).getMapValueFirst()); mgtMapBigTotalVo.setMapValue(MgtMapIntTotalVoGoodsType.get(i).getMapValueSecond()); if (MgtMapIntTotalVoGoodsType.get(i).getMapKey().equals("1")) { MgtMapIntTotalVo.setMapKey("周期"); mgtMapBigTotalVo.setMapKey("周期"); } else if (MgtMapIntTotalVoGoodsType.get(i).getMapKey().equals("2")) { MgtMapIntTotalVo.setMapKey("服务"); mgtMapBigTotalVo.setMapKey("服务"); } else if (MgtMapIntTotalVoGoodsType.get(i).getMapKey().equals("3")) { MgtMapIntTotalVo.setMapKey("体验"); mgtMapBigTotalVo.setMapKey("体验"); } else if (MgtMapIntTotalVoGoodsType.get(i).getMapKey().equals("4")) { MgtMapIntTotalVo.setMapKey("单品"); mgtMapBigTotalVo.setMapKey("单品"); if(staffTotalDto.getActivityFrom()==1){ //获取商品分类销售数据 List<MgtMapTotalPlusVo> MgtMapIntTotalVoGoodsType = orderMapper.listStaffOrderTotalGoodsType(staffTotalDto); List<MgtMapIntTotalVo> goodsTypeTotalList = new ArrayList<>(); List<MgtMapBigTotalVo> goodsTypeMoneyList = new ArrayList<>(); if (MgtMapIntTotalVoGoodsType != null && MgtMapIntTotalVoGoodsType.size() > 0) { MgtMapIntTotalVo MgtMapIntTotalVo; MgtMapBigTotalVo mgtMapBigTotalVo; // 遍历不同商品类型的会员数列表,设置商品类型数组和对应的会员数数组 for (int i = 0; i < MgtMapIntTotalVoGoodsType.size(); i++) { MgtMapIntTotalVo = new MgtMapIntTotalVo(); mgtMapBigTotalVo = new MgtMapBigTotalVo(); MgtMapIntTotalVo.setMapValue(MgtMapIntTotalVoGoodsType.get(i).getMapValueFirst()); mgtMapBigTotalVo.setMapValue(MgtMapIntTotalVoGoodsType.get(i).getMapValueSecond()); if (MgtMapIntTotalVoGoodsType.get(i).getMapKey().equals("1")) { MgtMapIntTotalVo.setMapKey("周期"); mgtMapBigTotalVo.setMapKey("周期"); } else if (MgtMapIntTotalVoGoodsType.get(i).getMapKey().equals("2")) { MgtMapIntTotalVo.setMapKey("服务"); mgtMapBigTotalVo.setMapKey("服务"); } else if (MgtMapIntTotalVoGoodsType.get(i).getMapKey().equals("3")) { MgtMapIntTotalVo.setMapKey("体验"); mgtMapBigTotalVo.setMapKey("体验"); } else if (MgtMapIntTotalVoGoodsType.get(i).getMapKey().equals("4")) { MgtMapIntTotalVo.setMapKey("单品"); mgtMapBigTotalVo.setMapKey("单品"); } goodsTypeTotalList.add(MgtMapIntTotalVo); goodsTypeMoneyList.add(mgtMapBigTotalVo); } goodsTypeTotalList.add(MgtMapIntTotalVo); goodsTypeMoneyList.add(mgtMapBigTotalVo); orderTypeTotalVo.setGoodsTypeTotalList(goodsTypeTotalList); orderTypeTotalVo.setGoodsTypeMoneyList(goodsTypeMoneyList); } orderTypeTotalVo.setGoodsTypeTotalList(goodsTypeTotalList); orderTypeTotalVo.setGoodsTypeMoneyList(goodsTypeMoneyList); } return orderTypeTotalVo; } @@ -4367,32 +4383,34 @@ public StaffActivityDateMemberTotalVo getStaffActivityGetMemberTotal(StaffTotalDto staffTotalDto) { // 创建返回对象 StaffActivityDateMemberTotalVo staffActivityDateMemberTotalVo = new StaffActivityDateMemberTotalVo(); // 查询数据库获取数据 List<MgtMapIntTotalVo> mgtMapIntTotalVoList = orderMapper.getStaffActivityGetMemberTotal(staffTotalDto); // 将查询结果转为Map Map<String, Integer> map = new HashMap<>(); if (mgtMapIntTotalVoList != null && !mgtMapIntTotalVoList.isEmpty()) { map = mgtMapIntTotalVoList.stream() .collect(Collectors.toMap(MgtMapIntTotalVo::getMapKey, MgtMapIntTotalVo::getMapValue)); if(staffTotalDto.getActivityFrom()==1){ // 查询数据库获取数据 List<MgtMapIntTotalVo> mgtMapIntTotalVoList = orderMapper.getStaffActivityGetMemberTotal(staffTotalDto); // 将查询结果转为Map Map<String, Integer> map = new HashMap<>(); if (mgtMapIntTotalVoList != null && !mgtMapIntTotalVoList.isEmpty()) { map = mgtMapIntTotalVoList.stream() .collect(Collectors.toMap(MgtMapIntTotalVo::getMapKey, MgtMapIntTotalVo::getMapValue)); } // 获取日期范围 List<String> dateList = getDateRange(staffTotalDto.getStartDate(), staffTotalDto.getEndDate()); int size = dateList.size(); // 创建日期和成员总数的数组 String[] dateMemberTotalKey = new String[size]; Integer[] dateMemberTotalValue = new Integer[size]; // 遍历日期列表,设置日期和成员总数的数组 String str; Integer value; for (int i = 0; i < size; i++) { str = dateList.get(i); dateMemberTotalKey[i] = str; value = map.get(str); dateMemberTotalValue[i] = (value != null) ? value : 0; } // 设置返回对象的日期和成员总数数组 staffActivityDateMemberTotalVo.setDateMemberTotalKey(dateMemberTotalKey); staffActivityDateMemberTotalVo.setDateMemberTotalValue(dateMemberTotalValue); } // 获取日期范围 List<String> dateList = getDateRange(staffTotalDto.getStartDate(), staffTotalDto.getEndDate()); int size = dateList.size(); // 创建日期和成员总数的数组 String[] dateMemberTotalKey = new String[size]; Integer[] dateMemberTotalValue = new Integer[size]; // 遍历日期列表,设置日期和成员总数的数组 String str; Integer value; for (int i = 0; i < size; i++) { str = dateList.get(i); dateMemberTotalKey[i] = str; value = map.get(str); dateMemberTotalValue[i] = (value != null) ? value : 0; } // 设置返回对象的日期和成员总数数组 staffActivityDateMemberTotalVo.setDateMemberTotalKey(dateMemberTotalKey); staffActivityDateMemberTotalVo.setDateMemberTotalValue(dateMemberTotalValue); // 返回结果对象 return staffActivityDateMemberTotalVo; } @@ -4406,40 +4424,42 @@ */ @Override public StaffActivityDateMemberTotalVo getStaffActivityMemberTotal(StaffTotalDto staffTotalDto) { MerTotalDto merTotalDto = new MerTotalDto(); merTotalDto.setAgeType(staffTotalDto.getAgeType()); if(staffTotalDto.getAgeType()!=null){ List<Long> userIdList = remoteMemberService.listUserIdByAgeType(staffTotalDto.getAgeType()).getData(); staffTotalDto.setUserIdList(userIdList); } // 创建返回对象 StaffActivityDateMemberTotalVo staffActivityDateMemberTotalVo = new StaffActivityDateMemberTotalVo(); // 查询数据库获取数据 List<MgtMapIntTotalVo> mgtMapIntTotalVoList = orderMapper.getStaffActivityMemberTotal(staffTotalDto); // 将查询结果转为Map Map<String, Integer> map = new HashMap<>(); if (mgtMapIntTotalVoList != null && !mgtMapIntTotalVoList.isEmpty()) { map = mgtMapIntTotalVoList.stream() .collect(Collectors.toMap(MgtMapIntTotalVo::getMapKey, MgtMapIntTotalVo::getMapValue)); if(staffTotalDto.getActivityFrom()==1){ MerTotalDto merTotalDto = new MerTotalDto(); merTotalDto.setAgeType(staffTotalDto.getAgeType()); if(staffTotalDto.getAgeType()!=null){ List<Long> userIdList = remoteMemberService.listUserIdByAgeType(staffTotalDto.getAgeType()).getData(); staffTotalDto.setUserIdList(userIdList); } // 查询数据库获取数据 List<MgtMapIntTotalVo> mgtMapIntTotalVoList = orderMapper.getStaffActivityMemberTotal(staffTotalDto); // 将查询结果转为Map Map<String, Integer> map = new HashMap<>(); if (mgtMapIntTotalVoList != null && !mgtMapIntTotalVoList.isEmpty()) { map = mgtMapIntTotalVoList.stream() .collect(Collectors.toMap(MgtMapIntTotalVo::getMapKey, MgtMapIntTotalVo::getMapValue)); } // 获取日期范围 List<String> dateList = getDateRange(staffTotalDto.getStartDate(), staffTotalDto.getEndDate()); int size = dateList.size(); // 创建日期和成员总数的数组 String[] dateMemberTotalKey = new String[size]; Integer[] dateMemberTotalValue = new Integer[size]; // 遍历日期列表,设置日期和成员总数的数组 String str; Integer value; for (int i = 0; i < size; i++) { str = dateList.get(i); dateMemberTotalKey[i] = str; value = map.get(str); dateMemberTotalValue[i] = (value != null) ? value : 0; } // 设置返回对象的日期和成员总数数组 staffActivityDateMemberTotalVo.setDateMemberTotalKey(dateMemberTotalKey); staffActivityDateMemberTotalVo.setDateMemberTotalValue(dateMemberTotalValue); } // 获取日期范围 List<String> dateList = getDateRange(staffTotalDto.getStartDate(), staffTotalDto.getEndDate()); int size = dateList.size(); // 创建日期和成员总数的数组 String[] dateMemberTotalKey = new String[size]; Integer[] dateMemberTotalValue = new Integer[size]; // 遍历日期列表,设置日期和成员总数的数组 String str; Integer value; for (int i = 0; i < size; i++) { str = dateList.get(i); dateMemberTotalKey[i] = str; value = map.get(str); dateMemberTotalValue[i] = (value != null) ? value : 0; } // 设置返回对象的日期和成员总数数组 staffActivityDateMemberTotalVo.setDateMemberTotalKey(dateMemberTotalKey); staffActivityDateMemberTotalVo.setDateMemberTotalValue(dateMemberTotalValue); // 返回结果对象 return staffActivityDateMemberTotalVo; } @@ -4646,4 +4666,29 @@ } return merOrderPageVoList; } /** * @description 获取销售排行 * @author jqs * @date 2023/8/24 18:00 * @param shopIdList * @return List<MgtMapIntTotalVo> */ @Override public List<MgtMapBigTotalVo> shopSalesRank(List<Long> shopIdList){ return orderMapper.shopSalesRank(shopIdList); } /** * @description 获取商户服务统计 * @author jqs * @date 2023/8/24 18:28 * @param shopId * @return MerHomeShopTotalVo */ @Override public MerHomeShopTotalVo getShopServiceTotal(Long shopId){ MerHomeShopTotalVo serviceTotalVo = orderMapper.getMerHomeShopServiceTotalVo(shopId); return serviceTotalVo; } } ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/order/OrderService.java
@@ -10,10 +10,7 @@ import com.ruoyi.order.domain.pojo.order.Order; import com.ruoyi.order.domain.vo.*; import com.ruoyi.system.api.domain.dto.*; import com.ruoyi.system.api.domain.vo.AppOrderTotalVo; import com.ruoyi.system.api.domain.vo.MerHomeShopTotalVo; import com.ruoyi.system.api.domain.vo.MgtBulletinBoardVo; import com.ruoyi.system.api.domain.vo.MgtMapIntTotalVo; import com.ruoyi.system.api.domain.vo.*; import java.math.BigDecimal; import java.util.List; @@ -527,4 +524,22 @@ String goodsName, String orderNo, String orderId, BigDecimal payMoney, String openid, String payerClientIp, List<String> goodsNameList); /** * @description 获取销售排行 * @author jqs * @date 2023/8/24 18:00 * @param shopIdList * @return List<MgtMapIntTotalVo> */ List<MgtMapBigTotalVo> shopSalesRank(List<Long> shopIdList); /** * @description 获取商户服务统计 * @author jqs * @date 2023/8/24 18:28 * @param shopId * @return MerHomeShopTotalVo */ MerHomeShopTotalVo getShopServiceTotal(Long shopId); } ruoyi-modules/ruoyi-order/src/main/resources/mapper/order/OrderMapper.xml
@@ -982,14 +982,29 @@ <select id="getTotalDataTotal" resultType="com.ruoyi.order.domain.vo.MgtTotalDataTotalVo"> SELECT COUNT(DISTINCT CASE WHEN tog.goods_type = 1 THEN toc.user_id ELSE NULL END) cyclePerson, COUNT(DISTINCT CASE WHEN tog.goods_type = 4 THEN toc.user_id ELSE NULL END) goodsPerson, COUNT(DISTINCT CASE WHEN tog.goods_type = 4 THEN toc.order_id ELSE NULL END) goodsNumber FROM t_order toc INNER JOIN t_order_goods tog ON toc.order_id = tog.order_id <if test="param.shopId != null and param.shopId != ''"> AND toc.shop_id = #{param.shopId} </if> <if test="param.startDate!=null and param.startDate!=''"> AND Date(toc.create_time) >= #{param.startDate} </if> <if test="param.endDate!=null and param.endDate!=''"> AND Date(toc.create_time) <= #{param.endDate} </if> </select> <select id="getTotalDataMemberTotal" resultType="com.ruoyi.order.domain.vo.MgtTotalDataTotalVo"> SELECT COUNT(DISTINCT CASE WHEN goods_type_1_count > 0 AND goods_type_3_count = 0 THEN user_id ELSE NULL END) AS onlyCyclePerson, COUNT(DISTINCT CASE WHEN goods_type_1_count = 0 AND goods_type_3_count > 0 THEN user_id ELSE NULL END) AS onlyExperiencePerson, COUNT(DISTINCT CASE WHEN goods_type_1_count > 0 AND goods_type_3_count > 0 THEN user_id ELSE NULL END) AS experienceCyclePerson, COUNT(DISTINCT CASE WHEN goods_type_1_count > 0 THEN user_id ELSE NULL END) AS cyclePerson, COUNT(DISTINCT CASE WHEN goods_type_4_count > 0 THEN user_id ELSE NULL END) AS goodsPerson, SUM(goods_type_4_count) AS goodsNumber, COUNT(DISTINCT CASE WHEN goods_type_1_count > 0 AND goods_type_2_count > 0 AND goods_type_3_count > 0 AND goods_type_4_count > 0 THEN user_id ELSE NULL END) AS orderPerson FROM ( COUNT(DISTINCT CASE WHEN goods_type_1_count > 0 OR goods_type_2_count > 0 OR goods_type_3_count > 0 OR goods_type_4_count > 0 THEN user_id ELSE NULL END) AS orderPerson FROM ( SELECT o.user_id, COUNT(DISTINCT CASE WHEN og.goods_type = 1 THEN og.goods_id ELSE NULL END) AS goods_type_1_count, @@ -998,7 +1013,7 @@ COUNT(DISTINCT CASE WHEN og.goods_type = 4 THEN og.goods_id ELSE NULL END) AS goods_type_4_count FROM t_order o JOIN t_order_goods og ON o.order_id = og.order_id WHERE o.del_flag = 0 AND og.del_flag = 0 AND o.order_status IN (2,3) WHERE o.del_flag = 0 AND og.del_flag = 0 AND o.order_status = 3 <if test="param.shopId != null and param.shopId != ''"> AND o.shop_id = #{param.shopId} </if> @@ -1028,7 +1043,24 @@ </select> <select id="getReorderPerson" resultType="java.lang.Integer"> SELECT COUNT(DISTINCT user_id) SELECT COUNT(temp.userId) FROM (SELECT toc.user_id userId, COUNT(DISTINCT toc.order_id) orderCount FROM t_order toc INNER JOIN t_order_goods tog ON toc.order_id = tog.order_id WHERE toc.del_flag = 0 AND tog.goods_type = 1 <if test="param.shopId != null and param.shopId != ''"> AND toc.shop_id = #{param.shopId} </if> <if test="param.startDate!=null and param.startDate!=''"> AND Date(toc.create_time) >= #{param.startDate} </if> <if test="param.endDate!=null and param.endDate!=''"> AND Date(toc.create_time) <= #{param.endDate} </if> GROUP BY toc.user_id) AS temp WHERE temp.orderCount > 1 <!--SELECT COUNT(DISTINCT user_id) FROM (SELECT t1.user_id, t1.pay_time, t2.pay_time as last_pay_time FROM t_order t1 INNER JOIN (SELECT toc.user_id, toc.pay_time @@ -1038,10 +1070,16 @@ <if test="param.shopId != null and param.shopId != ''"> AND toc.shop_id = #{param.shopId} </if> <if test="param.startDate!=null and param.startDate!=''"> AND Date(create_time) >= #{param.startDate} </if> <if test="param.endDate!=null and param.endDate!=''"> AND Date(create_time) <= #{param.endDate} </if> ORDER BY toc.pay_time DESC LIMIT 2) t2 ON t1.user_id = t2.user_id AND t1.pay_time < t2.pay_time WHERE t1.del_flag = 0 HAVING DATEDIFF(t2.pay_time, t1.pay_time) <= 30) AS temp HAVING DATEDIFF(t2.pay_time, t1.pay_time) <= 30) AS temp--> </select> <select id="getReturnedPerson" resultType="java.lang.Integer"> @@ -1857,4 +1895,17 @@ WHERE toc.del_flag = 0 AND (toc.order_status = 2 OR toc.order_status = 3) AND toc.shop_id = #{param.shopId} AND toc.user_id = #{param.memberUserId} ORDER BY toc.create_time DESC </select> <select id="shopSalesRank" resultType="com.ruoyi.system.api.domain.vo.MgtMapBigTotalVo"> SELECT shop_id mapKey, SUM(change_receivable_money) mapValue FROM t_order WHERE del_flag = 0 AND order_status = 3 AND shop_id IN <foreach collection="shopIdList" item="item" open="(" separator="," close=")"> #{item} </foreach> GROUP BY shop_id ORDER BY mapValue DESC LIMIT 15 </select> </mapper> ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/business/MerTaskController.java
@@ -85,8 +85,6 @@ return R.ok(); } @RequestMapping(value = "/pageMerAgencyTask", method = RequestMethod.POST) @ApiOperation(value = "分页获取商户代理商跟进任务列表") public R<Page<MerAgencyTaskPageVo>> pageMerAgencyTask(@RequestBody MerAgencyTaskPageDto merAgencyTaskPageDto) { ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/console/ShopController.java
@@ -151,10 +151,10 @@ @PostMapping("/getShopByBelongUserId") public R<ShopRelUserVo> getShopByBelongUserId(@RequestBody Long userId) { Shop shop = shopService.getShopByBelongUserId(userId); Optional.ofNullable(shop).orElseThrow(() -> new ServiceException("未查询到商户信息")); List<Shop> shopList = shopService.getShopByBelongUserId(userId); Optional.ofNullable(shopList.get(0)).orElseThrow(() -> new ServiceException("未查询到商户信息")); ShopRelUserVo shopRelUserVo = new ShopRelUserVo(); shopRelUserVo.setShopId(shop.getShopId()); shopRelUserVo.setShopId(shopList.get(0).getShopId()); return R.ok(shopRelUserVo); } ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/dto/FileDto.java
New file @@ -0,0 +1,22 @@ package com.ruoyi.shop.domain.dto; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @ClassName FileDto * @Description TODO * @Author jqs * @Date 2023/8/24 10:51 * @Version 1.0 */ @Data public class FileDto { @ApiModelProperty(value="文件名") private String fileName; @ApiModelProperty(value="文件地址") private String fileUrl; } ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/dto/MerFollowAgencyTaskDto.java
@@ -35,13 +35,13 @@ private String followContent; @ApiModelProperty(value="跟进图片地址 多个,号隔开") private String picture; private List<FileDto> picture; @ApiModelProperty(value="跟进视频地址 多个,号隔开") private String video; private List<FileDto> video; @ApiModelProperty(value="跟进音频地址 多个,号隔开") private String audio; private List<FileDto> audio; @ApiModelProperty(value="下次任务时间") private String nextTaskDate; ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/dto/MerFollowMemberTaskDto.java
@@ -35,13 +35,13 @@ private String followContent; @ApiModelProperty(value="跟进图片地址 多个,号隔开") private String picture; private List<FileDto> picture; @ApiModelProperty(value="跟进视频地址 多个,号隔开") private String video; private List<FileDto> video; @ApiModelProperty(value="跟进音频地址 多个,号隔开") private String audio; private List<FileDto> audio; @ApiModelProperty(value="下次任务时间") private String nextTaskDate; ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/dto/StaffFollowShopTaskDto.java
@@ -32,13 +32,13 @@ private String followContent; @ApiModelProperty(value="跟进图片地址 多个,号隔开") private String picture; private List<FileDto> picture; @ApiModelProperty(value="跟进视频地址 多个,号隔开") private String video; private List<FileDto> video; @ApiModelProperty(value="跟进音频地址 多个,号隔开") private String audio; private List<FileDto> audio; @ApiModelProperty(value="下次任务时间") private String nextTaskDate; ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/pojo/task/TaskFile.java
@@ -1,15 +1,15 @@ package com.ruoyi.shop.domain.pojo.task; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.activerecord.Model; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.io.Serializable; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import java.io.Serializable; /** * <p> @@ -44,6 +44,12 @@ */ @TableField("follow_from") private Integer followFrom; /** * 文件名 */ @TableField("file_name") private String fileName; /** * 文件地址 */ ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/MerAgencyTaskRecordPageVo.java
@@ -1,6 +1,7 @@ package com.ruoyi.shop.domain.vo; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.shop.domain.dto.FileDto; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -46,11 +47,11 @@ private String callPhone; @ApiModelProperty(value="跟进图片地址") private List<String> picture; private List<FileDto> picture; @ApiModelProperty(value="跟进视频地址") private List<String> video; private List<FileDto> video; @ApiModelProperty(value="跟进音频地址") private List<String> audio; private List<FileDto> audio; } ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/MerMemberTaskPageVo.java
@@ -3,6 +3,8 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; /** * @author jqs34 * @ClassName MerMemberTaskPageVo @@ -23,7 +25,7 @@ private String taskContent; @ApiModelProperty(value="处理内容") private String dealContent; private List<String> dealContent; @ApiModelProperty(value="紧急情况") private String emergencyState;; ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/MerMemberTaskRecordPageVo.java
@@ -1,6 +1,7 @@ package com.ruoyi.shop.domain.vo; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.shop.domain.dto.FileDto; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -43,11 +44,11 @@ private String callPhone; @ApiModelProperty(value="跟进图片地址") private List<String> picture; private List<FileDto> picture; @ApiModelProperty(value="跟进视频地址") private List<String> video; private List<FileDto> video; @ApiModelProperty(value="跟进音频地址") private List<String> audio; private List<FileDto> audio; } ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/MgtAgencyTaskRecordPageVo.java
@@ -1,6 +1,7 @@ package com.ruoyi.shop.domain.vo; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.shop.domain.dto.FileDto; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -53,11 +54,11 @@ private String callPhone; @ApiModelProperty(value="跟进图片地址") private List<String> picture; private List<FileDto> picture; @ApiModelProperty(value="跟进视频地址") private List<String> video; private List<FileDto> video; @ApiModelProperty(value="跟进音频地址") private List<String> audio; private List<FileDto> audio; } ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/MgtMemberFollowPageVo.java
@@ -1,6 +1,7 @@ package com.ruoyi.shop.domain.vo; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.shop.domain.dto.FileDto; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -52,11 +53,11 @@ private String callPhone; @ApiModelProperty(value="跟进图片地址") private List<String> picture; private List<FileDto> picture; @ApiModelProperty(value="跟进视频地址") private List<String> video; private List<FileDto> video; @ApiModelProperty(value="跟进音频地址") private List<String> audio; private List<FileDto> audio; } ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/MgtPlTotalShopTotalVo.java
@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; import java.util.List; /** @@ -56,7 +57,7 @@ private String[] shopSalesRankKey; @ApiModelProperty(value = "合作商营业额value") private Integer[] shopSalesRankValue; private BigDecimal[] shopSalesRankValue; @ApiModelProperty(value = "合作商推荐") private List<MgtMapIntTotalVo> shopRecommendVos; ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/MgtShopAuthGetVo.java
@@ -87,6 +87,12 @@ */ @ApiModelProperty(value = "法人姓名") private String lpCorporateName; @ApiModelProperty(value = "法人手机号") private String lpMobilePhone; @ApiModelProperty(value = "法人邮箱") private String lpContactEmail; /** * 法人身份证号 */ ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/MgtShopTaskRecordPageVo.java
@@ -1,6 +1,7 @@ package com.ruoyi.shop.domain.vo; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.shop.domain.dto.FileDto; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -53,11 +54,11 @@ private String callPhone; @ApiModelProperty(value="跟进图片地址") private List<String> picture; private List<FileDto> picture; @ApiModelProperty(value="跟进视频地址") private List<String> video; private List<FileDto> video; @ApiModelProperty(value="跟进音频地址") private List<String> audio; private List<FileDto> audio; } ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/StaffAgencyTaskRecordPageVo.java
@@ -1,6 +1,7 @@ package com.ruoyi.shop.domain.vo; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.shop.domain.dto.FileDto; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -53,11 +54,11 @@ private String callPhone; @ApiModelProperty(value="跟进图片地址") private List<String> picture; private List<FileDto> picture; @ApiModelProperty(value="跟进视频地址") private List<String> video; private List<FileDto> video; @ApiModelProperty(value="跟进音频地址") private List<String> audio; private List<FileDto> audio; } ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/StaffMyShopTaskRecordPageVo.java
@@ -1,6 +1,7 @@ package com.ruoyi.shop.domain.vo; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.shop.domain.dto.FileDto; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -53,13 +54,13 @@ private String callPhone; @ApiModelProperty(value="跟进图片地址") private List<String> picture; private List<FileDto> picture; @ApiModelProperty(value="跟进视频地址") private List<String> video; private List<FileDto> video; @ApiModelProperty(value="跟进音频地址") private List<String> audio; private List<FileDto> audio; } ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/mapper/shop/ShopMapper.java
@@ -185,13 +185,13 @@ List<MgtMapIntTotalVo> listShopAreaRank(@Param("param")MgtBasePlatformDto mgtBasePlatformDto); /** * @description 商户类型统计 * @description 销售排行 * @author jqs * @date 2023/6/21 17:40 * @param * @return List<MgtMapIntTotalVo> */ List<MgtMapIntTotalVo> listShopSalesRank(@Param("param")MgtBasePlatformDto mgtBasePlatformDto); List<Long> listShopSalesRank(@Param("param")MgtBasePlatformDto mgtBasePlatformDto); /** * @description 商户类型统计 ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/mapper/task/MemberTaskMapper.java
@@ -48,5 +48,13 @@ */ MemberTaskSimpleVo getLastMemberTask(@Param("userId")Long userId); /** * @description 获取任务处理内容 * @author jqs * @date 2023/8/24 12:05 * @param taskId * @return List<String> */ List<String> listDealContent(@Param("taskId")String taskId); } ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/scheduler/ShopScheduler.java
@@ -41,7 +41,7 @@ * 0 0/30 * * * ? * 定时检查 每30分钟检查一次 微信二级商户进件状态 */ @Scheduled(cron="0 0/30 * * * ?") @Scheduled(cron="0 0/15 * * * ?") private void queryEcommerceApplyMentsStatus(){ if(schedulerUtils.getSchedulerRun()) { log.info("--------------------定时检查微信二级商户进件状态任务开始执行--------------------"); ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopAuthenticationServiceImpl.java
@@ -3,6 +3,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.github.binarywang.wxpay.bean.ecommerce.ApplymentsStatusResult; import com.google.common.base.Joiner; import com.ruoyi.shop.domain.pojo.shop.ShopAuthentication; @@ -11,10 +12,8 @@ import com.ruoyi.shop.enums.dict.IDict; import com.ruoyi.shop.mapper.shop.ShopAuthenticationMapper; import com.ruoyi.shop.service.shop.ShopAuthenticationService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; @@ -33,7 +32,6 @@ @Override public List<ShopAuthentication> getShopAuthNeedUpdateStatus() { List<Integer> auditStatusList = Arrays.asList(1, 2, 3, 5); LambdaQueryWrapper<ShopAuthentication> queryWrapper = Wrappers.lambdaQuery(); queryWrapper.in(ShopAuthentication::getAuditStatus, auditStatusList); queryWrapper.isNotNull(ShopAuthentication::getApplymentId); ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java
@@ -38,6 +38,7 @@ import com.ruoyi.system.api.domain.poji.sys.SysUser; import com.ruoyi.system.api.domain.vo.*; import com.ruoyi.system.api.service.*; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -57,6 +58,7 @@ * @since 2023-04-25 */ @Service @Slf4j public class ShopServiceImpl extends ServiceImpl<ShopMapper, Shop> implements ShopService { @Resource @@ -791,8 +793,8 @@ */ @Override public StaffHomeShopTotalVo getStaffHomeTotal(Long userId){ List<Long> userIds = null; List<Long> shopIds = null; List<Long> userIds = new ArrayList<>(); List<Long> shopIds = new ArrayList<>(); //如果是leader 查询leader下面所有的员工下的所有shopId if(remoteSysStaffService.isLeader()){ userIds = sysUserService.getUserIdsByDept(userId).getData(); @@ -800,15 +802,21 @@ MgtBasePlatformDto mgtBasePlatformDto = new MgtBasePlatformDto(); mgtBasePlatformDto.setUserIdList(userIds); shopIds = shopMapper.listShopIdByTotal(mgtBasePlatformDto); Shop shop = this.getShopByBelongUserId(userId); if(shop!=null){ shopIds.add(shop.getShopId()); List<Shop> shopList = this.getShopByBelongUserId(userId); if(shopList!=null&&!shopList.isEmpty()){ for(Shop shop : shopList){ shopIds.add(shop.getShopId()); } userIds.add(userId); } }else { //普通员工查询商户归属的shopId Shop shop = this.getShopByBelongUserId(userId); shopIds.add(shop.getShopId()); List<Shop> shopList = this.getShopByBelongUserId(userId); if(shopList!=null&&!shopList.isEmpty()){ for(Shop shop : shopList){ shopIds.add(shop.getShopId()); } } } //分别查询 StaffHomeShopTotalVo staffHomeShopTotalVo = new StaffHomeShopTotalVo(); @@ -1044,6 +1052,7 @@ throw new ServiceException(e.getMessage()); } shopAuthentication.setAuditStatus(3); shopAuthentication.setApplymentId(applymentsResult.getApplymentId()); shopAuthenticationService.saveOrUpdate(shopAuthentication); } @@ -1101,10 +1110,10 @@ plTotalShopTotalVo.setAreaRankVos(shopAreaRank); } //获取销售排名 List<MgtMapIntTotalVo> shopSalesRank = shopMapper.listShopSalesRank(mgtBasePlatformDto); List<MgtMapBigTotalVo> shopSalesRank = remoteOrderService.shopSalesRank(shopIdList).getData(); if (shopSalesRank != null && shopSalesRank.size() > 0) { String[] shopSalesKey = new String[shopSalesRank.size()]; Integer[] shopSalesValue = new Integer[shopSalesRank.size()]; BigDecimal[] shopSalesValue = new BigDecimal[shopSalesRank.size()]; // 遍历不同商品类型的会员数列表,设置商品类型数组和对应的会员数数组 for (int i = 0; i < shopSalesRank.size(); i++) { shopSalesKey[i] = shopSalesRank.get(i).getMapKey(); @@ -1241,11 +1250,11 @@ * @return Shop */ @Override public Shop getShopByBelongUserId(Long userId){ public List<Shop> getShopByBelongUserId(Long userId){ LambdaQueryWrapper<Shop> queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(Shop::getDelFlag,0); queryWrapper.eq(Shop::getBelongUserId,userId); return this.getOne(queryWrapper,false); return this.list(queryWrapper); } /** @@ -1271,7 +1280,7 @@ */ @Override public StaffShopSimpleTotalVo getStaffSimpleTotal(Long userId){ List<Long> userIdList = null; List<Long> userIdList = new ArrayList<>(); if(remoteSysStaffService.isLeader()){ userIdList = sysUserService.getUserIdsByDept(userId).getData(); userIdList.add(userId); @@ -1317,8 +1326,6 @@ merHomeShopTotalVo.setShopId(shopId); // 通过远程订单服务获取商店总览信息 MerHomeShopTotalVo orderVo = remoteOrderService.getMerHomeTotal(merHomeShopTotalVo).getData(); // 获取商店总计信息 ShopTotal shopTotal = shopTotalService.getById(shopId); // 获取商店任务计数 Integer taskCount = memberTaskService.getMemberIngTotal(shopId); // 设置员工商店信息对象的属性 @@ -1326,10 +1333,11 @@ staffShopInfoGetVo.setUnHandleOrder(orderVo.getUnHandleOrder()); staffShopInfoGetVo.setShopTask(taskCount); staffShopInfoGetVo.setShopTurnover(orderVo.getShopTurnover()); staffShopInfoGetVo.setCycleSurp(shopTotal.getUseableCyclePerson()); staffShopInfoGetVo.setExplorationSurp(shopTotal.getUseableExperiencePerson()); staffShopInfoGetVo.setCycleSurp(orderVo.getCycleSurp()); staffShopInfoGetVo.setExplorationSurp(orderVo.getExplorationSurp()); staffShopInfoGetVo.setShopId(shopId); staffShopInfoGetVo.setShopName(shop.getShopName()); staffShopInfoGetVo.setShopType(shop.getShopType()); staffShopInfoGetVo.setShopPicture(shopPicture); staffShopInfoGetVo.setBusinessStartTime(shop.getBusinessStartTime()); staffShopInfoGetVo.setBusinessEndTime(shop.getBusinessEndTime()); @@ -1436,7 +1444,9 @@ @Override public void queryEcommerceApplyMentsStatus() { log.info("开始获取微信二级商户待检查列表"); List<ShopAuthentication> list = shopAuthenticationService.getShopAuthNeedUpdateStatus(); log.info("定时检查微信二级商户"+list.toString()); list.forEach(item -> queryApplyStatusByApplymentId(item.getApplymentId(), item.getShopId())); } @@ -1446,6 +1456,7 @@ */ private void queryApplyStatusByApplymentId(String applymentId, Long shopId) { try { log.debug("定时检查微信二级商户applymentId"+applymentId); if (StringUtils.isNotBlank(applymentId)) { ApplymentsStatusResult result = wechatPayUtils.queryApplyStatusByApplymentId(applymentId); shopAuthenticationService.updateAuditStatusByApplymentId(applymentId, result); @@ -1570,6 +1581,7 @@ if(shopTask!=null){ staffShopDetailVo.setNextTaskDate(shopTask.getTaskDate()); } staffShopDetailVo.setShopId(shopId); return staffShopDetailVo; } ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/task/AgencyTaskRecordServiceImpl.java
@@ -3,6 +3,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.shop.domain.dto.FileDto; import com.ruoyi.shop.domain.dto.MerAgencyTaskPageDto; import com.ruoyi.shop.domain.dto.MgtShopTaskPageDto; import com.ruoyi.shop.domain.dto.StaffAgencyPageDto; @@ -54,23 +55,44 @@ if(merAgencyTaskRecordPageVoList!=null&&!merAgencyTaskRecordPageVoList.isEmpty()){ Long followId; List<TaskFile> taskFileList; List<String> picture = new ArrayList<>(); List<String> video = new ArrayList<>(); List<String> audio = new ArrayList<>(); List<FileDto> picture = new ArrayList<>(); List<FileDto> video = new ArrayList<>(); List<FileDto> audio = new ArrayList<>(); //获取跟进详情文件 for(MerAgencyTaskRecordPageVo merAgencyTaskRecordPageVo : merAgencyTaskRecordPageVoList){ followId = merAgencyTaskRecordPageVo.getFollowId(); taskFileList = taskFileService.listByFollowIdAndFollowType(followId,1); if(taskFileList!=null&&!taskFileList.isEmpty()){ picture = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); picture = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } taskFileList = taskFileService.listByFollowIdAndFollowType(followId,2); if(taskFileList!=null&&!taskFileList.isEmpty()){ video = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); video = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } taskFileList = taskFileService.listByFollowIdAndFollowType(followId,3); if(taskFileList!=null&&!taskFileList.isEmpty()){ audio = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); audio = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } merAgencyTaskRecordPageVo.setPicture(picture); merAgencyTaskRecordPageVo.setVideo(video); @@ -91,9 +113,9 @@ if(mgtAgencyTaskRecordPageVoList!=null&&!mgtAgencyTaskRecordPageVoList.isEmpty()){ Long followId; List<TaskFile> taskFileList; List<String> picture = new ArrayList<>(); List<String> video = new ArrayList<>(); List<String> audio = new ArrayList<>(); List<FileDto> picture = new ArrayList<>(); List<FileDto> video = new ArrayList<>(); List<FileDto> audio = new ArrayList<>(); Long userId; SysUser sysUser; for(MgtAgencyTaskRecordPageVo mgtAgencyTaskRecordPageVo : mgtAgencyTaskRecordPageVoList){ @@ -106,15 +128,36 @@ followId = mgtAgencyTaskRecordPageVo.getFollowId(); taskFileList = taskFileService.listByFollowIdAndFollowType(followId,1); if(taskFileList!=null&&!taskFileList.isEmpty()){ picture = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); picture = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } taskFileList = taskFileService.listByFollowIdAndFollowType(followId,2); if(taskFileList!=null&&!taskFileList.isEmpty()){ video = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); video = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } taskFileList = taskFileService.listByFollowIdAndFollowType(followId,3); if(taskFileList!=null&&!taskFileList.isEmpty()){ audio = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); audio = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } mgtAgencyTaskRecordPageVo.setPicture(picture); mgtAgencyTaskRecordPageVo.setVideo(video); @@ -138,9 +181,9 @@ if(agencyTaskRecordPageVoList!=null&&!agencyTaskRecordPageVoList.isEmpty()){ Long followId; List<TaskFile> taskFileList; List<String> picture = new ArrayList<>(); List<String> video = new ArrayList<>(); List<String> audio = new ArrayList<>(); List<FileDto> picture = new ArrayList<>(); List<FileDto> video = new ArrayList<>(); List<FileDto> audio = new ArrayList<>(); Long userId; SysUser sysUser; for(StaffAgencyTaskRecordPageVo staffAgencyTaskRecordPageVo : agencyTaskRecordPageVoList){ @@ -153,15 +196,36 @@ followId = staffAgencyTaskRecordPageVo.getFollowId(); taskFileList = taskFileService.listByFollowIdAndFollowType(followId,1); if(taskFileList!=null&&!taskFileList.isEmpty()){ picture = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); picture = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } taskFileList = taskFileService.listByFollowIdAndFollowType(followId,2); if(taskFileList!=null&&!taskFileList.isEmpty()){ video = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); video = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } taskFileList = taskFileService.listByFollowIdAndFollowType(followId,3); if(taskFileList!=null&&!taskFileList.isEmpty()){ audio = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); audio = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } staffAgencyTaskRecordPageVo.setPicture(picture); staffAgencyTaskRecordPageVo.setVideo(video); ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/task/AgencyTaskServiceImpl.java
@@ -5,10 +5,7 @@ import com.ruoyi.common.core.utils.DateUtils; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.core.utils.uuid.IdUtils; import com.ruoyi.shop.domain.dto.MerAgencyTaskPageDto; import com.ruoyi.shop.domain.dto.MerCreateAgencyTaskDto; import com.ruoyi.shop.domain.dto.MerFollowAgencyTaskDto; import com.ruoyi.shop.domain.dto.MerFollowPhoneDto; import com.ruoyi.shop.domain.dto.*; import com.ruoyi.shop.domain.pojo.task.*; import com.ruoyi.shop.domain.vo.MerAgencySimpleTaskRecordPageVo; import com.ruoyi.shop.domain.vo.MerAgencyTaskPageVo; @@ -19,6 +16,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -139,48 +137,53 @@ agencyTaskRecord.setFollowContent(merFollowAgencyTaskDto.getFollowContent()); agencyTaskRecord.setCreateTime(new Date()); //创建任务详情文件 String picture = merFollowAgencyTaskDto.getPicture(); String video = merFollowAgencyTaskDto.getVideo(); String audio = merFollowAgencyTaskDto.getAudio(); String[] strArr; List<FileDto> picture = merFollowAgencyTaskDto.getPicture(); List<FileDto> video = merFollowAgencyTaskDto.getVideo(); List<FileDto> audio = merFollowAgencyTaskDto.getAudio(); TaskFile taskFile; if(StringUtils.isNotBlank(picture)){ strArr = picture.split(","); for(String str : strArr){ List<TaskFile> taskFileList = new ArrayList<>(); // 判断图片是否为空,并处理 if (picture!=null&&!picture.isEmpty()) { for (FileDto fileDto : picture) { taskFile = new TaskFile(); taskFile.setDelFlag(0); taskFile.setFollowId(agencyTaskRecord.getId()); taskFile.setFollowFrom(2); taskFile.setFileUrl(str); taskFile.setFollowFrom(1); taskFile.setFileName(fileDto.getFileName()); taskFile.setFileUrl(fileDto.getFileUrl()); taskFile.setFileType(1); taskFileService.saveOrUpdate(taskFile); taskFileList.add(taskFile); } } if(StringUtils.isNotBlank(video)){ strArr = video.split(","); for(String str : strArr){ // 判断视频是否为空,并处理 if (video!=null&&!video.isEmpty()) { for (FileDto fileDto : video) { taskFile = new TaskFile(); taskFile.setDelFlag(0); taskFile.setFollowId(agencyTaskRecord.getId()); taskFile.setFollowFrom(2); taskFile.setFileUrl(str); taskFile.setFollowFrom(1); taskFile.setFileName(fileDto.getFileName()); taskFile.setFileUrl(fileDto.getFileUrl()); taskFile.setFileType(2); taskFileService.saveOrUpdate(taskFile); taskFileList.add(taskFile); } } if(StringUtils.isNotBlank(audio)){ strArr = audio.split(","); for(String str : strArr){ // 判断音频是否为空,并处理 if (audio!=null&&!audio.isEmpty()) { for (FileDto fileDto : audio) { taskFile = new TaskFile(); taskFile.setDelFlag(0); taskFile.setFollowId(agencyTaskRecord.getId()); taskFile.setFollowFrom(2); taskFile.setFileUrl(str); taskFile.setFollowFrom(1); taskFile.setFileName(fileDto.getFileName()); taskFile.setFileUrl(fileDto.getFileUrl()); taskFile.setFileType(3); taskFileService.saveOrUpdate(taskFile); taskFileList.add(taskFile); } } if(taskFileList!=null&&!taskFileList.isEmpty()){ taskFileService.saveBatch(taskFileList); } } //创建新任务 if(StringUtils.isNotBlank(merFollowAgencyTaskDto.getNextTaskDate())){ ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/task/MemberTaskRecordServiceImpl.java
@@ -3,6 +3,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.core.utils.DateUtils; import com.ruoyi.shop.domain.dto.FileDto; import com.ruoyi.shop.domain.dto.MerMemberTaskPageDto; import com.ruoyi.shop.domain.dto.MgtMemberTaskPageDto; import com.ruoyi.shop.domain.pojo.task.MemberTaskRecord; @@ -48,22 +49,43 @@ if(merMemberTaskRecordPageVoList!=null&&!merMemberTaskRecordPageVoList.isEmpty()){ Long followId; List<TaskFile> taskFileList; List<String> picture = new ArrayList<>(); List<String> video = new ArrayList<>(); List<String> audio = new ArrayList<>(); List<FileDto> picture = new ArrayList<>(); List<FileDto> video = new ArrayList<>(); List<FileDto> audio = new ArrayList<>(); for(MerMemberTaskRecordPageVo merMemberTaskRecordPageVo : merMemberTaskRecordPageVoList){ followId = merMemberTaskRecordPageVo.getFollowId(); taskFileList = taskFileService.listByFollowIdAndFollowType(followId,1); if(taskFileList!=null&&!taskFileList.isEmpty()){ picture = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); picture = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } taskFileList = taskFileService.listByFollowIdAndFollowType(followId,2); if(taskFileList!=null&&!taskFileList.isEmpty()){ video = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); video = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } taskFileList = taskFileService.listByFollowIdAndFollowType(followId,3); if(taskFileList!=null&&!taskFileList.isEmpty()){ audio = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); audio = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } merMemberTaskRecordPageVo.setPicture(picture); merMemberTaskRecordPageVo.setVideo(video); @@ -89,22 +111,43 @@ if(mgtMemberFollowPageVoList!=null&&!mgtMemberFollowPageVoList.isEmpty()){ Long followId; List<TaskFile> taskFileList; List<String> picture = new ArrayList<>(); List<String> video = new ArrayList<>(); List<String> audio = new ArrayList<>(); List<FileDto> picture = new ArrayList<>(); List<FileDto> video = new ArrayList<>(); List<FileDto> audio = new ArrayList<>(); for(MgtMemberFollowPageVo mgtMemberFollowPageVo : mgtMemberFollowPageVoList){ followId = mgtMemberFollowPageVo.getFollowId(); taskFileList = taskFileService.listByFollowIdAndFollowType(followId,1); if(taskFileList!=null&&!taskFileList.isEmpty()){ picture = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); picture = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } taskFileList = taskFileService.listByFollowIdAndFollowType(followId,2); if(taskFileList!=null&&!taskFileList.isEmpty()){ video = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); video = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } taskFileList = taskFileService.listByFollowIdAndFollowType(followId,3); if(taskFileList!=null&&!taskFileList.isEmpty()){ audio = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); audio = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } mgtMemberFollowPageVo.setPicture(picture); mgtMemberFollowPageVo.setVideo(video); ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/task/MemberTaskServiceImpl.java
@@ -4,10 +4,7 @@ import com.ruoyi.common.core.utils.DateUtils; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.core.utils.uuid.IdUtils; import com.ruoyi.shop.domain.dto.MerCreateMemberTaskDto; import com.ruoyi.shop.domain.dto.MerFollowMemberTaskDto; import com.ruoyi.shop.domain.dto.MerFollowPhoneDto; import com.ruoyi.shop.domain.dto.MerMemberTaskPageDto; import com.ruoyi.shop.domain.dto.*; import com.ruoyi.shop.domain.pojo.task.MemberTask; import com.ruoyi.shop.domain.pojo.task.MemberTaskRecord; import com.ruoyi.shop.domain.pojo.task.TaskFile; @@ -23,6 +20,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -59,6 +57,15 @@ @Override public List<MerMemberTaskPageVo> pageMerMemberTask(Page page, MerMemberTaskPageDto merMemberTaskPageDto){ List<MerMemberTaskPageVo> merMemberTaskPageVoList = memberTaskMapper.pageMerMemberTask(page, merMemberTaskPageDto); List<String> dealContent = new ArrayList<>(); if(merMemberTaskPageVoList!=null&&!merMemberTaskPageVoList.isEmpty() ){ for(MerMemberTaskPageVo merMemberTaskPageVo : merMemberTaskPageVoList){ dealContent = memberTaskMapper.listDealContent(merMemberTaskPageVo.getTaskId()); if(dealContent!=null&&!dealContent.isEmpty()){ merMemberTaskPageVo.setDealContent(dealContent); } } } return merMemberTaskPageVoList; } @@ -145,50 +152,53 @@ // 保存或更新会员任务记录 memberTaskRecordService.saveOrUpdate(memberTaskRecord); // 获取图片、视频和音频 String picture = merFollowMemberTaskDto.getPicture(); String video = merFollowMemberTaskDto.getVideo(); String audio = merFollowMemberTaskDto.getAudio(); String[] strArr; List<FileDto> picture = merFollowMemberTaskDto.getPicture(); List<FileDto> video = merFollowMemberTaskDto.getVideo(); List<FileDto> audio = merFollowMemberTaskDto.getAudio(); TaskFile taskFile; List<TaskFile> taskFileList = new ArrayList<>(); // 判断图片是否为空,并处理 if (StringUtils.isNotBlank(picture)) { strArr = picture.split(","); for (String str : strArr) { if (picture!=null&&!picture.isEmpty()) { for (FileDto fileDto : picture) { taskFile = new TaskFile(); taskFile.setDelFlag(0); taskFile.setFollowId(memberTaskRecord.getId()); taskFile.setFollowFrom(2); taskFile.setFileUrl(str); taskFile.setFileName(fileDto.getFileName()); taskFile.setFileUrl(fileDto.getFileUrl()); taskFile.setFileType(1); taskFileService.saveOrUpdate(taskFile); taskFileList.add(taskFile); } } // 判断视频是否为空,并处理 if (StringUtils.isNotBlank(video)) { strArr = video.split(","); for (String str : strArr) { if (video!=null&&!video.isEmpty()) { for (FileDto fileDto : video) { taskFile = new TaskFile(); taskFile.setDelFlag(0); taskFile.setFollowId(memberTaskRecord.getId()); taskFile.setFollowFrom(2); taskFile.setFileUrl(str); taskFile.setFileName(fileDto.getFileName()); taskFile.setFileUrl(fileDto.getFileUrl()); taskFile.setFileType(2); taskFileService.saveOrUpdate(taskFile); taskFileList.add(taskFile); } } // 判断音频是否为空,并处理 if (StringUtils.isNotBlank(audio)) { strArr = audio.split(","); for (String str : strArr) { if (audio!=null&&!audio.isEmpty()) { for (FileDto fileDto : audio) { taskFile = new TaskFile(); taskFile.setDelFlag(0); taskFile.setFollowId(memberTaskRecord.getId()); taskFile.setFollowFrom(2); taskFile.setFileUrl(str); taskFile.setFileName(fileDto.getFileName()); taskFile.setFileUrl(fileDto.getFileUrl()); taskFile.setFileType(3); taskFileService.saveOrUpdate(taskFile); taskFileList.add(taskFile); } } if(taskFileList!=null&&!taskFileList.isEmpty()){ taskFileService.saveBatch(taskFileList); } } // 判断下一个任务日期是否为空,并处理 if (StringUtils.isNotBlank(merFollowMemberTaskDto.getNextTaskDate())) { ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/task/ShopTaskRecordServiceImpl.java
@@ -2,6 +2,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.shop.domain.dto.FileDto; import com.ruoyi.shop.domain.dto.MgtShopTaskPageDto; import com.ruoyi.shop.domain.dto.StaffShopTaskPageDto; import com.ruoyi.shop.domain.pojo.task.ShopTaskRecord; @@ -50,9 +51,9 @@ if(mgtShopTaskRecordPageVoList!=null&&!mgtShopTaskRecordPageVoList.isEmpty()){ Long followId; List<TaskFile> taskFileList; List<String> picture = new ArrayList<>(); List<String> video = new ArrayList<>(); List<String> audio = new ArrayList<>(); List<FileDto> picture = new ArrayList<>(); List<FileDto> video = new ArrayList<>(); List<FileDto> audio = new ArrayList<>(); Long userId; SysUser sysUser; for(MgtShopTaskRecordPageVo mgtShopTaskRecordPageVo : mgtShopTaskRecordPageVoList){ @@ -65,15 +66,36 @@ followId = mgtShopTaskRecordPageVo.getFollowId(); taskFileList = taskFileService.listByFollowIdAndFollowType(followId,1); if(taskFileList!=null&&!taskFileList.isEmpty()){ picture = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); picture = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } taskFileList = taskFileService.listByFollowIdAndFollowType(followId,2); if(taskFileList!=null&&!taskFileList.isEmpty()){ video = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); video = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } taskFileList = taskFileService.listByFollowIdAndFollowType(followId,3); if(taskFileList!=null&&!taskFileList.isEmpty()){ audio = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); audio = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } mgtShopTaskRecordPageVo.setPicture(picture); mgtShopTaskRecordPageVo.setVideo(video); @@ -97,9 +119,9 @@ if(myShopTaskRecordPageVoList!=null&&!myShopTaskRecordPageVoList.isEmpty()){ Long followId; List<TaskFile> taskFileList; List<String> picture = new ArrayList<>(); List<String> video = new ArrayList<>(); List<String> audio = new ArrayList<>(); List<FileDto> picture = new ArrayList<>(); List<FileDto> video = new ArrayList<>(); List<FileDto> audio = new ArrayList<>(); Long userId; SysUser sysUser; for(StaffMyShopTaskRecordPageVo staffMyShopTaskRecordPageVo : myShopTaskRecordPageVoList){ @@ -112,15 +134,36 @@ followId = staffMyShopTaskRecordPageVo.getFollowId(); taskFileList = taskFileService.listByFollowIdAndFollowType(followId,1); if(taskFileList!=null&&!taskFileList.isEmpty()){ picture = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); picture = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } taskFileList = taskFileService.listByFollowIdAndFollowType(followId,2); if(taskFileList!=null&&!taskFileList.isEmpty()){ video = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); video = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } taskFileList = taskFileService.listByFollowIdAndFollowType(followId,3); if(taskFileList!=null&&!taskFileList.isEmpty()){ audio = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); audio = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } staffMyShopTaskRecordPageVo.setPicture(picture); staffMyShopTaskRecordPageVo.setVideo(video); @@ -144,9 +187,9 @@ if(myShopTaskRecordPageVoList!=null&&!myShopTaskRecordPageVoList.isEmpty()){ Long followId; List<TaskFile> taskFileList; List<String> picture = new ArrayList<>(); List<String> video = new ArrayList<>(); List<String> audio = new ArrayList<>(); List<FileDto> picture = new ArrayList<>(); List<FileDto> video = new ArrayList<>(); List<FileDto> audio = new ArrayList<>(); Long userId; SysUser sysUser; for(StaffMyShopTaskRecordPageVo staffMyShopTaskRecordPageVo : myShopTaskRecordPageVoList){ @@ -159,15 +202,36 @@ followId = staffMyShopTaskRecordPageVo.getFollowId(); taskFileList = taskFileService.listByFollowIdAndFollowType(followId,1); if(taskFileList!=null&&!taskFileList.isEmpty()){ picture = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); picture = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } taskFileList = taskFileService.listByFollowIdAndFollowType(followId,2); if(taskFileList!=null&&!taskFileList.isEmpty()){ video = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); video = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } taskFileList = taskFileService.listByFollowIdAndFollowType(followId,3); if(taskFileList!=null&&!taskFileList.isEmpty()){ audio = taskFileList.stream().map(k->k.getFileUrl()).collect(Collectors.toList()); audio = taskFileList.stream() .map(taskFile -> { FileDto fileDto = new FileDto(); fileDto.setFileName(taskFile.getFileName()); fileDto.setFileUrl(taskFile.getFileUrl()); return fileDto; }) .collect(Collectors.toList()); } staffMyShopTaskRecordPageVo.setPicture(picture); staffMyShopTaskRecordPageVo.setVideo(video); ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/task/ShopTaskServiceImpl.java
@@ -19,6 +19,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -249,50 +250,53 @@ // 保存或更新会员任务记录 shopTaskRecordService.saveOrUpdate(shopTaskRecord); // 获取图片、视频和音频 String picture = staffFollowShopTaskDto.getPicture(); String video = staffFollowShopTaskDto.getVideo(); String audio = staffFollowShopTaskDto.getAudio(); String[] strArr; List<FileDto> picture = staffFollowShopTaskDto.getPicture(); List<FileDto> video = staffFollowShopTaskDto.getVideo(); List<FileDto> audio = staffFollowShopTaskDto.getAudio(); TaskFile taskFile; List<TaskFile> taskFileList = new ArrayList<>(); // 判断图片是否为空,并处理 if (StringUtils.isNotBlank(picture)) { strArr = picture.split(","); for (String str : strArr) { if (picture!=null&&!picture.isEmpty()) { for (FileDto fileDto : picture) { taskFile = new TaskFile(); taskFile.setDelFlag(0); taskFile.setFollowId(shopTaskRecord.getId()); taskFile.setFollowFrom(4); taskFile.setFileUrl(str); taskFile.setFileName(fileDto.getFileName()); taskFile.setFileUrl(fileDto.getFileUrl()); taskFile.setFileType(1); taskFileService.saveOrUpdate(taskFile); taskFileList.add(taskFile); } } // 判断视频是否为空,并处理 if (StringUtils.isNotBlank(video)) { strArr = video.split(","); for (String str : strArr) { if (video!=null&&!video.isEmpty()) { for (FileDto fileDto : video) { taskFile = new TaskFile(); taskFile.setDelFlag(0); taskFile.setFollowId(shopTaskRecord.getId()); taskFile.setFollowFrom(4); taskFile.setFileUrl(str); taskFile.setFileName(fileDto.getFileName()); taskFile.setFileUrl(fileDto.getFileUrl()); taskFile.setFileType(2); taskFileService.saveOrUpdate(taskFile); taskFileList.add(taskFile); } } // 判断音频是否为空,并处理 if (StringUtils.isNotBlank(audio)) { strArr = audio.split(","); for (String str : strArr) { if (audio!=null&&!audio.isEmpty()) { for (FileDto fileDto : audio) { taskFile = new TaskFile(); taskFile.setDelFlag(0); taskFile.setFollowId(shopTaskRecord.getId()); taskFile.setFollowFrom(4); taskFile.setFileUrl(str); taskFile.setFileName(fileDto.getFileName()); taskFile.setFileUrl(fileDto.getFileUrl()); taskFile.setFileType(3); taskFileService.saveOrUpdate(taskFile); taskFileList.add(taskFile); } } if(taskFileList!=null&&!taskFileList.isEmpty()){ taskFileService.saveBatch(taskFileList); } } // 判断下一个任务日期是否为空,并处理 if (StringUtils.isNotBlank(staffFollowShopTaskDto.getNextTaskDate())) { ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/shop/ShopService.java
@@ -272,7 +272,7 @@ * @param userId * @return Shop */ Shop getShopByBelongUserId(Long userId); List<Shop> getShopByBelongUserId(Long userId); /** * @description 员工端获取商户列表 ruoyi-modules/ruoyi-shop/src/main/resources/mapper/shop/ShopMapper.xml
@@ -730,9 +730,9 @@ ORDER BY COUNT(ts.shop_id) DESC LIMIT 15 </select> <select id="listShopSalesRank" resultType="com.ruoyi.system.api.domain.vo.MgtMapIntTotalVo"> <select id="listShopSalesRank" resultType="java.lang.Long"> SELECT ts.shop_name mapKey, ts.shop_id mapKey, tst.total_order_money mapValue FROM t_shop ts INNER JOIN t_shop_total tst ON ts.shop_id = tst.shop_id ruoyi-modules/ruoyi-shop/src/main/resources/mapper/task/MemberTaskMapper.xml
@@ -84,11 +84,9 @@ tmt.task_id taskId, tmt.task_date taskDate, tmt.task_content taskContent, tmtr.follow_content dealContent, tmt.emergency_state emergencyState, CASE tmt.task_status WHEN 1 THEN 1 WHEN 3 THEN 1 ELSE 0 END todayFlag FROM t_member_task tmt LEFT JOIN t_member_task_record tmtr ON tmt.task_id = tmtr.task_id WHERE tmt.del_flag = 0 AND tmt.shop_id = #{param.shopId} AND tmt.user_id = #{param.memberUserId} ORDER BY todayFlag,task_date DESC </select> @@ -110,4 +108,8 @@ WHERE del_flag = 0 AND task_status = 2 AND user_id = #{userId} ORDER BY task_date DESC LIMIT 1 </select> <select id="listDealContent" resultType="java.lang.String"> SELECT follow_content FROM t_member_task_record WHERE del_flag = 0 AND task_id = #{taskId} </select> </mapper>