Ver código fonte

优化 编译报错问题

java110 4 anos atrás
pai
commit
eb46e85a93

+ 9 - 0
java110-bean/src/main/java/com/java110/po/inspection/InspectionTaskPo.java

@@ -30,6 +30,7 @@ public class InspectionTaskPo implements Serializable {
     private String taskType;
 
     private String state;
+    private String statusCd;
 
     public String getTaskId() {
         return taskId;
@@ -166,4 +167,12 @@ public class InspectionTaskPo implements Serializable {
     public void setTaskType(String taskType) {
         this.taskType = taskType;
     }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
 }

+ 208 - 0
java110-db/src/main/resources/mapper/community/InspectionTaskV1ServiceDaoImplMapper.xml

@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="inspectionTaskV1ServiceDaoImpl">
+
+
+    <!-- 保存巡检任务信息 add by wuxw 2018-07-03 -->
+    <insert id="saveInspectionTaskInfo" parameterType="Map">
+        insert into inspection_task(
+        plan_user_id,act_ins_time,plan_ins_time,original_plan_user_name,ip_staff_id,transfer_desc,act_user_name,original_plan_user_id,task_type,sign_type,plan_end_time,inspection_plan_id,plan_user_name,community_id,act_user_id,task_id
+        ) values (
+        #{planUserId},#{actInsTime},#{planInsTime},#{originalPlanUserName},#{ipStaffId},#{transferDesc},#{actUserName},#{originalPlanUserId},#{taskType},#{signType},#{planEndTime},#{inspectionPlanId},#{planUserName},#{communityId},#{actUserId},#{taskId}
+        )
+    </insert>
+
+
+    <!-- 查询巡检任务信息 add by wuxw 2018-07-03 -->
+    <select id="getInspectionTaskInfo" parameterType="Map" resultType="Map">
+        select t.plan_user_id,t.plan_user_id planUserId,t.act_ins_time,t.act_ins_time
+        actInsTime,t.plan_ins_time,t.plan_ins_time planInsTime,t.original_plan_user_name,t.original_plan_user_name
+        originalPlanUserName,t.ip_staff_id,t.ip_staff_id ipStaffId,t.transfer_desc,t.transfer_desc
+        transferDesc,t.status_cd,t.status_cd statusCd,t.act_user_name,t.act_user_name
+        actUserName,t.original_plan_user_id,t.original_plan_user_id originalPlanUserId,t.task_type,t.task_type
+        taskType,t.sign_type,t.sign_type signType,t.plan_end_time,t.plan_end_time
+        planEndTime,t.inspection_plan_id,t.inspection_plan_id inspectionPlanId,t.plan_user_name,t.plan_user_name
+        planUserName,t.community_id,t.community_id communityId,t.act_user_id,t.act_user_id actUserId,t.task_id,t.task_id
+        taskId
+        from inspection_task t
+        where 1 =1
+        <if test="planUserId !=null and planUserId != ''">
+            and t.plan_user_id= #{planUserId}
+        </if>
+        <if test="actInsTime !=null and actInsTime != ''">
+            and t.act_ins_time= #{actInsTime}
+        </if>
+        <if test="planInsTime !=null and planInsTime != ''">
+            and t.plan_ins_time= #{planInsTime}
+        </if>
+        <if test="originalPlanUserName !=null and originalPlanUserName != ''">
+            and t.original_plan_user_name= #{originalPlanUserName}
+        </if>
+        <if test="ipStaffId !=null and ipStaffId != ''">
+            and t.ip_staff_id= #{ipStaffId}
+        </if>
+        <if test="transferDesc !=null and transferDesc != ''">
+            and t.transfer_desc= #{transferDesc}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="actUserName !=null and actUserName != ''">
+            and t.act_user_name= #{actUserName}
+        </if>
+        <if test="originalPlanUserId !=null and originalPlanUserId != ''">
+            and t.original_plan_user_id= #{originalPlanUserId}
+        </if>
+        <if test="taskType !=null and taskType != ''">
+            and t.task_type= #{taskType}
+        </if>
+        <if test="signType !=null and signType != ''">
+            and t.sign_type= #{signType}
+        </if>
+        <if test="planEndTime !=null and planEndTime != ''">
+            and t.plan_end_time= #{planEndTime}
+        </if>
+        <if test="inspectionPlanId !=null and inspectionPlanId != ''">
+            and t.inspection_plan_id= #{inspectionPlanId}
+        </if>
+        <if test="planUserName !=null and planUserName != ''">
+            and t.plan_user_name= #{planUserName}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="actUserId !=null and actUserId != ''">
+            and t.act_user_id= #{actUserId}
+        </if>
+        <if test="taskId !=null and taskId != ''">
+            and t.task_id= #{taskId}
+        </if>
+        order by t.create_time desc
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+
+    </select>
+
+
+    <!-- 修改巡检任务信息 add by wuxw 2018-07-03 -->
+    <update id="updateInspectionTaskInfo" parameterType="Map">
+        update inspection_task t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="planUserId !=null and planUserId != ''">
+            , t.plan_user_id= #{planUserId}
+        </if>
+        <if test="actInsTime !=null and actInsTime != ''">
+            , t.act_ins_time= #{actInsTime}
+        </if>
+        <if test="planInsTime !=null and planInsTime != ''">
+            , t.plan_ins_time= #{planInsTime}
+        </if>
+        <if test="originalPlanUserName !=null and originalPlanUserName != ''">
+            , t.original_plan_user_name= #{originalPlanUserName}
+        </if>
+        <if test="ipStaffId !=null and ipStaffId != ''">
+            , t.ip_staff_id= #{ipStaffId}
+        </if>
+        <if test="transferDesc !=null and transferDesc != ''">
+            , t.transfer_desc= #{transferDesc}
+        </if>
+        <if test="actUserName !=null and actUserName != ''">
+            , t.act_user_name= #{actUserName}
+        </if>
+        <if test="originalPlanUserId !=null and originalPlanUserId != ''">
+            , t.original_plan_user_id= #{originalPlanUserId}
+        </if>
+        <if test="taskType !=null and taskType != ''">
+            , t.task_type= #{taskType}
+        </if>
+        <if test="signType !=null and signType != ''">
+            , t.sign_type= #{signType}
+        </if>
+        <if test="planEndTime !=null and planEndTime != ''">
+            , t.plan_end_time= #{planEndTime}
+        </if>
+        <if test="inspectionPlanId !=null and inspectionPlanId != ''">
+            , t.inspection_plan_id= #{inspectionPlanId}
+        </if>
+        <if test="planUserName !=null and planUserName != ''">
+            , t.plan_user_name= #{planUserName}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            , t.community_id= #{communityId}
+        </if>
+        <if test="actUserId !=null and actUserId != ''">
+            , t.act_user_id= #{actUserId}
+        </if>
+        where 1=1
+        <if test="taskId !=null and taskId != ''">
+            and t.task_id= #{taskId}
+        </if>
+
+    </update>
+
+    <!-- 查询巡检任务数量 add by wuxw 2018-07-03 -->
+    <select id="queryInspectionTasksCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from inspection_task t
+        where 1 =1
+        <if test="planUserId !=null and planUserId != ''">
+            and t.plan_user_id= #{planUserId}
+        </if>
+        <if test="actInsTime !=null and actInsTime != ''">
+            and t.act_ins_time= #{actInsTime}
+        </if>
+        <if test="planInsTime !=null and planInsTime != ''">
+            and t.plan_ins_time= #{planInsTime}
+        </if>
+        <if test="originalPlanUserName !=null and originalPlanUserName != ''">
+            and t.original_plan_user_name= #{originalPlanUserName}
+        </if>
+        <if test="ipStaffId !=null and ipStaffId != ''">
+            and t.ip_staff_id= #{ipStaffId}
+        </if>
+        <if test="transferDesc !=null and transferDesc != ''">
+            and t.transfer_desc= #{transferDesc}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="actUserName !=null and actUserName != ''">
+            and t.act_user_name= #{actUserName}
+        </if>
+        <if test="originalPlanUserId !=null and originalPlanUserId != ''">
+            and t.original_plan_user_id= #{originalPlanUserId}
+        </if>
+        <if test="taskType !=null and taskType != ''">
+            and t.task_type= #{taskType}
+        </if>
+        <if test="signType !=null and signType != ''">
+            and t.sign_type= #{signType}
+        </if>
+        <if test="planEndTime !=null and planEndTime != ''">
+            and t.plan_end_time= #{planEndTime}
+        </if>
+        <if test="inspectionPlanId !=null and inspectionPlanId != ''">
+            and t.inspection_plan_id= #{inspectionPlanId}
+        </if>
+        <if test="planUserName !=null and planUserName != ''">
+            and t.plan_user_name= #{planUserName}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="actUserId !=null and actUserId != ''">
+            and t.act_user_id= #{actUserId}
+        </if>
+        <if test="taskId !=null and taskId != ''">
+            and t.task_id= #{taskId}
+        </if>
+
+
+    </select>
+
+</mapper>

+ 24 - 11
java110-generator/src/main/java/com/java110/code/TableToJson.java

@@ -18,20 +18,33 @@ import java.nio.charset.Charset;
 public class TableToJson {
 
     //show create table c_orders  用这个语句获取
-    public static final String createTableSql = "CREATE TABLE `inspection_item_title_value` (\n" +
-            "  `value_id` varchar(30) NOT NULL COMMENT '主键ID',\n" +
-            "  `title_id` varchar(30) NOT NULL COMMENT '题目ID',\n" +
-            "  `item_value` varchar(256) NOT NULL COMMENT '选项说明',\n" +
-            "  `community_id` varchar(30) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '小区ID',\n" +
-            "  `seq` int(11) NOT NULL DEFAULT '1' COMMENT '显示顺序',\n" +
-            "  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',\n" +
-            "  `status_cd` varchar(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效'\n" +
+    public static final String createTableSql = "CREATE TABLE `inspection_task` (\n" +
+            "  `task_id` varchar(30) NOT NULL COMMENT '任务编码',\n" +
+            "  `b_id` varchar(30) NOT NULL COMMENT '业务id',\n" +
+            "  `community_id` varchar(30) NOT NULL COMMENT '小区ID',\n" +
+            "  `inspection_plan_id` varchar(30) NOT NULL COMMENT '计划ID',\n" +
+            "  `plan_ins_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '计划巡检时间',\n" +
+            "  `act_ins_time` datetime DEFAULT NULL COMMENT '实际巡检时间',\n" +
+            "  `plan_user_id` varchar(60) NOT NULL COMMENT '计划巡检人员id',\n" +
+            "  `plan_user_name` varchar(60) DEFAULT NULL COMMENT '计划巡检人员姓名',\n" +
+            "  `act_user_id` varchar(30) DEFAULT NULL COMMENT '实际巡检人员id',\n" +
+            "  `act_user_name` varchar(60) DEFAULT NULL COMMENT '实际巡检人员姓名',\n" +
+            "  `sign_type` varchar(200) NOT NULL COMMENT '实际巡检方式',\n" +
+            "  `status_cd` varchar(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,0在用 1失效',\n" +
+            "  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n" +
+            "  `state` varchar(12) NOT NULL DEFAULT '20200405' COMMENT '巡检状态',\n" +
+            "  `ip_staff_id` varchar(30) NOT NULL COMMENT '巡检人ID',\n" +
+            "  `original_plan_user_id` varchar(60) DEFAULT NULL COMMENT '原计划巡检人userId',\n" +
+            "  `original_plan_user_name` varchar(60) DEFAULT NULL COMMENT '原计划巡检人名称',\n" +
+            "  `transfer_desc` varchar(255) DEFAULT NULL COMMENT '转移说明',\n" +
+            "  `task_type` varchar(255) DEFAULT NULL COMMENT '任务类型 1000日常巡检任务 2000流转巡检任务',\n" +
+            "  `plan_end_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '计划巡检结束时间',\n" +
             ") ";
 
     public static void main(String[] args) {
-        String desc = "题目选项";
-        String id = "valueId";
-        String name = "inspectionItemTitleValue";
+        String desc = "巡检任务";
+        String id = "taskId";
+        String name = "inspectionTask";
         String shareName = "community"; //生成到那个服务下
         String shareColumn = "community_id";
         String shareParam = "communityId";

+ 44 - 17
java110-generator/src/main/resources/newBack/template_1.json

@@ -1,36 +1,63 @@
 {
   "param": {
-    "valueId": "value_id",
-    "titleId": "title_id",
-    "itemValue": "item_value",
+    "planUserId": "plan_user_id",
+    "actInsTime": "act_ins_time",
+    "planInsTime": "plan_ins_time",
+    "originalPlanUserName": "original_plan_user_name",
+    "ipStaffId": "ip_staff_id",
+    "transferDesc": "transfer_desc",
     "statusCd": "status_cd",
+    "actUserName": "act_user_name",
+    "originalPlanUserId": "original_plan_user_id",
+    "taskType": "task_type",
+    "signType": "sign_type",
+    "planEndTime": "plan_end_time",
+    "inspectionPlanId": "inspection_plan_id",
+    "planUserName": "plan_user_name",
     "communityId": "community_id",
-    "seq": "seq"
+    "actUserId": "act_user_id",
+    "taskId": "task_id"
   },
-  "name": "inspectionItemTitleValue",
+  "name": "inspectionTask",
   "shareColumn": "community_id",
-  "id": "valueId",
+  "id": "taskId",
   "shareName": "community",
   "autoMove": true,
   "required": [
     {
-      "msg": "题目ID不能为空",
-      "code": "titleId"
-    },
-    {
-      "msg": "选项说明不能为空",
-      "code": "itemValue"
+      "msg": "任务编码不能为空",
+      "code": "taskId"
     },
     {
       "msg": "小区ID不能为空",
       "code": "communityId"
     },
     {
-      "msg": "显示顺序不能为空",
-      "code": "seq"
+      "msg": "计划ID不能为空",
+      "code": "inspectionPlanId"
+    },
+    {
+      "msg": "计划巡检时间不能为空",
+      "code": "planInsTime"
+    },
+    {
+      "msg": "计划巡检人员id不能为空",
+      "code": "planUserId"
+    },
+    {
+      "msg": "实际巡检方式不能为空",
+      "code": "signType"
+    },
+    {
+      "msg": "巡检人ID不能为空",
+      "code": "ipStaffId"
+    },
+    {
+      "msg": "计划巡检结束时间不能为空",
+      "code": "planEndTime"
     }
   ],
-  "desc": "题目选项",
+  "desc": "巡检任务",
   "shareParam": "communityId",
-  "tableName": "inspection_item_title_value"
-}
+  "tableName": "inspection_task"
+}

+ 68 - 0
java110-interface/src/main/java/com/java110/intf/community/IInspectionTaskV1InnerServiceSMO.java

@@ -0,0 +1,68 @@
+/*
+ * 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.intf.community;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.inspectionPlan.InspectionTaskDto;
+import com.java110.po.inspection.InspectionTaskPo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.util.List;
+
+/**
+ * 类表述: 服务之前调用的接口类,不对外提供接口能力 只用于接口建调用
+ * add by 吴学文 at 2022-03-16 09:35:12 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@FeignClient(name = "community-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/inspectionTaskV1Api")
+public interface IInspectionTaskV1InnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveInspectionTask", method = RequestMethod.POST)
+    public int saveInspectionTask(@RequestBody InspectionTaskPo inspectionTaskPo);
+
+    @RequestMapping(value = "/updateInspectionTask", method = RequestMethod.POST)
+    public int updateInspectionTask(@RequestBody  InspectionTaskPo inspectionTaskPo);
+
+    @RequestMapping(value = "/deleteInspectionTask", method = RequestMethod.POST)
+    public int deleteInspectionTask(@RequestBody  InspectionTaskPo inspectionTaskPo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param inspectionTaskDto 数据对象分享
+     * @return InspectionTaskDto 对象数据
+     */
+    @RequestMapping(value = "/queryInspectionTasks", method = RequestMethod.POST)
+    List<InspectionTaskDto> queryInspectionTasks(@RequestBody InspectionTaskDto inspectionTaskDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param inspectionTaskDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryInspectionTasksCount", method = RequestMethod.POST)
+    int queryInspectionTasksCount(@RequestBody InspectionTaskDto inspectionTaskDto);
+}

+ 71 - 0
service-community/src/main/java/com/java110/community/cmd/inspectionTask/DeleteInspectionTaskCmd.java

@@ -0,0 +1,71 @@
+/*
+ * 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.community.cmd.inspectionTask;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.AbstractServiceCmdListener;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.intf.community.IInspectionTaskV1InnerServiceSMO;
+import com.java110.po.inspection.InspectionTaskPo;
+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.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * 类表述:删除
+ * 服务编码:inspectionTask.deleteInspectionTask
+ * 请求路劲:/app/inspectionTask.DeleteInspectionTask
+ * add by 吴学文 at 2022-03-16 09:35:12 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "inspectionTask.deleteInspectionTask")
+public class DeleteInspectionTaskCmd extends AbstractServiceCmdListener {
+    private static Logger logger = LoggerFactory.getLogger(DeleteInspectionTaskCmd.class);
+
+    @Autowired
+    private IInspectionTaskV1InnerServiceSMO inspectionTaskV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "taskId", "taskId不能为空");
+        Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
+
+    }
+
+    @Override
+    @Java110Transactional
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        InspectionTaskPo inspectionTaskPo = BeanConvertUtil.covertBean(reqJson, InspectionTaskPo.class);
+        int flag = inspectionTaskV1InnerServiceSMOImpl.deleteInspectionTask(inspectionTaskPo);
+
+        if (flag < 1) {
+            throw new CmdException("删除数据失败");
+        }
+
+        cmdDataFlowContext.setResponseEntity(ResultVo.success());
+    }
+}

+ 81 - 0
service-community/src/main/java/com/java110/community/cmd/inspectionTask/ListInspectionTaskCmd.java

@@ -0,0 +1,81 @@
+/*
+ * 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.community.cmd.inspectionTask;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.AbstractServiceCmdListener;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.dto.inspectionPlan.InspectionTaskDto;
+import com.java110.intf.community.IInspectionTaskV1InnerServiceSMO;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * 类表述:查询
+ * 服务编码:inspectionTask.listInspectionTask
+ * 请求路劲:/app/inspectionTask.ListInspectionTask
+ * add by 吴学文 at 2022-03-16 09:35:12 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Java110Cmd(serviceCode = "inspectionTask.listInspectionTask")
+public class ListInspectionTaskCmd extends AbstractServiceCmdListener {
+
+    private static Logger logger = LoggerFactory.getLogger(ListInspectionTaskCmd.class);
+    @Autowired
+    private IInspectionTaskV1InnerServiceSMO inspectionTaskV1InnerServiceSMOImpl;
+
+    @Override
+    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+        super.validatePageInfo(reqJson);
+    }
+
+    @Override
+    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+        InspectionTaskDto inspectionTaskDto = BeanConvertUtil.covertBean(reqJson, InspectionTaskDto.class);
+
+        int count = inspectionTaskV1InnerServiceSMOImpl.queryInspectionTasksCount(inspectionTaskDto);
+
+        List<InspectionTaskDto> inspectionTaskDtos = null;
+
+        if (count > 0) {
+            inspectionTaskDtos = inspectionTaskV1InnerServiceSMOImpl.queryInspectionTasks(inspectionTaskDto);
+        } else {
+            inspectionTaskDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, inspectionTaskDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        cmdDataFlowContext.setResponseEntity(responseEntity);
+    }
+}

+ 77 - 0
service-community/src/main/java/com/java110/community/dao/IInspectionTaskV1ServiceDao.java

@@ -0,0 +1,77 @@
+/*
+ * 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.community.dao;
+
+
+import com.java110.utils.exception.DAOException;
+import com.java110.entity.merchant.BoMerchant;
+import com.java110.entity.merchant.BoMerchantAttr;
+import com.java110.entity.merchant.Merchant;
+import com.java110.entity.merchant.MerchantAttr;
+
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 类表述:
+ * add by 吴学文 at 2022-03-16 09:35:12 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+public interface IInspectionTaskV1ServiceDao {
+
+
+    /**
+     * 保存 巡检任务信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    int saveInspectionTaskInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询巡检任务信息(instance过程)
+     * 根据bId 查询巡检任务信息
+     * @param info bId 信息
+     * @return 巡检任务信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getInspectionTaskInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改巡检任务信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    int updateInspectionTaskInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询巡检任务总数
+     *
+     * @param info 巡检任务信息
+     * @return 巡检任务数量
+     */
+    int queryInspectionTasksCount(Map info);
+
+}

+ 112 - 0
service-community/src/main/java/com/java110/community/dao/impl/InspectionTaskV1ServiceDaoImpl.java

@@ -0,0 +1,112 @@
+/*
+ * 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.community.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.exception.DAOException;
+import com.java110.utils.util.DateUtil;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.community.dao.IInspectionTaskV1ServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 类表述:
+ * add by 吴学文 at 2022-03-16 09:35:12 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@Service("inspectionTaskV1ServiceDaoImpl")
+public class InspectionTaskV1ServiceDaoImpl extends BaseServiceDao implements IInspectionTaskV1ServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(InspectionTaskV1ServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存巡检任务信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int saveInspectionTaskInfo(Map info) throws DAOException {
+        logger.debug("保存 saveInspectionTaskInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("inspectionTaskV1ServiceDaoImpl.saveInspectionTaskInfo",info);
+
+        return saveFlag;
+    }
+
+
+    /**
+     * 查询巡检任务信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getInspectionTaskInfo(Map info) throws DAOException {
+        logger.debug("查询 getInspectionTaskInfo 入参 info : {}",info);
+
+        List<Map> businessInspectionTaskInfos = sqlSessionTemplate.selectList("inspectionTaskV1ServiceDaoImpl.getInspectionTaskInfo",info);
+
+        return businessInspectionTaskInfos;
+    }
+
+
+    /**
+     * 修改巡检任务信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int updateInspectionTaskInfo(Map info) throws DAOException {
+        logger.debug("修改 updateInspectionTaskInfo 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("inspectionTaskV1ServiceDaoImpl.updateInspectionTaskInfo",info);
+
+        return saveFlag;
+    }
+
+     /**
+     * 查询巡检任务数量
+     * @param info 巡检任务信息
+     * @return 巡检任务数量
+     */
+    @Override
+    public int queryInspectionTasksCount(Map info) {
+        logger.debug("查询 queryInspectionTasksCount 入参 info : {}",info);
+
+        List<Map> businessInspectionTaskInfos = sqlSessionTemplate.selectList("inspectionTaskV1ServiceDaoImpl.queryInspectionTasksCount", info);
+        if (businessInspectionTaskInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessInspectionTaskInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 90 - 0
service-community/src/main/java/com/java110/community/smo/impl/InspectionTaskV1InnerServiceSMOImpl.java

@@ -0,0 +1,90 @@
+/*
+ * 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.community.smo.impl;
+
+
+import com.java110.community.dao.IInspectionTaskV1ServiceDao;
+import com.java110.dto.inspectionPlan.InspectionTaskDto;
+import com.java110.intf.community.IInspectionTaskV1InnerServiceSMO;
+
+import com.java110.po.inspection.InspectionTaskPo;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.user.UserDto;
+import com.java110.dto.PageDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 类表述: 服务之前调用的接口实现类,不对外提供接口能力 只用于接口建调用
+ * add by 吴学文 at 2022-03-16 09:35:12 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 官网:http://www.homecommunity.cn
+ * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
+ * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
+ */
+@RestController
+public class InspectionTaskV1InnerServiceSMOImpl extends BaseServiceSMO implements IInspectionTaskV1InnerServiceSMO {
+
+    @Autowired
+    private IInspectionTaskV1ServiceDao inspectionTaskV1ServiceDaoImpl;
+
+
+    @Override
+    public int saveInspectionTask(@RequestBody InspectionTaskPo inspectionTaskPo) {
+        int saveFlag = inspectionTaskV1ServiceDaoImpl.saveInspectionTaskInfo(BeanConvertUtil.beanCovertMap(inspectionTaskPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int updateInspectionTask(@RequestBody  InspectionTaskPo inspectionTaskPo) {
+        int saveFlag = inspectionTaskV1ServiceDaoImpl.updateInspectionTaskInfo(BeanConvertUtil.beanCovertMap(inspectionTaskPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int deleteInspectionTask(@RequestBody  InspectionTaskPo inspectionTaskPo) {
+       inspectionTaskPo.setStatusCd("1");
+       int saveFlag = inspectionTaskV1ServiceDaoImpl.updateInspectionTaskInfo(BeanConvertUtil.beanCovertMap(inspectionTaskPo));
+       return saveFlag;
+    }
+
+    @Override
+    public List<InspectionTaskDto> queryInspectionTasks(@RequestBody  InspectionTaskDto inspectionTaskDto) {
+
+        //校验是否传了 分页信息
+
+        int page = inspectionTaskDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            inspectionTaskDto.setPage((page - 1) * inspectionTaskDto.getRow());
+        }
+
+        List<InspectionTaskDto> inspectionTasks = BeanConvertUtil.covertBeanList(inspectionTaskV1ServiceDaoImpl.getInspectionTaskInfo(BeanConvertUtil.beanCovertMap(inspectionTaskDto)), InspectionTaskDto.class);
+
+        return inspectionTasks;
+    }
+
+
+    @Override
+    public int queryInspectionTasksCount(@RequestBody InspectionTaskDto inspectionTaskDto) {
+        return inspectionTaskV1ServiceDaoImpl.queryInspectionTasksCount(BeanConvertUtil.beanCovertMap(inspectionTaskDto));    }
+
+}