Authored by 邱骏

update

Showing 28 changed files with 824 additions and 46 deletions
... ... @@ -25,7 +25,7 @@ import java.util.Map;
public class LoginController {
private static final Logger logger = LoggerFactory.getLogger("erpService");
private static final int SESSION_TIMEOUT_SECONDS = 3 * 60 * 60;
private static final int SESSION_TIMEOUT_SECONDS = 20 * 60;
@Resource
private LoginService loginService;
... ...
package com.yoho.order.dal;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.yoho.order.model.ExpressScreenshots;
/**
* Created by caoyan on 2018/9/12.
*/
public interface ExpressScreenshotsMapper {
List<ExpressScreenshots> selectByWaybillCode(@Param("waybillCode") String waybillCode);
int insert(ExpressScreenshots expressScreenshots);
}
... ...
package com.yoho.order.dal;
import com.yoho.order.model.ManualInputPermission;
import org.apache.ibatis.annotations.Param;
public interface ManualInputPermissionMapper {
ManualInputPermission selectByPid(@Param("pid")Integer pid);
}
\ No newline at end of file
... ...
... ... @@ -130,4 +130,6 @@ public class BuyerOrderReq extends PageRequestBO{
private Integer maxCurrentSecondMinusHours;
private String phoneUid;
private String sortRule;
}
... ...
package com.yoho.order.model;
import java.io.Serializable;
/**
* @author caoyan
* @date 2018/9/13
*/
public class ExpressScreenshots implements Serializable {
private static final long serialVersionUID = 2607922995706119816L;
private Integer id;
private String waybillCode;
private String url;
private Integer createTime;
private Integer createUid;
private String createUserName;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getWaybillCode() {
return waybillCode;
}
public void setWaybillCode(String waybillCode) {
this.waybillCode = waybillCode;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public Integer getCreateTime() {
return createTime;
}
public void setCreateTime(Integer createTime) {
this.createTime = createTime;
}
public Integer getCreateUid() {
return createUid;
}
public void setCreateUid(Integer createUid) {
this.createUid = createUid;
}
public String getCreateUserName() {
return createUserName;
}
public void setCreateUserName(String createUserName) {
this.createUserName = createUserName;
}
@Override
public String toString() {
return "ExpressScreenshots{" +
"id=" + id +
", waybillCode='" + waybillCode + '\'' +
", url='" + url + '\'' +
", createTime='" + createTime + '\'' +
", createUid=" + createUid +
", createUserName=" + createUserName +
'}';
}
}
... ...
package com.yoho.order.model;
import lombok.Data;
import lombok.ToString;
@Data
@ToString
public class ManualInputPermission {
private Integer id;
private Integer pid;
private String pidName;
}
\ No newline at end of file
... ...
... ... @@ -88,4 +88,11 @@ public interface ProductMapper {
List<Product> selectByProductCode(@Param("productCode") String productCode);
int selectProductStockNotZeroCount(@Param("status") Integer status, @Param("sellerList") List<Integer> sellerUid, @Param("product") Product product);
List<Product> selectProductStockNotZeroList(@Param("status") Integer status,
@Param("sellerList") List<Integer> sellerUid,
@Param("product") Product product,
@Param("start") int start,
@Param("rows") int rows);
}
\ No newline at end of file
... ...
... ... @@ -246,7 +246,12 @@
</if>
where 1=1
<include refid="Query_Order_Sql" />
<if test="buyerOrderReq.sortRule!=null and buyerOrderReq.sortRule!=''">
order by a.create_time #{buyerOrderReq.sortRule}
</if>
<if test="buyerOrderReq.sortRule==null or buyerOrderReq.sortRule=''">
order by a.create_time desc
</if>
<if test="buyerOrderReq.start!=null and buyerOrderReq.size != null">
limit #{buyerOrderReq.start},#{buyerOrderReq.size}
</if>
... ...
... ... @@ -69,9 +69,6 @@
use_limit_value,
</if>
product_limit_type,
<if test="param.productLimitType != 1">
product_limit_value,
</if>
start_time,end_time,status,create_time,pid,remark,skup_forbid_type)
values(#{param.couponToken},#{param.couponName},#{param.couponAmount},#{param.couponType}
,#{param.couponNum},#{param.useNum},#{param.sendNum},#{param.useLimitType},
... ... @@ -79,9 +76,6 @@
#{param.useLimitValue},
</if>
#{param.productLimitType},
<if test="param.productLimitType != 1">
#{param.productLimitValue},
</if>
#{param.startTime},#{param.endTime},#{param.status},#{param.createTime},#{param.pid},#{param.remark},#{param.skupForbidType})
</insert>
<update id="updateByCouponSaveUpdateReq">
... ... @@ -117,9 +111,6 @@
<if test="param.productLimitType != null">
product_limit_type=#{param.productLimitType},
</if>
<if test="param.productLimitValue != null">
product_limit_value=#{param.productLimitValue},
</if>
<if test="param.startTime != null">
start_time=#{param.startTime},
</if>
... ...
<?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.ExpressScreenshotsMapper">
<resultMap id="BaseResultMap" type="com.yoho.order.model.ExpressScreenshots">
<result column="id" property="id" jdbcType="INTEGER" />
<result column="waybill_code" property="waybillCode" jdbcType="VARCHAR" />
<result column="url" property="url" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="create_uid" property="createUid" jdbcType="INTEGER" />
<result column="create_user_name" property="createUserName" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List">
id, waybill_code, url, create_time, create_uid, create_user_name
</sql>
<insert id="insert" parameterType="com.yoho.order.model.ExpressScreenshots">
insert into express_screenshots (waybill_code, url, create_time, create_uid, create_user_name)
values (#{waybillCode}, #{url}, #{createTime}, #{createUid}, #{createUserName})
</insert>
<select id="selectByWaybillCode" resultMap = "BaseResultMap">
select <include refid="Base_Column_List"></include>
from express_screenshots where waybill_code= #{waybillCode}
order by create_time asc
</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.ManualInputPermissionMapper" >
<resultMap id="BaseResultMap" type="com.yoho.order.model.ManualInputPermission" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="pid" property="pid" jdbcType="INTEGER" />
<result column="pid_name" property="pidName" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, pid, pid_name
</sql>
<select id="selectByPid" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from manual_input_permission
where pid = #{pid,jdbcType=INTEGER} limit 1
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -253,4 +253,83 @@
#{item}
</foreach>
</select>
<select id="selectProductStockNotZeroCount" resultType="java.lang.Integer">
select count(p.id)
from product p
where 1 = 1
and p.id in (
select distinct product_id
from storage_price s
where 1 = 1
and s.status = #{status}
and s.seller_uid in
<foreach item="sellerItem" index="index" collection="sellerList" open="(" separator="," close=")">
#{sellerItem}
</foreach>
<if test="product.storageId != null and product.storageId > 0">
and s.storage_id = #{product.storageId}
</if>
<if test="product.skup != null and product.skup > 0">
and s.skup = #{product.skup}
</if>
)
<if test="product.id != null and product.id > 0">
and p.id = #{product.id}
</if>
<if test="product.productName != null and product.productName != '' ">
and p.product_name like concat('%', #{product.productName}, '%')
</if>
<if test="product.maxSortId != null and product.maxSortId > 0">
and p.max_sort_id = #{product.maxSortId}
</if>
<if test="product.midSortId != null and product.midSortId > 0">
and p.mid_sort_id = #{product.midSortId}
</if>
<if test="product.brandId != null and product.brandId > 0">
and p.brand_id = #{product.brandId}
</if>
</select>
<select id="selectProductStockNotZeroList" resultMap="BaseResultMap">
select p.id, p.brand_id, p.product_name, p.max_sort_id, p.mid_sort_id
from product p
where 1 = 1
and p.id in (
select distinct product_id
from storage_price s
where 1 = 1
and s.status = #{status}
and s.seller_uid in
<foreach item="sellerItem" index="index" collection="sellerList" open="(" separator="," close=")">
#{sellerItem}
</foreach>
<if test="product.storageId != null and product.storageId > 0">
and s.storage_id = #{product.storageId}
</if>
<if test="product.skup != null and product.skup > 0">
and s.skup = #{product.skup}
</if>
)
<if test="product.id != null and product.id > 0">
and p.id = #{product.id}
</if>
<if test="product.productName != null and product.productName != '' ">
and p.product_name like concat('%', #{product.productName}, '%')
</if>
<if test="product.maxSortId != null and product.maxSortId > 0">
and p.max_sort_id = #{product.maxSortId}
</if>
<if test="product.midSortId != null and product.midSortId > 0">
and p.mid_sort_id = #{product.midSortId}
</if>
<if test="product.brandId != null and product.brandId > 0">
and p.brand_id = #{product.brandId}
</if>
limit #{start}, #{rows}
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -36,7 +36,7 @@
<select id="selectTotalByCondition" resultType="java.lang.Integer" parameterType="com.yoho.product.model.SelfSizeReq">
select count(1)
from self_size a
<if test="selfSizeReq.productName != null or selfSizeReq.productCode != ''">
<if test="selfSizeReq.productName != null or selfSizeReq.productCode != null">
LEFT JOIN product b
ON( b.id=a.product_id)
</if>
... ... @@ -47,7 +47,7 @@
<select id="selectByCondition" resultMap="BaseResultMap" parameterType="com.yoho.product.model.SelfSizeReq">
select a.id, a.product_id, a.goods_id, a.size_id, a.audit_time, a.audit_uid, a.status
from self_size a
<if test="selfSizeReq.productName != null and selfSizeReq.productName != ''">
<if test="selfSizeReq.productName != null or selfSizeReq.productCode != null">
LEFT JOIN product b
ON( b.id=a.product_id)
</if>
... ...
package com.yoho.ufo.order.controller;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.yoho.ufo.order.request.ExpressScreenshotsReq;
import com.yoho.ufo.order.response.ExpressScreenshotsRsp;
import com.yoho.ufo.order.service.IExpressScreenshotsService;
import com.yoho.ufo.service.model.ApiResponse;
@RestController
@RequestMapping(value = "/expressScreenshots")
public class ExpressScreenshotsController {
private static final Logger LOGGER = LoggerFactory.getLogger(ExpressScreenshotsController.class);
@Autowired
private IExpressScreenshotsService expressScreenshotsService;
@RequestMapping(value = "/save")
public ApiResponse save(ExpressScreenshotsReq req) {
LOGGER.info("expressScreenshots save in. req is {}", req);
if(StringUtils.isEmpty(req.getWaybillCode()) || StringUtils.isEmpty(req.getUrl())) {
return new ApiResponse.ApiResponseBuilder().code(400).message("waybillCode or url is empty").build();
}
int result = expressScreenshotsService.save(req.getWaybillCode(), req.getUrl());
if(result > 0) {
return new ApiResponse.ApiResponseBuilder().code(200).message("保存成功").data(result).build();
}else {
return new ApiResponse.ApiResponseBuilder().code(500).message("保存失败").data(result).build();
}
}
@RequestMapping(value = "/queryByWaybillCode")
public ApiResponse queryByWaybillCode(ExpressScreenshotsReq req ) {
String waybillCode = req.getWaybillCode();
LOGGER.info("queryByWaybillCode in. waybillCode is {}", waybillCode);
List<ExpressScreenshotsRsp> result = expressScreenshotsService.queryListByWaybillCode(waybillCode);
return new ApiResponse.ApiResponseBuilder().code(200).message("查询成功").data(result).build();
}
}
... ...
... ... @@ -2,6 +2,8 @@ package com.yoho.ufo.order.controller;
import java.util.List;
import com.yoho.ufo.order.service.impl.*;
import com.yohobuy.ufo.model.order.resp.ManualInputPermissionVo;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -14,10 +16,6 @@ import com.yoho.order.model.Area;
import com.yoho.order.model.BuyerOrderReq;
import com.yoho.order.model.QiniuLiveRecord;
import com.yoho.ufo.exception.PlatformException;
import com.yoho.ufo.order.service.impl.AsynVideoLiveService;
import com.yoho.ufo.order.service.impl.PhoneUidCameraService;
import com.yoho.ufo.order.service.impl.PhoneUidDepotService;
import com.yoho.ufo.order.service.impl.UfoLiveService;
import com.yoho.ufo.service.model.ApiResponse;
import com.yohobuy.ufo.model.order.bo.PhoneUidCameraBo;
import com.yohobuy.ufo.model.order.bo.PhoneUidDepotBo;
... ... @@ -44,6 +42,9 @@ public class UfoLiveController {
@Autowired
private PhoneUidDepotService phoneUidDepotService;
@Autowired
private ManualInputPermissionService manualInputPermissionService;
@RequestMapping(value = "/generateMp4Vedio")
public ApiResponse generateMp4Vedio(BuyerOrderReq req) {
LOGGER.info("generateMp4Vedio in. req is {}", req);
... ... @@ -223,4 +224,11 @@ public class UfoLiveController {
}
return new ApiResponse.ApiResponseBuilder().code(200).data(reslut).message("查询成功").build();
}
@RequestMapping(value = "/permissionSelecetByPid")
public ApiResponse permissionSelecetByPid() {
LOGGER.info("permissionSelecetByPid in.");
ManualInputPermissionVo vo = manualInputPermissionService.selectPermissionByPid();
return new ApiResponse.ApiResponseBuilder().code(200).data(vo).message("查询成功").build();
}
}
... ...
package com.yoho.ufo.order.request;
public class ExpressScreenshotsReq {
private String waybillCode;
private String url;
public String getWaybillCode() {
return waybillCode;
}
public void setWaybillCode(String waybillCode) {
this.waybillCode = waybillCode;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}
... ...
package com.yoho.ufo.order.response;
public class ExpressScreenshotsPicRsp {
private String url;
private String createTimeStr;
private String createUserName;
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getCreateTimeStr() {
return createTimeStr;
}
public void setCreateTimeStr(String createTimeStr) {
this.createTimeStr = createTimeStr;
}
public String getCreateUserName() {
return createUserName;
}
public void setCreateUserName(String createUserName) {
this.createUserName = createUserName;
}
}
... ...
package com.yoho.ufo.order.response;
import java.util.List;
public class ExpressScreenshotsRsp {
private String waybillCode;
private List<ExpressScreenshotsPicRsp> picList;
public List<ExpressScreenshotsPicRsp> getPicList() {
return picList;
}
public void setPicList(List<ExpressScreenshotsPicRsp> picList) {
this.picList = picList;
}
public String getWaybillCode() {
return waybillCode;
}
public void setWaybillCode(String waybillCode) {
this.waybillCode = waybillCode;
}
}
... ...
package com.yoho.ufo.order.service;
import java.util.List;
import com.yoho.ufo.order.response.ExpressScreenshotsRsp;
public interface IExpressScreenshotsService {
int save(String waybillCode, String url);
List<ExpressScreenshotsRsp> queryListByWaybillCode(String waybillCode);
}
... ...
package com.yoho.ufo.order.service.impl;
import java.math.BigDecimal;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import com.yoho.order.dal.*;
import com.yoho.order.model.*;
import com.yoho.ufo.dal.ProductLimitSaleMapper;
import com.yoho.ufo.dal.model.ProductLimitSale;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.common.collect.Lists;
... ... @@ -28,6 +32,7 @@ import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.common.base.Splitter;
import com.yoho.core.dal.datasource.annotation.Database;
... ... @@ -36,13 +41,56 @@ import com.yoho.core.redis.cluster.operations.nosync.YHValueOperations;
import com.yoho.core.redis.cluster.operations.serializer.RedisKeyBuilder;
import com.yoho.core.rest.client.ServiceCaller;
import com.yoho.error.exception.ServiceException;
import com.yoho.order.dal.AppraiseAddressMapper;
import com.yoho.order.dal.BuyerOrderGoodsMapper;
import com.yoho.order.dal.BuyerOrderMapper;
import com.yoho.order.dal.BuyerOrderMetaMapper;
import com.yoho.order.dal.ExpressCompanyMapper;
import com.yoho.order.dal.ExpressInfoMapper;
import com.yoho.order.dal.ExpressRecordMapper;
import com.yoho.order.dal.OrderConfigMapper;
import com.yoho.order.dal.OrderCouponMapper;
import com.yoho.order.dal.OrderOperateRecordMapper;
import com.yoho.order.dal.OrdersPayMapper;
import com.yoho.order.dal.PhoneUidDepotMapper;
import com.yoho.order.dal.QiniuLiveRecordMapper;
import com.yoho.order.dal.QualityCheckMapper;
import com.yoho.order.dal.SellerOrderGoodsMapper;
import com.yoho.order.dal.SellerOrderMapper;
import com.yoho.order.dal.SellerOrderMetaMapper;
import com.yoho.order.dal.SignForPackageMapper;
import com.yoho.order.dal.StoredSellerMapper;
import com.yoho.order.model.AppraiseAddress;
import com.yoho.order.model.BuyerOrder;
import com.yoho.order.model.BuyerOrderFeedback;
import com.yoho.order.model.BuyerOrderGoods;
import com.yoho.order.model.BuyerOrderMeta;
import com.yoho.order.model.BuyerOrderReq;
import com.yoho.order.model.ExpressCompany;
import com.yoho.order.model.ExpressInfo;
import com.yoho.order.model.ExpressRecord;
import com.yoho.order.model.OrderConfig;
import com.yoho.order.model.OrderCoupon;
import com.yoho.order.model.OrderOperateRecord;
import com.yoho.order.model.OrdersPay;
import com.yoho.order.model.PhoneUidDepot;
import com.yoho.order.model.QiniuLiveRecord;
import com.yoho.order.model.QualityCheck;
import com.yoho.order.model.QualityCheckResp;
import com.yoho.order.model.SellerOrder;
import com.yoho.order.model.SellerOrderGoods;
import com.yoho.order.model.SellerOrderMeta;
import com.yoho.order.model.SignForPackage;
import com.yoho.order.model.StoredSeller;
import com.yoho.service.model.order.request.OrderRequest;
import com.yoho.ufo.constants.PlatformConstant;
import com.yoho.ufo.constants.RedisKeyConstants;
import com.yoho.ufo.dal.IdentifyRecordsMapper;
import com.yoho.ufo.dal.ProductLimitSaleMapper;
import com.yoho.ufo.dal.ProductMapper;
import com.yoho.ufo.dal.model.IdentifyRecords;
import com.yoho.ufo.dal.model.Product;
import com.yoho.ufo.dal.model.ProductLimitSale;
import com.yoho.ufo.exception.CommonException;
import com.yoho.ufo.order.constant.Constant;
import com.yoho.ufo.order.constant.OrderConfigConstant;
... ... @@ -640,7 +688,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
}
if(StringUtils.isNotEmpty(req.getQueryStr())) {
return queryOrderListByStatusAndQueryStr(req.getQueryStr(), req.getDepotNo(), checkStatusList, platformExpressInfoFlag);
return queryOrderListByStatusAndQueryStr(req.getQueryStr(), req.getDepotNo(), checkStatusList, platformExpressInfoFlag, req.getSortRule());
}
req.setStatus(null);
... ... @@ -672,7 +720,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
}
private PageResponseBO<BuyerOrderResp> queryOrderListByStatusAndQueryStr(String queryStr, Integer depotNo,
List<Byte> checkStatusList, String platformExpressInfoFlag){
List<Byte> checkStatusList, String platformExpressInfoFlag, String sortRule){
//先按订单号来查
BuyerOrderReq req = new BuyerOrderReq();
req.setOrderCode(queryStr);
... ... @@ -680,6 +728,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
req.setStatusList(checkStatusList);
req.setPlatformExpressInfoFlag(platformExpressInfoFlag);
req.setSize(100);
req.setSortRule(sortRule);
List<BuyerOrder> orderList = buyerOrderMapper.selectByCondition(req);
if(CollectionUtils.isEmpty(orderList)){//再按卖家运单号来查
orderList = Lists.newArrayList();
... ... @@ -689,6 +738,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
req.setStatusList(checkStatusList);
req.setPlatformExpressInfoFlag(platformExpressInfoFlag);
req.setSize(100);
req.setSortRule(sortRule);
List<BuyerOrder> list = buyerOrderMapper.selectByCondition(req);
if(CollectionUtils.isNotEmpty(list)){
orderList.addAll(list);
... ... @@ -828,6 +878,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
if (Constant.BUYER_ORDER_STATUS_PLATFORM_RECEIVE.getByteVal() != buyerOrder.getStatus().byteValue()) {
throw new ServiceException(400, "错误:订单状态已变化");
}
ufoLiveService.checkHasLiveVedioTime(Long.valueOf(orderCode)); // 检查是否有录制视频
int operateType = OperateTypeEnum.ONLY_JUDGE_UNSURE.getCode();
UserHelper userHelper = new UserHelper();
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
... ... @@ -1049,6 +1102,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
throw new ServiceException(400,"错误:订单状态变化,操作[鉴定通过]失败,请重新刷新列表");
}
ufoLiveService.checkHasLiveVedioTime(Long.valueOf(orderCode)); // 检查是否有录制视频
//记录操作日志
int operateType =OperateTypeEnum.ONLY_JUDGE_PASS.getCode();
UserHelper userHelper = new UserHelper();
... ... @@ -1078,6 +1133,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
throw new ServiceException(400,"错误:订单状态变化,操作[鉴定不通过]失败,请重新刷新列表");
}
ufoLiveService.checkHasLiveVedioTime(Long.valueOf(orderCode)); // 检查是否有录制视频
//记录操作日志
int operateType =OperateTypeEnum.ONLY_JUDGE_REJECT.getCode();
UserHelper userHelper = new UserHelper();
... ... @@ -1905,11 +1962,13 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
jsonObj.put("businessCode", "UFO");
jsonObj.put("custid", getCustId(req.getPhoneUid(), sellerGoods.getDepotNo()));
JSONArray cargoArr = new JSONArray();
JSONObject cargoObj = new JSONObject();
cargoObj.put("name", "衣服鞋帽");
cargoObj.put("count", 1);
cargoObj.put("unit", "件");
jsonObj.put("cargo", cargoObj);
cargoArr.add(cargoObj);
jsonObj.put("cargo", cargoArr);
//收件人信息
if(buyerOrder.getStatus().equals(Constant.BUYER_ORDER_STATUS_JUDGE_PASS.getByteVal())
... ...
package com.yoho.ufo.order.service.impl;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.elasticsearch.common.collect.Lists;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yoho.core.common.utils.DateUtil;
import com.yoho.order.dal.ExpressScreenshotsMapper;
import com.yoho.order.model.ExpressScreenshots;
import com.yoho.ufo.order.response.ExpressScreenshotsPicRsp;
import com.yoho.ufo.order.response.ExpressScreenshotsRsp;
import com.yoho.ufo.order.service.IExpressScreenshotsService;
/**
* @author craig.qin
*/
@Service
public class ExpressScreenshotsServiceImpl implements IExpressScreenshotsService {
private static final Logger LOGGER = LoggerFactory.getLogger(ExpressScreenshotsServiceImpl.class);
@Autowired
private ExpressScreenshotsMapper expressScreenshotsMapper;
@Override
public int save(String waybillCode, String url){
ExpressScreenshots record = new ExpressScreenshots();
record.setWaybillCode(waybillCode);
record.setUrl(url);
record.setCreateTime(DateUtil.getCurrentTimeSecond());
// UserHelper userInfo = new UserHelper();
// record.setCreateUid(userInfo.getUserId());
// record.setCreateUserName(userInfo.getUserName());
record.setCreateUid(10961101);
record.setCreateUserName("测试名字");
return expressScreenshotsMapper.insert(record);
}
@Override
public List<ExpressScreenshotsRsp> queryListByWaybillCode(String waybillCode) {
List<ExpressScreenshots> list = expressScreenshotsMapper.selectByWaybillCode(waybillCode);
List<ExpressScreenshotsRsp> result = Lists.newArrayList();
if(CollectionUtils.isEmpty(list)) {
return null;
}
List<ExpressScreenshotsPicRsp> picList = Lists.newArrayList();
for(ExpressScreenshots item : list) {
ExpressScreenshotsPicRsp picRsp = new ExpressScreenshotsPicRsp();
picRsp.setUrl(item.getUrl());
picRsp.setCreateTimeStr(DateUtil.getDateStrBySecond(item.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
picRsp.setCreateUserName(item.getCreateUserName());
picList.add(picRsp);
}
ExpressScreenshotsRsp rsp = new ExpressScreenshotsRsp();
rsp.setWaybillCode(waybillCode);
rsp.setPicList(picList);
return Lists.newArrayList(rsp);
}
}
... ...
package com.yoho.ufo.order.service.impl;
import com.yoho.order.dal.ManualInputPermissionMapper;
import com.yoho.order.model.ManualInputPermission;
import com.yoho.ufo.service.impl.UserHelper;
import com.yohobuy.ufo.model.order.resp.ManualInputPermissionVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* Created by li.ma on 2019/6/11.
*/
@Service
public class ManualInputPermissionService {
@Autowired
private ManualInputPermissionMapper manualInputPermissionMapper;
public ManualInputPermissionVo selectPermissionByPid() {
Integer pid = new UserHelper().getUserId();
ManualInputPermission manualInputPermission = manualInputPermissionMapper.selectByPid(pid);
ManualInputPermissionVo vo = new ManualInputPermissionVo();
vo.setHasPermission(null == manualInputPermission ? 0 : 1);
return vo;
}
}
... ...
... ... @@ -307,4 +307,15 @@ public class UfoLiveService {
public List<QiniuLiveRecord> queryVideoInfo(Integer startTime, Integer endTime) {
return qiniuLiveRecordMapper.selectByTime(startTime, endTime);
}
public boolean isStartLiveTime(Long orderCode) {
Integer startTime = liveRecordTimeMapper.selectByOrderCode(orderCode);
return null == startTime ? false : true;
}
public void checkHasLiveVedioTime(Long orderCode) {
if (!isStartLiveTime(orderCode)) {
throw new ServiceException(400, "请先录制视频再进行其他操作");
}
}
}
... ...
package com.yoho.ufo.service.impl;
import com.google.common.collect.Lists;
import com.yoho.core.common.utils.DateUtil;
import com.yoho.product.model.SecondhandImages;
import com.yoho.product.model.SecondhandInfo;
... ... @@ -106,27 +105,26 @@ public class StorageService {
* @return
*/
public PageResponseBO<ProductResponceBo> storageListPlus(ProductRequestBo bo, List<Integer> sellerUid) {
Product product = OrikaUtils.map(bo, Product.class);
/**
* 获取 productId
*/
List<Integer> integerList = storagePriceService.selectProductIdByPlus(product, sellerUid);
if (null != integerList && integerList.isEmpty()) {
// 返回空列表 代表查询了storage_price 但查询的接口是空 再联合查询肯定也是空
return new PageResponseBO<>();
}
product.setProductIdList(integerList);
int count = productMapper.selectProductStorageCount(product);
final Product product = OrikaUtils.map(bo, Product.class);
final int count = productMapper.selectProductStockNotZeroCount(
DEFAULT_SKUP_STATUS,
sellerUid,
product
);
if (count == 0) {
LOGGER.warn("StorageService storageListPlus count is 0.param = {}, sellerUid = {}", bo, sellerUid);
return new PageResponseBO<>();
}
List<Product> productList = productMapper.selectProductStorageList(product, bo.getStartIndex(), bo.getRows());
List<ProductResponceBo> responseBos = new ArrayList<>();
ProductResponceBo productResponseBo;
final List<Product> productList = productMapper.selectProductStockNotZeroList(
DEFAULT_SKUP_STATUS,
sellerUid,
product,
bo.getStartIndex(),
bo.getRows()
);
final List<ProductResponceBo> responseBos = new ArrayList<>();
for (Product productItem : productList) {
productResponseBo = productConvertService.convertProductDo2Bo(productItem);
responseBos.add(productResponseBo);
responseBos.add(productConvertService.convertProductDo2Bo(productItem));
}
productAssistService.fillBrandName(responseBos).fillSkupInfo(responseBos);
return new PageResponseBO<>(count, responseBos, bo.getPage(), bo.getRows());
... ...
... ... @@ -53,6 +53,8 @@ datasources:
- com.yoho.order.dal.PhoneUidCameraMapper
- com.yoho.order.dal.PhoneUidDepotMapper
- com.yoho.order.dal.OrderCouponMapper
- com.yoho.order.dal.ManualInputPermissionMapper
- com.yoho.order.dal.ExpressScreenshotsMapper
ufo_resource:
servers:
... ...
... ... @@ -53,6 +53,8 @@ datasources:
- com.yoho.order.dal.PhoneUidCameraMapper
- com.yoho.order.dal.PhoneUidDepotMapper
- com.yoho.order.dal.OrderCouponMapper
- com.yoho.order.dal.ManualInputPermissionMapper
- com.yoho.order.dal.ExpressScreenshotsMapper
ufo_resource:
servers:
... ...
... ... @@ -55,7 +55,7 @@
<div style="padding:20px;">
<input id="refund_tradeBillsId" type="hidden" readonly disabled/>
<input id="refund_uid" type="hidden" readonly disabled/>
<label> 单 编 号:</label>
<label>单编号:</label>
<input id="refund_orderCode" type="text" class="easyui-textbox" style="width:250px" readonly disabled/>
<br/><br/>
... ... @@ -63,7 +63,7 @@
<input id="refund_alipayAccount" type="text" class="easyui-textbox" style="width:250px" readonly disabled/>
<br/><br/>
<label> 款 金 额:</label>
<label>款金额:</label>
<input id="refund_amount" type="text" class="easyui-textbox" style="width:250px" readonly disabled/>
</div>
... ... @@ -73,6 +73,32 @@
<a href="#" id="refundConfirmDialog_btn_close" onclick="$('#refundConfirmDialog').dialog('close');" class="easyui-linkbutton btn-info" >关闭</a>
</div>
<div id="markPaidConfirmDialog" class="easyui-dialog" style="width:400px;height:300px;"
data-options="title:'确定已完成打款?',buttons:'#markPaidConfirmDialog_tb',modal:true,closed:true">
<div style="padding:20px;">
<input id="mark_paid_tradeBillsId" type="hidden" />
<input id="mark_paid_uid" type="hidden" />
<label>订单编号:</label>
<input id="mark_paid_orderCode" type="text" class="easyui-textbox" style="width:250px" readonly disabled/>
<br/><br/>
<label>打款渠道:</label>
<select id="mark_paid_sceneId" class="easyui-combobox" style="width:250px">
<option value="102">支付宝</option>
<option value="103">银行卡</option>
</select>
<br/><br/>
<label>打款金额:</label>
<input id="mark_paid_amount" type="text" class="easyui-textbox" style="width:250px" readonly disabled/>
</div>
</div>
<div id="markPaidConfirmDialog_tb">
<a href="#" id="markPaidConfirmDialog_btn_save" onclick="markPaidGo();" class="easyui-linkbutton btn-danger" >确定</a>
<a href="#" id="markPaidConfirmDialog_btn_close" onclick="$('#markPaidConfirmDialog').dialog('close');" class="easyui-linkbutton btn-info" >关闭</a>
</div>
<script>
$(function() {
$("#moneyType").combobox({
... ... @@ -194,13 +220,19 @@ function getTradeBillsList(){
align: "center",
formatter: function (value, rowData, rowIndex) {
if (rowData.tradeStatus != 100) {
var btn= "<a role='refundsConfirm' onclick='openConfirmDialog(\"%s\",\"%s\",\"%s\",\"%s\",\"%s\")' style='margin-left:10px;background-color: #5cb85c !important;'>打款</a>";
var btn= "<a role='confirmDialog' onclick='openConfirmDialog(\"%s\",\"%s\",\"%s\",\"%s\",\"%s\")' style='margin-left:10px;background-color: #5cb85c !important;'>打款</a>";
btn = btn.replace("%s",rowData.id);
btn = btn.replace("%s",rowData.uid);
btn = btn.replace("%s",rowData.orderCode);
btn = btn.replace("%s",rowData.alipayAccount);
btn = btn.replace("%s",rowData.amount);
return btn;
var markPaidbtn= "<a role='confirmDialog' onclick='openMarkPaidConfirmDialog(\"%s\",\"%s\",\"%s\",\"%s\",\"%s\")' style='margin-left:10px;background-color: #d9534f !important;'>已打款</a>";
markPaidbtn = markPaidbtn.replace("%s",rowData.id);
markPaidbtn = markPaidbtn.replace("%s",rowData.uid);
markPaidbtn = markPaidbtn.replace("%s",rowData.orderCode);
markPaidbtn = markPaidbtn.replace("%s",rowData.alipayAccount);
markPaidbtn = markPaidbtn.replace("%s",rowData.amount);
return btn + markPaidbtn;
}
}
}]],
... ... @@ -210,7 +242,7 @@ function getTradeBillsList(){
idField: "id",
singleSelect: true,
onLoadSuccess: function (data) {
$(this).datagrid("getPanel").find("a[role='refundsConfirm']").linkbutton({});
$(this).datagrid("getPanel").find("a[role='confirmDialog']").linkbutton({});
}
});
}
... ... @@ -226,6 +258,18 @@ function openConfirmDialog(id,uid,orderCode,alipayAccount,amount) {
$("#refundConfirmDialog").dialog('open');
}
function openMarkPaidConfirmDialog(id,uid,orderCode,alipayAccount,amount) {
//重新赋值
$("#mark_paid_sceneId").combobox('setValue','102');
$("#mark_paid_tradeBillsId").val(id);
$("#mark_paid_uid").val(uid);
$("#mark_paid_orderCode").textbox('setValue',orderCode);
$("#mark_paid_amount").textbox('setValue',amount);
$("#markPaidConfirmDialog").dialog('open');
}
//确认打款
function refundGo() {
var param={};
... ... @@ -261,6 +305,38 @@ function refundGo() {
$("#refundConfirmDialog_btn_close").linkbutton("disabled");
}
function markPaidGo() {
var param={};
param.sceneId = $("#mark_paid_sceneId").combobox('getValue');
param.tradeBillsId = $("#mark_paid_tradeBillsId").val();
param.uid=$("#mark_paid_uid").val();
param.orderCode=$("#mark_paid_orderCode").val();
param.alipayAccount="0";
param.amount=$("#mark_paid_amount").val();
//发送请求
$.ajax({
type: "POST",
url: contextPath + '/tradeBills/manualRefund',
data: param,
async: false,
cache: false,
dataType: 'json',
success: function (result) {
if(result.code != 200) {
$.messager.alert("失败", result.message, "error");
}
$("#markPaidConfirmDialog").dialog('close');
loadTradeBillsData();
}
});
//按钮置灰
$("#markPaidConfirmDialog_btn_save").linkbutton("disabled");
$("#markPaidConfirmDialog_btn_close").linkbutton("disabled");
}
</script>
</body>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Yoho!Buy运营平台</title>
<script src="/ufoPlatform/js/include.js?version=6.9.3"></script>
</head>
<body class="easyui-layout" fit="true">
<div region="north" style="height:230px;">
<script>
document.write(addHead('订单管理', '扫描快递单截屏'));
</script>
<div style="margin-left: 10px;margin-top: 30px">
<div style="border:1px solid #ddd;border-radius:5px 5px 5px 5px;">
<div style="margin-left: 10px;margin-top: 20px;margin-bottom: 20px">
<input id="waybillCode" name="waybillCode" />
<a id="searchBtn" class="btn-info">筛选</a>
<a id="clearBtn" class="btn-success">清除筛选</a>
</div>
</div>
</div>
</div>
<div id="screenshotsDiv" region="center">
<table id="screenshotsTable">
</table>
</div>
<div id="w" class="easyui-window" title="预览" data-options="modal:true,closed:true" style="width:500px;height:600px;padding:10px;">
<div align="center">
<img id="showImg" height="500px;" width="400px;" onclick="window.open(this.src)"/>
</div>
</div>
<script>
$(function() {
$("#waybillCode").textbox({
prompt: "卖家物流单号"
});
$("#searchBtn").linkbutton({
iconCls : "icon-search",
onClick: function () {
var param = {};
param.waybillCode = $('#waybillCode').val();
$("#screenshotsTable").myDatagrid("load", param);
}
});
// 清除筛选
$("#clearBtn").linkbutton({
iconCls : "icon-search",
onClick: function () {
$('#waybillCode').textbox('setValue', '');
}
});
loadMainList();
});
function loadMainList(){
$("#screenshotsTable").myDatagrid({
fit: true,
fitColumns: true,
striped: true,
url: contextPath + "/expressScreenshots/queryByWaybillCode",
method: 'POST',
loadFilter: function (data) {
var temp = defaultLoadFilter(data);
temp=null==temp?[]:temp;
temp.rows = temp.list;
return temp;
},
columns: [[{
title: "卖家物流单号",
field: "waybillCode",
width: 20,
align: "center"
}, {
title: "截屏",
field: "picList",
width: 80,
align: "center",
formatter: function (value, rowData, rowIndex) {
var imageStr = "<table><tbody><tr>";
if(value != null){
for (var i = 0 ;i < value.length; i++){
imageStr += "<td><a href='javascript:void(0)' onclick='openModal("+"\""+value[i].url+"\""+")'><img height='200px;' width='150px;' src='"+value[i].url+"'/></a>";
imageStr += "<br><font color='black'>创建时间:"+value[i].createTimeStr+"<br>操作人:"+value[i].createUserName + "</font>";
imageStr += "</td>";
if((i+1) % 5 == 0 && 0 != i && i != (value.length - 1)) {
imageStr += "</tr><tr>";
}
}
}
imageStr = imageStr + "</tr></tbody></table>";
return imageStr;
}
}]],
cache: false,
pagination: true,
pageSize: 10,
idField: "id",
singleSelect: true,
onLoadSuccess: function (data) {
if (data.total == 0) { 
$(this).datagrid('appendRow', { waybillCode: '<div style="text-align:center;color:red">无数据!</div>' }).datagrid('mergeCells', { index: 0, field: 'waybillCode', colspan: 2 })         
 }
}
});
}
function openModal(imageUrl){
$("#showImg").attr("src",imageUrl);
$("#w").window("open");
}
</script>
</body>
</html>
\ No newline at end of file
... ...