| | |
| | | |
| | | import com.yeshi.fanli.entity.accept.AdminAcceptData; |
| | | import com.yeshi.fanli.util.OrderConstant; |
| | | import net.sf.json.JSONArray; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | */ |
| | | @RequestMapping(value = "getUserOrderList") |
| | | public void getUserOrderList(AdminAcceptData acceptData, String callback, Integer pageIndex, Integer pageSize, Integer keyType, String key, |
| | | Integer state, Integer type, Integer orderState, String startTime, String endTime, Integer sourceType, |
| | | Integer state, String type, Integer orderState, String startTime, String endTime, Integer sourceType, |
| | | Integer riskType, BigDecimal payment, PrintWriter out) { |
| | | |
| | | List<Integer> typeList = null; |
| | | |
| | | if (pageIndex == null || pageIndex < 1) { |
| | | pageIndex = 1; |
| | |
| | | state = null;// 所有状态 |
| | | } |
| | | |
| | | if (type != null && type == 0) { |
| | | type = null; // 所有类型订单 |
| | | if (!StringUtil.isNullOrEmpty(type)) { |
| | | JSONArray array = JSONArray.fromObject(type); |
| | | if (array.size() > 0) { |
| | | typeList = new ArrayList<>(); |
| | | for (int i = 0; i < array.size(); i++) { |
| | | if (!StringUtil.isNullOrEmpty(array.optString(i))) |
| | | typeList.add(array.optInt(i)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (endTime != null && endTime.trim().length() > 0) { |
| | |
| | | if (riskType != null && !StringUtil.isNullOrEmpty(key) && keyType != null && keyType == 2) { |
| | | long uid = Long.parseLong(key); |
| | | // 查询同店铺商品,同商品订单超过一定数量的 |
| | | List<Integer> typeList = new ArrayList<>(); |
| | | typeList.add(HongBaoV2.TYPE_ZIGOU); |
| | | List<Integer> hongBaoTypeList = new ArrayList<>(); |
| | | hongBaoTypeList.add(HongBaoV2.TYPE_ZIGOU); |
| | | |
| | | if (riskType == 1) { |
| | | listGoodsId = commonOrderCountService.getSameGoodsOrderByUidAndHongBaoType(typeList, uid, |
| | | listGoodsId = commonOrderCountService.getSameGoodsOrderByUidAndHongBaoType(hongBaoTypeList, uid, |
| | | Integer.parseInt(configService.getValue(ConfigKeyEnum.adminMinSameGoodsOrderCount.getKey(), acceptData.getSystem()))); |
| | | if (listGoodsId == null || listGoodsId.isEmpty()) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无同商品订单")); |
| | | return; |
| | | } |
| | | } else if (riskType == 2) { |
| | | listShopId = commonOrderCountService.getSameShopOrderByUidAndHongBaoType(typeList, uid, |
| | | listShopId = commonOrderCountService.getSameShopOrderByUidAndHongBaoType(hongBaoTypeList, uid, |
| | | Integer.parseInt(configService.getValue(ConfigKeyEnum.adminMinSameShopOrderCount.getKey(), acceptData.getSystem()))); |
| | | if (listShopId == null || listShopId.isEmpty()) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无同店铺订单")); |
| | |
| | | |
| | | // 查询列表 |
| | | List<CommonOrderVO> list = commonOrderService.listQuery((pageIndex - 1) * pageSize, pageSize, keyType, key, |
| | | state, type, orderState, startTime, endTime, sourceType, listShopId, listGoodsId, minTime, money, payment, acceptData.getSystem()); |
| | | state, typeList, orderState, startTime, endTime, sourceType, listShopId, listGoodsId, minTime, money, payment, acceptData.getSystem()); |
| | | |
| | | // 统计总数 |
| | | long count = commonOrderService.countQuery(keyType, key, state, type, orderState, startTime, endTime, |
| | | long count = commonOrderService.countQuery(keyType, key, state, typeList, orderState, startTime, endTime, |
| | | sourceType, listShopId, listGoodsId, minTime, money, payment, acceptData.getSystem()); |
| | | |
| | | for (CommonOrderVO order : list) { |