| @@ -26,6 +26,7 @@ import javax.servlet.http.HttpServletRequest; | |||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.stream.Collectors; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxCUserBasicInfo") | @RequestMapping("wxCUserBasicInfo") | ||||
| @@ -40,7 +41,7 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| private WxCUserTagsService wxCUserTagsService; | private WxCUserTagsService wxCUserTagsService; | ||||
| @Autowired | @Autowired | ||||
| private WxTagsService wxTagsService; | |||||
| private WxCUserCarService wxCUserCarService; | |||||
| @Autowired | @Autowired | ||||
| private WxCouponOrderService wxCouponOrderService; | private WxCouponOrderService wxCouponOrderService; | ||||
| @@ -78,6 +79,15 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| } | } | ||||
| private void setUserInfoCar(WxCUserBasicInfo info) { | |||||
| WxCUserCar wxCUserCar = new WxCUserCar(); | |||||
| wxCUserCar.setCUserId(info.getId()); | |||||
| List<WxCUserCar> list = wxCUserCarService.getList(wxCUserCar); | |||||
| if (list.size() > 0) { | |||||
| info.setCarList(list.stream().map(p -> p.getCarNumber()).collect(Collectors.toList())); | |||||
| } | |||||
| } | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @@ -168,7 +178,7 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| setUserInfoTag(info); | setUserInfoTag(info); | ||||
| setUserInfoLevel(info); | setUserInfoLevel(info); | ||||
| setUserInfoCar(info); | |||||
| return new ResultData(info); | return new ResultData(info); | ||||
| } | } | ||||
| @@ -89,10 +89,8 @@ public class DaliyAmountSchedule { | |||||
| List<WxCouponOrder> list = wxCouponOrderMapper.findListOfOrderedByDate(dateMap); | List<WxCouponOrder> list = wxCouponOrderMapper.findListOfOrderedByDate(dateMap); | ||||
| logger.info("find " + list.size() + " coupon order from " + startDate + " to " + new Date()); | logger.info("find " + list.size() + " coupon order from " + startDate + " to " + new Date()); | ||||
| int total_price = 0; | |||||
| for(WxCouponOrder couponOrder : list) { | |||||
| total_price = total_price + couponOrder.getCouponPrice(); | |||||
| } | |||||
| int total_price = list.stream().mapToInt(p->p.getCouponPrice()).sum(); | |||||
| logger.info("\nFound " + list.size() + " coupon orders \n" + | logger.info("\nFound " + list.size() + " coupon orders \n" + | ||||
| "for " + merchant.getId() + "\n" + | "for " + merchant.getId() + "\n" + | ||||
| "from " + startDate + " to " + new Date() +"\n" + | "from " + startDate + " to " + new Date() +"\n" + | ||||
| @@ -112,10 +110,7 @@ public class DaliyAmountSchedule { | |||||
| list= wxCouponOrderMapper.findListOfVerifiedByDate(dateMap); | list= wxCouponOrderMapper.findListOfVerifiedByDate(dateMap); | ||||
| logger.info("find " + list.size() + " coupon order from " + startDate + " to " + new Date()); | logger.info("find " + list.size() + " coupon order from " + startDate + " to " + new Date()); | ||||
| total_price = 0; | |||||
| for(WxCouponOrder couponOrder : list) { | |||||
| total_price = total_price + couponOrder.getCouponPrice(); | |||||
| } | |||||
| total_price = list.stream().mapToInt(p->p.getCouponPrice()).sum(); | |||||
| logger.info("\nFound " + list.size() + " coupon orders \n" + | logger.info("\nFound " + list.size() + " coupon orders \n" + | ||||
| "for " + merchant.getId() + "\n" + | "for " + merchant.getId() + "\n" + | ||||
| "from " + startDate + " to " + new Date() +"\n" + | "from " + startDate + " to " + new Date() +"\n" + | ||||
| @@ -113,6 +113,9 @@ public class WxCUserBasicInfo implements Serializable { | |||||
| @Transient | @Transient | ||||
| private List<WxTags> tagsList; | private List<WxTags> tagsList; | ||||
| @Transient | |||||
| private List<String> carList; | |||||
| @Transient | @Transient | ||||
| private Date startTime; | private Date startTime; | ||||
| @Transient | @Transient | ||||
| @@ -121,7 +124,6 @@ public class WxCUserBasicInfo implements Serializable { | |||||
| @Transient | @Transient | ||||
| private String addressStr; | private String addressStr; | ||||
| public String getLevel() { | public String getLevel() { | ||||
| return level; | return level; | ||||
| } | } | ||||
| @@ -270,6 +272,14 @@ public class WxCUserBasicInfo implements Serializable { | |||||
| this.tagsList = tagsList; | this.tagsList = tagsList; | ||||
| } | } | ||||
| public List<String> getCarList() { | |||||
| return carList; | |||||
| } | |||||
| public void setCarList(List<String> carList) { | |||||
| this.carList = carList; | |||||
| } | |||||
| public static enum Field | public static enum Field | ||||
| { | { | ||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | ||||
| @@ -38,6 +38,7 @@ import java.io.*; | |||||
| import java.text.ParseException; | import java.text.ParseException; | ||||
| import java.text.SimpleDateFormat; | import java.text.SimpleDateFormat; | ||||
| import java.util.*; | import java.util.*; | ||||
| import java.util.stream.Collectors; | |||||
| @Service | @Service | ||||
| public class WxCouponOrderServiceImpl implements WxCouponOrderService { | public class WxCouponOrderServiceImpl implements WxCouponOrderService { | ||||
| @@ -173,11 +174,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| else | else | ||||
| list = wxCouponOrderMapper.findListOfOrderedByDate(dateMap); | list = wxCouponOrderMapper.findListOfOrderedByDate(dateMap); | ||||
| logger.info("find " + list.size() + " coupon order from " + startDate + " to " + new Date()); | logger.info("find " + list.size() + " coupon order from " + startDate + " to " + new Date()); | ||||
| int total_price = 0; | |||||
| for (WxCouponOrder couponOrder : list) { | |||||
| total_price = total_price + couponOrder.getCouponPrice(); | |||||
| } | |||||
| resultMap.put("amount", total_price); | |||||
| resultMap.put("amount", list.stream().mapToInt(p->p.getCouponPrice()).sum()); | |||||
| } else { | } else { | ||||
| if (isVerified) | if (isVerified) | ||||
| resultMap.put("list", PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponOrderMapper.findListOfVerifiedByDateForBUser(dateMap))); | resultMap.put("list", PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponOrderMapper.findListOfVerifiedByDateForBUser(dateMap))); | ||||