shop模块代码规范调整

This commit is contained in:
hupeng
2020-02-23 19:57:00 +08:00
parent 83997c7c34
commit 68b3d42f4d
30 changed files with 222 additions and 283 deletions

View File

@ -12,8 +12,8 @@ import co.yixiang.modules.shop.domain.YxUserBill;
import co.yixiang.modules.shop.service.YxUserBillService; import co.yixiang.modules.shop.service.YxUserBillService;
import co.yixiang.modules.shop.service.YxUserService; import co.yixiang.modules.shop.service.YxUserService;
import co.yixiang.modules.shop.service.dto.YxUserDTO; import co.yixiang.modules.shop.service.dto.YxUserDTO;
import co.yixiang.modules.wechat.service.YxWechatUserService; import co.yixiang.modules.shop.service.YxWechatUserService;
import co.yixiang.modules.wechat.service.dto.YxWechatUserDTO; import co.yixiang.modules.shop.service.dto.YxWechatUserDTO;
import co.yixiang.utils.OrderUtil; import co.yixiang.utils.OrderUtil;
import co.yixiang.utils.RedisUtil; import co.yixiang.utils.RedisUtil;
import com.github.binarywang.wxpay.bean.entpay.EntPayRequest; import com.github.binarywang.wxpay.bean.entpay.EntPayRequest;

View File

@ -1,4 +1,4 @@
package co.yixiang.modules.wechat.domain; package co.yixiang.modules.shop.domain;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions; import cn.hutool.core.bean.copier.CopyOptions;

View File

@ -1,4 +1,4 @@
package co.yixiang.modules.wechat.domain; package co.yixiang.modules.shop.domain;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions; import cn.hutool.core.bean.copier.CopyOptions;

View File

@ -1,6 +1,6 @@
package co.yixiang.modules.wechat.repository; package co.yixiang.modules.shop.repository;
import co.yixiang.modules.wechat.domain.YxSystemConfig; import co.yixiang.modules.shop.domain.YxSystemConfig;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

View File

@ -1,6 +1,6 @@
package co.yixiang.modules.wechat.repository; package co.yixiang.modules.shop.repository;
import co.yixiang.modules.wechat.domain.YxWechatUser; import co.yixiang.modules.shop.domain.YxWechatUser;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

View File

@ -1,14 +1,11 @@
package co.yixiang.modules.shop.rest; package co.yixiang.modules.shop.rest;
import cn.hutool.core.util.StrUtil;
import co.yixiang.aop.log.Log; import co.yixiang.aop.log.Log;
import co.yixiang.exception.BadRequestException;
import co.yixiang.modules.shop.domain.YxExpress; import co.yixiang.modules.shop.domain.YxExpress;
import co.yixiang.modules.shop.service.YxExpressService; import co.yixiang.modules.shop.service.YxExpressService;
import co.yixiang.modules.shop.service.dto.YxExpressQueryCriteria; import co.yixiang.modules.shop.service.dto.YxExpressQueryCriteria;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
@ -20,13 +17,17 @@ import org.springframework.web.bind.annotation.*;
* @author hupeng * @author hupeng
* @date 2019-12-12 * @date 2019-12-12
*/ */
@Api(tags = "快递管理") @Api(tags = "商城:快递管理")
@RestController @RestController
@RequestMapping("api") @RequestMapping("api")
public class YxExpressController { public class ExpressController {
@Autowired
private YxExpressService yxExpressService; private final YxExpressService yxExpressService;
public ExpressController(YxExpressService yxExpressService) {
this.yxExpressService = yxExpressService;
}
@Log("查询快递") @Log("查询快递")
@ApiOperation(value = "查询快递") @ApiOperation(value = "查询快递")

View File

@ -6,30 +6,26 @@ import co.yixiang.modules.shop.domain.YxMaterial;
import co.yixiang.modules.shop.service.YxMaterialService; import co.yixiang.modules.shop.service.YxMaterialService;
import co.yixiang.modules.shop.service.dto.YxMaterialQueryCriteria; import co.yixiang.modules.shop.service.dto.YxMaterialQueryCriteria;
import co.yixiang.utils.SecurityUtils; import co.yixiang.utils.SecurityUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
/** /**
* @author hupeng * @author hupeng
* @date 2020-01-09 * @date 2020-01-09
*/ */
@Api(tags = "素材管理管理") @Api(tags = "商城:素材管理管理")
@RestController @RestController
@RequestMapping("/api/material") @RequestMapping("/api/material")
public class YxMaterialController { public class MaterialController {
private final YxMaterialService yxMaterialService; private final YxMaterialService yxMaterialService;
public YxMaterialController(YxMaterialService yxMaterialService) { public MaterialController(YxMaterialService yxMaterialService) {
this.yxMaterialService = yxMaterialService; this.yxMaterialService = yxMaterialService;
} }

View File

@ -4,28 +4,26 @@ import co.yixiang.aop.log.Log;
import co.yixiang.modules.shop.domain.YxMaterialGroup; import co.yixiang.modules.shop.domain.YxMaterialGroup;
import co.yixiang.modules.shop.service.YxMaterialGroupService; import co.yixiang.modules.shop.service.YxMaterialGroupService;
import co.yixiang.modules.shop.service.dto.YxMaterialGroupQueryCriteria; import co.yixiang.modules.shop.service.dto.YxMaterialGroupQueryCriteria;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
/** /**
* @author hupeng * @author hupeng
* @date 2020-01-09 * @date 2020-01-09
*/ */
@Api(tags = "素材分组管理") @Api(tags = "商城:素材分组管理")
@RestController @RestController
@RequestMapping("/api/materialgroup") @RequestMapping("/api/materialgroup")
public class YxMaterialGroupController { public class MaterialGroupController {
private final YxMaterialGroupService yxMaterialGroupService; private final YxMaterialGroupService yxMaterialGroupService;
public YxMaterialGroupController(YxMaterialGroupService yxMaterialGroupService) { public MaterialGroupController(YxMaterialGroupService yxMaterialGroupService) {
this.yxMaterialGroupService = yxMaterialGroupService; this.yxMaterialGroupService = yxMaterialGroupService;
} }

View File

@ -1,19 +1,16 @@
package co.yixiang.modules.shop.rest; package co.yixiang.modules.shop.rest;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import co.yixiang.aop.log.Log; import co.yixiang.aop.log.Log;
import co.yixiang.exception.BadRequestException;
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.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 co.yixiang.modules.wechat.service.YxSystemConfigService;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
@ -25,16 +22,18 @@ import org.springframework.web.bind.annotation.*;
* @author hupeng * @author hupeng
* @date 2019-10-06 * @date 2019-10-06
*/ */
@Api(tags = "用户管理") @Api(tags = "商城:会员管理")
@RestController @RestController
@RequestMapping("api") @RequestMapping("api")
public class YxUserController { public class MemberController {
@Autowired private final YxUserService yxUserService;
private YxUserService yxUserService; private final YxSystemConfigService yxSystemConfigService;
@Autowired public MemberController(YxUserService yxUserService, YxSystemConfigService yxSystemConfigService) {
private YxSystemConfigService yxSystemConfigService; this.yxUserService = yxUserService;
this.yxSystemConfigService = yxSystemConfigService;
}
@Log("查询用户") @Log("查询用户")
@ApiOperation(value = "查询用户") @ApiOperation(value = "查询用户")
@ -86,7 +85,6 @@ public class YxUserController {
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
JSONObject jsonObject = JSON.parseObject(jsonStr); JSONObject jsonObject = JSON.parseObject(jsonStr);
int status = Integer.valueOf(jsonObject.get("status").toString()); int status = Integer.valueOf(jsonObject.get("status").toString());
//System.out.println(status);
yxUserService.onStatus(id,status); yxUserService.onStatus(id,status);
return new ResponseEntity(HttpStatus.OK); return new ResponseEntity(HttpStatus.OK);
} }
@ -95,7 +93,6 @@ public class YxUserController {
@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);
} }

View File

@ -10,7 +10,6 @@ import co.yixiang.modules.shop.service.dto.YxStoreCategoryQueryCriteria;
import co.yixiang.utils.OrderUtil; import co.yixiang.utils.OrderUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
@ -26,17 +25,19 @@ import java.util.List;
* @author hupeng * @author hupeng
* @date 2019-10-03 * @date 2019-10-03
*/ */
@Api(tags = "商品分类管理") @Api(tags = "城:商品分类管理")
@RestController @RestController
@RequestMapping("api") @RequestMapping("api")
public class YxStoreCategoryController { public class StoreCategoryController {
@Autowired
private YxStoreCategoryService yxStoreCategoryService;
private final YxStoreCategoryService yxStoreCategoryService;
public StoreCategoryController(YxStoreCategoryService yxStoreCategoryService) {
this.yxStoreCategoryService = yxStoreCategoryService;
}
@Log("导出数据") @Log("导出数据")
@ApiOperation("导出数据") @ApiOperation("导出数据")
@GetMapping(value = "/yxStoreCategory/download") @GetMapping(value = "/yxStoreCategory/download")
@ -52,7 +53,6 @@ public class YxStoreCategoryController {
@PreAuthorize("@el.check('admin','YXSTORECATEGORY_ALL','YXSTORECATEGORY_SELECT')") @PreAuthorize("@el.check('admin','YXSTORECATEGORY_ALL','YXSTORECATEGORY_SELECT')")
public ResponseEntity getYxStoreCategorys(YxStoreCategoryQueryCriteria criteria, Pageable pageable){ public ResponseEntity getYxStoreCategorys(YxStoreCategoryQueryCriteria criteria, Pageable pageable){
List<YxStoreCategoryDTO> categoryDTOList = yxStoreCategoryService.queryAll(criteria); List<YxStoreCategoryDTO> categoryDTOList = yxStoreCategoryService.queryAll(criteria);
return new ResponseEntity(yxStoreCategoryService.buildTree(categoryDTOList),HttpStatus.OK); return new ResponseEntity(yxStoreCategoryService.buildTree(categoryDTOList),HttpStatus.OK);
} }

View File

@ -4,6 +4,7 @@ import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import co.yixiang.annotation.AnonymousAccess;
import co.yixiang.aop.log.Log; import co.yixiang.aop.log.Log;
import co.yixiang.exception.BadRequestException; import co.yixiang.exception.BadRequestException;
import co.yixiang.modules.shop.domain.YxStoreOrder; import co.yixiang.modules.shop.domain.YxStoreOrder;
@ -14,8 +15,8 @@ import co.yixiang.modules.shop.service.YxStoreOrderStatusService;
import co.yixiang.modules.shop.service.dto.YxExpressDTO; import co.yixiang.modules.shop.service.dto.YxExpressDTO;
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 co.yixiang.modules.wechat.service.YxWechatUserService; import co.yixiang.modules.shop.service.YxWechatUserService;
import co.yixiang.modules.wechat.service.dto.YxWechatUserDTO; import co.yixiang.modules.shop.service.dto.YxWechatUserDTO;
import co.yixiang.mp.domain.YxWechatTemplate; import co.yixiang.mp.domain.YxWechatTemplate;
import co.yixiang.mp.service.WxMpTemplateMessageService; import co.yixiang.mp.service.WxMpTemplateMessageService;
import co.yixiang.mp.service.YxWechatTemplateService; import co.yixiang.mp.service.YxWechatTemplateService;
@ -24,7 +25,6 @@ import co.yixiang.utils.RedisUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
@ -36,59 +36,59 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
* @author hupeng * @author hupeng
* @date 2019-10-14 * @date 2019-10-14
*/ */
@Api(tags = "订单管理") @Api(tags = "商城:订单管理")
@RestController @RestController
@RequestMapping("api") @RequestMapping("api")
@Slf4j @Slf4j
public class YxStoreOrderController { public class StoreOrderController {
@Autowired
private YxStoreOrderService yxStoreOrderService;
@Autowired private final YxStoreOrderService yxStoreOrderService;
private YxStoreOrderStatusService yxStoreOrderStatusService; private final YxStoreOrderStatusService yxStoreOrderStatusService;
private final YxExpressService yxExpressService;
@Autowired private final YxWechatUserService wechatUserService;
private YxExpressService yxExpressService; private final WxMpTemplateMessageService templateMessageService;
private final YxWechatTemplateService yxWechatTemplateService;
@Autowired
private YxWechatUserService wechatUserService;
@Autowired
private WxMpTemplateMessageService templateMessageService;
@Autowired
private YxWechatTemplateService yxWechatTemplateService;
public StoreOrderController(YxStoreOrderService yxStoreOrderService, YxStoreOrderStatusService yxStoreOrderStatusService,
YxExpressService yxExpressService, YxWechatUserService wechatUserService, WxMpTemplateMessageService templateMessageService,
YxWechatTemplateService yxWechatTemplateService) {
this.yxStoreOrderService = yxStoreOrderService;
this.yxStoreOrderStatusService = yxStoreOrderStatusService;
this.yxExpressService = yxExpressService;
this.wechatUserService = wechatUserService;
this.templateMessageService = templateMessageService;
this.yxWechatTemplateService = yxWechatTemplateService;
}
@GetMapping(value = "/data/count") @GetMapping(value = "/data/count")
//@PreAuthorize("@el.check('admin','YXSTOREORDER_ALL','YXSTOREORDER_SELECT')") @AnonymousAccess
public ResponseEntity getCount(){ public ResponseEntity getCount() {
return new ResponseEntity(yxStoreOrderService.getOrderTimeData(),HttpStatus.OK); return new ResponseEntity(yxStoreOrderService.getOrderTimeData(), HttpStatus.OK);
} }
@GetMapping(value = "/data/chart") @GetMapping(value = "/data/chart")
//@PreAuthorize("@el.check('admin','YXSTOREORDER_ALL','YXSTOREORDER_SELECT')") @AnonymousAccess
public ResponseEntity getChart(){ public ResponseEntity getChart() {
return new ResponseEntity(yxStoreOrderService.chartCount(),HttpStatus.OK); return new ResponseEntity(yxStoreOrderService.chartCount(), HttpStatus.OK);
} }
@ApiOperation(value = "查询订单") @ApiOperation(value = "查询订单")
@GetMapping(value = "/yxStoreOrder") @GetMapping(value = "/yxStoreOrder")
@PreAuthorize("@el.check('admin','YXSTOREORDER_ALL','YXSTOREORDER_SELECT')") @PreAuthorize("@el.check('admin','YXSTOREORDER_ALL','YXSTOREORDER_SELECT')")
public ResponseEntity getYxStoreOrders(YxStoreOrderQueryCriteria criteria, public ResponseEntity getYxStoreOrders(YxStoreOrderQueryCriteria criteria,
Pageable pageable, Pageable pageable,
@RequestParam(name = "orderStatus") String orderStatus, @RequestParam(name = "orderStatus") String orderStatus,
@RequestParam(name = "orderType") String orderType){ @RequestParam(name = "orderType") String orderType) {
if(StrUtil.isNotEmpty(orderStatus)){ //订单状态查询
switch (orderStatus){ if (StrUtil.isNotEmpty(orderStatus)) {
switch (orderStatus) {
case "0": case "0":
criteria.setIsDel(0); criteria.setIsDel(0);
criteria.setPaid(0); criteria.setPaid(0);
@ -134,8 +134,9 @@ public class YxStoreOrderController {
break; break;
} }
} }
if(StrUtil.isNotEmpty(orderType)){ //订单类型查询
switch (orderType){ if (StrUtil.isNotEmpty(orderType)) {
switch (orderType) {
case "1": case "1":
criteria.setBargainId(0); criteria.setBargainId(0);
criteria.setCombinationId(0); criteria.setCombinationId(0);
@ -153,22 +154,19 @@ public class YxStoreOrderController {
} }
} }
return new ResponseEntity(yxStoreOrderService.queryAll(criteria, pageable), HttpStatus.OK);
return new ResponseEntity(yxStoreOrderService.queryAll(criteria,pageable),HttpStatus.OK);
} }
@ApiOperation(value = "发货") @ApiOperation(value = "发货")
@PutMapping(value = "/yxStoreOrder") @PutMapping(value = "/yxStoreOrder")
@PreAuthorize("@el.check('admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT')") @PreAuthorize("@el.check('admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT')")
public ResponseEntity update(@Validated @RequestBody YxStoreOrder resources){ public ResponseEntity update(@Validated @RequestBody YxStoreOrder resources) {
if(StrUtil.isBlank(resources.getDeliveryName())) throw new BadRequestException("请选择快递公司"); if (StrUtil.isBlank(resources.getDeliveryName())) throw new BadRequestException("请选择快递公司");
if(StrUtil.isBlank(resources.getDeliveryId())) throw new BadRequestException("快递单号不能为空"); if (StrUtil.isBlank(resources.getDeliveryId())) throw new BadRequestException("快递单号不能为空");
YxExpressDTO expressDTO = yxExpressService.findById(Integer.valueOf(resources YxExpressDTO expressDTO = yxExpressService.findById(Integer.valueOf(resources
.getDeliveryName())); .getDeliveryName()));
if(ObjectUtil.isNull(expressDTO)){ if (ObjectUtil.isNull(expressDTO)) {
throw new BadRequestException("请先添加快递公司"); throw new BadRequestException("请先添加快递公司");
} }
resources.setStatus(1); resources.setStatus(1);
@ -181,35 +179,35 @@ public class YxStoreOrderController {
YxStoreOrderStatus storeOrderStatus = new YxStoreOrderStatus(); YxStoreOrderStatus storeOrderStatus = new YxStoreOrderStatus();
storeOrderStatus.setOid(resources.getId()); storeOrderStatus.setOid(resources.getId());
storeOrderStatus.setChangeType("delivery_goods"); storeOrderStatus.setChangeType("delivery_goods");
storeOrderStatus.setChangeMessage("已发货 快递公司:"+resources.getDeliveryName() storeOrderStatus.setChangeMessage("已发货 快递公司:" + resources.getDeliveryName()
+" 快递单号:"+resources.getDeliveryId()); + " 快递单号:" + resources.getDeliveryId());
storeOrderStatus.setChangeTime(OrderUtil.getSecondTimestampTwo()); storeOrderStatus.setChangeTime(OrderUtil.getSecondTimestampTwo());
yxStoreOrderStatusService.create(storeOrderStatus); yxStoreOrderStatusService.create(storeOrderStatus);
//模板消息通知 //模板消息通知
String siteUrl = RedisUtil.get("site_url"); String siteUrl = RedisUtil.get("site_url");
try{ try {
YxWechatUserDTO wechatUser = wechatUserService.findById(resources.getUid()); YxWechatUserDTO wechatUser = wechatUserService.findById(resources.getUid());
if(ObjectUtil.isNotNull(wechatUser)){ if (ObjectUtil.isNotNull(wechatUser)) {
if(StrUtil.isNotBlank(wechatUser.getOpenid())){ if (StrUtil.isNotBlank(wechatUser.getOpenid())) {
YxWechatTemplate WechatTemplate = yxWechatTemplateService YxWechatTemplate WechatTemplate = yxWechatTemplateService
.findByTempkey("OPENTM200565259"); .findByTempkey("OPENTM200565259");
Map<String,String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
map.put("first","亲,宝贝已经启程了,好想快点来到你身边。"); map.put("first", "亲,宝贝已经启程了,好想快点来到你身边。");
map.put("keyword1",resources.getOrderId());//订单号 map.put("keyword1", resources.getOrderId());//订单号
map.put("keyword2",expressDTO.getName()); map.put("keyword2", expressDTO.getName());
map.put("keyword3",resources.getDeliveryId()); map.put("keyword3", resources.getDeliveryId());
map.put("remark","yshop电商系统为你服务"); map.put("remark", "yshop电商系统为你服务");
templateMessageService.sendWxMpTemplateMessage( wechatUser.getOpenid() templateMessageService.sendWxMpTemplateMessage(wechatUser.getOpenid()
,WechatTemplate.getTempid(), , WechatTemplate.getTempid(),
siteUrl+"/order/detail/"+resources.getOrderId(),map); siteUrl + "/order/detail/" + resources.getOrderId(), map);
}else if(StrUtil.isNotBlank(wechatUser.getRoutineOpenid())){ } else if (StrUtil.isNotBlank(wechatUser.getRoutineOpenid())) {
//todo 小程序通知 //todo 小程序通知
} }
} }
}catch (Exception e){ } catch (Exception e) {
log.info("当前用户不是微信用户不能发送模板消息哦!"); log.info("当前用户不是微信用户不能发送模板消息哦!");
} }
@ -221,32 +219,32 @@ public class YxStoreOrderController {
@ApiOperation(value = "退款") @ApiOperation(value = "退款")
@PostMapping(value = "/yxStoreOrder/refund") @PostMapping(value = "/yxStoreOrder/refund")
@PreAuthorize("@el.check('admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT')") @PreAuthorize("@el.check('admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT')")
public ResponseEntity refund(@Validated @RequestBody YxStoreOrder resources){ public ResponseEntity refund(@Validated @RequestBody YxStoreOrder resources) {
yxStoreOrderService.refund(resources); yxStoreOrderService.refund(resources);
//模板消息通知 //模板消息通知
String siteUrl = RedisUtil.get("site_url"); String siteUrl = RedisUtil.get("site_url");
try{ try {
YxWechatUserDTO wechatUser = wechatUserService.findById(resources.getUid()); YxWechatUserDTO wechatUser = wechatUserService.findById(resources.getUid());
if(ObjectUtil.isNotNull(wechatUser)){ if (ObjectUtil.isNotNull(wechatUser)) {
if(StrUtil.isNotBlank(wechatUser.getOpenid())){ if (StrUtil.isNotBlank(wechatUser.getOpenid())) {
YxWechatTemplate WechatTemplate = yxWechatTemplateService YxWechatTemplate WechatTemplate = yxWechatTemplateService
.findByTempkey("OPENTM410119152"); .findByTempkey("OPENTM410119152");
Map<String,String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
map.put("first","您在yshop的订单退款申请被通过钱款将很快还至您的支付账户。"); map.put("first", "您在yshop的订单退款申请被通过钱款将很快还至您的支付账户。");
map.put("keyword1",resources.getOrderId());//订单号 map.put("keyword1", resources.getOrderId());//订单号
map.put("keyword2",resources.getPayPrice().toString()); map.put("keyword2", resources.getPayPrice().toString());
map.put("keyword3", OrderUtil.stampToDate(resources.getAddTime().toString())); map.put("keyword3", OrderUtil.stampToDate(resources.getAddTime().toString()));
map.put("remark","yshop电商系统为你服务"); map.put("remark", "yshop电商系统为你服务");
templateMessageService.sendWxMpTemplateMessage( wechatUser.getOpenid() templateMessageService.sendWxMpTemplateMessage(wechatUser.getOpenid()
,WechatTemplate.getTempid(), , WechatTemplate.getTempid(),
siteUrl+"/order/detail/"+resources.getOrderId(),map); siteUrl + "/order/detail/" + resources.getOrderId(), map);
}else if(StrUtil.isNotBlank(wechatUser.getRoutineOpenid())){ } else if (StrUtil.isNotBlank(wechatUser.getRoutineOpenid())) {
//todo 小程序通知 //todo 小程序通知
} }
} }
}catch (Exception e){ } catch (Exception e) {
log.info("当前用户不是微信用户不能发送模板消息哦!"); log.info("当前用户不是微信用户不能发送模板消息哦!");
} }
@ -259,28 +257,27 @@ public class YxStoreOrderController {
@ApiOperation(value = "删除") @ApiOperation(value = "删除")
@DeleteMapping(value = "/yxStoreOrder/{id}") @DeleteMapping(value = "/yxStoreOrder/{id}")
@PreAuthorize("@el.check('admin','YXSTOREORDER_ALL','YXSTOREORDER_DELETE')") @PreAuthorize("@el.check('admin','YXSTOREORDER_ALL','YXSTOREORDER_DELETE')")
public ResponseEntity delete(@PathVariable Integer id){ public ResponseEntity delete(@PathVariable Integer id) {
//if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作"); //if(StrUtil.isNotEmpty("22")) throw new BadRequestException("演示环境禁止操作");
yxStoreOrderService.delete(id); yxStoreOrderService.delete(id);
return new ResponseEntity(HttpStatus.OK); return new ResponseEntity(HttpStatus.OK);
} }
@Log("修改订单") @Log("修改订单")
@ApiOperation(value = "修改订单") @ApiOperation(value = "修改订单")
@PostMapping(value = "/yxStoreOrder/edit") @PostMapping(value = "/yxStoreOrder/edit")
@PreAuthorize("hasAnyRole('admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT')") @PreAuthorize("hasAnyRole('admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT')")
public ResponseEntity editOrder(@RequestBody YxStoreOrder resources){ public ResponseEntity editOrder(@RequestBody YxStoreOrder resources) {
if(ObjectUtil.isNull(resources.getPayPrice())) throw new BadRequestException("请输入支付金额"); if (ObjectUtil.isNull(resources.getPayPrice())) throw new BadRequestException("请输入支付金额");
if(resources.getPayPrice().doubleValue() < 0) throw new BadRequestException("金额不能低于0"); if (resources.getPayPrice().doubleValue() < 0) throw new BadRequestException("金额不能低于0");
YxStoreOrderDTO storeOrder = yxStoreOrderService.findById(resources.getId()); YxStoreOrderDTO storeOrder = yxStoreOrderService.findById(resources.getId());
//判断金额是否有变动,生成一个额外订单号去支付 //判断金额是否有变动,生成一个额外订单号去支付
int res = NumberUtil.compare(storeOrder.getPayPrice().doubleValue(),resources.getPayPrice().doubleValue()); int res = NumberUtil.compare(storeOrder.getPayPrice().doubleValue(), resources.getPayPrice().doubleValue());
if(res != 0){ if (res != 0) {
String orderSn = IdUtil.getSnowflake(0,0).nextIdStr(); String orderSn = IdUtil.getSnowflake(0, 0).nextIdStr();
resources.setExtendOrderId(orderSn); resources.setExtendOrderId(orderSn);
} }
@ -290,7 +287,7 @@ public class YxStoreOrderController {
YxStoreOrderStatus storeOrderStatus = new YxStoreOrderStatus(); YxStoreOrderStatus storeOrderStatus = new YxStoreOrderStatus();
storeOrderStatus.setOid(resources.getId()); storeOrderStatus.setOid(resources.getId());
storeOrderStatus.setChangeType("order_edit"); storeOrderStatus.setChangeType("order_edit");
storeOrderStatus.setChangeMessage("修改订单价格为:"+resources.getPayPrice()); storeOrderStatus.setChangeMessage("修改订单价格为:" + resources.getPayPrice());
storeOrderStatus.setChangeTime(OrderUtil.getSecondTimestampTwo()); storeOrderStatus.setChangeTime(OrderUtil.getSecondTimestampTwo());
yxStoreOrderStatusService.create(storeOrderStatus); yxStoreOrderStatusService.create(storeOrderStatus);
@ -301,8 +298,8 @@ public class YxStoreOrderController {
@ApiOperation(value = "修改订单备注") @ApiOperation(value = "修改订单备注")
@PostMapping(value = "/yxStoreOrder/remark") @PostMapping(value = "/yxStoreOrder/remark")
@PreAuthorize("hasAnyRole('admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT')") @PreAuthorize("hasAnyRole('admin','YXSTOREORDER_ALL','YXSTOREORDER_EDIT')")
public ResponseEntity editOrderRemark(@RequestBody YxStoreOrder resources){ public ResponseEntity editOrderRemark(@RequestBody YxStoreOrder resources) {
if(StrUtil.isBlank(resources.getRemark())) throw new BadRequestException("请输入备注"); if (StrUtil.isBlank(resources.getRemark())) throw new BadRequestException("请输入备注");
yxStoreOrderService.update(resources); yxStoreOrderService.update(resources);
return new ResponseEntity(HttpStatus.OK); return new ResponseEntity(HttpStatus.OK);
} }

View File

@ -3,7 +3,6 @@ package co.yixiang.modules.shop.rest;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import co.yixiang.aop.log.Log; import co.yixiang.aop.log.Log;
import co.yixiang.exception.BadRequestException;
import co.yixiang.modules.shop.domain.YxStoreProduct; import co.yixiang.modules.shop.domain.YxStoreProduct;
import co.yixiang.modules.shop.service.YxStoreProductService; import co.yixiang.modules.shop.service.YxStoreProductService;
import co.yixiang.modules.shop.service.dto.YxStoreProductQueryCriteria; import co.yixiang.modules.shop.service.dto.YxStoreProductQueryCriteria;
@ -12,7 +11,6 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
@ -26,13 +24,16 @@ import java.math.BigDecimal;
* @author hupeng * @author hupeng
* @date 2019-10-04 * @date 2019-10-04
*/ */
@Api(tags = "商品管理") @Api(tags = "城:商品管理")
@RestController @RestController
@RequestMapping("api") @RequestMapping("api")
public class YxStoreProductController { public class StoreProductController {
@Autowired private final YxStoreProductService yxStoreProductService;
private YxStoreProductService yxStoreProductService;
public StoreProductController(YxStoreProductService yxStoreProductService) {
this.yxStoreProductService = yxStoreProductService;
}
@Log("查询商品") @Log("查询商品")
@ApiOperation(value = "查询商品") @ApiOperation(value = "查询商品")
@ -82,7 +83,7 @@ public class YxStoreProductController {
return new ResponseEntity(HttpStatus.OK); return new ResponseEntity(HttpStatus.OK);
} }
@ApiOperation(value = "商品上架下架") @ApiOperation(value = "商品上架/下架")
@PostMapping(value = "/yxStoreProduct/onsale/{id}") @PostMapping(value = "/yxStoreProduct/onsale/{id}")
public ResponseEntity onSale(@PathVariable Integer id,@RequestBody String jsonStr){ public ResponseEntity onSale(@PathVariable Integer id,@RequestBody String jsonStr){
JSONObject jsonObject = JSON.parseObject(jsonStr); JSONObject jsonObject = JSON.parseObject(jsonStr);

View File

@ -1,14 +1,11 @@
package co.yixiang.modules.shop.rest; package co.yixiang.modules.shop.rest;
import cn.hutool.core.util.StrUtil;
import co.yixiang.aop.log.Log; import co.yixiang.aop.log.Log;
import co.yixiang.exception.BadRequestException;
import co.yixiang.modules.shop.domain.YxStoreProductReply; import co.yixiang.modules.shop.domain.YxStoreProductReply;
import co.yixiang.modules.shop.service.YxStoreProductReplyService; import co.yixiang.modules.shop.service.YxStoreProductReplyService;
import co.yixiang.modules.shop.service.dto.YxStoreProductReplyQueryCriteria; import co.yixiang.modules.shop.service.dto.YxStoreProductReplyQueryCriteria;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
@ -20,13 +17,17 @@ import org.springframework.web.bind.annotation.*;
* @author hupeng * @author hupeng
* @date 2019-11-03 * @date 2019-11-03
*/ */
@Api(tags = "评论管理") @Api(tags = "商城:评论管理")
@RestController @RestController
@RequestMapping("api") @RequestMapping("api")
public class YxStoreProductReplyController { public class StoreProductReplyController {
@Autowired
private YxStoreProductReplyService yxStoreProductReplyService; private final YxStoreProductReplyService yxStoreProductReplyService;
public StoreProductReplyController(YxStoreProductReplyService yxStoreProductReplyService) {
this.yxStoreProductReplyService = yxStoreProductReplyService;
}
@Log("查询") @Log("查询")
@ApiOperation(value = "查询") @ApiOperation(value = "查询")

View File

@ -1,19 +1,16 @@
package co.yixiang.modules.wechat.rest; package co.yixiang.modules.shop.rest;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import co.yixiang.aop.log.Log; import co.yixiang.aop.log.Log;
import co.yixiang.exception.BadRequestException; import co.yixiang.modules.shop.domain.YxSystemConfig;
import co.yixiang.modules.wechat.domain.YxSystemConfig; import co.yixiang.modules.shop.service.YxSystemConfigService;
import co.yixiang.modules.wechat.service.YxSystemConfigService; import co.yixiang.modules.shop.service.dto.YxSystemConfigQueryCriteria;
import co.yixiang.modules.wechat.service.dto.YxSystemConfigQueryCriteria;
import co.yixiang.mp.config.WxMpConfiguration; import co.yixiang.mp.config.WxMpConfiguration;
import co.yixiang.utils.RedisUtil; import co.yixiang.utils.RedisUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
@ -24,13 +21,16 @@ import org.springframework.web.bind.annotation.*;
* @author hupeng * @author hupeng
* @date 2019-10-10 * @date 2019-10-10
*/ */
@Api(tags = "配置管理") @Api(tags = "商城:配置管理")
@RestController @RestController
@RequestMapping("api") @RequestMapping("api")
public class YxSystemConfigController { public class SystemConfigController {
@Autowired private final YxSystemConfigService yxSystemConfigService;
private YxSystemConfigService yxSystemConfigService;
public SystemConfigController(YxSystemConfigService yxSystemConfigService) {
this.yxSystemConfigService = yxSystemConfigService;
}
@Log("查询") @Log("查询")
@ApiOperation(value = "查询") @ApiOperation(value = "查询")

View File

@ -25,13 +25,16 @@ import org.springframework.web.bind.annotation.*;
* @author hupeng * @author hupeng
* @date 2019-10-18 * @date 2019-10-18
*/ */
@Api(tags = "数据配置管理") @Api(tags = "商城:数据配置管理")
@RestController @RestController
@RequestMapping("api") @RequestMapping("api")
public class YxSystemGroupDataController { public class SystemGroupDataController {
@Autowired private final YxSystemGroupDataService yxSystemGroupDataService;
private YxSystemGroupDataService yxSystemGroupDataService;
public SystemGroupDataController(YxSystemGroupDataService yxSystemGroupDataService) {
this.yxSystemGroupDataService = yxSystemGroupDataService;
}
@Log("查询数据配置") @Log("查询数据配置")
@ApiOperation(value = "查询数据配置") @ApiOperation(value = "查询数据配置")
@ -40,7 +43,7 @@ public class YxSystemGroupDataController {
public ResponseEntity getYxSystemGroupDatas(YxSystemGroupDataQueryCriteria criteria, public ResponseEntity getYxSystemGroupDatas(YxSystemGroupDataQueryCriteria criteria,
Pageable pageable){ Pageable pageable){
Sort sort = new Sort(Sort.Direction.DESC, "sort"); Sort sort = new Sort(Sort.Direction.DESC, "sort");
Pageable pageableT = new PageRequest(pageable.getPageNumber(), Pageable pageableT = PageRequest.of(pageable.getPageNumber(),
pageable.getPageSize(), pageable.getPageSize(),
sort); sort);
return new ResponseEntity(yxSystemGroupDataService.queryAll(criteria,pageableT),HttpStatus.OK); return new ResponseEntity(yxSystemGroupDataService.queryAll(criteria,pageableT),HttpStatus.OK);

View File

@ -1,15 +1,12 @@
package co.yixiang.modules.shop.rest; package co.yixiang.modules.shop.rest;
import cn.hutool.core.util.StrUtil;
import co.yixiang.aop.log.Log; import co.yixiang.aop.log.Log;
import co.yixiang.exception.BadRequestException;
import co.yixiang.modules.shop.domain.YxSystemUserLevel; import co.yixiang.modules.shop.domain.YxSystemUserLevel;
import co.yixiang.modules.shop.service.YxSystemUserLevelService; import co.yixiang.modules.shop.service.YxSystemUserLevelService;
import co.yixiang.modules.shop.service.dto.YxSystemUserLevelQueryCriteria; import co.yixiang.modules.shop.service.dto.YxSystemUserLevelQueryCriteria;
import co.yixiang.utils.OrderUtil; import co.yixiang.utils.OrderUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
@ -21,13 +18,16 @@ import org.springframework.web.bind.annotation.*;
* @author hupeng * @author hupeng
* @date 2019-12-04 * @date 2019-12-04
*/ */
@Api(tags = "用户等级管理") @Api(tags = "商城:用户等级管理")
@RestController @RestController
@RequestMapping("api") @RequestMapping("api")
public class YxSystemUserLevelController { public class SystemUserLevelController {
@Autowired private final YxSystemUserLevelService yxSystemUserLevelService;
private YxSystemUserLevelService yxSystemUserLevelService;
public SystemUserLevelController(YxSystemUserLevelService yxSystemUserLevelService) {
this.yxSystemUserLevelService = yxSystemUserLevelService;
}
@Log("查询") @Log("查询")
@ApiOperation(value = "查询") @ApiOperation(value = "查询")

View File

@ -1,8 +1,6 @@
package co.yixiang.modules.shop.rest; package co.yixiang.modules.shop.rest;
import cn.hutool.core.util.StrUtil;
import co.yixiang.aop.log.Log; import co.yixiang.aop.log.Log;
import co.yixiang.exception.BadRequestException;
import co.yixiang.modules.shop.domain.YxSystemUserTask; import co.yixiang.modules.shop.domain.YxSystemUserTask;
import co.yixiang.modules.shop.service.YxSystemUserTaskService; import co.yixiang.modules.shop.service.YxSystemUserTaskService;
import co.yixiang.modules.shop.service.dto.YxSystemUserTaskQueryCriteria; import co.yixiang.modules.shop.service.dto.YxSystemUserTaskQueryCriteria;
@ -22,13 +20,16 @@ import org.springframework.web.bind.annotation.*;
* @author hupeng * @author hupeng
* @date 2019-12-04 * @date 2019-12-04
*/ */
@Api(tags = "用户任务管理") @Api(tags = "商城:用户任务管理")
@RestController @RestController
@RequestMapping("api") @RequestMapping("api")
public class YxSystemUserTaskController { public class SystemUserTaskController {
@Autowired private final YxSystemUserTaskService yxSystemUserTaskService;
private YxSystemUserTaskService yxSystemUserTaskService;
public SystemUserTaskController(YxSystemUserTaskService yxSystemUserTaskService) {
this.yxSystemUserTaskService = yxSystemUserTaskService;
}
@Log("查询") @Log("查询")
@ApiOperation(value = "查询") @ApiOperation(value = "查询")
@ -37,7 +38,7 @@ public class YxSystemUserTaskController {
public ResponseEntity getYxSystemUserTasks(YxSystemUserTaskQueryCriteria criteria, public ResponseEntity getYxSystemUserTasks(YxSystemUserTaskQueryCriteria criteria,
Pageable pageable){ Pageable pageable){
Sort sort = new Sort(Sort.Direction.ASC, "levelId"); Sort sort = new Sort(Sort.Direction.ASC, "levelId");
Pageable pageableT = new PageRequest(pageable.getPageNumber(), Pageable pageableT = PageRequest.of(pageable.getPageNumber(),
pageable.getPageSize(), pageable.getPageSize(),
sort); sort);
return new ResponseEntity(yxSystemUserTaskService.queryAll(criteria,pageableT), return new ResponseEntity(yxSystemUserTaskService.queryAll(criteria,pageableT),

View File

@ -5,7 +5,6 @@ import co.yixiang.modules.shop.service.YxUserBillService;
import co.yixiang.modules.shop.service.dto.YxUserBillQueryCriteria; import co.yixiang.modules.shop.service.dto.YxUserBillQueryCriteria;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
@ -18,13 +17,16 @@ import org.springframework.web.bind.annotation.RestController;
* @author hupeng * @author hupeng
* @date 2019-11-06 * @date 2019-11-06
*/ */
@Api(tags = "用户账单管理") @Api(tags = "商城:用户账单管理")
@RestController @RestController
@RequestMapping("api") @RequestMapping("api")
public class YxUserBillController { public class UserBillController {
@Autowired private final YxUserBillService yxUserBillService;
private YxUserBillService yxUserBillService;
public UserBillController(YxUserBillService yxUserBillService) {
this.yxUserBillService = yxUserBillService;
}
@Log("查询") @Log("查询")
@ApiOperation(value = "查询") @ApiOperation(value = "查询")

View File

@ -1,8 +1,8 @@
package co.yixiang.modules.wechat.service; package co.yixiang.modules.shop.service;
import co.yixiang.modules.wechat.domain.YxSystemConfig; import co.yixiang.modules.shop.domain.YxSystemConfig;
import co.yixiang.modules.wechat.service.dto.YxSystemConfigDTO; import co.yixiang.modules.shop.service.dto.YxSystemConfigDTO;
import co.yixiang.modules.wechat.service.dto.YxSystemConfigQueryCriteria; import co.yixiang.modules.shop.service.dto.YxSystemConfigQueryCriteria;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import java.util.List; import java.util.List;

View File

@ -1,8 +1,8 @@
package co.yixiang.modules.wechat.service; package co.yixiang.modules.shop.service;
import co.yixiang.modules.wechat.domain.YxWechatUser; import co.yixiang.modules.shop.domain.YxWechatUser;
import co.yixiang.modules.wechat.service.dto.YxWechatUserDTO; import co.yixiang.modules.shop.service.dto.YxWechatUserDTO;
import co.yixiang.modules.wechat.service.dto.YxWechatUserQueryCriteria; import co.yixiang.modules.shop.service.dto.YxWechatUserQueryCriteria;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import java.util.List; import java.util.List;

View File

@ -1,4 +1,4 @@
package co.yixiang.modules.wechat.service.dto; package co.yixiang.modules.shop.service.dto;
import lombok.Data; import lombok.Data;

View File

@ -1,4 +1,4 @@
package co.yixiang.modules.wechat.service.dto; package co.yixiang.modules.shop.service.dto;
import lombok.Data; import lombok.Data;

View File

@ -1,4 +1,4 @@
package co.yixiang.modules.wechat.service.dto; package co.yixiang.modules.shop.service.dto;
import lombok.Data; import lombok.Data;

View File

@ -1,4 +1,4 @@
package co.yixiang.modules.wechat.service.dto; package co.yixiang.modules.shop.service.dto;
import lombok.Data; import lombok.Data;

View File

@ -29,11 +29,14 @@ import java.util.Optional;
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class) @Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public class YxExpressServiceImpl implements YxExpressService { public class YxExpressServiceImpl implements YxExpressService {
@Autowired private final YxExpressRepository yxExpressRepository;
private YxExpressRepository yxExpressRepository;
@Autowired private final YxExpressMapper yxExpressMapper;
private YxExpressMapper yxExpressMapper;
public YxExpressServiceImpl(YxExpressRepository yxExpressRepository, YxExpressMapper yxExpressMapper) {
this.yxExpressRepository = yxExpressRepository;
this.yxExpressMapper = yxExpressMapper;
}
@Override @Override
public Map<String,Object> queryAll(YxExpressQueryCriteria criteria, Pageable pageable){ public Map<String,Object> queryAll(YxExpressQueryCriteria criteria, Pageable pageable){

View File

@ -1,11 +1,11 @@
package co.yixiang.modules.wechat.service.impl; package co.yixiang.modules.shop.service.impl;
import co.yixiang.modules.wechat.domain.YxSystemConfig; import co.yixiang.modules.shop.domain.YxSystemConfig;
import co.yixiang.modules.wechat.repository.YxSystemConfigRepository; import co.yixiang.modules.shop.repository.YxSystemConfigRepository;
import co.yixiang.modules.wechat.service.YxSystemConfigService; import co.yixiang.modules.shop.service.YxSystemConfigService;
import co.yixiang.modules.wechat.service.dto.YxSystemConfigDTO; import co.yixiang.modules.shop.service.dto.YxSystemConfigDTO;
import co.yixiang.modules.wechat.service.dto.YxSystemConfigQueryCriteria; import co.yixiang.modules.shop.service.dto.YxSystemConfigQueryCriteria;
import co.yixiang.modules.wechat.service.mapper.YxSystemConfigMapper; import co.yixiang.modules.shop.service.mapper.YxSystemConfigMapper;
import co.yixiang.utils.PageUtil; import co.yixiang.utils.PageUtil;
import co.yixiang.utils.QueryHelp; import co.yixiang.utils.QueryHelp;
import co.yixiang.utils.ValidationUtil; import co.yixiang.utils.ValidationUtil;

View File

@ -1,11 +1,11 @@
package co.yixiang.modules.wechat.service.impl; package co.yixiang.modules.shop.service.impl;
import co.yixiang.modules.wechat.domain.YxWechatUser; import co.yixiang.modules.shop.domain.YxWechatUser;
import co.yixiang.modules.wechat.repository.YxWechatUserRepository; import co.yixiang.modules.shop.repository.YxWechatUserRepository;
import co.yixiang.modules.wechat.service.YxWechatUserService; import co.yixiang.modules.shop.service.YxWechatUserService;
import co.yixiang.modules.wechat.service.dto.YxWechatUserDTO; import co.yixiang.modules.shop.service.dto.YxWechatUserDTO;
import co.yixiang.modules.wechat.service.dto.YxWechatUserQueryCriteria; import co.yixiang.modules.shop.service.dto.YxWechatUserQueryCriteria;
import co.yixiang.modules.wechat.service.mapper.YxWechatUserMapper; import co.yixiang.modules.shop.service.mapper.YxWechatUserMapper;
import co.yixiang.utils.PageUtil; import co.yixiang.utils.PageUtil;
import co.yixiang.utils.QueryHelp; import co.yixiang.utils.QueryHelp;
import co.yixiang.utils.ValidationUtil; import co.yixiang.utils.ValidationUtil;

View File

@ -1,8 +1,8 @@
package co.yixiang.modules.wechat.service.mapper; package co.yixiang.modules.shop.service.mapper;
import co.yixiang.mapper.EntityMapper; import co.yixiang.mapper.EntityMapper;
import co.yixiang.modules.wechat.domain.YxSystemConfig; import co.yixiang.modules.shop.domain.YxSystemConfig;
import co.yixiang.modules.wechat.service.dto.YxSystemConfigDTO; import co.yixiang.modules.shop.service.dto.YxSystemConfigDTO;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy; import org.mapstruct.ReportingPolicy;

View File

@ -1,8 +1,8 @@
package co.yixiang.modules.wechat.service.mapper; package co.yixiang.modules.shop.service.mapper;
import co.yixiang.mapper.EntityMapper; import co.yixiang.mapper.EntityMapper;
import co.yixiang.modules.wechat.domain.YxWechatUser; import co.yixiang.modules.shop.domain.YxWechatUser;
import co.yixiang.modules.wechat.service.dto.YxWechatUserDTO; import co.yixiang.modules.shop.service.dto.YxWechatUserDTO;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy; import org.mapstruct.ReportingPolicy;

View File

@ -1,61 +0,0 @@
package co.yixiang.modules.wechat.rest;//package co.yixiang.modules.wechat.rest;
//
//import co.yixiang.aop.log.Log;
//import co.yixiang.modules.wechat.domain.YxWechatUser;
//import co.yixiang.modules.wechat.service.YxWechatUserService;
//import co.yixiang.modules.wechat.service.dto.YxWechatUserQueryCriteria;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.domain.Pageable;
//import org.springframework.http.HttpStatus;
//import org.springframework.http.ResponseEntity;
//import org.springframework.security.access.prepost.PreAuthorize;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.*;
//import io.swagger.annotations.*;
//
///**
//* @author hupeng
//* @date 2019-12-13
//*/
//@Api(tags = "YxWechatUser管理")
//@RestController
//@RequestMapping("api")
//public class YxWechatUserController {
//
// @Autowired
// private YxWechatUserService yxWechatUserService;
//
// @Log("查询YxWechatUser")
// @ApiOperation(value = "查询YxWechatUser")
// @GetMapping(value = "/yxWechatUser")
// @PreAuthorize("@el.check('admin','YXWECHATUSER_ALL','YXWECHATUSER_SELECT')")
// public ResponseEntity getYxWechatUsers(YxWechatUserQueryCriteria criteria, Pageable pageable){
// return new ResponseEntity(yxWechatUserService.queryAll(criteria,pageable),HttpStatus.OK);
// }
//
// @Log("新增YxWechatUser")
// @ApiOperation(value = "新增YxWechatUser")
// @PostMapping(value = "/yxWechatUser")
// @PreAuthorize("@el.check('admin','YXWECHATUSER_ALL','YXWECHATUSER_CREATE')")
// public ResponseEntity create(@Validated @RequestBody YxWechatUser resources){
// return new ResponseEntity(yxWechatUserService.create(resources),HttpStatus.CREATED);
// }
//
// @Log("修改YxWechatUser")
// @ApiOperation(value = "修改YxWechatUser")
// @PutMapping(value = "/yxWechatUser")
// @PreAuthorize("@el.check('admin','YXWECHATUSER_ALL','YXWECHATUSER_EDIT')")
// public ResponseEntity update(@Validated @RequestBody YxWechatUser resources){
// yxWechatUserService.update(resources);
// return new ResponseEntity(HttpStatus.NO_CONTENT);
// }
//
// @Log("删除YxWechatUser")
// @ApiOperation(value = "删除YxWechatUser")
// @DeleteMapping(value = "/yxWechatUser/{uid}")
// @PreAuthorize("@el.check('admin','YXWECHATUSER_ALL','YXWECHATUSER_DELETE')")
// public ResponseEntity delete(@PathVariable Integer uid){
// yxWechatUserService.delete(uid);
// return new ResponseEntity(HttpStatus.OK);
// }
//}