Merge remote-tracking branch 'origin/master' into master-v2
已删除1个文件
已修改35个文件
已添加10个文件
| | |
| | | package com.mzl.flower.config; |
| | | |
| | | import com.mzl.flower.config.exception.ValidationException; |
| | | import com.mzl.flower.utils.IpUtil; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.aspectj.lang.JoinPoint; |
| | |
| | | Object o = joinPoint.proceed(); |
| | | return o; |
| | | } catch (Throwable e) { |
| | | result = "failure"; |
| | | if(e instanceof ValidationException){ |
| | | result = "validate"; |
| | | errorMsg = ((ValidationException) e).getErrorMessageKey(); |
| | | }else{ |
| | | result = "error"; |
| | | final Writer writer = new StringWriter(); |
| | | final PrintWriter print = new PrintWriter(writer); |
| | | e.printStackTrace(print); |
| | | errorMsg = e.getMessage(); |
| | | } |
| | | throw e; |
| | | } finally { |
| | | //程序结束的时间 |
| | |
| | | HttpServletRequest request = attributes.getRequest(); |
| | | String logReturnMsg = "{\"startTime\":\"{}\",\"endTime\":\"{}\",\"method\":\"{}\",\"api\":\"{}\"" + |
| | | ",\"ip\":\"{}\",\"duration\":\"{}\",\"result\":\"{}\",\"errorMsg\":\"{}\"}"; |
| | | if("success".equals(result) || "validate".equals(result)){ |
| | | logger.info(logReturnMsg, beginTime, endTime, request.getMethod(), request.getRequestURI(), IpUtil.getIpAddress(request), requestTime, result, errorMsg); |
| | | }else{ |
| | | logger.error(logReturnMsg, beginTime, endTime, request.getMethod(), request.getRequestURI(), IpUtil.getIpAddress(request), requestTime, result, errorMsg); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | public enum SETTLEMENT_STATUS { |
| | | PENDING("待结算"), |
| | | COMPLETED("已结算"), |
| | | PROCESSING("结算中"), |
| | | COMPLETED("结算成功"), |
| | | FAILED("结算失败"), |
| | | ; |
| | | |
| | | SETTLEMENT_STATUS(String desc) { |
对比新文件 |
| | |
| | | package com.mzl.flower.dto.request.content; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class AddFeedbackDTO { |
| | | @ApiModelProperty("投诉反馈内容") |
| | | private String feedBack; |
| | | |
| | | @ApiModelProperty("投诉反馈类型(feedback_type)") |
| | | private String type; |
| | | |
| | | @ApiModelProperty("图片") |
| | | private String pictures; |
| | | } |
对比新文件 |
| | |
| | | package com.mzl.flower.dto.request.content; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class QueryFeedBackDTO { |
| | | |
| | | |
| | | @ApiModelProperty("是否处理") |
| | | private Boolean handled; |
| | | |
| | | @ApiModelProperty("商户名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("商户电话") |
| | | private String tel; |
| | | |
| | | @ApiModelProperty("创建日期(yyyy-mm-dd)") |
| | | private String createDateBeginStr; |
| | | |
| | | @ApiModelProperty("创建日期(yyyy-mm-dd)") |
| | | private String createDateEndStr; |
| | | |
| | | @ApiModelProperty(value = "创建日期(yyyy-mm-dd)",hidden = true) |
| | | private LocalDateTime createDateBegin; |
| | | |
| | | @ApiModelProperty(value = "创建日期(yyyy-mm-dd)", hidden = true) |
| | | private LocalDateTime createDateEnd; |
| | | |
| | | @ApiModelProperty(value = "用户ID",hidden = true) |
| | | private String userId; |
| | | |
| | | @ApiModelProperty(value = "ID",hidden = true) |
| | | private Long id; |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.mzl.flower.dto.request.content; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | public class ReplyFeedbackDTO { |
| | | |
| | | @NotNull(message = "id不能为空") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("回复内容") |
| | | @NotBlank(message = "回复内容不能为空") |
| | | private String reply; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "订单id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty(value = "订单商品id") |
| | | private String orderItemId; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | private String flowerName; |
| | | |
| | |
| | | @ApiModelProperty(value = "供应商名称") |
| | | private String supplierName; |
| | | |
| | | @ApiModelProperty(value = "下单开始时间; yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "下单开始时间; yyyy-MM-dd") |
| | | private String orderStartDateStr; |
| | | |
| | | @ApiModelProperty(value = "下单结束时间; yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "下单结束时间; yyyy-MM-dd") |
| | | private String orderEndDateStr; |
| | | |
| | | @ApiModelProperty(value = "售后开始时间; yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "售后开始时间; yyyy-MM-dd") |
| | | private String salesStartDateStr; |
| | | |
| | | @ApiModelProperty(value = "售后结束时间; yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty(value = "售后结束时间; yyyy-MM-dd") |
| | | private String salesEndDateStr; |
| | | |
| | | @ApiModelProperty(value = "状态 ORDER_SALES_STATUS") |
对比新文件 |
| | |
| | | package com.mzl.flower.dto.response.content; |
| | | |
| | | import com.mzl.flower.base.AbstractTransDTO; |
| | | import com.mzl.flower.base.annotation.DictTrans; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class FeedbackDTO extends AbstractTransDTO { |
| | | |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("用户ID") |
| | | private String userId; |
| | | |
| | | @ApiModelProperty("投诉反馈内容") |
| | | private String feedBack; |
| | | |
| | | @ApiModelProperty("投诉反馈类型(feedback_type)") |
| | | @DictTrans(target = "typeStr",codeType = "feedback_type") |
| | | private String type; |
| | | |
| | | @ApiModelProperty("投诉反馈类型(feedback_type)") |
| | | private String typeStr; |
| | | |
| | | @ApiModelProperty("图片") |
| | | private String pictures; |
| | | |
| | | @ApiModelProperty("回复内容") |
| | | private String reply; |
| | | |
| | | @ApiModelProperty("是否处理") |
| | | private Boolean handled; |
| | | |
| | | @ApiModelProperty("回复时间") |
| | | private LocalDateTime replyTime; |
| | | |
| | | @ApiModelProperty("提交时间") |
| | | private LocalDateTime createTime; |
| | | |
| | | |
| | | @ApiModelProperty("用户姓名") |
| | | private String customerName; |
| | | |
| | | @ApiModelProperty("用户电话") |
| | | private String customerTel; |
| | | } |
| | |
| | | @ApiModelProperty(value = "集货状态") |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "补货数量") |
| | | private Integer replaceNum; |
| | | |
| | | @ApiModelProperty(value = "降级数量") |
| | | private Integer reduceNum; |
| | | |
| | | @ApiModelProperty(value = "缺货数量") |
| | | private Integer lackNum; |
| | | |
| | | /*private String checkImages; |
| | | |
| | | @ApiModelProperty(value = "质检图片") |
| | |
| | | package com.mzl.flower.dto.response.payment; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.mzl.flower.base.AbstractTransDTO; |
| | | import com.mzl.flower.base.annotation.DictTrans; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class DeliveryOrderItemSettlementDTO extends AbstractTransDTO { |
| | | @ApiModelProperty(value = "订单商品id") |
| | | private String orderItemId; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | private String flowerName; |
| | |
| | | private String statusBackend; |
| | | private String statusBackendStr; |
| | | |
| | | @ApiModelProperty(value = "质检扣款") |
| | | @ApiModelProperty(value = "降级数量") |
| | | private Integer checkNum; |
| | | |
| | | @ApiModelProperty(value = "降级扣款") |
| | | private BigDecimal checkFee; |
| | | |
| | | @ApiModelProperty(value = "补货数量") |
| | | private Integer replaceNum; |
| | | |
| | | @ApiModelProperty(value = "补货扣款") |
| | | private BigDecimal replaceFee; |
| | | |
| | | @ApiModelProperty(value = "缺货数量") |
| | | private Integer lackNum; |
| | | |
| | | @ApiModelProperty(value = "缺货扣款") |
| | | private BigDecimal lackFee; |
| | | |
| | | @ApiModelProperty(value = "集货站运费") |
| | | private BigDecimal stationFee; |
| | |
| | | private BigDecimal income; |
| | | |
| | | @ApiModelProperty(value = "下单时间") |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss" ,timezone="GMT+8") |
| | | @DateTimeFormat |
| | | private LocalDateTime orderTime; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "是否可质检退款") |
| | | private boolean couldCheckRefund; |
| | | |
| | | @ApiModelProperty(value = "支付单号") |
| | | private String paymentTrId; |
| | | } |
| | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | |
| | | @ApiModelProperty(value = "物流扣款") |
| | | private BigDecimal feePlatformTransport; |
| | | |
| | | @ApiModelProperty(value = "下单时间") |
| | | private LocalDateTime orderTime; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "供应商名称") |
| | | private String supplierName; |
| | | |
| | | @ApiModelProperty(value = "供应商价格") |
| | | private BigDecimal supplierPrice; |
| | | |
| | | @ApiModelProperty(value = "合伙人加价") |
| | | private BigDecimal markupPartner; |
| | | |
| | | @ApiModelProperty(value = "商品售价") |
| | | private BigDecimal price; |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "平台回复") |
| | | private String remarks; |
| | | |
| | | @ApiModelProperty(value = "审核时间") |
| | | private LocalDateTime auditTime; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "快递单号") |
| | | private String deliveryNo;//快递单号 |
| | | |
| | | @ApiModelProperty(value = "支付单号") |
| | | private String paymentTrId; |
| | | } |
对比新文件 |
| | |
| | | package com.mzl.flower.entity.content; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.mzl.flower.base.BaseAutoEntity; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("t_feedback") |
| | | public class Feedback extends BaseAutoEntity { |
| | | |
| | | @ApiModelProperty("用户ID") |
| | | private String userId; |
| | | |
| | | @ApiModelProperty("投诉反馈类型(feedback_type)") |
| | | private String type; |
| | | |
| | | @ApiModelProperty("投诉反馈内容") |
| | | private String feedBack; |
| | | |
| | | @ApiModelProperty("图片") |
| | | private String pictures; |
| | | |
| | | @ApiModelProperty("回复内容") |
| | | private String reply; |
| | | |
| | | @ApiModelProperty("是否处理") |
| | | private Boolean handled; |
| | | |
| | | |
| | | @ApiModelProperty("回复时间") |
| | | private LocalDateTime replyTime; |
| | | |
| | | } |
对比新文件 |
| | |
| | | package com.mzl.flower.mapper.content; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.mzl.flower.dto.request.content.QueryFeedBackDTO; |
| | | import com.mzl.flower.dto.response.content.FeedbackDTO; |
| | | import com.mzl.flower.entity.content.Feedback; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Repository |
| | | public interface FeedbackMapper extends BaseMapper<Feedback> { |
| | | |
| | | List<FeedbackDTO> queryPage(@Param("dto") QueryFeedBackDTO dto, Page page); |
| | | } |
| | |
| | | Integer getUpFlowerStock(); |
| | | |
| | | List<FlowerListDTO> selectZoneFlowerList(Page page, @Param("condition") FlowerZoneQueryDTO dto); |
| | | |
| | | void updateFlowerCategoryInfo(Long category); |
| | | } |
| | |
| | | , @Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate); |
| | | |
| | | List<DeliveryOrderItem4CheckDTO> selectDoItemList4Check(@Param("deliveryIds") List<String> deliveryIds); |
| | | |
| | | Integer getUnCheckCount(@Param("deliveryId") String deliveryId); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.mzl.flower.dto.request.payment.OrderItemSalesQueryDTO; |
| | | import com.mzl.flower.dto.response.payment.OrderItemSalesNewListDTO; |
| | | import com.mzl.flower.dto.response.payment.OrderStatusCountDTO; |
| | | import com.mzl.flower.entity.payment.OrderItemSales; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | Integer getSupplierSalesCount(@Param("supplierId") Long supplierId); |
| | | |
| | | Integer getPartnerSalesCount(@Param("partnerId") Long partnerId); |
| | | |
| | | List<OrderStatusCountDTO> getSalesStatusCount(@Param("condition") OrderItemSalesQueryDTO dto); |
| | | } |
| | |
| | | public interface OrderMapper extends BaseMapper<Order> { |
| | | void setPartnerOrderReceive(); |
| | | |
| | | List<Order> getPartnerOrderReceive(); |
| | | |
| | | List<OrderStatusCountDTO> getOrderStatusCount(@Param("condition") OrderQueryDTO dto); |
| | | |
| | | List<OrderListDTO> selectOrderList(Page page, @Param("condition") OrderQueryDTO dto); |
| | |
| | | |
| | | List<Order> getOrderForBill(@Param("startTime")LocalDateTime startTime |
| | | , @Param("endTime")LocalDateTime endTime); |
| | | |
| | | } |
| | |
| | | for(Transfer t : ls){ |
| | | try { |
| | | paymentV3Service.checkTransferStatus(t); |
| | | settlementService.updateSettlementStatus(t.getId()); |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage(), e); |
| | | } |
| | |
| | | return advertisementMapper.selectPage(page, wrapper).convert(item -> { |
| | | AdvertisementDTO advertisementDTO = new AdvertisementDTO(); |
| | | BeanUtils.copyProperties(item, advertisementDTO); |
| | | advertisementDTO.setContent(null); |
| | | return advertisementDTO; |
| | | }); |
| | | } |
对比新文件 |
| | |
| | | package com.mzl.flower.service.content; |
| | | |
| | | 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.content.AddFeedbackDTO; |
| | | import com.mzl.flower.dto.request.content.QueryFeedBackDTO; |
| | | import com.mzl.flower.dto.request.content.ReplyFeedbackDTO; |
| | | import com.mzl.flower.dto.response.content.FeedbackDTO; |
| | | import com.mzl.flower.entity.content.Feedback; |
| | | import com.mzl.flower.mapper.content.FeedbackMapper; |
| | | import com.mzl.flower.utils.DateUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @Transactional |
| | | public class FeedbackService { |
| | | |
| | | private final FeedbackMapper feedbackMapper; |
| | | |
| | | |
| | | public FeedbackService(FeedbackMapper feedbackMapper) { |
| | | this.feedbackMapper = feedbackMapper; |
| | | } |
| | | |
| | | public void add(AddFeedbackDTO dto) { |
| | | Feedback feedback = new Feedback(); |
| | | feedback.setFeedBack(dto.getFeedBack()); |
| | | feedback.setType(dto.getType()); |
| | | feedback.setPictures(dto.getPictures()); |
| | | feedback.setUserId(SecurityUtils.getUserId()); |
| | | feedback.setHandled(false); |
| | | feedback.create(SecurityUtils.getUserId()); |
| | | feedbackMapper.insert(feedback); |
| | | } |
| | | |
| | | public Page<FeedbackDTO> queryPage(QueryFeedBackDTO dto, Page page) { |
| | | if(StringUtils.isNotBlank(dto.getCreateDateBeginStr())){ |
| | | dto.setCreateDateBegin(DateUtils.dateToLocalDateTime(dto.getCreateDateBeginStr(),true)); |
| | | } |
| | | if(StringUtils.isNotBlank(dto.getCreateDateEndStr())){ |
| | | dto.setCreateDateEnd(DateUtils.dateToLocalDateTime(dto.getCreateDateEndStr(),false)); |
| | | } |
| | | List<FeedbackDTO> list = feedbackMapper.queryPage(dto, page); |
| | | page.setRecords(list); |
| | | return page; |
| | | } |
| | | |
| | | public FeedbackDTO detail(Long id) { |
| | | QueryFeedBackDTO dto = new QueryFeedBackDTO(); |
| | | dto.setId(id); |
| | | List<FeedbackDTO> list = feedbackMapper.queryPage(dto, new Page(1,1)); |
| | | if(list != null && list.size() > 0){ |
| | | return list.get(0); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public void reply(ReplyFeedbackDTO dto) { |
| | | Feedback feedback = feedbackMapper.selectById(dto.getId()); |
| | | if(feedback == null){ |
| | | throw new ValidationException("投诉反馈不存在"); |
| | | } |
| | | feedback.setReply(dto.getReply()); |
| | | feedback.setHandled(true); |
| | | feedback.setReplyTime(LocalDateTime.now()); |
| | | feedbackMapper.updateById(feedback); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.mzl.flower.base.Node; |
| | | import com.mzl.flower.base.cache.CategoryPriceCacheClient; |
| | | import com.mzl.flower.config.exception.ValidationException; |
| | | import com.mzl.flower.config.security.SecurityUtils; |
| | |
| | | public Long updateCategory(FlowerCategoryUpdateDTO dto){ |
| | | Long id = dto.getId(); |
| | | FlowerCategory g = categoryMapper.selectById(id); |
| | | |
| | | Boolean shown = g.getShown(); |
| | | BeanUtils.copyProperties(dto, g); |
| | | g.setShown(shown); |
| | | g.setSortBy(dto.getSortBy() == null ? 0 : dto.getSortBy()); |
| | | g.update(SecurityUtils.getUserId()); |
| | | |
| | |
| | | public List<FlowerCategoryTreeDTO> selectCategoryTree(FlowerCategoryQueryDTO dto) { |
| | | List<FlowerCategoryTreeDTO> treeList = categoryMapper.selectTreeList(dto); |
| | | treeList = (List<FlowerCategoryTreeDTO>) TreeBuilderUtil.buildListToTree(treeList); |
| | | if(treeList != null && treeList.size() > 0){ |
| | | for(FlowerCategoryTreeDTO t : treeList){ |
| | | List<Node> cLs = t.getChildren(); |
| | | String ll = t.getLevelLimit(); |
| | | if(cLs != null && cLs.size() > 0){ |
| | | for(Node c : cLs){ |
| | | FlowerCategoryTreeDTO cc = (FlowerCategoryTreeDTO)c; |
| | | cc.setLevelLimit(ll); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return treeList; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | @Async |
| | | public synchronized void updateCategoryInfo(Long category){ |
| | | flowerMapper.updateFlowerCategoryInfo(category); |
| | | } |
| | | |
| | | /** |
| | | * 花农(供应商)提交商品 |
| | | * |
| | |
| | | |
| | | public Page<FlowerShowListDTO> myCollect(Page page, FlowerShowQueryDTO dto) { |
| | | dto.setUserId(SecurityUtils.getUserId()); |
| | | /*if (StringUtils.isNotEmpty(dto.getColumn())) { |
| | | List<OrderItem> orders = new ArrayList<>(); |
| | | OrderItem i = new OrderItem(); |
| | | i.setColumn(dto.getColumn()); |
| | | i.setAsc(dto.isAsc()); |
| | | page.setOrders(orders); |
| | | }*/ |
| | | if (StringUtils.isNotEmpty(dto.getColumn())) { |
| | | if(dto.getColumn().contains("sales") |
| | | || dto.getColumn().contains("stock")){ |
| | | dto.setColumn(dto.getColumn() + " desc"); |
| | | } |
| | | } |
| | | |
| | | dto.setParamId(paramService.getParamIdByCategoryId(dto.getCategory())); |
| | | List<FlowerShowListDTO> flowerShowListDTOS = flowerMapper.myCollect(page, dto); |
| | | page.setRecords(flowerShowListDTOS); |
| | |
| | | if(ls != null && ls.size() > 0){ |
| | | for(DeliveryOrderItemSettlementDTO dto : ls){ |
| | | dto.setTotalAmount(dto.getPrice().multiply(new BigDecimal(dto.getNum()))); |
| | | |
| | | if(StringUtils.isNotEmpty(dto.getStatus())) { |
| | | Double rate = dto.getServiceFeeRate(); |
| | | BigDecimal serviceFee = new BigDecimal(0); |
| | | if(rate != null) { |
| | | serviceFee = dto.getTotalAmount().multiply(new BigDecimal(rate)) |
| | | .divide(new BigDecimal(100), 2, RoundingMode.HALF_UP); |
| | | dto.setServiceFee(serviceFee); |
| | | } |
| | | |
| | | BigDecimal income = dto.getTotalAmount().subtract(dto.getCheckFee()) |
| | | .subtract(dto.getSalesFee()).subtract(dto.getStationFee()) |
| | | .subtract(serviceFee);//结算金额 |
| | | if (income.doubleValue() < 0) { |
| | | income = new BigDecimal(0); |
| | | } |
| | | |
| | | dto.setIncome(income); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | if(dto.getNum() == null || dto.getNum() == 0){ |
| | | throw new ValidationException("处理数量不能为0"); |
| | | } |
| | | OrderItemCheck c = orderItemCheckMapper.selectOne(new QueryWrapper<OrderItemCheck>() |
| | | .eq("type", dto.getType()) |
| | | .eq("order_item_id", dto.getOrderItemId()) |
| | | ); |
| | | |
| | | OrderItem oi = orderItemMapper.selectById(dto.getOrderItemId()); |
| | | if(dto.getNum() > oi.getNum()){ |
| | | throw new ValidationException("处理数量不能大于商品数量"); |
| | | } |
| | | BigDecimal deduct = deductAmount; |
| | | if(deduct == null){ |
| | | deduct = new BigDecimal(0); |
| | | |
| | | BigDecimal deduct = new BigDecimal(0); |
| | | if(Constants.CHECK_TYPE.replace.name().equals(dto.getType())){ |
| | | deduct = oi.getSupplierPrice().multiply(new BigDecimal(dto.getNum())); |
| | | } else if(Constants.CHECK_TYPE.lack.name().equals(dto.getType())){ |
| | | deduct = oi.getPrice().multiply(new BigDecimal(dto.getNum())); |
| | | } else if (Constants.CHECK_TYPE.reduce.name().equals(dto.getType())) { |
| | | if(deductAmount == null){ |
| | | throw new ValidationException("降级金额不能为空"); |
| | | } |
| | | deduct = deductAmount.multiply(new BigDecimal(dto.getNum())); |
| | | if(deduct.doubleValue() > oi.getTotal().doubleValue()){ |
| | | throw new ValidationException("降级金额不能大于商品总金额"); |
| | | } |
| | | } |
| | | |
| | | OrderItemCheck c = orderItemCheckMapper.selectOne(new QueryWrapper<OrderItemCheck>() |
| | | .eq("type", dto.getType()) |
| | | .eq("order_item_id", dto.getOrderItemId()) |
| | | ); |
| | | if(c != null){ |
| | | if(StringUtils.isNotEmpty(c.getAuditStatus())){ |
| | | throw new ValidationException("已审核,不可修改"); |
| | | } |
| | | c.setCheckTime(LocalDateTime.now()); |
| | | c.setNum(dto.getNum()); |
| | | c.setRemarks(dto.getRemarks()); |
| | |
| | | oi.update(SecurityUtils.getUserId()); |
| | | orderItemMapper.updateById(oi); |
| | | } |
| | | |
| | | DeliveryOrderItem di = deliveryOrderItemMapper.selectOne(new QueryWrapper<DeliveryOrderItem>() |
| | | .eq("order_item_id", id)); |
| | | if(di != null) { |
| | | Integer count = deliveryOrderItemMapper.getUnCheckCount(di.getDeliveryId()); |
| | | if(count == 0) { |
| | | DeliveryOrder d = deliveryOrderMapper.selectById(di.getDeliveryId()); |
| | | d.setCheckTime(LocalDateTime.now()); |
| | | d.setStatus(Constants.DELIVERY_ORDER_STATUS.CHECKED.name()); |
| | | d.update(SecurityUtils.getUserId()); |
| | | deliveryOrderMapper.updateById(d); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void deleteCheckInfo(String itemId, String type){ |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.mzl.flower.base.interceptor.CodeDecorator; |
| | | import com.mzl.flower.component.SequenceNo; |
| | | import com.mzl.flower.config.exception.ValidationException; |
| | | import com.mzl.flower.config.security.SecurityUtils; |
| | |
| | | import com.mzl.flower.dto.request.payment.*; |
| | | import com.mzl.flower.dto.response.payment.OrderItemSalesNewDTO; |
| | | import com.mzl.flower.dto.response.payment.OrderItemSalesNewListDTO; |
| | | import com.mzl.flower.dto.response.payment.OrderStatusCountDTO; |
| | | import com.mzl.flower.dto.response.system.CodeValueDTO; |
| | | import com.mzl.flower.entity.payment.*; |
| | | import com.mzl.flower.entity.supplier.Station; |
| | | import com.mzl.flower.mapper.payment.*; |
| | | import com.mzl.flower.mapper.supplier.StationMapper; |
| | | import com.mzl.flower.service.BaseService; |
| | | import com.mzl.flower.service.system.CodeService; |
| | | import com.mzl.flower.utils.ExcelExportUtil; |
| | | import com.mzl.flower.utils.UUIDGenerator; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.net.URLEncoder; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @Service |
| | |
| | | |
| | | @Autowired |
| | | private StationMapper stationMapper; |
| | | |
| | | @Autowired |
| | | private CodeService codeService; |
| | | |
| | | @Autowired |
| | | private CodeDecorator codeDecorator; |
| | | |
| | | public String createSales(OrderItemSalesCreateDTO dto){ |
| | | Integer num = dto.getNum(); |
| | |
| | | s.setOrderId(oi.getOrderId()); |
| | | s.setOrderItemId(oi.getId()); |
| | | s.setSalesNo(getSalesNo()); |
| | | s.setNum(num); |
| | | s.setTitle(title); |
| | | s.setPictures(toJSONString(dto.getPictureList())); |
| | | s.setVideos(toJSONString(dto.getVideoList())); |
| | |
| | | orderItemSalesMapper.updateById(s); |
| | | } |
| | | |
| | | public Page<OrderItemSalesNewListDTO> selectSalesList(Page page, OrderItemSalesQueryDTO dto){ |
| | | public List<OrderStatusCountDTO> getSalesStatusCount(OrderItemSalesQueryDTO dto) { |
| | | dto.setOrderStartDate(parseLocalDateTime(dto.getOrderStartDateStr())); |
| | | dto.setOrderEndDate(parseLocalDateTime(dto.getOrderEndDateStr())); |
| | | dto.setSalesStartDate(parseLocalDateTime(dto.getSalesStartDateStr())); |
| | | dto.setSalesEndDate(parseLocalDateTime(dto.getSalesEndDateStr())); |
| | | |
| | | List<CodeValueDTO> ls = codeService.searchValue("ORDER_SALES_STATUS"); |
| | | List<OrderStatusCountDTO> ll = orderItemSalesMapper.getSalesStatusCount(dto); |
| | | Map<String, Integer> llMap = new HashMap<>(); |
| | | if (ll != null && ll.size() > 0) { |
| | | for (OrderStatusCountDTO c : ll) { |
| | | llMap.put(c.getValue(), c.getOrderCount()); |
| | | } |
| | | } |
| | | |
| | | List<OrderStatusCountDTO> rr = new ArrayList<>(); |
| | | for (CodeValueDTO c : ls) { |
| | | OrderStatusCountDTO r = new OrderStatusCountDTO(); |
| | | r.setValue(c.getValue()); |
| | | r.setLabel(c.getLabel()); |
| | | Integer count = llMap.get(r.getValue()); |
| | | r.setOrderCount(count == null ? 0 : count); |
| | | |
| | | rr.add(r); |
| | | } |
| | | |
| | | return rr; |
| | | } |
| | | |
| | | public Page<OrderItemSalesNewListDTO> selectSalesList(Page page, OrderItemSalesQueryDTO dto){ |
| | | dto.setOrderStartDate(parseLocalDateTime(dto.getOrderStartDateStr(), true)); |
| | | dto.setOrderEndDate(parseLocalDateTime(dto.getOrderEndDateStr(), false)); |
| | | dto.setSalesStartDate(parseLocalDateTime(dto.getSalesStartDateStr(), true)); |
| | | dto.setSalesEndDate(parseLocalDateTime(dto.getSalesEndDateStr(), false)); |
| | | |
| | | List<OrderItemSalesNewListDTO> ls = orderItemSalesMapper.selectItemSalesList(page, dto); |
| | | |
| | | page.setRecords(ls); |
| | | return page; |
| | | } |
| | | |
| | | public void exportSalesList(HttpServletResponse response, OrderItemSalesQueryDTO dto){ |
| | | dto.setOrderStartDate(parseLocalDateTime(dto.getOrderStartDateStr(), true)); |
| | | dto.setOrderEndDate(parseLocalDateTime(dto.getOrderEndDateStr(), false)); |
| | | dto.setSalesStartDate(parseLocalDateTime(dto.getSalesStartDateStr(), true)); |
| | | dto.setSalesEndDate(parseLocalDateTime(dto.getSalesEndDateStr(), false)); |
| | | |
| | | List<OrderItemSalesNewListDTO> ls = orderItemSalesMapper.selectItemSalesList(null, dto); |
| | | codeDecorator.decorate(ls); |
| | | |
| | | String[] rowsName = new String[]{"集货站", "商品名称", "商品单位", "商品颜色", "商品等级" |
| | | , "商品分类", "收货人", "收货人手机号码", "收货地址", "商品数量", "供应商名称", "商品售价" |
| | | , "总金额", "订单号", "售后单号", "标题", "申请数量", "理由", "实际退款", "审核结果" |
| | | , "申请时间", "平台回复"}; |
| | | List<Object[]> dataList = new ArrayList<>(); |
| | | |
| | | for (OrderItemSalesNewListDTO d : ls) { |
| | | Object[] objs = new Object[rowsName.length]; |
| | | int a = 0; |
| | | objs[a++] = d.getStationName(); |
| | | objs[a++] = d.getFlowerName(); |
| | | objs[a++] = d.getFlowerUnit(); |
| | | objs[a++] = d.getFlowerColor(); |
| | | objs[a++] = d.getFlowerLevelStr(); |
| | | objs[a++] = d.getFlowerCategory(); |
| | | objs[a++] = d.getCustomer(); |
| | | objs[a++] = d.getCustomerTel(); |
| | | objs[a++] = d.getCustomerAddress(); |
| | | objs[a++] = d.getFlowerNum(); |
| | | objs[a++] = d.getSupplierName(); |
| | | objs[a++] = d.getPrice(); |
| | | objs[a++] = d.getTotal(); |
| | | objs[a++] = d.getOrderNo(); |
| | | objs[a++] = d.getSalesNo(); |
| | | objs[a++] = d.getTitle(); |
| | | objs[a++] = d.getNum(); |
| | | objs[a++] = d.getReason(); |
| | | objs[a++] = d.getTotalFee(); |
| | | objs[a++] = d.getStatusStr(); |
| | | objs[a++] = format(d.getCreateTime(), "yyyy-MM-dd HH:mm:ss"); |
| | | objs[a++] = d.getRemarks(); |
| | | |
| | | dataList.add(objs); |
| | | } |
| | | |
| | | ExcelExportUtil excelExportUtil = new ExcelExportUtil("售后申请列表", rowsName, dataList, response); |
| | | try { |
| | | response.addHeader("filename", URLEncoder.encode("售后申请列表.xls", "UTF-8")); |
| | | response.addHeader("Access-Control-Expose-Headers", "filename"); |
| | | excelExportUtil.export(); |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage(), e); |
| | | } |
| | | } |
| | | |
| | | public OrderItemSalesNewDTO getSalesInfo(String id){ |
| | |
| | | rr.setCustomerCity(o.getCustomerCity()); |
| | | rr.setCustomerRegion(o.getCustomerRegion()); |
| | | rr.setCustomerAddress(o.getCustomerAddress()); |
| | | rr.setOrderTime(o.getCreateTime()); |
| | | |
| | | OrderItem oi = orderItemMapper.selectById(sl.getOrderItemId()); |
| | | rr.setFlowerName(oi.getFlowerName()); |
| | |
| | | rr.setSupplierName(oi.getSupplierName()); |
| | | rr.setPrice(oi.getPrice()); |
| | | rr.setTotal(oi.getTotal()); |
| | | rr.setSupplierPrice(oi.getSupplierPrice()); |
| | | rr.setMarkupPartner(oi.getMarkupPartner()); |
| | | |
| | | Long stationId = oi.getStationId(); |
| | | if(stationId != null) { |
| | |
| | | } else if (Constants.CHECK_TYPE.lack.name().equals(type)) { |
| | | lackNum = num == null ? 0 : num; |
| | | lackFeeSupplier = oi.getSupplierPrice().multiply(new BigDecimal(lackNum)); |
| | | lackFeePartner = oi.getMarkupPartner().multiply(new BigDecimal(lackNum)); |
| | | |
| | | BigDecimal markupPartner = oi.getMarkupPartner() == null ? new BigDecimal(0) : oi.getMarkupPartner(); |
| | | lackFeePartner = markupPartner.multiply(new BigDecimal(lackNum)); |
| | | |
| | | BigDecimal markupTwo = oi.getMarkupTwo() == null ? new BigDecimal(0) : oi.getMarkupTwo(); |
| | | lackFeePlatform = oi.getMarkupOne().multiply(new BigDecimal(lackNum)); |
| | | lackFeePlatform = lackFeePlatform.add(oi.getMarkupTwo().multiply(new BigDecimal(lackNum))); |
| | | lackFeePlatform = lackFeePlatform.add(markupTwo.multiply(new BigDecimal(lackNum))); |
| | | } else if (Constants.CHECK_TYPE.replace.name().equals(type)) { |
| | | replaceNum = num == null ? 0 : num; |
| | | replaceFee = amount == null ? new BigDecimal(0) : amount; |
| | |
| | | |
| | | private void setPartnerIncome(OrderItem oi, OrderItemSettlement ois){ |
| | | //合伙人结算:合伙人加价-理赔-缺货扣款 = 结算金额 |
| | | BigDecimal totalAmount = oi.getMarkupPartner().multiply(new BigDecimal(oi.getNum())); |
| | | BigDecimal markupPartner = oi.getMarkupPartner() == null ? new BigDecimal(0) : oi.getMarkupPartner(); |
| | | BigDecimal totalAmount = markupPartner.multiply(new BigDecimal(oi.getNum())); |
| | | BigDecimal settlementAmount = totalAmount.subtract(ois.getSalesFeePartner()).subtract(ois.getLackFeePartner());//结算金额 |
| | | if(settlementAmount.doubleValue() < 0){ |
| | | settlementAmount = new BigDecimal(0); |
| | |
| | | * 合伙人订单定时发货 |
| | | */ |
| | | public void setPartnerOrderSend() { |
| | | orderMapper.setPartnerOrderReceive(); |
| | | List<Order> orders = orderMapper.getPartnerOrderReceive(); |
| | | if(orders == null || orders.size() == 0){ |
| | | return; |
| | | } |
| | | for (Order o : orders) { |
| | | //set status_backend = 'RECEIVE', status = 'RECEIVE' |
| | | o.setStatusBackend("RECEIVE"); |
| | | o.setStatus("RECEIVE"); |
| | | //发送微信发货请求 |
| | | JSONObject jsonObject = sendWxDeliveryGood(o); |
| | | if (jsonObject != null && (int) jsonObject.get("errcode") == 0) { |
| | | o.setWxDeliveryGood(true); |
| | | o.setWxDeliveryMsg(GsonUtil.toJson(jsonObject)); |
| | | } else { |
| | | o.setWxDeliveryGood(false); |
| | | o.setWxDeliveryMsg(GsonUtil.toJson(jsonObject)); |
| | | } |
| | | |
| | | orderMapper.updateById(o); |
| | | } |
| | | //orderMapper.setPartnerOrderReceive(); |
| | | } |
| | | |
| | | /** |
| | |
| | | o.setStatus(Constants.ORDER_STATUS.RECEIVE.name()); |
| | | o.setStatusBackend(Constants.ORDER_STATUS_BACKEND.RECEIVE.name()); |
| | | o.update(SecurityUtils.getUserId()); |
| | | |
| | | //发送微信发货请求 |
| | | JSONObject jsonObject = sendWxDeliveryGood(o); |
| | | if (jsonObject != null && (int) jsonObject.get("errcode") == 0) { |
| | | o.setWxDeliveryGood(true); |
| | | o.setWxDeliveryMsg(GsonUtil.toJson(jsonObject)); |
| | | } else { |
| | | o.setWxDeliveryGood(false); |
| | | o.setWxDeliveryMsg(GsonUtil.toJson(jsonObject)); |
| | | } |
| | | |
| | | orderMapper.updateById(o); |
| | | } |
| | | |
| | |
| | | o.setStatusBackend(Constants.ORDER_STATUS_BACKEND.EVALUATE.name()); |
| | | o.setReceiveTime(LocalDateTime.now()); |
| | | o.update("sys"); |
| | | |
| | | |
| | | //发送微信发货请求 |
| | | JSONObject jsonObject = sendWxDeliveryGood(o); |
| | | if (jsonObject != null && (int) jsonObject.get("errcode") == 0) { |
| | | o.setWxDeliveryGood(true); |
| | | o.setWxDeliveryMsg(GsonUtil.toJson(jsonObject)); |
| | | } else { |
| | | o.setWxDeliveryGood(false); |
| | | o.setWxDeliveryMsg(GsonUtil.toJson(jsonObject)); |
| | | } |
| | | orderMapper.updateById(o); |
| | | |
| | | } |
| | |
| | | o.setStatusBackend(Constants.ORDER_STATUS_BACKEND.EVALUATE.name()); |
| | | o.setReceiveTime(LocalDateTime.now()); |
| | | o.update(userId); |
| | | |
| | | //发送微信发货请求 |
| | | JSONObject jsonObject = sendWxDeliveryGood(o); |
| | | if (jsonObject != null && (int) jsonObject.get("errcode") == 0) { |
| | | o.setWxDeliveryGood(true); |
| | | o.setWxDeliveryMsg(GsonUtil.toJson(jsonObject)); |
| | | } else { |
| | | o.setWxDeliveryGood(false); |
| | | o.setWxDeliveryMsg(GsonUtil.toJson(jsonObject)); |
| | | } |
| | | |
| | | orderMapper.updateById(o); |
| | | } |
| | | |
| | |
| | | @Autowired |
| | | private OrderItemSettlementMapper orderItemSettlementMapper; |
| | | |
| | | @Autowired |
| | | private TransferMapper transferMapper; |
| | | |
| | | @Autowired |
| | | private TransferDetailMapper transferDetailMapper; |
| | | |
| | | public Page<OrderSettlementListDTO> selectSettlementList(Page page, OrderSettlementQueryDTO dto){ |
| | | dto.setStartDate(parseLocalDateTime(dto.getStartDateStr(), true)); |
| | | dto.setEndDate(parseLocalDateTime(dto.getEndDateStr(), false)); |
| | |
| | | OrderSettlement settlement = settlementMapper.selectById(id); |
| | | if(settlement == null){ |
| | | throw new ValidationException("结算单不存在"); |
| | | } |
| | | String status = settlement.getStatus(); |
| | | if(Constants.SETTLEMENT_STATUS.PROCESSING.name().equals(status)){ |
| | | throw new ValidationException("结算中,不用重复结算"); |
| | | } |
| | | if(Constants.SETTLEMENT_STATUS.COMPLETED.name().equals(status)){ |
| | | throw new ValidationException("结算成功,不用重复结算"); |
| | | } |
| | | String type = settlement.getType(); |
| | | |
| | |
| | | } |
| | | |
| | | settlement.setTransferTime(LocalDateTime.now()); |
| | | settlement.setStatus(Constants.SETTLEMENT_STATUS.COMPLETED.name()); |
| | | settlement.setStatus(Constants.SETTLEMENT_STATUS.PROCESSING.name()); |
| | | settlement.update(SecurityUtils.getUserId()); |
| | | |
| | | settlementMapper.updateById(settlement); |
| | | } |
| | | |
| | | public void updateSettlementStatus(String transferId){ |
| | | Transfer t = transferMapper.selectById(transferId); |
| | | if("FINISHED".equals(t.getStatus())){ |
| | | OrderSettlement settlement = settlementMapper.selectOne(new QueryWrapper<OrderSettlement>() |
| | | .eq("transfer_id", transferId)); |
| | | if(settlement == null){ |
| | | return; |
| | | } |
| | | String transferDetailId = settlement.getTransferDetailId(); |
| | | TransferDetail td = transferDetailMapper.selectById(transferDetailId); |
| | | if(td == null){ |
| | | log.warn("未找到对应明细"); |
| | | return; |
| | | } |
| | | String dStatus = td.getStatus(); |
| | | if("SUCCESS".equals(dStatus)){ |
| | | settlement.setStatus(Constants.SETTLEMENT_STATUS.COMPLETED.name()); |
| | | settlement.update("sys"); |
| | | settlementMapper.updateById(settlement); |
| | | } else if ("FAIL".equals(dStatus)){ |
| | | settlement.setStatus(Constants.SETTLEMENT_STATUS.FAILED.name()); |
| | | settlement.update("sys"); |
| | | settlementMapper.updateById(settlement); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void doSettlement(){//弃用 |
| | | //结算完成收货的订单 |
| | | List<Order> ls = orderMapper.getOrderForSettlement(); |
| | |
| | | |
| | | @GetMapping("/page") |
| | | @ApiOperation(value = "查询-分页", notes = "查询-分页") |
| | | public ResponseEntity<ReturnDataDTO<Page<BannerDTO>>> queryPage(String title,String status, Page page) { |
| | | public ResponseEntity<ReturnDataDTO<Page<AdvertisementDTO>>> queryPage(String title,String status, Page page) { |
| | | return returnData(R.SUCCESS.getCode(), advertisementService.queryPage(title,status,page)); |
| | | } |
| | | |
对比新文件 |
| | |
| | | package com.mzl.flower.web.content; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | 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.content.AddFeedbackDTO; |
| | | import com.mzl.flower.dto.request.content.QueryFeedBackDTO; |
| | | import com.mzl.flower.dto.request.content.ReplyFeedbackDTO; |
| | | import com.mzl.flower.dto.response.content.FeedbackDTO; |
| | | import com.mzl.flower.service.content.FeedbackService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @RestController |
| | | @RequestMapping("/api/feedback") |
| | | @Api(value = "投诉反馈管理", tags = "投诉反馈管理") |
| | | @Validated |
| | | @Slf4j |
| | | public class FeedbackController extends BaseController { |
| | | |
| | | private final FeedbackService feedbackService; |
| | | |
| | | public FeedbackController(FeedbackService feedbackService) { |
| | | this.feedbackService = feedbackService; |
| | | } |
| | | |
| | | @PostMapping("/page/new") |
| | | @ApiOperation(value = "用户提交投诉反馈", notes = "提交投诉反馈") |
| | | public ResponseEntity<ReturnDataDTO> add(@Validated @RequestBody AddFeedbackDTO dto) { |
| | | feedbackService.add(dto); |
| | | return returnData(R.SUCCESS.getCode(),null); |
| | | } |
| | | |
| | | @GetMapping("/my/feedback/list") |
| | | @ApiOperation(value = "用户查询我的投诉反馈", notes = "用户查询我的投诉反馈") |
| | | public ResponseEntity<ReturnDataDTO<Page<FeedbackDTO>>> queryMyPage(Page page) { |
| | | QueryFeedBackDTO dto = new QueryFeedBackDTO(); |
| | | dto.setUserId(SecurityUtils.getUserId()); |
| | | return returnData(R.SUCCESS.getCode(), feedbackService.queryPage(dto,page)); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/page/view") |
| | | @ApiOperation(value = "详情", notes = "详情") |
| | | public ResponseEntity<ReturnDataDTO<FeedbackDTO>> detail(@NotNull(message = "id不能为空") Long id) { |
| | | return returnData(R.SUCCESS.getCode(),feedbackService.detail(id)); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @ApiOperation(value = "运营查询-分页", notes = "查询-分页") |
| | | public ResponseEntity<ReturnDataDTO<Page<FeedbackDTO>>> queryPage(QueryFeedBackDTO dto, Page page) { |
| | | return returnData(R.SUCCESS.getCode(), feedbackService.queryPage(dto,page)); |
| | | } |
| | | |
| | | @PostMapping("/page/reply") |
| | | @ApiOperation(value = "运营回复投诉反馈", notes = "运营回复投诉反馈") |
| | | public ResponseEntity<ReturnDataDTO> reply(@Validated @RequestBody ReplyFeedbackDTO dto) { |
| | | feedbackService.reply(dto); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | @PostMapping("/cart/delete/batch") |
| | | @ApiOperation(value = "批量删除购物车商品") |
| | | public ResponseEntity<ReturnDataDTO<?>> deleteBatchFlower4Cart(CartDeleteDTO dto){ |
| | | public ResponseEntity<ReturnDataDTO<?>> deleteBatchFlower4Cart(@RequestBody CartDeleteDTO dto){ |
| | | if(dto == null || CollectionUtils.isEmpty(dto.getIds())){ |
| | | throw new ValidationException("ids不能为空"); |
| | | } |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "售后id", required = true, dataType = "String", paramType = "query") |
| | | }) |
| | | public ResponseEntity<ReturnDataDTO<OrderSalesDTO>> cancelSales(String id){ |
| | | public ResponseEntity<ReturnDataDTO<?>> cancelSales(String id){ |
| | | salesService.cancelSales(id); |
| | | return returnData(R.SUCCESS.getCode(), null); |
| | | } |
| | |
| | | import com.mzl.flower.dto.response.flower.FlowerCategoryDTO; |
| | | import com.mzl.flower.dto.response.flower.FlowerCategoryTreeDTO; |
| | | import com.mzl.flower.service.flower.FlowerCategoryService; |
| | | import com.mzl.flower.service.flower.FlowerService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | @Autowired |
| | | private FlowerCategoryService categoryService; |
| | | |
| | | @Autowired |
| | | private FlowerService flowerService; |
| | | |
| | | @PostMapping("/tree/new") |
| | | @ApiOperation(value = "新增商品分类") |
| | | public ResponseEntity<ReturnDataDTO> addCategory(@RequestBody FlowerCategoryCreateDTO dto) { |
| | |
| | | @PostMapping("/tree/edit") |
| | | @ApiOperation(value = "编辑商品分类") |
| | | public ResponseEntity<ReturnDataDTO> updateCategory(@RequestBody FlowerCategoryUpdateDTO dto) { |
| | | return returnData(R.SUCCESS.getCode(), categoryService.updateCategory(dto)); |
| | | Long category = categoryService.updateCategory(dto); |
| | | flowerService.updateCategoryInfo(category); |
| | | return returnData(R.SUCCESS.getCode(), category); |
| | | } |
| | | |
| | | @GetMapping("/tree/view") |
| | |
| | | import com.mzl.flower.constant.Constants; |
| | | import com.mzl.flower.dto.request.payment.*; |
| | | import com.mzl.flower.dto.response.payment.OrderItemSalesNewDTO; |
| | | import com.mzl.flower.dto.response.payment.OrderSalesListDTO; |
| | | import com.mzl.flower.dto.response.payment.OrderItemSalesNewListDTO; |
| | | import com.mzl.flower.dto.response.payment.OrderStatusCountDTO; |
| | | import com.mzl.flower.entity.payment.OrderItem; |
| | | import com.mzl.flower.service.payment.OrderItemSalesService; |
| | | import com.mzl.flower.service.payment.OrderItemSettlementService; |
| | |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/api/sales") |
| | |
| | | @Autowired |
| | | private OrderItemSettlementService orderItemSettlementService; |
| | | |
| | | @GetMapping("/status/count") |
| | | @ApiOperation(value = "获取状态数量") |
| | | public ResponseEntity<ReturnDataDTO<List<OrderStatusCountDTO>>> getSalesStatusCount(OrderItemSalesQueryDTO dto){ |
| | | return returnData(R.SUCCESS.getCode(), salesService.getSalesStatusCount(dto)); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "查询售后列表") |
| | | public ResponseEntity<ReturnDataDTO<Page<OrderSalesListDTO>>> selectSalesList(Page page |
| | | public ResponseEntity<ReturnDataDTO<Page<OrderItemSalesNewListDTO>>> selectSalesList(Page page |
| | | , OrderItemSalesQueryDTO dto){ |
| | | return returnData(R.SUCCESS.getCode(), salesService.selectSalesList(page, dto)); |
| | | } |
| | | |
| | | @GetMapping({"/list/export"}) |
| | | @ApiOperation(value = "售后列表导出") |
| | | public void exportSales(HttpServletResponse response, OrderItemSalesQueryDTO dto){ |
| | | salesService.exportSalesList(response, dto); |
| | | } |
| | | |
| | | @GetMapping("/list/view") |
| | | @ApiOperation(value = "售后详情") |
| | | @ApiImplicitParams({ |
| | |
| | | import com.mzl.flower.base.BaseController; |
| | | import com.mzl.flower.base.R; |
| | | import com.mzl.flower.base.ReturnDataDTO; |
| | | import com.mzl.flower.constant.Constants; |
| | | import com.mzl.flower.dto.request.payment.DeliveryOrderArriveDTO; |
| | | import com.mzl.flower.dto.request.payment.DeliveryOrderQueryDTO; |
| | | import com.mzl.flower.dto.response.payment.*; |
| | |
| | | return returnData(R.SUCCESS.getCode(), deliveryOrderService.selectSettlementListByTime(page, day)); |
| | | } |
| | | |
| | | @GetMapping("/mine/list/check/info/reduce") |
| | | @ApiOperation(value = "降级操作详情") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "orderItemId", value = "订单商品id", required = true, dataType = "String", paramType = "query") |
| | | }) |
| | | public ResponseEntity<ReturnDataDTO<OrderItemCheckReduceDTO>> getReduceCheck(String orderItemId){ |
| | | return returnData(R.SUCCESS.getCode(), deliveryOrderService.getReduceCheck(orderItemId)); |
| | | } |
| | | |
| | | @GetMapping("/mine/list/check/info/replace") |
| | | @ApiOperation(value = "补货操作详情") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "orderItemId", value = "订单商品id", required = true, dataType = "String", paramType = "query") |
| | | }) |
| | | public ResponseEntity<ReturnDataDTO<OrderItemCheckNumDTO>> getReplaceCheck(String orderItemId){ |
| | | return returnData(R.SUCCESS.getCode(), deliveryOrderService.getOtherCheck(orderItemId |
| | | , Constants.CHECK_TYPE.replace.name())); |
| | | } |
| | | |
| | | @GetMapping("/mine/list/check/info/lack") |
| | | @ApiOperation(value = "缺货操作详情") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "orderItemId", value = "订单商品id", required = true, dataType = "String", paramType = "query") |
| | | }) |
| | | public ResponseEntity<ReturnDataDTO<OrderItemCheckNumDTO>> getLackCheck(String orderItemId){ |
| | | return returnData(R.SUCCESS.getCode(), deliveryOrderService.getOtherCheck(orderItemId |
| | | , Constants.CHECK_TYPE.lack.name())); |
| | | } |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <mapper namespace="com.mzl.flower.mapper.content.AnnouncementMapper"> |
| | | <select id="queryPage" resultType="com.mzl.flower.dto.response.content.AnnouncementDTO"> |
| | | select * from t_announcement t where t.deleted= 0 |
| | | select t.id,t.title,t.cover,t.publish_date,t.status,t.create_time,t.update_time,t.type from t_announcement t where t.deleted= 0 |
| | | <if test="dto.title != null and dto.title != ''"> |
| | | and t.title like concat('%', #{dto.title}, '%') |
| | | </if> |
| | |
| | | </select> |
| | | <select id="queryList" resultType="com.mzl.flower.dto.response.content.AnnouncementDTO" |
| | | parameterType="com.mzl.flower.dto.request.content.QueryAnnouncementDTO"> |
| | | select * from t_announcement t where t.deleted= 0 |
| | | select t.id,t.title,t.cover,t.publish_date,t.status,t.create_time,t.update_time,t.type from t_announcement t where t.deleted= 0 |
| | | <if test="dto.title != null and dto.title != ''"> |
| | | and t.title like concat('%', #{dto.title}, '%') |
| | | </if> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <mapper namespace="com.mzl.flower.mapper.content.BannerMapper"> |
| | | <select id="queryPage" resultType="com.mzl.flower.dto.response.content.BannerDTO"> |
| | | select * from t_banner t where t.deleted= 0 |
| | | select t.id,t.name,t.url,t.module,t.status,t.create_time,t.update_time from t_banner t where t.deleted= 0 |
| | | <if test="dto.name != null and dto.name != ''"> |
| | | and t.name like concat('%', #{dto.name}, '%') |
| | | </if> |
| | |
| | | </select> |
| | | <select id="queryList" resultType="com.mzl.flower.dto.response.content.BannerDTO" |
| | | parameterType="com.mzl.flower.dto.request.content.QueryBannerDTO"> |
| | | select * from t_banner t where t.deleted= 0 |
| | | select t.id,t.name,t.url,t.module,t.status,t.create_time,t.update_time from t_banner t where t.deleted= 0 |
| | | <if test="dto.name != null and dto.name != ''"> |
| | | and t.name like concat('%', #{dto.name}, '%') |
| | | </if> |
对比新文件 |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <mapper namespace="com.mzl.flower.mapper.content.FeedbackMapper"> |
| | | <select id="queryPage" resultType="com.mzl.flower.dto.response.content.FeedbackDTO"> |
| | | SELECT |
| | | f.*, |
| | | c.`name` AS customerName, |
| | | u.tel AS customerTel |
| | | FROM |
| | | t_feedback f |
| | | LEFT JOIN t_user u ON f.user_id = u.id |
| | | LEFT JOIN t_customer_info c ON f.user_id = c.user_id |
| | | WHERE |
| | | f.deleted = 0 |
| | | <if test="dto.id != null and dto.name != 0"> |
| | | and f.id = #{dto.id} |
| | | </if> |
| | | <if test="dto.name != null and dto.name != ''"> |
| | | and c.name like concat('%', #{dto.name}, '%') |
| | | </if> |
| | | <if test="dto.tel != null and dto.tel != ''"> |
| | | and u.tel like concat('%', #{dto.tel}, '%') |
| | | </if> |
| | | <if test="dto.handled != null and dto.handled"> |
| | | and f.handled = 1 |
| | | </if> |
| | | <if test="dto.handled != null and !dto.handled"> |
| | | and f.handled = 0 |
| | | </if> |
| | | <if test="dto.userId != null and dto.userId != ''"> |
| | | and f.user_id = #{dto.userId} |
| | | </if> |
| | | <if test="dto.createDateBegin!=null "> |
| | | <![CDATA[ |
| | | AND f.create_time >= #{dto.createDateBegin} |
| | | ]]> |
| | | </if> |
| | | <if test="dto.createDateEnd!=null "> |
| | | <![CDATA[ |
| | | AND f.create_time <= #{dto.createDateEnd} |
| | | ]]> |
| | | </if> |
| | | order by f.create_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | </if> |
| | | ORDER BY fzp.rank asc |
| | | </select> |
| | | |
| | | <update id="updateFlowerCategoryInfo"> |
| | | update t_flower f, t_flower_category fc |
| | | set f.unit = fc.unit, f.color = fc.color |
| | | where f.category = fc.id and fc.id = #{category} |
| | | </update> |
| | | </mapper> |
| | |
| | | <select id="selectDoItemCheckList" resultType="com.mzl.flower.dto.response.payment.DeliveryOrderItemCheckDTO"> |
| | | SELECT oi.id, oi.flower_name, oi.flower_unit, oi.flower_color, oi.flower_cover, oi.num |
| | | , oi.supplier_price price, oi.flower_level, oi.status, oi.check_images, oi.check_time, oi.check_remarks |
| | | , (select oic.num from t_order_item_check oic where oic.order_item_id = oi.id and oic.type = 'replace') replaceNum |
| | | , (select oic.num from t_order_item_check oic where oic.order_item_id = oi.id and oic.type = 'reduce') reduceNum |
| | | , (select oic.num from t_order_item_check oic where oic.order_item_id = oi.id and oic.type = 'lack') lackNum |
| | | FROM t_delivery_order_item q |
| | | join t_order_item oi on oi.id = q.order_item_id |
| | | WHERE q.deleted = 0 and oi.deleted = 0 |
| | |
| | | </select> |
| | | |
| | | <select id="selectSettlementListByTime" resultType="com.mzl.flower.dto.response.payment.DeliveryOrderItemSettlementDTO"> |
| | | SELECT oi.flower_name, oi.flower_level, oi.num, oi.supplier_price price |
| | | , s.`status`, sd.check_fee, sd.station_fee, sd.sales_fee, s.service_fee_rate |
| | | SELECT ois.order_item_id, oi.flower_name, oi.flower_level, oi.num, oi.supplier_price price , s.`status` |
| | | , ois.check_num, ois.check_fee, ois.replace_num, ois.replace_fee, ois.lack_num, ois.lack_fee_supplier lackFee |
| | | , ois.station_fee, ois.sales_fee_supplier salesFee, ois.service_fee_rate, ois.service_fee, ois.income_supplier |
| | | , o.status_backend, o.create_time orderTime |
| | | FROM t_delivery_order_item doi |
| | | join t_delivery_order q on q.id = doi.delivery_id |
| | | join t_order o on o.id = q.order_id |
| | | join t_order_item oi on oi.id = doi.order_item_id |
| | | left join t_order_item_settlement ois on ois.order_item_id = oi.id |
| | | left join t_order_settlement_detail sd on sd.order_item_id = oi.id |
| | | left join t_order_settlement s on sd.settlement_id = s.id |
| | | WHERE q.deleted = 0 and doi.deleted = 0 |
| | |
| | | #{item} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="getUnCheckCount" resultType="java.lang.Integer"> |
| | | SELECT count(1) |
| | | FROM t_delivery_order_item doi |
| | | join t_order_item oi on oi.id = doi.order_item_id |
| | | WHERE oi.deleted = 0 and doi.deleted = 0 |
| | | and oi.status is null |
| | | and doi.delivery_id = #{deliveryId} |
| | | </select> |
| | | </mapper> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <mapper namespace="com.mzl.flower.mapper.payment.OrderItemSalesMapper"> |
| | | |
| | | <select id="selectItemSalesList" resultType="com.mzl.flower.dto.response.payment.OrderItemSalesNewListDTO"> |
| | | SELECT si.id, s.name stationName, oi.flower_name, oi.flower_unit, oi.flower_color, oi.flower_cover |
| | | , oi.flower_level, oi.flower_category, o.customer, o.customer_tel, o.customer_province, o.customer_city |
| | | , o.customer_region, o.customer_address, oi.num flowerNum, oi.supplier_name, oi.price, oi.total |
| | | , o.order_no, si.sales_no, si.title, si.num, si.reason, si.total_fee, si.status, si.create_time |
| | | , si.remarks |
| | | <select id="getSalesStatusCount" resultType="com.mzl.flower.dto.response.payment.OrderStatusCountDTO"> |
| | | SELECT si.status value, count(1) orderCount |
| | | FROM t_order_item_sales si |
| | | join t_order_item oi on oi.id = si.order_item_id |
| | | join t_order o on si.order_id = o.id |
| | | left join t_station s on s.id = oi.station_id |
| | | WHERE oi.deleted = 0 |
| | | <if test="condition.orderId != null and condition.orderId != ''"> |
| | | AND si.order_id = #{condition.orderId} |
| | |
| | | AND oi.supplier_id = #{condition.supplierId} |
| | | </if> |
| | | |
| | | GROUP BY si.status |
| | | </select> |
| | | <select id="selectItemSalesList" resultType="com.mzl.flower.dto.response.payment.OrderItemSalesNewListDTO"> |
| | | SELECT si.id, s.name stationName, oi.flower_name, oi.flower_unit, oi.flower_color, oi.flower_cover |
| | | , oi.flower_level, oi.flower_category, o.customer, o.customer_tel, o.customer_province, o.customer_city |
| | | , o.customer_region, o.customer_address, oi.num flowerNum, oi.supplier_name, oi.price, oi.total |
| | | , o.order_no, si.sales_no, si.title, si.num, si.reason, si.total_fee, si.status, si.create_time |
| | | , si.remarks, oi.supplier_price, oi.markup_partner, si.audit_time |
| | | FROM t_order_item_sales si |
| | | join t_order_item oi on oi.id = si.order_item_id |
| | | join t_order o on si.order_id = o.id |
| | | left join t_station s on s.id = oi.station_id |
| | | WHERE oi.deleted = 0 |
| | | <if test="condition.orderItemId != null and condition.orderItemId != ''"> |
| | | AND si.order_item_id = #{condition.orderItemId} |
| | | </if> |
| | | |
| | | <if test="condition.orderId != null and condition.orderId != ''"> |
| | | AND si.order_id = #{condition.orderId} |
| | | </if> |
| | | |
| | | <if test="condition.flowerName != null and condition.flowerName != ''"> |
| | | AND oi.flower_name LIKE concat('%', #{condition.flowerName},'%') |
| | | </if> |
| | | |
| | | <if test="condition.orderNo != null and condition.orderNo != ''"> |
| | | AND o.order_no LIKE concat('%', #{condition.orderNo},'%') |
| | | </if> |
| | | |
| | | <if test="condition.salesNo != null and condition.salesNo != ''"> |
| | | AND si.sales_no LIKE concat('%', #{condition.salesNo},'%') |
| | | </if> |
| | | |
| | | <if test="condition.customer != null and condition.customer != ''"> |
| | | AND o.customer LIKE concat('%', #{condition.customer},'%') |
| | | </if> |
| | | |
| | | <if test="condition.customerTel != null and condition.customerTel != ''"> |
| | | AND o.customer_tel LIKE concat('%', #{condition.customerTel},'%') |
| | | </if> |
| | | |
| | | <if test="condition.supplierName != null and condition.supplierName != ''"> |
| | | AND oi.supplier_name LIKE concat('%', #{condition.supplierName},'%') |
| | | </if> |
| | | |
| | | <if test="condition.orderStartDate != null"> |
| | | AND oi.create_time >= #{condition.orderStartDate} |
| | | </if> |
| | | <if test="condition.orderEndDate != null"> |
| | | AND oi.create_time <= #{condition.orderEndDate} |
| | | </if> |
| | | |
| | | <if test="condition.salesStartDate != null"> |
| | | AND si.create_time >= #{condition.salesStartDate} |
| | | </if> |
| | | <if test="condition.salesEndDate != null"> |
| | | AND si.create_time <= #{condition.salesEndDate} |
| | | </if> |
| | | |
| | | <if test="condition.status != null and condition.status != ''"> |
| | | AND si.status = #{condition.status} |
| | | </if> |
| | | |
| | | <if test="condition.createBy != null and condition.createBy != ''"> |
| | | AND si.create_by = #{condition.createBy} |
| | | </if> |
| | | <if test="condition.partnerId != null"> |
| | | AND o.partner_id = #{condition.partnerId} |
| | | </if> |
| | | <if test="condition.supplierId != null"> |
| | | AND oi.supplier_id = #{condition.supplierId} |
| | | </if> |
| | | |
| | | ORDER BY si.create_time desc |
| | | </select> |
| | | |
| | |
| | | where status_backend = 'SEND' and partner_id is not null |
| | | </update> |
| | | |
| | | <select id="getPartnerOrderReceive" resultType="com.mzl.flower.entity.payment.Order"> |
| | | select * from t_order t where status_backend = 'SEND' and partner_id is not null |
| | | </select> |
| | | |
| | | <select id="getOrderStatusCount" resultType="com.mzl.flower.dto.response.payment.OrderStatusCountDTO"> |
| | | SELECT q.status_backend value, count(1) orderCount |
| | | FROM t_order q |
| | |
| | | INSERT INTO t_code_value(ID,TYPE_CODE,VALUE,LABEL,DESCRIPTION,SEQ,STATUS) VALUES ('CHECK_AUDIT_STATUS_REJECTED','CHECK_AUDIT_STATUS','REJECTED','已拒绝','已拒绝',2,'A'); |
| | | |
| | | |
| | | ==================================================20240826 |
| | | delete from t_code_value where type_code = 'SETTLEMENT_STATUS'; |
| | | INSERT INTO t_code_value(ID,TYPE_CODE,VALUE,LABEL,DESCRIPTION,SEQ,STATUS) VALUES ('SETTLEMENT_STATUS_PENDING','SETTLEMENT_STATUS','PENDING','待结算','待结算',1,'A'); |
| | | INSERT INTO t_code_value(ID,TYPE_CODE,VALUE,LABEL,DESCRIPTION,SEQ,STATUS) VALUES ('SETTLEMENT_STATUS_PROCESSING','SETTLEMENT_STATUS','PROCESSING','结算中','结算中',2,'A'); |
| | | INSERT INTO t_code_value(ID,TYPE_CODE,VALUE,LABEL,DESCRIPTION,SEQ,STATUS) VALUES ('SETTLEMENT_STATUS_FAILED','SETTLEMENT_STATUS','FAILED','结算失败','结算失败',3,'A'); |
| | | INSERT INTO t_code_value(ID,TYPE_CODE,VALUE,LABEL,DESCRIPTION,SEQ,STATUS) VALUES ('SETTLEMENT_STATUS_COMPLETED','SETTLEMENT_STATUS','COMPLETED','结算成功','结算成功',4,'A'); |