解决用户账单不显示用户名,会员任务不显示任务名称

This commit is contained in:
xuwenbo
2020-05-14 18:04:43 +08:00
parent 9ed14ba9e8
commit d4b3b1a40e
6 changed files with 41 additions and 17 deletions

View File

@ -36,7 +36,7 @@ public interface YxUserBillService extends BaseService<YxUserBill>{
* @param criteria 条件参数 * @param criteria 条件参数
* @return List<YxUserBillDto> * @return List<YxUserBillDto>
*/ */
List<YxUserBill> queryAll(YxUserBillQueryCriteria criteria); List<Map<String,Object>> queryAll(YxUserBillQueryCriteria criteria);
/** /**
* 导出数据 * 导出数据

View File

@ -17,36 +17,37 @@ import java.io.Serializable;
*/ */
@Data @Data
public class YxSystemUserTaskDto implements Serializable { public class YxSystemUserTaskDto implements Serializable {
private Integer id; private Integer id;
/** 任务名称 */ // 任务名称
private String name; private String name;
/** 配置原名 */ // 配置原名
private String realName; private String realName;
/** 任务类型 */ // 任务类型
private String taskType; private String taskType;
/** 限定数 */ // 限定数
private Integer number; private Integer number;
/** 等级id */ // 等级id
private Integer levelId; private Integer levelId;
/** 排序 */ private String levalName;
// 排序
private Integer sort; private Integer sort;
/** 是否显示 */ // 是否显示
private Integer isShow; private Integer isShow;
/** 是否务必达成任务,1务必达成,0=满足其一 */ // 是否务必达成任务,1务必达成,0=满足其一
private Integer isMust; private Integer isMust;
/** 任务说明 */ // 任务说明
private String illustrate; private String illustrate;
/** 新增时间 */ // 新增时间
private Integer addTime; private Integer addTime;
} }

View File

@ -18,4 +18,7 @@ import co.yixiang.annotation.Query;
*/ */
@Data @Data
public class YxUserBillQueryCriteria{ public class YxUserBillQueryCriteria{
private String nickname;
private String category;
private String type;
} }

View File

@ -52,8 +52,13 @@ public class YxSystemUserTaskServiceImpl extends BaseServiceImpl<SystemUserTaskM
public Map<String, Object> queryAll(YxSystemUserTaskQueryCriteria criteria, Pageable pageable) { public Map<String, Object> queryAll(YxSystemUserTaskQueryCriteria criteria, Pageable pageable) {
getPage(pageable); getPage(pageable);
PageInfo<YxSystemUserTask> page = new PageInfo<>(queryAll(criteria)); PageInfo<YxSystemUserTask> page = new PageInfo<>(queryAll(criteria));
List<YxSystemUserTaskDto> systemUserTaskDTOS = generator.convert(page.getList(),YxSystemUserTaskDto.class);
for (YxSystemUserTaskDto systemUserTaskDTO : systemUserTaskDTOS) {
systemUserTaskDTO.setLevalName(this
.getById(systemUserTaskDTO.getLevelId()).getName());
}
Map<String, Object> map = new LinkedHashMap<>(2); Map<String, Object> map = new LinkedHashMap<>(2);
map.put("content", generator.convert(page.getList(), YxSystemUserTaskDto.class)); map.put("content", systemUserTaskDTOS);
map.put("totalElements", page.getTotal()); map.put("totalElements", page.getTotal());
return map; return map;
} }

View File

@ -19,6 +19,7 @@ import co.yixiang.modules.shop.service.YxUserBillService;
import co.yixiang.modules.shop.service.dto.YxUserBillDto; import co.yixiang.modules.shop.service.dto.YxUserBillDto;
import co.yixiang.modules.shop.service.dto.YxUserBillQueryCriteria; import co.yixiang.modules.shop.service.dto.YxUserBillQueryCriteria;
import co.yixiang.modules.shop.service.mapper.UserBillMapper; import co.yixiang.modules.shop.service.mapper.UserBillMapper;
import org.apache.xmlbeans.impl.xb.xmlconfig.Qnametargetlist;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -51,9 +52,9 @@ public class YxUserBillServiceImpl extends BaseServiceImpl<UserBillMapper, YxUse
//@Cacheable //@Cacheable
public Map<String, Object> queryAll(YxUserBillQueryCriteria criteria, Pageable pageable) { public Map<String, Object> queryAll(YxUserBillQueryCriteria criteria, Pageable pageable) {
getPage(pageable); getPage(pageable);
PageInfo<YxUserBill> page = new PageInfo<>(queryAll(criteria)); PageInfo<Map<String,Object>> page = new PageInfo<>(queryAll(criteria));
Map<String, Object> map = new LinkedHashMap<>(2); Map<String, Object> map = new LinkedHashMap<>(2);
map.put("content", generator.convert(page.getList(), YxUserBillDto.class)); map.put("content", page.getList());
map.put("totalElements", page.getTotal()); map.put("totalElements", page.getTotal());
return map; return map;
} }
@ -61,8 +62,9 @@ public class YxUserBillServiceImpl extends BaseServiceImpl<UserBillMapper, YxUse
@Override @Override
//@Cacheable //@Cacheable
public List<YxUserBill> queryAll(YxUserBillQueryCriteria criteria){ public List<Map<String,Object>> queryAll(YxUserBillQueryCriteria criteria){
return baseMapper.selectList(QueryHelpPlus.getPredicate(YxUserBill.class, criteria));
return baseMapper.findAllByQueryCriteria(criteria.getCategory(),criteria.getType(),criteria.getNickname());
} }

View File

@ -10,9 +10,17 @@ package co.yixiang.modules.shop.service.mapper;
import co.yixiang.common.mapper.CoreMapper; import co.yixiang.common.mapper.CoreMapper;
import co.yixiang.modules.shop.domain.YxUserBill; import co.yixiang.modules.shop.domain.YxUserBill;
import co.yixiang.modules.shop.service.dto.YxUserBillDto;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
/** /**
* @author hupeng * @author hupeng
* @date 2020-05-12 * @date 2020-05-12
@ -21,4 +29,9 @@ import org.springframework.stereotype.Repository;
@Mapper @Mapper
public interface UserBillMapper extends CoreMapper<YxUserBill> { public interface UserBillMapper extends CoreMapper<YxUserBill> {
@ResultType(Map.class)
@Select("select b.title,b.pm,b.category,b.type,b.number,b.add_time as addTime,u.nickname " +
"from yx_user_bill b left join yx_user u on u.uid=b.uid where if(#{category} !='',b.category=#{category},1=1) " +
"and if(#{type} !='',b.type=#{type},1=1) and if(#{nickname} !='',u.nickname LIKE CONCAT('%',#{nickname},'%'),1=1) ")
List<Map<String, Object>> findAllByQueryCriteria(@Param("category") String category, @Param("type") String type, @Param("nickname") String nickname);
} }