liupeng 4 years ago
parent
commit
3bb9a7c9d9

+ 8 - 3
code/sapparent/sapservice/src/main/java/org/fouram/dto/input/UploadUpdateEmpDTO.java

@@ -5,6 +5,7 @@ import java.util.List;
 
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -17,7 +18,7 @@ import lombok.NoArgsConstructor;
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class UploadUpdateEmpDTO implements Serializable {
 	private static final long serialVersionUID = 1L;
-	
+
 	private String accountBank;
 	private String accountBankName;
 	private String cardId;
@@ -35,8 +36,12 @@ public class UploadUpdateEmpDTO implements Serializable {
 	private String cityName;
 	private String businessUnit;
 	private String birthDate;
+	@ApiModelProperty("性别;(1 男 2 女)")
+	private Integer sex;
+	@ApiModelProperty("婚姻状况;( 1 未婚  2 已婚)")
+	private Integer marriage;
 	private List<AddFamilyDTO> familyList;
-	
+
 	@Data
 	@Builder
 	@NoArgsConstructor
@@ -44,7 +49,7 @@ public class UploadUpdateEmpDTO implements Serializable {
 	@JsonIgnoreProperties(ignoreUnknown = true)
 	public static class AddFamilyDTO implements Serializable {
 		private static final long serialVersionUID = 1L;
-		
+
 		private String birthDate;
 		private String name;
 		private Integer relation;

+ 20 - 2
code/sapparent/sapservice/src/main/java/org/fouram/service/SapUserService.java

@@ -33,6 +33,7 @@ import org.fouram.entity.SapOrg;
 import org.fouram.entity.SapPerGlobalInfoCHN;
 import org.fouram.entity.SapPerPerson;
 import org.fouram.entity.SapPerPersonRelationship;
+import org.fouram.entity.SapPerPersonal;
 import org.fouram.entity.SapUser;
 import org.fouram.entity.WxUser;
 import org.fouram.enums.CardTypeEnum;
@@ -78,6 +79,8 @@ public class SapUserService extends BaseService {
 	@Autowired
 	private SapBlacklistService sapBlacklistService;
 	@Autowired
+	private SapPerPersonalService sapPerPersonalService;
+	@Autowired
 	private SapPerNationalIdService sapPerNationalIdService;
 	@Autowired
 	private SapEmpEmploymentService sapEmpEmploymentService;
@@ -572,13 +575,13 @@ public class SapUserService extends BaseService {
 					.build();
 			familyList.add(family);
 		}
-		if("1111".equals(user.getPersonId())) {
+		if ("1111".equals(user.getPersonId())) {
 			user.setCardType(CardTypeEnum.USA.getSapCode());
 			user.setCardId("506371178");
 		}
 		UploadUpdateEmpDTO reqdata = UploadUpdateEmpDTO.builder().cardId(user.getCardId())
 				.cardType(CardTypeEnum.getEnumBySapCode(user.getCardType()).getMyCode()).email(user.getEmail())
-				.entryDate(user.getStartDate()).jobNumber(user.getJobNumber()).phone(user.getFormatMobile())
+				.entryDate(user.getStartDate()).jobNumber(user.getPersonId()).phone(user.getFormatMobile())
 				.resignDate(user.getEndDate()).type(type).username(user.getName()).businessUnit(user.getFirstOrgName())
 				.familyList(familyList).build();
 		SapBank sapBank = sapBankService.selectOneByPersonId(user.getPersonId());
@@ -603,6 +606,21 @@ public class SapUserService extends BaseService {
 		if (perPerson != null) {
 			reqdata.setBirthDate(perPerson.getDateOfBirth());
 		}
+		SapPerPersonal perPersonal = sapPerPersonalService.selectOneByPersonId(user.getPersonId());
+		if (perPersonal != null) {
+			// 1 男 2 女
+			if ("M".equals(perPersonal.getGender())) {
+				reqdata.setSex(1);
+			} else if ("F".equals(perPersonal.getGender())) {
+				reqdata.setSex(2);
+			}
+			// 1 未婚 2 已婚[未婚/已婚/已育/离婚]
+			if ("未婚".equals(perPersonal.getMaritalStatus()) || "离婚".equals(perPersonal.getMaritalStatus())) {
+				reqdata.setMarriage(1);
+			} else if ("已婚".equals(perPersonal.getMaritalStatus()) || "已育".equals(perPersonal.getMaritalStatus())) {
+				reqdata.setMarriage(2);
+			}
+		}
 		String url = "http://cmcadmin.info666.com/hr/emp/modifyEmpInfo";
 		if (!devFlag) {
 			url = "https://manage.inet.cmcinc.cn/hr/emp/modifyEmpInfo";