zhuguifei
2026-03-10 58402bd5e762361363a0f7d7907153c77dbb819f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
package com.shlanbao.tzsc.utils.params;
 
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
import com.shlanbao.tzsc.pms.md.eqp.beans.EquipmentsBean;
import com.shlanbao.tzsc.base.model.Combobox;
import com.shlanbao.tzsc.init.BaseParams;
import com.shlanbao.tzsc.pms.md.fixCode.beans.FixCodeBean;
import com.shlanbao.tzsc.pms.sys.role.beans.RoleBean;
 
 
/**
 * 数据字典导入固定参数
 * @author wanchanghuang
 * @create 2015年9月9日10:14:10
 */
public class SysEqpTypeBase {
 
    /**
     * 点检角色(操作工,维修工,维修主管)
     * value-sys_role表ID(角色ID)
     */
    public static Map<String, String> getDJRoleAlls(){
         Map<String, String> roleMap = new HashMap<String, String>();
         List<RoleBean> list=BaseParams.getListRole();
         if(list.size()>0 && list!=null){
             for(RoleBean r:list){
                 if(r.getSeq()==11){
                     roleMap.put(r.getName(), r.getId());
                 }
             }
         }
        return roleMap;
    }
    /**
     * 获取数组格式的点检角色id 操作工点检、维修工点检、维修主管点检
     * @return 工种角色id:0操作工、1机械维修工、2机械维修主管、3润滑工、4机械轮保工、5电气维修工、6电气维修主管、7电气轮保工
     */
 
    public static String[] getArrayDJRoleAll(){
        try {
            List<RoleBean> list=BaseParams.getListRole();
            String str="";
             if(list.size()>0 && list!=null){
                 for(RoleBean r:list){
                     if(r.getSeq()==14){
                        str+=r.getId()+",";
                     }
                 }
             }
             //拼接   "1,2,3"
             str="\""+str.substring(0, str.length()-1)+"\"";
             //将字符串转换成数组
             String [] stringArr= str.split(",");
             return stringArr;
        } catch (Exception e) {
            // TODO: handle exception
        }
        return null;
    }
    /**
     * 轮保角色(操作工,维修工,维修主管)
     * value-sys_role表ID(角色ID)
     * 注意:如果需要添加新角色,页面addMdType.jsp需要新增(目的页面显示角色名称)
     *     queryTypeCategory.jsp
     */
    public static Map<String, String> getLBRoleAlls(){
        Map<String, String> roleMap = new HashMap<String, String>();
         List<RoleBean> list=BaseParams.getListRole();
         if(list.size()>0 && list!=null){
             for(RoleBean r:list){
                 if(r.getSeq()==14){
                     roleMap.put(r.getName(), r.getId());
                 }
             }
         }
        return roleMap;
    }
 
    /**
     * 润滑部位
     *   roleMap.put( "VE-卷烟机","VE");
         roleMap.put("SE-卷烟机","SE");
         roleMap.put( "MAX-卷烟机","MAX");
         roleMap.put( "HCF-卷烟机","HCF");
         roleMap.put("ZF12B-卷烟机","ZF12B");
 
         roleMap.put( "YB25-包装机","YB25");
         roleMap.put( "YB45-包装机","YB45");
         roleMap.put( "YB55-包装机","YB55");
         roleMap.put( "YB65-包装机","YB65");
         roleMap.put("YB95-包装机","YB95");
     *
     */
    public static Map<String, String> getRHRoleAlls(){
         Map<String, String> roleMap = new HashMap<String, String>();
         List<FixCodeBean> list=BaseParams.getListMdFixCode();
         if(list!=null && list.size()>0){
             for(FixCodeBean f:list){
                 if("RH001".equalsIgnoreCase(f.getUpcode())){
                     roleMap.put(f.getName(), f.getCode());
                 }
             }
         }
        return roleMap;
    }
    /**
     * 设备点检增加功能,部位下啦
     *
     * type  卷-卷烟机
     *             包-包装机
     *       封-封箱机
     *       发射-发射机
     *       喂丝-喂丝机
     * @throws UnsupportedEncodingException
     *
     */
    public static Map<String, String> getDJBoxRoleAlls(String equipmentCode,String eqpTypeName) throws UnsupportedEncodingException{
        Map<String, String> roleMap = new HashMap<String, String>();
        int code=Integer.parseInt(equipmentCode);
         if(code<=30){
             roleMap.put( "VE-卷烟机","VE");
             roleMap.put("SE-卷烟机","SE");
             roleMap.put( "MAX-卷烟机","MAX");
             roleMap.put( "HCF-卷烟机","HCF");
             roleMap.put("ZF12B-卷烟机","ZF12B");
         }else if(code>=31&&code<=60){
             if(eqpTypeName.indexOf("25")>-1){
                 roleMap.put( "YB25-包装机","ZB25");
                }else{
                 roleMap.put( "YB45-包装机","ZB45");
                }
             roleMap.put( "YB55-包装机","YB55");
             roleMap.put( "YB65-包装机","YB65");
             roleMap.put("YB95-包装机","YB95");
         }else if(code>=61&&code<=70){
             roleMap.put("YP11A-封箱机","YP11A");
         }else if(code>=131&&code<=140){
             roleMap.put("YP27B-发射机","YP27B");
         }else if(code>=101&&code<=130){
             roleMap.put("成型机","成型机");
         }
        return roleMap;
    }
    /**
     * 数据字典润滑导入,润滑方式
     *
     * */
    public static Map<String,String> getBaseDatas(){
        Map<String,String> map = new HashMap<String, String>();
         List<Map<String,String>> list=  BaseParams.getListSysEqpType();
         if(null!=list && list.size()>0){
             map=list.get(0);
         }
        return map;
    }
 
    /**
     * 获取设备      key :name    val:id
     * @return
     */
    public static Map<String,String> getAllEqpNameAndID(){
        Map<String,String> map = new HashMap<String, String>();
        List<Combobox> box=BaseParams.getAllEqpsCombobox(false);
        for (int i = 0; i < box.size(); i++) {
            Combobox b=new Combobox();
            b=box.get(i);
            map.put(b.getName(), b.getId());
        }
        return map;
    }
 
    /**
     * 获取设备型号和名字        key:name    val:id
     * @return
     */
    public static Map<String,String> getEqpTypeNameAndID(){
        Map<String,String> map = new HashMap<String, String>();
        List<Combobox> box=BaseParams.getEqpTypesCombobox(false);
        for (int i = 0; i < box.size(); i++) {
            Combobox b=new Combobox();
            b=box.get(i);
            map.put(b.getName(), b.getId());
        }
        return map;
    }
 
    /**
     * 获取车间的        key:name   val:id
     * @return
     */
    public static Map<String,String> getworkshopNameAndID(){
        Map<String,String> map = new HashMap<String, String>();
        List<Combobox> box=BaseParams.getWorkShopCombobox(false);
        for (int i = 0; i < box.size(); i++) {
            Combobox b=new Combobox();
            b=box.get(i);
            map.put(b.getName(), b.getId());
        }
        return map;
    }
    /**
     * 设备类型        key:name  val:id
     * @return
     */
    public static Map<String,String> geteqpCategoryFromEqpType(){
        List<Combobox> box=BaseParams.getEqpCategoryCombobox(false);
        Map<String,String> map = new HashMap<String, String>();
        for (int i = 0; i < box.size(); i++) {
            Combobox b=new Combobox();
            b=box.get(i);
            map.put(b.getName(), b.getId());
        }
        return map;
    }
 
    /**
     * 解析excel 导入数据将文字转成对应id           key:单位名             val:单位id
     * @return
     */
    public static  Map<String,String> getUnit(){
        Map<String, String>  map=new HashMap<String, String>();
         List<Combobox> ls=BaseParams.getUnitCombobox(false);
         for (int i = 0; i < ls.size(); i++) {
            map.put(ls.get(i).getName(), ls.get(i).getId());
        }
        return map;
    }
    /**
     * 设备启用禁用
     *  map.put("启用", "1");
        map.put("禁用", "0");
     */
    public static Map<String,String> eqpStat(){
         Map<String, String> roleMap = new HashMap<String, String>();
         List<FixCodeBean> list=BaseParams.getListMdFixCode();
         if(list!=null && list.size()>0){
             for(FixCodeBean f:list){
                 if("IS001".equalsIgnoreCase(f.getUpcode())){
                     roleMap.put(f.getName(), f.getCode());
                 }
             }
         }
        return roleMap;
    }
    /**
     * 设备固入状态
     *  map.put("未入固", "1");
        map.put("已入固", "0");
     */
    public static Map<String,String> eqpPutStat(){
        Map<String, String> roleMap = new HashMap<String, String>();
         List<FixCodeBean> list=BaseParams.getListMdFixCode();
         if(list!=null && list.size()>0){
             for(FixCodeBean f:list){
                 if("GR001".equalsIgnoreCase(f.getUpcode())){
                     roleMap.put(f.getName(), f.getCode());
                 }
             }
         }
        return roleMap;
    }
    /**                                                对应字段
     * 转换的数据包括:表md_fix_code字段    upcode                    mes_code            code                type        bak
     *
     *                 物料转换            MAT0001                key:MES物料编码                val:数采物料id
     * *             单位转换            UNIT0001            key:MES单位编码                 val:数采单位id
     * *             物料类型转换        MATTYPE0001            key:MES物料类型编码        val:数采物料类型id
     * *             班次转换            SHIFT0001            key:MES班次编码        val:数采班次id
     * *             班组转换            TEAM0001            key:MES班组编码        val:数采班组id
     * *             车间转换            WORKSHOP0001        key:MES车间编码        val:数采车间id
     * *             工单中工段转换        WORKCENTEREQP0001   key:MES设备所属工段        val:数采设备code,              工单类型,        数采设备id
     * *             生产类型转换        PRODUCTTYPE0001        key:MES生产类型编码        val:数采生产类型id
     * *             设备类型 转换        EQPCATEGORY0001        key:MES设备类型编码        val:数采设备类型id
     * *             设备机型转换        MACHINETYPE0001        key:MES设备机型编码        val:数采设备机型id
     */
    /**
     * [功能说明]:通过mes_code,upcode找到md_fix_code表,返回对象
     *         注意mes_code可传MES编号,也可以传数采编号,由flag决定
     * @creatTime 2016年6月15日11:46:37
     * @author  wanchanghuang
     * @param  flag=true  mes_code:表示MES编号
     *         flag=false mes_code:表示数采编号
     *
     * */
    public static FixCodeBean getFixCodeByMesCode(String mes_code,String upcode,boolean flag){
        List<FixCodeBean> list=BaseParams.getListMdFixCode();
        FixCodeBean fixCodeBean=null;
        if(flag){
            for(FixCodeBean fcb:list){ //mes找数采
                if(mes_code.equals(fcb.getMesCode()) && upcode.equals(fcb.getUpcode())){
                    fixCodeBean=fcb;
                    break;
                }
            }
        }else{
            for(FixCodeBean fcb:list){ //数采找MES
                if(mes_code.equals(fcb.getCode()) && upcode.equals(fcb.getUpcode())){
                    fixCodeBean=fcb;
                    break;
                }
            }
        }
        return fixCodeBean;
    }
 
    /**
     * [功能说明]:true-通过MES设备CODE,找到设备对象并返回
     *          false-通过设备ID(equipmentcode),找到设备对象
     * */
    public static EquipmentsBean getEquipmentByMesCodeToId(String equipmentcode,boolean flag) {
        List<EquipmentsBean> list=BaseParams.getAllEquipments();
        if(flag){
            for(EquipmentsBean eb:list){
                if(equipmentcode.equals(eb.getMesEqpCode())){
                    EquipmentsBean eqb=new EquipmentsBean();
                    eqb.setId(eb.getId());
                    eqb.setName(eb.getName());
                    return eqb;
                }
            }
        }else{
            for(EquipmentsBean eb:list){
                if(equipmentcode.equals(eb.getId())){
                    EquipmentsBean eqb=new EquipmentsBean();
                    eqb.setId(eb.getId());
                    eqb.setName(eb.getName());
                    eqb.setMesEqpCode(eb.getMesEqpCode());
                    return eqb;
                }
            }
        }
 
        return null;
    }
 
 
    /**
     * wct设备有效作业率
     * jcTIme -就餐时间    wct就餐时间固定30分钟
     *
     * */
    public static Double jcTime=30d;
 
    /**
     * 设备轮完成保状态,目前全部完成为8
     */
    public static int Wctype=8;
 
    /**
     * 班次  1-早  2-中  3-晚   0-全部
     *
     * */
    public static String shift_0="0";
    public static String shift_1="1";
    public static String shift_2="2";
    public static String shift_3="3";
    /**
     * 班次  1-早  2-中  3-晚   0-全部
     * 取到具体的班次
     * 张璐
     *
     * */
    public static String[] getShift(){
        return new String[]{"0","1","2","3"};
    }
    /**
     * 周期  1-日  2-周  3-月   4-年
     *
     * */
    public static String period_1="1";
    public static String period_2="2";
    public static String period_3="3";
    public static String period_4="4";
    /**
     * 周期  1-日  2-周  3-月   4-年
     * @return
     */
    public static Map<String,String> getRh2(){
        Map<String, String> map=new HashMap<String, String>();
        map.put("日", "1");
        map.put("周", "2");
        map.put("月", "3");
        map.put("年", "4");
        return map;
    }
 
 
    /**
     * 共鞥:用于判定WCT设备点检中维修主管信息状态
     * 0-未完成,1-通过,2-有故障
     */
    public static String che_WX0="0";
    public static String che_WX1="1";
    public static String che_WX2="2";
    /**
     * 条烟提升机code
     */
    public static Integer TYTS_CODE=151;
    /**
     * 张璐
     * excel导出设置行数和页数
     * 生产统计中,导出暂设置为1W条
     */
    public static int page=1;
    public static int rows=10000;
 
 
 
    /**
     * 包装机设备类型code
     */
    public static int packerEqpTypeCode=2;
    /**
     * 卷烟机设备类型code
     */
    public static int rollerEqpTypeCode=1;
    /**
     * 封箱机设备类型code
     */
    public static int sealerEqpTypeCode=3;
    /**
     * 成型机设备类型code
     */
    public static int filterEqpTypeCode=4;
    /**
     * 发射机设备类型code
     */
    public static int launchEqpTypeCode=5;
    /**
     * 装盘机设备类型code
     */
    public static int snatchEqpTypeCode=6;
    /**
     * 卸盘机设备类型code
     */
    public static int unsnatchEqpTypeCode=7;
 
    /**
     * 盘纸规格  交接班使用
     */
    public static Double pz_gg=5000D;
    ////////////////////////////////WCT 与 PMS 数据交互数据暂存////////////////////
    //用于区别各个字段代表的数据含义
    /**
     * 未过滤点位和处理的原始数据
     */
    public static int ORIGINALDATA=1;
    /**
     * 处理后的数据
     */
    public static int FINALDATA=2;
 
    /**
     * 原始数据集合(key为当前会话id)
     */
    public static HashMap<String,String> ORIGINALDATA_MAP=new HashMap<>();
    /**
     * 处理后的数据集合(key为当前会话id)
     */
    public static HashMap<String,String> FINALDATA_MAP=new HashMap<>();
 
 
 
 
 
    /**
     *
     *  0:重量
     *  1:圆周
        2//圆度
        3//长度
        4//吸阻
        5//总通风率
        6//硬度
        20支质量
        含水率,含末率,端部落丝量,端部位置
     *
     * */
    public static String getZJCJType(String code){
        String type="-1";
        if(code.equals("JZYZZL")||code.equals("CPZL")){
            type="0";
        }else if(code.equals("JZYZYZ")||code.equals("FTLLBYZ")||code.equals("CPYZ")){
            type="1";
        }else if(code.equals("FTLLBYD")){
            type="2";
        }else if(code.equals("JZYZCD")||code.equals("FTLLBCD")||code.equals("CPCD")){
            type="3";
        }else if(code.contains("JZYZXZ")||code.equals("FTLLBXZ")||code.equals("CPXZ")){
            type="4";
        /*}else if(code.equals("JZYZZL")||code.equals("FTLLBZL")){
            type="5";*/
        }else if(code.equals("JZYZYD")||code.equals("FTLLBYD1")||code.equals("CPYD")){
            type="6";
        }
        return type;
    }
 
 
 
 
 
}