v4.2.5
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
package cn.lili.controller.goods;
|
||||
|
||||
import cn.lili.common.context.ThreadContextHolder;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.goods.service.GoodsImportService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author chc
|
||||
* @since 2022/6/2114:46
|
||||
*/
|
||||
@Api(tags = "商品导入")
|
||||
@RestController
|
||||
@RequestMapping("/store/goods/import")
|
||||
public class GoodsImportController {
|
||||
@Autowired
|
||||
private GoodsImportService goodsImportService;
|
||||
|
||||
|
||||
@PostMapping(value = "/import", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
@ApiOperation(value = "上传文件,商品批量添加")
|
||||
public ResultMessage<Object> importExcel(@RequestPart("files") MultipartFile files) {
|
||||
try {
|
||||
goodsImportService.importExcel(files);
|
||||
return ResultUtil.success(ResultCode.SUCCESS);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new ServiceException(ResultCode.ERROR);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "下载导入模板", produces = "application/octet-stream")
|
||||
@GetMapping(value = "/downLoad")
|
||||
public void download() {
|
||||
HttpServletResponse response = ThreadContextHolder.getHttpResponse();
|
||||
|
||||
goodsImportService.download(response);
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,14 @@
|
||||
package cn.lili.controller.goods;
|
||||
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.fulu.core.utils.Test;
|
||||
import cn.lili.common.security.OperationalJudgment;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.goods.entity.dos.Goods;
|
||||
import cn.lili.modules.goods.entity.dos.GoodsSku;
|
||||
import cn.lili.modules.goods.entity.dto.GoodsOperationDTO;
|
||||
import cn.lili.modules.goods.entity.dto.GoodsOperationFuLuDTO;
|
||||
import cn.lili.modules.goods.entity.dto.GoodsSearchParams;
|
||||
import cn.lili.modules.goods.entity.dto.GoodsSkuStockDTO;
|
||||
import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
|
||||
@@ -16,6 +18,10 @@ import cn.lili.modules.goods.entity.vos.StockWarningVO;
|
||||
import cn.lili.modules.goods.service.GoodsService;
|
||||
import cn.lili.modules.goods.service.GoodsSkuService;
|
||||
import cn.lili.modules.store.entity.dos.StoreDetail;
|
||||
import cn.lili.modules.store.entity.dto.FuLuConfigureDTO;
|
||||
import cn.lili.modules.store.service.StoreDetailService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import cn.lili.modules.store.service.StoreDetailService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@@ -27,6 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -7,6 +7,7 @@ import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.security.OperationalJudgment;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.kdBrid.service.KdNiaoService;
|
||||
import cn.lili.modules.member.entity.dto.MemberAddressDTO;
|
||||
import cn.lili.modules.member.service.StoreLogisticsService;
|
||||
import cn.lili.modules.order.order.entity.dto.OrderExportDTO;
|
||||
@@ -61,6 +62,12 @@ public class OrderStoreController {
|
||||
@Autowired
|
||||
private StoreLogisticsService storeLogisticsService;
|
||||
|
||||
/**
|
||||
* 快递鸟电子面单
|
||||
*/
|
||||
@Autowired
|
||||
private KdNiaoService kdNiaoService;
|
||||
|
||||
|
||||
@ApiOperation(value = "查询订单列表")
|
||||
@GetMapping
|
||||
@@ -174,4 +181,16 @@ public class OrderStoreController {
|
||||
public ResultMessage<List<OrderExportDTO>> queryExportOrder(OrderSearchParams orderSearchParams) {
|
||||
return ResultUtil.data(orderService.queryExportOrder(orderSearchParams));
|
||||
}
|
||||
|
||||
@PreventDuplicateSubmissions
|
||||
@ApiOperation(value = "创建电子面单")
|
||||
@PostMapping(value = "/{orderSn}/createElectronicsFaceSheet")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "orderSn", value = "订单号", required = true, paramType = "path"),
|
||||
@ApiImplicitParam(name = "logisticsId", value = "物流公司", required = true, dataType = "String", paramType = "query")
|
||||
})
|
||||
public ResultMessage<Object> createElectronicsFaceSheet(@NotNull(message = "参数非法") @PathVariable String orderSn,
|
||||
@NotNull(message = "请选择物流公司") String logisticsId) throws Exception{
|
||||
return ResultUtil.data(kdNiaoService.createElectronicsFaceSheet(orderSn,logisticsId));
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,12 @@ import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.member.service.StoreLogisticsService;
|
||||
import cn.lili.modules.store.entity.dos.StoreLogistics;
|
||||
import cn.lili.modules.store.entity.dto.StoreLogisticsCustomerDTO;
|
||||
import cn.lili.modules.system.entity.vo.StoreLogisticsVO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -38,7 +40,12 @@ public class LogisticsStoreController {
|
||||
@GetMapping
|
||||
public ResultMessage<List<StoreLogisticsVO>> get() {
|
||||
String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId();
|
||||
return ResultUtil.data(storeLogisticsService.getStoreLogistics(storeId));
|
||||
//获取已开启的物流公司
|
||||
List<StoreLogisticsVO> storeLogistics = storeLogisticsService.getOpenStoreLogistics(storeId);
|
||||
//获取未开启的物流公司
|
||||
List<StoreLogisticsVO> closeStoreLogistics = storeLogisticsService.getCloseStoreLogistics(storeId);
|
||||
storeLogistics.addAll(closeStoreLogistics);
|
||||
return ResultUtil.data(storeLogistics);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取商家已选择物流公司列表")
|
||||
@@ -49,11 +56,13 @@ public class LogisticsStoreController {
|
||||
}
|
||||
|
||||
@ApiOperation(value = "选择物流公司")
|
||||
@ApiImplicitParam(name = "logisticsId", value = "物流公司ID", required = true, paramType = "path")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "logisticsId", value = "物流公司ID", required = true, paramType = "path"),
|
||||
})
|
||||
@PostMapping("/{logisticsId}")
|
||||
public ResultMessage<StoreLogistics> checked(@PathVariable String logisticsId) {
|
||||
public ResultMessage<StoreLogistics> checked(@PathVariable String logisticsId,@RequestBody StoreLogisticsCustomerDTO storeLogisticsCustomerDTO) {
|
||||
String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId();
|
||||
return ResultUtil.data(storeLogisticsService.add(logisticsId, storeId));
|
||||
return ResultUtil.data(storeLogisticsService.add(logisticsId, storeId,storeLogisticsCustomerDTO));
|
||||
}
|
||||
|
||||
|
||||
@@ -66,4 +75,28 @@ public class LogisticsStoreController {
|
||||
return ResultUtil.data(remove);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改电子面单参数")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "logisticsId", value = "物流公司ID", required = true, paramType = "path"),
|
||||
})
|
||||
@PutMapping("/{logisticsId}/updateStoreLogistics")
|
||||
public ResultMessage<StoreLogistics> updateStoreLogistics(@PathVariable String logisticsId,StoreLogisticsCustomerDTO storeLogisticsCustomerDTO){
|
||||
String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId();
|
||||
return ResultUtil.data(storeLogisticsService.update(logisticsId, storeId,storeLogisticsCustomerDTO));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取商家已选择物流公司并且使用电子面单列表")
|
||||
@GetMapping("/getCheckedFaceSheet")
|
||||
public ResultMessage<List<StoreLogisticsVO>> getCheckedFaceSheet() {
|
||||
String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId();
|
||||
return ResultUtil.data(storeLogisticsService.getStoreSelectedLogisticsUseFaceSheet(storeId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取店铺-物流公司详细信息")
|
||||
@ApiImplicitParam(name = "logisticsId", value = "物流公司ID", required = true, paramType = "path")
|
||||
@GetMapping("/{logisticsId}/getStoreLogistics")
|
||||
public ResultMessage<StoreLogistics> getStoreLogistics(@PathVariable String logisticsId){
|
||||
return ResultUtil.data(storeLogisticsService.getStoreLogisticsInfo(logisticsId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
package cn.lili.controller.other;
|
||||
|
||||
import cn.lili.common.aop.annotation.DemoSite;
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.page.entity.dos.PageData;
|
||||
import cn.lili.modules.page.entity.dto.PageDataDTO;
|
||||
import cn.lili.modules.page.entity.enums.PageEnum;
|
||||
import cn.lili.modules.page.entity.vos.PageDataListVO;
|
||||
import cn.lili.modules.page.service.PageDataService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 店铺端,页面设置管理接口
|
||||
*
|
||||
* @author paulGao
|
||||
* @since 2020-05-06 15:18:56
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,页面设置管理接口")
|
||||
@RequestMapping("/store/other/pageData")
|
||||
public class PageDataStoreController {
|
||||
|
||||
@Autowired
|
||||
private PageDataService pageDataService;
|
||||
|
||||
@ApiOperation(value = "获取页面信息")
|
||||
@ApiImplicitParam(name = "id", value = "页面ID", required = true, dataType = "String", paramType = "path")
|
||||
@GetMapping(value = "/{id}")
|
||||
public ResultMessage<PageData> getPageData(@PathVariable String id) {
|
||||
//查询当前店铺下的页面数据
|
||||
PageData pageData = pageDataService.getOne(
|
||||
new LambdaQueryWrapper<PageData>()
|
||||
.eq(PageData::getPageType, PageEnum.STORE.name())
|
||||
.eq(PageData::getNum, UserContext.getCurrentUser().getStoreId())
|
||||
.eq(PageData::getId, id));
|
||||
return ResultUtil.data(pageData);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "添加页面")
|
||||
@PostMapping("/add")
|
||||
public ResultMessage<PageData> addPageData(@Valid PageData pageData) {
|
||||
//添加店铺类型,填写店铺ID
|
||||
pageData.setPageType(PageEnum.STORE.name());
|
||||
pageData.setNum(UserContext.getCurrentUser().getStoreId());
|
||||
return ResultUtil.data(pageDataService.addPageData(pageData));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改页面")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "页面ID", required = true, dataType = "String", paramType = "path")
|
||||
})
|
||||
@DemoSite
|
||||
@PutMapping("/update/{id}")
|
||||
public ResultMessage<PageData> updatePageData(@Valid PageData pageData, @NotNull @PathVariable String id) {
|
||||
pageData.setId(id);
|
||||
//添加店铺类型,填写店铺ID
|
||||
pageData.setPageType(PageEnum.STORE.name());
|
||||
pageData.setNum(UserContext.getCurrentUser().getStoreId());
|
||||
return ResultUtil.data(pageDataService.updatePageData(pageData));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "页面列表")
|
||||
@GetMapping("/pageDataList")
|
||||
public ResultMessage<IPage<PageDataListVO>> pageDataList(PageVO pageVO, PageDataDTO pageDataDTO) {
|
||||
pageDataDTO.setPageType(PageEnum.STORE.name());
|
||||
pageDataDTO.setNum(UserContext.getCurrentUser().getStoreId());
|
||||
return ResultUtil.data(pageDataService.getPageDataList(pageVO, pageDataDTO));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "发布页面")
|
||||
@ApiImplicitParam(name = "id", value = "页面ID", required = true, dataType = "String", paramType = "path")
|
||||
@PutMapping("/release/{id}")
|
||||
@DemoSite
|
||||
public ResultMessage<PageData> release(@PathVariable String id) {
|
||||
return ResultUtil.data(pageDataService.releasePageData(id));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除页面")
|
||||
@DemoSite
|
||||
@ApiImplicitParam(name = "id", value = "页面ID", required = true, dataType = "String", paramType = "path")
|
||||
@DeleteMapping("/remove/{id}")
|
||||
public ResultMessage<Object> remove(@PathVariable String id) {
|
||||
return ResultUtil.data(pageDataService.removePageData(id));
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,12 @@
|
||||
package cn.lili.controller.passport;
|
||||
|
||||
|
||||
import cn.lili.common.aop.annotation.DemoSite;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.security.AuthUser;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.security.enums.UserEnums;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.member.entity.dos.Member;
|
||||
@@ -15,6 +18,7 @@ import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
@@ -70,7 +74,11 @@ public class StorePassportController {
|
||||
@PostMapping("/modifyPass")
|
||||
public ResultMessage<Member> modifyPass(@NotNull(message = "旧密码不能为空") @RequestParam String password,
|
||||
@NotNull(message = "新密码不能为空") @RequestParam String newPassword) {
|
||||
return ResultUtil.data(memberService.modifyPass(password, newPassword));
|
||||
AuthUser tokenUser = UserContext.getCurrentUser();
|
||||
if (tokenUser == null) {
|
||||
throw new ServiceException(ResultCode.USER_NOT_LOGIN);
|
||||
}
|
||||
return ResultUtil.data(memberService.modifyPass(tokenUser.getId(), password, newPassword));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "刷新token")
|
||||
@@ -80,4 +88,5 @@ public class StorePassportController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
package cn.lili.controller.permission;
|
||||
|
||||
import cn.lili.common.aop.annotation.DemoSite;
|
||||
import cn.lili.common.enums.ResultCode;
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.exception.ServiceException;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.validation.Phone;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.member.entity.dos.Clerk;
|
||||
import cn.lili.modules.member.entity.dos.Member;
|
||||
import cn.lili.modules.member.entity.dto.*;
|
||||
import cn.lili.modules.member.entity.vo.ClerkVO;
|
||||
import cn.lili.modules.member.service.ClerkService;
|
||||
import cn.lili.modules.member.service.MemberService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 店员接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @since 2020/11/16 10:57
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@Api(tags = "店员")
|
||||
@RequestMapping("/store/clerk")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Validated
|
||||
public class ClerkStoreController {
|
||||
@Autowired
|
||||
private ClerkService clerkService;
|
||||
|
||||
@Autowired
|
||||
private MemberService memberService;
|
||||
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation(value = "分页获取店员列表")
|
||||
public ResultMessage<IPage<ClerkVO>> page(ClerkQueryDTO clerkQueryDTO,
|
||||
PageVO pageVo) {
|
||||
|
||||
IPage<ClerkVO> page = clerkService.clerkForPage(pageVo, clerkQueryDTO);
|
||||
return ResultUtil.data(page);
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
@ApiOperation(value = "获取店员详细")
|
||||
public ResultMessage<ClerkVO> get(@PathVariable String id) {
|
||||
|
||||
return ResultUtil.data(clerkService.get(id));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/{mobile}/check")
|
||||
@ApiOperation(value = "检测手机号码有效性")
|
||||
public ResultMessage<Object> check(@PathVariable @Phone(message = "手机号码格式不正确") String mobile) {
|
||||
return ResultUtil.data(clerkService.checkClerk(mobile));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation(value = "添加店员")
|
||||
public ResultMessage<Object> add(@Valid ClerkAddDTO clerkAddDTO) {
|
||||
int rolesMaxSize = 10;
|
||||
try {
|
||||
if (clerkAddDTO.getRoles() != null && clerkAddDTO.getRoles().size() >= rolesMaxSize) {
|
||||
throw new ServiceException(ResultCode.PERMISSION_BEYOND_TEN);
|
||||
}
|
||||
//校验是否已经是会员
|
||||
Member member = memberService.findByMobile(clerkAddDTO.getMobile());
|
||||
if (member == null) {
|
||||
//添加会员
|
||||
MemberAddDTO memberAddDTO = new MemberAddDTO();
|
||||
memberAddDTO.setMobile(clerkAddDTO.getMobile());
|
||||
memberAddDTO.setPassword(clerkAddDTO.getPassword());
|
||||
memberAddDTO.setUsername(clerkAddDTO.getUsername());
|
||||
member = memberService.addMember(memberAddDTO);
|
||||
} else {
|
||||
//校验要添加的会员是否已经是店主
|
||||
if (member.getHaveStore()) {
|
||||
throw new ServiceException(ResultCode.STORE_APPLY_DOUBLE_ERROR);
|
||||
}
|
||||
//校验会员的有效性
|
||||
if (!member.getDisabled()) {
|
||||
throw new ServiceException(ResultCode.USER_STATUS_ERROR);
|
||||
}
|
||||
}
|
||||
//添加店员
|
||||
clerkAddDTO.setMemberId(member.getId());
|
||||
clerkAddDTO.setShopkeeper(false);
|
||||
clerkAddDTO.setStoreId(UserContext.getCurrentUser().getStoreId());
|
||||
clerkService.saveClerk(clerkAddDTO);
|
||||
//修改此会员拥有店铺
|
||||
List<String> ids = new ArrayList<>();
|
||||
ids.add(member.getId());
|
||||
memberService.updateHaveShop(true, UserContext.getCurrentUser().getStoreId(), ids);
|
||||
} catch (Exception e) {
|
||||
log.error("添加店员出错", e);
|
||||
}
|
||||
return ResultUtil.success();
|
||||
}
|
||||
|
||||
|
||||
@PutMapping("/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "店员id", required = true, paramType = "path")
|
||||
@ApiOperation(value = "修改店员")
|
||||
public ResultMessage<Clerk> edit(@PathVariable String id, @Valid ClerkEditDTO clerkEditDTO) {
|
||||
clerkEditDTO.setId(id);
|
||||
return ResultUtil.data(clerkService.updateClerk(clerkEditDTO));
|
||||
}
|
||||
|
||||
@PutMapping(value = "/enable/{clerkId}")
|
||||
@ApiOperation(value = "禁/启 用 店员")
|
||||
@DemoSite
|
||||
public ResultMessage<Object> disable(@ApiParam("用户唯一id标识") @PathVariable String clerkId, Boolean status) {
|
||||
clerkService.disable(clerkId, status);
|
||||
return ResultUtil.success();
|
||||
}
|
||||
|
||||
|
||||
@DeleteMapping(value = "/delByIds/{ids}")
|
||||
@ApiOperation(value = "删除店员")
|
||||
public ResultMessage<Object> deleteClerk(@PathVariable List<String> ids) {
|
||||
clerkService.deleteClerk(ids);
|
||||
return ResultUtil.success();
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value = "/resetPassword/{ids}")
|
||||
@ApiOperation(value = "重置密码")
|
||||
@DemoSite
|
||||
public ResultMessage<Object> resetPassword(@PathVariable List ids) {
|
||||
clerkService.resetPassword(ids);
|
||||
return ResultUtil.success(ResultCode.USER_EDIT_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package cn.lili.controller.permission;
|
||||
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.common.vo.SearchVO;
|
||||
import cn.lili.modules.member.entity.dos.StoreDepartment;
|
||||
import cn.lili.modules.member.entity.vo.StoreDepartmentVO;
|
||||
import cn.lili.modules.member.service.StoreDepartmentService;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 管理端,部门管理接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @since 2020/11/22 12:06
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,部门管理接口")
|
||||
@RequestMapping("/store/department")
|
||||
public class StoreDepartmentController {
|
||||
@Autowired
|
||||
private StoreDepartmentService storeDepartmentService;
|
||||
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation(value = "查看部门详情")
|
||||
public ResultMessage<StoreDepartment> get(@PathVariable String id) {
|
||||
StoreDepartment storeDepartment = storeDepartmentService.getById(id);
|
||||
return ResultUtil.data(storeDepartment);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation(value = "获取树状结构")
|
||||
public ResultMessage<List<StoreDepartmentVO>> getByPage(StoreDepartment entity,
|
||||
SearchVO searchVo) {
|
||||
entity.setStoreId(UserContext.getCurrentUser().getStoreId());
|
||||
return ResultUtil.data(storeDepartmentService.tree(PageUtil.initWrapper(entity, searchVo)));
|
||||
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation(value = "新增部门")
|
||||
public ResultMessage<StoreDepartment> save(StoreDepartment storeDepartment) {
|
||||
storeDepartment.setStoreId(UserContext.getCurrentUser().getStoreId());
|
||||
storeDepartmentService.save(storeDepartment);
|
||||
return ResultUtil.data(storeDepartment);
|
||||
}
|
||||
|
||||
@PutMapping("/{id}")
|
||||
@ApiOperation(value = "更新部门")
|
||||
public ResultMessage<StoreDepartment> update(@PathVariable String id, StoreDepartment storeDepartment) {
|
||||
storeDepartment.setId(id);
|
||||
storeDepartmentService.update(storeDepartment);
|
||||
return ResultUtil.data(storeDepartment);
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "/{ids}")
|
||||
@ApiOperation(value = "删除部门")
|
||||
public ResultMessage<Object> delAllByIds(@PathVariable List<String> ids) {
|
||||
storeDepartmentService.deleteByIds(ids);
|
||||
return ResultUtil.success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package cn.lili.controller.permission;
|
||||
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.member.entity.dos.StoreDepartmentRole;
|
||||
import cn.lili.modules.member.service.StoreDepartmentRoleService;
|
||||
import cn.lili.modules.permission.entity.dos.DepartmentRole;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 店铺端,部门角色接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @since 2020/11/22 14:05
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,部门角色接口")
|
||||
@RequestMapping("/store/departmentRole")
|
||||
public class StoreDepartmentRoleController {
|
||||
@Autowired
|
||||
private StoreDepartmentRoleService storeDepartmentRoleService;
|
||||
|
||||
@GetMapping(value = "/{departmentId}")
|
||||
@ApiOperation(value = "查看部门拥有的角色")
|
||||
public ResultMessage<List<StoreDepartmentRole>> get(@PathVariable String departmentId) {
|
||||
return ResultUtil.data(storeDepartmentRoleService.listByDepartmentId(departmentId));
|
||||
}
|
||||
|
||||
@PutMapping("/{departmentId}")
|
||||
@ApiOperation(value = "更新部门角色")
|
||||
public ResultMessage<DepartmentRole> update(@PathVariable String departmentId, @RequestBody List<StoreDepartmentRole> storeDepartmentRoles) {
|
||||
storeDepartmentRoleService.updateByDepartmentId(departmentId, storeDepartmentRoles);
|
||||
return ResultUtil.success();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package cn.lili.controller.permission;
|
||||
|
||||
import cn.lili.common.aop.annotation.DemoSite;
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.member.entity.vo.StoreMenuVO;
|
||||
import cn.lili.modules.member.service.StoreMenuService;
|
||||
import cn.lili.modules.permission.entity.dos.Menu;
|
||||
import cn.lili.modules.permission.entity.dto.MenuSearchParams;
|
||||
import cn.lili.modules.permission.entity.vo.MenuVO;
|
||||
import cn.lili.modules.permission.service.MenuService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 管理端,菜单管理接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @since 2020/11/20 12:07
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@Api(tags = "店铺端,菜单管理接口")
|
||||
@RequestMapping("/store/menu")
|
||||
public class StoreMenuController {
|
||||
|
||||
@Autowired
|
||||
private StoreMenuService storeMenuService;
|
||||
|
||||
|
||||
@ApiOperation(value = "获取所有菜单")
|
||||
@GetMapping("/tree")
|
||||
public ResultMessage<List<StoreMenuVO>> getAllMenuList() {
|
||||
return ResultUtil.data(storeMenuService.tree());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取所有菜单---根据当前用户角色")
|
||||
@GetMapping("/memberMenu")
|
||||
public ResultMessage<List<StoreMenuVO>> memberMenu() {
|
||||
return ResultUtil.data(storeMenuService.findUserTree());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package cn.lili.controller.permission;
|
||||
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.member.entity.dos.StoreMenuRole;
|
||||
import cn.lili.modules.member.service.StoreMenuRoleService;
|
||||
import cn.lili.modules.permission.entity.dos.RoleMenu;
|
||||
import cn.lili.modules.permission.service.RoleMenuService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 店铺端,角色菜单接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @since 2020/11/22 11:40
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,角色菜单接口")
|
||||
@RequestMapping("/store/roleMenu")
|
||||
public class StoreMenuRoleController {
|
||||
@Autowired
|
||||
private StoreMenuRoleService storeMenuRoleService;
|
||||
|
||||
@GetMapping(value = "/{roleId}")
|
||||
@ApiOperation(value = "查看某角色拥有到菜单")
|
||||
public ResultMessage<List<StoreMenuRole>> get(@PathVariable String roleId) {
|
||||
return ResultUtil.data(storeMenuRoleService.findByRoleId(roleId));
|
||||
}
|
||||
|
||||
@PostMapping(value = "/{roleId}")
|
||||
@ApiOperation(value = "保存角色菜单")
|
||||
public ResultMessage save(@PathVariable String roleId, @RequestBody List<StoreMenuRole> roleMenus) {
|
||||
storeMenuRoleService.updateRoleMenu(roleId, roleMenus);
|
||||
return ResultUtil.success();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package cn.lili.controller.permission;
|
||||
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.security.context.UserContext;
|
||||
import cn.lili.common.vo.PageVO;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.member.entity.dos.StoreRole;
|
||||
import cn.lili.modules.member.service.StoreRoleService;
|
||||
import cn.lili.modules.permission.entity.dos.Role;
|
||||
import cn.lili.modules.permission.service.RoleService;
|
||||
import cn.lili.mybatis.util.PageUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 店铺端,角色管理接口
|
||||
*
|
||||
* @author Chopper
|
||||
* @since 2020/11/20 18:50
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "店铺端,店铺角色管理接口")
|
||||
@RequestMapping("/store/role")
|
||||
public class StoreRoleController {
|
||||
@Autowired
|
||||
private StoreRoleService storeRoleService;
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation(value = "添加角色")
|
||||
public ResultMessage<StoreRole> add(StoreRole storeRole) {
|
||||
storeRoleService.saveStoreRole(storeRole);
|
||||
return ResultUtil.data(storeRole);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation(value = "查询店铺角色")
|
||||
public ResultMessage<Page> page(PageVO pageVo, StoreRole storeRole) {
|
||||
storeRole.setStoreId(UserContext.getCurrentUser().getStoreId());
|
||||
Page page = storeRoleService.page(PageUtil.initPage(pageVo), PageUtil.initWrapper(storeRole));
|
||||
return ResultUtil.data(page);
|
||||
}
|
||||
|
||||
@PutMapping("/{roleId}")
|
||||
@ApiOperation(value = "编辑店铺角色")
|
||||
public ResultMessage<StoreRole> edit(@PathVariable String roleId, StoreRole storeRole) {
|
||||
storeRole.setId(roleId);
|
||||
storeRoleService.update(storeRole);
|
||||
return ResultUtil.data(storeRole);
|
||||
}
|
||||
|
||||
@DeleteMapping(value = "/{ids}")
|
||||
@ApiOperation(value = "批量删除店铺角色")
|
||||
public ResultMessage<Role> delByIds(@PathVariable List<String> ids) {
|
||||
storeRoleService.deleteRoles(ids);
|
||||
return ResultUtil.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -3,7 +3,9 @@ package cn.lili.controller.settings;
|
||||
|
||||
import cn.lili.common.enums.ResultUtil;
|
||||
import cn.lili.common.vo.ResultMessage;
|
||||
import cn.lili.modules.store.entity.dto.FuLuConfigureDTO;
|
||||
import cn.lili.modules.store.entity.dto.StoreAfterSaleAddressDTO;
|
||||
import cn.lili.modules.store.entity.dto.StoreDeliverGoodsAddressDTO;
|
||||
import cn.lili.modules.store.entity.dto.StoreSettingDTO;
|
||||
import cn.lili.modules.store.entity.vos.StoreVO;
|
||||
import cn.lili.modules.store.service.StoreDetailService;
|
||||
@@ -87,4 +89,19 @@ public class StoreSettingsController {
|
||||
boolean result = storeDetailService.editStoreAfterSaleAddressDTO(storeAfterSaleAddressDTO);
|
||||
return ResultUtil.data(result);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "获取商家发货地址")
|
||||
@GetMapping("/storeDeliverGoodsAddress")
|
||||
public ResultMessage<StoreDeliverGoodsAddressDTO> getStoreDeliverGoodsAddress(){
|
||||
return ResultUtil.data(storeDetailService.getStoreDeliverGoodsAddressDto());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改商家发货地址")
|
||||
@PutMapping("/storeDeliverGoodsAddress")
|
||||
public ResultMessage<Object> editStoreDeliverGoodsAddress(@Valid StoreDeliverGoodsAddressDTO storeDeliverGoodsAddressDTO) {
|
||||
//修改商家退货收件地址
|
||||
boolean result = storeDetailService.editStoreDeliverGoodsAddressDTO(storeDeliverGoodsAddressDTO);
|
||||
return ResultUtil.data(result);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user