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

Commit 9d4b230f authored by jiangxiulong's avatar jiangxiulong

Merge remote-tracking branch 'origin/master' into jxl_0322

parents 93c68082 bcb9c7a4
......@@ -24,7 +24,7 @@ public interface IGoblinOrderAppService {
ResponseDto<List<GoblinBackOrderVo>> refundDetails(String orderId);
String huiFuSync(HttpServletRequest request);
// String huiFuSync(HttpServletRequest request);
ResponseDto<List<GoblinMailVo>> getMail(String orderId, String mailId);
}
......@@ -8,6 +8,7 @@ import com.liquidnet.service.goblin.param.PayAgainParam;
import com.liquidnet.service.goblin.param.RefundCallbackParam;
import com.liquidnet.service.goblin.param.SyncOrderParam;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
public interface IGoblinOrderService {
......@@ -24,4 +25,7 @@ public interface IGoblinOrderService {
ResponseDto<Integer> checkOrderResultMaterCode(String materCode);
String huiFuSync(HttpServletRequest request);
}
......@@ -13,7 +13,7 @@ import java.util.HashMap;
public interface IGoblinStoreMoneyService {
ResponseDto<HashMap<String,String>> money(String spuId);
ResponseDto<HashMap<String,String>> money(String spuId,String st,String et);
ResponseDto<PageInfo<GoblinOrderLogVo>> getSpuList(String spuName, String st, String et, int page);
......
......@@ -48,7 +48,7 @@ public class GoblinSelfCategoryAdminController extends BaseController {
@ResponseBody
public TableDataInfo list() {
PageHelper.startPage(0, 1000, "mid");
return getDataTable(goblinSelfGoodsCategoryService.listForForMultiGrade());
return getDataTable(goblinSelfGoodsCategoryService.listForMultiGrade());
}
@ApiOperation(value = "筛选")
......@@ -76,6 +76,7 @@ public class GoblinSelfCategoryAdminController extends BaseController {
return AjaxResult.warn("无效参数");
}
queryWrapper.eq(GoblinSelfGoodsCategory::getGrade, grade);
queryWrapper.eq(GoblinSelfGoodsCategory::getDelFlg, "0");
queryWrapper.select(GoblinSelfGoodsCategory::getCateId, GoblinSelfGoodsCategory::getName, GoblinSelfGoodsCategory::getIcon, GoblinSelfGoodsCategory::getNeIsbn);
queryWrapper.orderByAsc(GoblinSelfGoodsCategory::getCateId);
......@@ -114,6 +115,11 @@ public class GoblinSelfCategoryAdminController extends BaseController {
switch (grade) {
case "1":
selfGoodsCategory.setCatePid(null);
queryWrapper.eq(GoblinSelfGoodsCategory::getGrade, "1");
queryWrapper.eq(GoblinSelfGoodsCategory::getName, name.trim());
if (goblinSelfGoodsCategoryService.count(queryWrapper) > 0) {
return AjaxResult.warn("分类名称重复,请核实");
}
break;
case "2":
queryWrapper.eq(GoblinSelfGoodsCategory::getCateId, catePid).eq(GoblinSelfGoodsCategory::getGrade, "1");
......@@ -121,6 +127,12 @@ public class GoblinSelfCategoryAdminController extends BaseController {
if (null == catePidObj) {
return AjaxResult.warn("父级分类无效");
}
if (catePidObj.getName().equals(name.trim())) {
return AjaxResult.warn("分类名称与父级分类重复,请核实");
}
if (goblinSelfGoodsCategoryService.countForMatchName(catePid, name.trim()) > 0) {
return AjaxResult.warn("分类名称重复,请核实");
}
break;
case "3":
queryWrapper.eq(GoblinSelfGoodsCategory::getCateId, catePid).eq(GoblinSelfGoodsCategory::getGrade, "2");
......@@ -128,16 +140,16 @@ public class GoblinSelfCategoryAdminController extends BaseController {
if (null == catePidObj) {
return AjaxResult.warn("父级分类无效");
}
if (catePidObj.getName().equals(name.trim())) {
return AjaxResult.warn("分类名称与父级分类重复,请核实");
}
if (goblinSelfGoodsCategoryService.countForMatchName(catePidObj.getCatePid(), name.trim()) > 0) {
return AjaxResult.warn("分类名称重复,请核实");
}
break;
default:
return AjaxResult.warn("分类层级无效");
}
queryWrapper.clear();
queryWrapper.eq(GoblinSelfGoodsCategory::getDelFlg, "0");
queryWrapper.eq(GoblinSelfGoodsCategory::getName, name.trim());
if (goblinSelfGoodsCategoryService.count(queryWrapper) > 0) {
return AjaxResult.warn("分类名称重复,请核实");
}
selfGoodsCategory.setCateId(IDGenerator.nextMilliId2());
selfGoodsCategory.setDelFlg("0");
......
......@@ -16,7 +16,9 @@ import java.util.List;
*/
public interface IGoblinSelfGoodsCategoryService extends IService<GoblinSelfGoodsCategory> {
List<GoblinSelfGoodsCategoryDto> listForForMultiGrade();
int countForMatchName(String cateFid, String name);
List<GoblinSelfGoodsCategoryDto> listForMultiGrade();
boolean addSave(GoblinSelfGoodsCategory selfGoodsCategory);
......
......@@ -46,9 +46,14 @@ public class GoblinSelfGoodsCategoryServiceImpl extends ServiceImpl<GoblinSelfGo
private RedisDataSourceUtil redisDataSourceUtil;
@Override
public List<GoblinSelfGoodsCategoryDto> listForForMultiGrade() {
public int countForMatchName(String cateFid, String name) {
return goblinSelfGoodsCategoryMapper.countForMatchName(cateFid, name);
}
@Override
public List<GoblinSelfGoodsCategoryDto> listForMultiGrade() {
goblinSelfGoodsCategoryMapper.statsForForMultiGrade();
List<GoblinSelfGoodsCategoryDto> dtos = goblinSelfGoodsCategoryMapper.listForForMultiGrade();
List<GoblinSelfGoodsCategoryDto> dtos = goblinSelfGoodsCategoryMapper.listForMultiGrade();
if (!CollectionUtils.isEmpty(dtos)) {
dtos.forEach(dto -> {
if (StringUtils.isNotEmpty(dto.getTcateId())) {
......
......@@ -102,6 +102,7 @@ global-auth:
- ${liquidnet.info.context}/order/syncOrder
- ${liquidnet.info.context}/goblin/syncOrder
- ${liquidnet.info.context}/goblin/refundSyncOrder
- ${liquidnet.info.context}/goblin/paySuccess
# -----------------------------------------------------------
# -----------------------------------------------------------
......
......@@ -28,43 +28,61 @@ public interface GoblinSelfGoodsCategoryMapper extends BaseMapper<GoblinSelfGood
// ) t ON t.cate_id=gsgc.cate_id
//SET gsgc.counts=t.ct
//WHERE gsgc.del_flg='0'
@Update("UPDATE goblin_self_goods_category gsgc\n" +
"INNER JOIN (\n" +
" SELECT cate_fid cate_id,count(1) ct FROM goblin_goods WHERE cate_fid IS NOT NULL AND del_flg='0' group by cate_fid\n" +
" UNION ALL\n" +
" SELECT cate_sid cate_id,count(1) ct FROM goblin_goods WHERE cate_sid IS NOT NULL AND del_flg='0' group by cate_sid\n" +
" UNION ALL\n" +
" SELECT cate_tid cate_id,count(1) ct FROM goblin_goods WHERE cate_tid IS NOT NULL AND del_flg='0' group by cate_tid\n" +
" ) t ON t.cate_id=gsgc.cate_id\n" +
"SET gsgc.counts=t.ct\n" +
@Update("UPDATE goblin_self_goods_category gsgc " +
"INNER JOIN (" +
" SELECT cate_fid cate_id,count(1) ct FROM goblin_goods WHERE cate_fid IS NOT NULL AND del_flg='0' group by cate_fid " +
" UNION ALL " +
" SELECT cate_sid cate_id,count(1) ct FROM goblin_goods WHERE cate_sid IS NOT NULL AND del_flg='0' group by cate_sid " +
" UNION ALL " +
" SELECT cate_tid cate_id,count(1) ct FROM goblin_goods WHERE cate_tid IS NOT NULL AND del_flg='0' group by cate_tid " +
" ) t ON t.cate_id=gsgc.cate_id " +
"SET gsgc.counts=t.ct " +
"WHERE gsgc.del_flg='0'")
int statsForForMultiGrade();
// SELECT cf.cate_id AS fcateId, cf.name AS fname, cf.icon AS ficon, cf.ne_isbn AS fneIsbn, cf.counts AS fcounts , cs.cate_id AS scateId, cs.name AS sname, cs.icon AS sicon, cs.ne_isbn AS sneIsbn, cs.counts AS scounts , ct.cate_id AS tcateId, ct.name AS tname, ct.icon AS ticon, ct.ne_isbn AS tneIsbn, ct.counts AS tcounts FROM goblin_self_goods_category cf LEFT JOIN ( SELECT cate_id, name, icon, grade, ne_isbn , counts, cate_pid FROM goblin_self_goods_category WHERE grade = '2' AND del_flg = '0' ) cs ON cs.cate_pid = cf.cate_id LEFT JOIN ( SELECT cate_id, name, icon, grade, ne_isbn , counts, cate_pid FROM goblin_self_goods_category WHERE grade = '3' AND del_flg = '0' ) ct ON ct.cate_pid = cs.cate_id WHERE cf.grade = '1' AND del_flg = '0'
@Select({"select cf.cate_id fcateId,\n" +
" cf.name fname,\n" +
" cf.icon ficon,\n" +
" cf.ne_isbn fneIsbn,\n" +
" cf.counts fcounts,\n" +
" cs.cate_id scateId,\n" +
" cs.name sname,\n" +
" cs.icon sicon,\n" +
" cs.ne_isbn sneIsbn,\n" +
" cs.counts scounts,\n" +
" ct.cate_id tcateId,\n" +
" ct.name tname,\n" +
" ct.icon ticon,\n" +
" ct.ne_isbn tneIsbn,\n" +
" ct.counts tcounts\n" +
"from goblin_self_goods_category cf\n" +
" left join (\n" +
" select cate_id, name, icon, grade, ne_isbn, counts, cate_pid from goblin_self_goods_category where grade = '2' and del_flg = '0'\n" +
") cs on cs.cate_pid = cf.cate_id\n" +
" left join (\n" +
" select cate_id, name, icon, grade, ne_isbn, counts, cate_pid from goblin_self_goods_category where grade = '3' and del_flg = '0'\n" +
") ct on ct.cate_pid = cs.cate_id\n" +
@Select({"select cf.cate_id fcateId," +
" cf.name fname," +
" cf.icon ficon," +
" cf.ne_isbn fneIsbn," +
" cf.counts fcounts," +
" cs.cate_id scateId," +
" cs.name sname," +
" cs.icon sicon," +
" cs.ne_isbn sneIsbn," +
" cs.counts scounts," +
" ct.cate_id tcateId," +
" ct.name tname," +
" ct.icon ticon," +
" ct.ne_isbn tneIsbn," +
" ct.counts tcounts " +
"from goblin_self_goods_category cf " +
" left join (" +
" select cate_id, name, icon, grade, ne_isbn, counts, cate_pid from goblin_self_goods_category where grade = '2' and del_flg = '0' " +
") cs on cs.cate_pid = cf.cate_id " +
" left join (" +
" select cate_id, name, icon, grade, ne_isbn, counts, cate_pid from goblin_self_goods_category where grade = '3' and del_flg = '0' " +
") ct on ct.cate_pid = cs.cate_id " +
"where cf.grade = '1' and del_flg = '0'"})
List<GoblinSelfGoodsCategoryDto> listForForMultiGrade();
List<GoblinSelfGoodsCategoryDto> listForMultiGrade();
List<String> listForMultiGradeCateId(@Param("cateIdArr") String[] cateIdArr);
// SELECT count(1) AS ct FROM ( SELECT gsgc2.cate_id, gsgc2.name, gsgc2.grade, gsgc2.cate_pid FROM goblin_self_goods_category gsgc2 WHERE gsgc2.del_flg = '0' AND gsgc2.cate_pid = '2268131118729' AND gsgc2.name = 'CD' UNION SELECT gsgc3.cate_id, gsgc3.name, gsgc3.grade, gsgc3.cate_pid FROM goblin_self_goods_category gsgc2 LEFT JOIN goblin_self_goods_category gsgc3 ON gsgc2.cate_id = gsgc3.cate_pid AND gsgc3.grade = '3' WHERE gsgc2.del_flg = '0' AND gsgc2.cate_pid = '2268131118729' AND gsgc3.name = 'CD' ) t
@Select({"select count(1) ct " +
"from (" +
" SELECT gsgc2.cate_id, gsgc2.name, gsgc2.grade, gsgc2.cate_pid " +
" from goblin_self_goods_category gsgc2 " +
" where gsgc2.del_flg = '0' " +
" and gsgc2.cate_pid = #{cateFid} " +
" and gsgc2.name = #{name} " +
" union " +
" SELECT gsgc3.cate_id, gsgc3.name, gsgc3.grade, gsgc3.cate_pid " +
" from goblin_self_goods_category gsgc2 " +
" left join goblin_self_goods_category gsgc3 on gsgc2.cate_id = gsgc3.cate_pid and gsgc3.grade = '3' " +
" where gsgc2.del_flg = '0' " +
" and gsgc2.cate_pid = #{cateFid} " +
" and gsgc3.name = #{name} " +
" ) t"})
int countForMatchName(@Param("cateFid") String cateFid, @Param("name") String name);
}
......@@ -389,7 +389,7 @@ public class CandyCouponServiceImpl implements ICandyCouponService {
isTarget = false;
}
if (isTarget && !ruleItem.getBusiId().equals("")) {
if (isTarget && ruleItem.getBusiId() != null && !ruleItem.getBusiId().equals("")) {
targetIds.add(ruleItem.getBusiId());
}
}
......
......@@ -79,10 +79,10 @@ public class GoblinStoreZhengzaiController {
return goblinOrderAppService.orderDetails(orderId, null);
}
@PostMapping("paySuccess")
@ApiOperation("汇付支付成功回调")
@ResponseBody
public String refundDetails(HttpServletRequest request) {
return goblinOrderAppService.huiFuSync(request);
}
// @PostMapping("paySuccess")
// @ApiOperation("汇付支付成功回调")
// @ResponseBody
// public String refundDetails(HttpServletRequest request) {
// return goblinOrderAppService.huiFuSync(request);
// }
}
......@@ -280,7 +280,7 @@ public class GoblinStoreMgtGoodsController {
{// 标签处理
List<String> goodsTagIdList = storeMgtGoodsAddParam.getTagList(),
goodsExtagIdList = storeMgtGoodsAddParam.getExtagList(),
goodsArtagIdList = storeMgtGoodsAddParam.getExtagList();
goodsArtagIdList = storeMgtGoodsAddParam.getArtagList();
if (!CollectionUtils.isEmpty(goodsTagIdList)) {
List<GoblinSelfTagVo> selfGoodsTagVos = goblinRedisUtils.getSelfTagVos();
List<GoblinGoodsTagVo> goodsTagVoList = ObjectUtil.getGoblinGoodsTagVoArrayList();
......
......@@ -32,10 +32,14 @@ public class GoblinStoreMoneyController {
@ApiOperation("商品资金总收入")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "spuId", value = "spuId"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "st", value = "开始时间"),
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "et", value = "截至时间"),
})
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<HashMap<String,String>> money(@RequestParam(value = "spuId", required = false) String spuId) {
return goblinStoreMoneyService.money(spuId);
public ResponseDto<HashMap<String, String>> money(@RequestParam(value = "spuId", required = false) String spuId,
@RequestParam(value = "st", required = false) String st,
@RequestParam(value = "et", required = false) String et) {
return goblinStoreMoneyService.money(spuId, st, et);
}
@GetMapping("spu/list")
......
......@@ -463,8 +463,8 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
// query.addCriteria(Criteria.where("name").regex(pattern).and("spuAppear").is("0").and("delFlg").is("0").and("shelvesStatus").is("3"));
query.addCriteria(Criteria.where("spuAppear").is("0").and("delFlg").is("0").and("shelvesStatus").is("3").and("marketId").is(null));
query.with(Sort.by(
Sort.Order.desc("count"),
Sort.Order.desc("createdAt")
//Sort.Order.desc("count"),
Sort.Order.desc("shelvesAt")
));
List<GoblinGoodsInfoVo> list = mongoTemplate.find(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
ArrayList<GoblinGoodsInfoListVo> list1=ObjectUtil.getGoblinGoodsInfoListVo();
......@@ -520,7 +520,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
Pattern pattern = Pattern.compile("^.*"+name+".*$", Pattern.CASE_INSENSITIVE);
query.addCriteria(Criteria.where("name").regex(pattern));
}
query.with(Sort.by(Sort.Direction.DESC, "count"));
query.with(Sort.by(Sort.Direction.DESC, "shelvesAt"));
// 查询总数
List<GoblinGoodsInfoVo> list = mongoTemplate.find(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
// 计算库存
......@@ -631,23 +631,23 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
Pageable pageable=null;
//
if(type.equals("1")){
pageable = PageRequest.of(page, pageSize, Sort.by(Sort.Direction.DESC, "count"));
pageable = PageRequest.of(page, pageSize, Sort.by(Sort.Direction.DESC, "count","createdAt"));
}else if(type.equals("2")){
pageable = PageRequest.of(page, pageSize, Sort.by(Sort.Direction.DESC, "shelvesAt"));
pageable = PageRequest.of(page, pageSize, Sort.by(Sort.Direction.DESC, "shelvesAt","createdAt"));
}else if(type.equals("3")){
Document source = new Document();
source.put("locale", "zh");
source.put("numericOrdering", true);
Collation collation = Collation.from(source);
query.collation(collation);
pageable = PageRequest.of(page, pageSize, Sort.by(Sort.Direction.DESC, "priceGe"));
pageable = PageRequest.of(page, pageSize, Sort.by(Sort.Direction.DESC, "priceGe","createdAt"));
}else if(type.equals("4")){
Document source = new Document();
source.put("locale", "zh");
source.put("numericOrdering", true);
Collation collation = Collation.from(source);
query.collation(collation);
pageable = PageRequest.of(page, pageSize, Sort.by(Sort.Direction.ASC, "priceGe"));
pageable = PageRequest.of(page, pageSize, Sort.by(Sort.Direction.ASC, "priceGe","createdAt"));
}
// 排序 分页
// Query query = Query.query(Criteria.where("status").ne(1).and("status").ne(0));
......@@ -689,7 +689,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
if(sortType==1){
sortName = Sort.by(Sort.Direction.DESC, "shelvesAt");
}else if(sortType==2){
sortName = Sort.by(Sort.Direction.DESC, "count");
sortName = Sort.by(Sort.Direction.DESC, "count","createdAt");
}else if(sortType==3){
Document source = new Document();
source.put("locale", "zh");
......
......@@ -895,10 +895,16 @@ public class GoblinStoreMgtGoodsServiceImpl implements IGoblinstoreMgtGoodsServi
});
LinkedList<String> toMqSqls = CollectionUtil.linkedListString();
toMqSqls.add(SqlMapping.get("goblin_goods.update_by_shelves"));
LinkedList<Object[]> updateGoodsObjs = CollectionUtil.linkedListObjectArr();
String shelvesStatus = shelvesFlg ? "3" : "1";
spuIdList.forEach(spuId -> updateGoodsObjs.add(new Object[]{shelvesStatus, now, uid, now, spuId, storeId}));
LinkedList<Object[]> updateGoodsObjs = CollectionUtil.linkedListObjectArr();
if (shelvesFlg) {
toMqSqls.add(SqlMapping.get("goblin_goods.update_by_shelves"));
spuIdList.forEach(spuId -> updateGoodsObjs.add(new Object[]{shelvesStatus, now, uid, now, spuId, storeId}));
} else {
toMqSqls.add(SqlMapping.get("goblin_goods.update_by_unshelves"));
spuIdList.forEach(spuId -> updateGoodsObjs.add(new Object[]{"1", shelvesStatus, now, uid, now, spuId, storeId}));
}
toMqSqls.add(SqlMapping.get("goblin_goods_sku.update_by_shelves"));
LinkedList<Object[]> updateGoodsSkuObjs = CollectionUtil.linkedListObjectArr();
spuIdList.forEach(spuId -> updateGoodsSkuObjs.add(new Object[]{shelvesStatus, now, uid, now, spuId, storeId}));
......
......@@ -25,13 +25,13 @@ public class GoblinStoreMoneyServiceImpl implements IGoblinStoreMoneyService {
GoblinMongoUtils mongoUtils;
@Override
public ResponseDto<HashMap<String,String>> money(String spuId) {
public ResponseDto<HashMap<String,String>> money(String spuId,String st,String et) {
String uid = CurrentUtil.getCurrentUid();
GoblinStoreInfoVo vo = redisUtils.getStoreInfoVoByUid(uid);
if (vo == null) {
return ResponseDto.failure("店铺不存在");
}
String data = mongoUtils.storeMoney(vo.getStoreId(), spuId);
String data = mongoUtils.storeMoney(vo.getStoreId(), spuId,st,et);
String[] array = data.split(",");
HashMap<String,String> map = CollectionUtil.mapStringString();
map.put("name",array[0]);
......
......@@ -43,6 +43,8 @@ import java.util.List;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static com.liquidnet.commons.lang.util.DateUtil.DTF_YMD_HMS;
@Component
public class GoblinMongoUtils {
@Autowired
......@@ -445,6 +447,7 @@ public class GoblinMongoUtils {
return mongoTemplate.findOne(Query.query(Criteria.where("storeId").is(storeId).and("name").is(name).and("delFlg").is("0")),
GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
}
public long countMgtGoodsInfoVo(String name) {
return mongoTemplate.count(Query.query(Criteria.where("name").is(name).and("delFlg").is("0")),
GoblinGoodsInfoVo.class.getSimpleName());
......@@ -507,8 +510,12 @@ public class GoblinMongoUtils {
}
public boolean updateGoodsInfoVoByShelves(String storeId, List<String> spuIdList, boolean shelvesFlg, String uid, LocalDateTime time) {
Update update = Update.update("shelvesStatus", shelvesFlg ? "3" : "1").set("shelvesAt", time).set("updatedBy", uid).set("updatedAt", time);
if (!shelvesFlg) {
update.set("shelvesHandle", "1");
}
return mongoTemplate.updateMulti(Query.query(Criteria.where("storeId").is(storeId).and("spuId").in(spuIdList.toArray())),
Update.update("shelvesStatus", shelvesFlg ? "3" : "1").set("shelvesAt", time).set("updatedBy", uid).set("updatedAt", time),
update,
GoblinGoodsInfoVo.class.getSimpleName()).getModifiedCount() > 0;
}
......@@ -806,9 +813,14 @@ public class GoblinMongoUtils {
}
//店铺总收入
public String storeMoney(String storeId, String spuId) {
public String storeMoney(String storeId, String spuId, String st, String et) {
String spuName = "店铺总收入";
Criteria criteria = Criteria.where("status").in(GoblinStatusConst.Status.ORDER_LOG_STATUS_11.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_22.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_28.getValue()).and("storeId").is(storeId);
if (st != null && et != null) {
LocalDateTime stDateTime = LocalDateTime.parse(st, DTF_YMD_HMS);
LocalDateTime etDateTime = LocalDateTime.parse(et, DTF_YMD_HMS);
criteria = criteria.and("createdAt").gte(stDateTime).lt(etDateTime);
}
Aggregation aggregation;
if (spuId != null) {
criteria = criteria.and("spuId").is(spuId);
......@@ -857,10 +869,12 @@ public class GoblinMongoUtils {
List<GoblinGoodsInfoVo> spuIdAndName = null;
Criteria criteria = Criteria.where("status").in(GoblinStatusConst.Status.ORDER_LOG_STATUS_11.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_22.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_28.getValue()).and("storeId").is(storeId);
if (st != null && et != null) {
criteria = criteria.and("createdAt").gte(st).lt(et);
LocalDateTime stDateTime = LocalDateTime.parse(st, DTF_YMD_HMS);
LocalDateTime etDateTime = LocalDateTime.parse(et, DTF_YMD_HMS);
criteria = criteria.and("createdAt").gte(stDateTime).lt(etDateTime);
}
//查询总数量
Query countQuery = Query.query(criteria);
Query countQuery = Query.query(criteria).with(Sort.by(Sort.Order.desc("createdAt")));
countQuery.fields().include("spuId");
List<GoblinOrderLogVo> countList = mongoTemplate.find(countQuery, GoblinOrderLogVo.class, GoblinOrderLogVo.class.getSimpleName());
List<String> spuIdList = countList.stream().map(GoblinOrderLogVo::getSpuId).distinct().collect(Collectors.toList());
......@@ -870,7 +884,7 @@ public class GoblinMongoUtils {
}
if (spuName != null) {
//根据spu名称查询spuId
Query query = Query.query(Criteria.where("name").regex(".*?" + spuName + ".*").and("storeId").is(storeId));
Query query = Query.query(Criteria.where("name").regex(".*?" + spuName + ".*").and("storeId").is(storeId)).with(Sort.by(Sort.Order.desc("createdAt")));
query.fields().include("spuId").include("name");
spuIdAndName = mongoTemplate.find(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
spuIdList = spuIdAndName.stream().map(GoblinGoodsInfoVo::getSpuId).collect(Collectors.toList());
......@@ -878,7 +892,7 @@ public class GoblinMongoUtils {
finalCount = spuIdList.size();
}
}
if(finalCount>0){
if (finalCount > 0) {
spuIdList = spuIdList.subList(skipCount, finalCount);
}
criteria = criteria.and("spuId").in(spuIdList);
......@@ -886,10 +900,12 @@ public class GoblinMongoUtils {
//查询聚合数据
Aggregation aggregation = Aggregation.newAggregation(
Aggregation.match(criteria),
Aggregation.project("spuId", "skuPriceActual"),
Aggregation.project("spuId", "skuPriceActual","orderType"),
Aggregation.group("spuId")
.first("spuId").as("spuId")
.sum("skuPriceActual").as("skuPriceActual")
.first("orderType").as("orderType")
.sum("skuPriceActual").as("skuPriceActual"),
Aggregation.sort(Sort.by(Sort.Order.desc("spuId")))
);
AggregationResults<GoblinOrderLogVo> outputType = mongoTemplate.aggregate(aggregation, GoblinOrderLogVo.class.getSimpleName(), GoblinOrderLogVo.class);
List<GoblinOrderLogVo> dataList = new ArrayList(outputType.getMappedResults());
......@@ -920,7 +936,9 @@ public class GoblinMongoUtils {
int skipCount = ((page - 1) * size);
Criteria criteria = Criteria.where("spuId").is(spuId);
if (st != null && et != null) {
criteria = criteria.and("createdAt").gte(st).lt(et);
LocalDateTime stDateTime = LocalDateTime.parse(st, DTF_YMD_HMS);
LocalDateTime etDateTime = LocalDateTime.parse(et, DTF_YMD_HMS);
criteria = criteria.and("createdAt").gte(stDateTime).lt(etDateTime);
}
if (orderCode != null) {
criteria = criteria.and("orderCode").is(orderCode);
......@@ -940,7 +958,7 @@ public class GoblinMongoUtils {
criteria = criteria.and("orderType").is("zhengzai").and("status").in(22, 28);
break;
}
}else{
} else {
criteria = criteria.and("status").in(
GoblinStatusConst.Status.ORDER_LOG_STATUS_11.getValue(),
GoblinStatusConst.Status.ORDER_LOG_STATUS_22.getValue(),
......@@ -1192,7 +1210,7 @@ public class GoblinMongoUtils {
//根据艺人标签和演出查询商品
public List<GoblinGoodsInfoVo> getMusicTagPGoods(String musicTag, String performanceId) {
Query query = Query.query(Criteria.where("extagVoList.tagName").is(musicTag)
Query query = Query.query(Criteria.where("artagVoList.tagName").is(musicTag)
.and("delFlg").is("0").and("shelvesStatus").is("3"));
return mongoTemplate.find(query,
GoblinGoodsInfoVo.class,
......
......@@ -1216,9 +1216,9 @@ public class GoblinRedisUtils {
// String rk = GoblinRedisConst.REDIS_ZZ_MUSIC_TAG.concat(musicTag + ":").concat(performanceId);
// Object obj = redisUtil.get(rk);
// if (obj == null) {
listVo = goblinMongoUtils.getMusicTagPGoods(musicTag, performanceId);
// redisUtil.set(rk, listVo);
return listVo;
listVo = goblinMongoUtils.getMusicTagPGoods(musicTag, performanceId);
// redisUtil.set(rk, listVo, 60 * 30);
return listVo;
// } else {
// return (List<GoblinGoodsInfoVo>) obj;
// }
......
......@@ -36,7 +36,8 @@ goblin_goods_sku_spec_value.update_by_del_sku=UPDATE goblin_goods_sku_spec_value
#---- 商品信息
goblin_goods.insert=INSERT INTO goblin_goods (spu_id,spu_no,name,subtitle,sell_price, price_ge,price_le,intro,details,cover_pic, video,spec_mode,store_id,cate_fid,cate_sid, cate_tid,store_cate_fid,store_cate_sid,store_cate_tid,brand_id, shelves_handle,shelves_time,spu_validity,virtual_flg,status, shelves_status,spu_appear,shelves_at,created_by,created_at, logistics_template)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin_goods.update_by_edit=UPDATE goblin_goods SET spu_no=?,name=?,subtitle=?,sell_price=?,intro=?,details=?,cover_pic=?,video=?,spec_mode=?,cate_fid=?,cate_sid=?,cate_tid=?,shelves_handle=?,shelves_time=?,spu_validity=?,virtual_flg=?,logistics_template=?,updated_by=?,updated_at=? WHERE spu_id=? AND del_flg='0'
goblin_goods.update_by_shelves=UPDATE goblin_goods SET shelves_status=?,shelves_at=?,updated_by=?,updated_at=? WHERE spu_id=? AND store_id=? AND spu_appear='0'
goblin_goods.update_by_shelves=UPDATE goblin_goods SET shelves_status=?,shelves_at=?,updated_by=?,updated_at=? WHERE spu_id=? AND store_id=? AND spu_appear='0'
goblin_goods.update_by_unshelves=UPDATE goblin_goods SET shelves_handle=?,shelves_status=?,shelves_at=?,updated_by=?,updated_at=? WHERE spu_id=? AND store_id=? AND spu_appear='0'
goblin_goods.update_by_status=UPDATE goblin_goods SET spu_appear=?,updated_by=?,updated_at=? WHERE store_id=? AND del_flg='0'
goblin_goods.update_by_edit_sku=UPDATE goblin_goods SET price_ge=?,price_le=?,updated_by=?,updated_at=? WHERE spu_id=? AND del_flg='0'
goblin_goods.update_by_del_sku=UPDATE goblin_goods SET price_ge=?,price_le=?,updated_by=?,updated_at=? WHERE spu_id=? AND del_flg='0'
......
......@@ -14,6 +14,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
@Slf4j
......@@ -53,6 +54,13 @@ public class GoblinOrderController {
return goblinAppOrderService.refundSyncOrder(refundCallbackParam);
}
@PostMapping("paySuccess")
@ApiOperation("汇付支付成功回调")
@ResponseBody
public String refundDetails(HttpServletRequest request) {
return goblinAppOrderService.huiFuSync(request);
}
@PostMapping("payAgain")
@ApiOperation("再次支付")
@ApiResponse(code = 200, message = "接口返回对象参数")
......
......@@ -101,7 +101,53 @@ public class AlOssController {
try {
if (null == ossFile || (isCutFrame > 0 && ossFile.getVideoImg().isEmpty())) { //保证上传过的文件也能截帧
// 上传
ossFile = this.uploadOssFile(file, pathName, buckType, resize, fileNew, isCutFrame);
ossFile = this.uploadOssFile(file, pathName, buckType, resize, fileNew, isCutFrame, true);
}
} finally {
// 删除临时文件 因为老文件也生成了所以也要删除
FilesUtils.deleteTempFile(fileNew);
}
if (null == ossFile) {
return ResponseDto.failure("上传失败,该文件不合规,请勿上传带有联系方式、色情、涉政、广告等敏感文件");
} else {
BeanUtils.copyProperties(ossFile, uploadVo);
return ResponseDto.success(uploadVo);
}
}
@PostMapping("/upload/unsm")
@ApiOperation("阿里云上传-不鉴黄")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", dataType = "File", name = "file", value = "文件", required = true),
@ApiImplicitParam(type = "form", dataType = "String", name = "pathName", value = "归类的文件夹名称 比如banner上传就传 banner 返回的地址就会是bnanner/XXX", defaultValue = "test"),
@ApiImplicitParam(type = "form", dataType = "Integer", name = "buckType", value = "buckType 1正常的任何文件上传 2apk上传", defaultValue = "1"),
@ApiImplicitParam(type = "form", dataType = "Integer", name = "resize", value = "resize", defaultValue = "0"),
@ApiImplicitParam(type = "form", dataType = "Integer", name = "isCutFrame", value = "是否截取帧数 用于视频获取图片 0不需要 1需要", defaultValue = "0"),
})
public ResponseDto<UploadVo> uploadUnSm(
@RequestParam MultipartFile file,
@RequestParam(defaultValue = "other") String pathName,
@RequestParam(defaultValue = "1", required = false) int buckType,
@RequestParam(defaultValue = "0", required = false) int resize,
@RequestParam(defaultValue = "0", required = false) int isCutFrame
) {
if (file.equals("") || file.getSize() <= 0) {
return ResponseDto.failure("不能上传大小为0的文件");
}
File fileNew = FilesUtils.multipartFileToFile(file);
if (null == fileNew) {
return ResponseDto.failure("multipartFileToFile Error");
}
// 是否上传过 有直接返回
PlatformOssFiles ossFile = this.getOldOssFile(fileNew);
UploadVo uploadVo = new UploadVo();
try {
if (null == ossFile || (isCutFrame > 0 && ossFile.getVideoImg().isEmpty())) { //保证上传过的文件也能截帧
// 上传
ossFile = this.uploadOssFile(file, pathName, buckType, resize, fileNew, isCutFrame, false);
}
} finally {
// 删除临时文件 因为老文件也生成了所以也要删除
......@@ -146,7 +192,7 @@ public class AlOssController {
* @param fileNew
* @return
*/
private PlatformOssFiles uploadOssFile(MultipartFile file, String pathName, int buckType, int resize, File fileNew, int isCutFrame) {
private PlatformOssFiles uploadOssFile(MultipartFile file, String pathName, int buckType, int resize, File fileNew, int isCutFrame, Boolean isShuMei) {
OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
int size = 0;
String filename, contentType, uploadPath = "";
......@@ -167,10 +213,12 @@ public class AlOssController {
PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, uploadPath, fileNew);
ossClient.putObject(putObjectRequest);
if (contentType.contains("image") && !contentType.equals("image/vnd.adobe.photoshop")) {
if (!shumeiUtil.checkImage(IDGenerator.nextSnowId(), imgUrl.concat(uploadPath))) {
ossClient.deleteObject(bucketName, uploadPath);
return null;
if (isShuMei) {
if (contentType.contains("image") && !contentType.equals("image/vnd.adobe.photoshop")) {
if (!shumeiUtil.checkImage(IDGenerator.nextSnowId(), imgUrl.concat(uploadPath))) {
ossClient.deleteObject(bucketName, uploadPath);
return null;
}
}
}
......@@ -238,7 +286,7 @@ public class AlOssController {
private PlatformOssFiles ossFileCutFrame(String ossFileUrl, String pathName, int buckType) {
String style = "?x-oss-process=video/snapshot,t_0,f_jpg,w_0,h_0,m_fast,ar_auto";
File fileNew = FilesUtils.inputStreamToFile(imgUrl.concat(ossFileUrl).concat(style), System.currentTimeMillis() + ".jpg");
return this.uploadOssFile(null, pathName, buckType, 0, fileNew, 0);
return this.uploadOssFile(null, pathName, buckType, 0, fileNew, 0,false);
}
@PostMapping("/uploadUrl")
......
......@@ -40,7 +40,8 @@ public class PlatformGoblinGoodsTaskController {
queryWrapper.eq(GoblinGoods::getSpuAppear, "0");
queryWrapper.eq(GoblinGoods::getShelvesHandle, "3");
queryWrapper.le(GoblinGoods::getShelvesTime, now);
queryWrapper.eq(GoblinGoods::getShelvesStatus, "0");
// queryWrapper.eq(GoblinGoods::getShelvesStatus, "0");
queryWrapper.in(GoblinGoods::getShelvesStatus, "0", "1");
queryWrapper.orderByAsc(GoblinGoods::getShelvesTime);
queryWrapper.select(GoblinGoods::getSpuId);
......@@ -53,7 +54,7 @@ public class PlatformGoblinGoodsTaskController {
try {
platformGoblinGoodsService.shelvesProcessing(spuIdList);
} catch (Exception e) {
log.error("商品上架处理[totalCount={},spuIdList={}]", totalCount, JsonUtils.toJson(spuIdList));
log.error("Ex.商品上架处理[totalCount={},spuIdList={}],{}", totalCount, JsonUtils.toJson(spuIdList), e.getMessage());
return ResponseDto.failure(String.format("商品上架处理失败[totalCount=%s]", totalCount));
}
}
......
......@@ -19,12 +19,12 @@ public class DataController {
private DataImpl data;
@PostMapping("phpGoodsOrder")
@ApiOperation("php今年订单迁移")
public ResponseDto<Boolean> fieldData() {
data.fieldData();
return ResponseDto.success();
}
// @PostMapping("phpGoodsOrder")
// @ApiOperation("php今年订单迁移")
// public ResponseDto<Boolean> fieldData() {
// data.fieldData();
// return ResponseDto.success();
// }
// @PostMapping("fieldData")
// @ApiOperation("场地数据迁移")
......
......@@ -51,9 +51,10 @@ public class PlatformGoblinGoodsService extends ServiceImpl<GoblinGoodsMapper, G
updateSkuWrapper.in(GoblinGoodsSku::getSpuId, spuIdList);
updateSkuWrapper.eq(GoblinGoodsSku::getDelFlg, "0");
LiquidnetServiceException liquidnetServiceException = new LiquidnetServiceException();
if (goblinGoodsSkuMapper.update(updateSku, updateSkuWrapper) > 0) {
UpdateResult updateSpuResult = mongoTemplate.getCollection(GoblinGoodsInfoVo.class.getSimpleName()).updateMany(
Query.query(Criteria.where("spuId").in(spuIdList).and("shelvesStatus").is("0").and("shelvesHandle").is("3")).getQueryObject(),
Query.query(Criteria.where("spuId").in(spuIdList).and("shelvesStatus").in("0", "1").and("shelvesHandle").is("3")).getQueryObject(),
Update.update("shelvesStatus", "3").set("shelvesAt", now).getUpdateObject()
);
if (updateSpuResult.getModifiedCount() > 0) {
......@@ -83,10 +84,15 @@ public class PlatformGoblinGoodsService extends ServiceImpl<GoblinGoodsMapper, G
Query.query(Criteria.where("spuId").in(spuIdList).and("shelvesAt").is(now)).getQueryObject(),
Update.update("shelvesStatus", "0").set("shelvesAt", of).getUpdateObject()
);
liquidnetServiceException.setMessage("更新失败:Mongo.GoblinGoodsSkuInfoVo");
}
} else {
liquidnetServiceException.setMessage("更新失败:Mongo.GoblinGoodsInfoVo");
}
} else {
liquidnetServiceException.setMessage("更新失败:Mysql.GoblinGoodsSku");
}
throw new LiquidnetServiceException();
throw liquidnetServiceException;
}
}
}
package com.liquidnet.service.platform.service.impl.goblin;
import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo;
import com.liquidnet.service.platform.utils.GoblinRedisUtils;
import com.liquidnet.service.platform.utils.QueueUtils;
......@@ -59,6 +60,9 @@ public class SpuGoodsInfoImpl {
obj);
}
log.info("执行完毕");
goblinRedisUtils.del(GoblinRedisConst.SELECT_GOODS_SPUIDS);
goblinRedisUtils.del(GoblinRedisConst.SELECT_GOODS_PAGE1);
goblinRedisUtils.del(GoblinRedisConst.SELECT_GOODS_SPUIDS_ISHAVE);
return true;
}
}
......@@ -9,6 +9,7 @@ import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.feign.stone.api.FeignStoneIntegralClient;
import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.constant.GoblinStatusConst;
import com.liquidnet.service.goblin.dto.vo.GoblinMailVo;
import com.liquidnet.service.goblin.dto.vo.GoblinOrderAttrVo;
import com.liquidnet.service.goblin.dto.vo.GoblinOrderSkuVo;
import com.liquidnet.service.goblin.dto.vo.GoblinStoreOrderVo;
......@@ -74,7 +75,7 @@ public class DataImpl {
" m.matter_num as 'master_order_code',\n" +
" m.matter_num as 'order_code',\n" +
" m.out_trade_no as 'pay_code',\n" +
" ifnull(user_id, user_id_new) as 'user_id',\n" +
" m.user_id_new as 'user_id',\n" +
" m.matter_amount as 'price_total',\n" +
" (m.matter_amount - m.coupon_type2_price) as 'price_actual',\n" +
" m.price_send as 'price_express',\n" +
......@@ -93,10 +94,14 @@ public class DataImpl {
" m.post_phone as 'express_phone',\n" +
" m.post_address as 'express_address',\n" +
" m.post_address as 'express_address_detail',\n" +
" m.created_at as 'created_at'\n" +
"from matters as m\n" +
" m.created_at as 'created_at',\n" +
" e.name as 'logistics_company',\n" +
" e.status as 'express_status',\n" +
" e.number as 'mail_no',\n" +
" e.created_at as 'delivery_time'\n" +
"from matters as m left join expresses as e on e.order_id = m.id and e.order_type = 'order_product'\n" +
"where m.status = 1\n" +
" and m.created_at >= '2022-01-01 00:00:00'";
" and m.created_at >= '2022-01-01 00:00:00' group by m.id;";
Connection connection = DriverManager.getConnection(SQL_URL, SQL_USER, SQL_PWD);
//查询数据
PreparedStatement preparedStatement = connection.prepareStatement(sql);
......@@ -107,7 +112,18 @@ public class DataImpl {
orderVo.setStoreId("dab4742921ba3555700896c4fafbee5b");
orderVo.setStoreName("摩登天空自营店");
orderVo.setPayCountdownMinute(5);
orderVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_4.getValue());
//判断快递状态
String express_status = row.getString("express_status");
if (express_status == null) {
orderVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_2.getValue());
} else {
if (express_status.equals("3")) {
orderVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_4.getValue());
} else {
orderVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_3.getValue());
}
}
orderVo.setOrderId(row.getString("order_id"));
orderVo.setMasterOrderCode(row.getString("master_order_code"));
orderVo.setOrderCode(row.getString("order_code"));
......@@ -163,7 +179,7 @@ public class DataImpl {
while (rowSku.next()) {
GoblinOrderSkuVo skuVo = GoblinOrderSkuVo.getNew();
skuVo.setOrderId(orderVo.getOrderId());
skuVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_4.getValue());
skuVo.setStatus(orderVo.getStatus());
skuVo.setOrderSkuId(rowSku.getString("order_sku_id"));
skuVo.setSpuId(rowSku.getString("spu_id"));
skuVo.setSkuId(rowSku.getString("sku_id"));
......@@ -172,15 +188,27 @@ public class DataImpl {
skuVo.setSkuPriceActual(rowSku.getBigDecimal("sku_price_actual"));
skuVo.setSkuName(rowSku.getString("sku_specs"));
skuVo.setSkuImage(rowSku.getString("sku_image"));
skuVo.setSkuSpecs("[{\"specName\":\""+rowSku.getString("sku_name")+"\",\"specVname\":\""+rowSku.getString("sku_specs")+"\"}]");//
skuVo.setSkuSpecs("[{\"specName\":\"" + rowSku.getString("sku_name") + "\",\"specVname\":\"" + rowSku.getString("sku_specs") + "\"}]");//
skuVo.setSpuName(rowSku.getString("spu_name"));
skuVo.setCreatedAt(orderVo.getCreatedAt());
setGoblinOrderSku(skuVo.getOrderSkuId(), skuVo);
orderSkuIds.add(skuVo.getOrderSkuId());
}
//判断快递
if (express_status != null) {
GoblinMailVo mailVo = GoblinMailVo.getNew();
mailVo.setMailId(IDGenerator.nextTimeId2());
mailVo.setOrderId(orderVo.getOrderId());
mailVo.setMailNo(row.getString("mail_no"));
mailVo.setDeliveryTime(row.getString("delivery_time"));
mailVo.setLogisticsCompany(row.getString("logistics_company"));
mailVo.setOrderSkuVoIds(orderSkuIds);
setGoblinMail(orderVo.getOrderId(), mailVo);
}
orderVo.setOrderSkuVoIds(orderSkuIds);
setGoblinOrder(orderVo.getOrderId(),orderVo);
addOrderList(orderVo.getUserId(),orderVo.getOrderId());
setGoblinOrder(orderVo.getOrderId(), orderVo);
// addOrderList(orderVo.getUserId(), orderVo.getOrderId());
rowSku.close();
preparedStatementSku.close();
......@@ -227,4 +255,18 @@ public class DataImpl {
return (List<String>) obj;
}
}
// 赋值 快递vo
public void setGoblinMail(String orderId, GoblinMailVo vo) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_MAIL.concat(orderId);
List<GoblinMailVo> list = goblinMailVoList();
list.add(vo);
redisDataSourceUtil.getRedisKylinUtil().set(redisKey, list);
}
private static final ArrayList<GoblinMailVo> goblinMailVo = new ArrayList<>();
public static ArrayList<GoblinMailVo> goblinMailVoList() {
return (ArrayList<GoblinMailVo>) goblinMailVo.clone();
}
}
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