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

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

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

parents 8ef9dbe8 66c948e4
......@@ -20,4 +20,7 @@ public class SlimeRedisConst {
// 无敌账号
public static final String SUPER_ACCOUNT = PREFIX.concat("super:account:");
// 临时可扫二维码演出列表
public static final String QR_CODE_PERFORMANCE = PREFIX.concat("qrCode:performance");
}
......@@ -101,7 +101,7 @@ public class GoblinFrontSelectGoodsController extends BaseController {
* @Description:精选商品保存
* @date 2022/1/4 下午2:49
*/
@PostMapping("create")
/*@PostMapping("create")
@ApiOperation(value = "精选商品保存")
@ResponseBody
public AjaxResult create(@RequestBody GoblinFrontSelectGoodsParam goblinFrontSelectGoodsParam) {
......@@ -115,7 +115,7 @@ public class GoblinFrontSelectGoodsController extends BaseController {
return error("操作失败");
}
}
*/
/**
* @author zhangfuxin
* @Description:精选商品修改
......
......@@ -253,7 +253,72 @@
$("input[name=optionsRadios]").change(function(e){
$("#bannerList").empty();
count = e.target.value;
addItem (count);
promiseMethods('/goblin-front-cube/list', 'post').then(res => {
let { data } = res;
if (data && data.length > 0) {
let arr = data[0].spuId.split(',');
if (count == data[0].rowType) {
for (var i = 0; i < data.length; i++) {
let str = '';
str += `<div class="items" data-id="${data[i].mid}">
<div class="first_content">
<div class="hot_title">
页面属性:
</div>
<div class="tags">
<label>
<input type="radio" checked value="1" id="pageAttribute${i}" name="pageAttribute${i}"><span>单商品</span></label>
</div>
</div>
<div class="first_content" style="align-items: flex-start;">
<div class="hot_title">
选择商品:
</div>
<div class="tags_content" style="width: 553px;">
<div class="input-group">
<input id="goodsName${i}" data-id="${arr[i]}" type="text" class="form-control storeList" placeholder="${data[i].goblinGoods.name}">
<div class="input-group-btn">
<ul class="dropdown-menu dropdown-menu-right" role="menu">
</ul>
</div>
</div>
<div class="img_box">
<img id="goodsImg${i}" src="${data[i].goblinGoods.coverPic}" alt="" style="max-height: 180px;max-width:180px;margin: 12px 0;">
<p id="goodsTitle${i}" style="width:180px;">${data[i].goblinGoods.name}</p>
<p id="goodsPrice${i}">${data[i].goblinGoods.priceLe}</p>
</div>
<button id="del${i}" type="button" class="btn btn-danger" style="width: 60px;" onclick="del('${i}')">删除</button>
</div>
</div>
<div class="first_content" style="align-items: flex-start;">
<div class="hot_title">
推荐文案:
</div>
<div class="tags">`;
if (i == 0) {
str+= `<textarea id="text${i}" class="form-control txtIpt" value="" name="" style="width: 553px;height: 150px;">${data[i].informationA}</textarea>`
} else if (i == 1) {
str+= `<textarea id="text${i}" class="form-control txtIpt" value="" name="" style="width: 553px;height: 150px;">${data[i].informationB}</textarea>`
} else if (i == 2) {
str+= `<textarea id="text${i}" class="form-control txtIpt" value="" name="" style="width: 553px;height: 150px;">${data[i].informationC}</textarea>`
} else {
str+= `<textarea id="text${i}" class="form-control txtIpt" value="" name="" style="width: 553px;height: 150px;">${data[i].informationD}</textarea>`
}
str+=`</div>
</div>
</div>`
$("#bannerList").append(str);
common(i)
}
} else {
addItem (count);
}
} else {
addItem (count);
}
// refreshItem()
})
})
function addItem (num) {
let str = '';
......
package com.liquidnet.client.admin.zhengzai.goblin.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinFrontSelectGoodsService;
import com.liquidnet.common.cache.redis.util.RedisGoblinUtil;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.entity.GoblinFrontSelectGoods;
......@@ -15,7 +13,6 @@ import com.liquidnet.service.goblin.entity.GoblinGoods;
import com.liquidnet.service.goblin.mapper.GoblinFrontSelectGoodsMapper;
import com.liquidnet.service.goblin.mapper.GoblinGoodsMapper;
import com.liquidnet.service.goblin.param.GoblinFrontSelectGoodsParam;
import com.mongodb.BasicDBObject;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
......@@ -76,26 +73,64 @@ public class GoblinFrontSelectGoodsServiceImpl extends ServiceImpl<GoblinFrontSe
}
public boolean update(GoblinFrontSelectGoods goblinFrontSelectGoods){
if(goblinFrontSelectGoods.getMid()>0){
//清空精选商品
goblinFrontSelectGoodsMapper.deleteAll();
//重新创建
String spuIds=goblinFrontSelectGoods.getSpuId();
if(StringUtil.isNotBlank(spuIds)){
String[] spuIdss=spuIds.split(",");
int index=0;
for(String spuId:spuIdss){
index++;
GoblinFrontSelectGoods goblinFrontSelectGoods1=new GoblinFrontSelectGoods();
goblinFrontSelectGoods1.setIndexs(index);
goblinFrontSelectGoods1.setUpdateTime(LocalDateTime.now());
goblinFrontSelectGoods1.setDelTag(0);
goblinFrontSelectGoods1.setCreateTime(LocalDateTime.now());
goblinFrontSelectGoods1.setSelectGoodsId(IDGenerator.nextSnowId());
goblinFrontSelectGoods1.setSpuId(spuId);
goblinFrontSelectGoods1.setOrderType(goblinFrontSelectGoods.getOrderType());
goblinFrontSelectGoodsMapper.insert(goblinFrontSelectGoods1);
}
}
/* if(goblinFrontSelectGoods.getMid()>0){
goblinFrontSelectGoods.setUpdateTime(LocalDateTime.now());
goblinFrontSelectGoodsMapper.updateById(goblinFrontSelectGoods);
}else{
this.create(goblinFrontSelectGoods);
}
}*/
return true;
}
public List getList(){
LambdaQueryWrapper<GoblinFrontSelectGoods> queryWrapper = Wrappers.lambdaQuery(GoblinFrontSelectGoods.class);
queryWrapper.eq(GoblinFrontSelectGoods::getDelTag,0);
List<GoblinFrontSelectGoods> list= goblinFrontSelectGoodsMapper.selectList(queryWrapper);
List<GoblinGoods> goblinGoodsList =new ArrayList<>();
List<GoblinFrontSelectGoodsParam> goodsP =new ArrayList<>();
queryWrapper.orderByAsc(GoblinFrontSelectGoods::getIndexs);
List<GoblinFrontSelectGoods> list= goblinFrontSelectGoodsMapper.selectList(queryWrapper);
String spuIds="";
for(GoblinFrontSelectGoods goblinFrontSelectGoods:list){
String spuids=goblinFrontSelectGoods.getSpuId();
if(StringUtil.isNotBlank(spuids)){
String[] spuIds=spuids.split(",");
for(String id:spuIds){
if(StringUtil.isBlank(spuIds)){
spuIds=goblinFrontSelectGoods.getSpuId();
}else{
spuIds=spuIds+","+goblinFrontSelectGoods.getSpuId();
}
}
if(list.size()>0){
GoblinFrontSelectGoods p=list.get(0);
GoblinFrontSelectGoods a=new GoblinFrontSelectGoods();
a.setOrderType(p.getOrderType());
a.setSelectGoodsId(spuIds);
a.setCreateTime(p.getCreateTime());
a.setDelTag(p.getDelTag());
a.setUpdateTime(p.getUpdateTime());
a.setSpuId(spuIds);
a.setSelectGoodsId("1");
a.setMid(1l);
List<GoblinGoods> goblinGoodsList =new ArrayList<>();
List<GoblinFrontSelectGoodsParam> goodsP =new ArrayList<>();
if(StringUtil.isNotBlank(spuIds)){
String[] dd=spuIds.split(",");
for(String id:dd){
LambdaQueryWrapper<GoblinGoods> queryWrappers = Wrappers.lambdaQuery(GoblinGoods.class);
queryWrappers.ne(GoblinGoods::getDelFlg,"1");
queryWrappers.eq(GoblinGoods::getSpuId,id);
......@@ -104,35 +139,29 @@ public class GoblinFrontSelectGoodsServiceImpl extends ServiceImpl<GoblinFrontSe
goblinGoodsList.add(goodsList.get(0));
}
}
GoblinFrontSelectGoodsParam goblinFrontSelectGoodsParam=new GoblinFrontSelectGoodsParam();
BeanUtils.copyProperties(a,goblinFrontSelectGoodsParam);
goblinFrontSelectGoodsParam.setGoblinGoodsList(goblinGoodsList);
goodsP.add(goblinFrontSelectGoodsParam);
return goodsP;
}
GoblinFrontSelectGoodsParam goblinFrontSelectGoodsParam=new GoblinFrontSelectGoodsParam();
BeanUtils.copyProperties(goblinFrontSelectGoods,goblinFrontSelectGoodsParam);
goblinFrontSelectGoodsParam.setGoblinGoodsList(goblinGoodsList);
goodsP.add(goblinFrontSelectGoodsParam);
}else{
return null;
}
return goodsP;
return null;
}
public boolean online(){
//查询
LambdaQueryWrapper<GoblinFrontSelectGoods> queryWrapper = Wrappers.lambdaQuery(GoblinFrontSelectGoods.class);
queryWrapper.eq(GoblinFrontSelectGoods::getDelTag,0);
queryWrapper.orderByAsc(GoblinFrontSelectGoods::getIndexs);
List<GoblinFrontSelectGoods> list=goblinFrontSelectGoodsMapper.selectList(queryWrapper);
//删除 mogndob
Query query = Query.query(Criteria.where("delTag").is("0"));
mongoTemplate.findAllAndRemove(query, GoblinFrontSelectGoods.class);
if(list.size()>0){
//放入mongodb
GoblinFrontSelectGoods goblinFrontSelectGoods= list.get(0);
GoblinFrontSelectGoods goblinFrontSelectGoods1= mongoTemplate.findOne(Query.query(Criteria.where("selectGoodsId").is(goblinFrontSelectGoods.getSelectGoodsId())), GoblinFrontSelectGoods.class, GoblinFrontSelectGoods.class.getSimpleName());
if(null==goblinFrontSelectGoods1){
for(GoblinFrontSelectGoods goblinFrontSelectGoods:list){
mongoTemplate.save(goblinFrontSelectGoods,GoblinFrontSelectGoods.class.getSimpleName());
}else{
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontSelectGoods)));
mongoTemplate.getCollection(GoblinFrontSelectGoods.class.getSimpleName()).updateOne(
Query.query(Criteria.where("selectGoodsId").is(goblinFrontSelectGoods.getSelectGoodsId())).getQueryObject(),
orderObject
);
}
redisGoblinUtil.set(GoblinRedisConst.SELECT_GOODS,list);
}
......
......@@ -41,6 +41,10 @@ public class GoblinFrontSelectGoods implements Serializable {
*/
private Integer delTag;
/*顺序
*/
private Integer indexs;
/**
* 创建时间
*/
......
......@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 精选商品
* 精选商品
Mapper 接口
* </p>
*
......@@ -13,5 +13,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @since 2022-01-04
*/
public interface GoblinFrontSelectGoodsMapper extends BaseMapper<GoblinFrontSelectGoods> {
public void deleteAll();
}
<?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.liquidnet.service.goblin.mapper.GoblinFrontSelectGoodsMapper">
<delete id="deleteAll">
delete from goblin_front_select_goods
</delete>
</mapper>
......@@ -56,7 +56,7 @@ goblin.self.market.delSpuRelation=UPDATE goblin_marketing_zhengzai SET del_flag
#---- 订单创建&支付
goblin.order.create.order_insert=INSERT INTO goblin_store_order (`master_order_code`,`order_id`,`store_id`,`store_name`,`order_code`,`user_id`,`user_name`,`user_mobile`,`price_total`,`price_actual`,`price_refund`,`price_express`,`price_coupon`,`price_voucher`,`status`,`ucoupon_id`,`pay_type`,`device_from`,`source`,`version`,`is_member`,`order_type`,`write_off_code`,`pay_countdown_minute`,`ip_address`,`pay_code`,`market_id`,`market_type`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin.order.create.attr_insert=INSERT INTO goblin_order_attr (`order_attr_id`,`order_id`,`express_contacts`,`express_address`,`express_address_detail`,`express_phone`,`express_type`,`created_at`) VALUES (?,?,?,?,?,?,?,?)
goblin.order.create.sku_insert=INSERT INTO goblin_order_sku (`order_sku_id`,`order_id`,`spu_id`,`spu_name`,`spu_pic`,`sku_id`,`num`,`sku_price`,`sku_price_actual`,`sku_name`,`sku_no`,`sku_image`,`sku_specs`,`price_voucher`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin.order.create.sku_insert=INSERT INTO goblin_order_sku (`order_sku_id`,`order_id`,`spu_id`,`spu_name`,`spu_pic`,`sku_id`,`num`,`sku_price`,`sku_price_actual`,`sku_name`,`sku_no`,`sku_image`,`sku_specs`,`price_voucher`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin_order.pay.order=UPDATE goblin_store_order SET payment_type = ? ,payment_id=?,pay_code = ? ,pay_time = ?,write_off_code = ? ,status = ? ,updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
goblin_order.pay.sku=UPDATE goblin_order_sku SET status = ? ,updated_at = ? WHERE order_sku_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
#---- 再次支付
......
......@@ -8,6 +8,7 @@ import com.liquidnet.service.kylin.dto.vo.middle.KylinBuyNoticeVo;
import com.liquidnet.service.kylin.service.partner.IKylinBuyNoticePartnerService;
import com.liquidnet.service.slime.util.InnerUtils;
import com.liquidnet.service.slime.util.PerformanceUtils;
import com.liquidnet.service.slime.util.RedisSlimeUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
......@@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
/**
......@@ -39,6 +41,8 @@ public class KylinBuyNoticeParnterController {
InnerUtils innerUtils;
@Autowired
PerformanceUtils performanceUtils;
@Autowired
RedisSlimeUtils redisSlimeUtils;
@GetMapping(value = "buyNotice")
@ApiOperation(value = "购票须知列表", position = 1)
......@@ -65,4 +69,11 @@ public class KylinBuyNoticeParnterController {
public ResponseDto<List<KylinExpressModuleVo>> getExpressList() {
return buyNoticePartnerService.getExpressList();
}
@GetMapping(value = "qrPerformance")
@ApiOperation(value = "可扫二维码的演出列表", position = 1)
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<List<HashMap<String, String>>> qrPerformance() {
return ResponseDto.success(redisSlimeUtils.qrPerformance());
}
}
package com.liquidnet.service.slime.util;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.service.kylin.constant.KylinRedisConst;
import com.liquidnet.service.kylin.dto.vo.KylinExpressModuleVo;
import com.liquidnet.service.kylin.dto.vo.middle.KylinBuyNoticeVo;
......@@ -12,6 +13,8 @@ import com.liquidnet.service.slime.service.SlimeRdmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@Component
......@@ -272,4 +275,25 @@ public class RedisSlimeUtils {
String redisKey = SlimeRedisConst.SUPER_ACCOUNT.concat(merchantId);
return redisUtil.hasKey(redisKey);
}
/**
* 是否为超级权限账户
*
* @return
*/
public List<HashMap<String, String>> qrPerformance() {
String redisKey = SlimeRedisConst.QR_CODE_PERFORMANCE;
Object obj = redisUtil.get(redisKey);
if (obj == null) {
List<HashMap<String, String>> listMap = new ArrayList<>();
HashMap<String, String> map = CollectionUtil.mapStringString();
map.put("name", "测试演出");
map.put("id", "112233");
listMap.add(map);
redisUtil.set(redisKey, listMap);
return listMap;
} else {
return (List<HashMap<String, String>>) redisUtil.get(redisKey);
}
}
}
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