记得上下班打卡 | git大法好,push需谨慎

Commit da308c8e authored by 张国柄's avatar 张国柄

Merge remote-tracking branch 'origin/dev_goblin' into dev_goblin

parents 5f3c31b2 6f30af6e
......@@ -32,6 +32,8 @@ public class GoblinGoodsSkuInfoDetailVo implements Serializable, Cloneable {
private String skuAppear;
@ApiModelProperty(position = 11, value = "商品ID[64]")
private String spuId;
@ApiModelProperty(position = 12, value = "库存是否告警,true 告警,false没有告警")
private boolean stockLess;
private static final GoblinGoodsSkuInfoDetailVo obj = new GoblinGoodsSkuInfoDetailVo();
......
......@@ -42,6 +42,8 @@ public class GoblinSelfMarketingVo implements Serializable, Cloneable {
private String endTime;
@ApiModelProperty(value = "创建时间")
private String createdAt;
@ApiModelProperty(value = "店铺数量")
private Integer storeCount;
private static final GoblinSelfMarketingVo obj = new GoblinSelfMarketingVo();
......
......@@ -4,6 +4,7 @@ import com.liquidnet.client.admin.common.core.controller.BaseController;
import com.liquidnet.client.admin.common.core.page.TableDataInfo;
import com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinZhengzaiMarketService;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.GoblinSelfMarketingDto;
import com.liquidnet.service.goblin.dto.manage.GoblinInsertZhengzaiParam;
import com.liquidnet.service.goblin.dto.manage.GoblinStoreZhengzaiParam;
import com.liquidnet.service.goblin.dto.vo.GoblinMarketSpuListVo;
......@@ -50,9 +51,9 @@ public class GoblinSelfZhengzaiController extends BaseController {
@RequestParam(value = "endTime", required = false) String et,
@RequestParam(value = "createdAt", required = false) String ct) {
LocalDateTime now = LocalDateTime.now();
List<GoblinSelfMarketing> list = goblinZhengzaiMarketService.zhengzaiList(page, purchaseName, status, st, et, ct).getData();
List<GoblinSelfMarketingDto> list = goblinZhengzaiMarketService.zhengzaiList(page, purchaseName, status, st, et, ct).getData();
startPage();
for (GoblinSelfMarketing item : list) {
for (GoblinSelfMarketingDto item : list) {
if (item.getStatus() != 7) {
if (now.isBefore(item.getStartTime())) {
item.setStatus(0);
......
......@@ -170,7 +170,7 @@
<span class="labelName">适用范围:</span>
<div class="search_ipt" style="position: relative;display: inline;">
<input type="text" id="searchIpt" autocomplete="off" class="layui-input" placeholder="全部">
<ul id="dataList" style="position: absolute;"></ul>
<ul id="dataList" style="position: absolute;" onclick="selectGoods()"></ul>
</div>
<select name="bindType" id="selectTwo" placeholder="请选择场次">
<option value="">所有</option>
......@@ -289,14 +289,14 @@
};
function getMallList() {
let data = {
title: searchVal
name: searchVal
}
let str = '';
promiseMethods(phpMallUrl + '/admin/goodListForQuick','get',data,'application/x-www-form-urlencoded').then(res=>{
promiseMethods('/compilations/goodsList','get',data).then(res=>{
if (res.data.length>0) {
searchData = [...res.data];
searchData.forEach((item,index)=>{
str+= `<li class="selectData" onclick="selectOne('${item.id}','${item.title}')">${item.title}</li>`
str+= `<li class="selectData" onclick="selectOne('${item.spuId}','${item.name}')">${item.name}</li>`
})
$('#dataList').html(str);
} else {
......@@ -335,7 +335,7 @@
$('#selectTwo').empty().append(str);
$('#selectThree').empty();
};
$("#searchIpt").focus(function(){
$("#searchIpt").blur(function(){
if (typeOne == 2) {
getMallList()
} else {
......@@ -343,11 +343,14 @@
}
$('#dataList').show()
});
$("#searchIpt").blur(function(){
setTimeout(() => {
$('#dataList').hide()
}, 500);
});
// $("#searchIpt").blur(function(){
// setTimeout(() => {
// $('#dataList').hide()
// }, 500);
// });
function selectGoods(){
$('#dataList').hide()
}
$("#searchIpt").keyup(function(){
searchVal = $("#searchIpt").val()
// search()
......
......@@ -166,7 +166,7 @@
<span class="labelName">适用范围:</span>
<div class="search_ipt" style="position: relative;display: inline;">
<input type="text" id="searchIpt" autocomplete="off" class="layui-input" placeholder="全部">
<ul id="dataList" style="position: absolute;"></ul>
<ul id="dataList" style="position: absolute;" onclick="selectGoods()"></ul>
</div>
<select name="bindType" id="selectTwo" hidden>
<option value="">所有</option>
......@@ -283,14 +283,14 @@
};
function getMallList() {
let data = {
title: ''
name: ''
}
let str = '';
promiseMethods(phpMallUrl + '/admin/goodListForQuick','get',data,'application/x-www-form-urlencoded').then(res=>{
promiseMethods('/compilations/goodsList','get',data).then(res=>{
if (res.data.length>0) {
searchData = [...res.data];
searchData.forEach((item,index)=>{
str+= `<li class="selectData" onclick="selectOne('${item.id}','id')">${item.title}</li>`
str+= `<li class="selectData" onclick="selectOne('${item.spuId}','id')">${item.name}</li>`
})
$('#dataList').html(str);
} else {
......@@ -319,7 +319,7 @@
$('#selectTwo').empty().append(str);
$('#selectThree').empty();
};
$("#searchIpt").focus(function(){
$("#searchIpt").blur(function(){
if (typeOne == 2) {
getMallList()
} else {
......@@ -327,11 +327,14 @@
}
$('#dataList').show()
});
$("#searchIpt").blur(function(){
setTimeout(() => {
$('#dataList').hide()
}, 500);
});
// $("#searchIpt").blur(function(){
// setTimeout(() => {
// $('#dataList').hide()
// }, 500);
// });
function selectGoods(){
$('#dataList').hide()
}
$("#searchIpt").keyup(function(){
searchVal = $("#searchIpt").val()
search()
......
......@@ -173,7 +173,7 @@
<span class="labelName">适用范围:</span>
<div class="search_ipt" style="position: relative;display: inline;">
<input type="text" id="searchIpt" autocomplete="off" class="layui-input" placeholder="全部">
<ul id="dataList" style="position: absolute;"></ul>
<ul id="dataList" style="position: absolute;" onclick="selectGoods()"></ul>
</div>
<select name="bindType" id="selectTwo">
<option value="">所有</option>
......@@ -291,14 +291,14 @@
};
function getMallList() {
let data = {
title: searchVal
name: searchVal
}
let str = '';
promiseMethods(phpMallUrl + '/admin/goodListForQuick','get',data,'application/x-www-form-urlencoded').then(res=>{
promiseMethods('/compilations/goodsList','get',data).then(res=>{
if (res.data.length>0) {
searchData = [...res.data];
searchData.forEach((item,index)=>{
str+= `<li class="selectData" onclick="selectOne('${item.id}','${item.title}')">${item.title}</li>`
str+= `<li class="selectData" onclick="selectOne('${item.spuId}','${item.name}')">${item.name}</li>`
})
$('#dataList').html(str);
} else {
......@@ -337,7 +337,7 @@
$('#selectTwo').empty().append(str);
$('#selectThree').empty();
};
$("#searchIpt").focus(function(){
$("#searchIpt").blur(function(){
if (typeOne == 2) {
getMallList()
} else {
......@@ -345,11 +345,14 @@
}
$('#dataList').show()
});
$("#searchIpt").blur(function(){
setTimeout(() => {
$('#dataList').hide()
}, 500);
});
// $("#searchIpt").blur(function(){
// setTimeout(() => {
// $('#dataList').hide()
// }, 500);
// });
function selectGoods(){
$('#dataList').hide()
}
$("#searchIpt").keyup(function(){
searchVal = $("#searchIpt").val()
// search()
......
......@@ -163,7 +163,7 @@
<span class="labelName">适用范围:</span>
<div class="search_ipt" style="position: relative;display: inline;">
<input type="text" id="searchIpt" autocomplete="off" class="layui-input" placeholder="全部">
<ul id="dataList" style="position: absolute;"></ul>
<ul id="dataList" style="position: absolute;" onclick="selectGoods()"></ul>
</div>
</div>
<div class="discount">
......@@ -237,14 +237,14 @@
let sendTimeType = '';
function getMallList() {
let data = {
title: $('#searchIpt').val()
name: $('#searchIpt').val()
}
let str = '';
promiseMethods(phpMallUrl + '/admin/goodListForQuick','get',data,'application/x-www-form-urlencoded').then(res=>{
promiseMethods('/compilations/goodsList','get',data).then(res=>{
if (res.data.length>0) {
searchData = [...res.data];
searchData.forEach((item,index)=>{
str+= `<li class="selectData" onclick="selectOne('${item.id}','id')">${item.title}</li>`
str+= `<li class="selectData" onclick="selectOne('${item.spuId}','${item.name}')">${item.name}</li>`
})
$('#dataList').html(str);
} else {
......@@ -254,8 +254,8 @@
};
function selectOne(id,name) {
searchData.some(item => {
if (item[name] == id) {
return $("#searchIpt").val(item.title);
if (item.spuId == id) {
return $("#searchIpt").val(item.name);
}
})
showId = id;
......@@ -287,15 +287,18 @@
$('#dataOne1').show();
}
});
$("#searchIpt").focus(function(){
$("#searchIpt").blur(function(){
getMallList()
$('#dataList').show()
});
$("#searchIpt").blur(function(){
setTimeout(() => {
$('#dataList').hide()
}, 500);
});
// $("#searchIpt").blur(function(){
// setTimeout(() => {
// $('#dataList').hide()
// }, 500);
// });
function selectGoods(){
$('#dataList').hide()
}
$("#searchIpt").keyup(function(){
searchVal = $("#searchIpt").val()
getMallList()
......
......@@ -173,7 +173,7 @@
title: '创建时间'
},
{
field: 'comment',
field: 'storeCount',
title: '店铺数量'
},
{
......
package com.liquidnet.client.admin.zhengzai.goblin.service;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.dto.GoblinSelfMarketingDto;
import com.liquidnet.service.goblin.dto.manage.GoblinInsertZhengzaiParam;
import com.liquidnet.service.goblin.dto.vo.GoblinMarketSpuListVo;
import com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo;
......@@ -26,7 +27,7 @@ public interface IGoblinZhengzaiMarketService {
* @param ct 创建时间
* @return
*/
ResponseDto<List<GoblinSelfMarketing>> zhengzaiList(int page, String purchaseName, int status, String st, String et, String ct);
ResponseDto<List<GoblinSelfMarketingDto>> zhengzaiList(int page, String purchaseName, int status, String st, String et, String ct);
/**
* 正在状态操作
......
......@@ -10,6 +10,7 @@ import com.liquidnet.commons.lang.util.*;
import com.liquidnet.service.adam.dto.vo.AdamUserInfoVo;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.goblin.constant.GoblinStatusConst;
import com.liquidnet.service.goblin.dto.GoblinSelfMarketingDto;
import com.liquidnet.service.goblin.dto.GoblinZhengzaiStoreDetailsDto;
import com.liquidnet.service.goblin.dto.GoblinZhengzaiStoreListDto;
import com.liquidnet.service.goblin.dto.manage.GoblinInsertZhengzaiParam;
......@@ -50,33 +51,34 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
GoblinMarketingZhengzaiRelationMapper goblinMarketingZhengzaiRelationMapper;
@Override
public ResponseDto<List<GoblinSelfMarketing>> zhengzaiList(int page, String purchaseName, int status, String st, String et, String ct) {
LambdaUpdateWrapper<GoblinSelfMarketing> queryMapper = Wrappers.lambdaUpdate(GoblinSelfMarketing.getNew()).eq(GoblinSelfMarketing::getDelFlag, 0);
switch (status) {
case 0://未开始
queryMapper = queryMapper.gt(GoblinSelfMarketing::getStartTime, LocalDateTime.now()).ne(GoblinSelfMarketing::getStatus, GoblinStatusConst.MarketingStatus.STORE_PURCHASE_STATUS_STOP.getValue());
break;
case 1://进行中
queryMapper = queryMapper.le(GoblinSelfMarketing::getStartTime, LocalDateTime.now()).ge(GoblinSelfMarketing::getEndTime, LocalDateTime.now()).ne(GoblinSelfMarketing::getStatus, GoblinStatusConst.MarketingStatus.STORE_PURCHASE_STATUS_STOP.getValue());
break;
case 2://已结束
queryMapper = queryMapper.lt(GoblinSelfMarketing::getEndTime, LocalDateTime.now()).ne(GoblinSelfMarketing::getStatus, GoblinStatusConst.MarketingStatus.STORE_PURCHASE_STATUS_STOP.getValue());
break;
case 7://停用
queryMapper = queryMapper.eq(GoblinSelfMarketing::getStatus, GoblinStatusConst.MarketingStatus.STORE_PURCHASE_STATUS_STOP.getValue());
break;
}
if (!purchaseName.equals("")) {
queryMapper = queryMapper.like(GoblinSelfMarketing::getName, purchaseName);
}
if ((st != null && !st.equals("")) && (et != null && !et.equals(""))) {
queryMapper = queryMapper.ge(GoblinSelfMarketing::getStartTime, st).le(GoblinSelfMarketing::getEndTime, et);
}
if (ct != null && !ct.equals("")) {
queryMapper = queryMapper.eq(GoblinSelfMarketing::getCreatedAt, ct);
}
return ResponseDto.success(goblinSelfMarketingMapper.selectList(queryMapper));
public ResponseDto<List<GoblinSelfMarketingDto>> zhengzaiList(int page, String purchaseName, int status, String st, String et, String ct) {
// LambdaUpdateWrapper<GoblinSelfMarketing> queryMapper = Wrappers.lambdaUpdate(GoblinSelfMarketing.getNew()).eq(GoblinSelfMarketing::getDelFlag, 0);
// switch (status) {
// case 0://未开始
// queryMapper = queryMapper.gt(GoblinSelfMarketing::getStartTime, LocalDateTime.now()).ne(GoblinSelfMarketing::getStatus, GoblinStatusConst.MarketingStatus.STORE_PURCHASE_STATUS_STOP.getValue());
// break;
// case 1://进行中
// queryMapper = queryMapper.le(GoblinSelfMarketing::getStartTime, LocalDateTime.now()).ge(GoblinSelfMarketing::getEndTime, LocalDateTime.now()).ne(GoblinSelfMarketing::getStatus, GoblinStatusConst.MarketingStatus.STORE_PURCHASE_STATUS_STOP.getValue());
// break;
// case 2://已结束
// queryMapper = queryMapper.lt(GoblinSelfMarketing::getEndTime, LocalDateTime.now()).ne(GoblinSelfMarketing::getStatus, GoblinStatusConst.MarketingStatus.STORE_PURCHASE_STATUS_STOP.getValue());
// break;
// case 7://停用
// queryMapper = queryMapper.eq(GoblinSelfMarketing::getStatus, GoblinStatusConst.MarketingStatus.STORE_PURCHASE_STATUS_STOP.getValue());
// break;
// }
//
// if (!purchaseName.equals("")) {
// queryMapper = queryMapper.like(GoblinSelfMarketing::getName, purchaseName);
// }
// if ((st != null && !st.equals("")) && (et != null && !et.equals(""))) {
// queryMapper = queryMapper.ge(GoblinSelfMarketing::getStartTime, st).le(GoblinSelfMarketing::getEndTime, et);
// }
// if (ct != null && !ct.equals("")) {
// queryMapper = queryMapper.eq(GoblinSelfMarketing::getCreatedAt, ct);
// }
List<GoblinSelfMarketingDto> marketing = goblinSelfMarketingMapper.getZhengzaiList(purchaseName, status, st, et, ct);
return ResponseDto.success(marketing);
}
@Override
......
package com.liquidnet.service.goblin.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
* 官方(平台)营销表[活动]表
* </p>
*
* @author liquidnet
* @since 2021-12-27
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class GoblinSelfMarketingDto implements Serializable, Cloneable {
private static final long serialVersionUID = 1L;
private String selfMarketId;
private String performanceId;
private String performanceImg;
private String name;
private Integer type;
private Integer status;
private String describes;
private LocalDateTime startTime;
private LocalDateTime endTime;
private LocalDateTime createdAt;
private Integer storeCount;
}
package com.liquidnet.service.goblin.mapper;
import com.liquidnet.service.goblin.dto.GoblinSelfMarketingDto;
import com.liquidnet.service.goblin.dto.GoblinZhengzaiStoreDetailsDto;
import com.liquidnet.service.goblin.dto.GoblinZhengzaiStoreListDto;
import com.liquidnet.service.goblin.entity.GoblinSelfMarketing;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -20,4 +22,7 @@ public interface GoblinSelfMarketingMapper extends BaseMapper<GoblinSelfMarketin
List<GoblinZhengzaiStoreListDto> getZhengzaiStoreList(String marketId);
List<GoblinZhengzaiStoreDetailsDto> getZhengzaiStoreDetails(String marketId, String storeId);
List<GoblinSelfMarketingDto> getZhengzaiList(@Param("purchaseName") String purchaseName, @Param("status") int status,@Param("st") String st, @Param("et") String et, @Param("ct") String ct);
}
......@@ -24,6 +24,21 @@
<result column="buy_type" property="buyType"/>
</resultMap>
<resultMap id="goblinSelfMarketingDtoResult"
type="com.liquidnet.service.goblin.dto.GoblinSelfMarketingDto">
<result column="self_market_id" property="selfMarketId"/>
<result column="performance_id" property="performanceId"/>
<result column="performance_img" property="performanceImg"/>
<result column="name" property="name"/>
<result column="type" property="type"/>
<result column="status" property="status"/>
<result column="describes" property="describes"/>
<result column="start_time" property="startTime"/>
<result column="end_time" property="endTime"/>
<result column="created_at" property="createdAt"/>
<result column="store_count" property="storeCount"/>
</resultMap>
<select id="getZhengzaiStoreList" resultMap="goblinZhengzaiStoreListDtoResult">
select b.store_id,c.store_name,b.show_time,IFNull(count(d.spu_id),0) as 'spu_count',IFNull(count(d.sku_id),0) as 'sku_count' from goblin_self_marketing as a
......@@ -44,4 +59,27 @@ GROUP BY b.store_id
select sku_id from goblin_marketing_zhengzai where self_market_id = #{marketId} and store_id = #{storeId}
)
</select>
<select id="getZhengzaiList" resultMap="goblinSelfMarketingDtoResult">
select
gsm.mid,gsm.name,gsm.performance_id,gsm.performance_img,gsm.created_at,gsm.updated_at,gsm.type,gsm.status,gsm.start_time,gsm.end_time,gsm.self_market_id,gsm.describes,count(gmzr.store_id)
as 'store_count'
from goblin_self_marketing as gsm left join goblin_marketing_zhengzai_relation gmzr on gsm.self_market_id =
gmzr.self_market_id
<where>
del_flag = 0
<if test="purchaseName != null and purchaseName!=''">and gsm.name like concat('%', #{purchaseName}, '%') '%'</if>
<if test="ct != null and ct!=''">and gsm.created_at = #{ct}</if>
<if test="st != null and et != null and st != '' and et != ''">and and gsm.start_time <![CDATA[ >= ]]> #{st} and
gsm.end_time <![CDATA[ <= ]]> #{et}
</if>
<if test="status==0">and gsm.start_time <![CDATA[ >= ]]> NOW() and gsm.status!=7</if>
<if test="status==1">and gsm.start_time <![CDATA[ < ]]> NOW() and gsm.end_time <![CDATA[ > ]]> NOW() and gsm.status!=7
</if>
<if test="status==2">and gsm.end_time <![CDATA[ <= ]]> NOW() and gsm.status!=7</if>
<if test="status==7">and gsm.status!=7</if>
</where>
group by gsm.self_market_id
</select>
</mapper>
......@@ -36,7 +36,7 @@ public class GoblinStoreBackOrderController {
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "page", value = "页数"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "orderBackCode", value = "订单退款编号"),
@ApiImplicitParam(type = "form", required = false, dataType = "Integer", name = "type", value = "退款类型[0-全部|1-退款|2-退货|3-退款退货]"),
@ApiImplicitParam(type = "form", required = false, dataType = "Integer", name = "type", value = "退款类型[1-退款|2-退货|3-退款退货]"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "cst", value = "申请起始时间"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "cet", value = "申请终止时间"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "orderCode", value = "订单编号"),
......
......@@ -9,6 +9,7 @@ import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.constant.GoblinStatusConst;
import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.entity.*;
import com.liquidnet.service.goblin.enums.GoblinStoreConf;
import com.liquidnet.service.goblin.service.GoblinFrontService;
import com.liquidnet.service.goblin.util.GoblinMongoUtils;
import com.liquidnet.service.goblin.util.GoblinRedisUtils;
......@@ -257,6 +258,23 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
}
return goblinFrontSeckillVo;
}
//获取库存设置的报警数量
public int getStockCount(String storeId){
String configVal="";
List<GoblinStoreConfigVo> listVo=goblinRedisUtils.getStoreConfigVos(storeId);
//ONOFF_SOLD_OUT_SHOW ON 开启
for(GoblinStoreConfigVo goblinStoreConfigVo:listVo){
//获取是 售罄是否开启
if(goblinStoreConfigVo.getConfigKey().equals(GoblinStoreConf.LIMIT_WARNING_STOCK)){
configVal=goblinStoreConfigVo.getConfigVal();
}
}
if(StringUtil.isNotBlank(configVal)){
return Integer.parseInt(configVal);
}else{
return -1;
}
}
/**
* 获得商品详情
*/
......@@ -268,13 +286,23 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
goblinFrontGoodDetailVo.setGoblinGoodsInfoVo(goblinGoodsInfoDetailVo);
//skuIdList
if(null!=goblinGoodsInfoVo){
int limit= getStockCount(goblinGoodsInfoVo.getStoreId());
List<String> skuIdList=goblinGoodsInfoVo.getSkuIdList();
ArrayList<GoblinGoodsSkuInfoDetailVo> list=ObjectUtil.goblinGoodsSkuInfoDetailVos();
for(String sku:skuIdList){
GoblinGoodsSkuInfoVo goblinGoodsSkuInfoVo=goblinRedisUtils.getGoodsSkuInfoVo(sku);
GoblinGoodsSkuInfoDetailVo goblinGoodsSkuInfoDetailVo=GoblinGoodsSkuInfoDetailVo.getNew();
BeanUtils.copyProperties(goblinGoodsSkuInfoVo,goblinGoodsSkuInfoDetailVo);
list.add(goblinGoodsSkuInfoDetailVo);
if(null!=goblinGoodsSkuInfoVo){
//获取 sku 库存数量
int stock=goblinRedisUtils.getSkuStock(null,goblinGoodsSkuInfoVo.getSkuId());
GoblinGoodsSkuInfoDetailVo goblinGoodsSkuInfoDetailVo=GoblinGoodsSkuInfoDetailVo.getNew();
BeanUtils.copyProperties(goblinGoodsSkuInfoVo,goblinGoodsSkuInfoDetailVo);
if(limit>=stock){
goblinGoodsSkuInfoDetailVo.setStockLess(true);
}else{
goblinGoodsSkuInfoDetailVo.setStockLess(false);
}
list.add(goblinGoodsSkuInfoDetailVo);
}
}
//goblinGoodsInfoVo
GoblinStoreInfoVo goblinStoreInfoVo=this.getStore(goblinGoodsInfoVo.getStoreId());
......@@ -444,6 +472,15 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
return list1;
}
public GoblinFrontCategoryListVo getStoreGoodes(String storeId,String categoryId,String name){
String configVal="";
List<GoblinStoreConfigVo> listVo=goblinRedisUtils.getStoreConfigVos(storeId);
//ONOFF_SOLD_OUT_SHOW ON 开启
for(GoblinStoreConfigVo goblinStoreConfigVo:listVo){
//获取是 售罄是否开启
if(goblinStoreConfigVo.getConfigKey().equals(GoblinStoreConf.ONOFF_SOLD_OUT_SHOW)){
configVal=goblinStoreConfigVo.getConfigVal();
}
}
//
Query query = new Query();
query.addCriteria(Criteria.where("storeId").is(storeId).and("spuAppear").is("0").and("delFlg").is("0").and("shelvesStatus").is("3"));
......@@ -461,21 +498,22 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
query.with(Sort.by(Sort.Direction.DESC, "count"));
// 查询总数
List<GoblinGoodsInfoVo> list = mongoTemplate.find(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
/*if(list.size()>0){
//找到 销量
for(GoblinGoodsInfoVo goblinGoodsInfoVo:list){
Integer counts=goblinRedisUtils.getSpuSaleCount(goblinGoodsInfoVo.getSpuId());
if(counts==null){
goblinGoodsInfoVo.setCount(0);
}else{
goblinGoodsInfoVo.setCount(counts);
// 计算库存
Iterator<GoblinGoodsInfoVo> iterator = list.iterator();
//删掉库存没有的商品
while(iterator.hasNext()){
GoblinGoodsInfoVo goblinGoodsInfoVo=iterator.next();
List<String> skuIdList =goblinGoodsInfoVo.getSkuIdList();
int count=0;
for(String skuId:skuIdList){
count=count+goblinRedisUtils.getSkuStock(null,skuId);
}
if(StringUtil.isNotBlank(configVal)&&!configVal.equals("ON")){
if(count==0){
iterator.remove();
}
}
Collections.sort(list, new Comparator<GoblinGoodsInfoVo>() {
public int compare(GoblinGoodsInfoVo arg0, GoblinGoodsInfoVo arg1) {
return -(arg0.getCount().compareTo(arg1.getCount()));
}});
}*/
}
ArrayList<GoblinGoodsInfoListVo> listVos=ObjectUtil.getGoblinGoodsInfoListVo();
for(GoblinGoodsInfoVo goblinGoodsInfoVo:list){
GoblinGoodsInfoListVo goblinGoodsInfoListVo= GoblinGoodsInfoListVo.getNew();
......
......@@ -227,6 +227,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
backOrderSkuVo.setSpuId(orderSkuVo.getSpuId());
backOrderSkuVo.setSpuName(orderSkuVo.getSpuName());
backOrderSkuVo.setSkuId(orderSkuVo.getSkuId());
backOrderSkuVo.setSkuPic(orderSkuVo.getSkuImage());
backOrderSkuVo.setSkuName(orderSkuVo.getSkuName());
backOrderSkuVo.setRefundPrice(orderSkuVo.getSkuPriceActual());
backOrderSkuVo.setSkuSpecs(orderSkuVo.getSkuSpecs());
......@@ -268,8 +269,7 @@ public class GoblinOrderAppServiceImpl implements IGoblinOrderAppService {
backOrderLog.getBackOrderLogId(), backOrderLog.getBackOrderId(), backOrderLog.getOperationType(),
backOrderLog.getMessage(), backOrderLog.getOperationName(), backOrderLog.getStatus(), now
});
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_USER_ORDER_OPERA.getKey(),
SqlMapping.get("goblin_order.pay.again", SqlMapping.gets(sqls, applyRefund, orderStatus, orderSkuStatus, refundLog)));
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_USER_ORDER_OPERA.getKey(), SqlMapping.gets(sqls, applyRefund, orderStatus, orderSkuStatus, refundLog));
return ResponseDto.success();
}
......
......@@ -35,6 +35,7 @@ import java.time.format.DateTimeFormatter;
import java.util.*;
import static com.liquidnet.commons.lang.util.DateUtil.DTF_YMD_HMS;
import static com.liquidnet.commons.lang.util.DateUtil.getNowTime;
@Service
@Slf4j
......@@ -431,6 +432,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
//redis 赋值
orderVo.setOrderAttrVo(orderAttrVo);
orderVo.setOrderSkuVoIds(goblinOrderSkuIdList);
orderVo.setCreatedAt(getNowTime());
redisUtils.setGoblinOrder(orderVo.getOrderId(), orderVo);
redisUtils.setMasterCode(preParam.getOrderMasterCode(), preParam.getOrderIdList().substring(1));
mongoUtils.insertGoblinStoreOrderVo(orderVo);
......
......@@ -154,7 +154,7 @@ public class GoblinStoreBackOrderServiceImpl implements IGoblinStoreBackOrderSer
backOrderLog.setOperationType(GoblinStatusConst.Type.OPERATION_TYPE_2.getValue());
backOrderLog.setMessage("商户退款-同意退款:backOrderId=[" + backOrderId + "]");
//调用退款
GoblinStoreOrderVo orderVo = redisUtils.getGoblinOrder(backOrderId);
GoblinStoreOrderVo orderVo = redisUtils.getGoblinOrder(backOrderVo.getOrderId());
String returnString = initRefund(orderVo, backOrderVo.getRealBackPrice(), backOrderVo.getBackCode());
HashMap hashMapResult = JsonUtils.fromJson(returnString, HashMap.class);
Boolean success = (Boolean) hashMapResult.get("success");
......
......@@ -537,9 +537,10 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
}
backOrderVo.setStatus(GoblinStatusConst.Status.ORDER_BACK_STATUS_2.getValue());
backOrderVo.setRefundAt(nowStr);
List<GoblinOrderSkuVo> skuVoList = ObjectUtil.getGoblinOrderSkuVoArrayList();
for (GoblinBackOrderSkuVo backOrderSkuVo : backOrderSkuVos) {
GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(backOrderSkuVo.getOrderSkuId());
orderSkuVo.setPriceRefund(orderSkuVo.getPriceRefund().add(price));
orderSkuVo.setPriceRefund(orderSkuVo.getPriceRefund()==null?BigDecimal.ZERO:orderSkuVo.getPriceRefund().add(price));
if (orderSkuVo.getPriceRefund().compareTo(orderSkuVo.getSkuPriceActual()) == 0) {
orderSkuVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_6.getValue());
String pre = GoblinStatusConst.MarketPreStatus.getPre(orderSkuVo.getSkuId());
......
......@@ -867,7 +867,8 @@ public class GoblinMongoUtils {
query.skip(skipCount).limit(size);
query.fields().include("backCode").include("orderCode").include("backOrderId").include("type").include("status").include("realBackPrice").include("createdAt")
.include("backOrderSkuVos.spuName").include("backOrderSkuVos.skuName").include("backOrderSkuVos.spuPic").include("backOrderSkuVos.skuPic")
.include("backOrderSkuVos.skuSpecs");
.include("backOrderSkuVos.skuSpecs").include("backOrderSkuVos.skuId").include("backOrderSkuVos.spuId").include("backOrderSkuVos.orderSkuId")
.include("backOrderSkuVos.refundPrice");
List<GoblinBackOrderVo> dataList = mongoTemplate.find(query, GoblinBackOrderVo.class, GoblinBackOrderVo.class.getSimpleName());
//查询总数量
Query countQuery = Query.query(criteria);
......
......@@ -19,7 +19,8 @@ liquidnet:
password: admin
config:
# location: /Users/hujiachen/JavaProject/liquidnet-bus-v1/liquidnet-bus-config/liquidnet-config
location: /app/support-config
# location: /app/support-config
location: /Users/edy/Project/liquidnet-bus-v1/liquidnet-bus-config/liquidnet-config
# end-dev-这里是配置信息基本值
spring:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment