shichongfu
2023-04-25 ce0b49552668d3331055e2b1a1447a743dc54939
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
509
510
511
package com.product.org.admin.service;
 
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.product.admin.service.OrganizationCacheService;
import com.product.core.cache.DataPoolRefreshCache;
import com.product.core.entity.FieldMetaEntity;
import com.product.module.sys.entity.SystemUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
 
import org.apache.commons.lang3.StringUtils;
import com.product.admin.service.UpdateLoginUserInfoService;
import com.product.core.dao.BaseDao;
import com.product.core.entity.DataTableEntity;
import com.product.core.entity.FieldSetEntity;
import com.product.core.exception.BaseException;
import com.product.core.service.support.AbstractBaseService;
import com.product.core.service.support.QueryFilterService;
import com.product.core.spring.context.SpringMVCContextHolder;
import com.product.org.admin.config.CmnConst;
import com.product.org.admin.config.SystemCode;
import com.product.org.admin.util.InternationalLanguage;
import com.product.util.BaseUtil;
import com.product.core.permission.PermissionService;
 
import java.util.*;
import java.util.Map.Entry;
 
/**
 * Copyright © 2020 LX-BASE
 *
 * @Title: LX-BASE-SERVER
 * @Project: base-server-org-admin
 * @Date: 2020年6月10日
 * @Author: Mr.Xu
 * @Description:岗位管理Service
 */
@Component
public class SystemPostsService extends AbstractBaseService {
 
    @Autowired
    public BaseDao dao;
    @Autowired
    PermissionService permissionService;
    @Autowired
    private UpdateLoginUserInfoService updateLoginUserInfoService;
    @Autowired
    public QueryFilterService queryFilterService;
    @Autowired
    public OrganizationCacheService organizationCacheService;
 
    /**
     * 岗位管理列表
     *
     * @param fse
     * @return
     * @throws BaseException
     */
    public DataTableEntity listPosts(FieldSetEntity fse) throws BaseException {
        // 郑盟 2020年12月22日 下午18:34
        String queryFilter = "";
        if (!BaseUtil.dataTableIsEmpty(fse.getSubDataTable("systemSeniorQueryString"))) {
            queryFilter = " and " + queryFilterService.getQueryFilter(fse);
        }
        // 数据条件
        String dataFilter;
        SystemUser currentUser = SpringMVCContextHolder.getCurrentUser();
        if(1 == currentUser.getUserType()){
//            dataFilter = CmnConst.DEPT_UUID +" = "+ "'"+currentUser.getOrg_level_uuid()+"'";
            dataFilter = CmnConst.DEPT_UUID + " = 1";
        }else {
            fse.setValue(CmnConst.ORG_LEVEL_UUID, currentUser.getOrg_level_uuid());
            dataFilter = permissionService.getDataFilter(CmnConst.ORG_LEVEL_UUID) + " and " + CmnConst.DEPT_UUID + " != 1";
        }
 
        // 岗位信息
        DataTableEntity dtJobPostInfo = dao.listTable("product_sys_job_posts", dataFilter + queryFilter, new Object[]{},
                new Object[]{}, CmnConst.SEQUENCE, fse.getInteger(CmnConst.PAGESIZE), fse.getInteger(CmnConst.CPAGE));
        // 岗位信息国际化
        // 遍历岗位信息
        if (dtJobPostInfo != null && dtJobPostInfo.getRows() > 0) {
            for (int i = 0; i < dtJobPostInfo.getRows(); i++) {
                FieldSetEntity fseJobPostInfo = dtJobPostInfo.getFieldSetEntity(i);
 
                String job_post_uuid = fseJobPostInfo.getUUID(); // 岗位uuid
                String dept_uuid = fseJobPostInfo.getString("dept_uuid"); // 所属部门
 
                // 获取岗位对应岗位等级
                DataTableEntity dtPostGrade = dao.listTable("product_sys_job_posts_grades_mapping", "job_post_uuid=?",
                        new Object[]{job_post_uuid});
                StringBuilder job_post_grades = new StringBuilder();
                forDtPostGrade(dtPostGrade, job_post_grades);
                // 装载人员数量
                DataTableEntity staffsNum = dao.listTable("product_sys_staffs", "job_post_uuid=?",
                        new Object[]{job_post_uuid});
                fseJobPostInfo.setValue("staffs_number", staffsNum == null ? 0 : staffsNum.getRows());
                if(1 == currentUser.getUserType()){
                    continue;
                }
                // 装载岗位等级
                fseJobPostInfo.setValue("job_post_grades", job_post_grades);
 
                // 获取部门信息
                FieldSetEntity fseDeptInfo = dao.getFieldSetEntity(CmnConst.PRODUCT_SYS_ORG_LEVELS, dept_uuid, false);
                if (fseDeptInfo == null) {
                    throw new BaseException(SystemCode.SYSTEM_GET_DEPARTMENTINFO_FAIL.getValue(), SystemCode.SYSTEM_GET_DEPARTMENTINFO_FAIL.getText());
                }
                FieldSetEntity fseDeptLanguage = dao.listInternationDataTable(fseDeptInfo, null);
 
                // 获取部门国际化全称
                Map<String, String> deptAllLanguage = InternationalLanguage
                        .parseLanguage(fseDeptLanguage.getSubDataTable(CmnConst.ORG_LEVEL_ALL));
 
                // 获取客户信息
                FieldSetEntity fseClientInfo = dao.getFieldSetEntity(CmnConst.PRODUCT_SYS_CLIENTS,
                        fseDeptInfo.getString("client_uuid"), false);
                if (fseClientInfo == null) {
                    throw new BaseException(SystemCode.GET_CLINET_FIAL.getValue(), SystemCode.GET_CLINET_FIAL.getText());
                }
                FieldSetEntity fseClientLanguage = dao.listInternationDataTable(fseClientInfo, null);
 
                // 获取部门国际化名称
                Map<String, String> clientNameLanguage = InternationalLanguage
                        .parseLanguage(fseClientLanguage.getSubDataTable(CmnConst.CLIENT_NAME));
 
                Map<String, DataTableEntity> international = new HashMap<>();
 
                // 创建国际化信息
                DataTableEntity dtInternational = new DataTableEntity();
                FieldMetaEntity fseMate = new FieldMetaEntity();
                fseMate.setTableName(new Object[]{"dept_all"});
 
                // 遍历客户名称国际化
                forClientNameLanguage(clientNameLanguage, deptAllLanguage, dtInternational);
                international.put("dept_all", dtInternational);
 
                // 装载全路径
                fseJobPostInfo.setSubData(international);
            }
        }
        DataTableEntity dtJobPostLanguage = dao.listInternationDataTable(dtJobPostInfo, null);
        dao.loadPromptData(dtJobPostLanguage);
 
        return dtJobPostLanguage;
    }
 
    private void forDtPostGrade(DataTableEntity dtPostGrade, StringBuilder job_post_grades) {
        if (dtPostGrade.getRows() > 0) {
            for (int j = 0; j < dtPostGrade.getRows(); j++) {
                FieldSetEntity fsePostGradeInfo = dtPostGrade.getFieldSetEntity(j);
                job_post_grades.append(fsePostGradeInfo.getUUID());
                if (j != dtPostGrade.getRows() - 1) {
                    job_post_grades.append(",");
                }
            }
        }
    }
 
    private void forClientNameLanguage(Map<String, String> clientNameLanguage, Map<String, String> deptAllLanguage,
                                       DataTableEntity dtInternational) {
 
        if (clientNameLanguage == null) {
            return;
        }
        for (Entry<String, String> clientNameLanguageMap : clientNameLanguage.entrySet()) {
            String languageCode = clientNameLanguageMap.getKey();
            String languageClientName = clientNameLanguageMap.getValue();
 
            if (deptAllLanguage != null) {
                String languageDeptAll = deptAllLanguage.get(languageCode);
                FieldSetEntity fseLanguage = new FieldSetEntity();
                fseLanguage.setTableName("dept_all");
                fseLanguage.setValue(languageCode, languageClientName + ">" + languageDeptAll);
                dtInternational.addFieldSetEntity(fseLanguage);
            } else {
                FieldSetEntity fseLanguage = new FieldSetEntity();
                fseLanguage.setTableName("dept_all");
                fseLanguage.setValue(languageCode, languageClientName);
                dtInternational.addFieldSetEntity(fseLanguage);
            }
 
        }
    }
 
    /**
     * 岗位详情
     *
     * @param fse
     * @return
     * @throws BaseException
     */
    public FieldSetEntity findPost(FieldSetEntity fse) throws BaseException {
        FieldSetEntity fs = dao.getFieldSetEntity(fse.getTableName(), fse.getString(CmnConst.UUID), false);
        DataTableEntity dt2 = dao.listTable("product_sys_job_posts_grades_mapping", "job_post_uuid=?",
                new String[]{fs.getString("uuid")});
        StringBuilder grade_uuids = new StringBuilder();
        if (dt2.getRows() > 0) {
            for (int j = 0; j < dt2.getRows(); j++) {
                FieldSetEntity fs2 = dt2.getFieldSetEntity(j);
                grade_uuids.append(fs2.getString("job_grade_uuid"));
                if (j + 1 < dt2.getRows() && dt2.getFieldSetEntity(j + 1) != null) {
                    grade_uuids.append(",");
                }
            }
        }
        fs.setValue("job_post_grades", grade_uuids);
        // xu pengcheng updateTime 2020-11-28 14:33:18 删除手动国际化代码
 
        // 杜洪波 updatetime 2020-12-08 17:19:00 岗位详情封装使用人数
        DataTableEntity postToStaff = dao.listTable(CmnConst.PRODUCT_SYS_STAFFS, "job_post_uuid=?",
                new Object[]{fse.getString(CmnConst.UUID)});
        if (BaseUtil.dataTableIsEmpty(postToStaff)) {
            fs.setValue("staffs_number", 0);
        } else {
            fs.setValue("staffs_number", postToStaff.getRows());
        }
 
        return dao.listInternationDataTable(fs, null);
    }
 
    /**
     * 新增岗位
     *
     * @param fse
     * @return
     * @throws BaseException
     */
    public String addPost(FieldSetEntity fse) throws BaseException {
        FieldSetEntity post = findPostByAdd(fse);
        if (post != null && !StringUtils.isEmpty(post.getUUID())) {
            throw new BaseException(SystemCode.SYSTEM_POST_EXIST_DEPT_ADD_FAIL.getValue(),
                    SystemCode.SYSTEM_POST_EXIST_DEPT_ADD_FAIL.getText());
        }
        fse = BaseUtil.createCreatorAndCreationTime(SpringMVCContextHolder.getCurrentUser(), fse);
        FieldSetEntity fs = fse;
        fs.remove("job_post_grades");
        fs.setValue("org_level_uuid", SpringMVCContextHolder.getCurrentUser().getOrg_level_uuid());
        String uuid = dao.add(fs);
        String job_post_grades = fse.getString("job_post_grades");
        if(!BaseUtil.strIsNull(job_post_grades)){
            String[] grades = job_post_grades.split(",");
            for (int i = 0; i < grades.length; i++) {
                FieldSetEntity fsg = new FieldSetEntity();
                FieldMetaEntity f = new FieldMetaEntity();
                f.setTableName(new Object[]{"product_sys_job_posts_grades_mapping"});
                fsg.setMeta(f);
                fsg.setValue("job_post_uuid", uuid);
                fsg = BaseUtil.createCreatorAndCreationTime(SpringMVCContextHolder.getCurrentUser(), fsg);
                String grade_uuid = grades[i];
                fsg.setValue("job_grade_uuid", grade_uuid);
                dao.add(fsg);
            }
        }
        return uuid;
    }
 
    /**
     * 查重
     */
    public FieldSetEntity findPostByAdd(FieldSetEntity fse) throws BaseException {
        fse = BaseUtil.createCreatorAndCreationTime(SpringMVCContextHolder.getCurrentUser(), fse);
        return dao.getFieldSetEntityByFilter(
                "product_sys_job_posts", "job_post_name=? and org_level_uuid=? and dept_uuid=?", new String[]{
                        fse.getString("job_post_name"), fse.getString("org_level_uuid"), fse.getString("dept_uuid")},
                false);
    }
 
    /**
     * 修改岗位
     *
     * @param fse
     * @return
     * @throws BaseException
     */
    public boolean updatePost(FieldSetEntity fse) throws BaseException {
        FieldSetEntity fieldSetEntity = dao.getFieldSetEntity(fse.getTableName(), fse.getString(CmnConst.UUID), false);
        String job_post_grades = fse.getString("job_post_grades");
        // 验证岗位等级是否被删除,如有被删除的验证员工是否引用了此岗位
        verifPostGrades(job_post_grades, fse);
        // 验证是否修改所属部门
        if (!fieldSetEntity.getString("dept_uuid").equals(fse.getString("dept_uuid"))) {
            boolean verifyPostExistStaffs = verifyPostExistStaffs(fse.getString(CmnConst.UUID));
            if (verifyPostExistStaffs) {
                throw new BaseException(SystemCode.SYSTEM_POSTS_UPDATE_EXIST_STAFF_FAIL.getValue(),
                        SystemCode.SYSTEM_POSTS_UPDATE_EXIST_STAFF_FAIL.getText(), this.getClass(), "updatePost");
            }
        }
        fse = BaseUtil.createCreatorAndCreationTime(SpringMVCContextHolder.getCurrentUser(), fse);
        DataTableEntity grades_mapping = dao.listTable("product_sys_job_posts_grades_mapping", "job_post_uuid=?",
                new String[]{fse.getUUID()});
        List<String> list = new ArrayList<>();
        if (grades_mapping.getRows() > 0) {
            for (int i = 0; i < grades_mapping.getRows(); i++) {
                FieldSetEntity fss = grades_mapping.getFieldSetEntity(i);
                list.add(fss.getString("job_grade_uuid"));
            }
        }
        addDelGrade(fse, list);
        fse.remove("job_post_grades");
        // xupengcheng dateTime 2020年11月28日14:35:21 修改岗位更新所属岗位人员信息
        updateLoginUserInfoService.updateUserInfoByPostUuid(fse.getUUID(), true);
        return dao.update(fse);
    }
 
    private void verifPostGrades(String job_post_grades, FieldSetEntity fse) {
        if (!StringUtils.isEmpty(job_post_grades)) {
            String newjob_post_grades = fse.getString("job_post_grades");
            String[] job_post_grade = job_post_grades.split(",");
            StringBuilder uuids = new StringBuilder();
            appendUuids(newjob_post_grades, job_post_grade, uuids, job_post_grades);
            if (uuids.length() != 0) {
                String uuidString = uuids.toString().substring(1);
                String sql = "select * from " + CmnConst.PRODUCT_SYS_STAFFS + " where job_post_grade_uuid in ('"
                        + uuidString.replace(",", "','") + "')";
                DataTableEntity listTable = dao.listTable(sql, new Object[]{});
                if (listTable != null && listTable.getRows() > 0)
                    throw new BaseException(SystemCode.SYSTEM_POSTS_DELETE_EXIST_POST_GRAGES_FAIL.getValue(),
                            SystemCode.SYSTEM_POSTS_DELETE_EXIST_POST_GRAGES_FAIL.getText(), this.getClass(),
                            "updatePost");
            }
        }
    }
 
    private void appendUuids(String newjob_post_grades, String[] job_post_grade, StringBuilder uuids,
                             String job_post_grades) {
        if (!StringUtils.isEmpty(newjob_post_grades)) {
            String[] newjob_post_grade = newjob_post_grades.split(",");
            for (int i = 0; i < job_post_grade.length; i++) {
                boolean is_exist = false;
                for (int j = 0; j < newjob_post_grade.length; j++) {
                    if (job_post_grade[i].equals(newjob_post_grade[j])) {
                        is_exist = true;
                        break;
                    }
                }
                if (!is_exist) {
                    uuids.append(",");
                    uuids.append(job_post_grade[i]);
                }
            }
        } else {
            // 改变 等于空
            uuids.append(",");
            uuids.append(job_post_grades);
        }
    }
 
    private void addDelGrade(FieldSetEntity fse, List<String> list) {
        // 前台等级
        String[] grade_view = fse.getString("job_post_grades").split(",");
        // 数据库等级
        List<String> list_view = Arrays.asList(grade_view);
        // 新增等级
        for (int i = 0; i < grade_view.length; i++) {
            String grade_v = grade_view[i];
            if (list.contains(grade_v)) {
                continue;
            } else {
                FieldSetEntity fs = new FieldSetEntity();
                fs.setTableName("product_sys_job_posts_grades_mapping");
                fs.setValue("job_post_uuid", fse.getString("uuid"));
                fs.setValue("job_grade_uuid", grade_v);
                fs = BaseUtil.createCreatorAndCreationTime(SpringMVCContextHolder.getCurrentUser(), fs);
                dao.add(fs);
            }
        }
        // 删除等级
        for (int i = 0; i < list.size(); i++) {
            String grade_v = list.get(i);
            if (list_view.contains(grade_v)) {
                continue;
            } else {
                FieldSetEntity fsd = dao.getFieldSetEntityByFilter("product_sys_job_posts_grades_mapping",
                        "job_post_uuid=? and job_grade_uuid=?", new String[]{fse.getString("uuid"), grade_v}, false);
                dao.delete("product_sys_job_posts_grades_mapping", "uuid=?", new String[]{fsd.getString("uuid")});
            }
        }
    }
 
    /**
     * 查询岗位是否有关联员工
     *
     * @param post_uuid
     * @return
     * @throws BaseException
     */
    private boolean verifyPostExistStaffs(String post_uuid) throws BaseException {
        DataTableEntity listTable = dao.listTable(CmnConst.PRODUCT_SYS_STAFFS, "job_post_uuid=?",
                new Object[]{post_uuid});
        if (!BaseUtil.dataTableIsEmpty(listTable))
            return true;
        return false;
    }
 
    /**
     * 删除岗位
     *
     * @param fse
     * @return
     * @throws BaseException
     */
    public boolean deletePost(FieldSetEntity fse) throws BaseException {
        boolean verifyPostExistStaffs = verifyPostExistStaffs(fse.getString(CmnConst.UUID));
        if (verifyPostExistStaffs) {
            throw new BaseException(SystemCode.SYSTEM_POSTS_DELETE_EXIST_STAFF_FAIL.getValue(),
                    SystemCode.SYSTEM_POSTS_DELETE_EXIST_STAFF_FAIL.getText(), this.getClass(), "deletePost");
        }
        DataTableEntity dt = dao.listTable("product_sys_job_posts_grades_mapping", "job_post_uuid=?",
                new String[]{fse.getUUID()});
        if (dt.getRows() > 0) {
            for (int i = 0; i < dt.getRows(); i++) {
                FieldSetEntity fs = dt.getFieldSetEntity(i);
                dao.delete("product_sys_job_posts_grades_mapping", "uuid=?", new String[]{fs.getString("uuid")});
            }
        }
        return dao.delete(fse.getTableName(), new String[]{fse.getString(CmnConst.UUID)});
    }
 
    // 数据迁移
    public Boolean movePost() throws BaseException {
        DataTableEntity dt = dao.listTable("product_sys_job_posts");
        if (dt.getRows() > 0) {
            for (int i = 0; i < dt.getRows(); i++) {
                FieldSetEntity fs = dt.getFieldSetEntity(i);
                String[] job_post_grades = fs.getString("job_post_grades").split(",");
                for (int j = 0; j < job_post_grades.length; j++) {
                    String job_post_grade = job_post_grades[j];
                    FieldSetEntity fsd = new FieldSetEntity();
                    fsd.setTableName("product_sys_job_posts_grades_mapping");
                    fsd.setValue("job_post_uuid", fs.getString("uuid"));
                    fsd.setValue("job_grade_uuid", job_post_grade);
                    fsd.setValue("created_by", fs.getString("created_by"));
                    fsd.setValue("created_utc_datetime", fs.getString("created_utc_datetime"));
                    dao.add(fsd);
                }
            }
            return true;
        }
        return false;
    }
 
    /**
     * 获取通用岗位
     * @param fse
     * @return
     */
    public DataTableEntity getGeneralPostName(FieldSetEntity fse){
        DataTableEntity dataTableEntity = dao.listTable(" SELECT * FROM product_sys_job_posts WHERE LENGTH(dept_uuid) < 16 ",new String[]{},fse.getInteger(CmnConst.PAGESIZE),fse.getInteger(CmnConst.CPAGE));
        return dataTableEntity;
    }
 
    public Boolean addGeneralPostName(FieldSetEntity fse){
        //获取org_level_uuid
        String orgLevelUuid = SpringMVCContextHolder.getCurrentUser().getOrg_level_uuid();
        Integer userId = SpringMVCContextHolder.getCurrentUser().getUser_id();
        FieldSetEntity sqlFse = dao.getFieldSetBySQL(" SELECT MAX(sequence) maxSequence FROM product_sys_job_posts ", new String[]{},false);
        String maxSequence = sqlFse.getString("maxSequence");
        Integer indexNum = 0;
        if(!BaseUtil.strIsNull(maxSequence)){
            indexNum = Integer.parseInt(maxSequence);
        }
        //岗位名称集
        String[] job_post_name = fse.getString("job_post_names").split(",");
        //部门元素集
        String dept = fse.getString("dept");
        JSONArray deptArray = JSONArray.parseArray(dept);
        DataTableEntity dataTableEntity = new DataTableEntity();
        FieldMetaEntity f = new FieldMetaEntity();
        f.setTableName(new String[]{ "product_sys_job_posts" });
        dataTableEntity.setMeta(f);
            for (int j = 0; j < job_post_name.length; j++) {
                contDept:
                for (int i = 0; i < deptArray.size(); i++) {
                    JSONObject deptObject = deptArray.getJSONObject(i);
                    JSONArray children = deptObject.getJSONArray("children");
                    //下面没有岗位
                    if(children != null && children.size() > 0){
                        for (int k = 0; k < children.size(); k++) {
                            JSONObject postObject = children.getJSONObject(k);
                            if(job_post_name[j].equals(postObject.getString("label"))){
                                //相同就不添加岗位
                                continue contDept;
                            }
                        }
                    }
                    indexNum ++;
                    FieldSetEntity fieldSetEntity = new FieldSetEntity();
                    fieldSetEntity.setTableName("product_sys_job_posts");
                    fieldSetEntity.setValue("org_level_uuid",orgLevelUuid);
                    fieldSetEntity.setValue("job_post_description",job_post_name[j]);
                    fieldSetEntity.setValue("is_used",1);
                    fieldSetEntity.setValue("sequence",indexNum);
                    fieldSetEntity.setValue("dept_uuid",deptObject.getString("value"));
                    fieldSetEntity.setValue("job_post_name",job_post_name[j]);
                    fieldSetEntity.setValue("created_by" ,userId);
                    fieldSetEntity.setValue("created_utc_datetime" , new Date());
                    dataTableEntity.addFieldSetEntity(fieldSetEntity);
                }
            }
            if(dataTableEntity.getRows() == 0){
                throw new BaseException(SystemCode.SYSTEM_POST_EXIST_DEPT_ADD_FAIL.getValue(), SystemCode.SYSTEM_POST_EXIST_DEPT_ADD_FAIL.getText());
            }
        Boolean flag = dao.add(dataTableEntity);
            //刷新岗位缓存
//        organizationCacheService.cachePost(null);
        //更新缓存数据-------------------------------------------
//        DataPoolRefreshCache.getInstance().put("product_sys_job_posts");
        return flag;
    }
}