server/services/src/main/java/com/doumee/dao/business/model/Orders.java
@@ -447,4 +447,8 @@ @ApiModelProperty(value = "门店主键(同时查询存件/取件门店)") private Integer shopId; @ApiModelProperty(value = "序号") @TableField(exist = false) private Integer sortNum; } server/services/src/main/java/com/doumee/dao/vo/MyOrderDetailVO.java
@@ -229,4 +229,9 @@ @ApiModelProperty(value = "司机评分") private Integer driverScore; @ApiModelProperty(value = "序号") private String sortnum; @ApiModelProperty(value = "取货序号") private String sortnumTake; } server/services/src/main/java/com/doumee/dao/vo/MyOrderVO.java
@@ -131,4 +131,12 @@ @ApiModelProperty(value = "评价状态:0=未评价;1=已评价") private Integer commentStatus; @ApiModelProperty(value = "序号") private String sortnum; @ApiModelProperty(value = "取货序号") private String sortnumTake; @ApiModelProperty(value = "下单照片") private List<String> orderImages; } server/services/src/main/java/com/doumee/dao/vo/OrderDetailVO.java
@@ -76,4 +76,7 @@ @ApiModelProperty(value = "订单状态描述") private String statusDesc; @ApiModelProperty(value = "序号") private String sortnum; } server/services/src/main/java/com/doumee/service/business/impl/OrdersServiceImpl.java
@@ -49,6 +49,7 @@ import com.github.xiaoymin.knife4j.core.util.CollectionUtils; import com.github.yulichang.wrapper.MPJLambdaWrapper; import com.alibaba.fastjson.JSONObject; import io.swagger.annotations.ApiModelProperty; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -1391,6 +1392,25 @@ } return urls; } private List<Multifile> getFileUrlsByidList(List<Integer> orderId, int objType, String prefix) { if(orderId ==null || orderId.size()==0){ return null; } List<Multifile> files = multifileMapper.selectList( new QueryWrapper<Multifile>().lambda() .in(Multifile::getObjId, orderId) .eq(Multifile::getObjType, objType) .eq(Multifile::getIsdeleted, Constants.ZERO) .orderByAsc(Multifile::getSortnum)); if (files != null) { for (Multifile f : files) { if (StringUtils.isNotBlank(f.getFileurl())) { f.setFileurl(prefix + f.getFileurl()); } } } return files; } /** * 计算并设置订单薪酬分配(司机、存件门店、取件门店) @@ -1499,8 +1519,13 @@ IPage<Orders> orderPage = ordersMapper.selectJoinPage(p, Orders.class, wrapper); List<MyOrderVO> voList = new ArrayList<>(); if (orderPage != null && orderPage.getRecords() != null) { if (orderPage != null && orderPage.getRecords() != null && orderPage.getRecords().size()>0) { String imgPrefix = getOrdersPrefix(); List<Integer> idList =new ArrayList<>(); for (Orders o : orderPage.getRecords()) { idList.add(o.getId()); } List<Multifile> files = getFileUrlsByidList(idList,Constants.FileType.ORDER_FILE.getKey(), imgPrefix); for (Orders o : orderPage.getRecords()) { MyOrderVO vo = new MyOrderVO(); vo.setId(o.getId()); @@ -1545,16 +1570,20 @@ // 评价状态 vo.setCommentStatus(o.getCommentStatus()); //序号 vo.setSortnum(Constants.formatIntegerNum(o.getDepositShopId())+"-"+o.getId()); if(o.getTakeShopId()!=null){ vo.setSortnumTake(Constants.formatIntegerNum(o.getTakeShopId())+"-"+o.getId()); } // 查询物品明细(一次查询,同时用于物品列表和逾期计算) List<OrdersDetail> details = ordersDetailMapper.selectList( new QueryWrapper<OrdersDetail>().lambda() .eq(OrdersDetail::getOrderId, o.getId()) .eq(OrdersDetail::getDeleted, Constants.ZERO)); // 物品明细 vo.setDetailList(buildDetailList(details)); vo.setOrderImages(getFileUrlsFromList(o.getId(),files)); // 逾期状态 fillOverdueStatus(vo, o, details); voList.add(vo); @@ -1568,6 +1597,22 @@ pageData.setPage(orderPage.getCurrent()); pageData.setCapacity(orderPage.getSize()); return pageData; } private List<String> getFileUrlsFromList(Integer id, List<Multifile> files) { List<String> urls = new ArrayList<>(); try { if(files!=null){ for(Multifile f : files){ if(Constants.equalsInteger(f.getObjId(),id)){ urls.add(f.getFileurl()); } } } }catch (Exception e){ } return urls; } @Override @@ -1775,7 +1820,11 @@ if (Constants.equalsInteger(order.getStatus(), Constants.OrderStatus.waitPay.getStatus())) { vo.setPayCountdownMs(calcPayCountdownMs(order)); } //序号 vo.setSortnum(Constants.formatIntegerNum(order.getDepositShopId())+"-"+order.getId()); if(order.getTakeShopId()!=null){ vo.setSortnumTake(Constants.formatIntegerNum(order.getTakeShopId())+"-"+order.getId()); } // 存件门店 if (order.getDepositShopId() != null) { ShopInfo depositShop = shopInfoMapper.selectById(order.getDepositShopId()); @@ -4131,7 +4180,7 @@ if (!Constants.equalsInteger(orders.getDepositShopId(), shopId)) { throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "当前门店不是该订单的存件门店"); } if (orders.getStatus() < 2 || orders.getStatus() > 5) { if (orders.getStatus() < 1 || orders.getStatus() > 7) { throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "当前订单状态不允许打印"); } ShopInfo shop = shopInfoMapper.selectById(shopId); @@ -4152,7 +4201,11 @@ userInfo += "(" + phone.substring(phone.length() - 4) + ")"; } } String content = printService.getPrintContent(shop.getName(), detailList, userInfo, orders.getCode(), orders.getRemark(), //序号 String sort = Constants.formatIntegerNum(shopId)+"-"+orders.getId(); // String content = printService.getPrintContent(shop.getName(), detailList, userInfo, orders.getCode(), orders.getRemark(), String content = printService.getPrintContent(shop.getName(), detailList, userInfo, orders.getCode(), sort, orders.getTakeLocationRemark(), orders.getPayTime() != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm").format(orders.getPayTime()) : "", orders.getExpectedTakeTime() != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm").format(orders.getExpectedTakeTime()) : ""); server/services/src/main/java/com/doumee/service/business/impl/PrintService.java
@@ -67,7 +67,10 @@ .append("</TEXT>"); y += 40; // 订单备注(最多2行) y = appendMultiLine(page, "订单备注:", remark, y, 2); page.append("<TEXT x=\"30\" y=\"").append(y).append("\" w=\"2\" h=\"2\" r=\"0\">") .append("序号:").append(remark) .append("</TEXT>"); // y = appendMultiLine(page, "订单备注:", remark, y, 2); // 门店名 + 序号(固定在底部) page.append("<TEXT x=\"30\" y=\"440\" w=\"1\" h=\"1\" r=\"0\">") .append(shopName).append(StringUtils.repeat(" ", 18)) small-program/pages/delivery-order-detail/delivery-order-detail.vue
@@ -51,6 +51,7 @@ </view> <view class="item-qrcode" v-if=" (info.type ===0 && info.status >=1 &&info.status <7) || (info.type ===1 && (info.status ===1 || (info.takeShopId && info.status ===5)))"> <!-- <image src="/static/image/btn_upload@2x.png" mode="widthFix"></image> --> <text style=" font-size: 36rpx;font-weight: 600;margin-bottom: 20rpx;">行李编号:{{info.sortnum || ''}}</text> <view style="width: 360rpx; height: 360rpx;"> <canvas canvas-id="qrcodeCanvas" id="qrcodeCanvas":style="'width: '+width+'px; height:'+height+'px;'"></canvas> <image class="qrcode-image" :src="qrcodeImage" mode="widthFix"></image> small-program/pages/itinerary/itinerary.vue
@@ -198,16 +198,26 @@ </view> </u-popup> <u-popup :show="showQrcode" round="15" @close="openQrcode()" :safeAreaInsetBottom="false" mode="bottom" :closeable="true" :closeOnClickOverlay="false"> <view class="tc" style="height: 700rpx;width: 100%; "> <view class="tc" style="height: auto;width: 100%; "> <view class="tc-contemt" style="text-align: center;"> <view class="tc-contemt-title" style="text-align: center;">核销码</view> <view style="margin-bottom: 30rpx;"> <text class="pickup-code" style="font-size: 48rpx;">行李编号:{{ currentOrder.sortnum||'' }}</text> <view class="pickup-code" style="margin-left: 60rpx;font-size: 28rpx;text-align: left;font-weight: normal;">用户:{{currentOrder.takeUser||''}}({{currentOrder.takePhone||''}})</view> <view class="pickup-code" style="margin-left: 60rpx;font-size: 28rpx;text-align: left;font-weight: normal;">门店:{{currentOrder.depositShopName||''}}</view> <view class="item-form-list" style="align-items:baseline;" v-if="currentOrder && currentOrder.orderImages && currentOrder.orderImages.length"> <view class="item-form-list-row" v-for="(item,index) in currentOrder.orderImages" key="item"> <image :src="item" mode="widthFix" @click="previewImage(currentOrder.orderImages,index)" ></image> </view> </view> </view> <view class="qrcode-box"> <canvas canvas-id="qrcodeCanvas" id="qrcodeCanvas" style="width: 100px; height: 100px;"></canvas> <image class="qrcode-image" :src="qrcodeImage" mode="widthFix"></image> </view> <text class="pickup-code">{{ currentOrder.memberVerifyCode||'' }}</text> <text class="pickup-code">核销码:{{ currentOrder.memberVerifyCode||'' }}</text> <text class="pickup-tip" @tap="copyCode">点击复制核销码</text> </view> </view> </u-popup> <custom-tabbar></custom-tabbar> @@ -313,6 +323,12 @@ this.getDataList(); }, methods: { previewImage(images,index = 0) { uni.previewImage({ current: index, urls: images }); }, changeTab(item){ this.activeTab = item.value this.getFirstPageData() @@ -1004,7 +1020,22 @@ opacity: 0; } } .item-form-list { max-width: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 20rpx; .item-form-list-row { border-radius: 8rpx; overflow: hidden; image { width: 130rpx; max-height: 150rpx; } } } .qrcode-image { width: 100%; height: 100%; small-program/shop/pages/order-details/order-details.vue
@@ -234,7 +234,7 @@ <view class="btn kong" @click="contactPhoneDo(info.takePhone)" v-if="info.status === 1 || info.status === 5" >联系客户</view> <view class="btn kong" @click="contactPhoneDo(info.driverPhone)" v-if="info.type ===1&&(info.status === 4 || info.status === 3)">联系骑手</view> <view class="btn you" v-if="info.status ===1 || info.status ===4 " @click="hexiaoOrder(info)" >收件核销</view> <view class="btn you" v-if="info.status ==2 || info.status ===3 || info.status ===5 || info.status ===4 " @click="printerOrder(info)" >打印标签</view> <view class="btn you" v-if="info.status>0||info.status<=7 " @click="printerOrder(info)" >打印标签</view> <view class="btn you" v-if="info.status ===5 &&(info.overdueStatus ==0 || info.overdueStatus == 1)" @click="hexiaoOrder(info)" >确认到店</view> <view class="btn you" v-if="info.status ===5 && (info.overdueStatus == 4 || info.overdueStatus == 2)" @click="hexiaoOrder(info)" >取件核销</view> </view> small-program/shop/pages/write-off-a/write-off-a.vue
@@ -155,6 +155,7 @@ </view> <view class="footer" > <view class="footer-btns"> <view class="btn you" v-if="info.status >0 || info.status <=7 " @click="printerOrder1()" >打印标签</view> <view class="btn you" v-if="info.status ===1 ||info.status ===4 " @click="show0=true" >收件核销</view> <view class="btn you" v-if="info.status ===5 &&(info.overdueStatus ==0 || info.overdueStatus == 1)" @click="show2=true" >确认到店</view> <view class="btn you" v-if="info.status ===5 && (info.overdueStatus == 4 || info.overdueStatus == 2)" @click="show1=true" >取件核销</view> @@ -290,6 +291,7 @@ id:null, show1:false, show0:false, loading:false, show3:false, show2:false, info:{}, @@ -318,6 +320,7 @@ onLoad(options) { this.info={} this.show2=false this.loading=false this.show1=false this.show0=false this.show3=false @@ -585,6 +588,35 @@ },1000) } }, async printerOrder(){ try{ var that =this that.$u.api.printOrderLabel({ orderId: this.id }).then(res=>{}) }catch(e){ } }, async printerOrder1(){ if(this.loading){ return } this.loading =true try{ var that =this that.$u.api.printOrderLabel({ orderId: this.id }).then(res=>{ if (res.code === 200 ) { uni.showToast({ title:'发起打印请求成功', icon:'none' }) } that.loading =false }) }catch(e){ this.loading =false } }, async shopVerifyOrderDo(){ var that =this if (!this.form.images || this.form.images.length == 0) { @@ -601,6 +633,7 @@ icon: 'success' }) uni.$emit('updateOrder',{info:this.info,delete:0}) that.printerOrder() setTimeout(function(){ that.getOrderDetail() },1000)