Authored by Lixiaodi

鉴定后台

package com.yoho.order.dal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
... ... @@ -19,4 +21,15 @@ public interface AppraiseOrderMapper {
int selectCountByStatusAndDepotNo(@Param("list")List<Byte> statusList, @Param("depotNo")Integer depotNo, @Param("platformExpressInfoFlag")String platformExpressInfoFlag);
int selectTotalByCondition(@Param("appraiseOrderReq") AppraiseOrderReq req);
int selectParentListCount(AppraiseOrderReq req);
List<AppraiseOrder> selectParentList(AppraiseOrderReq req);
int selectSonListCount(AppraiseOrderReq req);
List<AppraiseOrder> selectSonList(AppraiseOrderReq req);
List<Map<String, Object>> selectCountInfo(String orderCode);
}
... ...
package com.yoho.order.dal;
import com.yoho.order.model.AppraiseOrderMeta;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface AppraiseOrderMetaMapper {
int deleteByPrimaryKey(Integer id);
int insert(AppraiseOrderMeta record);
int insertSelective(AppraiseOrderMeta record);
AppraiseOrderMeta selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(AppraiseOrderMeta record);
int updateByPrimaryKey(AppraiseOrderMeta record);
List<AppraiseOrderMeta> selectFeeByOrderCodes(@Param("orderCodeList") List<String> orderCodeList);
AppraiseOrderMeta selectAddress(String orderCode);
}
\ No newline at end of file
... ...
package com.yoho.order.dal;
import com.yoho.order.model.OrdersPayRefund;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface OrdersPayRefundMapper {
int deleteByPrimaryKey(Integer id);
int insert(OrdersPayRefund record);
int insertSelective(OrdersPayRefund record);
OrdersPayRefund selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(OrdersPayRefund record);
int updateByPrimaryKey(OrdersPayRefund record);
List<OrdersPayRefund> selectByRefundCodes(@Param("orderCodeList") List<String> orderCodeList);
}
\ No newline at end of file
... ...
package com.yoho.order.model;
public class AppraiseOrderMeta {
private Integer id;
private Integer uid;
private Long orderCode;
private Integer storageId;
private String metaKey;
private String metaValue;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUid() {
return uid;
}
public void setUid(Integer uid) {
this.uid = uid;
}
public Long getOrderCode() {
return orderCode;
}
public void setOrderCode(Long orderCode) {
this.orderCode = orderCode;
}
public Integer getStorageId() {
return storageId;
}
public void setStorageId(Integer storageId) {
this.storageId = storageId;
}
public String getMetaKey() {
return metaKey;
}
public void setMetaKey(String metaKey) {
this.metaKey = metaKey == null ? null : metaKey.trim();
}
public String getMetaValue() {
return metaValue;
}
public void setMetaValue(String metaValue) {
this.metaValue = metaValue == null ? null : metaValue.trim();
}
}
\ No newline at end of file
... ...
... ... @@ -32,4 +32,12 @@ public class AppraiseOrderReq extends PageRequestBO{
private String platformExpressInfoFlag;
private String sortRule;
private Integer uid;
private String buyStartTimeStr;
private String buyEndTimeStr;
private Integer buyStartTime;
private Integer buyEndTime;
}
... ...
... ... @@ -34,5 +34,44 @@ public class AppraiseOrderResp extends PageRequestBO{
private Integer attributes;
private String attributesStr;
private Integer uid;
private String amount;
private String createTimeStr;
private Integer clientType;
private Integer payment;
private String imageUrl;
private String colorName;
private String avgPrice7Day;
private String usedAmount;
private String backAmount;
private String packageFee;
private String appraiseFee;
private String storageManagementFee;
private String deliverTimeStr;
private String expressNumber;
private String userName;
private String mobile;
private String backAddress;
private String backAddressDetail;
private String backMobile;
private String userDegree;
private int count;
private int receiveCount;
private int unReceiveCount;
private int appraiseOkCount;
private int appraiseBadCount;
private int appraiseFaultCount;
private int noAppraiseCount;
}
... ...
package com.yoho.order.model;
import java.math.BigDecimal;
public class OrdersPayRefund {
private Integer id;
private Long orderCode;
private Integer orderType;
private String serialNo;
private BigDecimal amount;
private Byte status;
private Integer createTime;
private Integer updateTime;
private String refundCode;
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 getOrderType() {
return orderType;
}
public void setOrderType(Integer orderType) {
this.orderType = orderType;
}
public String getSerialNo() {
return serialNo;
}
public void setSerialNo(String serialNo) {
this.serialNo = serialNo == null ? null : serialNo.trim();
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public Byte getStatus() {
return status;
}
public void setStatus(Byte status) {
this.status = status;
}
public Integer getCreateTime() {
return createTime;
}
public void setCreateTime(Integer createTime) {
this.createTime = createTime;
}
public Integer getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Integer updateTime) {
this.updateTime = updateTime;
}
public String getRefundCode() {
return refundCode;
}
public void setRefundCode(String refundCode) {
this.refundCode = refundCode == null ? null : refundCode.trim();
}
}
\ No newline at end of file
... ...
... ... @@ -142,5 +142,48 @@
</if>
</if>
</sql>
<select id="selectCountInfo" resultType="java.util.HashMap">
select status, count(*) as num from appraise_order where parent_order_code = #{orderCode} and attributes = 7
</select>
<select id="selectParentListCount" resultType="java.lang.Integer">
select count(*) from appraise_order
where <include refid="list_condition"/>
</select>
<select id="selectParentList" resultMap="BaseResultMap">
select * from appraise_order
where <include refid="list_condition"/> order by create_time desc limit #{start}, #{size}
</select>
<sql id="list_condition" >
parent_order_code is null and attributes = 7
<if test="statusList != null and statusList.size()>0">
and status in
<foreach collection="statusList" item="status" open="(" close=")" separator=",">
#{status}
</foreach>
</if>
<if test="orderCode != null and orderCode !=''">
and order_code = #{orderCode}
</if>
<if test="uid != null">
and uid = #{uid}
</if>
<if test="buyStartTime != null">
and create_time &gt;= #{buyStartTime}
</if>
<if test="buyEndTime != null">
and create_time &lt;= #{buyEndTime}
</if>
</sql>
<select id="selectSonListCount" resultType="java.lang.Integer">
select count(*) from appraise_order where parent_order_code = #{orderCode}
</select>
<select id="selectSonList" resultMap="BaseResultMap">
select * from appraise_order where parent_order_code = #{orderCode} order by create_time desc limit #{start}, #{size}
</select>
</mapper>
\ No newline at end of file
... ...
<?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.order.dal.AppraiseOrderMetaMapper" >
<resultMap id="BaseResultMap" type="com.yoho.order.model.AppraiseOrderMeta" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="uid" property="uid" jdbcType="INTEGER" />
<result column="order_code" property="orderCode" jdbcType="BIGINT" />
<result column="storage_id" property="storageId" jdbcType="INTEGER" />
<result column="meta_key" property="metaKey" jdbcType="VARCHAR" />
<result column="meta_value" property="metaValue" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, uid, order_code, storage_id, meta_key, meta_value
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from appraise_order_meta
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from appraise_order_meta
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.order.model.AppraiseOrderMeta" >
insert into appraise_order_meta (id, uid, order_code,
storage_id, meta_key, meta_value
)
values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=INTEGER}, #{orderCode,jdbcType=BIGINT},
#{storageId,jdbcType=INTEGER}, #{metaKey,jdbcType=VARCHAR}, #{metaValue,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.yoho.order.model.AppraiseOrderMeta" >
insert into appraise_order_meta
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="uid != null" >
uid,
</if>
<if test="orderCode != null" >
order_code,
</if>
<if test="storageId != null" >
storage_id,
</if>
<if test="metaKey != null" >
meta_key,
</if>
<if test="metaValue != null" >
meta_value,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="uid != null" >
#{uid,jdbcType=INTEGER},
</if>
<if test="orderCode != null" >
#{orderCode,jdbcType=BIGINT},
</if>
<if test="storageId != null" >
#{storageId,jdbcType=INTEGER},
</if>
<if test="metaKey != null" >
#{metaKey,jdbcType=VARCHAR},
</if>
<if test="metaValue != null" >
#{metaValue,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.order.model.AppraiseOrderMeta" >
update appraise_order_meta
<set >
<if test="uid != null" >
uid = #{uid,jdbcType=INTEGER},
</if>
<if test="orderCode != null" >
order_code = #{orderCode,jdbcType=BIGINT},
</if>
<if test="storageId != null" >
storage_id = #{storageId,jdbcType=INTEGER},
</if>
<if test="metaKey != null" >
meta_key = #{metaKey,jdbcType=VARCHAR},
</if>
<if test="metaValue != null" >
meta_value = #{metaValue,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yoho.order.model.AppraiseOrderMeta" >
update appraise_order_meta
set uid = #{uid,jdbcType=INTEGER},
order_code = #{orderCode,jdbcType=BIGINT},
storage_id = #{storageId,jdbcType=INTEGER},
meta_key = #{metaKey,jdbcType=VARCHAR},
meta_value = #{metaValue,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectFeeByOrderCodes" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from appraise_order_meta where order_code in
<foreach collection="orderCodeList" item="orderCode" open="(" close=")" separator=",">
#{orderCode}
</foreach>
and meta_key = 'fee'
</select>
<select id="selectAddress" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from appraise_order_meta where order_code = #{orderCode} and meta_key = 'back_delivery_address' limit 1
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -19,7 +19,7 @@
<select id="selectByOrderCodes" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from appraise_order where order_code in
from appraise_order_storage where order_code in
<foreach collection="list" item="orderCode" open="(" close=")" separator=",">
#{orderCode}
</foreach>
... ...
<?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.order.dal.OrdersPayRefundMapper" >
<resultMap id="BaseResultMap" type="com.yoho.order.model.OrdersPayRefund" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="order_code" property="orderCode" jdbcType="BIGINT" />
<result column="order_type" property="orderType" jdbcType="INTEGER" />
<result column="serial_no" property="serialNo" jdbcType="VARCHAR" />
<result column="amount" property="amount" jdbcType="DECIMAL" />
<result column="status" property="status" jdbcType="TINYINT" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="update_time" property="updateTime" jdbcType="INTEGER" />
<result column="refund_code" property="refundCode" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, order_code, order_type, serial_no, amount, status, create_time, update_time,
refund_code
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from orders_pay_refund
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from orders_pay_refund
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.yoho.order.model.OrdersPayRefund" >
insert into orders_pay_refund (id, order_code, order_type,
serial_no, amount, status,
create_time, update_time, refund_code
)
values (#{id,jdbcType=INTEGER}, #{orderCode,jdbcType=BIGINT}, #{orderType,jdbcType=INTEGER},
#{serialNo,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{status,jdbcType=TINYINT},
#{createTime,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER}, #{refundCode,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.yoho.order.model.OrdersPayRefund" >
insert into orders_pay_refund
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="orderCode != null" >
order_code,
</if>
<if test="orderType != null" >
order_type,
</if>
<if test="serialNo != null" >
serial_no,
</if>
<if test="amount != null" >
amount,
</if>
<if test="status != null" >
status,
</if>
<if test="createTime != null" >
create_time,
</if>
<if test="updateTime != null" >
update_time,
</if>
<if test="refundCode != null" >
refund_code,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="orderCode != null" >
#{orderCode,jdbcType=BIGINT},
</if>
<if test="orderType != null" >
#{orderType,jdbcType=INTEGER},
</if>
<if test="serialNo != null" >
#{serialNo,jdbcType=VARCHAR},
</if>
<if test="amount != null" >
#{amount,jdbcType=DECIMAL},
</if>
<if test="status != null" >
#{status,jdbcType=TINYINT},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=INTEGER},
</if>
<if test="updateTime != null" >
#{updateTime,jdbcType=INTEGER},
</if>
<if test="refundCode != null" >
#{refundCode,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.yoho.order.model.OrdersPayRefund" >
update orders_pay_refund
<set >
<if test="orderCode != null" >
order_code = #{orderCode,jdbcType=BIGINT},
</if>
<if test="orderType != null" >
order_type = #{orderType,jdbcType=INTEGER},
</if>
<if test="serialNo != null" >
serial_no = #{serialNo,jdbcType=VARCHAR},
</if>
<if test="amount != null" >
amount = #{amount,jdbcType=DECIMAL},
</if>
<if test="status != null" >
status = #{status,jdbcType=TINYINT},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=INTEGER},
</if>
<if test="updateTime != null" >
update_time = #{updateTime,jdbcType=INTEGER},
</if>
<if test="refundCode != null" >
refund_code = #{refundCode,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.yoho.order.model.OrdersPayRefund" >
update orders_pay_refund
set order_code = #{orderCode,jdbcType=BIGINT},
order_type = #{orderType,jdbcType=INTEGER},
serial_no = #{serialNo,jdbcType=VARCHAR},
amount = #{amount,jdbcType=DECIMAL},
status = #{status,jdbcType=TINYINT},
create_time = #{createTime,jdbcType=INTEGER},
update_time = #{updateTime,jdbcType=INTEGER},
refund_code = #{refundCode,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByRefundCodes" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from orders_pay_refund
where refund_code in
<foreach collection="orderCodeList" item="orderCode" open="(" close=")" separator=",">
#{orderCode}
</foreach>
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -2,6 +2,7 @@ package com.yoho.ufo.order.controller;
import java.util.Map;
import com.yoho.ufo.exception.PlatformException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -44,4 +45,30 @@ public class AppraiseOrderController {
return new ApiResponse.ApiResponseBuilder().code(200).message("查询成功").data(null == result ? new PageResponseBO<BuyerOrderResp>() : result).build();
}
@RequestMapping(value = "/list")
public ApiResponse list(AppraiseOrderReq req) {
LOGGER.info("appraiseOrder.list in. param is {}", req);
PageResponseBO<AppraiseOrderResp> result = null;
try {
result = appraiseOrderService.queryOrderList(req);
return new ApiResponse.ApiResponseBuilder().code(200).message("查询成功").data(result).build();
} catch (PlatformException e) {
return new ApiResponse(e.getCode(), e.getMessage(), null);
}
}
@RequestMapping(value = "/detailList")
public ApiResponse detailList(AppraiseOrderReq req) {
LOGGER.info("appraiseOrder.detailList in. param is {}", req);
PageResponseBO<AppraiseOrderResp> result = appraiseOrderService.queryOrderDetailList(req);
return new ApiResponse.ApiResponseBuilder().code(200).message("查询成功").data(result).build();
}
@RequestMapping(value = "/detailInfo")
public ApiResponse detailInfo(AppraiseOrderReq req) {
LOGGER.info("appraiseOrder.detailInfo in. param is {}", req);
AppraiseOrderResp result = appraiseOrderService.detailInfo(req);
return new ApiResponse.ApiResponseBuilder().code(200).message("查询成功").data(result).build();
}
}
... ...
... ... @@ -4,6 +4,8 @@ import java.util.Map;
import com.yoho.order.model.AppraiseOrderReq;
import com.yoho.order.model.AppraiseOrderResp;
import com.yoho.ufo.exception.PlatformException;
import com.yoho.ufo.service.model.ApiResponse;
import com.yoho.ufo.service.model.PageResponseBO;
public interface IAppraiseOrderService {
... ... @@ -11,4 +13,9 @@ public interface IAppraiseOrderService {
PageResponseBO<AppraiseOrderResp> queryOrderListByStatus(AppraiseOrderReq req);
PageResponseBO<AppraiseOrderResp> queryOrderList(AppraiseOrderReq req) throws PlatformException;
PageResponseBO<AppraiseOrderResp> queryOrderDetailList(AppraiseOrderReq req);
AppraiseOrderResp detailInfo(AppraiseOrderReq req);
}
... ...
package com.yoho.ufo.order.service.impl;
import java.util.List;
import java.util.Map;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yoho.core.rest.client.ServiceCaller;
import com.yoho.order.dal.*;
import com.yoho.order.model.*;
import com.yoho.ufo.exception.PlatformException;
import com.yoho.ufo.service.model.ApiResponse;
import com.yohobuy.ufo.model.order.common.AppraiseOrderStatus;
import org.apache.commons.collections.ArrayStack;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.common.collect.Lists;
import org.elasticsearch.common.collect.Maps;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.yoho.order.dal.AppraiseOrderGoodsMapper;
import com.yoho.order.dal.AppraiseOrderMapper;
import com.yoho.order.dal.AppraiseOrderStorageMapper;
import com.yoho.order.dal.ExpressRecordMapper;
import com.yoho.order.model.AppraiseOrder;
import com.yoho.order.model.AppraiseOrderGoods;
import com.yoho.order.model.AppraiseOrderReq;
import com.yoho.order.model.AppraiseOrderResp;
import com.yoho.order.model.AppraiseOrderStorage;
import com.yoho.order.model.ExpressRecord;
import com.yoho.ufo.order.constant.Constant;
import com.yoho.ufo.order.constant.OrderConfigConstant;
import com.yoho.ufo.order.service.IAppraiseOrderService;
... ... @@ -44,9 +48,29 @@ public class AppraiseOrderServiceImpl implements IAppraiseOrderService{
@Autowired
private AppraiseOrderStorageMapper appraiseOrderStorageMapper;
@Autowired
private AppraiseOrderMetaMapper appraiseOrderMetaMapper;
@Autowired
private ExpressRecordMapper expressRecordMapper;
@Autowired
private OrdersPayRefundMapper ordersPayRefundMapper;
@Autowired
private StoredSellerMapper storedSellerMapper;
@Value("${ip.port.uic.server}")
private String uicServerIpAndPort;
private static final String UIC_GETPROFILE_URL = "/uic/profile/getProfile";
private static final String UIC_GETUSERPROFILE_URL = "/uic/profile/getUserProfile";
@Autowired
private ServiceCaller serviceCaller;
//已收货
private static final Byte QC_STATUS_RECEIVED = 0;
... ... @@ -143,8 +167,188 @@ public class AppraiseOrderServiceImpl implements IAppraiseOrderService{
return result;
}
private PageResponseBO<AppraiseOrderResp> queryOrderListByStatusAndQueryStr(String queryStr, Integer depotNo,
@Override
public PageResponseBO<AppraiseOrderResp> queryOrderList(AppraiseOrderReq req) throws PlatformException {
Byte status = req.getStatus();
List<Byte> checkStatusList = Lists.newArrayList();
if (status != null && status >= 0) {
if (status == 101) {
checkStatusList = Arrays.asList((byte) 12, (byte) 14, (byte) 15, (byte) 23);
} else if (status == 102) {
checkStatusList = Arrays.asList((byte) 34, (byte) 13);
} else {
checkStatusList = Arrays.asList(status);
}
}
req.setStatusList(checkStatusList);
req.setBuyStartTime(parseTime(req.getBuyStartTimeStr()));
req.setBuyEndTime(parseTime(req.getBuyEndTimeStr()));
int count = appraiseOrderMapper.selectParentListCount(req);
PageResponseBO<AppraiseOrderResp> resp = new PageResponseBO<>();
resp.setTotal(count);
if (count == 0) {
resp.setList(Lists.newArrayList());
return resp;
}
req.setStart((req.getPage() - 1) * req.getSize());
List<AppraiseOrder> orderList = appraiseOrderMapper.selectParentList(req);
List<AppraiseOrderResp> respList = exchangeBo(orderList);
resp.setPage(req.getPage());
resp.setList(respList);
resp.setSize(req.getSize());
resp.setTotal(count);
return resp;
}
public AppraiseOrderResp detailInfo(AppraiseOrderReq req) {
AppraiseOrderResp result = new AppraiseOrderResp();
Integer uid = req.getUid();
String orderCode = req.getOrderCode();
List<Map<String, Object>> countInfo = appraiseOrderMapper.selectCountInfo(orderCode);
int count = 0;
for (Map<String, Object> record : countInfo) {
int c = ((Number) record.get("num")).intValue();
count += c;
if (record.get("status").toString().equals(Integer.toString(AppraiseOrderStatus.JUDGE_PASS.getCode()))) {
result.setAppraiseOkCount(c);
}
if (record.get("status").toString().equals(Integer.toString(AppraiseOrderStatus.CHECKING_FAKE.getCode()))) {
result.setAppraiseBadCount(c);
}
if (record.get("status").toString().equals(Integer.toString(AppraiseOrderStatus.CHECKING_FAKE.getCode()))) {
result.setAppraiseFaultCount(c);// TODO
}
if (record.get("status").toString().equals(Integer.toString(AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE.getCode()))) {
result.setNoAppraiseCount(c);
}
if (record.get("status").toString().equals(Integer.toString(AppraiseOrderStatus.SHAM_SEND_OUT.getCode()))) {
result.setUnReceiveCount(c);
}
}
result.setCount(count);
result.setReceiveCount(count - result.getUnReceiveCount());
//卖家信息
result.setUserName(getUserNameByUid(uid));
result.setMobile(getMobileByUid(uid));
result.setUid(uid);
AppraiseOrderMeta addressInfo = appraiseOrderMetaMapper.selectAddress(orderCode);
if (addressInfo != null) {
JSONObject jo = JSON.parseObject(addressInfo.getMetaValue());
result.setBackAddress(jo.getString("area"));
result.setBackAddressDetail(jo.getString("address"));
result.setBackMobile(jo.getString("mobile"));
}
StoredSeller storedSeller = storedSellerMapper.selectUid(uid);
if (storedSeller != null && storedSeller.getEntryType() != null) {
if (1 == storedSeller.getEntryType()) {
result.setUserDegree("入驻卖家");
} else if (2 == storedSeller.getEntryType()) {
result.setUserDegree("超级卖家");
}
} else {
result.setUserDegree("普通卖家");
}
List<ExpressRecord> expressRecordList = expressRecordMapper.selectByOrderCodeListAndType(Arrays.asList(orderCode), Lists.newArrayList(EnumExpressType.EXPRESS_TYPE_1.getCode()));
if (!expressRecordList.isEmpty()) {
result.setExpressNumber(expressRecordList.get(0).getWaybillCode());
result.setDeliverTimeStr(formatTime(expressRecordList.get(0).getCreateTime()));
}
return result;
}
@Override
public PageResponseBO<AppraiseOrderResp> queryOrderDetailList(AppraiseOrderReq req) {
long orderCode = Long.parseLong(req.getOrderCode());
int count = appraiseOrderMapper.selectSonListCount(req);
PageResponseBO<AppraiseOrderResp> resp = new PageResponseBO<>();
resp.setTotal(count);
if (count == 0) {
resp.setList(Lists.newArrayList());
return resp;
}
req.setStart((req.getPage() - 1) * req.getSize());
List<AppraiseOrder> orderList = appraiseOrderMapper.selectSonList(req);
List<AppraiseOrderGoods> goodsList = appraiseOrderGoodsMapper.selectByOrderCodes(orderList.stream().map(AppraiseOrder::getOrderCode).collect(Collectors.toList()));
List<AppraiseOrderStorage> storageList = appraiseOrderStorageMapper.selectByOrderCodes(orderList.stream().map(AppraiseOrder::getOrderCode).collect(Collectors.toList()));
List<AppraiseOrderMeta> feeList = appraiseOrderMetaMapper.selectFeeByOrderCodes(orderList.stream().map(AppraiseOrder::getOrderCode).collect(Collectors.toList()));
List<OrdersPayRefund> refundList = ordersPayRefundMapper.selectByRefundCodes(orderList.stream().map(AppraiseOrder::getOrderCode).collect(Collectors.toList()));
List<AppraiseOrderResp> respList = exchangeBo(orderList, goodsList, refundList, storageList, feeList);
resp.setPage(req.getPage());
resp.setList(respList);
resp.setSize(req.getSize());
resp.setTotal(count);
return resp;
}
private List<AppraiseOrderResp> exchangeBo(List<AppraiseOrder> orderList, List<AppraiseOrderGoods> goodsList, List<OrdersPayRefund> refundList, List<AppraiseOrderStorage> storageList, List<AppraiseOrderMeta> feeList) {
Map<String, AppraiseOrderStorage> storageMap = storageList.stream().collect(Collectors.toMap(AppraiseOrderStorage::getOrderCode, Function.identity()));
Map<String, AppraiseOrderGoods> goodsMap = goodsList.stream().collect(Collectors.toMap(AppraiseOrderGoods::getOrderCode, Function.identity()));
Map<Long, AppraiseOrderMeta> feeMap = feeList.stream().collect(Collectors.toMap(AppraiseOrderMeta::getOrderCode, Function.identity()));
Map<Long, OrdersPayRefund> refundMap = refundList.stream().collect(Collectors.toMap(OrdersPayRefund::getOrderCode, Function.identity()));
List<AppraiseOrderResp> result = Lists.newArrayList();
for(AppraiseOrder order : orderList) {
AppraiseOrderResp r = new AppraiseOrderResp();
BeanUtils.copyProperties(order, r);
AppraiseOrderStorage s = storageMap.get(order.getOrderCode());
if (s != null) {
BeanUtils.copyProperties(s, r);
}
AppraiseOrderGoods goods = goodsMap.get(order.getOrderCode());
if (goods != null) {
BeanUtils.copyProperties(goods, r);
}
AppraiseOrderMeta fee = feeMap.get(Long.parseLong(order.getOrderCode()));
if (fee != null) {
JSONObject j = JSON.parseObject(fee.getMetaValue());
r.setAvgPrice7Day(j.getString("prdPrice"));
r.setAppraiseFee(j.getJSONObject("platformFee").getString("appraiseFee"));
r.setPackageFee(j.getJSONObject("platformFee").getString("packageFee"));
r.setStorageManagementFee(j.getJSONObject("platformFee").getString("storageManagementFee"));
}
r.setAmount(order.getAmount().toString());
OrdersPayRefund refund = refundMap.get(Long.parseLong(order.getOrderCode()));
if (refund != null) {
r.setBackAmount(refund.getAmount().toString());
r.setUsedAmount(order.getAmount().subtract(refund.getAmount()).toString());
} else {
r.setBackAmount(BigDecimal.ZERO.toString());
r.setUsedAmount(order.getAmount().toString());
}
r.setCreateTimeStr(formatTime(order.getCreateTime()));
AppraiseOrderStatus status = AppraiseOrderStatus.getByCode(order.getStatus().intValue());
r.setStatusStr(status == null ? "" : status.getDesc());
result.add(r);
}
return result;
}
private List<AppraiseOrderResp> exchangeBo(List<AppraiseOrder> orderList) {
List<AppraiseOrderResp> result = Lists.newArrayList();
for(AppraiseOrder order : orderList) {
AppraiseOrderResp r = new AppraiseOrderResp();
BeanUtils.copyProperties(order, r);
r.setAmount(order.getAmount().toString());
r.setCreateTimeStr(formatTime(order.getCreateTime()));
AppraiseOrderStatus status = AppraiseOrderStatus.getByCode(order.getStatus().intValue());
r.setStatusStr(status == null ? "" : status.getDesc());
result.add(r);
}
return result;
}
private PageResponseBO<AppraiseOrderResp> queryOrderListByStatusAndQueryStr(String queryStr, Integer depotNo,
List<Byte> checkStatusList, String platformExpressInfoFlag, String sortRule){
//先按订单号来查
AppraiseOrderReq req = new AppraiseOrderReq();
... ... @@ -287,5 +491,58 @@ public class AppraiseOrderServiceImpl implements IAppraiseOrderService{
}
}
private String getUserNameByUid(Integer uid) {
Map<String,Integer> request = Collections.singletonMap("uid", uid);
String url = "http://" + uicServerIpAndPort + UIC_GETUSERPROFILE_URL;
JSONObject jsonObject;
try {
jsonObject = serviceCaller.post("uic.getUserProfileAction", url, request, JSONObject.class, null).get(1);
} catch (Exception e) {
LOGGER.error("call"+ url + " fail!!! uid is {}", uid);
return "";
}
if(null != jsonObject) {
return jsonObject.getString("profile_name");
}
return "";
}
private String getMobileByUid(Integer uid) {
LOGGER.info("call getMobileByUid uid is{}", uid);
Map<String,Integer> request = Collections.singletonMap("uid", uid);
String url = "http://" + uicServerIpAndPort + UIC_GETPROFILE_URL;
JSONObject jsonObject;
try {
jsonObject = serviceCaller.get("uic.getProfileAction", url, request, JSONObject.class, null).get(1);
} catch (Exception e) {
LOGGER.error("call"+ url + " fail!!! uid is {}", uid);
return "";
}
if(null == jsonObject.getJSONObject("data") || null == jsonObject.getJSONObject("data").getString("mobile_phone")) {
return "";
}
return jsonObject.getJSONObject("data").getString("mobile_phone");
}
private Integer parseTime(String time) throws PlatformException {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
if (StringUtils.isNotBlank(time)) {
return (int) (format.parse(time).getTime() / 1000);
}
return null;
} catch (ParseException e) {
throw new PlatformException("日期解析错误!", 400);
}
}
private String formatTime(Integer time) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (time != null && time > 0) {
return format.format(new Date(time * 1000L));
}
return "";
}
}
... ...
... ... @@ -65,6 +65,9 @@ datasources:
- com.yoho.order.dal.AbnormalOrderMapper
- com.yoho.order.dal.AppraiseOrderMapper
- com.yoho.order.dal.AppraiseOrderGoodsMapper
- com.yoho.order.dal.AppraiseOrderMetaMapper
- com.yoho.order.dal.AppraiseOrderStorageMapper
- com.yoho.order.dal.OrdersPayRefundMapper
ufo_resource:
servers:
... ...
... ... @@ -66,6 +66,9 @@ datasources:
- com.yoho.order.dal.AbnormalOrderMapper
- com.yoho.order.dal.AppraiseOrderMapper
- com.yoho.order.dal.AppraiseOrderGoodsMapper
- com.yoho.order.dal.AppraiseOrderMetaMapper
- com.yoho.order.dal.AppraiseOrderStorageMapper
- com.yoho.order.dal.OrdersPayRefundMapper
ufo_resource:
servers:
... ...
<!DOCTYPE html>
<div id="main" region="center" style="height:900px;">
<div id="tt" class="easyui-tabs" style="height:900px;">
<div title="订单信息" style="padding:20px;display:none;height:900px;">
<h2>卖家信息</h2>
<div style="margin-top: 20px;margin-left: 30px">
<table border="0" style="width:95%;margin-top:5px;line-height:30px;" id="tab1">
<tr>
<td>姓名:<span id="showUserName"></span></td>
<td>UID:<span id="showUid"></span></td>
<td>绑定手机号:<span id="showMobile"></span></td>
<td>发货单号:<span id="showExpressNumber"></span></td>
<td>发货时间:<span id="showDeliverTimeStr"></span></td>
</tr>
<tr>
<td>寄回地址:<span id="showBackAddress"></span></td>
<td>详细地址:<span id="showBackAddressDetail"></span></td>
<td>寄回手机号:<span id="showBackMobile"></span></td>
<td>邮政编码:<span id="showEx"></span></td>
<td>身份信息:<span id="showUserDegree"></span></td>
</tr>
</table>
</div>
<br/><br/><br/>
<h2>商品信息</h2>
<div style="margin-top: 20px;margin-left: 30px">
<table border="0" style="width:95%;margin-top:5px;line-height:30px;" id="tab2">
<tr>
<td>申请数量:<span id="showCount"></span></td>
<td>实到数量:<span id="showReceiveCount"></span></td>
<td>鉴定通过:<span id="showAppraiseOkCount"></span></td>
<td>鉴定为假:<span id="showAppraiseBadCount"></span></td>
<td>鉴定瑕疵:<span id="showAppraiseFaultCount"></span></td>
<td>无法鉴定:<span id="showNoAppraiseCount"></span></td>
</tr>
</table>
</div>
<br/><br/><br/>
<h2>订单信息</h2>
<div style="margin-top: 20px;margin-left: 30px;height:400px;">
<table id="orderDetailTable"></table>
</div>
</div>
<div title="物流信息" style="overflow:auto;padding:20px;display:none;">
<h2>卖家发货物流</h2>
<hr>
<table id="sellerExpressTable"></table>
<h2>平台发货物流/平台寄回物流</h2>
<hr>
<table id="platformExpressTable"></table>
</div>
<div title="操作记录" style="overflow:auto;padding:20px;display:none;">
<hr>
<table id="operateRecordTable"></table>
</div>
</div>
</div>
<script>
$(function () {
$('#tt').tabs({
border: false,
onSelect: function (title, index) {
if (index == 1) {
getExpressList(orderCode)
}
if (index == 2) {
getOperateRecord(orderCode)
}
}
});
// 隐藏域赋值
$.post(contextPath + "/appraiseOrder/detailInfo", {
orderCode: orderCode,
uid : uid
}, function (result) {
if (result.code == 200) {
var data = result.data;
$("#showDeliverTimeStr").text(data.deliverTimeStr);
$("#showExpressNumber").text(data.expressNumber);
$("#showUserName").text(data.userName);
$("#showUid").text(data.uid);
$("#showMobile").text(data.mobile);
$("#showBackAddress").text(data.backAddress);
$("#showBackAddressDetail").text(data.backAddressDetail);
$("#showBackMobile").text(data.backMobile);
$("#showUserDegree").text(data.userDegree);
$("#showCount").text(data.count);
$("#showReceiveCount").text(data.receiveCount);
$("#showAppraiseOkCount").text(data.appraiseOkCount);
$("#showAppraiseBadCount").text(data.appraiseBadCount);
$("#showAppraiseFaultCount").text(data.appraiseFaultCount);
$("#showNoAppraiseCount").text(data.noAppraiseCount);
$.parser.parse($("#trade").parent());
}
});
$("#orderDetailTable").myDatagrid({
fit: true,
fitColumns: true,
nowrap: false,
url: contextPath + "/appraiseOrder/detailList",
method: 'POST',
queryParams:{
orderCode: orderCode
},
loadFilter: function (data) {
var temp = defaultLoadFilter(data);
temp.rows = temp.list;
return temp;
},
columns: [[{
title: "子订单编号",
field: "orderCode",
width: 80,
align: "center"
}, {
title: "商品图片",
field: "imageUrl",
width: 80,
align: "center",
formatter: function (value, rowData) {
return '<img id="productImage" height="78px" width="78px" src="'+value+'" />';
}
}, {
title: "商品名称",
field: "productName",
width: 100,
align: "center"
}, {
title: "货号",
field: "productCode",
width: 80,
align: "center"
}, {
title: "颜色",
field: "colorName",
width: 50,
align: "center"
}, {
title: "尺码",
field: "sizeName",
width: 50,
align: "center"
}, {
title: "7天均价",
field: "avgPrice7Day",
width: 40,
align: "center"
}, {
title: "保证金",
field: "amount",
width: 100,
align: "center",
formatter: function (value, rowData) {
var str = "缴纳保证金:" + rowData.amount;
str += "<br/>退回保证金:" + rowData.backAmount;
str += "<br/>扣除保证金:" + rowData.usedAmount;
return str;
}
},{
title: "费用",
field: "fee",
width: 60,
align: "center",
formatter: function (value, rowData) {
var str = "包装费:" + rowData.packageFee;
str += "<br/>鉴定费:" + rowData.appraiseFee;
str += "<br/>仓储费:" + rowData.storageManagementFee;
return str;
}
},{
title: "状态",
field: "statusStr",
width: 60,
align: "center"
},{
title: "操作",
field: "operations",
width: 80,
align: "center",
formatter: function (value, rowData) {
var str = "<a role='viewOp' dataId='" + rowData.orderCode + "' style='margin-left:10px;background-color: #5bc0de'>操作记录</a>";
str += "<br/><a role='viewEx' dataId='" + rowData.orderCode + "' style='margin-left:10px;background-color: #5bc0de'>物流</a>";
if(rowData.status == "2") {
str = "<br/><a role='cancel' dataId='" + rowData.orderCode + "' style='margin-left:10px;background-color: #5bc0de'>取消订单</a>";
}
return str;
}
}]],
cache: false,
pagination: true,
pageSize: 10,
pageList: [10],
idField: "id",
singleSelect: false,
checkOnSelect: false,
onLoadSuccess: function () {
$(this).myDatagrid("getPanel").find("a[role='viewOp']").linkbutton({
iconCls: "icon-edit",
onClick: function () {
orderCode = $(this).attr("dataId");
getOperateRecord(orderCode);
$('#tt').tabs('select',"操作记录");
}
});
$(this).myDatagrid("getPanel").find("a[role='viewEx']").linkbutton({
iconCls: "icon-edit",
onClick: function () {
orderCode = $(this).attr("dataId");
getExpressList(orderCode);
$('#tt').tabs('select',"物流信息");
}
});
$(this).myDatagrid("getPanel").find("a[role='cancel']").linkbutton({
iconCls: "icon-edit",
onClick: function () {
orderCode = $(this).attr("dataId");
cancelSonOrder(orderCode);
}
});
}
});
function getOperateRecord(orderCode){
$("#operateRecordTable").myDatagrid({
fit: false,
fitColumns: true,
striped: true,
rownumbers:true,
url: contextPath + "/buyerOrder/queryOperateRecordList",
method: 'POST',
queryParams: {
orderCode: orderCode
},
loadFilter: function (data) {
var temp = defaultLoadFilter(data);
temp=null==temp?[]:temp;
temp.rows = temp.list;
return temp;
},
columns: [[{
title: "操作日志",
field: "typeStr",
width: 20,
align: "center"
}, {
title: "操作人",
field: "userName",
width: 20,
align: "center"
}, {
title: "处理时间",
field: "updateTimeStr",
width: 20,
align: "center"
}]],
cache: false,
pagination: false,
idField: "id",
singleSelect: true,
onLoadSuccess: function (data) {
if (data.total == 0) {
$(this).datagrid('appendRow', { type: '<div style="text-align:center;color:red">没有数据!</div>' }).datagrid('mergeCells', { index: 0, field: 'type', colspan: 3 })
}
}
});
}
function getExpressList(orderCode) {
$("#sellerExpressTable").datagrid({
fit: false,
fitColumns: true,
striped: true,
rownumbers:true,
url: contextPath + "/buyerOrder/queryExpressList",
method: 'POST',
queryParams: {
orderCode: orderCode,
expressTypeStr: "1"
},
loadFilter: function (data) {
var temp = defaultLoadFilter(data);
temp=null==temp?[]:temp;
temp.rows = temp.list;
return temp;
},
columns: [[{
title: "物流公司",
field: "expressCompanyName",
width: 20,
align: "center"
}, {
title: "快递单号",
field: "waybillCode",
width: 20,
align: "center"
}, {
title: "处理时间",
field: "createTimeStr",
width: 20,
align: "center"
}, {
title: "处理内容",
field: "acceptRemark",
width: 30,
align: "center"
}]],
cache: false,
pagination: false,
idField: "id",
singleSelect: true,
onLoadSuccess: function (data) {
if (data.total == 0) {
$(this).datagrid('appendRow', { expressCompanyName: '<div style="text-align:center;color:red">没有数据!</div>' }).datagrid('mergeCells', { index: 0, field: 'expressCompanyName', colspan: 4 })
}
}
});
$("#platformExpressTable").myDatagrid({
fit: false,
fitColumns: true,
striped: true,
rownumbers:true,
url: contextPath + "/buyerOrder/queryExpressList",
method: 'POST',
queryParams: {
orderCode: orderCode,
expressTypeStr: "2,3,4"
},
loadFilter: function (data) {
var temp = defaultLoadFilter(data);
temp=null==temp?[]:temp;
temp.rows = temp.list;
return temp;
},
columns: [[{
title: "物流公司",
field: "expressCompanyName",
width: 20,
align: "center"
}, {
title: "快递单号",
field: "waybillCode",
width: 20,
align: "center"
}, {
title: "处理时间",
field: "createTimeStr",
width: 20,
align: "center"
}, {
title: "处理内容",
field: "acceptRemark",
width: 30,
align: "center"
}]],
cache: false,
pagination: false,
idField: "id",
singleSelect: true,
onLoadSuccess: function (data) {
if (data.total == 0) {
$(this).datagrid('appendRow', { expressCompanyName: '<div style="text-align:center;color:red">没有数据!</div>' }).datagrid('mergeCells', { index: 0, field: 'expressCompanyName', colspan: 4 })
}
}
});
}
});
</script>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Yoho!Buy运营平台</title>
<script src="/ufoPlatform/js/include.js"></script>
<script src="/ufoPlatform/js/ajaxfileupload.js"></script>
<style>
.btn-download span {
line-height: 40px;
color: #87CEFA;
}
</style>
</head>
<body class="easyui-layout" fit="true">
<div region="north" style="height: 160px">
<script>
document.write(addHead('商品管理 /鉴定管理', ''));
</script>
<div style="margin-left: 30px;" class="div_search">
<input id="orderCode" type="text"/>
<input id="uid" type="text"/>
<select id="status" class="easyui-combobox" style="width:250px;" >
<option value="-1">订单状态</option>
<option value="0">待付保证金</option>
<option value="1">待发货</option>
<option value="101">已取消</option>
<option value="2">卖家已发货</option>
<option value="31">平台质检中</option>
<option value="102">平台鉴定完成</option>
</select>
下单时间:<input id="buyStartTime" type="text">
<input id="buyEndTime" type="text"/>
</div>
<div style="margin: 10px 0 0 30px;" class="div_search">
<a id="searchLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">筛选</a>
<a id="searchAllLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">全部</a>
</div>
</div>
<div region="center">
<div style="margin-left: 30px;margin-top: 20px;height: 660px">
<table id="orderTable"></table>
</div>
</div>
<script type="text/javascript">
var orderCode;
var uid;
function viewOrder(orderCode) {
window.open(contextPath + "/html/orderManage/detail.html?orderCode=" + orderCode + "&ver=" + new Date().getTime())
}
$(function () {
$("#orderCode").textbox({
prompt: "父订单编号"
});
$("#uid").textbox({
prompt: "UID"
});
$('#buyStartTime').datetimebox({});
$('#buyEndTime').datetimebox({});
$("#orderTable").myDatagrid({
fit: true,
fitColumns: true,
nowrap: false,
url: contextPath + "/appraiseOrder/list",
method: 'POST',
loadFilter: function (data) {
var temp = defaultLoadFilter(data);
temp.rows = temp.list;
return temp;
},
columns: [[{
title: "父订单编号",
field: "orderCode",
width: 60,
align: "center"
}, {
title: "订单状态",
field: "statusStr",
width: 120,
align: "center"
}, {
title: "订单类型",
field: "attributes",
width: 60,
align: "center",
formatter: function (value, rowData) {
if(value == "7") {
return "付费寄存";
}
if(value == "8") {
return "付费鉴定";
}
return "";
}
}, {
title: "用户UID",
field: "uid",
width: 60,
align: "center"
}, {
title: "保证金",
field: "amount",
width: 50,
align: "center"
}, {
title: "下单时间",
field: "createTimeStr",
width: 100,
align: "center",
},{
title: "订单来源",
field: "clientType",
width: 60,
align: "center",
formatter: function (value, rowData) {
if(value == "3") {
return "IOS";
}
if(value == "4") {
return "安卓";
}
if(value == "7") {
return "miniapp";
}
return "";
}
},{
title: "支付渠道",
field: "payment",
width: 60,
align: "center",
formatter: function (value, rowData) {
if(value == "1") {
return "微信";
}
if(value == "2") {
return "支付宝";
}
return "";
}
},{
title: "操作",
field: "operations",
width: 60,
align: "center",
formatter: function (value, rowData) {
var str = "<a role='view' dataId='" + rowData.orderCode + "' uid='" + rowData.uid + "' style='margin-left:10px;background-color: #5bc0de'>详情</a>";
if(rowData.status == "2") {
str = "<a role='cancel' dataId='" + rowData.orderCode + "' style='margin-left:10px;background-color: #5bc0de'>取消订单</a>";
}
return str;
}
}]],
cache: false,
pagination: true,
pageSize: 10,
pageList: [10],
idField: "id",
singleSelect: false,
checkOnSelect: false,
onLoadSuccess: function () {
$(this).myDatagrid("getPanel").find("a[role='view']").linkbutton({
iconCls: "icon-edit",
onClick: function () {
orderCode = $(this).attr("dataId");
uid = $(this).attr("uid");
viewDetail();
}
});
$(this).myDatagrid("getPanel").find("a[role='cancel']").linkbutton({
iconCls: "icon-edit",
onClick: function () {
orderCode = $(this).attr("dataId");
cancelParent(orderCode);
}
});
}
});
function viewDetail() {
var div = $("<div>").appendTo($(document.body));
var title = "寄存详情";
$(div).myDialog({
width: "1500px",
height: "800px",
title: title,
href: contextPath + "/html/goods/appraise/orderDetail.html?time_version=" + new Date().getTime(),
modal: true,
collapsible: true,
cache: false,
buttons: [ {
text: "关闭",
iconCls: "icon-cancel",
handler: function () {
$(div).dialog("close");
}
}]
});
}
// 搜索
$("#searchLinkButton").linkbutton({
onClick: function () {
var param = {};
param.orderCode = $('#orderCode').textbox('getValue');
param.uid = $('#uid').textbox('getValue');
param.status = $('#status').combobox('getValue');
param.buyStartTimeStr = $('#buyStartTime').datetimebox('getValue');
param.buyEndTimeStr = $('#buyEndTime').datetimebox('getValue');
$("#orderTable").myDatagrid("load", param);
}
});
// 搜索全部
$("#searchAllLinkButton").linkbutton({
onClick: function () {
var param = {};
$("#orderTable").myDatagrid("load", param);
}
});
});
</script>
</body>
</html>
\ No newline at end of file
... ...