Просмотр исходного кода

人员组织导入导出服务

luojing 5 лет назад
Родитель
Сommit
e144d256e3

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

@@ -225,9 +225,8 @@ public class ActionExportAll extends BaseAction {
 			row.createCell(1).setCellValue("组织编号 *");
 			row.createCell(2).setCellValue("组织级别名称 *");
 			row.createCell(3).setCellValue("上级组织编号");
-			row.createCell(4).setCellValue("组织代字");
-			row.createCell(5).setCellValue("描述");
-			row.createCell(6).setCellValue("排序号");
+			row.createCell(4).setCellValue("描述");
+			row.createCell(5).setCellValue("排序号");
 
 			for (int i = 0; i < unitList.size(); i++) {
 				unit = unitList.get(i);
@@ -253,9 +252,8 @@ public class ActionExportAll extends BaseAction {
 					}
 					
 				}
-				row.createCell(4).setCellValue(unit.getShortName());
-				row.createCell(5).setCellValue(unit.getDescription());
-				row.createCell(6).setCellValue(unit.getOrderNumber()+"");
+				row.createCell(4).setCellValue(unit.getDescription());
+				row.createCell(5).setCellValue(unit.getOrderNumber()+"");
 				
 			}
 		}

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

@@ -6,10 +6,10 @@ import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
+import java.util.Random;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -32,11 +32,6 @@ import org.apache.poi.ss.util.CellUtil;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
 
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
-
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
 import com.x.base.core.entity.type.GenderType;
@@ -73,11 +68,9 @@ class ActionInputAll extends BaseAction {
 	private static Logger logger = LoggerFactory.getLogger(ActionInputAll.class);
 	
 	private  boolean dutyFlag = false;
-	private  boolean unitTypeFlag = false;
 	
 	private  boolean wholeFlag = false;
 	
-	private static Map<String, String> typeMap = new HashMap<String,String>();
 	private static Map<String, String> dutyMap = new HashMap<String,String>();
 	
 	List<UnitItem> unit = new ArrayList<>();
@@ -122,36 +115,7 @@ class ActionInputAll extends BaseAction {
 		}
 	}
 
-	private void scan(Business business, XSSFWorkbook workbook) throws Exception {
-	//导入组织级别
-		Sheet sheet = workbook.getSheetAt(1);
-		System.out.println("sheet="+sheet.getSheetName());
-		UnitTypeSheetConfigurator configurator = new UnitTypeSheetConfigurator(workbook, sheet);
-		if (null == configurator.getTypeCodeColumn()) {
-			throw new ExceptionTypeCodeColumnEmpty();
-		}
-		if (null == configurator.getTypeNameColumn()) {
-			throw new ExceptionTypeNameColumnEmpty();
-		}
 	
-		for (int i = configurator.getFirstRow(); i <= configurator.getLastRow(); i++) {
-			Row row = sheet.getRow(i);
-			if (null != row) {
-				String name = configurator.getCellStringValue(row.getCell(configurator.getTypeCodeColumn()));
-				String value = configurator.getCellStringValue(row.getCell(configurator.getTypeNameColumn()));
-				System.out.println("name="+name+"_value="+value);
-				if(StringUtils.isNotEmpty(name) && StringUtils.isNotEmpty(value)){
-					typeMap.put(name, value);
-					
-				}else{
-					unitTypeFlag = true;
-				}
-			}
-		}
-		if(!unitTypeFlag){
-			this.scanUnit(business,workbook);
-		}
-	}
 	
 	private void scanUnit(Business business, XSSFWorkbook workbook) throws Exception {
 	//导入组织信息
@@ -171,6 +135,7 @@ class ActionInputAll extends BaseAction {
 		Sheet sheet = workbook.getSheetAt(2);
 		configuratorPerson = new PersonSheetConfigurator(workbook, sheet);
 		person = this.scanPersonList(configuratorPerson, sheet);
+		System.out.println("person="+person.size());
 		wholeFlag = this.checkPerson(business, workbook, configuratorPerson, person); 
 		if(wholeFlag){
 			this.scanIdentity(business, workbook,person,unit);
@@ -199,8 +164,9 @@ class ActionInputAll extends BaseAction {
 							this.persistIdentity(workbook, configuratorIdentity, identity);
 							System.out.println("开始导入职务信息--------");
 							//保存职务
-							duty = this.scanDutyList(business,configuratorIdentity, sheet);
-							this.persistDuty(workbook, configuratorDuty, duty);
+							duty = this.scanDutyList(business,identity, sheet);
+							//this.persistDuty(workbook, configuratorDuty, duty);
+							this.persistDuty(workbook, configuratorDuty, duty,business);
 							
 							//保存群组
 							//校验群组
@@ -341,7 +307,7 @@ class ActionInputAll extends BaseAction {
 					PersonItem personItem = new PersonItem();
 					personItem.setRow(i);
 					name = StringUtils.trimToEmpty(name);
-					mobile = StringUtils.trimToEmpty(mobile);
+					//mobile = StringUtils.trimToEmpty(mobile);
 					GenderType genderType = GenderType.d;
 					if (null != configurator.getGenderTypeColumn()) {
 						String gender = configurator
@@ -356,7 +322,13 @@ class ActionInputAll extends BaseAction {
 					}
 					personItem.setName(name);
 					personItem.setGenderType(genderType);
-					personItem.setMobile(mobile);
+					
+					if(StringUtils.isNotEmpty(mobile)){
+						personItem.setMobile(mobile);
+					}else{
+						personItem.setMobile("139"+this.getCard());
+					}
+					
 			
 					if (null != configurator.getEmployeeColumn()) {
 						String employee = configurator
@@ -413,6 +385,7 @@ class ActionInputAll extends BaseAction {
 			if (null != row) {
 				String unique = configurator.getCellStringValue(row.getCell(configurator.getUniqueColumn()));
 				String unitCode = configurator.getCellStringValue(row.getCell(configurator.getUnitCodeColumn()));
+				String dutyCode = configurator.getCellStringValue(row.getCell(configurator.getDutyCodeColumn()));
 				String majorStr = configurator.getCellStringValue(row.getCell(configurator.getMajorColumn()));
 				Boolean major = false;
 				if(majorStr.equals("true")){
@@ -425,6 +398,10 @@ class ActionInputAll extends BaseAction {
 					identityItem.setUnitCode(unitCode);
 					identityItem.setMajor(major);
 					
+					if(StringUtils.isNotEmpty(dutyCode)){
+						identityItem.setDutyCode(dutyCode);
+					}
+					
 					EntityManagerContainer emc = business.entityManagerContainer();
 					Person personobj = null;
 					personobj = emc.flag(unique, Person.class);
@@ -441,8 +418,17 @@ class ActionInputAll extends BaseAction {
 						identityItem.setUnitLevelName(u.getLevelName());
 						identityItem.setUnitName(u.getName());					
 					}
-					
 					identitys.add(identityItem);
+					
+					int idcount = 0;
+					for(IdentityItem idItem : identitys){
+						if(unique.equals(idItem.getPersonCode()) && unitCode.equals(idItem.getUnitCode())){
+							idcount = idcount+1;
+						}
+					}
+					if(idcount>1){
+						identitys.remove(identityItem);
+					}
 					logger.debug("scan identity:{}.", identityItem);
 				//}
 			}
@@ -507,24 +493,20 @@ class ActionInputAll extends BaseAction {
 		return groups;
 	}
 	
-	private List<DutyItem> scanDutyList(Business business,IdentitySheetConfigurator configurator, Sheet sheet) throws Exception {
-		if (null == configurator.getDutyCodeColumn()) {
-			throw new ExceptionDutyCodeColumnEmpty();
-		}
+	private List<DutyItem> scanDutyList(Business business,List<IdentityItem> identityItems, Sheet sheet) throws Exception {
 		
 		List<DutyItem> dutys = new ArrayList<>();
-		for (int i = configurator.getFirstRow(); i <= configurator.getLastRow(); i++) {
-			Row row = sheet.getRow(i);
-			if (null != row) {
-				String dutyCode = configurator.getCellStringValue(row.getCell(configurator.getDutyCodeColumn()));
-				String unitCode = configurator.getCellStringValue(row.getCell(configurator.getUnitCodeColumn()));
-				String personCode = configurator.getCellStringValue(row.getCell(configurator.getUniqueColumn()));
+		for (int i = 0; i < identityItems.size(); i++) {
+			IdentityItem identutyIt = identityItems.get(i);
+			if (null != identutyIt) {
+				String dutyCode = identutyIt.getDutyCode();
+				String unitCode = identutyIt.getUnitCode();
+				String personCode = identutyIt.getPersonCode();
 				List<Identity> identitys = new ArrayList<>();
 				
 				if(StringUtils.isNotEmpty(dutyCode)){
 					DutyItem dutyItem = new DutyItem();
-					dutyItem.setRow(i);
-					dutyItem.setUnique(dutyCode);
+					dutyItem.setRow(i+1);
 					dutyItem.setName(dutyMap.get(dutyCode));
 					EntityManagerContainer emc = business.entityManagerContainer();
 					
@@ -534,6 +516,7 @@ class ActionInputAll extends BaseAction {
 					if(u != null){
 						dutyItem.setUnit(u.getId());
 						unitId = u.getId();
+						dutyItem.setUnique(dutyCode+unitId);
 					}
 					
 					Person personObj = null;
@@ -544,19 +527,25 @@ class ActionInputAll extends BaseAction {
 						CriteriaQuery<Identity> cq = cb.createQuery(Identity.class);
 						Root<Identity> root = cq.from(Identity.class);
 						//System.out.println("personid="+personObj.getId());
-						Predicate p = cb.equal(root.get(Identity_.person), personObj.getId());		
+						Predicate p = cb.equal(root.get(Identity_.person), personObj.getId());	
+						p = cb.and(p,cb.equal(root.get(Identity_.unit), u.getId()));
 						identitys = em.createQuery(cq.select(root).where(p)).getResultList();
+						
+						if(personCode.equals("zhengping2")){
+							System.out.println("identitys="+identitys.size());
+						}
 					}
-					//System.out.println("identitys="+identitys.size());
+					
 					
 					if(ListTools.isNotEmpty(identitys)){
 						List<String> didylist = new ArrayList<>();
-						for (Identity identity : identitys) {
+						/*for (Identity identity : identitys) {
 							if(unitId.equals(identity.getUnit())){
 								//System.out.println("unitCode="+unitCode);
 								didylist.add(identity.getDistinguishedName());
 							}
-						}
+						}*/
+						didylist.add(identitys.get(0).getId());
 						dutyItem.setIdentityList(didylist);
 					}
 					
@@ -593,6 +582,7 @@ class ActionInputAll extends BaseAction {
 				validate = false;
 				continue;
 			}
+			this.setUnitMemo(workbook, configurator, o, "校验通过.");
 		}
 		if (validate) {
 			for (UnitItem o : unit) {
@@ -646,6 +636,7 @@ class ActionInputAll extends BaseAction {
 				validate = false;
 				continue;
 			}
+			this.setPersonMemo(workbook, configurator, o, "校验通过.");
 			/*if(o.getAttributes().isEmpty()|| StringUtils.isEmpty(o.getAttributes().get("idNumber"))){
 				this.setPersonMemo(workbook, configurator, o, "身份证号不能为空.");
 				validate = false;
@@ -663,7 +654,6 @@ class ActionInputAll extends BaseAction {
 						}
 					}
 				}
-				
 				Person p = null;
 				p = emc.flag(o.getUnique(), Person.class);
 				if (null != p) {
@@ -756,14 +746,18 @@ class ActionInputAll extends BaseAction {
 					continue;
 				}
 				
+				//if (validate) {
+					this.setIdentityMemo(workbook, configurator, identityItem, "校验通过.");
+				//}
+				
 			}
 		}
 		
-		if (validate) {
+		/*if (validate) {
 			for (IdentityItem o : identitys) {
 				this.setIdentityMemo(workbook, configurator, o, "校验通过.");
 			}
-		}
+		}*/
 		return validate;
 	}
 	
@@ -848,14 +842,18 @@ class ActionInputAll extends BaseAction {
 					continue;
 				}
 				
+				//if (validate) {
+					this.setGroupMemo(workbook, configurator, groupItem, "校验通过.");
+				//}
+				
 			}
 		}
 		
-		if (validate) {
+		/*if (validate) {
 			for (GroupItem o : groups){
 				this.setGroupMemo(workbook, configurator, o, "校验通过.");
 			}
-		}
+		}*/
 		return validate;
 	}
 	
@@ -890,21 +888,6 @@ class ActionInputAll extends BaseAction {
 				String resp = this.savePerson("person", personObject);
 				
 				if("".equals(resp)){
-					/*if((!o.getAttributes().isEmpty()) && o.getAttributes().containsKey("idNumber") && StringUtils.isNotEmpty(o.getAttributes().get("idNumber"))){
-						
-						Person person = null;
-						person = emc.flag(o.getUnique(), Person.class);
-						if(person != null){
-							PersonAttribute personAttribute = new PersonAttribute();
-							personAttribute.setName("idNumber");
-							List<String> attributeList = new ArrayList<>();
-							attributeList.add(o.getAttributes().get("idNumber"));
-							personAttribute.setAttributeList(attributeList);
-							personAttribute.setPerson(person.getId());
-							String respAttribute = this.savePersonAttribute("personattribute",personAttribute);
-							System.out.println("respAttribute="+respAttribute);
-						}
-					}*/
 					this.setPersonMemo(workbook, configurator, o, "已导入.");
 				}else{
 					System.out.println("respMass="+resp);
@@ -935,26 +918,26 @@ class ActionInputAll extends BaseAction {
 		}
 	}
 	
-	private void persistDuty(XSSFWorkbook workbook, DutySheetConfigurator configurator, List<DutyItem> dutyItems) throws Exception {
+	private void persistDuty(XSSFWorkbook workbook, DutySheetConfigurator configurator, List<DutyItem> dutyItems,Business business) throws Exception {
+		EntityManagerContainer emc = business.entityManagerContainer();
 		for (List<DutyItem> list : ListTools.batch(dutyItems, 200)) {
 			for (DutyItem o : list) {
-				if(StringUtils.isNotEmpty(o.getUnique()) && this.getDuty("unitduty/list/unit/"+o.getUnit(),o.getUnique(),o.getIdentityList())){
+				if(StringUtils.isNotEmpty(o.getUnique()) && this.getDuty(emc,o)){
 				}else{
 					logger.debug("正在保存职务:{}.", o.getName());
 					UnitDuty dutyObject = new UnitDuty();
 					o.copyTo(dutyObject);
-					
 					String resp = this.saveDuty("unitduty", dutyObject);
-					System.out.println("respMass="+resp);
+					if("".equals(resp)){
+					}else{
+						System.out.println("respMassduty="+resp);
+					}
+					
 				}
 				
 			}
 		}
-		for(List<UnitDuty> unitlist : ListTools.batch(editduty, 200)){
-			for (UnitDuty uo : unitlist) {
-				this.editDuty("unitduty/"+uo.getId(),uo);
-			}
-		}
+		
 	}
 	
 	private void persistGroup(Business business,XSSFWorkbook workbook, GroupSheetConfigurator configurator, List<GroupItem> groupItems) throws Exception {
@@ -1107,35 +1090,35 @@ class ActionInputAll extends BaseAction {
 		return resp.getMessage();
 	}
 	
-	private boolean getDuty(String path, String dutyCode,List<String> identityLists) throws Exception{
+	private boolean getDuty(EntityManagerContainer emc, DutyItem dutyItem) throws Exception{
 		boolean checkduty = false;
-		ActionResponse resp =  ThisApplication.context().applications()
-				.getQuery(x_organization_assemble_control.class, path);
-		JsonObject jsonObject = new JsonParser().parse(resp.toString()).getAsJsonObject();
-		JsonArray jsonArray = null;
-		//jsonArray = new JsonParser().parse(jsonObject.getAsJsonObject().get("data").getAsString()).getAsJsonArray();
-		jsonArray = jsonObject.getAsJsonArray("data");
-		if(jsonArray.size()>0){
-			Iterator it = jsonArray.iterator();
-		    while(it.hasNext()){
-		        JsonElement e = (JsonElement)it.next();
-		        //JsonElement转换为JavaBean对象
-		        UnitDuty unitduty= gson.fromJson(e, UnitDuty.class);
-		        if(dutyCode.equals(unitduty.getUnique())){
-		        	checkduty = true;
-		        	UnitDuty dutyObject = new UnitDuty();
-		        	unitduty.copyTo(dutyObject);
-		        	List<String> identityList = dutyObject.getIdentityList();
-		        	identityList.add(identityLists.get(0));
-		        	dutyObject.setIdentityList(identityList);
-		        	editduty.add(dutyObject);
-		        }
-		    }
+		UnitDuty unitDuty = null;
+		unitDuty= emc.flag(dutyItem.getUnique(), UnitDuty.class);
+		if(unitDuty != null){
+			checkduty = true;
+			List<String> identityList = new ArrayList<>();
+			identityList = unitDuty.getIdentityList();
+			identityList.addAll(dutyItem.getIdentityList());
+			unitDuty.setIdentityList(identityList);
+			//editduty.add(unitDuty);
+			this.editDuty("unitduty/"+unitDuty.getId(),unitDuty);
 		}
 		
 		return checkduty;
 	}
 	
+	   //生成随机数
+	private String getCard(){
+	       Random rand=new Random();//生成随机数
+	        String cardNnumer="";
+	        for(int a=0;a<8;a++){
+	        cardNnumer+=rand.nextInt(10);//生成6位数字
+	        }
+	       return cardNnumer;
+
+
+	  }
+	
 	private void concretePassword(List<PersonItem> people) throws Exception {
 		Pattern pattern = Pattern.compile(com.x.base.core.project.config.Person.REGULAREXPRESSION_SCRIPT);
 		Matcher matcher = pattern.matcher(Config.person().getPassword());

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

@@ -24,7 +24,14 @@ public class ActionTemplate extends BaseAction {
 	protected ActionResult<Wo> execute(EffectivePerson effectivePerson) throws Exception {
 		try (XSSFWorkbook workbook = new XSSFWorkbook(); ByteArrayOutputStream os = new ByteArrayOutputStream()) {
 			ActionResult<Wo> result = new ActionResult<>();
-			this.template(workbook);
+			
+			this.templateRemark(workbook);
+			this.templateUnit(workbook);
+			this.templatePerson(workbook);
+			this.templateIdentity(workbook);
+			this.templateDuty(workbook);
+			this.templateGroup(workbook);
+			
 			workbook.write(os);
 			Wo wo = new Wo(os.toByteArray(), this.contentType(true, name), this.contentDisposition(true, name));
 			result.setData(wo);
@@ -32,23 +39,130 @@ public class ActionTemplate extends BaseAction {
 		}
 	}
 
-	private void template(XSSFWorkbook workbook) throws Exception {
-		XSSFSheet sheet = workbook.createSheet("人员");
+	private void templateRemark(XSSFWorkbook workbook) throws Exception {
+		XSSFSheet sheet = workbook.createSheet("注意事项");
+		Row row = sheet.createRow(0);
+		// 先创建表头
+		row = sheet.createRow(2);
+		row.createCell(0).setCellValue("注意事项:");
+
+		row = sheet.createRow(4);
+		row.createCell(0).setCellValue("1. 表格内不要做合并(拆分)单元格操作,各列顺序不能变动,更不能删除,否则会造成数据混乱;");
+		
+		row = sheet.createRow(6);
+		row.createCell(0).setCellValue("2. * 为必填项");
+		
+		row = sheet.createRow(8);
+		row.createCell(0).setCellValue("3. 如有特殊要求的格式,详见列名批注;");
+		
+		row = sheet.createRow(10);
+		row.createCell(0).setCellValue("4. 表中示例数据用于示范,实际导入时需删除;");
+		
+		row = sheet.createRow(12);
+		row.createCell(0).setCellValue("5. 每个Sheet页顺序不能变动,本Sheet页不能删除。");
+		
+		CellStyle cellStyle = workbook.createCellStyle();
+		cellStyle.setWrapText(true);
+		IntStream.rangeClosed(0, 6).forEach(i -> {
+			sheet.setDefaultColumnStyle(i, cellStyle);
+		});
+	}
+	
+	private void templateUnit(XSSFWorkbook workbook) throws Exception {
+		XSSFSheet sheet = workbook.createSheet("组织信息");
+		Row row = sheet.createRow(0);
+		Cell cell = row.createCell(0);
+		cell.setCellValue("组织名称 *");
+		cell = row.createCell(1);
+		cell.setCellValue("组织编号 *");
+		cell = row.createCell(2);
+		cell.setCellValue("组织级别名称 *");
+		cell = row.createCell(3);
+		cell.setCellValue("上级组织编号");
+		cell = row.createCell(4);
+		cell.setCellValue("描述");
+		cell = row.createCell(5);
+		cell.setCellValue("排序号");
+		CellStyle cellStyle = workbook.createCellStyle();
+		cellStyle.setWrapText(true);
+		IntStream.rangeClosed(0, 6).forEach(i -> {
+			sheet.setDefaultColumnStyle(i, cellStyle);
+		});
+	}
+	
+	private void templatePerson(XSSFWorkbook workbook) throws Exception {
+		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.setCellValue("员工账号 *");
 		cell = row.createCell(2);
-		cell.setCellValue("电子邮件");
+		cell.setCellValue("手机号码 *");
 		cell = row.createCell(3);
-		cell.setCellValue("唯一编码");
+		cell.setCellValue("人员编号");
 		cell = row.createCell(4);
-		cell.setCellValue("员工号");
+		cell.setCellValue("办公电话");
 		cell = row.createCell(5);
 		cell.setCellValue("性别");
 		cell = row.createCell(6);
-		cell.setCellValue("(地址)");
+		cell.setCellValue("邮件");
+		CellStyle cellStyle = workbook.createCellStyle();
+		cellStyle.setWrapText(true);
+		IntStream.rangeClosed(0, 6).forEach(i -> {
+			sheet.setDefaultColumnStyle(i, cellStyle);
+		});
+	}
+	
+	private void templateIdentity(XSSFWorkbook workbook) throws Exception {
+		XSSFSheet sheet = workbook.createSheet("人员身份信息");
+		Row row = sheet.createRow(0);
+		Cell cell = row.createCell(0);
+		cell.setCellValue("员工账号 *");
+		cell = row.createCell(1);
+		cell.setCellValue("组织编号 *");
+		cell = row.createCell(2);
+		cell.setCellValue("职务编号");
+		cell = row.createCell(3);
+		cell.setCellValue("主兼职");
+		CellStyle cellStyle = workbook.createCellStyle();
+		cellStyle.setWrapText(true);
+		IntStream.rangeClosed(0, 6).forEach(i -> {
+			sheet.setDefaultColumnStyle(i, cellStyle);
+		});
+	}
+	
+	private void templateDuty(XSSFWorkbook workbook) throws Exception {
+		XSSFSheet sheet = workbook.createSheet("职务信息");
+		Row row = sheet.createRow(0);
+		Cell cell = row.createCell(0);
+		cell.setCellValue("职务账号 *");
+		cell = row.createCell(1);
+		cell.setCellValue("职务名称 *");
+		cell = row.createCell(2);
+		cell.setCellValue("职务描述");
+		CellStyle cellStyle = workbook.createCellStyle();
+		cellStyle.setWrapText(true);
+		IntStream.rangeClosed(0, 6).forEach(i -> {
+			sheet.setDefaultColumnStyle(i, cellStyle);
+		});
+	}
+	
+	private void templateGroup(XSSFWorkbook workbook) throws Exception {
+		XSSFSheet sheet = workbook.createSheet("群组信息");
+		Row row = sheet.createRow(0);
+		Cell cell = row.createCell(0);
+		cell.setCellValue("群组名称 *");
+		cell = row.createCell(1);
+		cell.setCellValue("群组编号 *");
+		cell = row.createCell(2);
+		cell.setCellValue("人员编号");
+		cell = row.createCell(3);
+		cell.setCellValue("组织编号");
+		cell = row.createCell(4);
+		cell.setCellValue("群组编号");
+		cell = row.createCell(5);
+		cell.setCellValue("描述");
 		CellStyle cellStyle = workbook.createCellStyle();
 		cellStyle.setWrapText(true);
 		IntStream.rangeClosed(0, 6).forEach(i -> {

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

@@ -88,11 +88,11 @@ public class ActionWipeAll extends BaseAction {
 			ApplicationCache.notify(Person.class);
 			ApplicationCache.notify(Unit.class);
 			
-			wo.setFlag("导入人员数据成功");
+			wo.setFlag("清空人员数据成功");
 			System.out.println("开始删除人员组织所有数据--------end");
 		} catch (Exception e) {
 			logger.info("系统在查询所有组织人员信息时发生异常。" );
-			wo.setFlag("导入人员数据失败");
+			wo.setFlag("清空人员数据失败");
 			e.printStackTrace();
 		}
 		

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

@@ -13,6 +13,7 @@ public class IdentityItem extends GsonPropertyObject {
 	
 	private String personCode;
 	private String unitCode;
+	private String dutyCode;
 	private Boolean major;
 	
 
@@ -81,6 +82,14 @@ public class IdentityItem extends GsonPropertyObject {
 	public void setUnitCode(String unitCode) {
 		this.unitCode = unitCode;
 	}
+	
+	public String getDutyCode() {
+		return dutyCode;
+	}
+
+	public void setDutyCode(String dutyCode) {
+		this.dutyCode = dutyCode;
+	}
 
 	public Boolean getMajor() {
 		return major;

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

@@ -42,7 +42,7 @@ public class IdentitySheetConfigurator extends GsonPropertyObject {
 			Cell cell = row.getCell(i);
 			if (null != cell) {
 				String str = this.getCellStringValue(cell);
-				System.out.println("personStr = "+str);
+				System.out.println("identityStr = "+str);
 				if (StringUtils.isNotEmpty(str)) {
 					if (uniqueItems.contains(str)) {
 						this.uniqueColumn = i;

+ 0 - 12
o2web/source/x_component_Org/$Main/default/importCss.css

@@ -2,18 +2,6 @@
     padding: 20px;
     margin: 20px 40px;
 }
-.importPersonCleanNode {
-    margin: 10px 0px 30px 0px;
-    height: 30px;
-    line-height: 30px;
-    width: 120px;
-    border: 1px solid #999999;
-    border-radius: 8px;
-    background-color: #3c76b7;
-    color: #ffffff;
-    text-align: center;
-    cursor: pointer;
-}
 .importPersonTitleNode {
     height: 40px;
     line-height: 40px;

+ 0 - 1
o2web/source/x_component_Org/$Main/default/importView.html

@@ -1,5 +1,4 @@
 <div class="importPersonAreaNode">
-    <div class="importPersonCleanNode"></div>
     <div class="importPersonTitleNode"></div>
     <div class="importPersonTemplateNode"></div>
     <div class="importPersonNode"></div>

+ 1 - 12
o2web/source/x_component_Org/Main.js

@@ -169,7 +169,6 @@ MWF.xApplication.Org.Main = new Class({
             "styles": this.css.rightContentNode
         }).inject(this.node);
         this.importConfiguratorContentNode.set("load", {"onSuccess": function(){
-        	this.importPersonCleanNode = this.importConfiguratorContentNode.getElement(".importPersonCleanNode");
         	this.importPersonTitleNode = this.importConfiguratorContentNode.getElement(".importPersonTitleNode");
             this.importPersonTemplateNode = this.importConfiguratorContentNode.getElement(".importPersonTemplateNode");
             this.importPersonNode = this.importConfiguratorContentNode.getElement(".importPersonNode");
@@ -184,20 +183,10 @@ MWF.xApplication.Org.Main = new Class({
         var url = action.action.address + action.action.actions.getImportPersonTemplate.uri;
         var infor = this.lp.importPersonInfor.replace("{url}", url);
 
-		this.importPersonCleanNode.set("text", this.lp.importPersonCleanNode);
         this.importPersonTitleNode.set("text", this.lp.importPersonTitle);
         this.importPersonTemplateNode.set("html", infor);
         this.importPersonNode.set("text", this.lp.importPersonAction);
-
-		this.importPersonCleanNode.addEvent("click", function(){
-			this.importPersonResultNode.hide();
-			this.restActions.wipeAll(function( json ){
-				if (json.type && json.type=="success"){
-					this.importPersonResultNode.set("html", json.data.flag);
-					this.importPersonResultNode.show();
-				}
-			}.bind(this),null,false);
-		}.bind(this));
+		
 
         this.importPersonNode.addEvent("click", function(){
             this.importPersonResultNode.hide();