| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | |
| | | date2 = LocalDateTime.parse(date + "T00:00:00").minusDays(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
| | | fansSubmit.setCreateTime(LocalDateTime.parse(date + "T00:00:00")); |
| | | } |
| | | fansSubmitMapper.insert(fansSubmit); |
| | | try { |
| | | FansSubmit fansSubmit1 = fansSubmitMapper.selectOne(Wrappers.<FansSubmit>lambdaQuery().eq(FansSubmit::getCustom, fansSubmit.getCustom()).eq(FansSubmit::getProduct, fansSubmit.getProduct()).eq(FansSubmit::getVx, fansSubmit.getVx()).like(FansSubmit::getCreateTime, date).last("limit 1")); |
| | | if(BeanUtil.isEmpty(fansSubmit1)){ |
| | | fansSubmitMapper.insert(fansSubmit); |
| | | }else{ |
| | | fansSubmit1.setFansAdd(fansSubmit.getFansAdd()); |
| | | fansSubmitMapper.updateById(fansSubmit1); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | List<FansSubmit> fansSubmits = fansSubmitMapper.selectList(Wrappers.<FansSubmit>lambdaQuery().eq(FansSubmit::getProduct, fansSubmit.getProduct()).eq(FansSubmit::getVx, fansSubmit.getVx()).select(FansSubmit::getFansAdd).like(FansSubmit::getCreateTime, date)); |
| | | Integer sum = 0; |
| | | for (FansSubmit fansSubmit2 : fansSubmits) { |
| | |
| | | queryWrapper.select("DISTINCT vx").like("create_time", format); |
| | | return fansSubmitMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteAllFans(String date) { |
| | | List<FansSubmit> list = fansSubmitMapper.selectList(Wrappers.<FansSubmit>lambdaQuery().eq(FansSubmit::getCreateUser, getLook.selectPowerByMethodAndUserId("selectDataReportingList").get("userId")).like(FansSubmit::getCreateTime, date).select(FansSubmit::getId)); |
| | | for (FansSubmit fansSubmit : list) { |
| | | delFansSubmit(fansSubmit.getId()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Double countFansSubmitList(FansSubmit fansSubmit) { |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("selectFansSubmitList"); |
| | | if(map1.get("look")==1) fansSubmit.setCreateUser(map1.get("userId")); |
| | | fansSubmit.setCreateTime(fansSubmit.getCreateTime().plusDays(1)); |
| | | return fansSubmitMapper.countFansSubmitList(QueryWrappers.queryWrappers(fansSubmit)); |
| | | } |
| | | } |
| | | |
| | | |