| 对比新文件 |
| | |
| | | package com.mzl.flower.dto.request.flower; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class FlowerMarkupSpCgBatchSaveDTO { |
| | | |
| | | @ApiModelProperty(value = "分类id列表") |
| | | private List<Long> categoryId; |
| | | |
| | | @ApiModelProperty(value = "A级金额") |
| | | private BigDecimal levelA; |
| | | |
| | | @ApiModelProperty(value = "B级金额") |
| | | private BigDecimal levelB; |
| | | |
| | | @ApiModelProperty(value = "C级金额") |
| | | private BigDecimal levelC; |
| | | |
| | | @ApiModelProperty(value = "D级金额") |
| | | private BigDecimal levelD; |
| | | |
| | | @ApiModelProperty(value = "E级金额") |
| | | private BigDecimal levelE; |
| | | |
| | | @ApiModelProperty(value = "O级金额") |
| | | private BigDecimal levelO; |
| | | |
| | | @ApiModelProperty(value = "合伙人ID") |
| | | private Long partnerId; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(hidden = true) |
| | | private String userId; |
| | | |
| | | @ApiModelProperty(value = "结算对象名称") |
| | | private String userName; |
| | | |
| | | } |
| | |
| | | List<FlowerListDTO> selectZoneFlowerList(Page page, @Param("condition") FlowerZoneQueryDTO dto); |
| | | |
| | | void updateFlowerCategoryInfo(Long category); |
| | | |
| | | List<Long> searchInvalidHistory(@Param("userId") String userId); |
| | | } |
| | |
| | | package com.mzl.flower.service.customer; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.mzl.flower.config.exception.ValidationException; |
| | | import com.mzl.flower.config.security.SecurityUtils; |
| | | import com.mzl.flower.entity.customer.BrowseHistory; |
| | | import com.mzl.flower.mapper.customer.BrowseHistoryMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | log.error(e.getMessage(), e); |
| | | } |
| | | } |
| | | |
| | | public boolean deleteBatchIds(List<Long> ids) { |
| | | if(CollectionUtils.isNotEmpty(ids)){ |
| | | return browseHistoryMapper.deleteBatchIds(ids)>0; |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.mzl.flower.config.exception.ValidationException; |
| | | import com.mzl.flower.config.security.SecurityUtils; |
| | | import com.mzl.flower.dto.request.flower.FlowerMarkupPsSpCgSaveDTO; |
| | | import com.mzl.flower.dto.request.flower.FlowerMarkupSpCgBatchSaveDTO; |
| | | import com.mzl.flower.dto.request.flower.FlowerMarkupSpCgQueryDTO; |
| | | import com.mzl.flower.dto.request.flower.FlowerMarkupSpCgSaveDTO; |
| | | import com.mzl.flower.dto.response.flower.FlowerMarkupSpCgDTO; |
| | |
| | | markupCacheClient.addMarkupSpCg(dto.getPartnerId(), cId, cg); |
| | | } |
| | | |
| | | public void saveMarkupSpCgBatch(FlowerMarkupSpCgBatchSaveDTO dto) { |
| | | List<Long> categoryIds = dto.getCategoryId(); |
| | | if (categoryIds == null || categoryIds.size() == 0) { |
| | | throw new ValidationException("分类列表不能为空"); |
| | | } |
| | | for (Long categoryId : categoryIds) { |
| | | FlowerMarkupSpCgSaveDTO cg = new FlowerMarkupSpCgSaveDTO(); |
| | | BeanUtils.copyProperties(dto, cg); |
| | | cg.setCategoryId(categoryId); |
| | | saveMarkupSpCg(cg); |
| | | } |
| | | } |
| | | public FlowerMarkupSpCgDTO getMarkupSpCg(Long categoryId){ |
| | | FlowerMarkupSpCgDTO dto = new FlowerMarkupSpCgDTO(); |
| | | dto.setCategoryId(categoryId); |
| | |
| | | |
| | | return page; |
| | | } |
| | | |
| | | public void clearInvalidHistory(String userId) { |
| | | |
| | | List<Long> ids = flowerMapper.searchInvalidHistory(userId); |
| | | if(ids!=null && ids.size()>0){ |
| | | browseService.deleteBatchIds(ids); |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | import com.mzl.flower.base.BaseController; |
| | | import com.mzl.flower.base.R; |
| | | import com.mzl.flower.base.ReturnDataDTO; |
| | | import com.mzl.flower.config.security.SecurityUtils; |
| | | import com.mzl.flower.dto.request.flower.FlowerShowQueryDTO; |
| | | import com.mzl.flower.dto.response.flower.FlowerShowListDTO; |
| | | import com.mzl.flower.service.flower.FlowerService; |
| | |
| | | public ResponseEntity<ReturnDataDTO<Page<FlowerShowListDTO>>> myBrowseHistory(Page page, FlowerShowQueryDTO dto) { |
| | | return returnData(R.SUCCESS.getCode(),flowerService.myBrowseHistory(page,dto)); |
| | | } |
| | | |
| | | @PostMapping("/clear") |
| | | @ApiOperation(value = "清空失效商品", notes = "清空失效商品") |
| | | public ResponseEntity<ReturnDataDTO<Page<FlowerShowListDTO>>> clear() { |
| | | flowerService.clearInvalidHistory(SecurityUtils.getUserId()); |
| | | return returnData(R.SUCCESS.getCode(),null); |
| | | } |
| | | } |
| | |
| | | import com.mzl.flower.base.R; |
| | | import com.mzl.flower.base.ReturnDataDTO; |
| | | import com.mzl.flower.config.exception.ValidationException; |
| | | import com.mzl.flower.dto.request.flower.FlowerMarkupSpCgBatchSaveDTO; |
| | | import com.mzl.flower.dto.request.flower.FlowerMarkupSpCgQueryDTO; |
| | | import com.mzl.flower.dto.request.flower.FlowerMarkupSpCgSaveDTO; |
| | | import com.mzl.flower.dto.response.flower.FlowerMarkupSpCgDTO; |
| | |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | } |
| | | |
| | | @PostMapping("/list/save/batch") |
| | | @ApiOperation(value = "批量新增商品分类加价") |
| | | public ResponseEntity<ReturnDataDTO> saveMarkupSpCgBatch(@RequestBody FlowerMarkupSpCgBatchSaveDTO dto) { |
| | | Partner s = spCgService.getCurrentPartner(); |
| | | if(s == null){ |
| | | throw new ValidationException("未找到当前合伙人信息"); |
| | | } |
| | | dto.setPartnerId(s.getId()); |
| | | spCgService.saveMarkupSpCgBatch(dto); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | } |
| | | |
| | | @PostMapping("/list/save/platform") |
| | | @ApiOperation(value = "运营平台新增商品分类加价") |
| | | public ResponseEntity<ReturnDataDTO> saveMarkupSpCgPlatform(@RequestBody FlowerMarkupSpCgSaveDTO dto) { |
| | |
| | | </if> |
| | | ORDER BY fzp.rank asc |
| | | </select> |
| | | <select id="searchInvalidHistory" resultType="java.lang.Long"> |
| | | SELECT c.id |
| | | FROM t_browse_his c left join t_flower f on c.flower_id = f.id |
| | | WHERE f.deleted = 0 and c.deleted = 0 and f.status != 'UP' and c.user_id = #{userId} |
| | | </select> |
| | | |
| | | <update id="updateFlowerCategoryInfo"> |
| | | update t_flower f, t_flower_category fc |
| | |
| | | <if test="condition.weight != null"> |
| | | AND q.weight = #{condition.weight} |
| | | </if> |
| | | ORDER BY q.sort_by |
| | | ORDER BY CASE WHEN q.parent_id IS NULL THEN 1 ELSE 2 END,q.sort_by, spcg.create_time |
| | | </select> |
| | | |
| | | |
| | |
| | | <if test="condition.weight != null"> |
| | | AND q.weight = #{condition.weight} |
| | | </if> |
| | | ORDER BY q.sort_by |
| | | ORDER BY CASE WHEN q.parent_id IS NULL THEN 1 ELSE 2 END,q.sort_by, spcg.create_time |
| | | </select> |
| | | |
| | | |
| | |
| | | join t_flower_markup_sp sp on sp.flower_id = f.id and sp.partner_id = #{partnerId} |
| | | left join t_supplier_info s on s.id = f.supplier_id |
| | | left join t_flower_category c on f.category = c.id |
| | | WHERE f.deleted = 0 |
| | | WHERE f.deleted = 0 AND sp.fee > 0 |
| | | <if test="condition.name != null and condition.name != ''"> |
| | | AND f.name LIKE concat('%', #{condition.name},'%') |
| | | </if> |
| | |
| | | <if test="condition.endDate != null"> |
| | | AND s.create_time <= #{condition.endDate} |
| | | </if> |
| | | |
| | | <if test="condition.userName != null and condition.userName != ''"> |
| | | AND (si.name LIKE CONCAT('%', #{condition.userName}, '%') OR pi.name LIKE CONCAT('%', #{condition.userName}, '%')) |
| | | </if> |
| | | ORDER BY s.create_time desc |
| | | </select> |
| | | |