فهرست منبع

Merge branch 'feature/organization_import' into 'develop'

人员组织导入导出服务_模板列名修改以及描述

See merge request o2oa/o2oa!848
o2null 5 سال پیش
والد
کامیت
a93bdc7f82

+ 1 - 1
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/export/ActionExportAll.java

@@ -377,7 +377,7 @@ public class ActionExportAll extends BaseAction {
 			row.createCell(1).setCellValue("群组编号 *");
 			row.createCell(2).setCellValue("人员编号");
 			row.createCell(3).setCellValue("组织编号");
-			row.createCell(4).setCellValue("群组编号");
+			row.createCell(4).setCellValue("群组编号");
 			row.createCell(5).setCellValue("描述");
 
 			for (int i = 0; i < groupList.size(); i++) {

+ 12 - 0
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/inputperson/ActionInputAll.java

@@ -72,6 +72,7 @@ class ActionInputAll extends BaseAction {
 	private  boolean wholeFlag = false;
 	
 	private static Map<String, String> dutyMap = new HashMap<String,String>();
+	private static Map<String, String> dutyDescriptionMap = new HashMap<String,String>();
 	
 	List<UnitItem> unit = new ArrayList<>();
 	List<PersonItem> person = new ArrayList<>();
@@ -192,6 +193,7 @@ class ActionInputAll extends BaseAction {
 				if (null != row) {
 					String name = configurator.getCellStringValue(row.getCell(configurator.getNameColumn()));
 					String key = configurator.getCellStringValue(row.getCell(configurator.getUniqueColumn()));
+					String dutyDescription = configurator.getCellStringValue(row.getCell(configurator.getDescriptionColumn()));
 					//System.out.println("职务name="+name+"_职务value="+key);
 					if(StringUtils.isNotEmpty(name) && StringUtils.isNotEmpty(key)){
 						dutyMap.put(key, name);
@@ -199,6 +201,11 @@ class ActionInputAll extends BaseAction {
 					}else{
 						dutyFlag = true;
 					}
+					if(StringUtils.isNotEmpty(dutyDescription) && StringUtils.isNotEmpty(key)){
+						dutyDescriptionMap.put(key, dutyDescription);
+					}else{
+						dutyDescriptionMap.put(key, "");
+					}
 				}
 			}
 	}
@@ -447,6 +454,7 @@ class ActionInputAll extends BaseAction {
 				String personCode = configurator.getCellStringValue(row.getCell(configurator.getPersonCodeColumn()));
 				String unitCode = configurator.getCellStringValue(row.getCell(configurator.getUnitCodeColumn()));
 				String groupCode = configurator.getCellStringValue(row.getCell(configurator.getGroupCodeColumn()));
+				String description = configurator.getCellStringValue(row.getCell(configurator.getDescriptionColumn()));
 				
 				//if (StringUtils.isNotEmpty(name) && StringUtils.isNotEmpty(mobile)) {
 					GroupItem groupItem = new GroupItem();
@@ -484,6 +492,9 @@ class ActionInputAll extends BaseAction {
 							 
 						 }
 					}
+					if(StringUtils.isNotEmpty(description)){
+						groupItem.setDescription(description);
+					}
 					
 					groups.add(groupItem);
 					logger.debug("scan group:{}.", groupItem);
@@ -508,6 +519,7 @@ class ActionInputAll extends BaseAction {
 					DutyItem dutyItem = new DutyItem();
 					dutyItem.setRow(i+1);
 					dutyItem.setName(dutyMap.get(dutyCode));
+					dutyItem.setDescription(dutyDescriptionMap.get(dutyCode));
 					EntityManagerContainer emc = business.entityManagerContainer();
 					
 					Unit u = null;

+ 2 - 2
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/inputperson/ActionTemplate.java

@@ -136,7 +136,7 @@ public class ActionTemplate extends BaseAction {
 		XSSFSheet sheet = workbook.createSheet("职务信息");
 		Row row = sheet.createRow(0);
 		Cell cell = row.createCell(0);
-		cell.setCellValue("职务号 *");
+		cell.setCellValue("职务号 *");
 		cell = row.createCell(1);
 		cell.setCellValue("职务名称 *");
 		cell = row.createCell(2);
@@ -160,7 +160,7 @@ public class ActionTemplate extends BaseAction {
 		cell = row.createCell(3);
 		cell.setCellValue("组织编号");
 		cell = row.createCell(4);
-		cell.setCellValue("群组编号");
+		cell.setCellValue("群组编号");
 		cell = row.createCell(5);
 		cell.setCellValue("描述");
 		CellStyle cellStyle = workbook.createCellStyle();

+ 9 - 1
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/inputperson/DutySheetConfigurator.java

@@ -27,6 +27,7 @@ public class DutySheetConfigurator extends GsonPropertyObject {
 
 	private Integer nameColumn;
 	private Integer uniqueColumn;
+	private Integer descriptionColumn;
 
 	private Map<String, Integer> attributes = new HashMap<>();
 
@@ -46,7 +47,9 @@ public class DutySheetConfigurator extends GsonPropertyObject {
 						this.uniqueColumn = i;
 					} else if (nameItems.contains(str)) {
 						this.nameColumn = i;
-					}else {
+					}else if (descriptionItems.contains(str)) {
+						this.descriptionColumn = i;
+					} else {
 						Matcher matcher = attributePattern.matcher(str);
 						if (matcher.matches()) {
 							String attribute = matcher.group(1);
@@ -60,6 +63,7 @@ public class DutySheetConfigurator extends GsonPropertyObject {
 
 	private static List<String> uniqueItems = Arrays.asList(new String[] { "职务编号 *",  "unique" });
 	private static List<String> nameItems = Arrays.asList(new String[] { "职务名称 *", "name" });
+	private static List<String> descriptionItems = Arrays.asList(new String[] { "描述","职务描述", "description" });
 
 	public String getCellStringValue(Cell cell) {
 		if (null != cell) {
@@ -102,6 +106,10 @@ public class DutySheetConfigurator extends GsonPropertyObject {
 	public Map<String, Integer> getAttributes() {
 		return attributes;
 	}
+	
+	public Integer getDescriptionColumn() {
+		return descriptionColumn;
+	}
 
 	public Integer getFirstRow() {
 		return firstRow;

+ 1 - 1
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/inputperson/GroupSheetConfigurator.java

@@ -74,7 +74,7 @@ public class GroupSheetConfigurator extends GsonPropertyObject {
 	private static List<String> nameItems = Arrays.asList(new String[] { "群组名称 *", "name" });
 	private static List<String> personCodeItems = Arrays.asList(new String[] { "人员编号", "personCode" });
 	private static List<String> unitCodeItems = Arrays.asList(new String[] { "组织编号", "unitCode" });
-	private static List<String> groupCodeItems = Arrays.asList(new String[] { "群组编号", "groupCode" });
+	private static List<String> groupCodeItems = Arrays.asList(new String[] { "子群组编号","群组编号", "groupCode" });
 	private static List<String> descriptionItems = Arrays.asList(new String[] { "描述","群组描述", "description" });
 
 	public String getCellStringValue(Cell cell) {