Authored by caoyan

Merge branch 'test6.8.9' of http://git.yoho.cn/ufo/ufo-platform into test6.8.9

... ... @@ -103,4 +103,7 @@ public class BuyerOrderReq extends PageRequestBO{
private Integer date;//查询包裹日期
private Integer endTime; // 鉴定视频的结束时间
private Integer cameraCode; // 鉴定视频的摄像头编号
}
... ...
... ... @@ -36,6 +36,7 @@ public class SellerWalletDetail {
SELLER_ONSHELF("卖家上架商品", 11),
SELLER_ADDPRICE("卖家上调价格", 12),
TRADE_COMPLETE("商品交易完成", 51),
APPRAISE_UNSURE("商品无法鉴定", 52),
SELLER_REDUCEPRICE("卖家下调价格", 13),
SELLER_OFFSHELF("卖家下架商品", 21),
SYSTEM_OFFSHELF("系统下架商品", 22),
... ...
... ... @@ -71,4 +71,6 @@ public interface StoragePriceMapper {
ArrayList<Integer> selectAllSkuBySeller(@Param("list") List<Integer> allSellerUid, @Param("status") int onSaleStatus);
ArrayList<ExportStoragePriceInner> selectExportInfoPlusList(@Param("list") ArrayList<Integer> skuList, @Param("status") int onSaleStatus);
Integer selectFirstUidByProductIdAndUidList(@Param("productId") Integer productId, @Param("uidList") List<Integer> uidList);
}
\ No newline at end of file
... ...
... ... @@ -24,7 +24,7 @@
from product_limit_sale
where product_id = #{productId,jdbcType=INTEGER} and del_status=0
</select>
<select id="selectHasDataProductIds" resultMap="BaseResultMap">
<select id="selectHasDataProductIds" resultType="java.lang.Integer">
select
distinct product_id
from product_limit_sale
... ...
... ... @@ -84,6 +84,17 @@
from storage_price where storage_id = #{storageId}
<include refid="skupPageCondition"/>
</select>
<select id="selectFirstUidByProductIdAndUidList" resultType="java.lang.Integer">
select seller_uid
from storage_price where product_id = #{productId} and status=1
<if test="uidList != null">
and seller_uid in
<foreach item="item" index="index" collection="uidList" open="(" separator="," close=")">
#{item}
</foreach>
</if>
limit 1
</select>
<sql id="skupPageCondition">
<if test="sellerUid != null and sellerUid > 0">
... ...
... ... @@ -112,7 +112,8 @@ public class LiveEventsListener implements ApplicationListener<QiniuLiveRecordEv
result.setStartTime(startTime);
result.setPid(record.getUserId());
result.setOrderCode(Long.valueOf(record.getOrderCode()));
result.setEndTime(DateUtil.getCurrentTimeSeconds()); // 鉴定通过和不通过的时候,默认视频结束
result.setEndTime(null == record.getEndTime() ? DateUtil.getCurrentTimeSeconds() : record.getEndTime()); // 鉴定通过和不通过的时候,默认视频结束
result.setCameraCode(record.getCameraCode());
return result;
}
}
... ...
... ... @@ -253,7 +253,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
//月结订单类型
private static final List<Byte> monthlyStatementList = Lists.newArrayList(Constant.BUYER_ORDER_STATUS_JUDGE_PASS.getByteVal(),//平台鉴定通过
Constant.BUYER_ORDER_STATUS_MINI_FAULT_ACCEPT.getByteVal(),//瑕疵确认通过
Constant.BUYER_ORDER_STATUS_APPRAISE_UNSURE.getByteVal());//无法鉴定
Constant.BUYER_ORDER_STATUS_APPRAISE_UNSURE.getByteVal(),//无法鉴定
Constant.BUYER_ORDER_STATUS_TO_BE_RECEIVED.getByteVal());//平台已发货
public Map<String, Integer> getCountByJudgeStatus(BuyerOrderReq req){
List<Byte> toBeReceivedList = Lists.newArrayList();
... ...
... ... @@ -196,9 +196,9 @@ public class UfoLiveService {
String cameraCode = yhValueOperations.get(getRedisKey(req.getPid()));
req.setCameraCode(null == cameraCode ? null : Integer.valueOf(cameraCode));
req.setCameraCode(null == cameraCode ? req.getCameraCode() : Integer.valueOf(cameraCode));
return null == cameraCode ? null : Integer.valueOf(cameraCode);
return null == cameraCode ? req.getCameraCode() : Integer.valueOf(cameraCode);
}
public Integer queryCurrentTime(Long orderCode) throws PlatformException {
... ...
... ... @@ -56,6 +56,7 @@ import com.yohobuy.ufo.model.common.PageResponseBO;
import com.yohobuy.ufo.model.order.req.BatchImportPrdReq;
import com.yohobuy.ufo.model.order.req.SellerReq;
import com.yohobuy.ufo.model.order.vo.AddressInfo;
import com.yohobuy.ufo.model.request.product.ProductImportTranItemBo;
import com.yohobuy.ufo.model.request.product.ProductRequestBatchBo;
import com.yohobuy.ufo.model.request.product.ProductRequestBo;
import com.yohobuy.ufo.model.resp.product.ProductEditResponceBo;
... ... @@ -176,23 +177,55 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
String limit = limitSaleInfo.get(i);
String[] array0 = limit.split(" ");
Integer uid = new Integer(array0[0]);
BigDecimal percent = new BigDecimal(array0[1]);
BigDecimal percent = null;
if (array0.length == 2 && StringUtils.isNotBlank(array0[1])) {
percent = new BigDecimal(array0[1]);
}
map.put(uid, percent);
}
}
List<ProductLimitSale> exist = productLimitSaleMapper.selectByProductId(productId);
Map<Integer, BigDecimal> existMap = CollectionUtil.extractMap(exist, ProductLimitSale::getUid, ProductLimitSale::getProfitRate);
LOGGER.info("商品:{} 限制出售配置更新前为:{}", productId, exist);
LOGGER.info("商品:{} 限制出售配置更新参数为:{}", productId, map);
boolean hasDiff = false;
List<Integer> updateOrInsertOrRemove = new ArrayList<>();
for (ProductLimitSale s : exist) {
BigDecimal percent = map.get(s.getUid());
if (percent == null || percent.compareTo(s.getProfitRate()) != 0) {
if (!map.containsKey(s.getUid())) {
hasDiff = true;
break;
updateOrInsertOrRemove.add(s.getUid());
} else {
BigDecimal percent = map.get(s.getUid());
if (percent == null && s.getProfitRate() == null) {
continue;
}
if (percent != null && s.getProfitRate() != null) {
if (percent.compareTo(s.getProfitRate()) != 0) {
hasDiff = true;
updateOrInsertOrRemove.add(s.getUid());
}
} else {
hasDiff = true;
updateOrInsertOrRemove.add(s.getUid());
}
}
}
// add
for (Integer uidOld : map.keySet()) {
if(!existMap.containsKey(uidOld)) {
updateOrInsertOrRemove.add(uidOld);
}
}
if(!updateOrInsertOrRemove.isEmpty()) {
if(map.isEmpty() || exist.isEmpty()) {
checkStorage(productId, null);
} else {
checkStorage(productId, updateOrInsertOrRemove);
}
}
// 包含
if (!hasDiff) {
for (ProductLimitSale s : exist) {
... ... @@ -216,6 +249,17 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
});
}
private void checkStorage(Integer productId, List<Integer> updateOrInsertOrRemove) {
Integer uid = storagePriceMapper.selectFirstUidByProductIdAndUidList(productId, updateOrInsertOrRemove);
if (uid != null) {
if (updateOrInsertOrRemove == null) {
throw new CommonException(400, "该商品存在出售中的SKUP,请先下架所有SKUP后,再进行变更");
} else {
throw new CommonException(400, "UID:" + uid + "存在出售中的SKUP,请先下架所有SKUP后,再进行变更");
}
}
}
private List<GoodsImages> getGoodsImagesFromBo(ProductRequestBo bo) {
if (CollectionUtils.isEmpty(bo.getImageUrlList())) {
return null;
... ... @@ -337,15 +381,19 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
Set<Integer> uids = new HashSet<>();
for (String s : limitInfo) {
String[] array = s.split(" ");
if (array.length != 2) {
if (array.length > 2) {
throw new CommonException(400, "请输入正确的可售用户信息!");
}
try {
Integer uid = new Integer(array[0]);
BigDecimal percent = new BigDecimal(array[1]);
if (uid < 1 || percent.compareTo(BigDecimal.ZERO) < 0
|| percent.compareTo(new BigDecimal("100")) > 0 || uids.contains(uid)) {
throw new CommonException(400, "请输入正确的可售用户信息!");
if (uid < 1 || uids.contains(uid)) {
throw new CommonException(400, "用户id错误或者有重复行!");
}
if (array.length == 2 && StringUtils.isNotBlank(array[1])) {
BigDecimal percent = new BigDecimal(array[1]);
if (percent.compareTo(BigDecimal.ZERO) < 0 || percent.compareTo(new BigDecimal("100")) > 0) {
throw new CommonException(400, "请输入(uid:" + uid + ")正确的百分比信息!");
}
}
uids.add(uid);
} catch (NumberFormatException e) {
... ... @@ -967,8 +1015,7 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
BigDecimal rate = userHasPermissionMap.get(productId);
if (rate == null) {
sb.append(",").append(productId);
}
if (rate.compareTo(BigDecimal.ZERO) < 0 || rate.compareTo(new BigDecimal("100")) > 0) {
} else if (rate.compareTo(BigDecimal.ZERO) < 0 || rate.compareTo(new BigDecimal("100")) > 0) {
LOGGER.error("用户" + uid + ",商品" + productId + "的rate配置有误:" + rate);
throw new PlatformException("用户" + uid + ",商品" + productId + "的rate配置有误:" + rate, 400);
}
... ... @@ -1044,10 +1091,19 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
for (int i = 0; i < batchLists.size(); i++) {
LOGGER.info("一共{}行,每批次{}行,一共{}批,处理批次{}...", items.size(), batchNum, batchLists.size(), i + 1);
List<ProductImportTranItem> batch = batchLists.get(i);
BatchImportPrdReq<ProductImportTranItem> batchReq = new BatchImportPrdReq<>();
BatchImportPrdReq<ProductImportTranItemBo> batchReq = new BatchImportPrdReq<>();
batchReq.setHiddenBackAddress(addressHidden);
batchReq.setNoHiddenBackAddress(address);
batchReq.setProductList(batch);
List<ProductImportTranItemBo> batchBo = new ArrayList<>();
for(ProductImportTranItem it : batch) {
ProductImportTranItemBo bo = new ProductImportTranItemBo();
BeanUtils.copyProperties(it, bo);
bo.setGoodsPaymentRate(it.getSellerServiceFeeRate());
batchBo.add(bo);
}
batchReq.setProductList(batchBo);
batchReq.setTaskId(tran.getId());
batch.forEach(b -> b.setTranId(tran.getId()));
... ...
... ... @@ -50,6 +50,9 @@
<td><label>平台收货仓库:</label><span id="depotName"></span></td>
<td colspan="2"><label>平台收货地址:</label><span id="platformReceiveGoodsAddress"></span></td>
</tr>
<tr>
<td><label>订单类型:</label><span id="preSellOrNormal"></span></td>
</tr>
</table>
<h2>收货信息</h2>
... ... @@ -320,6 +323,17 @@ function getOrderInfo(orderCode){
if(result.data.status ==2){//卖家已发货,卖家可联系客服修改物流单号
$("#sellerWaybillCode").html('<input id="input_sellerWaybillCode" type="text" class="easyui-textbox" value="' + result.data.sellerWaybillCode + '"/>');
}
//订单类型是预售订单还是普通订单
var attributes = result.data.attributes;
var attributesStr = '普通现货订单';
if("2" == attributes){
attributesStr = '线下店订单';
}else if("3" == attributes){
attributesStr = '急速发货订单';
}else if("4" == attributes){
attributesStr = '普通预售';
}
$("#preSellOrNormal").html(attributesStr);
//收货信息
//鉴定前,买家可联系客服修改收货信息
... ...
... ... @@ -75,6 +75,7 @@
<option value="20">已取消(质检不通过取消)</option>
<option value="21">已取消(瑕疵确认不通过取消)</option>
<option value="22">已取消(瑕疵确认超时取消)</option>
<option value="23">已取消(商品无法鉴定)</option>
</select>
<br><br>
... ...
... ... @@ -628,7 +628,7 @@
var limitInfo = new Array();
for (var x of limitSaleInfoMap) { // 遍历Map
if(myTrim(x[1].uid)=="" || myTrim(x[1].per) == ""){
if(myTrim(x[1].uid)==""){
$.messager.alert('操作提示', '请填写有效的可售卖家信息!');
return false;
}
... ... @@ -910,10 +910,11 @@
});
function addRowSetValue(uid,percent) {
tempIndex++;
if(percent==null || percent=="null") percent = "";
var rowStr ="<tr>";
rowStr += "<td><input id=\"uid" +tempIndex+ "\" style=\"width: 90px;height: 15px\"></td>";
rowStr += "<td><input id=\"per" +tempIndex+ "\" style=\"width: 70px;height: 15px\"></td>";
rowStr += "<td><a rowid=\"" +tempIndex+ "\" class=\"easyui-linkbutton btn-delete\" style=\"float: right;color: red;height: 20px\" onclick='{if(confirm(\"确定要删除吗?\")) {deleteCurrentRow(this); }else {}}'>删除行</a></td>";
rowStr += "<td><a rowid=\"" +tempIndex+ "\" class=\"easyui-linkbutton btn-delete\" style=\"float: right;color: red;height: 20px\" onclick='{ var that = this;$.messager.confirm(\"操作提示\", \"确定要删除吗?\", function (data) { if(data) deleteCurrentRow(that);})}'>删除行</a></td>";
rowStr += "</tr>";
$("#uidListTable").append(rowStr);
$.parser.parse($("#addLimitSaleBtn").parent());
... ... @@ -925,7 +926,7 @@
var rowStr ="<tr>";
rowStr += "<td><input id=\"uid" +tempIndex+ "\" style=\"width: 90px;height: 15px\"></td>";
rowStr += "<td><input id=\"per" +tempIndex+ "\" style=\"width: 70px;height: 15px\"></td>";
rowStr += "<td><a rowid=\"" +tempIndex+ "\" class=\"easyui-linkbutton btn-delete\" style=\"float: right;color: red;height: 20px\" onclick='{if(confirm(\"确定要删除吗?\")) {deleteCurrentRow(this); }else {}}'>删除行</a></td>";
rowStr += "<td><a rowid=\"" +tempIndex+ "\" class=\"easyui-linkbutton btn-delete\" style=\"float: right;color: red;height: 20px\" onclick='{ var that = this;$.messager.confirm(\"操作提示\", \"确定要删除吗?\", function (data) { if(data) deleteCurrentRow(that);})}'>删除行</a></td>";
rowStr += "</tr>";
$("#uidListTable").append(rowStr);
$.parser.parse($("#addLimitSaleBtn").parent());
... ...