Your Name лет назад: 3
Родитель
Сommit
8a2eecea6f

+ 0 - 91
service-api/src/main/java/com/java110/api/controller/FlowController.java

@@ -1,91 +0,0 @@
-/*
- * Copyright 2017-2020 吴学文 and java110 team.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.java110.api.controller;
-
-import com.java110.api.smo.privilege.IPrivilegeSMO;
-import com.java110.core.base.controller.BaseController;
-import com.java110.core.context.IPageData;
-import com.java110.utils.constant.CommonConstant;
-import com.java110.utils.util.Assert;
-import org.slf4j.Logger;
-import com.java110.core.log.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.client.RestTemplate;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.Date;
-
-/**
- * 流程控制类
- */
-@Controller
-public class FlowController extends BaseController {
-    private static Logger logger = LoggerFactory.getLogger(FlowController.class);
-    @Autowired
-    private RestTemplate restTemplate;
-
-    @Autowired
-    private IPrivilegeSMO privilegeSMOImpl;
-
-    /**
-     * 流程处理方法
-     *
-     * @param flowCode 流程编码
-     * @param request  请求对象
-     * @return 页面名称
-     */
-    @RequestMapping(path = "/flow/{flowCode}")
-    public String flow(@PathVariable String flowCode,
-                       HttpServletRequest request) {
-        logger.debug("请求流程 {},{}", flowCode, new Date());
-        try {
-            System.out.println("开始寻找组件数据");
-            IPageData pd = (IPageData) request.getAttribute(CommonConstant.CONTEXT_PAGE_DATA);
-            System.out.println("数据获取成功");
-            //权限校验
-            privilegeSMOImpl.hasPrivilege(restTemplate, pd, "/" + flowCode);
-            validateFlowData(flowCode, pd);
-
-        } catch (Throwable e) {
-            flowCode = "error";
-        }
-        System.out.println("传入的路径为  " + flowCode);
-
-        return flowCode;
-    }
-
-
-    /**
-     * 流程数据校验方法
-     *
-     * @throws RuntimeException
-     */
-    private void validateFlowData(String flowCode, IPageData pd) throws RuntimeException {
-
-        Assert.hasLength(flowCode, "参数错误,未传入流程编码");
-    }
-
-    public RestTemplate getRestTemplate() {
-        return restTemplate;
-    }
-
-    public void setRestTemplate(RestTemplate restTemplate) {
-        this.restTemplate = restTemplate;
-    }
-}

+ 116 - 0
service-community/src/main/java/com/java110/community/cmd/ownerRepair/ListFinishRepairsByStaffCmd.java

@@ -0,0 +1,116 @@
+package com.java110.community.cmd.ownerRepair;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.core.factory.CommunitySettingFactory;
+import com.java110.doc.annotation.*;
+import com.java110.dto.basePrivilege.BasePrivilegeDto;
+import com.java110.dto.repair.RepairDto;
+import com.java110.intf.community.IMenuInnerServiceSMO;
+import com.java110.intf.community.IRepairInnerServiceSMO;
+import com.java110.intf.community.IRepairUserInnerServiceSMO;
+import com.java110.utils.cache.MappingCache;
+import com.java110.utils.constant.MappingConstant;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.utils.util.StringUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+@Java110CmdDoc(title = "员工已办维修单",
+        description = "查询员工已办维修单",
+        httpMethod = "get",
+        url = "http://{ip}:{port}/app/ownerRepair.listFinishRepairsByStaff",
+        resource = "communityDoc",
+        author = "吴学文",
+        serviceCode = "ownerRepair.listFinishRepairsByStaff",
+        seq = 19
+)
+
+@Java110ParamsDoc(
+        params = {
+                @Java110ParamDoc(name = "communityId", length = 30, remark = "必填,小区ID"),
+                @Java110ParamDoc(name = "staffId", length = 30, remark = "必填,员工ID"),
+        })
+
+@Java110ResponseDoc(
+        params = {
+                @Java110ParamDoc(name = "code", type = "int", length = 11, defaultValue = "0", remark = "返回编号,0 成功 其他失败"),
+                @Java110ParamDoc(name = "msg", type = "String", length = 250, defaultValue = "成功", remark = "描述"),
+                @Java110ParamDoc(name = "data", type = "Array", remark = "有效数据"),
+                @Java110ParamDoc(parentNodeName = "data",name = "appointmentTime", type = "String", remark = "预约时间"),
+                @Java110ParamDoc(parentNodeName = "data",name = "repairName", type = "String", remark = "报修名称"),
+                @Java110ParamDoc(parentNodeName = "data",name = "repairId", type = "String", remark = "工单ID"),
+                @Java110ParamDoc(parentNodeName = "data",name = "context", type = "String", remark = "报修内容"),
+        }
+)
+
+@Java110ExampleDoc(
+        reqBody="{'username':'wuxw','passwd':'admin'}",
+        resBody="{\"code\":0,\"data\":[{\"appointmentTime\":\"2023-02-18 23:34:23\",\"bId\":\"202023021803780003\"," +
+                "\"communityId\":\"2023013154290059\",\"context\":\"飞蛾打印机报修单测试\",\"page\":-1,\"preRuId\":\"832023021884560007\"," +
+                "\"preStaffId\":\"302023013185270087\",\"preStaffName\":\"0131演示物业\",\"publicArea\":\"T\",\"records\":0,\"repairChannel\":\"T\"," +
+                "\"repairId\":\"822023021809940002\",\"repairName\":\"飞蛾打印机报修单测试\",\"repairObjId\":\"2023013154290059\"," +
+                "\"repairObjName\":\"0131培训小区\",\"repairObjType\":\"001\",\"repairType\":\"102023020172340620\",\"repairTypeName\":\"水电报修\"," +
+                "\"repairWay\":\"200\",\"returnVisitFlag\":\"001\",\"returnVisitFlagName\":\"都不回访\",\"row\":0,\"ruId\":\"832023021876140009\"," +
+                "\"startRuId\":\"832023021897810004\",\"state\":\"1100\",\"stateName\":\"接单\",\"statusCd\":\"0\",\"tel\":\"18909714455\"," +
+                "\"total\":0}],\"msg\":\"成功\",\"page\":0,\"records\":1,\"rows\":0,\"total\":1}"
+)
+@Java110Cmd(serviceCode = "ownerRepair.listFinishRepairsByStaff")
+public class ListFinishRepairsByStaffCmd extends Cmd {
+
+    @Autowired
+    private IRepairInnerServiceSMO repairInnerServiceSMOImpl;
+
+    @Autowired
+    private IRepairUserInnerServiceSMO repairUserInnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+        super.validatePageInfo(reqJson);
+        Assert.hasKeyAndValue(reqJson, "communityId", "请求中未包含小区ID");
+        Assert.hasKeyAndValue(reqJson, "staffId", "请求中未包含员工信息");
+    }
+
+    /**
+     * 报修已办
+     * @param event              事件对象
+     * @param context 数据上文对象
+     * @param reqJson            请求报文
+     * @throws CmdException
+     * @throws ParseException
+     */
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
+        RepairDto ownerRepairDto = BeanConvertUtil.covertBean(reqJson, RepairDto.class);
+        if (reqJson.containsKey("repairStates")) {
+            String[] states = reqJson.getString("repairStates").split(",");
+            ownerRepairDto.setStates(Arrays.asList(states));
+        } else {
+            //Pc WEB维修已办
+            String[] states={RepairDto.STATE_BACK, RepairDto.STATE_TRANSFER,RepairDto.STATE_PAY, RepairDto.STATE_PAY_ERROR, RepairDto.STATE_APPRAISE, RepairDto.STATE_RETURN_VISIT, RepairDto.STATE_COMPLATE};
+            ownerRepairDto.setStates(Arrays.asList(states));
+        }
+        int count = repairInnerServiceSMOImpl.queryStaffFinishRepairsCount(ownerRepairDto);
+        List<RepairDto> ownerRepairs = null;
+        if (count > 0) {
+            ownerRepairs = repairInnerServiceSMOImpl.queryStaffFinishRepairs(ownerRepairDto);
+            //refreshStaffName(ownerRepairs);
+        } else {
+            ownerRepairs = new ArrayList<>();
+        }
+        ResponseEntity<String> responseEntity = ResultVo.createResponseEntity((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, ownerRepairs);
+        context.setResponseEntity(responseEntity);
+    }
+}

+ 101 - 0
service-community/src/main/java/com/java110/community/cmd/ownerRepair/ListUndoRepairsByStaffCmd.java

@@ -0,0 +1,101 @@
+package com.java110.community.cmd.ownerRepair;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.doc.annotation.*;
+import com.java110.dto.repair.RepairDto;
+import com.java110.intf.community.IRepairInnerServiceSMO;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 查询员工待办 维修工单
+ */
+
+@Java110CmdDoc(title = "员工待办维修单",
+        description = "查询员工待办维修单",
+        httpMethod = "get",
+        url = "http://{ip}:{port}/app/ownerRepair.listUndoRepairsByStaff",
+        resource = "communityDoc",
+        author = "吴学文",
+        serviceCode = "ownerRepair.listUndoRepairsByStaff",
+        seq = 17
+)
+
+@Java110ParamsDoc(
+        params = {
+                @Java110ParamDoc(name = "communityId", length = 30, remark = "必填,小区ID"),
+                @Java110ParamDoc(name = "staffId", length = 30, remark = "必填,员工ID"),
+        })
+
+@Java110ResponseDoc(
+        params = {
+                @Java110ParamDoc(name = "code", type = "int", length = 11, defaultValue = "0", remark = "返回编号,0 成功 其他失败"),
+                @Java110ParamDoc(name = "msg", type = "String", length = 250, defaultValue = "成功", remark = "描述"),
+                @Java110ParamDoc(name = "data", type = "Array", remark = "有效数据"),
+                @Java110ParamDoc(parentNodeName = "data",name = "appointmentTime", type = "String", remark = "预约时间"),
+                @Java110ParamDoc(parentNodeName = "data",name = "repairName", type = "String", remark = "报修名称"),
+                @Java110ParamDoc(parentNodeName = "data",name = "repairId", type = "String", remark = "工单ID"),
+                @Java110ParamDoc(parentNodeName = "data",name = "context", type = "String", remark = "报修内容"),
+        }
+)
+
+@Java110ExampleDoc(
+        reqBody="{'username':'wuxw','passwd':'admin'}",
+        resBody="{\"code\":0,\"data\":[{\"appointmentTime\":\"2023-02-18 23:34:23\",\"bId\":\"202023021803780003\"," +
+                "\"communityId\":\"2023013154290059\",\"context\":\"飞蛾打印机报修单测试\",\"page\":-1,\"preRuId\":\"832023021884560007\"," +
+                "\"preStaffId\":\"302023013185270087\",\"preStaffName\":\"0131演示物业\",\"publicArea\":\"T\",\"records\":0,\"repairChannel\":\"T\"," +
+                "\"repairId\":\"822023021809940002\",\"repairName\":\"飞蛾打印机报修单测试\",\"repairObjId\":\"2023013154290059\"," +
+                "\"repairObjName\":\"0131培训小区\",\"repairObjType\":\"001\",\"repairType\":\"102023020172340620\",\"repairTypeName\":\"水电报修\"," +
+                "\"repairWay\":\"200\",\"returnVisitFlag\":\"001\",\"returnVisitFlagName\":\"都不回访\",\"row\":0,\"ruId\":\"832023021876140009\"," +
+                "\"startRuId\":\"832023021897810004\",\"state\":\"1100\",\"stateName\":\"接单\",\"statusCd\":\"0\",\"tel\":\"18909714455\"," +
+                "\"total\":0}],\"msg\":\"成功\",\"page\":0,\"records\":1,\"rows\":0,\"total\":1}"
+)
+@Java110Cmd(serviceCode = "ownerRepair.listUndoRepairsByStaff")
+public class ListUndoRepairsByStaffCmd extends Cmd {
+
+    @Autowired
+    private IRepairInnerServiceSMO repairInnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+        super.validatePageInfo(reqJson);
+        Assert.hasKeyAndValue(reqJson, "communityId", "请求中未包含小区ID");
+        Assert.hasKeyAndValue(reqJson, "staffId", "请求中未包含员工信息");
+    }
+
+    /**
+     * 报修待办
+     *
+     * @param event   事件对象
+     * @param context 数据上文对象
+     * @param reqJson 请求报文
+     * @throws CmdException
+     * @throws ParseException
+     */
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
+        RepairDto ownerRepairDto = BeanConvertUtil.covertBean(reqJson, RepairDto.class);
+        //获取用户id
+        int count = repairInnerServiceSMOImpl.queryStaffRepairsCount(ownerRepairDto);
+        List<RepairDto> ownerRepairs = null;
+        if (count > 0) {
+            ownerRepairs = repairInnerServiceSMOImpl.queryStaffRepairs(ownerRepairDto);
+        } else {
+            ownerRepairs = new ArrayList<>();
+        }
+        ResponseEntity<String> responseEntity = ResultVo.createResponseEntity((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, ownerRepairs);
+        context.setResponseEntity(responseEntity);
+    }
+}