bug--dto重命名以及部门判断

This commit is contained in:
taochengbo
2020-05-17 15:55:14 +08:00
parent c823316b56
commit 1a503373e6
21 changed files with 121 additions and 106 deletions

View File

@ -13,7 +13,7 @@ import co.yixiang.logging.aop.log.Log;
import co.yixiang.modules.shop.domain.YxUser;
import co.yixiang.modules.shop.service.YxSystemConfigService;
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 com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
@ -100,7 +100,7 @@ public class MemberController {
@ApiOperation(value = "修改余额")
@PostMapping(value = "/yxUser/money")
@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);
return new ResponseEntity(HttpStatus.NO_CONTENT);
}

View File

@ -10,7 +10,7 @@ package co.yixiang.modules.shop.service;
import co.yixiang.common.service.BaseService;
import co.yixiang.modules.shop.domain.YxStoreOrder;
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.YxStoreOrderQueryCriteria;
import org.springframework.data.domain.Pageable;
@ -63,7 +63,7 @@ public interface YxStoreOrderService extends BaseService<YxStoreOrder>{
OrderCountDto getOrderCount();
OrderTimeDataDTO getOrderTimeData();
OrderTimeDataDto getOrderTimeData();
Map<String,Object> chartCount();
}

View File

@ -9,7 +9,7 @@
package co.yixiang.modules.shop.service;
import co.yixiang.common.service.BaseService;
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.YxStoreProductQueryCriteria;
import org.springframework.data.domain.Pageable;
@ -51,7 +51,7 @@ public interface YxStoreProductService extends BaseService<YxStoreProduct>{
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);

View File

@ -9,7 +9,7 @@
package co.yixiang.modules.shop.service;
import co.yixiang.common.service.BaseService;
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.YxUserQueryCriteria;
import org.springframework.data.domain.Pageable;
@ -49,7 +49,7 @@ public interface YxUserService extends BaseService<YxUser>{
void onStatus(Integer id, int status);
void updateMoney(UserMoneyDTO param);
void updateMoney(UserMoneyDto param);
void incBrokeragePrice(double doubleValue, Integer uid);
}

View File

@ -16,7 +16,7 @@ import lombok.Data;
* @Date 2019/11/25
**/
@Data
public class ChartDataDTO{
public class ChartDataDto {
// @Value("#{target.adminCount}")
private Double num;

View File

@ -19,7 +19,7 @@ import java.util.Map;
* @Date 2019/10/12
**/
@Data
public class DetailDTO {
public class DetailDto {
private List<String> data;
//private List<Map<String,List<Map<String,String>>>> res;

View File

@ -19,7 +19,7 @@ import java.util.List;
**/
@Data
public class FromatDetailDTO {
public class FromatDetailDto {
private boolean attrHidden;
private String detailValue;

View File

@ -18,7 +18,7 @@ import java.io.Serializable;
* @Date 2019/11/25
**/
@Data
public class OrderTimeDataDTO implements Serializable {
public class OrderTimeDataDto implements Serializable {
private Double todayPrice; //今日成交额
private Integer todayCount; //今日订单数
private Double proPrice; //昨日成交额

View File

@ -19,7 +19,7 @@ import java.util.Map;
**/
@Data
public class ProductFormatDTO {
public class ProductFormatDto {
private Double price;

View File

@ -20,7 +20,7 @@ import java.util.Map;
@Data
public class StoreOrderCartInfoDTO {
public class StoreOrderCartInfoDto {
private Integer id;

View File

@ -16,7 +16,7 @@ import lombok.Data;
* @Date 2019/12/11
**/
@Data
public class UserBillDTO {
public class UserBillDto {
private Integer pm;
private String gtitle;
private String category;

View File

@ -20,7 +20,7 @@ import java.io.Serializable;
* @Date 2019/12/4
**/
@Data
public class UserMoneyDTO implements Serializable {
public class UserMoneyDto implements Serializable {
//@NotNull(message = "参数缺失")
private Integer uid;
//@NotNull(message = "请选择修改余额方式")

View File

@ -20,7 +20,7 @@ import java.util.List;
* @date 2019-10-03
*/
@Data
public class YxStoreCategorySmallDTO implements Serializable {
public class YxStoreCategorySmallDto implements Serializable {
// 商品分类表ID
private Integer id;

View File

@ -33,7 +33,7 @@ public class YxStoreOrderDto implements Serializable {
//订单类型
private String pinkName;
private List<StoreOrderCartInfoDTO> cartInfoList;
private List<StoreOrderCartInfoDto> cartInfoList;
// 订单号

View File

@ -19,7 +19,7 @@ import java.math.BigDecimal;
* @date 2019-10-04
*/
@Data
public class YxStoreProductSmallDTO implements Serializable {
public class YxStoreProductSmallDto implements Serializable {
// 商品id
private Integer id;

View File

@ -19,7 +19,7 @@ import java.math.BigDecimal;
* @date 2019-10-06
*/
@Data
public class YxUserSmallDTO implements Serializable {
public class YxUserSmallDto implements Serializable {
// 用户id
private Integer uid;

View File

@ -16,7 +16,6 @@ import co.yixiang.exception.BadRequestException;
import co.yixiang.exception.EntityExistException;
import co.yixiang.modules.activity.domain.YxStorePink;
import co.yixiang.modules.activity.service.YxStorePinkService;
import co.yixiang.modules.activity.service.mapper.YxStorePinkMapper;
import co.yixiang.modules.shop.domain.*;
import co.yixiang.common.service.impl.BaseServiceImpl;
import co.yixiang.modules.shop.service.*;
@ -106,14 +105,14 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
}
@Override
public OrderTimeDataDTO getOrderTimeData() {
public OrderTimeDataDto getOrderTimeData() {
int today = OrderUtil.dateToTimestampT(DateUtil.beginOfDay(new Date()));
int yesterday = OrderUtil.dateToTimestampT(DateUtil.beginOfDay(DateUtil.
yesterday()));
int lastWeek = OrderUtil.dateToTimestampT(DateUtil.beginOfDay(DateUtil.lastWeek()));
int nowMonth = OrderUtil.dateToTimestampT(DateUtil
.beginOfMonth(new Date()));
OrderTimeDataDTO orderTimeDataDTO = new OrderTimeDataDTO();
OrderTimeDataDto orderTimeDataDTO = new OrderTimeDataDto();
// todo orderTimeDataDTO.setTodayCount(yxStoreOrderMapper.countByPayTimeGreaterThanEqual(today));
// //orderTimeDataDTO.setTodayPrice(yxStoreOrderMapper.sumPrice(today));
@ -154,57 +153,7 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
PageInfo<YxStoreOrder> page = new PageInfo<>(queryAll(criteria));
List<YxStoreOrderDto> storeOrderDTOS = new ArrayList<>();
for (YxStoreOrder yxStoreOrder : page.getList()) {
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);
orderList(storeOrderDTOS, yxStoreOrder);
}
Map<String, Object> map = new LinkedHashMap<>(2);
@ -213,6 +162,65 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
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
//@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<YxStoreOrderDto> storeOrderDTOS = new ArrayList<>();
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(),
yxStoreOrder.getRefundStatus());
if(yxStoreOrder.getStoreId() > 0) {
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/>";
orderStatusStr = str;
}
yxStoreOrderDTO.setStatusName(orderStatusStr);
yxStoreOrderDto.setStatusName(orderStatusStr);
yxStoreOrderDTO.set_status(_status);
yxStoreOrderDto.set_status(_status);
String payTypeName = OrderUtil.payTypeName(yxStoreOrder.getPayType()
,yxStoreOrder.getPaid());
yxStoreOrderDTO.setPayTypeName(payTypeName);
yxStoreOrderDto.setPayTypeName(payTypeName);
yxStoreOrderDTO.setPinkName(orderType(yxStoreOrder.getId()
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<>();
List<StoreOrderCartInfoDto> cartInfoDTOS = new ArrayList<>();
for (YxStoreOrderCartInfo cartInfo : cartInfos) {
StoreOrderCartInfoDTO cartInfoDTO = new StoreOrderCartInfoDTO();
StoreOrderCartInfoDto cartInfoDTO = new StoreOrderCartInfoDto();
cartInfoDTO.setCartInfoMap(JSON.parseObject(cartInfo.getCartInfo()));
cartInfoDTOS.add(cartInfoDTO);
}
yxStoreOrderDTO.setCartInfoList(cartInfoDTOS);
yxStoreOrderDTO.setUserDTO(generator.convert(userService.getOne(new QueryWrapper<YxUser>().eq("uid",yxStoreOrder.getUid())), YxUserDto.class));
yxStoreOrderDto.setCartInfoList(cartInfoDTOS);
yxStoreOrderDto.setUserDTO(generator.convert(userService.getOne(new QueryWrapper<YxUser>().eq("uid",yxStoreOrder.getUid())), YxUserDto.class));
storeOrderDTOS.add(yxStoreOrderDTO);
storeOrderDTOS.add(yxStoreOrderDto);
}

View File

@ -146,14 +146,14 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
}
@Override
public List<ProductFormatDTO> isFormatAttr(Integer id, String jsonStr) {
public List<ProductFormatDto> isFormatAttr(Integer id, String jsonStr) {
if(ObjectUtil.isNull(id)) throw new BadRequestException("产品不存在");
YxStoreProductDto yxStoreProductDTO = generator.convert(this.getById(id),YxStoreProductDto.class);
DetailDTO detailDTO = attrFormat(jsonStr);
List<ProductFormatDTO> newList = new ArrayList<>();
DetailDto detailDTO = attrFormat(jsonStr);
List<ProductFormatDto> newList = new ArrayList<>();
for (Map<String, Map<String,String>> map : detailDTO.getRes()) {
ProductFormatDTO productFormatDTO = new ProductFormatDTO();
ProductFormatDto productFormatDTO = new ProductFormatDto();
productFormatDTO.setDetail(map.get("detail"));
productFormatDTO.setCost(yxStoreProductDTO.getCost().doubleValue());
productFormatDTO.setPrice(yxStoreProductDTO.getPrice().doubleValue());
@ -170,16 +170,16 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
public void createProductAttr(Integer id, String jsonStr) {
JSONObject jsonObject = JSON.parseObject(jsonStr);
//System.out.println(jsonObject);
List<FromatDetailDTO> attrList = JSON.parseArray(
List<FromatDetailDto> attrList = JSON.parseArray(
jsonObject.get("items").toString(),
FromatDetailDTO.class);
List<ProductFormatDTO> valueList = JSON.parseArray(
FromatDetailDto.class);
List<ProductFormatDto> valueList = JSON.parseArray(
jsonObject.get("attrs").toString(),
ProductFormatDTO.class);
ProductFormatDto.class);
List<YxStoreProductAttr> attrGroup = new ArrayList<>();
for (FromatDetailDTO fromatDetailDTO : attrList) {
for (FromatDetailDto fromatDetailDTO : attrList) {
YxStoreProductAttr yxStoreProductAttr = new YxStoreProductAttr();
yxStoreProductAttr.setProductId(id);
yxStoreProductAttr.setAttrName(fromatDetailDTO.getValue());
@ -190,7 +190,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
List<YxStoreProductAttrValue> valueGroup = new ArrayList<>();
for (ProductFormatDTO productFormatDTO : valueList) {
for (ProductFormatDto productFormatDTO : valueList) {
YxStoreProductAttrValue yxStoreProductAttrValue = new YxStoreProductAttrValue();
yxStoreProductAttrValue.setProductId(id);
//productFormatDTO.getDetail().values().stream().collect(Collectors.toList());
@ -267,10 +267,10 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
* @param jsonStr
* @return
*/
public DetailDTO attrFormat(String jsonStr){
public DetailDto attrFormat(String jsonStr){
JSONObject jsonObject = JSON.parseObject(jsonStr);
List<FromatDetailDTO> fromatDetailDTOList = JSON.parseArray(jsonObject.get("items").toString(),
FromatDetailDTO.class);
List<FromatDetailDto> fromatDetailDTOList = JSON.parseArray(jsonObject.get("items").toString(),
FromatDetailDto.class);
List<String> data = new ArrayList<>();
List<Map<String,Map<String,String>>> res =new ArrayList<>();
if(fromatDetailDTOList.size() > 1){
@ -313,7 +313,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
}else{
List<String> dataArr = new ArrayList<>();
for (FromatDetailDTO fromatDetailDTO : fromatDetailDTOList) {
for (FromatDetailDto fromatDetailDTO : fromatDetailDTOList) {
for (String str : fromatDetailDTO.getDetail()) {
Map<String,Map<String,String>> map2 = new LinkedHashMap<>();
@ -329,7 +329,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
String s = StrUtil.join("-",dataArr);
data.add(s);
}
DetailDTO detailDTO = new DetailDTO();
DetailDto detailDTO = new DetailDto();
detailDTO.setData(data);
detailDTO.setRes(res);
return detailDTO;

View File

@ -10,7 +10,7 @@ package co.yixiang.modules.shop.service.impl;
import co.yixiang.modules.shop.domain.YxUser;
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 co.yixiang.dozer.service.IGenerator;
import com.github.pagehelper.PageInfo;
@ -126,7 +126,7 @@ public class YxUserServiceImpl extends BaseServiceImpl<UserMapper, YxUser> imple
@Override
@Transactional(rollbackFor = Exception.class)
public void updateMoney(UserMoneyDTO param) {
public void updateMoney(UserMoneyDto param) {
//todo 修改用余额
}

View File

@ -10,11 +10,10 @@ package co.yixiang.modules.shop.service.mapper;
import co.yixiang.common.mapper.CoreMapper;
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.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
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}" +
" GROUP BY FROM_UNIXTIME(add_time,'%Y-%m-%d') " +
" 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," +
"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}" +
" GROUP BY FROM_UNIXTIME(add_time,'%Y-%m-%d') " +
" ORDER BY add_time ASC")
List<ChartDataDTO> chartListT(@Param("time")int time);
List<ChartDataDto> chartListT(@Param("time")int time);
}

View File

@ -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.DeptQueryCriteria;
import co.yixiang.utils.ThrowableUtil;
import co.yixiang.utils.ValidationUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -91,6 +92,13 @@ public class DeptController {
@PutMapping
@PreAuthorize("@el.check('admin','dept:edit')")
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);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}