springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/ShopApi.java
@@ -82,25 +82,30 @@ if (storeVO == null) { return R.fail(); } R<SysUserVO> sysUserVO = userService.getSysUserVOByAccount(storeVO.getStoreAccount()); JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(sysUserVO.getData())); SysUserVO entityVo = jsonObject.toJavaObject(SysUserVO.class); storeVO.setSysUserId(entityVo.getUserId()); storeVO.setLoginUserId(loginUserId); R r1 = communityService.saveStore(storeVO); R<SysUserVO> sysUserVO = userService.getSysUserVOByAccountAndType(storeVO.getStoreAccount(),5); JSONObject jsonObject = null; if (sysUserVO.getData() != null) { return R.fail("账号已存在!"); } AdministratorsUserVO administratorsUserVO = new AdministratorsUserVO(); administratorsUserVO.setAccount(storeVO.getStoreAccount()); administratorsUserVO.setPassword(storeVO.getStorePassword()); administratorsUserVO.setType(5); administratorsUserVO.setAreaId(null); administratorsUserVO.setStatus(1); administratorsUserVO.setPhone(storeVO.getPhone()); administratorsUserVO.setRoleId(888888888l); administratorsUserVO.setShopStoreName(storeVO.getName()); administratorsUserVO.setShopStorePhone(storeVO.getPhone()); R r = userService.addUserBackstage(administratorsUserVO); //保存sys_user if (R.isOk(r1)) { AdministratorsUserVO administratorsUserVO = new AdministratorsUserVO(); administratorsUserVO.setAccount(storeVO.getStoreAccount()); administratorsUserVO.setPassword(storeVO.getStorePassword()); administratorsUserVO.setType(5); administratorsUserVO.setAreaId(null); administratorsUserVO.setStatus(1); administratorsUserVO.setPhone(storeVO.getPhone()); administratorsUserVO.setRoleId(888888888l); administratorsUserVO.setShopStoreName(storeVO.getName()); administratorsUserVO.setShopStorePhone(storeVO.getPhone()); R r = userService.addUserBackstage(administratorsUserVO); if (R.isOk(r)) { sysUserVO = userService.getSysUserVOByAccountAndType(storeVO.getStoreAccount(),5); jsonObject = JSON.parseObject(JSON.toJSONString(sysUserVO.getData())); SysUserVO entityVo = jsonObject.toJavaObject(SysUserVO.class); storeVO.setSysUserId(entityVo.getUserId()); storeVO.setLoginUserId(loginUserId); communityService.saveStore(storeVO); } return R.ok(); } @@ -109,15 +114,14 @@ @PostMapping("/store/edit/{id}") @ApiImplicitParam(name = "id", value = "商家id") public R editStore(@Valid @RequestBody ShopStoreVO storeVO, @PathVariable("id") Long id) { R<LoginUserInfoVO> sysUserVO = userService.getSysUserVOByAccount(storeVO.getStoreAccount()); R<LoginUserInfoVO> sysUserVO = userService.getSysUserVOByAccountAndType(storeVO.getStoreAccount(),5); if (sysUserVO.getData() == null) { return R.fail("没有相关的用户!"); } LoginUserInfoVO user = JSON.parseObject(JSON.toJSONString(sysUserVO.getData())).toJavaObject(LoginUserInfoVO.class); storeVO.setSysUserId(user.getUserId()); R<ShopStoreVO> storeInfoVO = communityService.getStoreInfo(id); if( storeInfoVO.getCode()==500){ if (storeInfoVO.getCode() == 500) { return R.fail(storeInfoVO.getMsg()); } //维护sys_user @@ -149,15 +153,15 @@ @ApiOperation(value = "新增商品") @PostMapping("/goods/save") R saveShopGoods(@RequestBody AddShopGoodsVO addShopGoodsVO){ R saveShopGoods(@RequestBody AddShopGoodsVO addShopGoodsVO) { return communityService.saveShopGoods(addShopGoodsVO); } @ApiOperation(value = "编辑商品") @PostMapping("/goods/edit/{id}") R editShopGoods(@PathVariable("id") Long id,@RequestBody AddShopGoodsVO addShopGoodsVO) { return communityService.editShopGoods(id,addShopGoodsVO); R editShopGoods(@PathVariable("id") Long id, @RequestBody AddShopGoodsVO addShopGoodsVO) { return communityService.editShopGoods(id, addShopGoodsVO); } @ApiOperation(value = "删除商品") @@ -167,78 +171,78 @@ } @ApiOperation(value = "商品上下架") @ApiImplicitParams({@ApiImplicitParam(name = "id",value = "商品Id"), @ApiImplicitParam(name = "status",value = "1.上架 2.下架 ")}) @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "商品Id"), @ApiImplicitParam(name = "status", value = "1.上架 2.下架 ")}) @GetMapping("/goods/changeStatus") R changeStatus(@RequestParam("id") Long id,@RequestParam("status")Integer status) { return communityService.changeStatus(id,status); R changeStatus(@RequestParam("id") Long id, @RequestParam("status") Integer status) { return communityService.changeStatus(id, status); } @ApiOperation(value = "订单_分页列表",response = ComShopOrderSearchVO.class) @ApiOperation(value = "订单_分页列表", response = ComShopOrderSearchVO.class) @PostMapping("/order/page") public R page(@RequestBody @Validated PageComShopOrderSearchDTO pageComShopOrderSearchDTO){ public R page(@RequestBody @Validated PageComShopOrderSearchDTO pageComShopOrderSearchDTO) { pageComShopOrderSearchDTO.setUserId(this.getUserId()); ClazzUtils.setIfStringIsEmpty(pageComShopOrderSearchDTO); return communityService.pageShopOrder(pageComShopOrderSearchDTO); } @ApiOperation(value = "订单_详细",response = ComShopOrderPageVO.class) @ApiOperation(value = "订单_详细", response = ComShopOrderPageVO.class) @GetMapping("/order/detail") @ShopOperLog(operType = 11) public R detail(@RequestParam("orderId") Long orderId){ public R detail(@RequestParam("orderId") Long orderId) { return communityService.orderDetail(orderId); } @ApiOperation(value = "订单_导出表格") @PostMapping("/order/export") @ShopOperLog(operType = 12) public R export(@RequestBody ComShopOrderExportDTO comShopOrderExportDTO){ public R export(@RequestBody ComShopOrderExportDTO comShopOrderExportDTO) { ClazzUtils.setIfStringIsEmpty(comShopOrderExportDTO); String url=excelUrl; String uuid= UUID.randomUUID().toString().replace("-",""); String url = excelUrl; String uuid = UUID.randomUUID().toString().replace("-", ""); //String name=uuid+".xlsx"; String ftpUrl="/mnt/data/web/excel/"; String ftpUrl = "/mnt/data/web/excel/"; R<ShopStoreVO> storeR = communityService.getUserStoreInfo(getUserId()); if(!R.isOk(storeR)){ if (!R.isOk(storeR)) { return R.fail("用户不是商家"); } ShopStoreVO shopStoreVO = JSONObject.parseObject(JSONObject.toJSONString(storeR.getData()),ShopStoreVO.class); ShopStoreVO shopStoreVO = JSONObject.parseObject(JSONObject.toJSONString(storeR.getData()), ShopStoreVO.class); Long userId = this.getUserId(); comShopOrderExportDTO.setUserId(userId); R r=communityService.shopOrderExportData(comShopOrderExportDTO); R r = communityService.shopOrderExportData(comShopOrderExportDTO); if (R.isOk(r)) { List<ExcelShopOrderDTO> excelShopOrderDTO = JSONArray.parseArray(JSONArray.toJSONString(r.getData()),ExcelShopOrderDTO.class); if(excelShopOrderDTO==null||excelShopOrderDTO.size()==0){ List<ExcelShopOrderDTO> excelShopOrderDTO = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ExcelShopOrderDTO.class); if (excelShopOrderDTO == null || excelShopOrderDTO.size() == 0) { return R.ok("未找到数据"); } try { SFTPUtil sftp = new SFTPUtil(userName,password,host,port); SFTPUtil sftp = new SFTPUtil(userName, password, host, port); sftp.login(); String name = shopStoreVO.getName() +"商城订单-" + new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()) + ".xlsx"; boolean existDir = sftp.isExistDir(ftpUrl+name); String name = shopStoreVO.getName() + "商城订单-" + new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()) + ".xlsx"; boolean existDir = sftp.isExistDir(ftpUrl + name); if (!existDir) { String property = System.getProperty("user.dir"); String fileName = property + File.separator+name; String fileName = property + File.separator + name; // 这里 需要指定写用哪个class去写 ExcelWriter excelWriter = null; InputStream inputStream=null; InputStream inputStream = null; try { excelWriter = EasyExcel.write(fileName, ExcelShopOrderDTO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build(); WriteSheet writeSheet = EasyExcel.writerSheet(shopStoreVO.getName()+"订单").build(); WriteSheet writeSheet = EasyExcel.writerSheet(shopStoreVO.getName() + "订单").build(); excelWriter.write(excelShopOrderDTO, writeSheet); excelWriter.finish(); File file=new File(fileName); inputStream=new FileInputStream(file); File file = new File(fileName); inputStream = new FileInputStream(file); sftp.uploadMore(ftpUrl, name, inputStream); sftp.logout(); inputStream.close(); String absolutePath = file.getAbsolutePath(); boolean delete = file.delete(); log.info("删除excel【{}】结果【{}】",absolutePath,delete); log.info("删除excel【{}】结果【{}】", absolutePath, delete); } finally { // 千万别忘记finish 会帮忙关闭流 if (inputStream != null) { @@ -249,7 +253,7 @@ } } } return R.ok(url+ URLEncoder.encode(name,"UTF-8")); return R.ok(url + URLEncoder.encode(name, "UTF-8")); } catch (Exception e) { e.printStackTrace(); log.error("文件传输失败【{}】", e.getMessage()); @@ -261,22 +265,23 @@ @ApiOperation(value = "资金_统计信息") @GetMapping("/capital/stat") public R stat(){ return communityService.getFundsStat(getUserId()); public R stat() { Long userId = 0L; return communityService.getFundsStat(userId); } @ApiOperation(value = "资金_分页列表") @PostMapping("/capital/page") public R page(@RequestBody PageComShopFundsSearchDTO pageComShopFundsSearchDTO){ public R page(@RequestBody PageComShopFundsSearchDTO pageComShopFundsSearchDTO) { pageComShopFundsSearchDTO.setUserId(getUserId()); ClazzUtils.setIfStringIsEmpty(pageComShopFundsSearchDTO); return communityService.pageShopFunds(pageComShopFundsSearchDTO); } @ApiOperation(value = "资金_详情",response = CapitalDetailVO.class) @ApiImplicitParam(name = "orderId",value = "订单Id") @ApiOperation(value = "资金_详情", response = CapitalDetailVO.class) @ApiImplicitParam(name = "orderId", value = "订单Id") @GetMapping("/capital/capitalDetailByStore") R capitalDetailByStore(@RequestParam("orderId") Long orderId){ R capitalDetailByStore(@RequestParam("orderId") Long orderId) { return communityService.capitalDetailByStore(orderId); } @@ -284,52 +289,52 @@ @ApiOperation(value = "资金_导出表格") @PostMapping("/capital/export") @ShopOperLog(operType = 12) public R export(@RequestBody ComShopFundsExportDTO comShopFundsExportDTO){ public R export(@RequestBody ComShopFundsExportDTO comShopFundsExportDTO) { ClazzUtils.setIfStringIsEmpty(comShopFundsExportDTO); String url=excelUrl; String uuid= UUID.randomUUID().toString().replace("-",""); String url = excelUrl; String uuid = UUID.randomUUID().toString().replace("-", ""); //String name=uuid+".xlsx"; String ftpUrl="/mnt/data/web/excel/"; String ftpUrl = "/mnt/data/web/excel/"; R<ShopStoreVO> storeR = communityService.getUserStoreInfo(getUserId()); if(!R.isOk(storeR)){ if (!R.isOk(storeR)) { return R.fail("用户不是商家"); } ShopStoreVO shopStoreVO = JSONObject.parseObject(JSONObject.toJSONString(storeR.getData()),ShopStoreVO.class); ShopStoreVO shopStoreVO = JSONObject.parseObject(JSONObject.toJSONString(storeR.getData()), ShopStoreVO.class); Long userId = this.getUserId(); comShopFundsExportDTO.setUserId(userId); R r=communityService.shopOrderFundsExportData(comShopFundsExportDTO); R r = communityService.shopOrderFundsExportData(comShopFundsExportDTO); if (R.isOk(r)) { List<ExcelShopFundsDTO> excelShopFundsDTO = JSONArray.parseArray(JSONArray.toJSONString(r.getData()),ExcelShopFundsDTO.class); if(excelShopFundsDTO==null||excelShopFundsDTO.size()==0){ List<ExcelShopFundsDTO> excelShopFundsDTO = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ExcelShopFundsDTO.class); if (excelShopFundsDTO == null || excelShopFundsDTO.size() == 0) { return R.ok("未找到数据"); } try { SFTPUtil sftp = new SFTPUtil(userName,password,host,port); SFTPUtil sftp = new SFTPUtil(userName, password, host, port); sftp.login(); String name = shopStoreVO.getName() +"-商家资金流水-" + new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()) + ".xlsx"; boolean existDir = sftp.isExistDir(ftpUrl+name); String name = shopStoreVO.getName() + "-商家资金流水-" + new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()) + ".xlsx"; boolean existDir = sftp.isExistDir(ftpUrl + name); if (!existDir) { String property = System.getProperty("user.dir"); String fileName = property + File.separator+name; String fileName = property + File.separator + name; // 这里 需要指定写用哪个class去写 ExcelWriter excelWriter = null; InputStream inputStream=null; InputStream inputStream = null; try { excelWriter = EasyExcel.write(fileName, ExcelShopFundsDTO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build(); WriteSheet writeSheet = EasyExcel.writerSheet(shopStoreVO.getName()+"订单").build(); WriteSheet writeSheet = EasyExcel.writerSheet(shopStoreVO.getName() + "订单").build(); excelWriter.write(excelShopFundsDTO, writeSheet); excelWriter.finish(); File file=new File(fileName); inputStream=new FileInputStream(file); File file = new File(fileName); inputStream = new FileInputStream(file); sftp.uploadMore(ftpUrl, name, inputStream); sftp.logout(); inputStream.close(); String absolutePath = file.getAbsolutePath(); boolean delete = file.delete(); log.info("删除excel【{}】结果【{}】",absolutePath,delete); log.info("删除excel【{}】结果【{}】", absolutePath, delete); } finally { // 千万别忘记finish 会帮忙关闭流 if (inputStream != null) { @@ -340,7 +345,7 @@ } } } return R.ok(url+ URLEncoder.encode(name,"UTF-8")); return R.ok(url + URLEncoder.encode(name, "UTF-8")); } catch (Exception e) { e.printStackTrace(); log.error("文件传输失败【{}】", e.getMessage()); springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/PageComOpsHouseDTO.java
@@ -60,7 +60,7 @@ private Integer priceOrder; @ApiModelProperty(value="发布人姓名") private String userRealName; private String userName; @ApiModelProperty(value="联系方式") private String mobile; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/shop/ComShopFundsExportDTO.java
@@ -27,7 +27,7 @@ @ApiModelProperty(value = "支付时间-结束",example = "2021-04-18 19:59:14") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date payTimeEnd; @ApiModelProperty(value = "订单ID", notes = "如果指定了订单ID,其它搜索条件将被忽略,只导出指定订单") @ApiModelProperty(value = "订单ID-如果指定了订单ID,只导出指定订单,其它搜索条件将被忽略", notes = "如果指定了订单ID,其它搜索条件将被忽略,只导出指定订单") private Long[] orderIds; @JsonIgnore private Long userId; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/shop/ComShopOrderExportDTO.java
@@ -37,8 +37,11 @@ @ApiModelProperty(value = "下单时间-结束",example = "2021-04-18 19:58:54") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createAtEnd; @ApiModelProperty(value = "订单ID", notes = "如果指定了订单ID,其它搜索条件将被忽略,只导出指定订单") @ApiModelProperty(value = "订单ID-如果指定了订单ID,只导出指定订单,其它搜索条件将被忽略", notes = "") private Long[] orderIds; @JsonIgnore @ApiModelProperty(hidden = true) private Long userId; @ApiModelProperty(hidden = true) private Long storeUserId; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/shop/PageComShopOrderSearchDTO.java
@@ -31,16 +31,20 @@ private String storeName; @ApiModelProperty(value = "订单状态(1.待付款 2.代发货 3.待收货 4.待评价 5.已完成 6.已取消)",example = "1") private Integer status; @ApiModelProperty(value = "下单时间-开始",example = "1") @ApiModelProperty(value = "下单时间-开始",example = "2021-4-10 10:38:25") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private String createAtStart; @ApiModelProperty(value = "下单时间-结束",example = "1") @ApiModelProperty(value = "下单时间-结束",example = "2021-4-20 10:38:29") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createAtEnd; @ApiModelProperty(value = "分页-当前页数",example = "1", required = true) private Long pageNum; @ApiModelProperty(value = "分页-每页记录数",example = "10", required = true) private Long pageSize; @JsonIgnore @ApiModelProperty(hidden = true) private Long userId; @ApiModelProperty(hidden = true) private Long storeId; @ApiModelProperty(hidden = true) private Long storeUserId; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/shop/ComShopOrderOperateVO.java
New file @@ -0,0 +1,31 @@ package com.panzhihua.common.model.vos.shop; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.math.BigDecimal; import java.util.Date; @Data @ApiModel("订单操作日志") public class ComShopOrderOperateVO { @ApiModelProperty(value = "订单号") private String orderNo; @ApiModelProperty(value = "操作人") private String operationBy; @ApiModelProperty(value = "操作时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date operationTime; @ApiModelProperty(value = "操作类型(1.创建订单 2.取消订单 3.订单支付 4.订单发货 5.订单完成)") private Integer operationType; @ApiModelProperty(value = "操作内容") private String operationContent; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/shop/ComShopOrderPageVO.java
@@ -72,4 +72,10 @@ @ApiModelProperty(value = "用户收货地址id") private ComShopUserAddressVO userAddressVO; @ApiModelProperty(value = "商品名称") private String goodsName; @ApiModelProperty(value = "订单日志") private List<ComShopOrderOperateVO> logs; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/shop/ComShopOrderSearchVO.java
@@ -29,6 +29,9 @@ @ApiModelProperty("用户id") private Long userId; @ApiModelProperty("用户账号") private Long userName; @ApiModelProperty("订单号") private String orderNo; @@ -47,6 +50,15 @@ @ApiModelProperty("订单收货人id") private Long receiverId; @ApiModelProperty("收货人") private String receiverName; @ApiModelProperty("电话") private String receiverPhone; @ApiModelProperty("商品") private String goodsName; @ApiModelProperty("订单总金额") private BigDecimal totalAmount; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/shop/LoginStoreUserInfoVO.java
New file @@ -0,0 +1,171 @@ package com.panzhihua.common.model.vos.shop; import com.fasterxml.jackson.annotation.JsonFormat; import com.panzhihua.common.model.vos.community.ComActVO; import com.panzhihua.common.model.vos.community.ComMngStructAreaVO; import com.panzhihua.common.model.vos.community.ComMngStructHouseVO; import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO; import com.panzhihua.common.validated.AddGroup; import com.panzhihua.common.validated.PutGroup; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.Min; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import java.util.Date; import java.util.List; import java.util.Set; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 登录用户信息 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2020-11-24 09:35 **/ @Data @ApiModel(value = "用户信息") public class LoginStoreUserInfoVO { @ApiModelProperty("user_id") private Long userId; @ApiModelProperty("微信会话密钥") private String sessionKey; @ApiModelProperty("用户在开放平台的唯一标识符") private String unionid; @ApiModelProperty("登录账户") private String account; @ApiModelProperty("登录密码") private String password; @ApiModelProperty("微信小程序唯一标识") private String openid; @ApiModelProperty("手机号") private String phone; @ApiModelProperty("昵称") private String nickName; @ApiModelProperty("真实名字") @NotBlank(groups = {AddGroup.class},message = "真实名字不能为空") private String name; @ApiModelProperty("社区id") @Min(value = 1,groups = {PutGroup.class},message = "社区id不能为空") @NotNull(groups = {PutGroup.class},message = "社区id不能为空") private Long communityId; @ApiModelProperty("社区名字") private String communityName; @ApiModelProperty("性别 1 男 2 女") private Integer sex; @ApiModelProperty("是否社区团队或者党委或系统管理人员 1 是 2 否") private Integer ismemberrole; @ApiModelProperty("生日") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date birthday; @ApiModelProperty("头像") private String imageUrl; @ApiModelProperty(value = "用户类型 1 小程序 2 运营平台 3 社区平台") private Integer type; @ApiModelProperty("职业") private String job; @ApiModelProperty("是否志愿者 0否 1 是") private Integer isVolunteer; @ApiModelProperty("是否党员 0 否 1 是") private Integer isPartymember; @ApiModelProperty("1 启用 2 禁用") private Integer status; @ApiModelProperty("创建时间") private Date createAt; @ApiModelProperty("最后登录时间") private Date lastLoginTime; @ApiModelProperty("角色集合") private Set<String> roles; @ApiModelProperty("权限集合") private Set<String> permissions; @ApiModelProperty("人脸采集照片url") private String faceUrl; @ApiModelProperty("驳回原因") private String rejectReson; @ApiModelProperty("身份证号") @NotBlank(groups = {AddGroup.class},message = "身份证号不能为空") private String idCard; @ApiModelProperty("标签 多个用,隔开") private String tags; @ApiModelProperty("家庭id") private Long familyId; @ApiModelProperty(value = "分页每页数量",example = "10") private Long pageSize; @ApiModelProperty(value = "分页当前记录数",example = "1") private Long pageNum; @ApiModelProperty("人脸采集审核状态 0 待审核 1 审核通过 2驳回") private Integer faceState; @ApiModelProperty("操作类型 1通过 2驳回 3删除") private Integer operationType; @ApiModelProperty("家庭成员") private List<ComMngFamilyInfoVO> comMngFamilyInfoVOS; @ApiModelProperty("房屋信息") private List<ComMngStructHouseVO> comMngStructHouseVOS; @ApiModelProperty("用户小区id") @Min(value = 1,groups = {PutGroup.class},message = "用户小区id不能为空") @NotNull(groups = {PutGroup.class},message = "用户小区id不能为空") private Long areaId; @ApiModelProperty("用户所在社区信息") private ComActVO comActVO; @ApiModelProperty("小区信息") private ComMngStructAreaVO comMngStructAreaVO; @ApiModelProperty("0 未申请 1 申请中 2 通过 3 驳回") private Integer volunteerStatus; @ApiModelProperty("是否注册 0 否 1 是") private Integer isRegister; @ApiModelProperty("年龄") private Integer age; @ApiModelProperty("政治面貌:1 - 党员;2 - 团员;3 - 群众") private Integer politicalOutlook; @ApiModelProperty("用户商铺信息") private ShopStoreVO storeInfo; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/shop/PageShopStoreVO.java
@@ -57,6 +57,9 @@ @ApiModelProperty("店铺销量") private Integer sale; @ApiModelProperty("店铺登陆密码") private String storePassword; @ApiModelProperty("店内商品列表") private List<ComShopGoodsVO> goodsList; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/shop/ShopOperLogVO.java
@@ -23,9 +23,12 @@ @ApiModelProperty("模块标题") private String title; @ApiModelProperty("业务类型(0其它 1新增 2修改 3删除)") @ApiModelProperty("业务类型") private Integer businessType; @ApiModelProperty("业务类型名称") private String businessName; @ApiModelProperty("方法名称") private String method; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/shop/ShopStoreVO.java
@@ -1,6 +1,7 @@ package com.panzhihua.common.model.vos.shop; import com.fasterxml.jackson.annotation.JsonIgnore; import com.panzhihua.common.validated.AddGroup; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -37,12 +38,14 @@ @ApiModelProperty("店铺登陆账号") @Pattern(groups = {AddGroup.class},message="【密码】格式为6-16个字符,英文,数字,且必须包含英文和数字",regexp="^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$") @NotBlank(message = "店铺登陆账号不能为空") private String storeAccount; @ApiModelProperty("店铺登陆密码") @NotBlank(message = "店铺登陆密码不能为空") @Pattern(groups = {AddGroup.class},message="【密码】格式为6-16个字符,英文,数字,且必须包含英文和数字",regexp="^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$") private String storePassword; @@ -68,4 +71,7 @@ @JsonIgnore private Long loginUserId; @ApiModelProperty("id") private Long id; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/user/UserService.java
@@ -546,7 +546,7 @@ * @return */ @GetMapping("getUserByAccount") R getSysUserVOByAccount(@RequestParam(value = "account") String account); R getSysUserVOByAccountAndType(@RequestParam(value = "account") String account,@RequestParam(value = "type") Integer type); /** springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ShopApi.java
@@ -158,6 +158,7 @@ */ @PostMapping("/pageShopGoods") public R pageShopGoods(@RequestBody ComShopGoodsDTO comShopGoodsDTO) { return comShopGoodsService.pageShopGoods(comShopGoodsDTO); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComOpsHouseDAO.java
@@ -23,7 +23,7 @@ @Select("select type,name,phone,image_url from sys_user where user_id=#{userId}") LoginUserInfoVO selectUserByUserId(Long userId); @Select("select user_id from sys_user where user_id=#{name} limit 1") @Select("select user_id from sys_user where name like concat('%',#{name},'%') limit 1") Long selectUserIdByName(String name); @Select("<script> " + springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComShopOrderDAO.java
@@ -34,11 +34,11 @@ IPage<ComShopOrderPageVO> pageOrderList(Page page,@Param("comOrderListDTO") PageComOrderListDTO comOrderListDTO); @Select("<script> " + "SELECT sr.id, sr.store_id, sr.user_id, sr.order_no, sr.pay_no, \n" + "SELECT distinct sr.id, sr.store_id, sr.user_id, su.phone AS userName , sr.order_no, sr.pay_no, \n" + " sr.wx_tarde_no, sr.status, sr.pay_status, sr.receiver_id, \n" + " sr.total_amount, sr.discount_amount, sr.pay_amount, sr.pay_type, \n" + " sr.pay_time, sr.delivery_type, sr.delivery_status, sr.logistics_company, \n" + " sr.logistics_no, sr.create_at \n" + " sr.logistics_no, sr.create_at, uad.name as receiver_name, uad.phone as receiver_phone, group_concat(og.goods_name) as goodsName \n" + " FROM com_shop_order sr LEFT JOIN com_shop_order_goods og ON sr.id = og.order_id \n" + " LEFT JOIN com_shop_goods_attr ga ON og.goods_attr_id = ga.id \n" + " LEFT JOIN sys_user su ON sr.user_id = su.user_id \n" + @@ -75,6 +75,13 @@ "<if test='pageComShopOrderSearchDTO.storeName != null '>" + " AND ss.name like concat('%', #{pageComShopOrderSearchDTO.storeName}, '%') " + " </if> " + "<if test='pageComShopOrderSearchDTO.storeId != null '>" + " AND ss.id = #{pageComShopOrderSearchDTO.storeId} " + " </if> " + "<if test='pageComShopOrderSearchDTO.storeUserId != null '>" + " AND ss.sys_user_id = #{pageComShopOrderSearchDTO.storeUserId} " + " </if> " + " GROUP BY sr.id " + " ORDER BY sr.create_at "+ "</script>") IPage<ComShopOrderSearchVO> pageOrderBy(Page page, @Param("pageComShopOrderSearchDTO") PageComShopOrderSearchDTO pageComShopOrderSearchDTO); @@ -101,7 +108,10 @@ " LEFT JOIN com_shop_store ss ON sr.store_id = ss.id \n" + " WHERE sr.delete_status = 1" + "<if test='comShopOrderExportDTO.userId != null'>" + " AND ss.user_id = #{comShopOrderExportDTO.userId} " + " AND sr.user_id = #{comShopOrderExportDTO.userId} " + " </if> " + "<if test='comShopOrderExportDTO.storeUserId != null '>" + " AND ss.sys_user_id = #{comShopOrderExportDTO.storeUserId} " + " </if> " + "<if test='comShopOrderExportDTO.orderIds != null and comShopOrderExportDTO.orderIds.length>0 '>" + " AND sr.id in " + @@ -179,7 +189,7 @@ "SELECT ss.sys_user_id, sum(sr.pay_amount) AS t , DATE_FORMAT(sr.pay_time,'%Y%m%d') days\n" + "FROM com_shop_order sr LEFT JOIN com_shop_store ss ON sr.store_id = ss.id\n" + "WHERE sr.pay_status = 2 AND DATE_FORMAT(sr.pay_time,'%Y%m%d') = DATE_FORMAT(NOW(),'%Y%m%d')\n" + "<if test='userId!=null'>" + "<if test='userId!=null and userId!=0L'>" + " and ss.sys_user_id = #{userId}\n" + "</if>" + "GROUP BY days\n" + @@ -187,7 +197,7 @@ "SELECT ss.sys_user_id, sum(sr.pay_amount) AS t, DATE_FORMAT(sr.pay_time,'%Y%u') weeks\n" + "FROM com_shop_order sr LEFT JOIN com_shop_store ss ON sr.store_id = ss.id\n" + "WHERE sr.pay_status = 2 AND DATE_FORMAT(sr.pay_time,'%Y%u') = DATE_FORMAT(NOW(),'%Y%u')\n" + "<if test='userId!=null'>" + "<if test='userId!=null and userId!=0L'>" + " and ss.sys_user_id = #{userId}\n" + "</if>" + "GROUP BY weeks\n" + @@ -195,7 +205,7 @@ "SELECT ss.sys_user_id, sum(sr.pay_amount) AS t, DATE_FORMAT(sr.pay_time,'%Y%m') months\n" + "FROM com_shop_order sr LEFT JOIN com_shop_store ss ON sr.store_id = ss.id\n" + "WHERE sr.pay_status = 2 AND DATE_FORMAT(sr.pay_time,'%Y%m') = DATE_FORMAT(NOW(),'%Y%m')\n" + "<if test='userId!=null'>" + "<if test='userId!=null and userId!=0L'>" + " and ss.sys_user_id = #{userId}\n" + "</if>" + "GROUP BY months\n" + springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComShopStoreDAO.java
@@ -19,7 +19,7 @@ public interface ComShopStoreDAO extends BaseMapper<ComShopStoreDO> { @Select("<script>" + "select id,`name`,contacts,store_account,classify_id,logo,phone,delivery_type,remark,`status`,sale,sale_volume,store_detail,create_at from com_shop_store c" + "select id,`name`,store_password,contacts,store_account,classify_id,logo,phone,delivery_type,remark,`status`,sale,sale_volume,store_detail,create_at from com_shop_store c" + " <where>" + "<if test='pageComShopStoreDTO.contacts != null and pageComShopStoreDTO.contacts.trim() != ""'>" + "and c.contacts like concat('%',#{pageComShopStoreDTO.contacts},'%') \n" + springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComOpsHouseServiceImpl.java
@@ -127,8 +127,8 @@ } page.setSize(pageSize); page.setCurrent(pageNum); if(!StringUtils.isEmpty(pageComOpsHouseDTO.getUserRealName())){ Long userId = comOpsHouseDAO.selectUserIdByName(pageComOpsHouseDTO.getUserRealName()); if(!StringUtils.isEmpty(pageComOpsHouseDTO.getUserName())){ Long userId = comOpsHouseDAO.selectUserIdByName(pageComOpsHouseDTO.getUserName()); if (userId==null){ userId = -1L; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopOperLogServiceImpl.java
@@ -55,6 +55,25 @@ */ shopOperLogVO.setJsonResult("****"); shopOperLogVO.setOperParam("****"); String businessTypeName = ""; switch (comShopOperLogDO.getBusinessType()){ case 1: businessTypeName = "登录";break; case 2: businessTypeName = "修改密码";break; case 3: businessTypeName = "添加商品";break; case 4: businessTypeName = "编辑商品";break; case 5: businessTypeName = "下架商品";break; case 6: businessTypeName = "上架商品";break; case 7: businessTypeName = "删除商品";break; case 8: businessTypeName = "取消订单";break; case 9: businessTypeName = "发货";break; case 10: businessTypeName = "配送";break; case 11:businessTypeName = "查看订单详情";break; case 12:businessTypeName = "导出订单";break; case 13:businessTypeName = "导出资金流水";break; default: break; } shopOperLogVO.setBusinessName(businessTypeName); return shopOperLogVO; }); return R.ok(comShopOperLogVOIPage); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopOrderServiceImpl.java
@@ -369,6 +369,7 @@ //查询订单下商品信息 List<ComShopOrderGoodsDO> orderGoodsDOList = comShopOrderGoodsDAO.selectList(new QueryWrapper<ComShopOrderGoodsDO>() .eq("order_no",shopOrderDO.getOrderNo())); StringBuilder sbr = new StringBuilder(""); if(!orderGoodsDOList.isEmpty()){ orderGoodsDOList.forEach(orderGoods -> { ComShopOrderGoodsVO orderGoodsVO = new ComShopOrderGoodsVO(); @@ -377,9 +378,11 @@ orderGoodsVO.setGoodsPic(orderGoods.getGoodsAttrPic()); orderGoodsVO.setPrice(orderGoods.getGoodsAttrPrice()); orderGoodsVOS.add(orderGoodsVO); sbr.append(orderGoods.getGoodsName() + " " ); }); } orderVO.setOrderGoodsVOList(orderGoodsVOS); orderVO.setGoodsName(sbr.toString()); ComShopUserAddressVO userAddressVO = new ComShopUserAddressVO(); //查询用户收货地址 @@ -389,6 +392,15 @@ orderVO.setUserAddressVO(userAddressVO); } //操作日志 List<ComShopOrderOperateDO> listOperLog = comShopOrderOperateDAO.selectList(new LambdaQueryWrapper<ComShopOrderOperateDO>().eq(ComShopOrderOperateDO::getOrderNo, shopOrderDO.getOrderNo())); List<ComShopOrderOperateVO> listOperLogVO = new ArrayList<>(listOperLog.size()); listOperLog.forEach(logDO ->{ ComShopOrderOperateVO copyVO = new ComShopOrderOperateVO(); BeanUtils.copyProperties(logDO,copyVO); listOperLogVO.add(copyVO); }); orderVO.setLogs(listOperLogVO); return R.ok(orderVO); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopStoreServiceImpl.java
@@ -34,8 +34,9 @@ /** * 查询店铺列表 * @param pageComShopStoreDTO 请求参数 * @return 店铺列表 * * @param pageComShopStoreDTO 请求参数 * @return 店铺列表 */ @Override @@ -47,18 +48,19 @@ /** * 查询店铺详情 * @param comShopStoreDTO 请求参数 * @return 店铺详情 * * @param comShopStoreDTO 请求参数 * @return 店铺详情 */ @Override public R shopStoreDetail(PageComShopStoreDTO comShopStoreDTO) { //查询店铺 ComShopStoreDO storeDO = this.baseMapper.selectById(comShopStoreDTO.getStoreId()); if (storeDO == null) { return R.fail(401,"店铺不存在"); return R.fail(401, "店铺不存在"); } if(storeDO.getStatus().equals(ComShopStoreDO.status.no)){ return R.fail(402,"店铺已被禁用"); if (storeDO.getStatus().equals(ComShopStoreDO.status.no)) { return R.fail(402, "店铺已被禁用"); } PageShopStoreVO shopStoreVO = new PageShopStoreVO(); BeanUtils.copyProperties(storeDO, shopStoreVO); @@ -75,6 +77,11 @@ public R saveStore(ShopStoreVO storeVO) { if (storeVO == null) { return R.ok("500", "数据为空!"); } ComShopStoreDO comShopStoreDO = this.baseMapper.selectOne(new LambdaQueryWrapper<ComShopStoreDO>() .eq(ComShopStoreDO::getStoreAccount, storeVO.getStoreAccount())); if (comShopStoreDO != null) { return R.ok("500", "商家账号存在"); } ComShopStoreDO storeDO = new ComShopStoreDO(); BeanUtils.copyProperties(storeVO, storeDO); @@ -108,10 +115,10 @@ public R getOneInfo(Long id) { ComShopStoreDO comShopStoreDO = this.baseMapper.selectById(id); if (comShopStoreDO == null) { R.fail(500,"商铺不存在"); R.fail(500, "商铺不存在"); } ShopStoreVO shopStoreVO = new ShopStoreVO(); BeanUtils.copyProperties(comShopStoreDO,shopStoreVO); BeanUtils.copyProperties(comShopStoreDO, shopStoreVO); return R.ok(shopStoreVO); } @@ -119,10 +126,10 @@ public R getUserStoreInfo(Long userId) { ComShopStoreDO comShopStoreDO = this.baseMapper.selectOne(new LambdaQueryWrapper<ComShopStoreDO>().eq(ComShopStoreDO::getDeleteStatus, 1).eq(ComShopStoreDO::getSysUserId, userId)); if (comShopStoreDO == null) { R.fail(500,"商铺不存在"); R.fail(500, "商铺不存在"); } ShopStoreVO shopStoreVO = new ShopStoreVO(); BeanUtils.copyProperties(comShopStoreDO,shopStoreVO); BeanUtils.copyProperties(comShopStoreDO, shopStoreVO); return R.ok(shopStoreVO); } } springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/api/UserApi.java
@@ -611,13 +611,13 @@ } /** * 通过账号查询用户信息 * 通过账号和渠道查询用户信息 * @param account * @return */ @GetMapping("getUserByAccount") public R getSysUserVOByAccount(@RequestParam(value = "account") String account){ return userService.getSysUserVOByAccount(account); public R getSysUserVOByAccount(@RequestParam(value = "account") String account,@RequestParam(value = "type") Integer type){ return userService.getSysUserVOByAccount(account, type); } /** springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/UserService.java
@@ -3,7 +3,6 @@ import com.panzhihua.common.model.dtos.PageDTO; import com.panzhihua.common.model.dtos.community.ExportUserDTO; import com.panzhihua.common.model.dtos.community.NoticeReadDTO; import com.panzhihua.common.model.dtos.user.EexcelUserDTO; import com.panzhihua.common.model.dtos.user.PageFeedBackDTO; import com.panzhihua.common.model.dtos.user.PageUserAppletsBackstageDTO; import com.panzhihua.common.model.dtos.user.SysUserFeedbackDTO; @@ -11,8 +10,6 @@ import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.SystemmanagementConfigVO; import com.panzhihua.common.model.vos.user.*; import java.util.List; /** * @program: springcloud_k8s_panzhihuazhihuishequ @@ -361,8 +358,9 @@ /** * 通过账号查询用户信息 * @param account * @param type * @return */ R getSysUserVOByAccount(String account); R getSysUserVOByAccount(String account, Integer type); } springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
@@ -1560,8 +1560,10 @@ } @Override public R getSysUserVOByAccount(String account) { SysUserDO sysUserDO = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getAccount, account)); public R getSysUserVOByAccount(String account, Integer type) { LambdaQueryWrapper<SysUserDO> query = new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getAccount, account); query.eq(SysUserDO::getType, type); SysUserDO sysUserDO = userDao.selectOne(query); if (ObjectUtils.isEmpty(sysUserDO)) { return R.fail("用户不存在"); } springcloud_k8s_panzhihuazhihuishequ/shop_backstage/src/main/java/com/panzhihua/shop_backstage/api/GoodsApi.java
@@ -4,6 +4,9 @@ import com.panzhihua.common.model.dtos.shop.ComShopGoodsDTO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.shop.AddShopGoodsVO; import com.panzhihua.common.model.vos.shop.ComShopGoodsVO; import com.panzhihua.common.model.vos.shop.ComShopOrderSearchVO; import com.panzhihua.common.model.vos.shop.ShopStoreVO; import com.panzhihua.common.service.community.CommunityService; import com.panzhihua.common.validated.PageGroup; import com.panzhihua.common.interfaces.ShopOperLog; @@ -32,9 +35,15 @@ @Resource private CommunityService communityService; @ApiOperation(value = "商品分页搜索") @ApiOperation(value = "商品分页搜索", response = ComShopGoodsVO.class) @PostMapping("/page") public R search(@RequestBody @Validated(PageGroup.class) ComShopGoodsDTO comShopGoodsDTO){ R<ShopStoreVO> storeInfoR = communityService.getUserStoreInfo(getUserId()); ShopStoreVO shopStoreVO = storeInfoR.getData(); if(shopStoreVO==null){ return R.fail("用户无关联店铺"); } comShopGoodsDTO.setStoreId(shopStoreVO.getId()); return communityService.pageShopGoods(comShopGoodsDTO); } @@ -42,6 +51,10 @@ @ShopOperLog(operType = 3) @PostMapping("/add") public R search(@RequestBody AddShopGoodsVO addShopGoodsVO){ R<ShopStoreVO> storeInofR = communityService.getUserStoreInfo(getUserId()); ShopStoreVO shopStoreVO = storeInofR.getData(); addShopGoodsVO.setStoreId(shopStoreVO.getId()); addShopGoodsVO.setName(shopStoreVO.getName()); return communityService.saveShopGoods(addShopGoodsVO); } springcloud_k8s_panzhihuazhihuishequ/shop_backstage/src/main/java/com/panzhihua/shop_backstage/api/LogApi.java
@@ -4,6 +4,7 @@ import com.panzhihua.common.model.dtos.PageDTO; import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.shop.ShopOperLogVO; import com.panzhihua.common.service.community.CommunityService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -32,7 +33,7 @@ @Resource private CommunityService communityService; @ApiOperation(value = "登陆用户操作日志") @ApiOperation(value = "登陆用户操作日志", response = ShopOperLogVO.class) @GetMapping("/page") public R page(@RequestParam("pageNum") Long pageNum, @RequestParam("pageSize") Long pageSize){ PageDTO pageDTO = new PageDTO(); springcloud_k8s_panzhihuazhihuishequ/shop_backstage/src/main/java/com/panzhihua/shop_backstage/api/LoginApi.java
@@ -1,16 +1,21 @@ package com.panzhihua.shop_backstage.api; import com.alibaba.fastjson.JSONObject; import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.shop.LoginStoreUserInfoVO; import com.panzhihua.common.model.vos.shop.ShopStoreVO; import com.panzhihua.common.model.vos.user.ChangePasswordVO; import com.panzhihua.common.service.auth.TokenService; import com.panzhihua.common.service.community.CommunityService; import com.panzhihua.common.service.user.UserService; import com.panzhihua.common.interfaces.ShopOperLog; import com.panzhihua.shop_backstage.model.vos.LoginBody; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.util.ObjectUtils; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -26,6 +31,8 @@ private TokenService tokenService; @Resource private UserService userService; @Resource private CommunityService communityService; @ApiOperation(value = "商家后台登录") @ShopOperLog(operType = 1) @@ -57,11 +64,29 @@ return userService.changePassword(changePasswordVO); } @ApiOperation(value = "当前登录用户信息",response = LoginUserInfoVO.class) @ApiOperation(value = "当前登录用户信息",response = LoginStoreUserInfoVO.class) @GetMapping("user") public R detailUser(){ Long userId = this.getUserId(); return userService.detailUser(userId); R<LoginUserInfoVO> loginUserInfoVOR = userService.detailUser(userId); try { LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(loginUserInfoVOR.getData()), LoginUserInfoVO.class); loginUserInfoVO.setPassword("******"); R<ShopStoreVO> storeR = communityService.getUserStoreInfo(userId); LoginStoreUserInfoVO loginStoreUserInfoVO = new LoginStoreUserInfoVO(); BeanUtils.copyProperties(loginUserInfoVO, loginStoreUserInfoVO); if (R.isOk(storeR)&& storeR.getData()!=null) { ShopStoreVO shopStoreVO = JSONObject.parseObject(JSONObject.toJSONString(storeR.getData()), ShopStoreVO.class); loginStoreUserInfoVO.setStoreInfo(shopStoreVO); } return R.ok(loginStoreUserInfoVO); }catch (Exception e){ e.printStackTrace(); return R.fail("获取登陆商家用户信息失败"); } } } springcloud_k8s_panzhihuazhihuishequ/shop_backstage/src/main/java/com/panzhihua/shop_backstage/api/OrderApi.java
@@ -11,6 +11,7 @@ import com.panzhihua.common.model.vos.R; import com.panzhihua.common.interfaces.ShopOperLog; import com.panzhihua.common.model.vos.shop.ComShopOrderPageVO; import com.panzhihua.common.model.vos.shop.ComShopOrderSearchVO; import com.panzhihua.common.model.vos.shop.ShopStoreVO; import com.panzhihua.common.service.community.CommunityService; import com.panzhihua.common.utlis.SFTPUtil; @@ -65,11 +66,11 @@ @Value("${ftp.port}") private int port; @ApiOperation(value = "订单分页") @ApiOperation(value = "订单分页", response = ComShopOrderSearchVO.class) @PostMapping("") public R page(@RequestBody @Validated PageComShopOrderSearchDTO pageComShopOrderSearchDTO){ pageComShopOrderSearchDTO.setUserId(this.getUserId()); ClazzUtils.setIfStringIsEmpty(pageComShopOrderSearchDTO); pageComShopOrderSearchDTO.setStoreUserId(this.getUserId()); return communityService.pageShopOrder(pageComShopOrderSearchDTO); } @@ -112,6 +113,7 @@ @ShopOperLog(operType = 12) public R export(@RequestBody ComShopOrderExportDTO comShopOrderExportDTO){ ClazzUtils.setIfStringIsEmpty(comShopOrderExportDTO); comShopOrderExportDTO.setStoreUserId(getUserId()); String url=excelUrl; String uuid= UUID.randomUUID().toString().replace("-",""); //String name=uuid+".xlsx"; @@ -125,7 +127,7 @@ ShopStoreVO shopStoreVO = JSONObject.parseObject(JSONObject.toJSONString(storeR.getData()),ShopStoreVO.class); Long userId = this.getUserId(); comShopOrderExportDTO.setUserId(userId); comShopOrderExportDTO.setStoreUserId(userId); R r=communityService.shopOrderExportData(comShopOrderExportDTO); if (R.isOk(r)) { List<ExcelShopOrderDTO> excelShopOrderDTO = JSONArray.parseArray(JSONArray.toJSONString(r.getData()),ExcelShopOrderDTO.class); springcloud_k8s_panzhihuazhihuishequ/shop_backstage/src/main/java/com/panzhihua/shop_backstage/config/SwaggerConfig.java
@@ -24,7 +24,7 @@ return new Docket(DocumentationType.SWAGGER_2) .apiInfo(apiInfo()) .select() .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) .apis(RequestHandlerSelectors.basePackage("com.panzhihua.shop_backstage")) .paths(PathSelectors.any()) .build(); }