springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/ShopApi.java
@@ -82,14 +82,11 @@ 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); //保存sys_user if (R.isOk(r1)) { R<SysUserVO> sysUserVO = userService.getSysUserVOByPhone(storeVO.getPhone()); JSONObject jsonObject = null; if (sysUserVO.getData() != null) { return R.fail("账号已存在!"); } AdministratorsUserVO administratorsUserVO = new AdministratorsUserVO(); administratorsUserVO.setAccount(storeVO.getStoreAccount()); administratorsUserVO.setPassword(storeVO.getStorePassword()); @@ -101,6 +98,14 @@ administratorsUserVO.setShopStoreName(storeVO.getName()); administratorsUserVO.setShopStorePhone(storeVO.getPhone()); R r = userService.addUserBackstage(administratorsUserVO); //保存sys_user if (R.isOk(r)) { sysUserVO = userService.getSysUserVOByPhone(storeVO.getPhone()); 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,13 +114,12 @@ @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.getSysUserVOByPhone(storeVO.getPhone()); 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){ return R.fail(storeInfoVO.getMsg()); 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/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/ComShopStoreServiceImpl.java
@@ -34,6 +34,7 @@ /** * 查询店铺列表 * * @param pageComShopStoreDTO 请求参数 * @return 店铺列表 */ @@ -47,6 +48,7 @@ /** * 查询店铺详情 * * @param comShopStoreDTO 请求参数 * @return 店铺详情 */ @@ -76,6 +78,11 @@ 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); storeDO.setSale(0); 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(); }