Преглед изворни кода

Merge branch 'master' of https://github.com/java110/MicroCommunity

wuxw пре 6 година
родитељ
комит
6a89e31dd7

+ 5 - 0
WebService/src/main/resources/components/machinePackage/machine-select2/machineSelect2.html

@@ -0,0 +1,5 @@
+<select class="form-control" id = "machineSelector">
+    <option value="">请选择设备</option>
+
+
+</select>

+ 123 - 0
WebService/src/main/resources/components/machinePackage/machine-select2/machineSelect2.js

@@ -0,0 +1,123 @@
+(function (vc) {
+    vc.extends({
+        propTypes: {
+            parentModal: vc.propTypes.string,
+            callBackListener: vc.propTypes.string, //父组件名称
+            callBackFunction: vc.propTypes.string //父组件监听方法
+        },
+        data: {
+            machineSelect2Info: {
+                machines: [],
+                machineId: '-1',
+                machineCode: '',
+                machineName: '',
+                machineSelector: {},
+            }
+        },
+        watch: {
+            machineSelect2Info: {
+                deep: true,
+                handler: function () {
+                    vc.emit($props.callBackListener, $props.callBackFunction, this.machineSelect2Info);
+                }
+            }
+        },
+        _initMethod: function () {
+            this._initMachineSelect2();
+        },
+        _initEvent: function () {
+            //监听 modal 打开
+            /* $('#'+$props.parentModal).on('show.bs.modal', function () {
+                  vc.component._initFloorSelect2();
+             })*/
+            vc.on('machineSelect2', 'setMachine', function (_param) {
+                console.log("执行:edit machineSelect2"+_param);
+                vc.copyObject(_param, this.machineSelect2Info);
+                /* $("#floorSelector").val({
+                     id:param.floorId,
+                     text:_param.floorNum
+                 }).select2();*/
+
+                var option = new Option(_param.machineName, _param.machineId, true, true);
+                this.machineSelect2Info.machineSelector.append(option);
+            });
+
+            vc.on('machineSelect2', 'clearMachine', function (_param) {
+                this.machineSelect2Info = {
+                    machines: [],
+                    machineId: '-1',
+                    machineCode: '',
+                    machineName: '',
+                    machineSelector: {},
+                };
+            });
+        },
+        methods: {
+            _initMachineSelect2: function () {
+                console.log("调用_initMachineSelect2 方法");
+                $.fn.modal.Constructor.prototype.enforceFocus = function () {
+                };
+                $.fn.select2.defaults.set('width', '100%');
+                this.machineSelect2Info.machineSelector = $('#machineSelector').select2({
+                    placeholder: '必填,请选择楼栋',
+                    allowClear: true,//允许清空
+                    escapeMarkup: function (markup) {
+                        return markup;
+                    }, // 自定义格式化防止xss注入
+                    ajax: {
+                        url: "/callComponent/machineSelect2/list",
+                        dataType: 'json',
+                        delay: 250,
+                        data: function (params) {
+                            console.log("param", params);
+                            var _term = "";
+                            if (params.hasOwnProperty("term")) {
+                                _term = params.term;
+                            }
+                            return {
+                                machineName: _term,
+                                page: 1,
+                                row: 10,
+                                communityId: vc.getCurrentCommunity().communityId
+                            };
+                        },
+                        processResults: function (data) {
+                            console.log(data, this._filterMachineData(data.machines));
+                            return {
+                                results: this._filterMachineData(data.machines)
+                            };
+                        },
+                        cache: true
+                    }
+                });
+                $('#machineSelector').on("select2:select", function (evt) {
+                    //这里是选中触发的事件
+                    //evt.params.data 是选中项的信息
+                    console.log('select', evt);
+                    this.machineSelect2Info.machineId = evt.params.data.id;
+                    this.machineSelect2Info.machineName = evt.params.data.text;
+                });
+
+                $('#machineSelector').on("select2:unselect", function (evt) {
+                    //这里是取消选中触发的事件
+                    //如配置allowClear: true后,触发
+                    console.log('unselect', evt);
+                    this.machineSelect2Info.machineId = '-1';
+                    this.machineSelect2Info.machineName = '';
+
+                });
+            },
+            _filterMachineData: function (_machines) {
+                var _tmpMachines = [];
+                for (var i = 0; i < _machines.length; i++) {
+                    var _tmpMachine = {
+                        id: _machines[i].machineId,
+                        text: _machines[i].machineName
+                    };
+                    _tmpMachines.push(_tmpMachine);
+                }
+                return _tmpMachines;
+            }
+        }
+    });
+})(window.vc);

+ 76 - 13
java110-bean/src/main/java/com/java110/dto/inspectionPoint/InspectionDto.java

@@ -16,10 +16,16 @@ import java.util.Date;
 public class InspectionDto extends PageDto implements Serializable {
 
     private String inspectionId;
-private String machineId;
-private String remark;
-private String inspectionName;
-private String communityId;
+    private String inspectionName;
+    private String remark;
+    private String machineCode;
+    private String machineName;
+    private String locationTypeCd;
+    private String locationTypeName;
+    private String locationObjId;
+    private String locationObjName;
+    private String machineId;
+    private String communityId;
 
 
     private Date createTime;
@@ -30,31 +36,40 @@ private String communityId;
     public String getInspectionId() {
         return inspectionId;
     }
-public void setInspectionId(String inspectionId) {
+
+    public void setInspectionId(String inspectionId) {
         this.inspectionId = inspectionId;
     }
-public String getMachineId() {
+
+    public String getMachineId() {
         return machineId;
     }
-public void setMachineId(String machineId) {
+
+    public void setMachineId(String machineId) {
         this.machineId = machineId;
     }
-public String getRemark() {
+
+    public String getRemark() {
         return remark;
     }
-public void setRemark(String remark) {
+
+    public void setRemark(String remark) {
         this.remark = remark;
     }
-public String getInspectionName() {
+
+    public String getInspectionName() {
         return inspectionName;
     }
-public void setInspectionName(String inspectionName) {
+
+    public void setInspectionName(String inspectionName) {
         this.inspectionName = inspectionName;
     }
-public String getCommunityId() {
+
+    public String getCommunityId() {
         return communityId;
     }
-public void setCommunityId(String communityId) {
+
+    public void setCommunityId(String communityId) {
         this.communityId = communityId;
     }
 
@@ -74,4 +89,52 @@ public void setCommunityId(String communityId) {
     public void setStatusCd(String statusCd) {
         this.statusCd = statusCd;
     }
+
+    public String getMachineCode() {
+        return machineCode;
+    }
+
+    public void setMachineCode(String machineCode) {
+        this.machineCode = machineCode;
+    }
+
+    public String getMachineName() {
+        return machineName;
+    }
+
+    public void setMachineName(String machineName) {
+        this.machineName = machineName;
+    }
+
+    public String getLocationTypeCd() {
+        return locationTypeCd;
+    }
+
+    public void setLocationTypeCd(String locationTypeCd) {
+        this.locationTypeCd = locationTypeCd;
+    }
+
+    public String getLocationTypeName() {
+        return locationTypeName;
+    }
+
+    public void setLocationTypeName(String locationTypeName) {
+        this.locationTypeName = locationTypeName;
+    }
+
+    public String getLocationObjId() {
+        return locationObjId;
+    }
+
+    public void setLocationObjId(String locationObjId) {
+        this.locationObjId = locationObjId;
+    }
+
+    public String getLocationObjName() {
+        return locationObjName;
+    }
+
+    public void setLocationObjName(String locationObjName) {
+        this.locationObjName = locationObjName;
+    }
 }

+ 54 - 0
java110-code-generator/src/main/resources/web/template_inspectionPoint.json

@@ -0,0 +1,54 @@
+{
+  "templateName":"巡检点",
+  "templateCode":"inspectionPoint",
+  "templateKey":"inspectionId",
+  "templateKeyName":"巡检点ID",
+  "searchCode": "inspectionName",
+  "searchName": "巡检点名称",
+  "conditions": [
+    {
+      "name": "巡检点ID",
+      "inputType": "input",
+      "code": "inspectionId",
+      "whereCondition": "equal"
+    },
+    {
+      "name": "设备ID",
+      "inputType": "input",
+      "code": "machineId",
+      "whereCondition": "equal"
+    },
+    {
+      "name": "巡检点名称",
+      "inputType": "input",
+      "code": "inspectionName",
+      "whereCondition": "equal"
+    }
+  ],
+  "columns":[
+    {
+      "code": "inspection_name",
+      "cnCode":"巡检点名称",
+      "desc":"必填,请填写巡检点名称",
+      "required":true,
+      "hasDefaultValue":false,
+      "inputType": "input",
+      "limit":"maxLength",
+      "limitParam":"100",
+      "limitErrInfo":"巡检点名称不能超过100位",
+      "show": true
+    },
+    {
+      "code": "remark",
+      "cnCode":"备注",
+      "desc":"必填,请填写巡检点名称",
+      "required":false,
+      "hasDefaultValue":false,
+      "inputType": "input",
+      "limit":"maxLength",
+      "limitParam":"200",
+      "limitErrInfo":"备注信息不能超过200位",
+      "show": true
+    }
+  ]
+}

+ 3 - 3
java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java

@@ -820,16 +820,16 @@ public class BusinessTypeConstant {
      *  保存巡检点
      * 14开头  3保存
      */
-    public static final String BUSINESS_TYPE_SAVE_INSPECTION="300200030001";
+    public static final String BUSINESS_TYPE_SAVE_INSPECTION="500200030001";
 
     /**
      * 修改巡检点
      */
-    public static final String BUSINESS_TYPE_UPDATE_INSPECTION="300200040001";
+    public static final String BUSINESS_TYPE_UPDATE_INSPECTION="500200040001";
     /**
      *  删除巡检点
      */
-    public static final String BUSINESS_TYPE_DELETE_INSPECTION ="300200050001";
+    public static final String BUSINESS_TYPE_DELETE_INSPECTION ="500200050001";
 
     /**
      *  保存巡检路线

+ 3 - 0
java110-utils/src/main/java/com/java110/utils/constant/PrivilegeCodeConstant.java

@@ -140,6 +140,9 @@ public final class PrivilegeCodeConstant {
     public static final String AGENT_HAS_LIST_MACHINE_RECORD = "502019112673230007";
     public static final String LIST_APPLICATION_KEY = "502019120169500005";
 
+    //巡检点权限编码
+    public static final String AGENT_HAS_LIST_INSPECTION_POINT = "502020020729080005";
+
 
 
 }

+ 31 - 0
java110-utils/src/main/java/com/java110/utils/constant/ServiceCodeInspectionPointConstant.java

@@ -0,0 +1,31 @@
+package com.java110.utils.constant;
+
+/**
+ * 巡检点常量类
+ * Created by wuxw on 2017/5/20.
+ */
+public class ServiceCodeInspectionPointConstant {
+
+    /**
+     * 添加 巡检点
+     */
+    public static final String ADD_INSPECTIONPOINT = "inspectionPoint.saveInspectionPoint";
+
+
+    /**
+     * 修改 巡检点
+     */
+    public static final String UPDATE_INSPECTIONPOINT = "inspectionPoint.updateInspectionPoint";
+    /**
+     * 删除 巡检点
+     */
+    public static final String DELETE_INSPECTIONPOINT = "inspectionPoint.deleteInspectionPoint";
+
+
+    /**
+     * 查询 巡检点
+     */
+    public static final String LIST_INSPECTIONPOINTS = "inspectionPoint.listInspectionPoints";
+
+
+}