Authored by zhengwen.ge

userOrders报表

package com.yoho.unions.common.enums;
import org.apache.commons.lang.StringUtils;
/**
* 是否新客
* Created by yoho on 2017/6/7.
*/
public enum NewUserEnum {
NEW_USER("Y","是"),
NOT_NEW("N","否");
private String code;
private String name;
private NewUserEnum(String code,String name){
this.code = code;
this.name = name;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
public static String getNameByCode(String code){
if(StringUtils.isEmpty(code)){
return null;
}
for(NewUserEnum e:values()){
if(code.equals(e.getCode())){
return e.getName();
}
}
return null;
}
}
... ...
package com.yoho.unions.common.enums;
import org.apache.commons.lang.StringUtils;
/**
* 订单状态枚举
* Created by yoho on 2017/6/7.
*/
public enum OrderStatusEnum {
WAIT_REVIEW("0","待审核"),
ALREADY_REVIEW("100","已审核"),
PLAN_GOOS("200","备货中"),
ALREADY_SEND("600","已交寄"),
ALREADY_DELIVERY("700","已妥投"),
ALREADY_CANCEL("900","已取消"),
CUSTOMER_CANCEL("901","客服取消"),
PLANGOOS_CANCEL("902","备货中取消"),
OVERTIME_CANCEL("906","超时取消");
private String code;
private String name;
public String getCode() {
return code;
}
public String getName() {
return name;
}
private OrderStatusEnum(String code,String name){
this.code = code;
this.name = name;
}
public static String getNameByCode(String code){
if(StringUtils.isEmpty(code)){
return null;
}
for(OrderStatusEnum e:values()){
if (code.equals(e.getCode())) {
return e.getName();
}
}
return null;
}
}
... ...
package com.yoho.unions.common.enums;
import org.apache.commons.lang.StringUtils;
/**
* 支付方式枚举
* Created by yoho on 2017/6/7.
*/
public enum PaymentTypeEnum {
online_pay("1","在线支付"),
delivery_pay("2","货到付款");
private String code;
private String name;
public String getCode() {
return code;
}
public String getName() {
return name;
}
private PaymentTypeEnum(String code,String name){
this.code = code;
this.name = name;
}
public static String getNameByCode(String code){
if(StringUtils.isEmpty(code)){
return null;
}
for(PaymentTypeEnum e:values()){
if(code.equals(e.getCode())){
return e.getName();
}
}
return null;
}
}
... ...
... ... @@ -67,6 +67,7 @@
<value>/batch/export.do</value>
<value>/batch/import</value>
<value>/mktReportForm/getMktReportForm</value>
<value>/UnionRest/queryUnionOrders</value>
</list>
</property>
<property name="excludeMethods">
... ...
... ... @@ -9,6 +9,8 @@ public interface IOrdersMapper {
Orders selectByUidAndOrderCode(@Param("uid") int uid, @Param("orderCode") long orderCode);
Orders selectByOrderCode(@Param("orderCode") long orderCode);
/**
* 查询某用户一段时间以来的已交寄订单
* @param uid
... ...
... ... @@ -32,4 +32,8 @@ public interface IUserOrdersDAO {
* @return 表里存在的codes
*/
List<UserOrders> getExistOrderCodes(@Param("list") Set<String> list);
int selectCount(@Param("beginTime") int beginTime,@Param("endTime") int endTime,@Param("orderCode") int orderCode,@Param("unionId") int unionId);
List<UserOrders> selectUserOrderList(@Param("beginTime") int beginTime,@Param("endTime") int endTime,@Param("orderCode") int orderCode,@Param("unionId") int unionId,@Param("startIndex") int startIndex, @Param("pageSize") int pageSize);
}
\ No newline at end of file
... ...
package com.yoho.unions.dal;
import com.yoho.unions.dal.model.OrdersCoupons;
public interface OrdersCouponsMapper {
OrdersCoupons selectByOrderCode(Long orderCode);
}
\ No newline at end of file
... ...
... ... @@ -161,6 +161,16 @@ public class Orders {
private Integer uid;
/**
* 订单金额
*/
private BigDecimal orderAmount;
/**
* 实际支付金额
*/
private BigDecimal lastOrderAmount;
/**
* 快递单号
*/
private String expressNumber;
... ... @@ -190,7 +200,7 @@ public class Orders {
/**
* 使用有货币量
*/
private Integer yohoCoinNum;
private int yohoCoinNum;
/**
* 支付类型
... ... @@ -342,7 +352,7 @@ public class Orders {
/**
* 订单状态
*/
private Byte ordersStatus;
private int orderStatus;
private String canCommont;
... ... @@ -356,6 +366,28 @@ public class Orders {
private BigDecimal promotionAmount;
private String newUserOrders;
public static long getSerialVersionUID() {
return serialVersionUID;
}
public BigDecimal getOrderAmount() {
return orderAmount;
}
public void setOrderAmount(BigDecimal orderAmount) {
this.orderAmount = orderAmount;
}
public BigDecimal getLastOrderAmount() {
return lastOrderAmount;
}
public void setLastOrderAmount(BigDecimal lastOrderAmount) {
this.lastOrderAmount = lastOrderAmount;
}
private boolean isSupportRefund;
private boolean isSupportExchange;
... ... @@ -690,11 +722,11 @@ public class Orders {
this.invoicesPayable = invoicesPayable == null ? null : invoicesPayable.trim();
}
public Integer getYohoCoinNum() {
public int getYohoCoinNum() {
return yohoCoinNum;
}
public void setYohoCoinNum(Integer yohoCoinNum) {
public void setYohoCoinNum(int yohoCoinNum) {
this.yohoCoinNum = yohoCoinNum;
}
... ... @@ -994,12 +1026,12 @@ public class Orders {
this.parentOrderCode = parentOrderCode;
}
public Byte getOrdersStatus() {
return ordersStatus;
public int getOrderStatus() {
return orderStatus;
}
public void setOrdersStatus(Byte ordersStatus) {
this.ordersStatus = ordersStatus;
public void setOrderStatus(int orderStatus) {
this.orderStatus = orderStatus;
}
public String getUser_confirm_paid() {
... ... @@ -1161,6 +1193,14 @@ public class Orders {
public void setCanChangeProvince(String canChangeProvince) {
this.canChangeProvince = canChangeProvince;
}
public String getNewUserOrders() {
return newUserOrders;
}
public void setNewUserOrders(String newUserOrders) {
this.newUserOrders = newUserOrders == null ? null : newUserOrders.trim();
}
@Override
public String toString() {
... ...
package com.yoho.unions.dal.model;
import java.math.BigDecimal;
public class OrdersCoupons {
private Integer id;
private Long orderCode;
private Integer couponId;
private String couponCode;
private BigDecimal couponAmount;
private BigDecimal couponAdjustAmount;
private String couponTitle;
private Integer createTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Long getOrderCode() {
return orderCode;
}
public void setOrderCode(Long orderCode) {
this.orderCode = orderCode;
}
public Integer getCouponId() {
return couponId;
}
public void setCouponId(Integer couponId) {
this.couponId = couponId;
}
public String getCouponCode() {
return couponCode;
}
public void setCouponCode(String couponCode) {
this.couponCode = couponCode == null ? null : couponCode.trim();
}
public BigDecimal getCouponAmount() {
return couponAmount;
}
public void setCouponAmount(BigDecimal couponAmount) {
this.couponAmount = couponAmount;
}
public BigDecimal getCouponAdjustAmount() {
return couponAdjustAmount;
}
public void setCouponAdjustAmount(BigDecimal couponAdjustAmount) {
this.couponAdjustAmount = couponAdjustAmount;
}
public String getCouponTitle() {
return couponTitle;
}
public void setCouponTitle(String couponTitle) {
this.couponTitle = couponTitle == null ? null : couponTitle.trim();
}
public Integer getCreateTime() {
return createTime;
}
public void setCreateTime(Integer createTime) {
this.createTime = createTime;
}
}
\ No newline at end of file
... ...
... ... @@ -2,74 +2,31 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.unions.dal.IOrdersMapper">
<resultMap id="BaseResultMap" type="com.yoho.unions.dal.model.Orders">
<id column="id" property="id" jdbcType="INTEGER"/>
<result column="order_code" property="orderCode" jdbcType="BIGINT"/>
<result column="uid" property="uid" jdbcType="INTEGER"/>
<result column="express_number" property="expressNumber" jdbcType="VARCHAR"/>
<result column="order_type" property="orderType" jdbcType="TINYINT"/>
<result column="is_invoice" property="isInvoice" jdbcType="CHAR"/>
<result column="invoices_type" property="invoicesType" jdbcType="VARCHAR"/>
<result column="invoices_payable" property="invoicesPayable" jdbcType="VARCHAR"/>
<result column="yoho_coin_num" property="yohoCoinNum" jdbcType="SMALLINT"/>
<result column="payment_type" property="paymentType" jdbcType="TINYINT"/>
<result column="payment" property="payment" jdbcType="TINYINT"/>
<result column="bank_code" property="bankCode" jdbcType="VARCHAR"/>
<result column="payment_status" property="paymentStatus" jdbcType="CHAR"/>
<result column="shipping_type_id" property="shippingTypeId" jdbcType="TINYINT"/>
<result column="shipping_cost" property="shippingCost" jdbcType="DECIMAL"/>
<result column="express_id" property="expressId" jdbcType="TINYINT"/>
<result column="user_name" property="userName" jdbcType="VARCHAR"/>
<result column="phone" property="phone" jdbcType="VARCHAR"/>
<result column="mobile" property="mobile" jdbcType="VARCHAR"/>
<result column="area_code" property="areaCode" jdbcType="INTEGER"/>
<result column="address" property="address" jdbcType="VARCHAR"/>
<result column="zip_code" property="zipCode" jdbcType="INTEGER"/>
<result column="remark" property="remark" jdbcType="VARCHAR"/>
<result column="receiving_time" property="receivingTime" jdbcType="INTEGER"/>
<result column="receipt_time" property="receiptTime" jdbcType="VARCHAR"/>
<result column="exception_status" property="exceptionStatus" jdbcType="TINYINT"/>
<result column="is_lock" property="isLock" jdbcType="CHAR"/>
<result column="is_arrive" property="isArrive" jdbcType="CHAR"/>
<result column="status" property="status" jdbcType="TINYINT"/>
<result column="is_cancel" property="isCancel" jdbcType="CHAR"/>
<result column="cancel_type" property="cancelType" jdbcType="TINYINT"/>
<result column="exchange_status" property="exchangeStatus" jdbcType="TINYINT"/>
<result column="refund_status" property="refundStatus" jdbcType="TINYINT"/>
<result column="arrive_time" property="arriveTime" jdbcType="INTEGER"/>
<result column="shipment_time" property="shipmentTime" jdbcType="INTEGER"/>
<result column="create_time" property="createTime" jdbcType="INTEGER"/>
<result column="amount" property="amount" jdbcType="DECIMAL"/>
<result column="is_print_price" property="isPrintPrice" jdbcType="CHAR"/>
<result column="is_pre_contact" property="isPreContact" jdbcType="CHAR"/>
<result column="is_need_rapid" property="isNeedRapid" jdbcType="CHAR"/>
<result column="update_time" property="updateTime" jdbcType="INTEGER"/>
<result column="attribute" property="attribute" jdbcType="TINYINT"/>
<result column="is_payed" property="isPayed" jdbcType="CHAR"/>
<result column="activities_id" property="activitiesId" jdbcType="SMALLINT"/>
<result column="parent_order_code" property="parentOrderCode" jdbcType="BIGINT"/>
<result column="orders_status" property="ordersStatus" jdbcType="TINYINT"/>
<result column="province" property="province" jdbcType="VARCHAR"/>
<result column="user_level" property="userLevel" jdbcType="TINYINT"/>
<result column="is_jit" property="isJit" jdbcType="CHAR"/>
<result column="email" property="email" jdbcType="VARCHAR"/>
<result column="city" property="city" jdbcType="VARCHAR"/>
<result column="district" property="district" jdbcType="VARCHAR"/>
<result column="is_multi_package" property="isMultiPackage" jdbcType="CHAR"/>
<result column="is_advance" property="isAdvance" jdbcType="CHAR"/>
<result column="deliver_yoho_coin" property="deliverYohoCoin" jdbcType="INTEGER"/>
<result column="is_jit_already_split" property="isJitAlreadySplit" jdbcType="CHAR"/>
<result column="is_blk" property="isBlk" jdbcType="CHAR"/>
<id column="id" property="id" jdbcType="INTEGER" />
<result column="order_code" property="orderCode" jdbcType="BIGINT" />
<result column="uid" property="uid" jdbcType="INTEGER" />
<result column="user_level" property="userLevel" jdbcType="TINYINT" />
<result column="parent_order_code" property="parentOrderCode" jdbcType="BIGINT" />
<result column="order_amount" property="orderAmount" jdbcType="DECIMAL" />
<result column="last_order_amount" property="lastOrderAmount" jdbcType="DECIMAL" />
<result column="express_number" property="expressNumber" jdbcType="VARCHAR" />
<result column="order_type" property="orderType" jdbcType="TINYINT" />
<result column="yoho_coin_num" property="yohoCoinNum" jdbcType="INTEGER" />
<result column="payment_status" property="paymentStatus" jdbcType="TINYINT" />
<result column="payment_type" property="paymentType" jdbcType="TINYINT" />
<result column="payment" property="payment" jdbcType="TINYINT" />
<result column="shipping_cost" property="shippingCost" jdbcType="DECIMAL" />
<result column="remark" property="remark" jdbcType="VARCHAR" />
<result column="order_status" property="orderStatus" jdbcType="INTEGER" />
<result column="new_user_orders" property="newUserOrders" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List">
id, order_code, uid, express_number, order_type, is_invoice, invoices_type, invoices_payable,
yoho_coin_num, payment_type, payment, bank_code, payment_status, shipping_type_id,
shipping_cost, express_id, user_name, phone, mobile, area_code, address, zip_code,
remark, receiving_time, receipt_time, exception_status, is_lock, is_arrive, status,
is_cancel, cancel_type, exchange_status, refund_status, arrive_time, shipment_time,
create_time, amount, is_print_price, is_pre_contact, is_need_rapid, update_time,
attribute, is_payed, activities_id, parent_order_code, orders_status,province, user_level,
is_jit, email, city, district, is_multi_package, is_advance, deliver_yoho_coin, is_jit_already_split,is_blk
id, order_code, uid, user_level, parent_order_code, order_amount,
last_order_amount, express_number,order_type,
yoho_coin_num, payment_status, payment_type,
payment, shipping_cost, remark,
order_status,new_user_orders
</sql>
... ... @@ -79,6 +36,13 @@
from orders
where order_code = #{orderCode,jdbcType=BIGINT} and uid = #{uid,jdbcType=INTEGER}
</select>
<select id="selectByOrderCode" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from orders
where order_code = #{orderCode,jdbcType=BIGINT}
</select>
<select id="selectCountShipStatusOrderSince" resultType="java.lang.Integer">
select count(1)
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yoho.unions.dal.OrdersCouponsMapper" >
<resultMap id="BaseResultMap" type="com.yoho.unions.dal.model.OrdersCoupons" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="order_code" property="orderCode" jdbcType="BIGINT" />
<result column="coupon_id" property="couponId" jdbcType="INTEGER" />
<result column="coupon_code" property="couponCode" jdbcType="VARCHAR" />
<result column="coupon_amount" property="couponAmount" jdbcType="DECIMAL" />
<result column="coupon_adjust_amount" property="couponAdjustAmount" jdbcType="DECIMAL" />
<result column="coupon_title" property="couponTitle" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, order_code, coupon_id, coupon_code, coupon_amount, coupon_adjust_amount, coupon_title,
create_time
</sql>
<select id="selectByOrderCode" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from orders_coupons
where order_code = #{orderCode,jdbcType=BIGINT}
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -339,4 +339,40 @@
#{code}
</foreach>
</select>
<select id="selectCount" resultType="java.lang.Integer">
select count(1) from user_orders where 1 = 1
<if test="orderCode != 0" >
and order_code = #{orderCode}
</if>
<if test="unionId != 0" >
and uid = #{unionId}
</if>
<if test="beginTime != 0" >
and create_time &gt; #{beginTime}
</if>
<if test="endTime != 0" >
and create_time &lt;#{endTime}
</if>
</select>
<select id="selectUserOrderList" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from user_orders
where 1=1
<if test="orderCode != 0" >
and order_code = #{orderCode}
</if>
<if test="unionId != 0" >
and uid = #{unionId}
</if>
<if test="beginTime != 0" >
and create_time &gt; #{beginTime}
</if>
<if test="endTime != 0" >
and create_time &lt;#{endTime}
</if>
limit #{startIndex},#{pageSize}
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -5,7 +5,7 @@
<parent>
<groupId>com.yoho</groupId>
<artifactId>parent</artifactId>
<version>1.2.4-SNAPSHOT</version>
<version>1.2.5-SNAPSHOT</version>
</parent>
<groupId>com.yoho.dsf</groupId>
<artifactId>yoho-unions</artifactId>
... ...
... ... @@ -4,10 +4,14 @@ import com.alibaba.fastjson.JSONObject;
import com.yoho.service.model.union.request.ActiveUnionRequestBO;
import com.yoho.service.model.union.request.AddUnionRequestBO;
import com.yoho.service.model.union.request.ClickUnionRequestBO;
import com.yoho.service.model.union.request.UnionOrderReqBO;
import com.yoho.service.model.union.response.ActiveUnionResponseBO;
import com.yoho.service.model.union.response.PageUnionOrderRspBO;
import com.yoho.service.model.union.response.UnionResponse;
import com.yoho.service.model.union.response.UnionResponseBO;
import com.yoho.unions.common.ApiResponse;
import com.yoho.unions.server.service.DingdangService;
import com.yoho.unions.server.service.IUnionOrderService;
import com.yoho.unions.server.service.MainUnionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -27,6 +31,8 @@ public class UnionRest {
MainUnionService dDServiceImpl;
@Resource
DingdangService dingdangService;
@Resource
IUnionOrderService unionOrderService;
/**
* 添加顶当
... ... @@ -103,4 +109,20 @@ public class UnionRest {
log.info("Enter addYas UnionType is {}",request.getUnion_type());
return dingdangService.addYas(request);
}
@RequestMapping("/queryUnionOrders")
@ResponseBody
public ApiResponse queryUnionOrders(UnionOrderReqBO reqBO){
log.info("enter queryUnionOrders. param unionLogsReqBO={}", reqBO);
if(reqBO==null){
return new ApiResponse.ApiResponseBuilder().code(500).message("缺少参数").build();
}
try{
PageUnionOrderRspBO unionOrderRspBO = unionOrderService.queryUnionOrders(reqBO);
return new ApiResponse.ApiResponseBuilder().code(200).message("查询联盟订单").data(unionOrderRspBO).build();
}catch (Exception e){
log.warn("queryUnionOrders error exception is {}",e);
return new ApiResponse.ApiResponseBuilder().code(500).message("失败").build();
}
}
}
... ...
package com.yoho.unions.server.service;
import com.yoho.service.model.union.request.UnionLogsReqBO;
import com.yoho.service.model.union.request.UnionOrderReqBO;
import com.yoho.service.model.union.response.PageUnionClickLogsRspBO;
import com.yoho.service.model.union.response.PageUnionOrderRspBO;
import com.yoho.unions.vo.OrderInfo;
import com.yoho.unions.vo.TransInfo;
import com.yoho.unions.vo.UnionOrderReqVO;
... ... @@ -12,4 +16,6 @@ public interface IUnionOrderService {
public List<TransInfo> getTrandInfo(UnionOrderReqVO req);
PageUnionOrderRspBO queryUnionOrders(UnionOrderReqBO reqBO);
}
... ...
package com.yoho.unions.server.service.impl;
import com.yoho.service.model.union.UnionTrans;
import com.yoho.service.model.union.request.UnionLogsReqBO;
import com.yoho.service.model.union.request.UnionOrderReqBO;
import com.yoho.service.model.union.response.PageUnionActivityLogsRspBO;
import com.yoho.service.model.union.response.PageUnionOrderRspBO;
import com.yoho.service.model.union.response.UnionActivityLogsRspBO;
import com.yoho.service.model.union.response.UnionOrderRspBO;
import com.yoho.unions.common.enums.NewUserEnum;
import com.yoho.unions.common.enums.OrderStatusEnum;
import com.yoho.unions.common.enums.PaymentTypeEnum;
import com.yoho.unions.common.redis.RedisHashCache;
import com.yoho.unions.common.redis.RedisListCache;
import com.yoho.unions.dal.model.UnionActivityTrans;
import com.yoho.unions.dal.model.UnionOrders;
import com.yoho.unions.dal.model.UnionOrdersGoods;
import com.yoho.unions.common.utils.DateUtil;
import com.yoho.unions.dal.IOrdersMapper;
import com.yoho.unions.dal.IUserOrdersDAO;
import com.yoho.unions.dal.OrdersCouponsMapper;
import com.yoho.unions.dal.model.*;
import com.yoho.unions.server.service.IUnionOrderService;
import com.yoho.unions.vo.OrderInfo;
import com.yoho.unions.vo.OrdersGood;
... ... @@ -43,6 +54,14 @@ public class UnionOrderServiceImpl implements IUnionOrderService {
@Autowired
private RedisHashCache redisHashCache;
@Autowired
IUserOrdersDAO userOrdersDAO;
@Autowired
IOrdersMapper ordersMapper;
@Autowired
OrdersCouponsMapper ordersCouponsMapper;
@Override
public List<OrderInfo> getUnionOrders(UnionOrderReqVO req) {
logger.info("Enter getUnionOrders: request param is {}", req);
... ... @@ -202,4 +221,66 @@ public class UnionOrderServiceImpl implements IUnionOrderService {
}
return resList;
}
public PageUnionOrderRspBO queryUnionOrders(UnionOrderReqBO reqBO){
// Integer beginTime = reqBO.getBeginTime()==0?null:reqBO.getBeginTime();
// Integer endTime = reqBO.getEndTime()==0?null:reqBO.getEndTime();
// Integer orderCode = reqBO.getOrderCode()==0?null:reqBO.getOrderCode();
// Integer unionId = reqBO.getUnionId()==0?null:reqBO.getUnionId();
int beginTime = reqBO.getBeginTime();
int endTime = reqBO.getEndTime();
int orderCode = reqBO.getOrderCode();
int unionId = reqBO.getUnionId();
String unionType = StringUtils.isBlank(reqBO.getUnionType()) ? null : reqBO.getUnionType();
//查询总数
int count = userOrdersDAO.selectCount(beginTime,endTime,orderCode,unionId);
logger.info("userOrdersDAO.selectCount: size is {}", count);
List<UserOrders> userOrdersList = new ArrayList<>();
List<UnionOrderRspBO> unionOrderRspBOList = new ArrayList<>();
if(count>0){
userOrdersList = userOrdersDAO.selectUserOrderList(beginTime,endTime,orderCode,unionId,reqBO.getStart(),reqBO.getSize());
}
for(UserOrders userOrders:userOrdersList){
//根据查询出来的uid,ordercode,查询ERP_ORDERS.Orders
// Orders orders = ordersMapper.selectByUidAndOrderCode(userOrders.getuId(),Long.valueOf(userOrders.getOrderCode()));
Orders orders = ordersMapper.selectByOrderCode(Long.valueOf(userOrders.getOrderCode()));
UnionOrderRspBO orderRspBO = new UnionOrderRspBO();
//优惠券金额
OrdersCoupons ordersCoupons = ordersCouponsMapper.selectByOrderCode(Long.valueOf(userOrders.getOrderCode()));
if(null!=ordersCoupons){
orderRspBO.setCouponAmount(ordersCoupons.getCouponAmount());
}else{
orderRspBO.setCouponAmount(new BigDecimal(0));
}
//订单金额
orderRspBO.setOrderAmount(orders.getOrderAmount());
orderRspBO.setYohoCoinNum(orders.getYohoCoinNum());
//运费
orderRspBO.setShipmentAmount(orders.getShippingCost());
//实际支付金额
orderRspBO.setRealPayAmount(orders.getLastOrderAmount());
//订单状态
orderRspBO.setOrderStatus(OrderStatusEnum.getNameByCode(String.valueOf(orders.getOrderStatus())));
//附加信息
orderRspBO.setExetInfmoation(orders.getRemark());
//支付方式
orderRspBO.setPayChannel(PaymentTypeEnum.getNameByCode(String.valueOf(orders.getPaymentType())));
//是否新客
orderRspBO.setIsNew(NewUserEnum.getNameByCode(orders.getNewUserOrders()));
orderRspBO.setOrderCode(Integer.valueOf(userOrders.getOrderCode()));
orderRspBO.setId(userOrders.getId());
orderRspBO.setOrderTime(DateUtil.long2DateStr(Long.valueOf(userOrders.getCreateTime())*Long.valueOf(1000),"yyyy-MM-dd"));
orderRspBO.setUnionId(Integer.valueOf(userOrders.getUid()));
orderRspBO.setUid(orders.getUid());
unionOrderRspBOList.add(orderRspBO);
}
PageUnionOrderRspBO pageUnionOrderRspBO = new PageUnionOrderRspBO();
pageUnionOrderRspBO.setList(unionOrderRspBOList);
pageUnionOrderRspBO.setTotal(count);
pageUnionOrderRspBO.setSize(reqBO.getSize());
pageUnionOrderRspBO.setPage(reqBO.getPage());
return pageUnionOrderRspBO;
}
}
... ...
... ... @@ -46,7 +46,7 @@ public class GdtTransTask {
@Resource
IUnionConfigDAO unionConfigDAO;
@Scheduled(cron = "0 0/6 * * * ?")
// @Scheduled(cron = "0 0/6 * * * ?")
public void run() {
UnionOrderReqVO reqVO = new UnionOrderReqVO();
reqVO.setLimit(10);
... ...
... ... @@ -86,5 +86,7 @@ datasources:
daos:
- com.yoho.unions.dal.ErpOrdersMapper
- com.yoho.unions.dal.ErpOrdersGoodsMapper
- com.yoho.unions.dal.IOrdersMapper
- com.yoho.unions.dal.OrdersCouponsMapper
readOnlyInSlave: true
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Yoho!Buy运营平台</title>
<script src="/union/js/include.js"></script>
<script src="/union/js/ajaxfileupload.js"></script>
</head>
<body class="easyui-layout" fit="true">
<div region="north" style="padding-bottom: 35px; height: auto;">
<script>
document.write(addHead('市场管理', '联盟订单管理'));
</script>
<style>
.div_search input { margin-top: 20px; }
.div_search .textbox { margin-top: 20px; }
.div_search .easyui-linkbutton { margin-top: 20px; }
</style>
<label>开始时间:</label>
<input class="easyui-datetimebox" id="beginTime">
</input>
<label>结束时间:</label>
<input class="easyui-datetimebox" id="endTime">
</input>
<label>订单号:</label>
<input class="easyui-textbox" id="orderCode">
</input>
<label>联盟用户ID:</label>
<input class="easyui-textbox" id="unionId">
</input>
<label>渠道:</label>
<input class="easyui-textbox" id="unionType">
</input>
<a id="searchBtn" class="btn-info">查询</a>
</div>
<div region="center">
<div style="margin-left: 30px;margin-top: 20px; height: 500px;">
<table id="userOrdersTable"></table>
</div>
</div>
<script type="text/javascript">
$(function () {
$("#userOrdersTable").myDatagrid({
fit: true,
fitColumns: true,
//queryParams: param,
nowrap: false,
url: contextPath + "/UnionRest/queryUnionOrders",
method: 'POST',
loadFilter: function (data) {
var temp = defaultLoadFilter(data);
temp.rows = temp.list;
return temp;
},
columns: [[{
title: "ID",
field: "id",
width: 70,
align: "center"
}, {
title: "联盟用户ID",
field: "unionId",
width: 170,
align: "center"
}, {
title: "下单时间",
field: "orderTime",
width: 170,
align: "center"
}, {
title: "订单号",
field: "orderCode",
width: 170,
align: "center"
}, {
title: "订单用户ID",
field: "uid",
width: 170,
align: "center"
}, {
title: "订单金额",
field: "orderAmount",
width: 170,
align: "center"
}, {
title: "优惠券金额",
field: "couponAmount",
width: 170,
align: "center"
}, {
title: "YOHO币",
field: "yohoCoinNum",
width: 170,
align: "center"
}, {
title: "运费",
field: "shipmentAmount",
width: 170,
align: "center"
}, {
title: "实付金额",
field: "realPayAmount",
width: 170,
align: "center"
}, {
title: "订单状态",
field: "orderStatus",
width: 170,
align: "center"
}, {
title: "渠道",
field: "unionType",
width: 170,
align: "center"
}, {
title: "附加信息",
field: "exetInfmoation",
width: 170,
align: "center"
}, {
title: "支付方式",
field: "payChannel",
width: 170,
align: "center"
}, {
title: "是否新客",
field: "isNew",
width: 170,
align: "center"
}
]],
cache: false,
pagination: true,
pageSize: 10,
pageList: [10],
idField: "id",
singleSelect: false,
checkOnSelect: false,
onLoadSuccess: function (data) {
$(this).myDatagrid("getPanel").find("a[role='delete']").linkbutton({
iconCls: "icon-more",
onClick: function () {
deleteBlack($(this).attr("dataId"));
}
});
}
});
$("#searchBtn").linkbutton({
iconCls: "icon-search",
text: "查询",
onClick: function () {
var param = {};
$("#userOrdersTable").myDatagrid("load", param);
}
});
});
</script>
</body>
</html>
\ No newline at end of file
... ...