|
|
@@ -1,13 +1,13 @@
|
|
|
package com.fs.his.controller;
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fs.common.annotation.Log;
|
|
|
import com.fs.common.core.controller.BaseController;
|
|
|
import com.fs.common.core.domain.AjaxResult;
|
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.core.page.TableDataInfo;
|
|
|
import com.fs.common.enums.BusinessType;
|
|
|
+import com.fs.common.utils.CloudHostUtils;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
|
import com.fs.his.domain.FsIntegralOrder;
|
|
|
@@ -17,7 +17,8 @@ import com.fs.his.enums.ShipperCodeEnum;
|
|
|
import com.fs.his.param.FsIntegralOrderParam;
|
|
|
import com.fs.his.service.IFsExpressService;
|
|
|
import com.fs.his.service.IFsIntegralOrderService;
|
|
|
-import com.fs.his.utils.PhoneUtil;
|
|
|
+import com.fs.his.service.IFsStoreOrderService;
|
|
|
+import com.fs.utils.OrderContextHolder;
|
|
|
import com.fs.his.vo.*;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
@@ -44,6 +45,9 @@ public class FsIntegralOrderController extends BaseController
|
|
|
private IFsIntegralOrderService fsIntegralOrderService;
|
|
|
@Autowired
|
|
|
private IFsExpressService expressService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IFsStoreOrderService fsStoreOrderService;
|
|
|
/**
|
|
|
* 查询积分商品订单列表
|
|
|
*/
|
|
|
@@ -98,18 +102,33 @@ public class FsIntegralOrderController extends BaseController
|
|
|
@GetMapping(value = "/getExpress/{id}")
|
|
|
public R getExpress(@PathVariable("id") Long id)
|
|
|
{
|
|
|
+ /**
|
|
|
+ * selectFsIntegralOrderByOrderId查询的数据表:fs_integral_order
|
|
|
+ * 需要执行添加字段的DDL语句
|
|
|
+ * ALTER TABLE `fs_integral_order`
|
|
|
+ * ADD COLUMN `login_account` VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '代服物流查询账号';
|
|
|
+ * */
|
|
|
FsIntegralOrder fsIntegralOrder = fsIntegralOrderService.selectFsIntegralOrderByOrderId(id);
|
|
|
ExpressInfoDTO expressInfoDTO=null;
|
|
|
- if(StringUtils.isNotEmpty(fsIntegralOrder.getDeliverySn())){
|
|
|
- String lastFourNumber = "";
|
|
|
- if (fsIntegralOrder.getDeliveryCode().equals(ShipperCodeEnum.SF.getValue())) {
|
|
|
+ //代服管家 查询自己的物流
|
|
|
+ if (CloudHostUtils.hasCloudHostName("金牛明医")) {
|
|
|
+ FsStoreOrder fsStoreOrder = new FsStoreOrder();
|
|
|
+ fsStoreOrder.setOrderCode(fsIntegralOrder.getOrderCode());
|
|
|
+ //线程携带订单信息
|
|
|
+ OrderContextHolder.setIntegralOrder(fsIntegralOrder);
|
|
|
+ expressInfoDTO = fsStoreOrderService.getDfExpressInfoDTO(fsStoreOrder);
|
|
|
+ }else {
|
|
|
+ if (StringUtils.isNotEmpty(fsIntegralOrder.getDeliverySn())) {
|
|
|
+ String lastFourNumber = "";
|
|
|
+ if (fsIntegralOrder.getDeliveryCode().equals(ShipperCodeEnum.SF.getValue())) {
|
|
|
|
|
|
- lastFourNumber = fsIntegralOrder.getUserPhone();
|
|
|
- if (lastFourNumber.length() == 11) {
|
|
|
- lastFourNumber = StrUtil.sub(lastFourNumber, lastFourNumber.length(), -4);
|
|
|
+ lastFourNumber = fsIntegralOrder.getUserPhone();
|
|
|
+ if (lastFourNumber.length() == 11) {
|
|
|
+ lastFourNumber = StrUtil.sub(lastFourNumber, lastFourNumber.length(), -4);
|
|
|
+ }
|
|
|
}
|
|
|
+ expressInfoDTO = expressService.getExpressInfo(fsIntegralOrder.getOrderCode(), fsIntegralOrder.getDeliveryCode(), fsIntegralOrder.getDeliverySn(), lastFourNumber);
|
|
|
}
|
|
|
- expressInfoDTO=expressService.getExpressInfo(fsIntegralOrder.getOrderCode(),fsIntegralOrder.getDeliveryCode(),fsIntegralOrder.getDeliverySn(),lastFourNumber);
|
|
|
}
|
|
|
return R.ok().put("data",expressInfoDTO);
|
|
|
}
|
|
|
@@ -178,4 +197,25 @@ public class FsIntegralOrderController extends BaseController
|
|
|
String orderCode = requestBody.get("orderCode");
|
|
|
return toAjax(fsIntegralOrderService.cancelOrder(orderCode));
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 申请退款
|
|
|
+ * 接口不校验是否发货
|
|
|
+ * */
|
|
|
+ @PreAuthorize("@ss.hasPermi('his:integralOrder:cancel')")
|
|
|
+ @Log(title = "积分商品订单", businessType = BusinessType.UPDATE)
|
|
|
+ @PostMapping("/mandatoryRefunds")
|
|
|
+ public AjaxResult mandatoryRefunds(@RequestBody Map<String, String> requestBody){
|
|
|
+ String orderCode = requestBody.get("orderCode");
|
|
|
+ return toAjax(fsIntegralOrderService.mandatoryRefunds(orderCode));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 确认收货
|
|
|
+ * todo:权限标识符待定
|
|
|
+ */
|
|
|
+ @Log(title = "积分商品订单", businessType = BusinessType.UPDATE)
|
|
|
+ @GetMapping("/finishOrder/{orderCode}")
|
|
|
+ public AjaxResult finishOrder(@PathVariable("orderCode") String orderCode) {
|
|
|
+ return toAjax(fsIntegralOrderService.finishOrder(orderCode));
|
|
|
+ }
|
|
|
}
|