From a44f2c3b5db92069ea2813ecf8cb12a6ab3b2203 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期四, 19 五月 2022 17:04:07 +0800 Subject: [PATCH] 管理员权限雁验证 --- app/src/main/java/com/yeshi/makemoney/app/dao/goldcorn/GoldCornSettleRecordDao.java | 72 +++++++++++++++++++++-------------- 1 files changed, 43 insertions(+), 29 deletions(-) diff --git a/app/src/main/java/com/yeshi/makemoney/app/dao/goldcorn/GoldCornSettleRecordDao.java b/app/src/main/java/com/yeshi/makemoney/app/dao/goldcorn/GoldCornSettleRecordDao.java index 8014b5d..3e6bb83 100644 --- a/app/src/main/java/com/yeshi/makemoney/app/dao/goldcorn/GoldCornSettleRecordDao.java +++ b/app/src/main/java/com/yeshi/makemoney/app/dao/goldcorn/GoldCornSettleRecordDao.java @@ -10,85 +10,99 @@ import java.util.List; import java.lang.Long; import java.util.Date; + import com.yeshi.makemoney.app.entity.goldcorn.GoldCornSettleRecord; import org.yeshi.utils.mongo.MongodbBaseDao; + import java.lang.String; + import com.yeshi.makemoney.app.entity.SystemEnum; + import java.util.ArrayList; @Repository -public class GoldCornSettleRecordDao extends MongodbBaseDao<GoldCornSettleRecord>{ +public class GoldCornSettleRecordDao extends MongodbBaseDao<GoldCornSettleRecord> { - public void updateSelective(GoldCornSettleRecord bean) { + public void updateSelective(GoldCornSettleRecord bean) { Query query = new Query(); - Update update=new Update(); + Update update = new Update(); query.addCriteria(Criteria.where("id").is(bean.getId())); - if(bean.getDay() != null) { + if (bean.getDay() != null) { update.set("day", bean.getDay()); } - if(bean.getSystem() != null) { + if (bean.getSystem() != null) { update.set("system", bean.getSystem()); } - if(bean.getRate() != null) { + if (bean.getRate() != null) { update.set("rate", bean.getRate()); } - if(bean.getCornNum() != null) { + if (bean.getCornNum() != null) { update.set("cornNum", bean.getCornNum()); } - if(bean.getTotalMoney() != null) { + if (bean.getTotalMoney() != null) { update.set("totalMoney", bean.getTotalMoney()); } - if(bean.getRemarks() != null) { + + if (bean.getUserCount() != null) { + update.set("userCount", bean.getUserCount()); + } + + if (bean.getSettledUserCount() != null) { + update.set("settledUserCount", bean.getSettledUserCount()); + } + + if (bean.getRemarks() != null) { update.set("remarks", bean.getRemarks()); } - if(bean.getCreateTime() != null) { + if (bean.getCreateTime() != null) { update.set("createTime", bean.getCreateTime()); } update.set("updateTime", new Date()); update(query, update); - } + } - public List<GoldCornSettleRecord> list(DaoQuery daoQuery){ + public List<GoldCornSettleRecord> list(DaoQuery daoQuery) { Query query = getQuery(daoQuery); - if (daoQuery.sortList!=null && daoQuery.sortList.size()>0){ + if (daoQuery.sortList != null && daoQuery.sortList.size() > 0) { query.with(Sort.by(daoQuery.sortList)); } query.skip(daoQuery.start); query.limit(daoQuery.count); return findList(query); - } + } - public long count(DaoQuery daoQuery){ - Query query=getQuery(daoQuery); + public long count(DaoQuery daoQuery) { + Query query = getQuery(daoQuery); return count(query); - } + } - private Query getQuery(DaoQuery daoQuery){ - List<Criteria> andList=new ArrayList<>(); - if(daoQuery.day!=null){ + private Query getQuery(DaoQuery daoQuery) { + List<Criteria> andList = new ArrayList<>(); + if (daoQuery.day != null) { andList.add(Criteria.where("day").is(daoQuery.day)); } - if(daoQuery.system!=null){ + if (daoQuery.system != null) { andList.add(Criteria.where("system").is(daoQuery.system)); } - if(daoQuery.maxCreateTime!=null){ + + if (daoQuery.maxCreateTime != null) { andList.add(Criteria.where("createTime").lt(daoQuery.maxCreateTime)); } - if(daoQuery.minCreateTime!=null){ + if (daoQuery.minCreateTime != null) { andList.add(Criteria.where("createTime").gte(daoQuery.minCreateTime)); } - Query query=new Query(); - Criteria[] ands=new Criteria[andList.size()]; + Query query = new Query(); + Criteria[] ands = new Criteria[andList.size()]; andList.toArray(ands); - if(ands.length>0){ + if (ands.length > 0) { query.addCriteria(new Criteria().andOperator(ands)); } return query; - } + } - public static class DaoQuery{ + public static class DaoQuery { public String day; public SystemEnum system; public Date maxCreateTime; @@ -96,5 +110,5 @@ public int start; public int count; public List<Sort.Order> sortList; - } + } } -- Gitblit v1.8.0