Просмотр исходного кода

优化保养计划添加功能

wuxw лет назад: 3
Родитель
Сommit
007dadf936

+ 2 - 6
java110-db/src/main/resources/mapper/community/MaintainancePlanMachineV1ServiceDaoImplMapper.xml

@@ -22,6 +22,7 @@
         communityId,t.machine_name,t.machine_name machineName
         communityId,t.machine_name,t.machine_name machineName
         from maintainance_plan_machine t
         from maintainance_plan_machine t
         where 1 =1
         where 1 =1
+        and t.status_cd = '0'
         <if test="mpmId !=null and mpmId != ''">
         <if test="mpmId !=null and mpmId != ''">
             and t.mpm_id= #{mpmId}
             and t.mpm_id= #{mpmId}
         </if>
         </if>
@@ -34,9 +35,6 @@
         <if test="planId !=null and planId != ''">
         <if test="planId !=null and planId != ''">
             and t.plan_id= #{planId}
             and t.plan_id= #{planId}
         </if>
         </if>
-        <if test="statusCd !=null and statusCd != ''">
-            and t.status_cd= #{statusCd}
-        </if>
         <if test="communityId !=null and communityId != ''">
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
             and t.community_id= #{communityId}
         </if>
         </if>
@@ -84,6 +82,7 @@
         select count(1) count
         select count(1) count
         from maintainance_plan_machine t
         from maintainance_plan_machine t
         where 1 =1
         where 1 =1
+        and t.status_cd = '0'
         <if test="mpmId !=null and mpmId != ''">
         <if test="mpmId !=null and mpmId != ''">
             and t.mpm_id= #{mpmId}
             and t.mpm_id= #{mpmId}
         </if>
         </if>
@@ -96,9 +95,6 @@
         <if test="planId !=null and planId != ''">
         <if test="planId !=null and planId != ''">
             and t.plan_id= #{planId}
             and t.plan_id= #{planId}
         </if>
         </if>
-        <if test="statusCd !=null and statusCd != ''">
-            and t.status_cd= #{statusCd}
-        </if>
         <if test="communityId !=null and communityId != ''">
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
             and t.community_id= #{communityId}
         </if>
         </if>

+ 3 - 0
java110-db/src/main/resources/mapper/community/MaintainancePlanStaffV1ServiceDaoImplMapper.xml

@@ -21,6 +21,7 @@
         communityId,t.staff_id,t.staff_id staffId,t.mps_id,t.mps_id mpsId
         communityId,t.staff_id,t.staff_id staffId,t.mps_id,t.mps_id mpsId
         from maintainance_plan_staff t
         from maintainance_plan_staff t
         where 1 =1
         where 1 =1
+        and t.status_cd = '0'
         <if test="staffName !=null and staffName != ''">
         <if test="staffName !=null and staffName != ''">
             and t.staff_name= #{staffName}
             and t.staff_name= #{staffName}
         </if>
         </if>
@@ -75,6 +76,7 @@
         select count(1) count
         select count(1) count
         from maintainance_plan_staff t
         from maintainance_plan_staff t
         where 1 =1
         where 1 =1
+        and t.status_cd = '0'
         <if test="staffName !=null and staffName != ''">
         <if test="staffName !=null and staffName != ''">
             and t.staff_name= #{staffName}
             and t.staff_name= #{staffName}
         </if>
         </if>
@@ -100,6 +102,7 @@
         select t.plan_id planId,count(1) staffCount
         select t.plan_id planId,count(1) staffCount
         from maintainance_plan_staff t
         from maintainance_plan_staff t
         where 1 =1
         where 1 =1
+        and t.status_cd = '0'
         <if test="planIds !=null ">
         <if test="planIds !=null ">
             and t.plan_id in
             and t.plan_id in
             <foreach collection="planIds" item="item" open="(" close=")" separator=",">
             <foreach collection="planIds" item="item" open="(" close=")" separator=",">

+ 0 - 71
service-community/src/main/java/com/java110/community/cmd/maintainancePlan/DeleteMaintainancePlanStaffCmd.java

@@ -1,71 +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.community.cmd.maintainancePlan;
-
-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.Cmd;
-import com.java110.core.event.cmd.CmdEvent;
-import com.java110.intf.community.IMaintainancePlanStaffV1InnerServiceSMO;
-import com.java110.po.maintainancePlanStaff.MaintainancePlanStaffPo;
-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.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * 类表述:删除
- * 服务编码:maintainancePlanStaff.deleteMaintainancePlanStaff
- * 请求路劲:/app/maintainancePlanStaff.DeleteMaintainancePlanStaff
- * add by 吴学文 at 2022-11-07 02:15:24 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 = "maintainancePlan.deleteMaintainancePlanStaff")
-public class DeleteMaintainancePlanStaffCmd extends Cmd {
-    private static Logger logger = LoggerFactory.getLogger(DeleteMaintainancePlanStaffCmd.class);
-
-    @Autowired
-    private IMaintainancePlanStaffV1InnerServiceSMO maintainancePlanStaffV1InnerServiceSMOImpl;
-
-    @Override
-    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
-        Assert.hasKeyAndValue(reqJson, "mpsId", "mpsId不能为空");
-        Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
-
-    }
-
-    @Override
-    @Java110Transactional
-    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
-
-        MaintainancePlanStaffPo maintainancePlanStaffPo = BeanConvertUtil.covertBean(reqJson, MaintainancePlanStaffPo.class);
-        int flag = maintainancePlanStaffV1InnerServiceSMOImpl.deleteMaintainancePlanStaff(maintainancePlanStaffPo);
-
-        if (flag < 1) {
-            throw new CmdException("删除数据失败");
-        }
-
-        cmdDataFlowContext.setResponseEntity(ResultVo.success());
-    }
-}

+ 2 - 0
service-community/src/main/java/com/java110/community/cmd/maintainancePlan/ListMaintainancePlanStaffCmd.java

@@ -22,6 +22,7 @@ import com.java110.core.event.cmd.Cmd;
 import com.java110.core.event.cmd.CmdEvent;
 import com.java110.core.event.cmd.CmdEvent;
 import com.java110.intf.community.IMaintainancePlanStaffV1InnerServiceSMO;
 import com.java110.intf.community.IMaintainancePlanStaffV1InnerServiceSMO;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
 import com.java110.utils.util.BeanConvertUtil;
 import com.java110.vo.ResultVo;
 import com.java110.vo.ResultVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -56,6 +57,7 @@ public class ListMaintainancePlanStaffCmd extends Cmd {
     @Override
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
     public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
         super.validatePageInfo(reqJson);
         super.validatePageInfo(reqJson);
+        Assert.hasKeyAndValue(reqJson,"communityId","未包含小区");
     }
     }
 
 
     @Override
     @Override

+ 0 - 78
service-community/src/main/java/com/java110/community/cmd/maintainancePlan/SaveMaintainancePlanStaffCmd.java

@@ -1,78 +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.community.cmd.maintainancePlan;
-
-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.Cmd;
-import com.java110.core.event.cmd.CmdEvent;
-import com.java110.core.factory.GenerateCodeFactory;
-import com.java110.intf.community.IMaintainancePlanStaffV1InnerServiceSMO;
-import com.java110.po.maintainancePlanStaff.MaintainancePlanStaffPo;
-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.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * 类表述:保存
- * 服务编码:maintainancePlanStaff.saveMaintainancePlanStaff
- * 请求路劲:/app/maintainancePlanStaff.SaveMaintainancePlanStaff
- * add by 吴学文 at 2022-11-07 02:15:24 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 = "maintainancePlan.saveMaintainancePlanStaff")
-public class SaveMaintainancePlanStaffCmd extends Cmd {
-
-    private static Logger logger = LoggerFactory.getLogger(SaveMaintainancePlanStaffCmd.class);
-
-    public static final String CODE_PREFIX_ID = "10";
-
-    @Autowired
-    private IMaintainancePlanStaffV1InnerServiceSMO maintainancePlanStaffV1InnerServiceSMOImpl;
-
-    @Override
-    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
-        Assert.hasKeyAndValue(reqJson, "planId", "请求报文中未包含planId");
-        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
-        Assert.hasKeyAndValue(reqJson, "staffId", "请求报文中未包含staffId");
-        Assert.hasKeyAndValue(reqJson, "staffName", "请求报文中未包含staffName");
-
-    }
-
-    @Override
-    @Java110Transactional
-    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
-
-        MaintainancePlanStaffPo maintainancePlanStaffPo = BeanConvertUtil.covertBean(reqJson, MaintainancePlanStaffPo.class);
-        maintainancePlanStaffPo.setMpsId(GenerateCodeFactory.getGeneratorId(CODE_PREFIX_ID));
-        int flag = maintainancePlanStaffV1InnerServiceSMOImpl.saveMaintainancePlanStaff(maintainancePlanStaffPo);
-
-        if (flag < 1) {
-            throw new CmdException("保存数据失败");
-        }
-
-        cmdDataFlowContext.setResponseEntity(ResultVo.success());
-    }
-}

+ 0 - 74
service-community/src/main/java/com/java110/community/cmd/maintainancePlan/UpdateMaintainancePlanStaffCmd.java

@@ -1,74 +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.community.cmd.maintainancePlan;
-
-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.Cmd;
-import com.java110.core.event.cmd.CmdEvent;
-import com.java110.intf.community.IMaintainancePlanStaffV1InnerServiceSMO;
-import com.java110.po.maintainancePlanStaff.MaintainancePlanStaffPo;
-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.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * 类表述:更新
- * 服务编码:maintainancePlanStaff.updateMaintainancePlanStaff
- * 请求路劲:/app/maintainancePlanStaff.UpdateMaintainancePlanStaff
- * add by 吴学文 at 2022-11-07 02:15:24 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 = "maintainancePlan.updateMaintainancePlanStaff")
-public class UpdateMaintainancePlanStaffCmd extends Cmd {
-
-    private static Logger logger = LoggerFactory.getLogger(UpdateMaintainancePlanStaffCmd.class);
-
-
-    @Autowired
-    private IMaintainancePlanStaffV1InnerServiceSMO maintainancePlanStaffV1InnerServiceSMOImpl;
-
-    @Override
-    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
-        Assert.hasKeyAndValue(reqJson, "mpsId", "mpsId不能为空");
-        Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
-
-    }
-
-    @Override
-    @Java110Transactional
-    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
-
-        MaintainancePlanStaffPo maintainancePlanStaffPo = BeanConvertUtil.covertBean(reqJson, MaintainancePlanStaffPo.class);
-        int flag = maintainancePlanStaffV1InnerServiceSMOImpl.updateMaintainancePlanStaff(maintainancePlanStaffPo);
-
-        if (flag < 1) {
-            throw new CmdException("更新数据失败");
-        }
-
-        cmdDataFlowContext.setResponseEntity(ResultVo.success());
-    }
-}