Merge branch 'huacheng_test' into haucheng_panzhihua
| | |
| | | import com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO; |
| | | import com.panzhihua.common.model.vos.shop.*; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.common.validated.PutGroup; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "查询商品详情", response = ComShopFlowerGoodsVO.class) |
| | | @PostMapping("shopGoodsDetail") |
| | | @GetMapping("shopGoodsDetail") |
| | | @ApiImplicitParam(name = "goodsId", value = "商品id", required = true) |
| | | public R shopGoodsDetail(@RequestParam("goodsId") Long goodsId) { |
| | | return communityService.shopFlowerGoodsDetail(goodsId); |
| | | } |
| | | @ApiOperation(value = "删除商品") |
| | | @DeleteMapping("/goods/delete") |
| | | public R deleteShopGoods(@RequestParam("goodsId") Long goodsId) { |
| | | return communityService.deleteFlowerShopGoods(goodsId); |
| | | } |
| | | @ApiOperation(value = "商品上下架") |
| | | @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "商品Id"), |
| | | @ApiImplicitParam(name = "status", value = "1.上架 2.下架 ")}) |
| | | @GetMapping("/goods/changeStatus") |
| | | public R changeStatus(@RequestParam("id") Long id, @RequestParam("status") Integer status) { |
| | | return communityService.changeFlowerStatus(id, status); |
| | | } |
| | | @ApiOperation(value = "编辑商品") |
| | | @PostMapping("/goods/edit/{id}") |
| | | public R editShopGoods(@PathVariable("id") Long id, |
| | | @RequestBody @Validated(AddGroup.class) AddShopFlowerGoodsVO addShopGoodsVO) { |
| | | return communityService.editFlowerShopGoods(id, addShopGoodsVO); |
| | | } |
| | | @ApiOperation(value = "新增商品") |
| | | @PostMapping("/goods/save") |
| | | public R saveShopGoods(@RequestBody @Validated(AddGroup.class) AddShopFlowerGoodsVO addShopGoodsVO) { |
| | | return communityService.saveFlowerShopGoods(addShopGoodsVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询用户收货地址列表", response = ComShopUserAddressVO.class) |
| | | @PostMapping("shopUserAddressList") |
| | |
| | | /** |
| | | * 配送方式(1.商家配送 2.快递物流) |
| | | */ |
| | | @ApiModelProperty(value = "配送方式(1.商家配送 2.快递物流)", hidden = true) |
| | | @ApiModelProperty(value = "配送方式(1.自提 2.快递)") |
| | | private Integer deliveryType; |
| | | |
| | | @ApiModelProperty("商品规格") |
| | |
| | | /** |
| | | * 删除商品 |
| | | * |
| | | * @param id |
| | | * @param goodsId |
| | | * @return |
| | | */ |
| | | @PostMapping("/shopFlower/deleteShopGoods") |
| | | R deleteFlowerShopGoods(@RequestBody Long[] id); |
| | | @DeleteMapping("/shopFlower/deleteShopGoods") |
| | | R deleteFlowerShopGoods(@RequestParam("goodsId") Long goodsId); |
| | | |
| | | /** |
| | | * 修改商品状态 |
| | |
| | | R changeFlowerStatus(@RequestParam("id") Long id, @RequestParam("status") Integer status); |
| | | |
| | | /** |
| | | * 修改商品状态 |
| | | * 商品详情 |
| | | * |
| | | * @param goodsId |
| | | * @return |
| | | */ |
| | | @PostMapping("/shopFlower/shopGoodsDetail") |
| | | @GetMapping("/shopFlower/shopGoodsDetail") |
| | | R shopFlowerGoodsDetail(@RequestParam("goodsId") Long goodsId); |
| | | |
| | | |
| | |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"花城商城管理模块"}) |
| | | @RestController("/shopFlower") |
| | | @RestController |
| | | @RequestMapping("shopFlower") |
| | | public class ShopFlowerApi extends BaseController { |
| | | @Value("${excel.userurl}") |
| | | private String excelUrl; |
| | | // FTP 登录用户名 |
| | | @Value("${ftp.username}") |
| | | private String userName; |
| | | // FTP 登录密码 |
| | | @Value("${ftp.password}") |
| | | private String password; |
| | | // FTP 服务器地址IP地址 |
| | | @Value("${ftp.host}") |
| | | private String host; |
| | | // FTP 端口 |
| | | @Value("${ftp.port}") |
| | | private int port; |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | |
| | | @RequestBody @Validated(AddGroup.class) AddShopFlowerGoodsVO addShopGoodsVO) { |
| | | return communityService.editFlowerShopGoods(id, addShopGoodsVO); |
| | | } |
| | | @ApiOperation(value = "查询商品详情", response = ComShopFlowerGoodsVO.class) |
| | | @GetMapping("shopGoodsDetail") |
| | | @ApiImplicitParam(name = "goodsId", value = "商品id", required = true) |
| | | public R shopGoodsDetail(@RequestParam("goodsId") Long goodsId) { |
| | | return communityService.shopFlowerGoodsDetail(goodsId); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "删除商品") |
| | | @PostMapping("/goods/delete") |
| | | public R deleteShopGoods(@RequestBody Long[] id) { |
| | | return communityService.deleteFlowerShopGoods(id); |
| | | @DeleteMapping("/goods/delete") |
| | | public R deleteShopGoods(@RequestParam("goodsId") Long goodsId) { |
| | | return communityService.deleteFlowerShopGoods(goodsId); |
| | | } |
| | | |
| | | @ApiOperation(value = "商品上下架") |
| | |
| | | import com.panzhihua.common.model.dtos.community.sanshuo.ComSanshuoEventDTO; |
| | | import com.panzhihua.common.model.dtos.community.sanshuo.IndexDateDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.service_community.entity.ComEvent; |
| | | import com.panzhihua.service_community.entity.ComMediateType; |
| | | import com.panzhihua.service_community.entity.ComSanshuoEvent; |
| | |
| | | @Resource |
| | | private IComEventService comEventService; |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @GetMapping ("/list") |
| | | public R list(@RequestParam(value = "keyWord",required = false)String keyWord, |
| | | @RequestParam(value = "page",required = false)Integer page, |
| | | @RequestParam(value = "size",required = false)Integer size){ |
| | | return commediateTypeService.listEvent(keyWord,page,size); |
| | | String appId=userService.detailUser(this.getUserId()).getData().getAppId(); |
| | | return commediateTypeService.listEvent(keyWord,page,size,appId); |
| | | } |
| | | |
| | | @GetMapping("/detail") |
| | |
| | | /** |
| | | * 删除商品 |
| | | * |
| | | * @param id |
| | | * @param goodsId |
| | | * @return |
| | | */ |
| | | @PostMapping("deleteShopGoods") |
| | | public R deleteFlowerShopGoods(@RequestBody Long[] id) { |
| | | return comShopFlowerGoodsService.deleteShopFlowerGoods(id); |
| | | @DeleteMapping("deleteShopGoods") |
| | | public R deleteFlowerShopGoods(@RequestParam("goodsId") Long goodsId) { |
| | | return comShopFlowerGoodsService.deleteShopFlowerGoods(goodsId); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param goodsId 商品id |
| | | * @return 商品信息 |
| | | */ |
| | | @PostMapping("shopGoodsDetail") |
| | | @GetMapping("shopGoodsDetail") |
| | | public R shopFlowerGoodsDetail(@RequestParam("goodsId") Long goodsId) { |
| | | return comShopFlowerGoodsService.shopFlowerGoodsDetail(goodsId); |
| | | } |
| | |
| | | /** |
| | | * 查询该事件类型的事件数量 |
| | | * */ |
| | | Integer selectEventCount(Long id); |
| | | Integer selectEventCount(@Param("id") Long id,@Param("appId")String appId); |
| | | } |
| | | |
| | | |
| | |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R deleteShopFlowerGoods(Long[] id); |
| | | R deleteShopFlowerGoods(Long id); |
| | | |
| | | /** |
| | | * 修改商品状态 |
| | |
| | | * @param size |
| | | * @return 处理结果 |
| | | * */ |
| | | R listEvent(String keyWord, Integer page, Integer size); |
| | | R listEvent(String keyWord, Integer page, Integer size,String appId); |
| | | |
| | | /** |
| | | * 新增或修改事件类型 |
| | |
| | | if (addShopFlowerGoodsVO == null) { |
| | | return R.ok("500", "数据为空!"); |
| | | } |
| | | String[] images = addShopFlowerGoodsVO.getGoodsPic().split(","); |
| | | |
| | | ComShopFlowerGoodsDO shopGoodsDO = new ComShopFlowerGoodsDO(); |
| | | BeanUtils.copyProperties(addShopFlowerGoodsVO, shopGoodsDO); |
| | | shopGoodsDO.setOriginalPrice(addShopFlowerGoodsVO.getPrice()); |
| | | if (images.length > 1) { |
| | | shopGoodsDO.setGoodsPic(images[0]); |
| | | } |
| | | shopGoodsDO.setImages(addShopFlowerGoodsVO.getGoodsPic()); |
| | | shopGoodsDO.setSale(0); |
| | | shopGoodsDO.setDetails(addShopFlowerGoodsVO.getDetails()); |
| | | int goodsId = this.baseMapper.insert(shopGoodsDO); |
| | | if (goodsId > 0) { |
| | | |
| | |
| | | for (ComShopFlowerGoodsAttrDO oneGoodsAttrDO : goodsAttrDOs) { |
| | | AddShopFlowerGoodsAttrVO goodsAttrVO = new AddShopFlowerGoodsAttrVO(); |
| | | BeanUtils.copyProperties(oneGoodsAttrDO, goodsAttrVO); |
| | | goodsAttrVO.setGoodsAttrId(oneGoodsAttrDO.getId()); |
| | | goodsAttrVOList.add(goodsAttrVO); |
| | | } |
| | | shopGoods.setGoodsAttrs(goodsAttrVOList); |
| | |
| | | shopFlowerGoodsAttrDAO.updateById(comShopGoodsAttrDO); |
| | | } else { |
| | | comShopGoodsAttrDO = new ComShopFlowerGoodsAttrDO(); |
| | | comShopGoodsAttrDO.setGoodsId(shopGoodsDO.getId()); |
| | | comShopGoodsAttrDO.setGoodsId(id); |
| | | comShopGoodsAttrDO.setStoreId(shopGoodsDO.getStoreId()); |
| | | comShopGoodsAttrDO.setGoodsName(shopGoodsDO.getName()); |
| | | comShopGoodsAttrDO.setGoodsAttrName(goodsAttr.getGoodsAttrName()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R deleteShopFlowerGoods(Long[] id) { |
| | | LambdaQueryWrapper<ComShopFlowerGoodsDO> query = new LambdaQueryWrapper<ComShopFlowerGoodsDO>().in(ComShopFlowerGoodsDO::getId, id); |
| | | List<ComShopFlowerGoodsDO> comShopGoodsDOS = this.baseMapper.selectList(query); |
| | | for (ComShopFlowerGoodsDO one : comShopGoodsDOS) { |
| | | one.setDeleteStatus(ComShopFlowerGoodsDO.deleteStatus.yes); |
| | | this.baseMapper.updateById(one); |
| | | } |
| | | public R deleteShopFlowerGoods(Long id) { |
| | | ComShopFlowerGoodsDO comShopFlowerGoodsDO = this.baseMapper.selectById(id); |
| | | comShopFlowerGoodsDO.setDeleteStatus(ComShopFlowerGoodsDO.deleteStatus.yes); |
| | | this.baseMapper.updateById(comShopFlowerGoodsDO); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | * @return 处理结果 |
| | | * */ |
| | | @Override |
| | | public R listEvent(String keyWord, Integer page, Integer size) { |
| | | public R listEvent(String keyWord, Integer page, Integer size,String appId) { |
| | | IPage<ComMediateType> comMediateTypeIPage = comMediateTypeDao.eventList(new Page(page, size), keyWord); |
| | | List<ComMediateType> records = comMediateTypeIPage.getRecords(); |
| | | for (ComMediateType record : records) { |
| | | //查询事件数量 |
| | | if (nonNull(record) && nonNull(record.getId())){ |
| | | record.setEventCount(comMediateTypeDao.selectEventCount(record.getId())); |
| | | record.setEventCount(comMediateTypeDao.selectEventCount(record.getId(),appId)); |
| | | } |
| | | } |
| | | comMediateTypeIPage.setRecords(records); |
| | |
| | | <select id="dateAnalysis" resultType="com.panzhihua.common.model.vos.sanshuo.IndexDateVO"> |
| | | SELECT |
| | | (SELECT count(id) FROM com_sanshuo_event_info |
| | | where event_process_status in (2,3,5,6) |
| | | where event_process_status in (2,3,5,6) |
| | | AND user_event_status not in(3,4) |
| | | AND app_id='wx0cef797390444b75' |
| | | <if test="dto.type == 2"> |
| | |
| | | (SELECT count(id) FROM com_sanshuo_event_info |
| | | where is_end <> 1 |
| | | AND user_event_status not in(3,4) |
| | | AND event_process_status > 1 |
| | | AND event_process_status not in (9) |
| | | AND app_id='wx0cef797390444b75' |
| | | <if test="dto.type == 2"> |
| | | AND current_process_type in (1,5) |
| | |
| | | <select id="selectEventCount" resultType="java.lang.Integer"> |
| | | select count(id) from com_sanshuo_event_info |
| | | where event_category = #{id} |
| | | AND app_id=#{appId} |
| | | </select> |
| | | </mapper> |
| | |
| | | storeName,c.name,c.store_id,c.goods_pic,c.images,c.status,c.sale,c.original_price,c.price,c.unit,c.order,c.stock,c.details,c.remark,c.goods_describe,c.delivery_type,c.delete_status,c.create_at,c.update_at |
| | | from com_shop_flower_goods c |
| | | left join com_convenient_merchants ccm on c.store_id=ccm.id |
| | | <where>and |
| | | where c.delete_status = 1 and ccm.is_del = 0 |
| | | <if test='pageComShopFlowerGoodsDTO.storeName != null and pageComShopFlowerGoodsDTO.storeName.trim() != ""'> |
| | | c.delete_status = 1 and ccm.id_del = 0 |
| | | and ccm.name like concat('%',#{pageComShopFlowerGoodsDTO.storeName},'%') |
| | | </if> |
| | | <if test='pageComShopFlowerGoodsDTO.name != null and pageComShopFlowerGoodsDTO.name.trim() != ""'>and c.name |
| | | like concat('%',#{pageComShopFlowerGoodsDTO.name},'%') |
| | | <if test='pageComShopFlowerGoodsDTO.name != null and pageComShopFlowerGoodsDTO.name.trim() != ""'> |
| | | and c.name like concat('%',#{pageComShopFlowerGoodsDTO.name},'%') |
| | | </if> |
| | | <if test='pageComShopFlowerGoodsDTO.storeId != null'>and ccm.id=#{pageComShopFlowerGoodsDTO.storeId} |
| | | <if test='pageComShopFlowerGoodsDTO.storeId != null'> |
| | | and ccm.id=#{pageComShopFlowerGoodsDTO.storeId} |
| | | </if> |
| | | <if test='pageComShopFlowerGoodsDTO.status != null'>and c.status like |
| | | concat('%',#{pageComShopFlowerGoodsDTO.status},'%') |
| | | <if test='pageComShopFlowerGoodsDTO.status != null'> |
| | | and c.status like concat('%',#{pageComShopFlowerGoodsDTO.status},'%') |
| | | </if> |
| | | </where> |
| | | |
| | | order by c.create_at desc |
| | | </select> |
| | | <select id="pageShopGoodsByStoreId" resultType="com.panzhihua.common.model.vos.shop.ComShopFlowerGoodsVO"> |