| | |
| | |
|
| | | import com.yeshi.fanli.dao.hongbao.HongBaoDao;
|
| | | import com.yeshi.fanli.dao.mybatis.share.ShareMapper;
|
| | | import com.yeshi.fanli.dao.order.PidOrderDao;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBao;
|
| | | import com.yeshi.fanli.entity.taobao.PidOrder;
|
| | | import com.yeshi.fanli.entity.taobao.PidUser;
|
| | | import com.yeshi.fanli.entity.taobao.ShareTaoPassword;
|
| | | import com.yeshi.fanli.service.inter.goods.ShareService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import org.yeshi.utils.NumberUtil;
|
| | |
|
| | | @Service
|
| | | public class ShareServiceImpl implements ShareService {
|
| | |
| | |
|
| | | @Resource
|
| | | private HongBaoDao hongBaoDao;
|
| | | |
| | | @Resource
|
| | | private PidOrderDao pidOrderDao;
|
| | |
|
| | | @Override
|
| | | public String getRandomPid() {
|
| | |
| | | public int getCount(long uid) {
|
| | | return shareMapper.getCount(uid);
|
| | | }
|
| | | |
| | | @Override
|
| | | public int getCountByKey(String key) {
|
| | | if (NumberUtil.isNumeric(key)) {
|
| | | |
| | | if (key.trim().length() < 18) {
|
| | | long lk = Long.parseLong(key);
|
| | | return (int) pidOrderDao.getCount(
|
| | | "select count(*) from PidOrder po where po.userInfo.id = ? ",
|
| | | new Serializable[] {lk});
|
| | | } else {
|
| | | return (int) pidOrderDao.getCount("select count(*) from PidOrder po where po.orderId like ? ",
|
| | | new Serializable[] { "%" + key + "%" });
|
| | | }
|
| | | |
| | | } else {
|
| | | |
| | | return (int) pidOrderDao.getCount("select count(*) from PidOrder po where po.userInfo.nickName like ? ",
|
| | | new Serializable[] { "%" + key + "%" });
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<HongBao> getShareList(int pageIndex, long uid) {
|
| | |
| | | return shareMapper.getShareMoneyCount();
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public List<PidOrder> getShareMoneyList(int pageIndex, String key) {
|
| | | |
| | | if(NumberUtil.isNumeric(key)) {
|
| | | |
| | | if(key.length() < 18 ) {
|
| | | long uid = Long.parseLong(key);
|
| | | List<PidOrder> shareMoneyList = pidOrderDao.list("from PidOrder po where po.userInfo.id = ? order by po.orderCreateTime desc",
|
| | | (pageIndex - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, new Serializable[] {uid});
|
| | | return shareMoneyList;
|
| | | } else {
|
| | | List<PidOrder> shareMoneyList = pidOrderDao.list("from PidOrder po where po.orderId like ? order by po.orderCreateTime desc",
|
| | | (pageIndex - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, new Serializable[] {"%" + key + "%"});
|
| | | return shareMoneyList;
|
| | | }
|
| | | |
| | | }
|
| | | List<PidOrder> shareMoneyList = pidOrderDao.list("from PidOrder po where po.userInfo.nickName like ? order by po.orderCreateTime desc",
|
| | | (pageIndex - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, new Serializable[] {"%" + key + "%"});
|
| | | return shareMoneyList;
|
| | | }
|
| | |
|
| | | }
|