|
|
|
@ -13,6 +13,7 @@ import cn.chjyj.szwh.utils.ProperUtils; |
|
|
|
import cn.chjyj.szwh.utils.RequestUtils; |
|
|
|
import cn.chjyj.szwh.utils.SignUtils; |
|
|
|
import cn.chjyj.szwh.vo.GoodsDetailVo; |
|
|
|
import cn.chjyj.szwh.vo.GoodsListVo; |
|
|
|
import cn.chjyj.szwh.vo.OrderDetailVo; |
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
@ -142,40 +143,22 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
Map retmap =new HashMap(); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
|
|
|
List nglist= new ArrayList(); |
|
|
|
// 符合条件的记录总数
|
|
|
|
List<Goods> glist = goodsMapper.getGoodsListByMap(gmap,limit); |
|
|
|
for(Goods g:glist){ |
|
|
|
Map gtmap =new HashMap(); |
|
|
|
GoodsDetail goodsDetail = goodsDetailMapper.getGoodsDetailBygid(g.getGoodsDetailId()); |
|
|
|
gtmap.put("goods_name",goodsDetail.getGoodsName()); |
|
|
|
gtmap.put("goods_type",goodsDetail.getGoodsType()); |
|
|
|
|
|
|
|
gtmap.put("createtime",sdf.format(g.getCreateTime())); |
|
|
|
gtmap.put("entrust_status",g.getEntrustStatus()); |
|
|
|
gtmap.put("goods_detail_id",g.getGoodsDetailId()); |
|
|
|
gtmap.put("goods_islicode",g.getGoodsIslicode()); |
|
|
|
gtmap.put("goods_status",g.getGoodsStatus()); |
|
|
|
gtmap.put("id",g.getId()); |
|
|
|
gtmap.put("is_recommend",g.getIsRecommend()); |
|
|
|
gtmap.put("key",g.getGoodsIslicode()); |
|
|
|
gtmap.put("user_islicode",g.getUserIslicode()); |
|
|
|
gtmap.put("username",g.getUsername()); |
|
|
|
nglist.add(gtmap); |
|
|
|
} |
|
|
|
//对日期格式化
|
|
|
|
retmap.put("data",nglist); |
|
|
|
int start = page>1?(page-1)*limit:0; |
|
|
|
int end =page*limit; |
|
|
|
|
|
|
|
List nglist= new ArrayList(); |
|
|
|
List<GoodsListVo> goodsListVoList = goodsMapper.getGoodsVoList(gmap,null,"DESC",limit,start); |
|
|
|
retmap.put("data",goodsListVoList); |
|
|
|
// 总的记录
|
|
|
|
int total = goodsMapper.countAllGoods(); |
|
|
|
//int total = goodsMapper.countAllGoods();
|
|
|
|
int total = goodsMapper.countGoodsListVo(gmap); |
|
|
|
retmap.put("total",total); |
|
|
|
|
|
|
|
int start = page>1?(page-1)*limit:0; |
|
|
|
int end =page*limit; |
|
|
|
|
|
|
|
|
|
|
|
// 总的页
|
|
|
|
int totalpage = (int)Math.ceil(total/limit); |
|
|
|
retmap.put("last_page",totalpage); |
|
|
|
// int totalpage = (int)Math.ceil(total/limit);
|
|
|
|
// retmap.put("last_page",totalpage);
|
|
|
|
retmap.put("per_page",limit); |
|
|
|
retmap.put("start",start+1); // start 默认为0
|
|
|
|
retmap.put("end",end); |
|
|
|
|