Your Name 3 gadi atpakaļ
vecāks
revīzija
921e4931a1

+ 27 - 10
java110-bean/src/main/java/com/java110/dto/printerRuleRepair/PrinterRuleRepairDto.java

@@ -1,6 +1,7 @@
 package com.java110.dto.printerRuleRepair;
 
 import com.java110.dto.PageDto;
+
 import java.io.Serializable;
 import java.util.Date;
 
@@ -15,9 +16,10 @@ import java.util.Date;
 public class PrinterRuleRepairDto extends PageDto implements Serializable {
 
     private String prrId;
-private String repairType;
-private String ruleId;
-private String communityId;
+    private String repairType;
+    private String repairTypeName;
+    private String ruleId;
+    private String communityId;
 
 
     private Date createTime;
@@ -28,25 +30,32 @@ private String communityId;
     public String getPrrId() {
         return prrId;
     }
-public void setPrrId(String prrId) {
+
+    public void setPrrId(String prrId) {
         this.prrId = prrId;
     }
-public String getRepairType() {
+
+    public String getRepairType() {
         return repairType;
     }
-public void setRepairType(String repairType) {
+
+    public void setRepairType(String repairType) {
         this.repairType = repairType;
     }
-public String getRuleId() {
+
+    public String getRuleId() {
         return ruleId;
     }
-public void setRuleId(String ruleId) {
+
+    public void setRuleId(String ruleId) {
         this.ruleId = ruleId;
     }
-public String getCommunityId() {
+
+    public String getCommunityId() {
         return communityId;
     }
-public void setCommunityId(String communityId) {
+
+    public void setCommunityId(String communityId) {
         this.communityId = communityId;
     }
 
@@ -66,4 +75,12 @@ public void setCommunityId(String communityId) {
     public void setStatusCd(String statusCd) {
         this.statusCd = statusCd;
     }
+
+    public String getRepairTypeName() {
+        return repairTypeName;
+    }
+
+    public void setRepairTypeName(String repairTypeName) {
+        this.repairTypeName = repairTypeName;
+    }
 }

+ 34 - 15
java110-bean/src/main/java/com/java110/po/printerRuleRepair/PrinterRuleRepairPo.java

@@ -17,6 +17,7 @@ package com.java110.po.printerRuleRepair;
 
 import java.io.Serializable;
 import java.util.Date;
+
 /**
  * 类表述: Po 数据模型实体对象 基本保持与数据库模型一直 用于 增加修改删除 等时的数据载体
  * add by 吴学文 at 2023-02-17 14:54:10 mail: 928255095@qq.com
@@ -28,41 +29,59 @@ import java.util.Date;
 public class PrinterRuleRepairPo implements Serializable {
 
     private String prrId;
-private String repairType;
-private String statusCd = "0";
-private String ruleId;
-private String communityId;
-public String getPrrId() {
+    private String repairType;
+
+    private String repairTypeName;
+
+    private String statusCd = "0";
+    private String ruleId;
+    private String communityId;
+
+    public String getPrrId() {
         return prrId;
     }
-public void setPrrId(String prrId) {
+
+    public void setPrrId(String prrId) {
         this.prrId = prrId;
     }
-public String getRepairType() {
+
+    public String getRepairType() {
         return repairType;
     }
-public void setRepairType(String repairType) {
+
+    public void setRepairType(String repairType) {
         this.repairType = repairType;
     }
-public String getStatusCd() {
+
+    public String getStatusCd() {
         return statusCd;
     }
-public void setStatusCd(String statusCd) {
+
+    public void setStatusCd(String statusCd) {
         this.statusCd = statusCd;
     }
-public String getRuleId() {
+
+    public String getRuleId() {
         return ruleId;
     }
-public void setRuleId(String ruleId) {
+
+    public void setRuleId(String ruleId) {
         this.ruleId = ruleId;
     }
-public String getCommunityId() {
+
+    public String getCommunityId() {
         return communityId;
     }
-public void setCommunityId(String communityId) {
+
+    public void setCommunityId(String communityId) {
         this.communityId = communityId;
     }
 
+    public String getRepairTypeName() {
+        return repairTypeName;
+    }
 
-
+    public void setRepairTypeName(String repairTypeName) {
+        this.repairTypeName = repairTypeName;
+    }
 }

+ 68 - 68
java110-db/src/main/resources/mapper/common/PrinterRuleRepairV1ServiceDaoImplMapper.xml

@@ -5,93 +5,93 @@
 <mapper namespace="printerRuleRepairV1ServiceDaoImpl">
 
 
-
-
-
     <!-- 保存云打印规则报修信息 add by wuxw 2018-07-03 -->
     <insert id="savePrinterRuleRepairInfo" parameterType="Map">
         insert into printer_rule_repair(
-prr_id,repair_type,rule_id,community_id
-) values (
-#{prrId},#{repairType},#{ruleId},#{communityId}
-)
+        prr_id,repair_type,rule_id,community_id,repair_type_name
+        ) values (
+        #{prrId},#{repairType},#{ruleId},#{communityId},#{repairTypeName}
+        )
     </insert>
 
 
-
     <!-- 查询云打印规则报修信息 add by wuxw 2018-07-03 -->
     <select id="getPrinterRuleRepairInfo" parameterType="Map" resultType="Map">
-        select  t.prr_id,t.prr_id prrId,t.repair_type,t.repair_type repairType,t.status_cd,t.status_cd statusCd,t.rule_id,t.rule_id ruleId,t.community_id,t.community_id communityId 
-from printer_rule_repair t 
-where 1 =1 
-<if test="prrId !=null and prrId != ''">
-   and t.prr_id= #{prrId}
-</if> 
-<if test="repairType !=null and repairType != ''">
-   and t.repair_type= #{repairType}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="ruleId !=null and ruleId != ''">
-   and t.rule_id= #{ruleId}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
-order by t.create_time desc
-<if test="page != -1 and page != null ">
-   limit #{page}, #{row}
-</if> 
+        select t.prr_id,t.prr_id prrId,t.repair_type,t.repair_type repairType,t.status_cd,t.status_cd
+        statusCd,t.rule_id,t.rule_id ruleId,t.community_id,t.community_id communityId,t.repair_type_name repairTypeName
+        from printer_rule_repair t
+        where 1 =1
+        <if test="prrId !=null and prrId != ''">
+            and t.prr_id= #{prrId}
+        </if>
+        <if test="repairType !=null and repairType != ''">
+            and t.repair_type= #{repairType}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="ruleId !=null and ruleId != ''">
+            and t.rule_id= #{ruleId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </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="updatePrinterRuleRepairInfo" parameterType="Map">
-        update  printer_rule_repair t set t.status_cd = #{statusCd}
-<if test="newBId != null and newBId != ''">
-,t.b_id = #{newBId}
-</if> 
-<if test="repairType !=null and repairType != ''">
-, t.repair_type= #{repairType}
-</if> 
-<if test="ruleId !=null and ruleId != ''">
-, t.rule_id= #{ruleId}
-</if> 
-<if test="communityId !=null and communityId != ''">
-, t.community_id= #{communityId}
-</if> 
- where 1=1 <if test="prrId !=null and prrId != ''">
-and t.prr_id= #{prrId}
-</if> 
+        update printer_rule_repair t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="repairType !=null and repairType != ''">
+            , t.repair_type= #{repairType}
+        </if>
+        <if test="repairTypeName !=null and repairTypeName != ''">
+            , t.repair_type_name= #{repairTypeName}
+        </if>
+        <if test="ruleId !=null and ruleId != ''">
+            , t.rule_id= #{ruleId}
+        </if>
+
+        where 1=1
+        <if test="prrId !=null and prrId != ''">
+            and t.prr_id= #{prrId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
 
     </update>
 
     <!-- 查询云打印规则报修数量 add by wuxw 2018-07-03 -->
-     <select id="queryPrinterRuleRepairsCount" parameterType="Map" resultType="Map">
-        select  count(1) count 
-from printer_rule_repair t 
-where 1 =1 
-<if test="prrId !=null and prrId != ''">
-   and t.prr_id= #{prrId}
-</if> 
-<if test="repairType !=null and repairType != ''">
-   and t.repair_type= #{repairType}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="ruleId !=null and ruleId != ''">
-   and t.rule_id= #{ruleId}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
+    <select id="queryPrinterRuleRepairsCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from printer_rule_repair t
+        where 1 =1
+        <if test="prrId !=null and prrId != ''">
+            and t.prr_id= #{prrId}
+        </if>
+        <if test="repairType !=null and repairType != ''">
+            and t.repair_type= #{repairType}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="ruleId !=null and ruleId != ''">
+            and t.rule_id= #{ruleId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
 
 
-     </select>
+    </select>
 
 </mapper>

+ 3 - 0
service-common/src/main/java/com/java110/common/cmd/printer/ListMachinePrinterCmd.java

@@ -22,6 +22,7 @@ import com.java110.core.event.cmd.Cmd;
 import com.java110.core.event.cmd.CmdEvent;
 import com.java110.intf.common.IMachinePrinterV1InnerServiceSMO;
 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;
@@ -56,6 +57,8 @@ public class ListMachinePrinterCmd extends Cmd {
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
         super.validatePageInfo(reqJson);
+        Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区");
+
     }
 
     @Override

+ 16 - 12
service-common/src/main/java/com/java110/common/cmd/printer/ListPrinterRuleCmd.java

@@ -22,12 +22,15 @@ import com.java110.core.event.cmd.Cmd;
 import com.java110.core.event.cmd.CmdEvent;
 import com.java110.intf.common.IPrinterRuleV1InnerServiceSMO;
 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 com.java110.dto.printerRule.PrinterRuleDto;
+
 import java.util.List;
 import java.util.ArrayList;
+
 import org.springframework.http.ResponseEntity;
 import org.springframework.http.HttpStatus;
 import org.slf4j.Logger;
@@ -47,34 +50,35 @@ import org.slf4j.LoggerFactory;
 @Java110Cmd(serviceCode = "printer.listPrinterRule")
 public class ListPrinterRuleCmd extends Cmd {
 
-  private static Logger logger = LoggerFactory.getLogger(ListPrinterRuleCmd.class);
+    private static Logger logger = LoggerFactory.getLogger(ListPrinterRuleCmd.class);
     @Autowired
     private IPrinterRuleV1InnerServiceSMO printerRuleV1InnerServiceSMOImpl;
 
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
         super.validatePageInfo(reqJson);
+        Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区");
     }
 
     @Override
     public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
 
-           PrinterRuleDto printerRuleDto = BeanConvertUtil.covertBean(reqJson, PrinterRuleDto.class);
+        PrinterRuleDto printerRuleDto = BeanConvertUtil.covertBean(reqJson, PrinterRuleDto.class);
 
-           int count = printerRuleV1InnerServiceSMOImpl.queryPrinterRulesCount(printerRuleDto);
+        int count = printerRuleV1InnerServiceSMOImpl.queryPrinterRulesCount(printerRuleDto);
 
-           List<PrinterRuleDto> printerRuleDtos = null;
+        List<PrinterRuleDto> printerRuleDtos = null;
 
-           if (count > 0) {
-               printerRuleDtos = printerRuleV1InnerServiceSMOImpl.queryPrinterRules(printerRuleDto);
-           } else {
-               printerRuleDtos = new ArrayList<>();
-           }
+        if (count > 0) {
+            printerRuleDtos = printerRuleV1InnerServiceSMOImpl.queryPrinterRules(printerRuleDto);
+        } else {
+            printerRuleDtos = new ArrayList<>();
+        }
 
-           ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, printerRuleDtos);
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, printerRuleDtos);
 
-           ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
 
-           cmdDataFlowContext.setResponseEntity(responseEntity);
+        cmdDataFlowContext.setResponseEntity(responseEntity);
     }
 }

+ 3 - 0
service-common/src/main/java/com/java110/common/cmd/printer/ListPrinterRuleFeeCmd.java

@@ -22,6 +22,7 @@ import com.java110.core.event.cmd.Cmd;
 import com.java110.core.event.cmd.CmdEvent;
 import com.java110.intf.common.IPrinterRuleFeeV1InnerServiceSMO;
 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;
@@ -54,6 +55,8 @@ public class ListPrinterRuleFeeCmd extends Cmd {
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
         super.validatePageInfo(reqJson);
+        Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区");
+
     }
 
     @Override

+ 3 - 0
service-common/src/main/java/com/java110/common/cmd/printer/ListPrinterRuleMachineCmd.java

@@ -22,6 +22,7 @@ import com.java110.core.event.cmd.Cmd;
 import com.java110.core.event.cmd.CmdEvent;
 import com.java110.intf.common.IPrinterRuleMachineV1InnerServiceSMO;
 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;
@@ -54,6 +55,8 @@ public class ListPrinterRuleMachineCmd extends Cmd {
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
         super.validatePageInfo(reqJson);
+        Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区");
+
     }
 
     @Override

+ 3 - 0
service-common/src/main/java/com/java110/common/cmd/printer/ListPrinterRuleRepairCmd.java

@@ -22,6 +22,7 @@ import com.java110.core.event.cmd.Cmd;
 import com.java110.core.event.cmd.CmdEvent;
 import com.java110.intf.common.IPrinterRuleRepairV1InnerServiceSMO;
 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;
@@ -54,6 +55,8 @@ public class ListPrinterRuleRepairCmd extends Cmd {
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
         super.validatePageInfo(reqJson);
+        Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区");
+
     }
 
     @Override

+ 15 - 0
service-common/src/main/java/com/java110/common/cmd/printer/SavePrinterRuleRepairCmd.java

@@ -22,7 +22,9 @@ 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.dto.repair.RepairSettingDto;
 import com.java110.intf.common.IPrinterRuleRepairV1InnerServiceSMO;
+import com.java110.intf.community.IRepairSettingV1InnerServiceSMO;
 import com.java110.po.printerRuleRepair.PrinterRuleRepairPo;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
@@ -32,6 +34,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.List;
+
 /**
  * 类表述:保存
  * 服务编码:printerRuleRepair.savePrinterRuleRepair
@@ -52,12 +56,23 @@ public class SavePrinterRuleRepairCmd extends Cmd {
     @Autowired
     private IPrinterRuleRepairV1InnerServiceSMO printerRuleRepairV1InnerServiceSMOImpl;
 
+    @Autowired
+    private IRepairSettingV1InnerServiceSMO repairSettingV1InnerServiceSMOImpl;
+
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
         Assert.hasKeyAndValue(reqJson, "ruleId", "请求报文中未包含ruleId");
         Assert.hasKeyAndValue(reqJson, "repairType", "请求报文中未包含repairType");
         Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
 
+        RepairSettingDto repairSettingDto = new RepairSettingDto();
+        repairSettingDto.setCommunityId(reqJson.getString("communityId"));
+        repairSettingDto.setRepairType(reqJson.getString("repairType"));
+        List<RepairSettingDto> repairSettingDtos = repairSettingV1InnerServiceSMOImpl.queryRepairSettings(repairSettingDto);
+
+        Assert.listOnlyOne(repairSettingDtos,"未包含报修类型");
+        reqJson.put("repairTypeName",repairSettingDtos.get(0).getRepairTypeName());
+
     }
 
     @Override

+ 0 - 74
service-common/src/main/java/com/java110/common/cmd/printer/UpdatePrinterRuleRepairCmd.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.common.cmd.printer;
-
-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.common.IPrinterRuleRepairV1InnerServiceSMO;
-import com.java110.po.printerRuleRepair.PrinterRuleRepairPo;
-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;
-
-
-/**
- * 类表述:更新
- * 服务编码:printerRuleRepair.updatePrinterRuleRepair
- * 请求路劲:/app/printerRuleRepair.UpdatePrinterRuleRepair
- * add by 吴学文 at 2023-02-17 14:54:10 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 = "printer.updatePrinterRuleRepair")
-public class UpdatePrinterRuleRepairCmd extends Cmd {
-
-    private static Logger logger = LoggerFactory.getLogger(UpdatePrinterRuleRepairCmd.class);
-
-
-    @Autowired
-    private IPrinterRuleRepairV1InnerServiceSMO printerRuleRepairV1InnerServiceSMOImpl;
-
-    @Override
-    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
-        Assert.hasKeyAndValue(reqJson, "prrId", "prrId不能为空");
-        Assert.hasKeyAndValue(reqJson, "communityId", "communityId不能为空");
-
-    }
-
-    @Override
-    @Java110Transactional
-    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
-
-        PrinterRuleRepairPo printerRuleRepairPo = BeanConvertUtil.covertBean(reqJson, PrinterRuleRepairPo.class);
-        int flag = printerRuleRepairV1InnerServiceSMOImpl.updatePrinterRuleRepair(printerRuleRepairPo);
-
-        if (flag < 1) {
-            throw new CmdException("更新数据失败");
-        }
-
-        cmdDataFlowContext.setResponseEntity(ResultVo.success());
-    }
-}