‘linchangsheng’ 6 月之前
父節點
當前提交
efa4c4a42f

+ 13 - 8
mall-server-api/src/main/java/com/gree/mall/manager/bean/listvo/UserVO.java

@@ -2,7 +2,9 @@ package com.gree.mall.manager.bean.listvo;
 
 import com.gree.mall.manager.annotation.ZfireField;
 import com.gree.mall.manager.enums.ExamineStatusEnum;
+import com.gree.mall.manager.enums.ExamineWorkerStatusEnum;
 import com.gree.mall.manager.enums.UserTypeEnum;
+import com.gree.mall.manager.plus.entity.User;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -12,7 +14,7 @@ import java.util.Date;
 @ZfireField(tbName = "a")
 @ApiModel
 @Data
-public class UserVO {
+public class UserVO   {
 
     @ZfireField(hide = true, tbName = "b")
     private String id;
@@ -20,11 +22,11 @@ public class UserVO {
     @ZfireField(hide = true)
     private String userId;
 
-//    @ZfireField(hide = true)
-//    private String companyWechatId;
-//
-//    @ApiModelProperty("商户名称")
-//    private String companyName;
+    @ApiModelProperty("所属公司编号")
+    private String companyWechatId;
+
+    @ApiModelProperty("所属公司编号")
+    private String companyName;
 
     @ZfireField(tbName = "b")
     @ApiModelProperty("网点编号")
@@ -61,8 +63,8 @@ public class UserVO {
     private UserTypeEnum type;
 
     @ZfireField(tbName = "b")
-    @ApiModelProperty("审核状态")
-    private ExamineStatusEnum examineStatus;
+    @ApiModelProperty("状态")
+    private ExamineWorkerStatusEnum examineStatus;
 
     @ZfireField(tbName = "b")
     @ApiModelProperty("审批人")
@@ -72,6 +74,9 @@ public class UserVO {
     @ApiModelProperty("审批时间")
     private Date examineTime;
 
+    @ApiModelProperty(value = "过期提醒")
+    private String overdueRemark;
+
     @ZfireField(tbName = "b")
     @ApiModelProperty("银行卡")
     private String bankAccount;

+ 125 - 0
mall-server-api/src/main/java/com/gree/mall/manager/controller/member/WorkerManagerController.java

@@ -0,0 +1,125 @@
+package com.gree.mall.manager.controller.member;
+
+import cn.hutool.core.lang.TypeReference;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gree.mall.manager.annotation.ZfireList;
+import com.gree.mall.manager.bean.listvo.User2VO;
+import com.gree.mall.manager.bean.listvo.UserCustomerVO;
+import com.gree.mall.manager.bean.listvo.UserVO;
+import com.gree.mall.manager.bean.listvo.workorder.UserWaitVO;
+import com.gree.mall.manager.bean.member.UserApplyBean;
+import com.gree.mall.manager.bean.policy.PolicyDetail;
+import com.gree.mall.manager.bean.user.UserApplyWorkerBean;
+import com.gree.mall.manager.bean.user.UserWxBean;
+import com.gree.mall.manager.enums.ExamineStatusEnum;
+import com.gree.mall.manager.exception.RemoteServiceException;
+import com.gree.mall.manager.helper.ResponseHelper;
+import com.gree.mall.manager.logic.goods.GoodsLogic;
+import com.gree.mall.manager.logic.policy.WorkerManagerLogic;
+import com.gree.mall.manager.logic.user.UserLogic;
+import com.gree.mall.manager.plus.entity.*;
+import com.gree.mall.manager.utils.CommonUtils;
+import com.gree.mall.manager.utils.excel.ExcelUtils;
+import com.gree.mall.manager.zfire.bean.WorkerParamBean;
+import com.gree.mall.manager.zfire.bean.ZfireParamBean;
+import com.gree.mall.manager.zfire.util.FieldUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.common.error.WxErrorException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.text.ParseException;
+import java.util.List;
+
+@Slf4j
+@RestController
+@Api(value = "师傅管理API", tags = {"师傅管理API"})
+@RequestMapping(value = "/workerManager", produces = "application/json; charset=utf-8")
+public class WorkerManagerController {
+
+    @Autowired
+    UserLogic userLogic;
+
+    @Autowired
+    WorkerManagerLogic workerManagerLogic;
+
+
+    @ZfireList
+    @PostMapping("/list/page2")
+    @ApiOperation(value = "师傅列表-v2")
+    public ResponseHelper<Page<UserVO>> page1(
+            @RequestBody WorkerParamBean zfireParamBean
+    ) throws RemoteServiceException {
+        IPage<UserVO> page = userLogic.page2(zfireParamBean);
+        return ResponseHelper.success(page, new TypeReference<UserVO>() {
+        });
+    }
+
+    @PostMapping("/list/page2/export")
+    @ApiOperation(value = "师傅列表-导出-v2")
+    public void page1Export(
+            @RequestBody WorkerParamBean zfireParamBean,
+            HttpServletRequest request,
+            HttpServletResponse response
+    ) throws Exception {
+        //2.查询要导出的内容
+        IPage<UserVO> page = userLogic.page2(zfireParamBean);
+        //3.导出
+        FieldUtils.exportData(page.getRecords(), zfireParamBean.getExportFields(), request, response);
+    }
+
+
+    @PostMapping("/stop")
+    @ApiOperation("暂停接单")
+    public ResponseHelper stop(
+            @ApiParam(value = "id", required = true) @RequestParam String id,
+            HttpServletRequest request
+    ) throws ParseException {
+        workerManagerLogic.stop(id);
+        return ResponseHelper.success();
+    }
+
+
+    @PostMapping("/activation")
+    @ApiOperation("激活账号")
+    public ResponseHelper activation(
+            @ApiParam(value = "id", required = true) @RequestParam String id,
+            HttpServletRequest request
+    ) throws ParseException {
+        workerManagerLogic.activation(id);
+        return ResponseHelper.success();
+    }
+
+
+    @PostMapping("/quit")
+    @ApiOperation("离职")
+    public ResponseHelper quit(
+            @ApiParam(value = "id", required = true) @RequestParam String id,
+            HttpServletRequest request
+    ) throws ParseException {
+        workerManagerLogic.quit(id);
+        return ResponseHelper.success();
+    }
+
+
+    @PostMapping("/againQuit")
+    @ApiOperation("重新入职")
+    public ResponseHelper againQuit(
+            @ApiParam(value = "id", required = true) @RequestParam String id,
+            HttpServletRequest request
+    ) throws ParseException {
+        workerManagerLogic.againQuit(id);
+        return ResponseHelper.success();
+    }
+
+
+
+}

+ 1 - 1
mall-server-api/src/main/java/com/gree/mall/manager/controller/policy/PolicyOrderController.java

@@ -97,7 +97,7 @@ public class PolicyOrderController {
         return ResponseHelper.success(policyDetail);
     }
 
-    @PostMapping("/add")
+    @PostMapping("/update")
     @ApiOperation("保险订单修改")
     public ResponseHelper add(
             @RequestBody PolicyOrder policyOrder,

+ 23 - 0
mall-server-api/src/main/java/com/gree/mall/manager/enums/ExamineWorkerStatusEnum.java

@@ -0,0 +1,23 @@
+package com.gree.mall.manager.enums;
+
+import com.gree.mall.manager.enums.base.BaseEnum;
+import lombok.Getter;
+
+@Getter
+public enum ExamineWorkerStatusEnum implements BaseEnum {
+    WAIT_WORKER("WAIT_WORKER","待师傅购买"),
+    POLICY_WAIT("POLICY_WAIT","保险待审核"),
+    WAIT("WAIT","入驻待审核"),
+    FAIL("FAIL","驳回"),
+    EXPIRED("EXPIRED","证件快过期"),
+    OVERDUE("OVERDUE","证件已过期"),
+    QUIT("QUIT","已离职"),
+    STOP("STOP","已暂停"),
+    OK("OK","审核通过");
+
+    ExamineWorkerStatusEnum(String key,String remark) {
+        this.key=key;this.remark = remark;
+    }
+    private String key;
+    private String remark;
+}

+ 87 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/policy/WorkerManagerLogic.java

@@ -0,0 +1,87 @@
+package com.gree.mall.manager.logic.policy;
+
+import cn.hutool.db.sql.Order;
+import com.gree.mall.manager.enums.ExamineWorkerStatusEnum;
+import com.gree.mall.manager.enums.OrderStatusEnum;
+import com.gree.mall.manager.enums.workorder.OrderBaseStatusEnum;
+import com.gree.mall.manager.exception.RemoteServiceException;
+import com.gree.mall.manager.plus.entity.PgOrderBase;
+import com.gree.mall.manager.plus.entity.WebsitUser;
+import com.gree.mall.manager.plus.service.PgOrderBaseService;
+import com.gree.mall.manager.plus.service.WebsitUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class WorkerManagerLogic {
+
+    @Autowired
+    WebsitUserService websitUserService;
+
+    @Autowired
+    PgOrderBaseService pgOrderBaseService;
+
+
+    public void stop(String id) {
+
+        WebsitUser websitUserBean = websitUserService.getById(id);
+        if (!websitUserBean.getExamineStatus().equals(ExamineWorkerStatusEnum.OK.getKey()))
+            throw new RemoteServiceException("师傅不处于审核通过");
+
+        WebsitUser websitUser = new WebsitUser();
+        websitUser.setId(id);
+        websitUser.setExamineStatus(ExamineWorkerStatusEnum.STOP.getKey());
+        websitUser.updateById();
+    }
+
+    public void activation(String id) {
+
+        WebsitUser websitUserBean = websitUserService.getById(id);
+        if (!websitUserBean.getExamineStatus().equals(ExamineWorkerStatusEnum.STOP.getKey()))
+            throw new RemoteServiceException("师傅不处于暂停状态");
+
+        WebsitUser websitUser = new WebsitUser();
+        websitUser.setId(id);
+        websitUser.setExamineStatus(ExamineWorkerStatusEnum.POLICY_WAIT.getKey());
+        websitUser.updateById();
+    }
+
+    public void quit(String id) {
+
+        WebsitUser websitUserBean = websitUserService.getById(id);
+        if (!websitUserBean.getExamineStatus().equals(ExamineWorkerStatusEnum.OK.getKey()))
+            throw new RemoteServiceException("师傅不处于审核通过");
+
+
+        if (pgOrderBaseService.lambdaQuery()
+                .and(item -> item.eq(PgOrderBase::getWorkerId,websitUserBean.getUserId()).or().like(PgOrderBase::getWorkerIdList,websitUserBean.getUserId()))
+                .eq(PgOrderBase::getWebsitId,websitUserBean.getWebsitId())
+                .notIn(PgOrderBase::getOrderStatus, OrderBaseStatusEnum.YQX.getKey(),OrderBaseStatusEnum.YJS.getKey(),
+                        OrderBaseStatusEnum.YWG.getKey(),OrderBaseStatusEnum.FWQX.getKey(),OrderBaseStatusEnum.YWGO.getKey(),
+                        OrderBaseStatusEnum.YGBGD.getKey(),OrderBaseStatusEnum.FGFZF.getKey(),OrderBaseStatusEnum.YZFGD.getKey(),
+                        OrderBaseStatusEnum.FZXBWG.getKey(),OrderBaseStatusEnum.FBBWG.getKey(),OrderBaseStatusEnum.LSXX.getKey(),
+                        OrderBaseStatusEnum.PLGB.getKey(),OrderBaseStatusEnum.ZCGB.getKey()
+                        ).count() > 1) {
+
+            throw new RemoteServiceException("师傅存在未完工工单,请改派后再离职");
+        }
+
+
+        WebsitUser websitUser = new WebsitUser();
+        websitUser.setId(id);
+        websitUser.setExamineStatus(ExamineWorkerStatusEnum.QUIT.getKey());
+        websitUser.updateById();
+    }
+
+    public void againQuit(String id) {
+
+        WebsitUser websitUserBean = websitUserService.getById(id);
+        if (!websitUserBean.getExamineStatus().equals(ExamineWorkerStatusEnum.QUIT.getKey()))
+            throw new RemoteServiceException("师傅不处于离职状态");
+
+        WebsitUser websitUser = new WebsitUser();
+        websitUser.setId(id);
+        websitUser.setExamineStatus(ExamineWorkerStatusEnum.POLICY_WAIT.getKey());
+        websitUser.updateById();
+    }
+}

+ 41 - 1
mall-server-api/src/main/java/com/gree/mall/manager/logic/unicom/UnicomLogic.java

@@ -155,7 +155,47 @@ public class UnicomLogic {
         callSendRecord.insert();
 
         if(!s.equals("200")){
-            throw new RemoteServiceException("拨打云呼失败错误码【"+s+"】");
+            if (s.equals("301"))
+                throw new RemoteServiceException("拨打云呼失败错误码【"+s+"】,参数缺失");
+
+            if (s.equals("303"))
+                throw new RemoteServiceException("拨打云呼失败错误码【"+s+"】,电话错误");
+
+            if (s.equals("309"))
+                throw new RemoteServiceException("拨打云呼失败错误码【"+s+"】,token过期");
+
+            if (s.equals("401"))
+                throw new RemoteServiceException("拨打云呼失败错误码【"+s+"】,账户不存在");
+
+            if (s.equals("402"))
+                throw new RemoteServiceException("拨打云呼失败错误码【"+s+"】,参数错误");
+
+            if (s.equals("404"))
+                throw new RemoteServiceException("拨打云呼失败错误码【"+s+"】,登录号错误");
+
+            if (s.equals("405"))
+                throw new RemoteServiceException("拨打云呼失败错误码【"+s+"】,key不存在");
+
+            if (s.equals("407"))
+                throw new RemoteServiceException("拨打云呼失败错误码【"+s+"】,坐席未登录");
+
+
+            if (s.equals("408"))
+                throw new RemoteServiceException("拨打云呼失败错误码【"+s+"】,坐席忙碌");
+
+            if (s.equals("409"))
+                throw new RemoteServiceException("拨打云呼失败错误码【"+s+"】,时间错误");
+
+
+            if (s.equals("410"))
+                throw new RemoteServiceException("拨打云呼失败错误码【"+s+"】,外呼防骚扰上限,号码为限制外呼好卖");
+
+            if (s.equals("412"))
+                throw new RemoteServiceException("拨打云呼失败错误码【"+s+"】,坐席没有绑定sip号");
+
+            if (s.equals("603"))
+                throw new RemoteServiceException("拨打云呼失败错误码【"+s+"】,flag参数错误");
+
         }
     }