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

Commit 2c27fc67 authored by 张国柄's avatar 张国柄

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

parents f8a635e7 70a88d0d
...@@ -13,7 +13,7 @@ import java.util.HashMap; ...@@ -13,7 +13,7 @@ import java.util.HashMap;
public interface IGoblinStoreMoneyService { 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); ResponseDto<PageInfo<GoblinOrderLogVo>> getSpuList(String spuName, String st, String et, int page);
......
...@@ -32,10 +32,14 @@ public class GoblinStoreMoneyController { ...@@ -32,10 +32,14 @@ public class GoblinStoreMoneyController {
@ApiOperation("商品资金总收入") @ApiOperation("商品资金总收入")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "form", required = false, dataType = "String", name = "spuId", value = "spuId"), @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 = "接口返回对象参数") @ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<HashMap<String,String>> money(@RequestParam(value = "spuId", required = false) String spuId) { public ResponseDto<HashMap<String, String>> money(@RequestParam(value = "spuId", required = false) String spuId,
return goblinStoreMoneyService.money(spuId); @RequestParam(value = "st", required = false) String st,
@RequestParam(value = "et", required = false) String et) {
return goblinStoreMoneyService.money(spuId, st, et);
} }
@GetMapping("spu/list") @GetMapping("spu/list")
......
...@@ -25,13 +25,13 @@ public class GoblinStoreMoneyServiceImpl implements IGoblinStoreMoneyService { ...@@ -25,13 +25,13 @@ public class GoblinStoreMoneyServiceImpl implements IGoblinStoreMoneyService {
GoblinMongoUtils mongoUtils; GoblinMongoUtils mongoUtils;
@Override @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(); String uid = CurrentUtil.getCurrentUid();
GoblinStoreInfoVo vo = redisUtils.getStoreInfoVoByUid(uid); GoblinStoreInfoVo vo = redisUtils.getStoreInfoVoByUid(uid);
if (vo == null) { if (vo == null) {
return ResponseDto.failure("店铺不存在"); return ResponseDto.failure("店铺不存在");
} }
String data = mongoUtils.storeMoney(vo.getStoreId(), spuId); String data = mongoUtils.storeMoney(vo.getStoreId(), spuId,st,et);
String[] array = data.split(","); String[] array = data.split(",");
HashMap<String,String> map = CollectionUtil.mapStringString(); HashMap<String,String> map = CollectionUtil.mapStringString();
map.put("name",array[0]); map.put("name",array[0]);
......
...@@ -43,6 +43,8 @@ import java.util.List; ...@@ -43,6 +43,8 @@ import java.util.List;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.liquidnet.commons.lang.util.DateUtil.DTF_YMD_HMS;
@Component @Component
public class GoblinMongoUtils { public class GoblinMongoUtils {
@Autowired @Autowired
...@@ -445,6 +447,7 @@ public class GoblinMongoUtils { ...@@ -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")), return mongoTemplate.findOne(Query.query(Criteria.where("storeId").is(storeId).and("name").is(name).and("delFlg").is("0")),
GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName()); GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
} }
public long countMgtGoodsInfoVo(String name) { public long countMgtGoodsInfoVo(String name) {
return mongoTemplate.count(Query.query(Criteria.where("name").is(name).and("delFlg").is("0")), return mongoTemplate.count(Query.query(Criteria.where("name").is(name).and("delFlg").is("0")),
GoblinGoodsInfoVo.class.getSimpleName()); GoblinGoodsInfoVo.class.getSimpleName());
...@@ -806,9 +809,14 @@ public class GoblinMongoUtils { ...@@ -806,9 +809,14 @@ public class GoblinMongoUtils {
} }
//店铺总收入 //店铺总收入
public String storeMoney(String storeId, String spuId) { public String storeMoney(String storeId, String spuId, String st, String et) {
String spuName = "店铺总收入"; 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); 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; Aggregation aggregation;
if (spuId != null) { if (spuId != null) {
criteria = criteria.and("spuId").is(spuId); criteria = criteria.and("spuId").is(spuId);
...@@ -857,7 +865,9 @@ public class GoblinMongoUtils { ...@@ -857,7 +865,9 @@ public class GoblinMongoUtils {
List<GoblinGoodsInfoVo> spuIdAndName = null; 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); 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) { 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);
...@@ -870,7 +880,7 @@ public class GoblinMongoUtils { ...@@ -870,7 +880,7 @@ public class GoblinMongoUtils {
} }
if (spuName != null) { if (spuName != null) {
//根据spu名称查询spuId //根据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"); query.fields().include("spuId").include("name");
spuIdAndName = mongoTemplate.find(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName()); spuIdAndName = mongoTemplate.find(query, GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class.getSimpleName());
spuIdList = spuIdAndName.stream().map(GoblinGoodsInfoVo::getSpuId).collect(Collectors.toList()); spuIdList = spuIdAndName.stream().map(GoblinGoodsInfoVo::getSpuId).collect(Collectors.toList());
...@@ -878,7 +888,7 @@ public class GoblinMongoUtils { ...@@ -878,7 +888,7 @@ public class GoblinMongoUtils {
finalCount = spuIdList.size(); finalCount = spuIdList.size();
} }
} }
if(finalCount>0){ if (finalCount > 0) {
spuIdList = spuIdList.subList(skipCount, finalCount); spuIdList = spuIdList.subList(skipCount, finalCount);
} }
criteria = criteria.and("spuId").in(spuIdList); criteria = criteria.and("spuId").in(spuIdList);
...@@ -920,6 +930,8 @@ public class GoblinMongoUtils { ...@@ -920,6 +930,8 @@ public class GoblinMongoUtils {
int skipCount = ((page - 1) * size); int skipCount = ((page - 1) * size);
Criteria criteria = Criteria.where("spuId").is(spuId); Criteria criteria = Criteria.where("spuId").is(spuId);
if (st != null && et != null) { 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(st).lt(et); criteria = criteria.and("createdAt").gte(st).lt(et);
} }
if (orderCode != null) { if (orderCode != null) {
...@@ -940,7 +952,7 @@ public class GoblinMongoUtils { ...@@ -940,7 +952,7 @@ public class GoblinMongoUtils {
criteria = criteria.and("orderType").is("zhengzai").and("status").in(22, 28); criteria = criteria.and("orderType").is("zhengzai").and("status").in(22, 28);
break; break;
} }
}else{ } else {
criteria = criteria.and("status").in( criteria = criteria.and("status").in(
GoblinStatusConst.Status.ORDER_LOG_STATUS_11.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_11.getValue(),
GoblinStatusConst.Status.ORDER_LOG_STATUS_22.getValue(), GoblinStatusConst.Status.ORDER_LOG_STATUS_22.getValue(),
...@@ -1192,7 +1204,7 @@ public class GoblinMongoUtils { ...@@ -1192,7 +1204,7 @@ public class GoblinMongoUtils {
//根据艺人标签和演出查询商品 //根据艺人标签和演出查询商品
public List<GoblinGoodsInfoVo> getMusicTagPGoods(String musicTag, String performanceId) { 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")); .and("delFlg").is("0").and("shelvesStatus").is("3"));
return mongoTemplate.find(query, return mongoTemplate.find(query,
GoblinGoodsInfoVo.class, GoblinGoodsInfoVo.class,
......
...@@ -385,7 +385,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -385,7 +385,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
orderAttr.setOrderId(orderId); orderAttr.setOrderId(orderId);
if (!writeOffCode.equals("EMPTY")) { if (!writeOffCode.equals("EMPTY")) {
orderAttr.setExpressContacts(addressesVo.getName()); orderAttr.setExpressContacts(addressesVo.getName());
orderAttr.setExpressAddress(addressesVo.getProvince() + "," + addressesVo.getCounty() + "," + addressesVo.getCity()); orderAttr.setExpressAddress(addressesVo.getProvince() + " " + addressesVo.getCity() + " " + addressesVo.getCounty());
orderAttr.setExpressAddressDetail(addressesVo.getAddress()); orderAttr.setExpressAddressDetail(addressesVo.getAddress());
orderAttr.setExpressPhone(addressesVo.getPhone()); orderAttr.setExpressPhone(addressesVo.getPhone());
orderAttr.setExpressType(1); orderAttr.setExpressType(1);
......
...@@ -19,12 +19,12 @@ public class DataController { ...@@ -19,12 +19,12 @@ public class DataController {
private DataImpl data; private DataImpl data;
@PostMapping("phpGoodsOrder") // @PostMapping("phpGoodsOrder")
@ApiOperation("php今年订单迁移") // @ApiOperation("php今年订单迁移")
public ResponseDto<Boolean> fieldData() { // public ResponseDto<Boolean> fieldData() {
data.fieldData(); // data.fieldData();
return ResponseDto.success(); // return ResponseDto.success();
} // }
// @PostMapping("fieldData") // @PostMapping("fieldData")
// @ApiOperation("场地数据迁移") // @ApiOperation("场地数据迁移")
......
...@@ -74,7 +74,7 @@ public class DataImpl { ...@@ -74,7 +74,7 @@ public class DataImpl {
" m.matter_num as 'master_order_code',\n" + " m.matter_num as 'master_order_code',\n" +
" m.matter_num as 'order_code',\n" + " m.matter_num as 'order_code',\n" +
" m.out_trade_no as 'pay_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 as 'price_total',\n" +
" (m.matter_amount - m.coupon_type2_price) as 'price_actual',\n" + " (m.matter_amount - m.coupon_type2_price) as 'price_actual',\n" +
" m.price_send as 'price_express',\n" + " m.price_send as 'price_express',\n" +
...@@ -172,15 +172,15 @@ public class DataImpl { ...@@ -172,15 +172,15 @@ public class DataImpl {
skuVo.setSkuPriceActual(rowSku.getBigDecimal("sku_price_actual")); skuVo.setSkuPriceActual(rowSku.getBigDecimal("sku_price_actual"));
skuVo.setSkuName(rowSku.getString("sku_specs")); skuVo.setSkuName(rowSku.getString("sku_specs"));
skuVo.setSkuImage(rowSku.getString("sku_image")); 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.setSpuName(rowSku.getString("spu_name"));
skuVo.setCreatedAt(orderVo.getCreatedAt()); skuVo.setCreatedAt(orderVo.getCreatedAt());
setGoblinOrderSku(skuVo.getOrderSkuId(), skuVo); setGoblinOrderSku(skuVo.getOrderSkuId(), skuVo);
orderSkuIds.add(skuVo.getOrderSkuId()); orderSkuIds.add(skuVo.getOrderSkuId());
} }
orderVo.setOrderSkuVoIds(orderSkuIds); orderVo.setOrderSkuVoIds(orderSkuIds);
setGoblinOrder(orderVo.getOrderId(),orderVo); setGoblinOrder(orderVo.getOrderId(), orderVo);
addOrderList(orderVo.getUserId(),orderVo.getOrderId()); addOrderList(orderVo.getUserId(), orderVo.getOrderId());
rowSku.close(); rowSku.close();
preparedStatementSku.close(); preparedStatementSku.close();
......
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