| | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.*; |
| | | import com.ruoyi.domain.dto.AncestorClan; |
| | | import com.ruoyi.domain.dto.AncestorHelper; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import com.ruoyi.service.ZfAncestorService; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import static com.ruoyi.common.core.domain.AjaxResult.error; |
| | | import static com.ruoyi.common.core.page.TableSupport.*; |
| | | //import static jdk.nashorn.internal.runtime.regexp.joni.Config.log; |
| | | |
| | | @RestController |
| | | @RequestMapping("/ZfAncestor") |
| | |
| | | |
| | | zInfoUserService.updateById(infoUser); |
| | | } |
| | | @Log(title = "家庭大事件记录", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, ZfAncestor zfAncestor) { |
| | | List<AncestorClan> list = new ArrayList<>(); |
| | | |
| | | list = zfAncestorService.selectByCondition(zfAncestor); |
| | | // log.info("导出记录为:{}", list); |
| | | ExcelUtil<AncestorClan> util = new ExcelUtil<>(AncestorClan.class); |
| | | util.exportExcel(response, list, "家庭大事件记录数据"); |
| | | |
| | | } |
| | | /** |
| | | * 导出导出祖先信息记录列表 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:property:export')") |
| | | @Log(title = "导出祖先信息", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export1/{ids}") |
| | | public void export(HttpServletResponse response, @PathVariable Long[] ids) |
| | | { |
| | | List<AncestorClan> list = zfAncestorService.selectByIds(ids); |
| | | // log.info("导出记录为:{}",list); |
| | | ExcelUtil<AncestorClan> util = new ExcelUtil<>(AncestorClan.class); |
| | | util.exportExcel(response, list, "保洁收纳记录数据"); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改祖先信息 |
| | | */ |
| | | @Log(title = "祖先", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ZfAncestor zfAncestor) { |
| | | public AjaxResult edit(@RequestBody AncestorHelper ancestorHelper) { |
| | | |
| | | ZfAncestor spouseSex = zfAncestorService.update(zfAncestor); |
| | | updateAncestor(zfAncestor); |
| | | if (spouseSex.getId() != null) |
| | | updateAncestor(spouseSex); |
| | | // ZfAncestor spouseSex = zfAncestorService.update(zfAncestor); |
| | | // updateAncestor(zfAncestor); |
| | | // if (spouseSex.getId() != null) |
| | | // updateAncestor(spouseSex); |
| | | |
| | | //修改sys_user表 |
| | | SysUser us = new SysUser(); |
| | | us.setNickName(ancestorHelper.getName()); |
| | | // us.setStatus(String.valueOf(zfAncestor.getStatus())); |
| | | us.setSex(String.valueOf(ancestorHelper.getSex())); |
| | | us.setUserName(ancestorHelper.getName()); |
| | | // us.setClanId(ancestorHelper.getClanId()); |
| | | us.setUserId(ancestorHelper.getSysId()); |
| | | |
| | | if (!userService.checkNickNameUnique(us)) { |
| | | return error("修改祖先'" + us.getNickName() + "'失败,登录账号已存在"); |
| | | } |
| | | userService.updateUser(us); |
| | | |
| | | |
| | | //修改z_info_user表 |
| | | ZInfoUser infoUser = new ZInfoUser(); |
| | | infoUser.setSysId(us.getUserId()); |
| | | infoUser.setNickName(us.getNickName()); |
| | | infoUser.setOldName(us.getUserName()); |
| | | infoUser.setSex(Integer.parseInt(us.getSex())); |
| | | ZInfoUser infoBysysId = zInfoUserService.getInfoBysysId(us.getUserId()); |
| | | infoUser.setUserId(infoBysysId.getUserId()); |
| | | |
| | | zInfoUserService.saveOrUpdate(infoUser); |
| | | |
| | | //修改zf_ancestor表 |
| | | ZfAncestor zfAncestor = new ZfAncestor(); |
| | | // zfAncestor.setClanId(ancestorHelper.getClanId()); |
| | | zfAncestor.setName(ancestorHelper.getName()); |
| | | zfAncestor.setSex(ancestorHelper.getSex()); |
| | | zfAncestor.setSysId(ancestorHelper.getSysId()); |
| | | |
| | | zfAncestorService.update(zfAncestor); |
| | | |
| | | return AjaxResult.success(); |
| | | } |
| | |
| | | zfAncestor1.setStatus(0); |
| | | zfAncestor1.setSysId(usa.getUserId()); |
| | | zfAncestorService.addData(zfAncestor1); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | else{ |
| | | //保存祖先管理员,也先保存到sys_user |
| | |
| | | zfAncestor.setSysId(us.getUserId()); |
| | | |
| | | zfAncestorService.addData(zfAncestor); |
| | | |
| | | |
| | | } |
| | | |