bug--dto重命名以及部门判断
This commit is contained in:
@ -13,7 +13,7 @@ import co.yixiang.logging.aop.log.Log;
|
|||||||
import co.yixiang.modules.shop.domain.YxUser;
|
import co.yixiang.modules.shop.domain.YxUser;
|
||||||
import co.yixiang.modules.shop.service.YxSystemConfigService;
|
import co.yixiang.modules.shop.service.YxSystemConfigService;
|
||||||
import co.yixiang.modules.shop.service.YxUserService;
|
import co.yixiang.modules.shop.service.YxUserService;
|
||||||
import co.yixiang.modules.shop.service.dto.UserMoneyDTO;
|
import co.yixiang.modules.shop.service.dto.UserMoneyDto;
|
||||||
import co.yixiang.modules.shop.service.dto.YxUserQueryCriteria;
|
import co.yixiang.modules.shop.service.dto.YxUserQueryCriteria;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
@ -100,7 +100,7 @@ public class MemberController {
|
|||||||
@ApiOperation(value = "修改余额")
|
@ApiOperation(value = "修改余额")
|
||||||
@PostMapping(value = "/yxUser/money")
|
@PostMapping(value = "/yxUser/money")
|
||||||
@PreAuthorize("@el.check('admin','YXUSER_ALL','YXUSER_EDIT')")
|
@PreAuthorize("@el.check('admin','YXUSER_ALL','YXUSER_EDIT')")
|
||||||
public ResponseEntity updatePrice(@Validated @RequestBody UserMoneyDTO param){
|
public ResponseEntity updatePrice(@Validated @RequestBody UserMoneyDto param){
|
||||||
yxUserService.updateMoney(param);
|
yxUserService.updateMoney(param);
|
||||||
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
return new ResponseEntity(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ package co.yixiang.modules.shop.service;
|
|||||||
import co.yixiang.common.service.BaseService;
|
import co.yixiang.common.service.BaseService;
|
||||||
import co.yixiang.modules.shop.domain.YxStoreOrder;
|
import co.yixiang.modules.shop.domain.YxStoreOrder;
|
||||||
import co.yixiang.modules.shop.service.dto.OrderCountDto;
|
import co.yixiang.modules.shop.service.dto.OrderCountDto;
|
||||||
import co.yixiang.modules.shop.service.dto.OrderTimeDataDTO;
|
import co.yixiang.modules.shop.service.dto.OrderTimeDataDto;
|
||||||
import co.yixiang.modules.shop.service.dto.YxStoreOrderDto;
|
import co.yixiang.modules.shop.service.dto.YxStoreOrderDto;
|
||||||
import co.yixiang.modules.shop.service.dto.YxStoreOrderQueryCriteria;
|
import co.yixiang.modules.shop.service.dto.YxStoreOrderQueryCriteria;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
@ -63,7 +63,7 @@ public interface YxStoreOrderService extends BaseService<YxStoreOrder>{
|
|||||||
|
|
||||||
OrderCountDto getOrderCount();
|
OrderCountDto getOrderCount();
|
||||||
|
|
||||||
OrderTimeDataDTO getOrderTimeData();
|
OrderTimeDataDto getOrderTimeData();
|
||||||
|
|
||||||
Map<String,Object> chartCount();
|
Map<String,Object> chartCount();
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
package co.yixiang.modules.shop.service;
|
package co.yixiang.modules.shop.service;
|
||||||
import co.yixiang.common.service.BaseService;
|
import co.yixiang.common.service.BaseService;
|
||||||
import co.yixiang.modules.shop.domain.YxStoreProduct;
|
import co.yixiang.modules.shop.domain.YxStoreProduct;
|
||||||
import co.yixiang.modules.shop.service.dto.ProductFormatDTO;
|
import co.yixiang.modules.shop.service.dto.ProductFormatDto;
|
||||||
import co.yixiang.modules.shop.service.dto.YxStoreProductDto;
|
import co.yixiang.modules.shop.service.dto.YxStoreProductDto;
|
||||||
import co.yixiang.modules.shop.service.dto.YxStoreProductQueryCriteria;
|
import co.yixiang.modules.shop.service.dto.YxStoreProductQueryCriteria;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
@ -51,7 +51,7 @@ public interface YxStoreProductService extends BaseService<YxStoreProduct>{
|
|||||||
|
|
||||||
void onSale(Integer id, int status);
|
void onSale(Integer id, int status);
|
||||||
|
|
||||||
List<ProductFormatDTO> isFormatAttr(Integer id, String jsonStr);
|
List<ProductFormatDto> isFormatAttr(Integer id, String jsonStr);
|
||||||
|
|
||||||
void createProductAttr(Integer id, String jsonStr);
|
void createProductAttr(Integer id, String jsonStr);
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
package co.yixiang.modules.shop.service;
|
package co.yixiang.modules.shop.service;
|
||||||
import co.yixiang.common.service.BaseService;
|
import co.yixiang.common.service.BaseService;
|
||||||
import co.yixiang.modules.shop.domain.YxUser;
|
import co.yixiang.modules.shop.domain.YxUser;
|
||||||
import co.yixiang.modules.shop.service.dto.UserMoneyDTO;
|
import co.yixiang.modules.shop.service.dto.UserMoneyDto;
|
||||||
import co.yixiang.modules.shop.service.dto.YxUserDto;
|
import co.yixiang.modules.shop.service.dto.YxUserDto;
|
||||||
import co.yixiang.modules.shop.service.dto.YxUserQueryCriteria;
|
import co.yixiang.modules.shop.service.dto.YxUserQueryCriteria;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
@ -49,7 +49,7 @@ public interface YxUserService extends BaseService<YxUser>{
|
|||||||
|
|
||||||
void onStatus(Integer id, int status);
|
void onStatus(Integer id, int status);
|
||||||
|
|
||||||
void updateMoney(UserMoneyDTO param);
|
void updateMoney(UserMoneyDto param);
|
||||||
|
|
||||||
void incBrokeragePrice(double doubleValue, Integer uid);
|
void incBrokeragePrice(double doubleValue, Integer uid);
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ import lombok.Data;
|
|||||||
* @Date 2019/11/25
|
* @Date 2019/11/25
|
||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
public class ChartDataDTO{
|
public class ChartDataDto {
|
||||||
|
|
||||||
// @Value("#{target.adminCount}")
|
// @Value("#{target.adminCount}")
|
||||||
private Double num;
|
private Double num;
|
@ -19,7 +19,7 @@ import java.util.Map;
|
|||||||
* @Date 2019/10/12
|
* @Date 2019/10/12
|
||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
public class DetailDTO {
|
public class DetailDto {
|
||||||
private List<String> data;
|
private List<String> data;
|
||||||
|
|
||||||
//private List<Map<String,List<Map<String,String>>>> res;
|
//private List<Map<String,List<Map<String,String>>>> res;
|
@ -19,7 +19,7 @@ import java.util.List;
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class FromatDetailDTO {
|
public class FromatDetailDto {
|
||||||
private boolean attrHidden;
|
private boolean attrHidden;
|
||||||
|
|
||||||
private String detailValue;
|
private String detailValue;
|
@ -18,7 +18,7 @@ import java.io.Serializable;
|
|||||||
* @Date 2019/11/25
|
* @Date 2019/11/25
|
||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
public class OrderTimeDataDTO implements Serializable {
|
public class OrderTimeDataDto implements Serializable {
|
||||||
private Double todayPrice; //今日成交额
|
private Double todayPrice; //今日成交额
|
||||||
private Integer todayCount; //今日订单数
|
private Integer todayCount; //今日订单数
|
||||||
private Double proPrice; //昨日成交额
|
private Double proPrice; //昨日成交额
|
@ -19,7 +19,7 @@ import java.util.Map;
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class ProductFormatDTO {
|
public class ProductFormatDto {
|
||||||
|
|
||||||
private Double price;
|
private Double price;
|
||||||
|
|
@ -20,7 +20,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class StoreOrderCartInfoDTO {
|
public class StoreOrderCartInfoDto {
|
||||||
|
|
||||||
|
|
||||||
private Integer id;
|
private Integer id;
|
@ -16,7 +16,7 @@ import lombok.Data;
|
|||||||
* @Date 2019/12/11
|
* @Date 2019/12/11
|
||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
public class UserBillDTO {
|
public class UserBillDto {
|
||||||
private Integer pm;
|
private Integer pm;
|
||||||
private String gtitle;
|
private String gtitle;
|
||||||
private String category;
|
private String category;
|
@ -20,7 +20,7 @@ import java.io.Serializable;
|
|||||||
* @Date 2019/12/4
|
* @Date 2019/12/4
|
||||||
**/
|
**/
|
||||||
@Data
|
@Data
|
||||||
public class UserMoneyDTO implements Serializable {
|
public class UserMoneyDto implements Serializable {
|
||||||
//@NotNull(message = "参数缺失")
|
//@NotNull(message = "参数缺失")
|
||||||
private Integer uid;
|
private Integer uid;
|
||||||
//@NotNull(message = "请选择修改余额方式")
|
//@NotNull(message = "请选择修改余额方式")
|
@ -20,7 +20,7 @@ import java.util.List;
|
|||||||
* @date 2019-10-03
|
* @date 2019-10-03
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class YxStoreCategorySmallDTO implements Serializable {
|
public class YxStoreCategorySmallDto implements Serializable {
|
||||||
|
|
||||||
// 商品分类表ID
|
// 商品分类表ID
|
||||||
private Integer id;
|
private Integer id;
|
@ -33,7 +33,7 @@ public class YxStoreOrderDto implements Serializable {
|
|||||||
//订单类型
|
//订单类型
|
||||||
private String pinkName;
|
private String pinkName;
|
||||||
|
|
||||||
private List<StoreOrderCartInfoDTO> cartInfoList;
|
private List<StoreOrderCartInfoDto> cartInfoList;
|
||||||
|
|
||||||
|
|
||||||
// 订单号
|
// 订单号
|
||||||
|
@ -19,7 +19,7 @@ import java.math.BigDecimal;
|
|||||||
* @date 2019-10-04
|
* @date 2019-10-04
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class YxStoreProductSmallDTO implements Serializable {
|
public class YxStoreProductSmallDto implements Serializable {
|
||||||
|
|
||||||
// 商品id
|
// 商品id
|
||||||
private Integer id;
|
private Integer id;
|
@ -19,7 +19,7 @@ import java.math.BigDecimal;
|
|||||||
* @date 2019-10-06
|
* @date 2019-10-06
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class YxUserSmallDTO implements Serializable {
|
public class YxUserSmallDto implements Serializable {
|
||||||
|
|
||||||
// 用户id
|
// 用户id
|
||||||
private Integer uid;
|
private Integer uid;
|
@ -16,7 +16,6 @@ import co.yixiang.exception.BadRequestException;
|
|||||||
import co.yixiang.exception.EntityExistException;
|
import co.yixiang.exception.EntityExistException;
|
||||||
import co.yixiang.modules.activity.domain.YxStorePink;
|
import co.yixiang.modules.activity.domain.YxStorePink;
|
||||||
import co.yixiang.modules.activity.service.YxStorePinkService;
|
import co.yixiang.modules.activity.service.YxStorePinkService;
|
||||||
import co.yixiang.modules.activity.service.mapper.YxStorePinkMapper;
|
|
||||||
import co.yixiang.modules.shop.domain.*;
|
import co.yixiang.modules.shop.domain.*;
|
||||||
import co.yixiang.common.service.impl.BaseServiceImpl;
|
import co.yixiang.common.service.impl.BaseServiceImpl;
|
||||||
import co.yixiang.modules.shop.service.*;
|
import co.yixiang.modules.shop.service.*;
|
||||||
@ -106,14 +105,14 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OrderTimeDataDTO getOrderTimeData() {
|
public OrderTimeDataDto getOrderTimeData() {
|
||||||
int today = OrderUtil.dateToTimestampT(DateUtil.beginOfDay(new Date()));
|
int today = OrderUtil.dateToTimestampT(DateUtil.beginOfDay(new Date()));
|
||||||
int yesterday = OrderUtil.dateToTimestampT(DateUtil.beginOfDay(DateUtil.
|
int yesterday = OrderUtil.dateToTimestampT(DateUtil.beginOfDay(DateUtil.
|
||||||
yesterday()));
|
yesterday()));
|
||||||
int lastWeek = OrderUtil.dateToTimestampT(DateUtil.beginOfDay(DateUtil.lastWeek()));
|
int lastWeek = OrderUtil.dateToTimestampT(DateUtil.beginOfDay(DateUtil.lastWeek()));
|
||||||
int nowMonth = OrderUtil.dateToTimestampT(DateUtil
|
int nowMonth = OrderUtil.dateToTimestampT(DateUtil
|
||||||
.beginOfMonth(new Date()));
|
.beginOfMonth(new Date()));
|
||||||
OrderTimeDataDTO orderTimeDataDTO = new OrderTimeDataDTO();
|
OrderTimeDataDto orderTimeDataDTO = new OrderTimeDataDto();
|
||||||
|
|
||||||
// todo orderTimeDataDTO.setTodayCount(yxStoreOrderMapper.countByPayTimeGreaterThanEqual(today));
|
// todo orderTimeDataDTO.setTodayCount(yxStoreOrderMapper.countByPayTimeGreaterThanEqual(today));
|
||||||
// //orderTimeDataDTO.setTodayPrice(yxStoreOrderMapper.sumPrice(today));
|
// //orderTimeDataDTO.setTodayPrice(yxStoreOrderMapper.sumPrice(today));
|
||||||
@ -154,57 +153,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
|||||||
PageInfo<YxStoreOrder> page = new PageInfo<>(queryAll(criteria));
|
PageInfo<YxStoreOrder> page = new PageInfo<>(queryAll(criteria));
|
||||||
List<YxStoreOrderDto> storeOrderDTOS = new ArrayList<>();
|
List<YxStoreOrderDto> storeOrderDTOS = new ArrayList<>();
|
||||||
for (YxStoreOrder yxStoreOrder : page.getList()) {
|
for (YxStoreOrder yxStoreOrder : page.getList()) {
|
||||||
YxStoreOrderDto yxStoreOrderDTO = generator.convert(yxStoreOrder,YxStoreOrderDto.class);
|
orderList(storeOrderDTOS, yxStoreOrder);
|
||||||
Integer _status = OrderUtil.orderStatus(yxStoreOrder.getPaid(),yxStoreOrder.getStatus(),
|
|
||||||
yxStoreOrder.getRefundStatus());
|
|
||||||
|
|
||||||
if(yxStoreOrder.getStoreId() > 0) {
|
|
||||||
String storeName = systemStoreService.getById(yxStoreOrder.getStoreId()).getName();
|
|
||||||
yxStoreOrderDTO.setStoreName(storeName);
|
|
||||||
}
|
|
||||||
|
|
||||||
//订单状态
|
|
||||||
String orderStatusStr = OrderUtil.orderStatusStr(yxStoreOrder.getPaid()
|
|
||||||
,yxStoreOrder.getStatus(),yxStoreOrder.getShippingType()
|
|
||||||
,yxStoreOrder.getRefundStatus());
|
|
||||||
|
|
||||||
if(_status == 3){
|
|
||||||
String refundTime = OrderUtil.stampToDate(String.valueOf(yxStoreOrder
|
|
||||||
.getRefundReasonTime()));
|
|
||||||
String str = "<b style='color:#f124c7'>申请退款</b><br/>"+
|
|
||||||
"<span>退款原因:"+yxStoreOrder.getRefundReasonWap()+"</span><br/>" +
|
|
||||||
"<span>备注说明:"+yxStoreOrder.getRefundReasonWapExplain()+"</span><br/>" +
|
|
||||||
"<span>退款时间:"+refundTime+"</span><br/>";
|
|
||||||
orderStatusStr = str;
|
|
||||||
}
|
|
||||||
yxStoreOrderDTO.setStatusName(orderStatusStr);
|
|
||||||
|
|
||||||
yxStoreOrderDTO.set_status(_status);
|
|
||||||
|
|
||||||
String payTypeName = OrderUtil.payTypeName(yxStoreOrder.getPayType()
|
|
||||||
,yxStoreOrder.getPaid());
|
|
||||||
yxStoreOrderDTO.setPayTypeName(payTypeName);
|
|
||||||
|
|
||||||
yxStoreOrderDTO.setPinkName(orderType(yxStoreOrder.getId()
|
|
||||||
,yxStoreOrder.getPinkId(),yxStoreOrder.getCombinationId()
|
|
||||||
,yxStoreOrder.getSeckillId(),yxStoreOrder.getBargainId(),
|
|
||||||
yxStoreOrder.getShippingType()));
|
|
||||||
|
|
||||||
List<YxStoreOrderCartInfo> cartInfos = storeOrderCartInfoService.list(
|
|
||||||
new QueryWrapper<YxStoreOrderCartInfo>().eq("oid",yxStoreOrder.getId()));
|
|
||||||
List<StoreOrderCartInfoDTO> cartInfoDTOS = new ArrayList<>();
|
|
||||||
for (YxStoreOrderCartInfo cartInfo : cartInfos) {
|
|
||||||
StoreOrderCartInfoDTO cartInfoDTO = new StoreOrderCartInfoDTO();
|
|
||||||
cartInfoDTO.setCartInfoMap(JSON.parseObject(cartInfo.getCartInfo()));
|
|
||||||
|
|
||||||
cartInfoDTOS.add(cartInfoDTO);
|
|
||||||
}
|
|
||||||
yxStoreOrderDTO.setCartInfoList(cartInfoDTOS);
|
|
||||||
yxStoreOrderDTO.setUserDTO(generator.convert(userService.getById(yxStoreOrder.getUid()),YxUserDto.class));
|
|
||||||
if(yxStoreOrderDTO.getUserDTO()==null){
|
|
||||||
yxStoreOrderDTO.setUserDTO(new YxUserDto());
|
|
||||||
}
|
|
||||||
storeOrderDTOS.add(yxStoreOrderDTO);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Map<String, Object> map = new LinkedHashMap<>(2);
|
Map<String, Object> map = new LinkedHashMap<>(2);
|
||||||
@ -213,6 +162,65 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
|||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代码提取
|
||||||
|
* @param storeOrderDTOS
|
||||||
|
* @param yxStoreOrder
|
||||||
|
*/
|
||||||
|
private void orderList(List<YxStoreOrderDto> storeOrderDTOS, YxStoreOrder yxStoreOrder) {
|
||||||
|
YxStoreOrderDto yxStoreOrderDto = generator.convert(yxStoreOrder, YxStoreOrderDto.class);
|
||||||
|
Integer _status = OrderUtil.orderStatus(yxStoreOrder.getPaid(),yxStoreOrder.getStatus(),
|
||||||
|
yxStoreOrder.getRefundStatus());
|
||||||
|
|
||||||
|
if(yxStoreOrder.getStoreId() > 0) {
|
||||||
|
String storeName = systemStoreService.getById(yxStoreOrder.getStoreId()).getName();
|
||||||
|
yxStoreOrderDto.setStoreName(storeName);
|
||||||
|
}
|
||||||
|
|
||||||
|
//订单状态
|
||||||
|
String orderStatusStr = OrderUtil.orderStatusStr(yxStoreOrder.getPaid()
|
||||||
|
,yxStoreOrder.getStatus(),yxStoreOrder.getShippingType()
|
||||||
|
,yxStoreOrder.getRefundStatus());
|
||||||
|
|
||||||
|
if(_status == 3){
|
||||||
|
String refundTime = OrderUtil.stampToDate(String.valueOf(yxStoreOrder
|
||||||
|
.getRefundReasonTime()));
|
||||||
|
String str = "<b style='color:#f124c7'>申请退款</b><br/>"+
|
||||||
|
"<span>退款原因:"+yxStoreOrder.getRefundReasonWap()+"</span><br/>" +
|
||||||
|
"<span>备注说明:"+yxStoreOrder.getRefundReasonWapExplain()+"</span><br/>" +
|
||||||
|
"<span>退款时间:"+refundTime+"</span><br/>";
|
||||||
|
orderStatusStr = str;
|
||||||
|
}
|
||||||
|
yxStoreOrderDto.setStatusName(orderStatusStr);
|
||||||
|
|
||||||
|
yxStoreOrderDto.set_status(_status);
|
||||||
|
|
||||||
|
String payTypeName = OrderUtil.payTypeName(yxStoreOrder.getPayType()
|
||||||
|
,yxStoreOrder.getPaid());
|
||||||
|
yxStoreOrderDto.setPayTypeName(payTypeName);
|
||||||
|
|
||||||
|
yxStoreOrderDto.setPinkName(orderType(yxStoreOrder.getId()
|
||||||
|
,yxStoreOrder.getPinkId(),yxStoreOrder.getCombinationId()
|
||||||
|
,yxStoreOrder.getSeckillId(),yxStoreOrder.getBargainId(),
|
||||||
|
yxStoreOrder.getShippingType()));
|
||||||
|
|
||||||
|
List<YxStoreOrderCartInfo> cartInfos = storeOrderCartInfoService.list(
|
||||||
|
new QueryWrapper<YxStoreOrderCartInfo>().eq("oid",yxStoreOrder.getId()));
|
||||||
|
List<StoreOrderCartInfoDto> cartInfoDTOS = new ArrayList<>();
|
||||||
|
for (YxStoreOrderCartInfo cartInfo : cartInfos) {
|
||||||
|
StoreOrderCartInfoDto cartInfoDTO = new StoreOrderCartInfoDto();
|
||||||
|
cartInfoDTO.setCartInfoMap(JSON.parseObject(cartInfo.getCartInfo()));
|
||||||
|
|
||||||
|
cartInfoDTOS.add(cartInfoDTO);
|
||||||
|
}
|
||||||
|
yxStoreOrderDto.setCartInfoList(cartInfoDTOS);
|
||||||
|
yxStoreOrderDto.setUserDTO(generator.convert(userService.getById(yxStoreOrder.getUid()), YxUserDto.class));
|
||||||
|
if(yxStoreOrderDto.getUserDTO()==null){
|
||||||
|
yxStoreOrderDto.setUserDTO(new YxUserDto());
|
||||||
|
}
|
||||||
|
storeOrderDTOS.add(yxStoreOrderDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
//@Cacheable
|
//@Cacheable
|
||||||
@ -309,14 +317,14 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
|||||||
List<YxStoreOrder> yxStoreOrders = this.list(new QueryWrapper<YxStoreOrder>().in("order_id",ids));
|
List<YxStoreOrder> yxStoreOrders = this.list(new QueryWrapper<YxStoreOrder>().in("order_id",ids));
|
||||||
List<YxStoreOrderDto> storeOrderDTOS = new ArrayList<>();
|
List<YxStoreOrderDto> storeOrderDTOS = new ArrayList<>();
|
||||||
for (YxStoreOrder yxStoreOrder :yxStoreOrders) {
|
for (YxStoreOrder yxStoreOrder :yxStoreOrders) {
|
||||||
YxStoreOrderDto yxStoreOrderDTO = generator.convert(yxStoreOrder,YxStoreOrderDto.class);
|
YxStoreOrderDto yxStoreOrderDto = generator.convert(yxStoreOrder,YxStoreOrderDto.class);
|
||||||
|
|
||||||
Integer _status = OrderUtil.orderStatus(yxStoreOrder.getPaid(),yxStoreOrder.getStatus(),
|
Integer _status = OrderUtil.orderStatus(yxStoreOrder.getPaid(),yxStoreOrder.getStatus(),
|
||||||
yxStoreOrder.getRefundStatus());
|
yxStoreOrder.getRefundStatus());
|
||||||
|
|
||||||
if(yxStoreOrder.getStoreId() > 0) {
|
if(yxStoreOrder.getStoreId() > 0) {
|
||||||
String storeName = systemStoreService.getById(yxStoreOrder.getStoreId()).getName();
|
String storeName = systemStoreService.getById(yxStoreOrder.getStoreId()).getName();
|
||||||
yxStoreOrderDTO.setStoreName(storeName);
|
yxStoreOrderDto.setStoreName(storeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
//订单状态
|
//订单状态
|
||||||
@ -333,31 +341,31 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
|||||||
"<span>退款时间:"+refundTime+"</span><br/>";
|
"<span>退款时间:"+refundTime+"</span><br/>";
|
||||||
orderStatusStr = str;
|
orderStatusStr = str;
|
||||||
}
|
}
|
||||||
yxStoreOrderDTO.setStatusName(orderStatusStr);
|
yxStoreOrderDto.setStatusName(orderStatusStr);
|
||||||
|
|
||||||
yxStoreOrderDTO.set_status(_status);
|
yxStoreOrderDto.set_status(_status);
|
||||||
|
|
||||||
String payTypeName = OrderUtil.payTypeName(yxStoreOrder.getPayType()
|
String payTypeName = OrderUtil.payTypeName(yxStoreOrder.getPayType()
|
||||||
,yxStoreOrder.getPaid());
|
,yxStoreOrder.getPaid());
|
||||||
yxStoreOrderDTO.setPayTypeName(payTypeName);
|
yxStoreOrderDto.setPayTypeName(payTypeName);
|
||||||
|
|
||||||
yxStoreOrderDTO.setPinkName(orderType(yxStoreOrder.getId()
|
yxStoreOrderDto.setPinkName(orderType(yxStoreOrder.getId()
|
||||||
,yxStoreOrder.getPinkId(),yxStoreOrder.getCombinationId()
|
,yxStoreOrder.getPinkId(),yxStoreOrder.getCombinationId()
|
||||||
,yxStoreOrder.getSeckillId(),yxStoreOrder.getBargainId(),
|
,yxStoreOrder.getSeckillId(),yxStoreOrder.getBargainId(),
|
||||||
yxStoreOrder.getShippingType()));
|
yxStoreOrder.getShippingType()));
|
||||||
|
|
||||||
List<YxStoreOrderCartInfo> cartInfos = storeOrderCartInfoService.list(new QueryWrapper<YxStoreOrderCartInfo>().eq("oid",yxStoreOrder.getId()));
|
List<YxStoreOrderCartInfo> cartInfos = storeOrderCartInfoService.list(new QueryWrapper<YxStoreOrderCartInfo>().eq("oid",yxStoreOrder.getId()));
|
||||||
List<StoreOrderCartInfoDTO> cartInfoDTOS = new ArrayList<>();
|
List<StoreOrderCartInfoDto> cartInfoDTOS = new ArrayList<>();
|
||||||
for (YxStoreOrderCartInfo cartInfo : cartInfos) {
|
for (YxStoreOrderCartInfo cartInfo : cartInfos) {
|
||||||
StoreOrderCartInfoDTO cartInfoDTO = new StoreOrderCartInfoDTO();
|
StoreOrderCartInfoDto cartInfoDTO = new StoreOrderCartInfoDto();
|
||||||
cartInfoDTO.setCartInfoMap(JSON.parseObject(cartInfo.getCartInfo()));
|
cartInfoDTO.setCartInfoMap(JSON.parseObject(cartInfo.getCartInfo()));
|
||||||
|
|
||||||
cartInfoDTOS.add(cartInfoDTO);
|
cartInfoDTOS.add(cartInfoDTO);
|
||||||
}
|
}
|
||||||
yxStoreOrderDTO.setCartInfoList(cartInfoDTOS);
|
yxStoreOrderDto.setCartInfoList(cartInfoDTOS);
|
||||||
yxStoreOrderDTO.setUserDTO(generator.convert(userService.getOne(new QueryWrapper<YxUser>().eq("uid",yxStoreOrder.getUid())), YxUserDto.class));
|
yxStoreOrderDto.setUserDTO(generator.convert(userService.getOne(new QueryWrapper<YxUser>().eq("uid",yxStoreOrder.getUid())), YxUserDto.class));
|
||||||
|
|
||||||
storeOrderDTOS.add(yxStoreOrderDTO);
|
storeOrderDTOS.add(yxStoreOrderDto);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,14 +146,14 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ProductFormatDTO> isFormatAttr(Integer id, String jsonStr) {
|
public List<ProductFormatDto> isFormatAttr(Integer id, String jsonStr) {
|
||||||
if(ObjectUtil.isNull(id)) throw new BadRequestException("产品不存在");
|
if(ObjectUtil.isNull(id)) throw new BadRequestException("产品不存在");
|
||||||
|
|
||||||
YxStoreProductDto yxStoreProductDTO = generator.convert(this.getById(id),YxStoreProductDto.class);
|
YxStoreProductDto yxStoreProductDTO = generator.convert(this.getById(id),YxStoreProductDto.class);
|
||||||
DetailDTO detailDTO = attrFormat(jsonStr);
|
DetailDto detailDTO = attrFormat(jsonStr);
|
||||||
List<ProductFormatDTO> newList = new ArrayList<>();
|
List<ProductFormatDto> newList = new ArrayList<>();
|
||||||
for (Map<String, Map<String,String>> map : detailDTO.getRes()) {
|
for (Map<String, Map<String,String>> map : detailDTO.getRes()) {
|
||||||
ProductFormatDTO productFormatDTO = new ProductFormatDTO();
|
ProductFormatDto productFormatDTO = new ProductFormatDto();
|
||||||
productFormatDTO.setDetail(map.get("detail"));
|
productFormatDTO.setDetail(map.get("detail"));
|
||||||
productFormatDTO.setCost(yxStoreProductDTO.getCost().doubleValue());
|
productFormatDTO.setCost(yxStoreProductDTO.getCost().doubleValue());
|
||||||
productFormatDTO.setPrice(yxStoreProductDTO.getPrice().doubleValue());
|
productFormatDTO.setPrice(yxStoreProductDTO.getPrice().doubleValue());
|
||||||
@ -170,16 +170,16 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
public void createProductAttr(Integer id, String jsonStr) {
|
public void createProductAttr(Integer id, String jsonStr) {
|
||||||
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
||||||
//System.out.println(jsonObject);
|
//System.out.println(jsonObject);
|
||||||
List<FromatDetailDTO> attrList = JSON.parseArray(
|
List<FromatDetailDto> attrList = JSON.parseArray(
|
||||||
jsonObject.get("items").toString(),
|
jsonObject.get("items").toString(),
|
||||||
FromatDetailDTO.class);
|
FromatDetailDto.class);
|
||||||
List<ProductFormatDTO> valueList = JSON.parseArray(
|
List<ProductFormatDto> valueList = JSON.parseArray(
|
||||||
jsonObject.get("attrs").toString(),
|
jsonObject.get("attrs").toString(),
|
||||||
ProductFormatDTO.class);
|
ProductFormatDto.class);
|
||||||
|
|
||||||
|
|
||||||
List<YxStoreProductAttr> attrGroup = new ArrayList<>();
|
List<YxStoreProductAttr> attrGroup = new ArrayList<>();
|
||||||
for (FromatDetailDTO fromatDetailDTO : attrList) {
|
for (FromatDetailDto fromatDetailDTO : attrList) {
|
||||||
YxStoreProductAttr yxStoreProductAttr = new YxStoreProductAttr();
|
YxStoreProductAttr yxStoreProductAttr = new YxStoreProductAttr();
|
||||||
yxStoreProductAttr.setProductId(id);
|
yxStoreProductAttr.setProductId(id);
|
||||||
yxStoreProductAttr.setAttrName(fromatDetailDTO.getValue());
|
yxStoreProductAttr.setAttrName(fromatDetailDTO.getValue());
|
||||||
@ -190,7 +190,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
|
|
||||||
|
|
||||||
List<YxStoreProductAttrValue> valueGroup = new ArrayList<>();
|
List<YxStoreProductAttrValue> valueGroup = new ArrayList<>();
|
||||||
for (ProductFormatDTO productFormatDTO : valueList) {
|
for (ProductFormatDto productFormatDTO : valueList) {
|
||||||
YxStoreProductAttrValue yxStoreProductAttrValue = new YxStoreProductAttrValue();
|
YxStoreProductAttrValue yxStoreProductAttrValue = new YxStoreProductAttrValue();
|
||||||
yxStoreProductAttrValue.setProductId(id);
|
yxStoreProductAttrValue.setProductId(id);
|
||||||
//productFormatDTO.getDetail().values().stream().collect(Collectors.toList());
|
//productFormatDTO.getDetail().values().stream().collect(Collectors.toList());
|
||||||
@ -267,10 +267,10 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
* @param jsonStr
|
* @param jsonStr
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public DetailDTO attrFormat(String jsonStr){
|
public DetailDto attrFormat(String jsonStr){
|
||||||
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
JSONObject jsonObject = JSON.parseObject(jsonStr);
|
||||||
List<FromatDetailDTO> fromatDetailDTOList = JSON.parseArray(jsonObject.get("items").toString(),
|
List<FromatDetailDto> fromatDetailDTOList = JSON.parseArray(jsonObject.get("items").toString(),
|
||||||
FromatDetailDTO.class);
|
FromatDetailDto.class);
|
||||||
List<String> data = new ArrayList<>();
|
List<String> data = new ArrayList<>();
|
||||||
List<Map<String,Map<String,String>>> res =new ArrayList<>();
|
List<Map<String,Map<String,String>>> res =new ArrayList<>();
|
||||||
if(fromatDetailDTOList.size() > 1){
|
if(fromatDetailDTOList.size() > 1){
|
||||||
@ -313,7 +313,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
}else{
|
}else{
|
||||||
List<String> dataArr = new ArrayList<>();
|
List<String> dataArr = new ArrayList<>();
|
||||||
|
|
||||||
for (FromatDetailDTO fromatDetailDTO : fromatDetailDTOList) {
|
for (FromatDetailDto fromatDetailDTO : fromatDetailDTOList) {
|
||||||
|
|
||||||
for (String str : fromatDetailDTO.getDetail()) {
|
for (String str : fromatDetailDTO.getDetail()) {
|
||||||
Map<String,Map<String,String>> map2 = new LinkedHashMap<>();
|
Map<String,Map<String,String>> map2 = new LinkedHashMap<>();
|
||||||
@ -329,7 +329,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
String s = StrUtil.join("-",dataArr);
|
String s = StrUtil.join("-",dataArr);
|
||||||
data.add(s);
|
data.add(s);
|
||||||
}
|
}
|
||||||
DetailDTO detailDTO = new DetailDTO();
|
DetailDto detailDTO = new DetailDto();
|
||||||
detailDTO.setData(data);
|
detailDTO.setData(data);
|
||||||
detailDTO.setRes(res);
|
detailDTO.setRes(res);
|
||||||
return detailDTO;
|
return detailDTO;
|
||||||
|
@ -10,7 +10,7 @@ package co.yixiang.modules.shop.service.impl;
|
|||||||
|
|
||||||
import co.yixiang.modules.shop.domain.YxUser;
|
import co.yixiang.modules.shop.domain.YxUser;
|
||||||
import co.yixiang.common.service.impl.BaseServiceImpl;
|
import co.yixiang.common.service.impl.BaseServiceImpl;
|
||||||
import co.yixiang.modules.shop.service.dto.UserMoneyDTO;
|
import co.yixiang.modules.shop.service.dto.UserMoneyDto;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import co.yixiang.dozer.service.IGenerator;
|
import co.yixiang.dozer.service.IGenerator;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
@ -126,7 +126,7 @@ public class YxUserServiceImpl extends BaseServiceImpl<UserMapper, YxUser> imple
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateMoney(UserMoneyDTO param) {
|
public void updateMoney(UserMoneyDto param) {
|
||||||
//todo 修改用余额
|
//todo 修改用余额
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,11 +10,10 @@ package co.yixiang.modules.shop.service.mapper;
|
|||||||
|
|
||||||
import co.yixiang.common.mapper.CoreMapper;
|
import co.yixiang.common.mapper.CoreMapper;
|
||||||
import co.yixiang.modules.shop.domain.YxStoreOrder;
|
import co.yixiang.modules.shop.domain.YxStoreOrder;
|
||||||
import co.yixiang.modules.shop.service.dto.ChartDataDTO;
|
import co.yixiang.modules.shop.service.dto.ChartDataDto;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
import org.springframework.data.jpa.repository.Query;
|
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -39,11 +38,11 @@ public interface StoreOrderMapper extends CoreMapper<YxStoreOrder> {
|
|||||||
" FROM yx_store_order where refund_status=0 and is_del=0 and paid=1 and pay_time >= ${time}" +
|
" FROM yx_store_order where refund_status=0 and is_del=0 and paid=1 and pay_time >= ${time}" +
|
||||||
" GROUP BY FROM_UNIXTIME(add_time,'%Y-%m-%d') " +
|
" GROUP BY FROM_UNIXTIME(add_time,'%Y-%m-%d') " +
|
||||||
" ORDER BY add_time ASC")
|
" ORDER BY add_time ASC")
|
||||||
List<ChartDataDTO> chartList(@Param("time") int time);
|
List<ChartDataDto> chartList(@Param("time") int time);
|
||||||
@Select("SELECT count(id) as num," +
|
@Select("SELECT count(id) as num," +
|
||||||
"FROM_UNIXTIME(add_time, '%m-%d') as time " +
|
"FROM_UNIXTIME(add_time, '%m-%d') as time " +
|
||||||
" FROM yx_store_order where refund_status=0 and is_del=0 and paid=1 and pay_time >= ${time}" +
|
" FROM yx_store_order where refund_status=0 and is_del=0 and paid=1 and pay_time >= ${time}" +
|
||||||
" GROUP BY FROM_UNIXTIME(add_time,'%Y-%m-%d') " +
|
" GROUP BY FROM_UNIXTIME(add_time,'%Y-%m-%d') " +
|
||||||
" ORDER BY add_time ASC")
|
" ORDER BY add_time ASC")
|
||||||
List<ChartDataDTO> chartListT(@Param("time")int time);
|
List<ChartDataDto> chartListT(@Param("time")int time);
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ import co.yixiang.modules.system.service.DeptService;
|
|||||||
import co.yixiang.modules.system.service.dto.DeptDto;
|
import co.yixiang.modules.system.service.dto.DeptDto;
|
||||||
import co.yixiang.modules.system.service.dto.DeptQueryCriteria;
|
import co.yixiang.modules.system.service.dto.DeptQueryCriteria;
|
||||||
import co.yixiang.utils.ThrowableUtil;
|
import co.yixiang.utils.ThrowableUtil;
|
||||||
|
import co.yixiang.utils.ValidationUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
@ -91,6 +92,13 @@ public class DeptController {
|
|||||||
@PutMapping
|
@PutMapping
|
||||||
@PreAuthorize("@el.check('admin','dept:edit')")
|
@PreAuthorize("@el.check('admin','dept:edit')")
|
||||||
public ResponseEntity<Object> update(@Validated @RequestBody Dept resources){
|
public ResponseEntity<Object> update(@Validated @RequestBody Dept resources){
|
||||||
|
if(resources.getId().equals(resources.getPid())) {
|
||||||
|
throw new BadRequestException("上级不能为自己");
|
||||||
|
}
|
||||||
|
Dept dept = deptService.getOne(new QueryWrapper<Dept>().lambda()
|
||||||
|
.eq(Dept::getId,resources.getId()));
|
||||||
|
ValidationUtil.isNull( dept.getId(),"Dept","id",resources.getId());
|
||||||
|
resources.setId(dept.getId());
|
||||||
deptService.saveOrUpdate(resources);
|
deptService.saveOrUpdate(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user