xiaoyong931011
2021-07-02 280c1bf9b93fb57b65d2c3f88cc4924aa9d780b4
Merge branch 'score-shop' of http://120.27.238.55:7000/r/xzx into score-shop
4 files modified
18 ■■■■ changed files
gc-order/src/main/java/com/xzx/gc/order/service/JhyOrderService.java 7 ●●●● patch | view | raw | blame | history
gc-order/src/main/java/com/xzx/gc/order/vo/JhyOrderListVo.java 5 ●●●●● patch | view | raw | blame | history
gc-order/src/main/resources/mapper/order/JhyOrderMapper.xml 2 ●●●●● patch | view | raw | blame | history
gc-shop/src/main/java/com/xzx/gc/shop/service/OrderService.java 4 ●●● patch | view | raw | blame | history
gc-order/src/main/java/com/xzx/gc/order/service/JhyOrderService.java
@@ -155,7 +155,12 @@
            throw new RestException(-3, "无权限操作");
        }
        order.setStatus(JhyOrder.ORDER_STATUS_CANCEL);
        if (userId.equals(order.getJhyId())) {
            order.setStatus(JhyOrder.ORDER_STATUS_WAITING);
        } else {
            order.setStatus(JhyOrder.ORDER_STATUS_CANCEL);
        }
        jhyOrderMapper.updateByPrimaryKey(order);
    }
gc-order/src/main/java/com/xzx/gc/order/vo/JhyOrderListVo.java
@@ -4,6 +4,8 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel(value = "JhyOrderListVo", description = "集物员订单列表返回参数类")
public class JhyOrderListVo {
@@ -35,6 +37,9 @@
    @ApiModelProperty(value = "重量")
    private String weight;
    @ApiModelProperty(value = "取货时间")
    private String receivingTime;
    @ApiModelProperty(value = "备注")
    private String remark;
gc-order/src/main/resources/mapper/order/JhyOrderMapper.xml
@@ -13,6 +13,7 @@
            ,a.weight
            ,a.status
            ,a.remark
            ,date_format(a.receiving_time, '%Y-%m-%d %H:%i') receivingTime
            ,CONCAT(a.reserve_date, ' ', a.reserve_time) reserveTime
            ,GROUP_CONCAT(b.title) items
            ,c.username jhyName
@@ -34,5 +35,6 @@
            </if>
        </where>
        group by a.id
        order by a.receiving_time desc, a.id desc
    </select>
</mapper>
gc-shop/src/main/java/com/xzx/gc/shop/service/OrderService.java
@@ -205,13 +205,15 @@
        }
        AccountInfo accountInfo = accountInfoMapper.selectAccountInfoByUserId(addGoodsOrderDto.getUserId());
        log.info("积分:{}", accountInfo.getCollectScore());
        if (accountInfo.getCollectScore() == null) {
            throw new RestException(-3, "积分不足");
        }
        BigDecimal totalPrice = sku.getPresentPrice().multiply(BigDecimal.valueOf(addGoodsOrderDto.getCnt()));
        BigDecimal score = new BigDecimal(accountInfo.getCollectScore());
        log.info("积分:{}", score);
        log.info("积分1:{}", totalPrice);
        if (score.compareTo(totalPrice) < 0) {
            throw new RestException(-3, "积分不足");
        }