Helius
2021-07-02 a31466965504b949403770c7c03eb9ee873640a9
Merge branch 'score-shop' of http://120.27.238.55:7000/r/xzx into score-shop
4 files modified
41 ■■■■■ changed files
gc-core/src/main/java/com/xzx/gc/entity/ScoreOrder.java 7 ●●●●● patch | view | raw | blame | history
gc-shop/src/main/java/com/xzx/gc/shop/service/OrderService.java 26 ●●●●● patch | view | raw | blame | history
gc-shop/src/main/java/com/xzx/gc/shop/vo/QueryOrderListVo.java 2 ●●●●● patch | view | raw | blame | history
gc-shop/src/main/resources/sql 6 ●●●●● patch | view | raw | blame | history
gc-core/src/main/java/com/xzx/gc/entity/ScoreOrder.java
@@ -37,5 +37,12 @@
    public  static final Integer STATUS_EVALUATE = 5;
    public  static final Integer STATUS_CANCEL = 6;
    /**
     * 后台确认提货  1:是  2:否
     */
    private Integer isFinish;
    public  static final Integer ISFINISH_YES = 1;
    public  static final Integer ISFINISH_NO = 2;
    private String remark;
}
gc-shop/src/main/java/com/xzx/gc/shop/service/OrderService.java
@@ -72,6 +72,29 @@
            for(QueryOrderListVo queryOrderListVo : maps){
                String decode = StringUtils.decode(queryOrderListVo.getName());
                queryOrderListVo.setName(decode);
                BigDecimal totalPrice = new BigDecimal(StrUtil.isEmpty(queryOrderListVo.getTotalPrice()) ? "0" : queryOrderListVo.getTotalPrice())
                        .setScale( 2, BigDecimal.ROUND_DOWN );
                queryOrderListVo.setTotalPrice(totalPrice.toString());
                Long id = queryOrderListVo.getId();
                Example example = new Example(ScoreOrderDetails.class);
                Example.Criteria criteria = example.createCriteria();
                criteria.andEqualTo("orderId",id);
                List<ScoreOrderDetails> scoreOrderDetails = scoreOrderDetailsMapper.selectByExample(example);
                if(CollUtil.isNotEmpty(scoreOrderDetails)){
                    StringBuffer stringBuffer = new StringBuffer();
                    for(ScoreOrderDetails scoreOrderDetail : scoreOrderDetails){
                        String goodsName = scoreOrderDetail.getGoodsName();
                        BigDecimal unitPrice = scoreOrderDetail.getUnitPrice();
                        String sku = scoreOrderDetail.getSku();
                        Integer cnt = scoreOrderDetail.getCnt();
                        BigDecimal totalPriceOrderDetail = scoreOrderDetail.getTotalPrice();
                        stringBuffer = stringBuffer.append(goodsName+"(")
                                .append("规格:"+sku+","+unitPrice.setScale( 2, BigDecimal.ROUND_DOWN ).toString()+"*"+cnt.toString()+",")
                                .append("总价:"+totalPriceOrderDetail.setScale( 2, BigDecimal.ROUND_DOWN ).toString()+";)");
                    }
                    queryOrderListVo.setOrderDetails(stringBuffer.toString());
                }
            }
        }
        PageInfo pageInfo = new PageInfo(maps);
@@ -152,7 +175,8 @@
    public Long insureOrder(InsureOrderDto model) {
        ScoreOrder scoreOrder = new ScoreOrder();
        scoreOrder.setId(model.getId());
        scoreOrder.setStatus(ScoreOrder.STATUS_DONE);
//        scoreOrder.setStatus(ScoreOrder.STATUS_DONE);
        scoreOrder.setIsFinish(ScoreOrder.ISFINISH_YES);
        scoreOrder.setVoucherImg(CollUtil.join(model.getVoucherImgs(),","));
        scoreOrderMapper.updateByPrimaryKeySelective(scoreOrder);
        return scoreOrder.getId();
gc-shop/src/main/java/com/xzx/gc/shop/vo/QueryOrderListVo.java
@@ -17,6 +17,8 @@
    private String phone;
    @ApiModelProperty(value="下单时间")
    private String createTime;
    @ApiModelProperty(value="订单详情")
    private String orderDetails;
    @ApiModelProperty(value="订单总价")
    private String totalPrice;
    @ApiModelProperty(value="数量")
gc-shop/src/main/resources/sql
@@ -60,6 +60,12 @@
MODIFY COLUMN `nick_name`  varchar(100) CHARACTER SET utf8mb4 NULL DEFAULT NULL AFTER `name`;
ALTER TABLE `xzx_score_order`
ADD COLUMN `is_finish`  int(11) NULL DEFAULT 2 COMMENT '后台确认提货  1:是  2:否' AFTER `remark`;