|
@@ -13,6 +13,7 @@ import com.gree.mall.manager.bean.member.UserCompanyAttrBean;
|
|
|
import com.gree.mall.manager.bean.member.UserCompanyDeliveryBean;
|
|
import com.gree.mall.manager.bean.member.UserCompanyDeliveryBean;
|
|
|
import com.gree.mall.manager.bean.user.UserApplyWorkerBean;
|
|
import com.gree.mall.manager.bean.user.UserApplyWorkerBean;
|
|
|
import com.gree.mall.manager.bean.user.UserWxBean;
|
|
import com.gree.mall.manager.bean.user.UserWxBean;
|
|
|
|
|
+import com.gree.mall.manager.constant.Constant;
|
|
|
import com.gree.mall.manager.enums.ExamineStatusEnum;
|
|
import com.gree.mall.manager.enums.ExamineStatusEnum;
|
|
|
import com.gree.mall.manager.exception.RemoteServiceException;
|
|
import com.gree.mall.manager.exception.RemoteServiceException;
|
|
|
import com.gree.mall.manager.helper.ResponseHelper;
|
|
import com.gree.mall.manager.helper.ResponseHelper;
|
|
@@ -29,13 +30,17 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.integration.redis.util.RedisLockRegistry;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
|
|
+import java.util.concurrent.locks.Lock;
|
|
|
|
|
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
@RestController
|
|
@RestController
|
|
@@ -47,6 +52,8 @@ public class MemberController {
|
|
|
UserLogic userLogic;
|
|
UserLogic userLogic;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
GoodsLogic goodsLogic;
|
|
GoodsLogic goodsLogic;
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ RedisLockRegistry redisLockRegistry;
|
|
|
|
|
|
|
|
@ZfireList
|
|
@ZfireList
|
|
|
@PostMapping("/list/customer")
|
|
@PostMapping("/list/customer")
|
|
@@ -331,15 +338,35 @@ public class MemberController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PostMapping("/company/delivery/import")
|
|
@PostMapping("/company/delivery/import")
|
|
|
- @ApiOperation(value = "配送员师傅-导入(模板名称:配送员师傅导入.xlsx)")
|
|
|
|
|
|
|
+ @ApiOperation(value = "作废 配送员师傅-导入(模板名称:配送员师傅导入.xlsx)")
|
|
|
public ResponseHelper companyDeliveryImport(
|
|
public ResponseHelper companyDeliveryImport(
|
|
|
@RequestParam MultipartFile file
|
|
@RequestParam MultipartFile file
|
|
|
) throws RemoteServiceException, IOException {
|
|
) throws RemoteServiceException, IOException {
|
|
|
- List<Object> objects = ExcelUtils.importExcel(file);
|
|
|
|
|
- userLogic.companyDeliveryImport(objects);
|
|
|
|
|
|
|
+// List<Object> objects = ExcelUtils.importExcel(file);
|
|
|
|
|
+// userLogic.companyDeliveryImport(objects);
|
|
|
|
|
+
|
|
|
return ResponseHelper.success();
|
|
return ResponseHelper.success();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @PostMapping("/company/delivery/add")
|
|
|
|
|
+ @ApiOperation(value = "商户配送员添加")
|
|
|
|
|
+ public ResponseHelper companyDeliveryAdd(
|
|
|
|
|
+ @ApiParam(value = "用户id", required = true) @RequestParam String mobile,
|
|
|
|
|
+ @ApiParam(value = "昵称", required = true) @RequestParam String nickName,
|
|
|
|
|
+ @ApiParam(value = "仓储id", required = true) @RequestParam String storageId
|
|
|
|
|
+ ) throws Exception {
|
|
|
|
|
+ Lock obtain = redisLockRegistry.obtain(Constant.RedisPrefix.LOCK_COMMON + mobile);
|
|
|
|
|
+ if(!obtain.tryLock(10, TimeUnit.SECONDS)){
|
|
|
|
|
+ return ResponseHelper.error("系统繁忙,请稍后再试");
|
|
|
|
|
+ }
|
|
|
|
|
+ try {
|
|
|
|
|
+ userLogic.companyDeliveryAdd(mobile, nickName, storageId);
|
|
|
|
|
+ return ResponseHelper.success();
|
|
|
|
|
+ }finally {
|
|
|
|
|
+ obtain.unlock();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@PostMapping("/company/delivery/del")
|
|
@PostMapping("/company/delivery/del")
|
|
|
@ApiOperation(value = "商户配送员删除")
|
|
@ApiOperation(value = "商户配送员删除")
|
|
|
public ResponseHelper companyDeliveryDel(
|
|
public ResponseHelper companyDeliveryDel(
|