| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.websocket.server.PathParam; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.regex.Pattern; |
| | |
| | | return zInfoUserService.empower(empowerDto); |
| | | } |
| | | |
| | | /** |
| | | * 家根网 |
| | | */ |
| | | @GetMapping("/root") |
| | | public AjaxResult listAllPeopleWithTree(){ |
| | | return zInfoUserService.listWithTree(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 找到所有的成员 |
| | | */ |
| | | @GetMapping("/all") |
| | | public AjaxResult listAllPeople(){ |
| | | return zInfoUserService.listAllExceptAdmin(); |
| | | } |
| | | |
| | | /** |
| | | * 新增、修改父子关系 |
| | | */ |
| | | |
| | | @PutMapping("/setParent") |
| | | public AjaxResult addParent(@PathParam("fatherId")Long fatherId,@PathParam("motherId")Long motherId){ |
| | | return zInfoUserService.addParent(fatherId,motherId); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.MarryUser; |
| | | import com.ruoyi.domain.ZMarry; |
| | | import com.ruoyi.domain.dto.MarryInfoDto; |
| | | import com.ruoyi.service.ZMarryService; |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | // /** |
| | | // * 导出婚姻状况 |
| | | // */ |
| | | // @PostMapping("/export") |
| | | // public void export(HttpServletResponse response) |
| | | // { |
| | | // AjaxResult marryStatus = getMarryStatus(); |
| | | // HashMap data = (HashMap) marryStatus.get("data"); |
| | | // |
| | | // List<MarryUser> myInfoList = Arrays.asList((MarryUser) data.get("myInfo")); |
| | | // ExcelUtil<MarryUser> util1 = new ExcelUtil<>(MarryUser.class); |
| | | // util1.exportEasyExcel(response,myInfoList,"个人信息"); |
| | | // |
| | | // List<MarryUser> spouseInfoList = Arrays.asList((MarryUser) data.get("spouseInfo")); |
| | | // ExcelUtil<MarryUser> util2 = new ExcelUtil<>(MarryUser.class); |
| | | // util2.exportEasyExcel(response,spouseInfoList,"配偶信息"); |
| | | // |
| | | // List<ZMarry> marryInfoList = Arrays.asList((ZMarry) data.get("marryInfo")); |
| | | // ExcelUtil<ZMarry> util3 = new ExcelUtil<>(ZMarry.class); |
| | | // util3.exportEasyExcel(response,marryInfoList,"婚姻信息"); |
| | | // |
| | | // List<MarryUser> oldSpouseInfoList = (List<MarryUser>) data.get("oldSpouseInfo"); |
| | | // ExcelUtil<MarryUser> util4 = new ExcelUtil<>(MarryUser.class); |
| | | // util4.exportEasyExcel(response,oldSpouseInfoList,"前任信息"); |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * 导出 |
| | | */ |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response){ |
| | | AjaxResult marryStatus = getMarryStatus(); |
| | | MarryInfoDto data = (MarryInfoDto) marryStatus.get("data"); |
| | | List<MarryInfoDto> list = Arrays.asList(data); |
| | | ExcelUtil<MarryInfoDto> util1 = new ExcelUtil<>(MarryInfoDto.class); |
| | | util1.exportExcel(response,list,"婚姻信息"); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | <artifactId>lombok</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>easyexcel</artifactId> |
| | | <version>2.2.6</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | import java.util.UUID; |
| | | import java.util.stream.Collectors; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.apache.commons.lang3.RegExUtils; |
| | | import org.apache.commons.lang3.reflect.FieldUtils; |
| | |
| | | } |
| | | return method; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 对excel表单默认第一个索引名转换成list(EasyExcel) |
| | | * |
| | | * @param is 输入流 |
| | | * @return 转换后集合 |
| | | */ |
| | | public List<T> importEasyExcel(InputStream is) throws Exception |
| | | { |
| | | return EasyExcel.read(is).head(clazz).sheet().doReadSync(); |
| | | } |
| | | |
| | | /** |
| | | * 对list数据源将其里面的数据导入到excel表单(EasyExcel) |
| | | * |
| | | * @param list 导出数据集合 |
| | | * @param sheetName 工作表的名称 |
| | | * @return 结果 |
| | | */ |
| | | public void exportEasyExcel(HttpServletResponse response, List<T> list, String sheetName) |
| | | { |
| | | try |
| | | { |
| | | EasyExcel.write(response.getOutputStream(), clazz).sheet(sheetName).doWrite(list); |
| | | } |
| | | catch (IOException e) |
| | | { |
| | | log.error("导出EasyExcel异常{}", e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.converter; |
| | | |
| | | import com.alibaba.excel.converters.Converter; |
| | | import com.alibaba.excel.enums.CellDataTypeEnum; |
| | | import com.alibaba.excel.metadata.CellData; |
| | | import com.alibaba.excel.metadata.GlobalConfiguration; |
| | | import com.alibaba.excel.metadata.property.ExcelContentProperty; |
| | | |
| | | /** |
| | | * @Author Jinquan_Ou |
| | | * @Description |
| | | * @Date 2023-04-26 15:09 |
| | | * @Version 1.0.0 |
| | | **/ |
| | | @SuppressWarnings("rawtypes") |
| | | public class BearStatusConverter implements Converter<Integer> { |
| | | @Override |
| | | public Class supportJavaTypeKey() { |
| | | return Integer.class; |
| | | } |
| | | |
| | | @Override |
| | | public CellDataTypeEnum supportExcelTypeKey() { |
| | | return CellDataTypeEnum.STRING; |
| | | } |
| | | |
| | | @Override |
| | | public Integer convertToJavaData(CellData cellData, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception { |
| | | Integer value = 0; |
| | | String str = cellData.getStringValue(); |
| | | if ("未婚".equals(str)) { |
| | | value = 0; |
| | | } else if ("初婚".equals(str)) { |
| | | value = 1; |
| | | } else if ("离婚".equals(str)) { |
| | | value = 2; |
| | | } else if ("再婚".equals(str)) { |
| | | value = 3; |
| | | } |
| | | return value; |
| | | } |
| | | |
| | | @Override |
| | | public CellData convertToExcelData(Integer value, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception { |
| | | String str="其他"; |
| | | if(0==value){ |
| | | str="未婚"; |
| | | }else if (1==value){ |
| | | str="初婚"; |
| | | } else if (2==value) { |
| | | str="离婚"; |
| | | }else if (3==value){ |
| | | str="再婚"; |
| | | } |
| | | return new CellData(str); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.domain; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.format.DateTimeFormat; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.converter.BearStatusConverter; |
| | | import lombok.Data; |
| | | |
| | | import java.io.PipedReader; |
| | |
| | | private String id; |
| | | private Long myId; |
| | | |
| | | @Excel(name = "姓名") |
| | | // @ExcelProperty({"姓名"}) |
| | | private String name; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
| | | @Excel(name = "生日", dateFormat = "yyyy-MM-dd") |
| | | // @ExcelProperty({"生日"}) |
| | | // @DateTimeFormat("yyyy-MM-dd") |
| | | private Date birthday; |
| | | |
| | | @Excel(name = "户籍地址") |
| | | // @ExcelProperty({"户籍地址"}) |
| | | private String address; |
| | | |
| | | @Excel(name = "工作地址") |
| | | // @ExcelProperty({"工作地址"}) |
| | | private String workAddress; |
| | | |
| | | @Excel(name = "婚姻状况",readConverterExp = "0=未婚,1=初婚,2=离婚,3=再婚") |
| | | // @ExcelProperty(value = {"婚姻状况"},converter = BearStatusConverter.class) |
| | | private Integer marryStatus; |
| | | |
| | | @Excel(name = "性别",readConverterExp = "0=女,1=男") |
| | | // @ExcelProperty({"性别"}) |
| | | private Integer sex; |
| | | |
| | | @Excel(name = "民族") |
| | | // @ExcelProperty({"民族"}) |
| | | private String nation; |
| | | |
| | | @Excel(name = "手机号码") |
| | | // @ExcelProperty({"手机号码"}) |
| | | private String phone; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Version 1.0 |
| | |
| | | /** |
| | | * 父亲的id |
| | | */ |
| | | private Integer fatherId; |
| | | private Long fatherId; |
| | | |
| | | /** |
| | | * 母亲的id |
| | | */ |
| | | private Integer momId; |
| | | private Long momId; |
| | | |
| | | /** |
| | | * 出生年月日 |
| | |
| | | */ |
| | | private String secondFamilyId; |
| | | |
| | | /** |
| | | * 子列表 |
| | | */ |
| | | @TableField(exist = false) |
| | | List<ZInfoUser> childList; |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import lombok.Data; |
| | | import lombok.ToString; |
| | | |
| | |
| | | * 结婚时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
| | | // @Excel(name = "结婚时间", dateFormat = "yyyy-MM-dd") |
| | | private Date marryTime; |
| | | |
| | | /** |
| | | * 生育情况,0:未生育、1:在孕、2:已生育 |
| | | */ |
| | | // @Excel(name = "生育情况",readConverterExp = "0=未生育,1=在孕,2=已生育") |
| | | private Integer bearStatus; |
| | | |
| | | // @Excel(name = "是否领取计划生育服务手册",readConverterExp = "0=否,1=是") |
| | | private Integer handbookStatus; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
| | | // @Excel(name = "领取计划生育服务手册时间", dateFormat = "yyyy-MM-dd") |
| | | private Date handbookTime; |
| | | |
| | | // @Excel(name = "是否领取独生子女证", readConverterExp = "0=否,1=是") |
| | | private Integer oneBorn; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
| | | // @Excel(name = "领取独生子女证时间", dateFormat = "yyyy-MM-dd") |
| | | private Date oneBornTime; |
| | | |
| | | // @Excel(name = "需声明的情况") |
| | | private String content; |
| | | |
| | | // @Excel(name = "备注") |
| | | private String remark; |
| | | |
| | | private Integer deleteStatus; |
| | |
| | | package com.ruoyi.domain.dto; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.format.DateTimeFormat; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.converter.BearStatusConverter; |
| | | import com.ruoyi.domain.MarryUser; |
| | | import lombok.Data; |
| | | import org.apache.poi.ss.usermodel.IndexedColors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | |
| | | |
| | | //我个人的数据 |
| | | private String id; |
| | | // @ExcelProperty({"个人数据","姓名"}) |
| | | @Excel(name = "个人姓名",headerBackgroundColor = IndexedColors.YELLOW) |
| | | private String name; |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
| | | // @ExcelProperty({"个人信息","生日"}) |
| | | // @DateTimeFormat("yyyy-MM-dd") |
| | | @Excel(name = "个人生日", dateFormat = "yyyy-MM-dd",headerBackgroundColor = IndexedColors.YELLOW) |
| | | private Date birthday; |
| | | // @ExcelProperty({"个人信息","户籍地址"}) |
| | | @Excel(name = "个人户籍地址",headerBackgroundColor = IndexedColors.YELLOW) |
| | | private String address; |
| | | // @ExcelProperty({"个人信息","工作地址"}) |
| | | @Excel(name = "个人工作地址",headerBackgroundColor = IndexedColors.YELLOW) |
| | | private String workAddress; |
| | | // @ExcelProperty(value = {"个人信息","婚姻状况"},converter = BearStatusConverter.class) |
| | | @Excel(name = "个人婚姻状况", readConverterExp = "0=未婚,1=初婚,2=离婚,3=再婚",headerBackgroundColor = IndexedColors.YELLOW) |
| | | private Integer marryStatus; |
| | | // @ExcelProperty(value = {"个人信息","性别"}) |
| | | @Excel(name = "个人性别", readConverterExp = "0=女,1=男",headerBackgroundColor = IndexedColors.YELLOW) |
| | | private Integer sex; |
| | | // @ExcelProperty(value = {"个人信息","民族"}) |
| | | @Excel(name = "个人民族",headerBackgroundColor = IndexedColors.YELLOW) |
| | | private String nation; |
| | | // @ExcelProperty(value = {"个人信息","手机号码"}) |
| | | @Excel(name = "个人电话号码",headerBackgroundColor = IndexedColors.YELLOW) |
| | | private String phone; |
| | | |
| | | //配偶的数据 |
| | | private String spouseId; |
| | | // @ExcelProperty(value = {"配偶信息","姓名"}) |
| | | @Excel(name = "配偶姓名",headerBackgroundColor = IndexedColors.GREEN) |
| | | private String spouseName; |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
| | | // @ExcelProperty(value = {"配偶信息","生日"}) |
| | | // @DateTimeFormat("yyyy-MM-dd") |
| | | @Excel(name = "配偶生日", dateFormat = "yyyy-MM-dd",headerBackgroundColor = IndexedColors.GREEN) |
| | | private Date spouseBirthday; |
| | | // @ExcelProperty(value = {"配偶信息","户籍地址"}) |
| | | @Excel(name = "配偶户籍地址",headerBackgroundColor = IndexedColors.GREEN) |
| | | private String spouseAddress; |
| | | // @ExcelProperty(value = {"配偶信息","工作地址"}) |
| | | @Excel(name = "配偶工作地址",headerBackgroundColor = IndexedColors.GREEN) |
| | | private String spouseWorkAddress; |
| | | // @ExcelProperty(value = {"配偶信息","婚姻状况"},converter = BearStatusConverter.class) |
| | | @Excel(name = "配偶婚姻状况", readConverterExp = "0=未婚,1=初婚,2=离婚,3=再婚",headerBackgroundColor = IndexedColors.GREEN) |
| | | private Integer spouseMarryStatus; |
| | | // @ExcelProperty(value = {"配偶信息","性别"}) |
| | | @Excel(name = "配偶性别", readConverterExp = "0=女,1=男",headerBackgroundColor = IndexedColors.GREEN) |
| | | private Integer spouseSex; |
| | | // @ExcelProperty(value = {"配偶信息","民族"}) |
| | | @Excel(name = "配偶民族",headerBackgroundColor = IndexedColors.GREEN) |
| | | private String spouseNation; |
| | | @Excel(name = "配偶手机号码",headerBackgroundColor = IndexedColors.GREEN) |
| | | private String spousePhone; |
| | | |
| | | |
| | | |
| | | //生育情况(中间表) |
| | |
| | | * 结婚时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
| | | @Excel(name = "结婚时间", dateFormat = "yyyy-MM-dd") |
| | | private Date marryTime; |
| | | |
| | | /** |
| | | * 生育情况,0:未生育、1:在孕、2:已生育 |
| | | */ |
| | | @Excel(name = "生育情况", readConverterExp = "0=未生育,1=在孕,2=已生育") |
| | | private Integer bearStatus; |
| | | @Excel(name = "是否领取计划生育服务手册", readConverterExp = "0=否,1=是") |
| | | private Integer handbookStatus; |
| | | @Excel(name = "领取计划生育服务手册时间", dateFormat = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
| | | private Date handbookTime; |
| | | @Excel(name = "是否领取独生子女证", readConverterExp = "0=否,1=是") |
| | | private Integer oneBorn; |
| | | @Excel(name = "领取独生子女证时间", dateFormat = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
| | | private Date oneBornTime; |
| | | @Excel(name = "需声明的情况") |
| | | private String content; |
| | | @Excel(name = "备注") |
| | | private String remark; |
| | | |
| | | /** |
| | | * 前任信息的List |
| | | */ |
| | | @Excel(name = "前任信息",headerBackgroundColor= IndexedColors.RED) |
| | | private List<MarryUser> oldSpouseList; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.domain.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @Author Jinquan_Ou |
| | | * @Description |
| | | * @Date 2023-05-03 18:38 |
| | | * @Version 1.0.0 |
| | | **/ |
| | | @Data |
| | | public class ZUserInfoDto implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | AjaxResult empower(EmpowerDto empowerDto); |
| | | |
| | | AjaxResult listWithTree(); |
| | | |
| | | AjaxResult addParent(Long fatherId, Long motherId); |
| | | |
| | | AjaxResult listAllExceptAdmin(); |
| | | |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | private void checkAuthorization(String familyId, String destinationFamilyId,boolean flag) { |
| | | String text=null; |
| | | if(flag){ |
| | |
| | | return familyId; |
| | | } |
| | | |
| | | |
| | | |
| | | private String getFinalStr(String destinationFamilyId, List<String> authorityList) { |
| | | String authorityListStr = authorityList.stream().collect(Collectors.joining(" ", "{", "}")); |
| | | String finalStr= destinationFamilyId +authorityListStr; //3{2007 1988 1004} |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取家根网 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AjaxResult listWithTree() { |
| | | |
| | | List<ZInfoUser> allPeopleList = list(); |
| | | List<ZInfoUser> result = null; |
| | | try { |
| | | result = allPeopleList.stream().filter(people -> people.getUserId()!=1&&(people.getFatherId() == 0||people.getMomId()==0)) |
| | | .map(people -> { |
| | | people.setChildList(fillChildren(people, allPeopleList)); |
| | | return people; |
| | | }).collect(Collectors.toList()); |
| | | } catch (NullPointerException e) { |
| | | throw new RuntimeException("您在加入成员的时候没有指定该成员的父亲或者母亲"); |
| | | } |
| | | return AjaxResult.success(result); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 为了家根网、新增或者修改父子关系 |
| | | * @param fatherId |
| | | * @param motherId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AjaxResult addParent(Long fatherId, Long motherId) { |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | | Long userId = user.getUserId(); |
| | | LambdaQueryWrapper<ZInfoUser> zInfoUserLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | zInfoUserLambdaQueryWrapper.eq(ZInfoUser::getUserId,userId); |
| | | ZInfoUser zInfoUser = getOne(zInfoUserLambdaQueryWrapper); |
| | | |
| | | zInfoUser.setFatherId(fatherId); |
| | | zInfoUser.setMomId(motherId); |
| | | |
| | | updateById(zInfoUser); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult listAllExceptAdmin() { |
| | | List<ZInfoUser> collect = list().stream().filter(zInfoUser -> zInfoUser.getUserId() != 1).collect(Collectors.toList()); |
| | | return AjaxResult.success(collect); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 递归算法 |
| | | * @param people |
| | | * @param allPeopleList |
| | | * @return |
| | | */ |
| | | private List<ZInfoUser> fillChildren(ZInfoUser people, List<ZInfoUser> allPeopleList) { |
| | | return allPeopleList.stream().filter( |
| | | one -> one.getFatherId() == people.getUserId() || one.getMomId() == people.getUserId() |
| | | ).map( |
| | | one -> { |
| | | one.setChildList(fillChildren(one, allPeopleList)); |
| | | return one; |
| | | } |
| | | ).collect(Collectors.toList()); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | oldSpouseList.add(oldSpouse); |
| | | } |
| | | |
| | | //统一封装返回 |
| | | HashMap<String, Object> resultMap = new HashMap<>(); |
| | | resultMap.put("myInfo",myself); |
| | | resultMap.put("spouseInfo",spouse); |
| | | resultMap.put("marryInfo",myMarryInfo); |
| | | resultMap.put("oldSpouseInfo",oldSpouseList); |
| | | // //统一封装返回 |
| | | // HashMap<String, Object> resultMap = new HashMap<>(); |
| | | // resultMap.put("myInfo",myself); |
| | | // resultMap.put("spouseInfo",spouse); |
| | | // resultMap.put("marryInfo",myMarryInfo); |
| | | // resultMap.put("oldSpouseInfo",oldSpouseList); |
| | | |
| | | return AjaxResult.success(resultMap); |
| | | //转成DTO返回 |
| | | MarryInfoDto marryInfoDto = MarryInfoToDto(myMarryInfo, oldSpouseList, myself, spouse); |
| | | return AjaxResult.success(marryInfoDto); |
| | | } |
| | | |
| | | private MarryInfoDto MarryInfoToDto(ZMarry myMarryInfo,List<MarryUser> oldSpouseList,MarryUser myself,MarryUser spouse){ |
| | | MarryInfoDto marryInfoDto = new MarryInfoDto(); |
| | | marryInfoDto.setId(myself.getId()); |
| | | marryInfoDto.setName(myself.getName()); |
| | | marryInfoDto.setBirthday(myself.getBirthday()); |
| | | marryInfoDto.setAddress(myself.getAddress()); |
| | | marryInfoDto.setWorkAddress(myself.getWorkAddress()); |
| | | marryInfoDto.setMarryStatus(myself.getMarryStatus()); |
| | | marryInfoDto.setSex(myself.getSex()); |
| | | marryInfoDto.setNation(myself.getNation()); |
| | | marryInfoDto.setPhone(myself.getPhone()); |
| | | |
| | | marryInfoDto.setSpouseId(spouse.getId()); |
| | | marryInfoDto.setSpouseName(spouse.getName()); |
| | | marryInfoDto.setSpouseBirthday(spouse.getBirthday()); |
| | | marryInfoDto.setSpouseAddress(spouse.getAddress()); |
| | | marryInfoDto.setSpouseWorkAddress(spouse.getWorkAddress()); |
| | | marryInfoDto.setSpouseMarryStatus(spouse.getMarryStatus()); |
| | | marryInfoDto.setSpouseSex(spouse.getSex()); |
| | | marryInfoDto.setSpouseNation(spouse.getNation()); |
| | | marryInfoDto.setSpousePhone(spouse.getPhone()); |
| | | |
| | | marryInfoDto.setMarryId(myMarryInfo.getId()); |
| | | marryInfoDto.setBearStatus(myMarryInfo.getBearStatus()); |
| | | marryInfoDto.setHandbookStatus(myMarryInfo.getHandbookStatus()); |
| | | marryInfoDto.setHandbookTime(myMarryInfo.getHandbookTime()); |
| | | marryInfoDto.setOneBorn(myMarryInfo.getOneBorn()); |
| | | marryInfoDto.setOneBornTime(myMarryInfo.getOneBornTime()); |
| | | marryInfoDto.setContent(myMarryInfo.getContent()); |
| | | marryInfoDto.setRemark(myMarryInfo.getRemark()); |
| | | marryInfoDto.setMarryTime(myMarryInfo.getMarryTime()); |
| | | |
| | | marryInfoDto.setOldSpouseList(oldSpouseList); |
| | | return marryInfoDto; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Transactional |
| | | public AjaxResult addInfo(MarryInfoDto marryInfoDto){ |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |