|
|
@@ -789,62 +789,23 @@ public class PosOrderController extends BaseController {
|
|
|
QueryWrapper<PosOrder> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("dd_id", ddid);
|
|
|
PosOrder orlist = posOrderService.getOne(queryWrapper);
|
|
|
- JSONObject org = new JSONObject();
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
- org.put("id", orlist.getId());
|
|
|
- org.put("ddId", orlist.getDdId());
|
|
|
+ // 自动序列化所有PosOrder字段,新增字段无需手动添加
|
|
|
+ JSONObject org = JSON.parseObject(
|
|
|
+ JSON.toJSONStringWithDateFormat(orlist, "yyyy-MM-dd HH:mm:ss")
|
|
|
+ );
|
|
|
+ // 以下为非PosOrder字段或需要特殊处理的字段
|
|
|
org.put("shanghu", infoUserService.getById(orlist.getShId()));
|
|
|
org.put("store", posStoreService.getById(orlist.getMdId()));
|
|
|
- org.put("cretim", sdf.format(orlist.getCretim()));
|
|
|
- org.put("shdzId", orlist.getShdzId());
|
|
|
org.put("shaddress", orlist.getShAddress() == null ? infoAddressService.getById(orlist.getShdzId()) : JSONObject.parseObject(orlist.getShAddress()));
|
|
|
org.put("user", infoUserService.getById(orlist.getUserId()));
|
|
|
- org.put("amount", orlist.getAmount());
|
|
|
- org.put("kefuState", orlist.getKefuState());
|
|
|
- org.put("kefuContent", orlist.getKefuContent());
|
|
|
- org.put("kefuRepeat", orlist.getKefuRepeat());
|
|
|
- org.put("repeatDdId", orlist.getRepeatDdId());
|
|
|
- org.put("remarks", orlist.getRemarks());
|
|
|
- org.put("state", orlist.getState());
|
|
|
- org.put("type", orlist.getType());
|
|
|
- org.put("jvli", orlist.getJvli());
|
|
|
- org.put("freight", orlist.getFreight());
|
|
|
- org.put("delryTime", orlist.getDelryTime());
|
|
|
- org.put("longitude", orlist.getLongitude());
|
|
|
- org.put("latitude", orlist.getLatitude());
|
|
|
- org.put("qsId", orlist.getQsId());
|
|
|
- org.put("sqImg", orlist.getQsImg());
|
|
|
- org.put("discountAmount", orlist.getDiscountAmount());
|
|
|
InfoUser qsUser = infoUserService.getById(orlist.getQsId());
|
|
|
setQsStar(qsUser);
|
|
|
org.put("qsuser", orlist.getQsId() == null ? null : qsUser);
|
|
|
- org.put("payUrl", orlist.getPayUrl());
|
|
|
QueryWrapper<RiderPosition> query = new QueryWrapper<>();
|
|
|
query.eq("rider_id", orlist.getQsId());
|
|
|
org.put("RiderPosition", orlist.getQsId() == null ? null : riderPositionService.getOne(query));
|
|
|
- org.put("diningStatus", orlist.getDiningStatus());
|
|
|
- org.put("collectPayment", orlist.getCollectPayment());
|
|
|
org.put("food", JSONArray.parseArray(orlist.getFood()));
|
|
|
-// org.put("activity",salesPromotionService.getById(orlist.getActivity()));
|
|
|
-
|
|
|
- org.put("activity", orlist.getActivity());
|
|
|
- org.put("mdActivity", orlist.getMdActivity());
|
|
|
- org.put("salesReduction", orlist.getSalesReduction());
|
|
|
- org.put("mdSalesReduction", orlist.getMdSalesReduction());
|
|
|
- org.put("salesName", orlist.getSalesName());
|
|
|
- org.put("mdSalesName", orlist.getMdSalesName());
|
|
|
- org.put("mdDiscountAmount", orlist.getMdDiscountAmount());
|
|
|
- org.put("discountAmount", orlist.getDiscountAmount());
|
|
|
- org.put("mdYhId", orlist.getMdYhId());
|
|
|
- org.put("mdYhName", orlist.getMdYhName());
|
|
|
- org.put("yhId", orlist.getYhId());
|
|
|
- org.put("yhName", orlist.getYhName());
|
|
|
- org.put("points", orlist.getPoints());
|
|
|
- org.put("pointsReduction", orlist.getPointsReduction());
|
|
|
- org.put("sdTime", orlist.getSdTime());
|
|
|
- org.put("payType", orlist.getPayType());
|
|
|
Long count = posOrderRatingService.getBaseMapper().selectCount(new QueryWrapper<PosOrderRating>().eq("dd_id", ddid));
|
|
|
- //是否已经评论
|
|
|
org.put("isCommented", count > 0);
|
|
|
return success(org);
|
|
|
}
|