数据表添加、用户添加身份证号及验证

main
hansha 2 years ago
parent c5123d0c12
commit 8786e12d76

@ -65,6 +65,10 @@ public class SysProfileController extends BaseController
currentUser.setEmail(user.getEmail()); currentUser.setEmail(user.getEmail());
currentUser.setPhonenumber(user.getPhonenumber()); currentUser.setPhonenumber(user.getPhonenumber());
currentUser.setSex(user.getSex()); currentUser.setSex(user.getSex());
if (StringUtils.isNotEmpty(user.getCardId()) && !userService.checkCardIdUnique(currentUser))
{
return error("修改用户'" + loginUser.getUsername() + "'失败,身份证号已存在");
}
if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser)) if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser))
{ {
return error("修改用户'" + loginUser.getUsername() + "'失败,手机号码已存在"); return error("修改用户'" + loginUser.getUsername() + "'失败,手机号码已存在");

@ -1,21 +1,5 @@
package com.ruoyi.web.controller.system; package com.ruoyi.web.controller.system;
import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
@ -31,6 +15,16 @@ import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysPostService; import com.ruoyi.system.service.ISysPostService;
import com.ruoyi.system.service.ISysRoleService; import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.stream.Collectors;
/** /**
* *
@ -128,6 +122,10 @@ public class SysUserController extends BaseController
{ {
return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
} }
else if (StringUtils.isNotEmpty(user.getCardId()) && !userService.checkCardIdUnique(user))
{
return error("新增用户'" + user.getUserName() + "'失败,身份证号已存在");
}
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
{ {
return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在"); return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
@ -158,8 +156,10 @@ public class SysUserController extends BaseController
else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
{ {
return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
} }else if(StringUtils.isNotEmpty(user.getCardId()) && !userService.checkCardIdUnique(user))
else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) {
return error("修改用户'" + user.getUserName() + "'失败,身份证号已存在");
}else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
{ {
return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
} }

@ -1,16 +1,19 @@
package com.ruoyi.common.core.domain.entity; package com.ruoyi.common.core.domain.entity;
import java.util.Date;
import java.util.List;
import javax.validation.constraints.*;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Excel.ColumnType; import com.ruoyi.common.annotation.Excel.ColumnType;
import com.ruoyi.common.annotation.Excel.Type; import com.ruoyi.common.annotation.Excel.Type;
import com.ruoyi.common.annotation.Excels; import com.ruoyi.common.annotation.Excels;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.xss.Xss; import com.ruoyi.common.xss.Xss;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.Date;
import java.util.List;
/** /**
* sys_user * sys_user
@ -45,6 +48,10 @@ public class SysUser extends BaseEntity
@Excel(name = "手机号码") @Excel(name = "手机号码")
private String phonenumber; private String phonenumber;
/** 身份证号 */
@Excel(name = "身份证号")
private String cardId;
/** 用户性别 */ /** 用户性别 */
@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知") @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
private String sex; private String sex;
@ -177,7 +184,15 @@ public class SysUser extends BaseEntity
this.phonenumber = phonenumber; this.phonenumber = phonenumber;
} }
public String getSex() public void setCardId(String cardId)
{
this.cardId = cardId;
}
public String getCardId() {
return cardId;
}
public String getSex()
{ {
return sex; return sex;
} }
@ -306,6 +321,7 @@ public class SysUser extends BaseEntity
.append("nickName", getNickName()) .append("nickName", getNickName())
.append("email", getEmail()) .append("email", getEmail())
.append("phonenumber", getPhonenumber()) .append("phonenumber", getPhonenumber())
.append("cardId", getCardId())
.append("sex", getSex()) .append("sex", getSex())
.append("avatar", getAvatar()) .append("avatar", getAvatar())
.append("password", getPassword()) .append("password", getPassword())

@ -1,8 +1,9 @@
package com.ruoyi.system.mapper; package com.ruoyi.system.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* *
@ -124,4 +125,12 @@ public interface SysUserMapper
* @return * @return
*/ */
public SysUser checkEmailUnique(String email); public SysUser checkEmailUnique(String email);
/**
* cardId
*
* @param cardId
* @return
*/
public SysUser checkCardIdUnique(String cardId);
} }

@ -1,8 +1,9 @@
package com.ruoyi.system.service; package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import java.util.List;
/** /**
* *
* *
@ -90,6 +91,14 @@ public interface ISysUserService
*/ */
public boolean checkEmailUnique(SysUser user); public boolean checkEmailUnique(SysUser user);
/**
* cardId
*
* @param user
* @return
*/
public boolean checkCardIdUnique(SysUser user);
/** /**
* *
* *

@ -1,15 +1,5 @@
package com.ruoyi.system.service.impl; package com.ruoyi.system.service.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import javax.validation.Validator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.domain.entity.SysRole;
@ -22,13 +12,20 @@ import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.system.domain.SysPost; import com.ruoyi.system.domain.SysPost;
import com.ruoyi.system.domain.SysUserPost; import com.ruoyi.system.domain.SysUserPost;
import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.domain.SysUserRole;
import com.ruoyi.system.mapper.SysPostMapper; import com.ruoyi.system.mapper.*;
import com.ruoyi.system.mapper.SysRoleMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.mapper.SysUserPostMapper;
import com.ruoyi.system.mapper.SysUserRoleMapper;
import com.ruoyi.system.service.ISysConfigService; import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.validation.Validator;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/** /**
* *
@ -212,6 +209,24 @@ public class SysUserServiceImpl implements ISysUserService
return UserConstants.UNIQUE; return UserConstants.UNIQUE;
} }
/**
* email
*
* @param user
* @return
*/
@Override
public boolean checkCardIdUnique(SysUser user)
{
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
SysUser info = userMapper.checkCardIdUnique(user.getCardId());
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
{
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
/** /**
* *
* *

@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="nickName" column="nick_name" /> <result property="nickName" column="nick_name" />
<result property="email" column="email" /> <result property="email" column="email" />
<result property="phonenumber" column="phonenumber" /> <result property="phonenumber" column="phonenumber" />
<result property="cardId" column="card_id" />
<result property="sex" column="sex" /> <result property="sex" column="sex" />
<result property="avatar" column="avatar" /> <result property="avatar" column="avatar" />
<result property="password" column="password" /> <result property="password" column="password" />
@ -47,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectUserVo"> <sql id="selectUserVo">
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber,u.card_id, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
from sys_user u from sys_user u
@ -57,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult"> <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber,u.card_id, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
left join sys_dept d on u.dept_id = d.dept_id left join sys_dept d on u.dept_id = d.dept_id
where u.del_flag = '0' where u.del_flag = '0'
<if test="userId != null and userId != 0"> <if test="userId != null and userId != 0">
@ -72,6 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phonenumber != null and phonenumber != ''"> <if test="phonenumber != null and phonenumber != ''">
AND u.phonenumber like concat('%', #{phonenumber}, '%') AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if> </if>
<if test="cardId != null and cardId != ''"> and card_id = #{cardId}</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(u.create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d') AND date_format(u.create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if> </if>
@ -86,7 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult"> <select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber,u.card_id, u.status, u.create_time
from sys_user u from sys_user u
left join sys_dept d on u.dept_id = d.dept_id left join sys_dept d on u.dept_id = d.dept_id
left join sys_user_role ur on u.user_id = ur.user_id left join sys_user_role ur on u.user_id = ur.user_id
@ -98,12 +100,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phonenumber != null and phonenumber != ''"> <if test="phonenumber != null and phonenumber != ''">
AND u.phonenumber like concat('%', #{phonenumber}, '%') AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if> </if>
<if test="cardId != null and cardId != ''"> and card_id = #{cardId}</if>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
</select> </select>
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult"> <select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber,u.card_id, u.status, u.create_time
from sys_user u from sys_user u
left join sys_dept d on u.dept_id = d.dept_id left join sys_dept d on u.dept_id = d.dept_id
left join sys_user_role ur on u.user_id = ur.user_id left join sys_user_role ur on u.user_id = ur.user_id
@ -116,6 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="phonenumber != null and phonenumber != ''"> <if test="phonenumber != null and phonenumber != ''">
AND u.phonenumber like concat('%', #{phonenumber}, '%') AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if> </if>
<if test="cardId != null and cardId != ''"> and card_id = #{cardId}</if>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
</select> </select>
@ -141,7 +145,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult"> <select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1 select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
</select> </select>
<select id="checkCardIdUnique" parameterType="String" resultMap="SysUserResult">
select user_id, card_id from sys_user where card_id = #{cardId} and del_flag = '0' limit 1
</select>
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId"> <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
insert into sys_user( insert into sys_user(
<if test="userId != null and userId != 0">user_id,</if> <if test="userId != null and userId != 0">user_id,</if>
@ -151,6 +159,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="email != null and email != ''">email,</if> <if test="email != null and email != ''">email,</if>
<if test="avatar != null and avatar != ''">avatar,</if> <if test="avatar != null and avatar != ''">avatar,</if>
<if test="phonenumber != null and phonenumber != ''">phonenumber,</if> <if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
<if test="cardId != null">card_id,</if>
<if test="sex != null and sex != ''">sex,</if> <if test="sex != null and sex != ''">sex,</if>
<if test="password != null and password != ''">password,</if> <if test="password != null and password != ''">password,</if>
<if test="status != null and status != ''">status,</if> <if test="status != null and status != ''">status,</if>
@ -165,6 +174,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="email != null and email != ''">#{email},</if> <if test="email != null and email != ''">#{email},</if>
<if test="avatar != null and avatar != ''">#{avatar},</if> <if test="avatar != null and avatar != ''">#{avatar},</if>
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if> <if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
<if test="cardId != null">#{cardId},</if>
<if test="sex != null and sex != ''">#{sex},</if> <if test="sex != null and sex != ''">#{sex},</if>
<if test="password != null and password != ''">#{password},</if> <if test="password != null and password != ''">#{password},</if>
<if test="status != null and status != ''">#{status},</if> <if test="status != null and status != ''">#{status},</if>
@ -182,6 +192,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if> <if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
<if test="email != null ">email = #{email},</if> <if test="email != null ">email = #{email},</if>
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if> <if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
<if test="cardId != null">card_id = #{cardId},</if>
<if test="sex != null and sex != ''">sex = #{sex},</if> <if test="sex != null and sex != ''">sex = #{sex},</if>
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if> <if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
<if test="password != null and password != ''">password = #{password},</if> <if test="password != null and password != ''">password = #{password},</if>

@ -1,48 +1,42 @@
package com.ruoyi.szxc.controller; package com.ruoyi.szxc.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.szxc.domain.News;
import com.ruoyi.szxc.service.INewsService;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.szxc.domain.SzxcNews;
import com.ruoyi.szxc.service.ISzxcNewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/** /**
* Controller * Controller
* *
* @author hs * @author hs
* @date 2024-03-15 * @date 2024-03-16
*/ */
@RestController @RestController
@RequestMapping("/szxc/news") @RequestMapping("/szxc/news")
public class NewsController extends BaseController public class SzxcNewsController extends BaseController
{ {
@Autowired @Autowired
private INewsService newsService; private ISzxcNewsService szxcNewsService;
/** /**
* *
*/ */
@PreAuthorize("@ss.hasPermi('szxc:news:list')") @PreAuthorize("@ss.hasPermi('szxc:news:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(News news) public TableDataInfo list(SzxcNews szxcNews)
{ {
startPage(); startPage();
List<News> list = newsService.selectNewsList(news); List<SzxcNews> list = szxcNewsService.selectSzxcNewsList(szxcNews);
return getDataTable(list); return getDataTable(list);
} }
@ -52,10 +46,10 @@ public class NewsController extends BaseController
@PreAuthorize("@ss.hasPermi('szxc:news:export')") @PreAuthorize("@ss.hasPermi('szxc:news:export')")
@Log(title = "公告资讯", businessType = BusinessType.EXPORT) @Log(title = "公告资讯", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, News news) public void export(HttpServletResponse response, SzxcNews szxcNews)
{ {
List<News> list = newsService.selectNewsList(news); List<SzxcNews> list = szxcNewsService.selectSzxcNewsList(szxcNews);
ExcelUtil<News> util = new ExcelUtil<News>(News.class); ExcelUtil<SzxcNews> util = new ExcelUtil<SzxcNews>(SzxcNews.class);
util.exportExcel(response, list, "公告资讯数据"); util.exportExcel(response, list, "公告资讯数据");
} }
@ -66,7 +60,7 @@ public class NewsController extends BaseController
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id)
{ {
return success(newsService.selectNewsById(id)); return success(szxcNewsService.selectSzxcNewsById(id));
} }
/** /**
@ -75,9 +69,9 @@ public class NewsController extends BaseController
@PreAuthorize("@ss.hasPermi('szxc:news:add')") @PreAuthorize("@ss.hasPermi('szxc:news:add')")
@Log(title = "公告资讯", businessType = BusinessType.INSERT) @Log(title = "公告资讯", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody News news) public AjaxResult add(@RequestBody SzxcNews szxcNews)
{ {
return toAjax(newsService.insertNews(news)); return toAjax(szxcNewsService.insertSzxcNews(szxcNews));
} }
/** /**
@ -86,9 +80,9 @@ public class NewsController extends BaseController
@PreAuthorize("@ss.hasPermi('szxc:news:edit')") @PreAuthorize("@ss.hasPermi('szxc:news:edit')")
@Log(title = "公告资讯", businessType = BusinessType.UPDATE) @Log(title = "公告资讯", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody News news) public AjaxResult edit(@RequestBody SzxcNews szxcNews)
{ {
return toAjax(newsService.updateNews(news)); return toAjax(szxcNewsService.updateSzxcNews(szxcNews));
} }
/** /**
@ -99,6 +93,6 @@ public class NewsController extends BaseController
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids)
{ {
return toAjax(newsService.deleteNewsByIds(ids)); return toAjax(szxcNewsService.deleteSzxcNewsByIds(ids));
} }
} }

@ -0,0 +1,49 @@
package com.ruoyi.szxc.domain;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* szxc_jm_car
*
* @author hs
* @date 2024-03-16
*/
public class SzxcJmCar extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 居民id */
private Long jmId;
/** 车辆id */
private Long carId;
public void setJmId(Long jmId)
{
this.jmId = jmId;
}
public Long getJmId()
{
return jmId;
}
public void setCarId(Long carId)
{
this.carId = carId;
}
public Long getCarId()
{
return carId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("jmId", getJmId())
.append("carId", getCarId())
.toString();
}
}

@ -0,0 +1,50 @@
package com.ruoyi.szxc.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* szxc_jm_house
*
* @author hs
* @date 2024-03-16
*/
public class SzxcJmHouse extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 居民id */
private Long jmId;
/** 房屋id */
private Long houseId;
public void setJmId(Long jmId)
{
this.jmId = jmId;
}
public Long getJmId()
{
return jmId;
}
public void setHouseId(Long houseId)
{
this.houseId = houseId;
}
public Long getHouseId()
{
return houseId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("jmId", getJmId())
.append("houseId", getHouseId())
.toString();
}
}

@ -1,17 +1,18 @@
package com.ruoyi.szxc.domain; package com.ruoyi.szxc.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/** /**
* szxc_jm_info * szxc_jm_info
* *
* @author hs * @author hs
* @date 2024-03-15 * @date 2024-03-16
*/ */
public class SzxcJmInfo extends BaseEntity public class SzxcJmInfo extends BaseEntity
{ {
@ -42,7 +43,7 @@ public class SzxcJmInfo extends BaseEntity
/** 身份证号 */ /** 身份证号 */
@Excel(name = "身份证号") @Excel(name = "身份证号")
private String idCard; private String cardId;
/** 出生日期 */ /** 出生日期 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@ -53,8 +54,8 @@ public class SzxcJmInfo extends BaseEntity
@Excel(name = "年龄") @Excel(name = "年龄")
private Long age; private Long age;
/** 用户性别0男 1女 */ /** 性别0男 1女 2未知 */
@Excel(name = "用户性别", readConverterExp = "0=男,1=女") @Excel(name = "性别", readConverterExp = "0=男,1=女,2=未知")
private String sex; private String sex;
/** 籍贯 */ /** 籍贯 */
@ -97,183 +98,183 @@ public class SzxcJmInfo extends BaseEntity
@Excel(name = "创建者ID") @Excel(name = "创建者ID")
private Long userId; private Long userId;
public void setId(Long id) public void setId(Long id)
{ {
this.id = id; this.id = id;
} }
public Long getId() public Long getId()
{ {
return id; return id;
} }
public void setDeptId(Long deptId) public void setDeptId(Long deptId)
{ {
this.deptId = deptId; this.deptId = deptId;
} }
public Long getDeptId() public Long getDeptId()
{ {
return deptId; return deptId;
} }
public void setDeptName(String deptName) public void setDeptName(String deptName)
{ {
this.deptName = deptName; this.deptName = deptName;
} }
public String getDeptName() public String getDeptName()
{ {
return deptName; return deptName;
} }
public void setName(String name) public void setName(String name)
{ {
this.name = name; this.name = name;
} }
public String getName() public String getName()
{ {
return name; return name;
} }
public void setOldName(String oldName) public void setOldName(String oldName)
{ {
this.oldName = oldName; this.oldName = oldName;
} }
public String getOldName() public String getOldName()
{ {
return oldName; return oldName;
} }
public void setNationality(String nationality) public void setNationality(String nationality)
{ {
this.nationality = nationality; this.nationality = nationality;
} }
public String getNationality() public String getNationality()
{ {
return nationality; return nationality;
} }
public void setIdCard(String idCard) public void setCardId(String cardId)
{ {
this.idCard = idCard; this.cardId = cardId;
} }
public String getIdCard() public String getCardId()
{ {
return idCard; return cardId;
} }
public void setBornDate(Date bornDate) public void setBornDate(Date bornDate)
{ {
this.bornDate = bornDate; this.bornDate = bornDate;
} }
public Date getBornDate() public Date getBornDate()
{ {
return bornDate; return bornDate;
} }
public void setAge(Long age) public void setAge(Long age)
{ {
this.age = age; this.age = age;
} }
public Long getAge() public Long getAge()
{ {
return age; return age;
} }
public void setSex(String sex) public void setSex(String sex)
{ {
this.sex = sex; this.sex = sex;
} }
public String getSex() public String getSex()
{ {
return sex; return sex;
} }
public void setJg(String jg) public void setJg(String jg)
{ {
this.jg = jg; this.jg = jg;
} }
public String getJg() public String getJg()
{ {
return jg; return jg;
} }
public void setRelation(String relation) public void setRelation(String relation)
{ {
this.relation = relation; this.relation = relation;
} }
public String getRelation() public String getRelation()
{ {
return relation; return relation;
} }
public void setJgNature(String jgNature) public void setJgNature(String jgNature)
{ {
this.jgNature = jgNature; this.jgNature = jgNature;
} }
public String getJgNature() public String getJgNature()
{ {
return jgNature; return jgNature;
} }
public void setLongLive(String longLive) public void setLongLive(String longLive)
{ {
this.longLive = longLive; this.longLive = longLive;
} }
public String getLongLive() public String getLongLive()
{ {
return longLive; return longLive;
} }
public void setHjAddress(String hjAddress) public void setHjAddress(String hjAddress)
{ {
this.hjAddress = hjAddress; this.hjAddress = hjAddress;
} }
public String getHjAddress() public String getHjAddress()
{ {
return hjAddress; return hjAddress;
} }
public void setPhone(String phone) public void setPhone(String phone)
{ {
this.phone = phone; this.phone = phone;
} }
public String getPhone() public String getPhone()
{ {
return phone; return phone;
} }
public void setHead(String head) public void setHead(String head)
{ {
this.head = head; this.head = head;
} }
public String getHead() public String getHead()
{ {
return head; return head;
} }
public void setSameHeadIds(String sameHeadIds) public void setSameHeadIds(String sameHeadIds)
{ {
this.sameHeadIds = sameHeadIds; this.sameHeadIds = sameHeadIds;
} }
public String getSameHeadIds() public String getSameHeadIds()
{ {
return sameHeadIds; return sameHeadIds;
} }
public void setOff(String off) public void setOff(String off)
{ {
this.off = off; this.off = off;
} }
public String getOff() public String getOff()
{ {
return off; return off;
} }
public void setUserId(Long userId) public void setUserId(Long userId)
{ {
this.userId = userId; this.userId = userId;
} }
public Long getUserId() public Long getUserId()
{ {
return userId; return userId;
} }
@ -281,30 +282,30 @@ public class SzxcJmInfo extends BaseEntity
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId()) .append("id", getId())
.append("deptId", getDeptId()) .append("deptId", getDeptId())
.append("deptName", getDeptName()) .append("deptName", getDeptName())
.append("name", getName()) .append("name", getName())
.append("oldName", getOldName()) .append("oldName", getOldName())
.append("nationality", getNationality()) .append("nationality", getNationality())
.append("idCard", getIdCard()) .append("cardId", getCardId())
.append("bornDate", getBornDate()) .append("bornDate", getBornDate())
.append("age", getAge()) .append("age", getAge())
.append("sex", getSex()) .append("sex", getSex())
.append("jg", getJg()) .append("jg", getJg())
.append("relation", getRelation()) .append("relation", getRelation())
.append("jgNature", getJgNature()) .append("jgNature", getJgNature())
.append("longLive", getLongLive()) .append("longLive", getLongLive())
.append("hjAddress", getHjAddress()) .append("hjAddress", getHjAddress())
.append("phone", getPhone()) .append("phone", getPhone())
.append("head", getHead()) .append("head", getHead())
.append("sameHeadIds", getSameHeadIds()) .append("sameHeadIds", getSameHeadIds())
.append("off", getOff()) .append("off", getOff())
.append("createBy", getCreateBy()) .append("createBy", getCreateBy())
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
.append("userId", getUserId()) .append("userId", getUserId())
.toString(); .toString();
} }
} }

@ -0,0 +1,50 @@
package com.ruoyi.szxc.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* szxc_jm_tag
*
* @author hs
* @date 2024-03-16
*/
public class SzxcJmTag extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 居民id */
private Long jmId;
/** 标签id */
private Long tagId;
public void setJmId(Long jmId)
{
this.jmId = jmId;
}
public Long getJmId()
{
return jmId;
}
public void setTagId(Long tagId)
{
this.tagId = tagId;
}
public Long getTagId()
{
return tagId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("jmId", getJmId())
.append("tagId", getTagId())
.toString();
}
}

@ -6,12 +6,12 @@ import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
/** /**
* news * szxc_news
* *
* @author hs * @author hs
* @date 2024-03-15 * @date 2024-03-16
*/ */
public class News extends BaseEntity public class SzxcNews extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

@ -0,0 +1,62 @@
package com.ruoyi.szxc.mapper;
import com.ruoyi.szxc.domain.SzxcJmCar;
import java.util.List;
/**
* Mapper
*
* @author hs
* @date 2024-03-16
*/
public interface SzxcJmCarMapper
{
/**
*
*
* @param jmId
* @return
*/
public SzxcJmCar selectSzxcJmCarByJmId(Long jmId);
/**
*
*
* @param szxcJmCar
* @return
*/
public List<SzxcJmCar> selectSzxcJmCarList(SzxcJmCar szxcJmCar);
/**
*
*
* @param szxcJmCar
* @return
*/
public int insertSzxcJmCar(SzxcJmCar szxcJmCar);
/**
*
*
* @param szxcJmCar
* @return
*/
public int updateSzxcJmCar(SzxcJmCar szxcJmCar);
/**
*
*
* @param jmId
* @return
*/
public int deleteSzxcJmCarByJmId(Long jmId);
/**
*
*
* @param jmIds
* @return
*/
public int deleteSzxcJmCarByJmIds(Long[] jmIds);
}

@ -0,0 +1,61 @@
package com.ruoyi.szxc.mapper;
import java.util.List;
import com.ruoyi.szxc.domain.SzxcJmHouse;
/**
* Mapper
*
* @author hs
* @date 2024-03-16
*/
public interface SzxcJmHouseMapper
{
/**
*
*
* @param jmId
* @return
*/
public SzxcJmHouse selectSzxcJmHouseByJmId(Long jmId);
/**
*
*
* @param szxcJmHouse
* @return
*/
public List<SzxcJmHouse> selectSzxcJmHouseList(SzxcJmHouse szxcJmHouse);
/**
*
*
* @param szxcJmHouse
* @return
*/
public int insertSzxcJmHouse(SzxcJmHouse szxcJmHouse);
/**
*
*
* @param szxcJmHouse
* @return
*/
public int updateSzxcJmHouse(SzxcJmHouse szxcJmHouse);
/**
*
*
* @param jmId
* @return
*/
public int deleteSzxcJmHouseByJmId(Long jmId);
/**
*
*
* @param jmIds
* @return
*/
public int deleteSzxcJmHouseByJmIds(Long[] jmIds);
}

@ -0,0 +1,61 @@
package com.ruoyi.szxc.mapper;
import java.util.List;
import com.ruoyi.szxc.domain.SzxcJmTag;
/**
* Mapper
*
* @author hs
* @date 2024-03-16
*/
public interface SzxcJmTagMapper
{
/**
*
*
* @param jmId
* @return
*/
public SzxcJmTag selectSzxcJmTagByJmId(Long jmId);
/**
*
*
* @param szxcJmTag
* @return
*/
public List<SzxcJmTag> selectSzxcJmTagList(SzxcJmTag szxcJmTag);
/**
*
*
* @param szxcJmTag
* @return
*/
public int insertSzxcJmTag(SzxcJmTag szxcJmTag);
/**
*
*
* @param szxcJmTag
* @return
*/
public int updateSzxcJmTag(SzxcJmTag szxcJmTag);
/**
*
*
* @param jmId
* @return
*/
public int deleteSzxcJmTagByJmId(Long jmId);
/**
*
*
* @param jmIds
* @return
*/
public int deleteSzxcJmTagByJmIds(Long[] jmIds);
}

@ -1,16 +1,15 @@
package com.ruoyi.szxc.mapper; package com.ruoyi.szxc.mapper;
import com.ruoyi.szxc.domain.News;
import java.util.List; import java.util.List;
import com.ruoyi.szxc.domain.SzxcNews;
/** /**
* Mapper * Mapper
* *
* @author hs * @author hs
* @date 2024-03-15 * @date 2024-03-16
*/ */
public interface NewsMapper public interface SzxcNewsMapper
{ {
/** /**
* *
@ -18,31 +17,31 @@ public interface NewsMapper
* @param id * @param id
* @return * @return
*/ */
public News selectNewsById(Long id); public SzxcNews selectSzxcNewsById(Long id);
/** /**
* *
* *
* @param news * @param szxcNews
* @return * @return
*/ */
public List<News> selectNewsList(News news); public List<SzxcNews> selectSzxcNewsList(SzxcNews szxcNews);
/** /**
* *
* *
* @param news * @param szxcNews
* @return * @return
*/ */
public int insertNews(News news); public int insertSzxcNews(SzxcNews szxcNews);
/** /**
* *
* *
* @param news * @param szxcNews
* @return * @return
*/ */
public int updateNews(News news); public int updateSzxcNews(SzxcNews szxcNews);
/** /**
* *
@ -50,7 +49,7 @@ public interface NewsMapper
* @param id * @param id
* @return * @return
*/ */
public int deleteNewsById(Long id); public int deleteSzxcNewsById(Long id);
/** /**
* *
@ -58,5 +57,5 @@ public interface NewsMapper
* @param ids * @param ids
* @return * @return
*/ */
public int deleteNewsByIds(Long[] ids); public int deleteSzxcNewsByIds(Long[] ids);
} }

@ -0,0 +1,62 @@
package com.ruoyi.szxc.service;
import com.ruoyi.szxc.domain.SzxcJmCar;
import java.util.List;
/**
* Service
*
* @author hs
* @date 2024-03-16
*/
public interface ISzxcJmCarService
{
/**
*
*
* @param jmId
* @return
*/
public SzxcJmCar selectSzxcJmCarByJmId(Long jmId);
/**
*
*
* @param szxcJmCar
* @return
*/
public List<SzxcJmCar> selectSzxcJmCarList(SzxcJmCar szxcJmCar);
/**
*
*
* @param szxcJmCar
* @return
*/
public int insertSzxcJmCar(SzxcJmCar szxcJmCar);
/**
*
*
* @param szxcJmCar
* @return
*/
public int updateSzxcJmCar(SzxcJmCar szxcJmCar);
/**
*
*
* @param jmIds
* @return
*/
public int deleteSzxcJmCarByJmIds(Long[] jmIds);
/**
*
*
* @param jmId
* @return
*/
public int deleteSzxcJmCarByJmId(Long jmId);
}

@ -0,0 +1,61 @@
package com.ruoyi.szxc.service;
import java.util.List;
import com.ruoyi.szxc.domain.SzxcJmHouse;
/**
* Service
*
* @author hs
* @date 2024-03-16
*/
public interface ISzxcJmHouseService
{
/**
*
*
* @param jmId
* @return
*/
public SzxcJmHouse selectSzxcJmHouseByJmId(Long jmId);
/**
*
*
* @param szxcJmHouse
* @return
*/
public List<SzxcJmHouse> selectSzxcJmHouseList(SzxcJmHouse szxcJmHouse);
/**
*
*
* @param szxcJmHouse
* @return
*/
public int insertSzxcJmHouse(SzxcJmHouse szxcJmHouse);
/**
*
*
* @param szxcJmHouse
* @return
*/
public int updateSzxcJmHouse(SzxcJmHouse szxcJmHouse);
/**
*
*
* @param jmIds
* @return
*/
public int deleteSzxcJmHouseByJmIds(Long[] jmIds);
/**
*
*
* @param jmId
* @return
*/
public int deleteSzxcJmHouseByJmId(Long jmId);
}

@ -0,0 +1,61 @@
package com.ruoyi.szxc.service;
import java.util.List;
import com.ruoyi.szxc.domain.SzxcJmTag;
/**
* Service
*
* @author hs
* @date 2024-03-16
*/
public interface ISzxcJmTagService
{
/**
*
*
* @param jmId
* @return
*/
public SzxcJmTag selectSzxcJmTagByJmId(Long jmId);
/**
*
*
* @param szxcJmTag
* @return
*/
public List<SzxcJmTag> selectSzxcJmTagList(SzxcJmTag szxcJmTag);
/**
*
*
* @param szxcJmTag
* @return
*/
public int insertSzxcJmTag(SzxcJmTag szxcJmTag);
/**
*
*
* @param szxcJmTag
* @return
*/
public int updateSzxcJmTag(SzxcJmTag szxcJmTag);
/**
*
*
* @param jmIds
* @return
*/
public int deleteSzxcJmTagByJmIds(Long[] jmIds);
/**
*
*
* @param jmId
* @return
*/
public int deleteSzxcJmTagByJmId(Long jmId);
}

@ -1,16 +1,15 @@
package com.ruoyi.szxc.service; package com.ruoyi.szxc.service;
import com.ruoyi.szxc.domain.News;
import java.util.List; import java.util.List;
import com.ruoyi.szxc.domain.SzxcNews;
/** /**
* Service * Service
* *
* @author hs * @author hs
* @date 2024-03-15 * @date 2024-03-16
*/ */
public interface INewsService public interface ISzxcNewsService
{ {
/** /**
* *
@ -18,31 +17,31 @@ public interface INewsService
* @param id * @param id
* @return * @return
*/ */
public News selectNewsById(Long id); public SzxcNews selectSzxcNewsById(Long id);
/** /**
* *
* *
* @param news * @param szxcNews
* @return * @return
*/ */
public List<News> selectNewsList(News news); public List<SzxcNews> selectSzxcNewsList(SzxcNews szxcNews);
/** /**
* *
* *
* @param news * @param szxcNews
* @return * @return
*/ */
public int insertNews(News news); public int insertSzxcNews(SzxcNews szxcNews);
/** /**
* *
* *
* @param news * @param szxcNews
* @return * @return
*/ */
public int updateNews(News news); public int updateSzxcNews(SzxcNews szxcNews);
/** /**
* *
@ -50,7 +49,7 @@ public interface INewsService
* @param ids * @param ids
* @return * @return
*/ */
public int deleteNewsByIds(Long[] ids); public int deleteSzxcNewsByIds(Long[] ids);
/** /**
* *
@ -58,5 +57,5 @@ public interface INewsService
* @param id * @param id
* @return * @return
*/ */
public int deleteNewsById(Long id); public int deleteSzxcNewsById(Long id);
} }

@ -1,97 +0,0 @@
package com.ruoyi.szxc.service.impl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.szxc.domain.News;
import com.ruoyi.szxc.mapper.NewsMapper;
import com.ruoyi.szxc.service.INewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author hs
* @date 2024-03-15
*/
@Service
public class NewsServiceImpl implements INewsService
{
@Autowired
private NewsMapper newsMapper;
/**
*
*
* @param id
* @return
*/
@Override
public News selectNewsById(Long id)
{
return newsMapper.selectNewsById(id);
}
/**
*
*
* @param news
* @return
*/
@Override
public List<News> selectNewsList(News news)
{
return newsMapper.selectNewsList(news);
}
/**
*
*
* @param news
* @return
*/
@Override
public int insertNews(News news)
{
news.setCreateTime(DateUtils.getNowDate());
return newsMapper.insertNews(news);
}
/**
*
*
* @param news
* @return
*/
@Override
public int updateNews(News news)
{
news.setUpdateTime(DateUtils.getNowDate());
return newsMapper.updateNews(news);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteNewsByIds(Long[] ids)
{
return newsMapper.deleteNewsByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteNewsById(Long id)
{
return newsMapper.deleteNewsById(id);
}
}

@ -0,0 +1,94 @@
package com.ruoyi.szxc.service.impl;
import com.ruoyi.szxc.domain.SzxcJmCar;
import com.ruoyi.szxc.mapper.SzxcJmCarMapper;
import com.ruoyi.szxc.service.ISzxcJmCarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author hs
* @date 2024-03-16
*/
@Service
public class SzxcJmCarServiceImpl implements ISzxcJmCarService
{
@Autowired
private SzxcJmCarMapper szxcJmCarMapper;
/**
*
*
* @param jmId
* @return
*/
@Override
public SzxcJmCar selectSzxcJmCarByJmId(Long jmId)
{
return szxcJmCarMapper.selectSzxcJmCarByJmId(jmId);
}
/**
*
*
* @param szxcJmCar
* @return
*/
@Override
public List<SzxcJmCar> selectSzxcJmCarList(SzxcJmCar szxcJmCar)
{
return szxcJmCarMapper.selectSzxcJmCarList(szxcJmCar);
}
/**
*
*
* @param szxcJmCar
* @return
*/
@Override
public int insertSzxcJmCar(SzxcJmCar szxcJmCar)
{
return szxcJmCarMapper.insertSzxcJmCar(szxcJmCar);
}
/**
*
*
* @param szxcJmCar
* @return
*/
@Override
public int updateSzxcJmCar(SzxcJmCar szxcJmCar)
{
return szxcJmCarMapper.updateSzxcJmCar(szxcJmCar);
}
/**
*
*
* @param jmIds
* @return
*/
@Override
public int deleteSzxcJmCarByJmIds(Long[] jmIds)
{
return szxcJmCarMapper.deleteSzxcJmCarByJmIds(jmIds);
}
/**
*
*
* @param jmId
* @return
*/
@Override
public int deleteSzxcJmCarByJmId(Long jmId)
{
return szxcJmCarMapper.deleteSzxcJmCarByJmId(jmId);
}
}

@ -0,0 +1,93 @@
package com.ruoyi.szxc.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.szxc.mapper.SzxcJmHouseMapper;
import com.ruoyi.szxc.domain.SzxcJmHouse;
import com.ruoyi.szxc.service.ISzxcJmHouseService;
/**
* Service
*
* @author hs
* @date 2024-03-16
*/
@Service
public class SzxcJmHouseServiceImpl implements ISzxcJmHouseService
{
@Autowired
private SzxcJmHouseMapper szxcJmHouseMapper;
/**
*
*
* @param jmId
* @return
*/
@Override
public SzxcJmHouse selectSzxcJmHouseByJmId(Long jmId)
{
return szxcJmHouseMapper.selectSzxcJmHouseByJmId(jmId);
}
/**
*
*
* @param szxcJmHouse
* @return
*/
@Override
public List<SzxcJmHouse> selectSzxcJmHouseList(SzxcJmHouse szxcJmHouse)
{
return szxcJmHouseMapper.selectSzxcJmHouseList(szxcJmHouse);
}
/**
*
*
* @param szxcJmHouse
* @return
*/
@Override
public int insertSzxcJmHouse(SzxcJmHouse szxcJmHouse)
{
return szxcJmHouseMapper.insertSzxcJmHouse(szxcJmHouse);
}
/**
*
*
* @param szxcJmHouse
* @return
*/
@Override
public int updateSzxcJmHouse(SzxcJmHouse szxcJmHouse)
{
return szxcJmHouseMapper.updateSzxcJmHouse(szxcJmHouse);
}
/**
*
*
* @param jmIds
* @return
*/
@Override
public int deleteSzxcJmHouseByJmIds(Long[] jmIds)
{
return szxcJmHouseMapper.deleteSzxcJmHouseByJmIds(jmIds);
}
/**
*
*
* @param jmId
* @return
*/
@Override
public int deleteSzxcJmHouseByJmId(Long jmId)
{
return szxcJmHouseMapper.deleteSzxcJmHouseByJmId(jmId);
}
}

@ -0,0 +1,93 @@
package com.ruoyi.szxc.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.szxc.mapper.SzxcJmTagMapper;
import com.ruoyi.szxc.domain.SzxcJmTag;
import com.ruoyi.szxc.service.ISzxcJmTagService;
/**
* Service
*
* @author hs
* @date 2024-03-16
*/
@Service
public class SzxcJmTagServiceImpl implements ISzxcJmTagService
{
@Autowired
private SzxcJmTagMapper szxcJmTagMapper;
/**
*
*
* @param jmId
* @return
*/
@Override
public SzxcJmTag selectSzxcJmTagByJmId(Long jmId)
{
return szxcJmTagMapper.selectSzxcJmTagByJmId(jmId);
}
/**
*
*
* @param szxcJmTag
* @return
*/
@Override
public List<SzxcJmTag> selectSzxcJmTagList(SzxcJmTag szxcJmTag)
{
return szxcJmTagMapper.selectSzxcJmTagList(szxcJmTag);
}
/**
*
*
* @param szxcJmTag
* @return
*/
@Override
public int insertSzxcJmTag(SzxcJmTag szxcJmTag)
{
return szxcJmTagMapper.insertSzxcJmTag(szxcJmTag);
}
/**
*
*
* @param szxcJmTag
* @return
*/
@Override
public int updateSzxcJmTag(SzxcJmTag szxcJmTag)
{
return szxcJmTagMapper.updateSzxcJmTag(szxcJmTag);
}
/**
*
*
* @param jmIds
* @return
*/
@Override
public int deleteSzxcJmTagByJmIds(Long[] jmIds)
{
return szxcJmTagMapper.deleteSzxcJmTagByJmIds(jmIds);
}
/**
*
*
* @param jmId
* @return
*/
@Override
public int deleteSzxcJmTagByJmId(Long jmId)
{
return szxcJmTagMapper.deleteSzxcJmTagByJmId(jmId);
}
}

@ -0,0 +1,97 @@
package com.ruoyi.szxc.service.impl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.szxc.domain.SzxcNews;
import com.ruoyi.szxc.mapper.SzxcNewsMapper;
import com.ruoyi.szxc.service.ISzxcNewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author hs
* @date 2024-03-16
*/
@Service
public class SzxcNewsServiceImpl implements ISzxcNewsService
{
@Autowired
private SzxcNewsMapper szxcNewsMapper;
/**
*
*
* @param id
* @return
*/
@Override
public SzxcNews selectSzxcNewsById(Long id)
{
return szxcNewsMapper.selectSzxcNewsById(id);
}
/**
*
*
* @param szxcNews
* @return
*/
@Override
public List<SzxcNews> selectSzxcNewsList(SzxcNews szxcNews)
{
return szxcNewsMapper.selectSzxcNewsList(szxcNews);
}
/**
*
*
* @param szxcNews
* @return
*/
@Override
public int insertSzxcNews(SzxcNews szxcNews)
{
szxcNews.setCreateTime(DateUtils.getNowDate());
return szxcNewsMapper.insertSzxcNews(szxcNews);
}
/**
*
*
* @param szxcNews
* @return
*/
@Override
public int updateSzxcNews(SzxcNews szxcNews)
{
szxcNews.setUpdateTime(DateUtils.getNowDate());
return szxcNewsMapper.updateSzxcNews(szxcNews);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteSzxcNewsByIds(Long[] ids)
{
return szxcNewsMapper.deleteSzxcNewsByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteSzxcNewsById(Long id)
{
return szxcNewsMapper.deleteSzxcNewsById(id);
}
}

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.szxc.mapper.SzxcJmInfoMapper"> <mapper namespace="com.ruoyi.szxc.mapper.SzxcJmInfoMapper">
<resultMap type="SzxcJmInfo" id="SzxcJmInfoResult"> <resultMap type="SzxcJmInfo" id="SzxcJmInfoResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="deptId" column="dept_id" /> <result property="deptId" column="dept_id" />
@ -11,7 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="name" column="name" /> <result property="name" column="name" />
<result property="oldName" column="old_name" /> <result property="oldName" column="old_name" />
<result property="nationality" column="nationality" /> <result property="nationality" column="nationality" />
<result property="idCard" column="id_card" /> <result property="cardId" column="card_id" />
<result property="bornDate" column="born_date" /> <result property="bornDate" column="born_date" />
<result property="age" column="age" /> <result property="age" column="age" />
<result property="sex" column="sex" /> <result property="sex" column="sex" />
@ -32,18 +32,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectSzxcJmInfoVo"> <sql id="selectSzxcJmInfoVo">
select id, dept_id, dept_name, name, old_name, nationality, id_card, born_date, age, sex, jg, relation, jg_nature, long_live, hj_address, phone, head, same_head_ids, off, create_by, create_time, update_by, update_time, user_id from szxc_jm_info select id, dept_id, dept_name, name, old_name, nationality, card_id, born_date, age, sex, jg, relation, jg_nature, long_live, hj_address, phone, head, same_head_ids, off, create_by, create_time, update_by, update_time, user_id from szxc_jm_info
</sql> </sql>
<select id="selectSzxcJmInfoList" parameterType="SzxcJmInfo" resultMap="SzxcJmInfoResult"> <select id="selectSzxcJmInfoList" parameterType="SzxcJmInfo" resultMap="SzxcJmInfoResult">
<include refid="selectSzxcJmInfoVo"/> <include refid="selectSzxcJmInfoVo"/>
<where> <where>
<if test="deptId != null "> and dept_id = #{deptId}</if> <if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if> <if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="oldName != null and oldName != ''"> and old_name like concat('%', #{oldName}, '%')</if> <if test="oldName != null and oldName != ''"> and old_name like concat('%', #{oldName}, '%')</if>
<if test="nationality != null and nationality != ''"> and nationality = #{nationality}</if> <if test="nationality != null and nationality != ''"> and nationality = #{nationality}</if>
<if test="idCard != null and idCard != ''"> and id_card = #{idCard}</if> <if test="cardId != null and cardId != ''"> and card_id = #{cardId}</if>
<if test="bornDate != null "> and born_date = #{bornDate}</if> <if test="bornDate != null "> and born_date = #{bornDate}</if>
<if test="age != null "> and age = #{age}</if> <if test="age != null "> and age = #{age}</if>
<if test="sex != null and sex != ''"> and sex = #{sex}</if> <if test="sex != null and sex != ''"> and sex = #{sex}</if>
@ -59,12 +59,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userId != null "> and user_id = #{userId}</if> <if test="userId != null "> and user_id = #{userId}</if>
</where> </where>
</select> </select>
<select id="selectSzxcJmInfoById" parameterType="Long" resultMap="SzxcJmInfoResult"> <select id="selectSzxcJmInfoById" parameterType="Long" resultMap="SzxcJmInfoResult">
<include refid="selectSzxcJmInfoVo"/> <include refid="selectSzxcJmInfoVo"/>
where id = #{id} where id = #{id}
</select> </select>
<insert id="insertSzxcJmInfo" parameterType="SzxcJmInfo" useGeneratedKeys="true" keyProperty="id"> <insert id="insertSzxcJmInfo" parameterType="SzxcJmInfo" useGeneratedKeys="true" keyProperty="id">
insert into szxc_jm_info insert into szxc_jm_info
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
@ -73,7 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="name != null">name,</if> <if test="name != null">name,</if>
<if test="oldName != null">old_name,</if> <if test="oldName != null">old_name,</if>
<if test="nationality != null">nationality,</if> <if test="nationality != null">nationality,</if>
<if test="idCard != null">id_card,</if> <if test="cardId != null">card_id,</if>
<if test="bornDate != null">born_date,</if> <if test="bornDate != null">born_date,</if>
<if test="age != null">age,</if> <if test="age != null">age,</if>
<if test="sex != null">sex,</if> <if test="sex != null">sex,</if>
@ -91,14 +91,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="userId != null">user_id,</if> <if test="userId != null">user_id,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deptId != null">#{deptId},</if> <if test="deptId != null">#{deptId},</if>
<if test="deptName != null">#{deptName},</if> <if test="deptName != null">#{deptName},</if>
<if test="name != null">#{name},</if> <if test="name != null">#{name},</if>
<if test="oldName != null">#{oldName},</if> <if test="oldName != null">#{oldName},</if>
<if test="nationality != null">#{nationality},</if> <if test="nationality != null">#{nationality},</if>
<if test="idCard != null">#{idCard},</if> <if test="cardId != null">#{cardId},</if>
<if test="bornDate != null">#{bornDate},</if> <if test="bornDate != null">#{bornDate},</if>
<if test="age != null">#{age},</if> <if test="age != null">#{age},</if>
<if test="sex != null">#{sex},</if> <if test="sex != null">#{sex},</if>
@ -116,7 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="userId != null">#{userId},</if> <if test="userId != null">#{userId},</if>
</trim> </trim>
</insert> </insert>
<update id="updateSzxcJmInfo" parameterType="SzxcJmInfo"> <update id="updateSzxcJmInfo" parameterType="SzxcJmInfo">
@ -127,7 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="name != null">name = #{name},</if> <if test="name != null">name = #{name},</if>
<if test="oldName != null">old_name = #{oldName},</if> <if test="oldName != null">old_name = #{oldName},</if>
<if test="nationality != null">nationality = #{nationality},</if> <if test="nationality != null">nationality = #{nationality},</if>
<if test="idCard != null">id_card = #{idCard},</if> <if test="cardId != null">card_id = #{cardId},</if>
<if test="bornDate != null">born_date = #{bornDate},</if> <if test="bornDate != null">born_date = #{bornDate},</if>
<if test="age != null">age = #{age},</if> <if test="age != null">age = #{age},</if>
<if test="sex != null">sex = #{sex},</if> <if test="sex != null">sex = #{sex},</if>
@ -154,7 +154,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<delete id="deleteSzxcJmInfoByIds" parameterType="String"> <delete id="deleteSzxcJmInfoByIds" parameterType="String">
delete from szxc_jm_info where id in delete from szxc_jm_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>

@ -2,9 +2,9 @@
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.szxc.mapper.NewsMapper"> <mapper namespace="com.ruoyi.szxc.mapper.SzxcNewsMapper">
<resultMap type="News" id="NewsResult"> <resultMap type="SzxcNews" id="SzxcNewsResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="title" column="title" /> <result property="title" column="title" />
<result property="type" column="type" /> <result property="type" column="type" />
@ -20,12 +20,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="userId" column="user_id" /> <result property="userId" column="user_id" />
</resultMap> </resultMap>
<sql id="selectNewsVo"> <sql id="selectSzxcNewsVo">
select id, title, type, picture, content, leave, create_by, create_time, update_by, update_time, dept_id, dept_name, user_id from news select id, title, type, picture, content, leave, create_by, create_time, update_by, update_time, dept_id, dept_name, user_id from szxc_news
</sql> </sql>
<select id="selectNewsList" parameterType="News" resultMap="NewsResult"> <select id="selectSzxcNewsList" parameterType="SzxcNews" resultMap="SzxcNewsResult">
<include refid="selectNewsVo"/> <include refid="selectSzxcNewsVo"/>
<where> <where>
<if test="title != null and title != ''"> and title = #{title}</if> <if test="title != null and title != ''"> and title = #{title}</if>
<if test="type != null and type != ''"> and type = #{type}</if> <if test="type != null and type != ''"> and type = #{type}</if>
@ -38,13 +38,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="selectNewsById" parameterType="Long" resultMap="NewsResult"> <select id="selectSzxcNewsById" parameterType="Long" resultMap="SzxcNewsResult">
<include refid="selectNewsVo"/> <include refid="selectSzxcNewsVo"/>
where id = #{id} where id = #{id}
</select> </select>
<insert id="insertNews" parameterType="News" useGeneratedKeys="true" keyProperty="id"> <insert id="insertSzxcNews" parameterType="SzxcNews" useGeneratedKeys="true" keyProperty="id">
insert into news insert into szxc_news
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="title != null and title != ''">title,</if> <if test="title != null and title != ''">title,</if>
<if test="type != null">type,</if> <if test="type != null">type,</if>
@ -75,8 +75,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim> </trim>
</insert> </insert>
<update id="updateNews" parameterType="News"> <update id="updateSzxcNews" parameterType="SzxcNews">
update news update szxc_news
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="title != null and title != ''">title = #{title},</if> <if test="title != null and title != ''">title = #{title},</if>
<if test="type != null">type = #{type},</if> <if test="type != null">type = #{type},</if>
@ -94,12 +94,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id} where id = #{id}
</update> </update>
<delete id="deleteNewsById" parameterType="Long"> <delete id="deleteSzxcNewsById" parameterType="Long">
delete from news where id = #{id} delete from szxc_news where id = #{id}
</delete> </delete>
<delete id="deleteNewsByIds" parameterType="String"> <delete id="deleteSzxcNewsByIds" parameterType="String">
delete from news where id in delete from szxc_news where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>

@ -41,9 +41,9 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="身份证号" prop="idCard"> <el-form-item label="身份证号" prop="cardId">
<el-input <el-input
v-model="queryParams.idCard" v-model="queryParams.cardId"
placeholder="请输入身份证号" placeholder="请输入身份证号"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
@ -51,10 +51,10 @@
</el-form-item> </el-form-item>
<el-form-item label="出生日期" prop="bornDate"> <el-form-item label="出生日期" prop="bornDate">
<el-date-picker clearable <el-date-picker clearable
v-model="queryParams.bornDate" v-model="queryParams.bornDate"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="请选择出生日期"> placeholder="请选择出生日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="年龄" prop="age"> <el-form-item label="年龄" prop="age">
@ -205,14 +205,14 @@
<el-table-column label="姓名" align="center" prop="name" /> <el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="曾用名" align="center" prop="oldName" /> <el-table-column label="曾用名" align="center" prop="oldName" />
<el-table-column label="国籍" align="center" prop="nationality" /> <el-table-column label="国籍" align="center" prop="nationality" />
<el-table-column label="身份证号" align="center" prop="idCard" /> <el-table-column label="身份证号" align="center" prop="cardId" />
<el-table-column label="出生日期" align="center" prop="bornDate" width="180"> <el-table-column label="出生日期" align="center" prop="bornDate" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.bornDate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.bornDate, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="年龄" align="center" prop="age" /> <el-table-column label="年龄" align="center" prop="age" />
<el-table-column label="用户性别" align="center" prop="sex" /> <el-table-column label="性别" align="center" prop="sex" />
<el-table-column label="籍贯" align="center" prop="jg" /> <el-table-column label="籍贯" align="center" prop="jg" />
<el-table-column label="与户主关系" align="center" prop="relation" /> <el-table-column label="与户主关系" align="center" prop="relation" />
<el-table-column label="籍贯性质" align="center" prop="jgNature" /> <el-table-column label="籍贯性质" align="center" prop="jgNature" />
@ -242,7 +242,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
@ -269,15 +269,15 @@
<el-form-item label="国籍" prop="nationality"> <el-form-item label="国籍" prop="nationality">
<el-input v-model="form.nationality" placeholder="请输入国籍" /> <el-input v-model="form.nationality" placeholder="请输入国籍" />
</el-form-item> </el-form-item>
<el-form-item label="身份证号" prop="idCard"> <el-form-item label="身份证号" prop="cardId">
<el-input v-model="form.idCard" placeholder="请输入身份证号" /> <el-input v-model="form.cardId" placeholder="请输入身份证号" />
</el-form-item> </el-form-item>
<el-form-item label="出生日期" prop="bornDate"> <el-form-item label="出生日期" prop="bornDate">
<el-date-picker clearable <el-date-picker clearable
v-model="form.bornDate" v-model="form.bornDate"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="请选择出生日期"> placeholder="请选择出生日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="年龄" prop="age"> <el-form-item label="年龄" prop="age">
@ -323,186 +323,186 @@
</template> </template>
<script> <script>
import { listJminfo, getJminfo, delJminfo, addJminfo, updateJminfo } from "@/api/szxc/jminfo"; import { listJminfo, getJminfo, delJminfo, addJminfo, updateJminfo } from "@/api/szxc/jminfo";
export default { export default {
name: "Jminfo", name: "Jminfo",
data() { data() {
return { return {
// //
loading: true, loading: true,
// //
ids: [], ids: [],
// //
single: true, single: true,
// //
multiple: true, multiple: true,
// //
showSearch: true, showSearch: true,
// //
total: 0, total: 0,
// //
jminfoList: [], jminfoList: [],
// //
title: "", title: "",
// //
open: false, open: false,
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
deptId: null, deptId: null,
deptName: null, deptName: null,
name: null, name: null,
oldName: null, oldName: null,
nationality: null, nationality: null,
idCard: null, cardId: null,
bornDate: null, bornDate: null,
age: null, age: null,
sex: null, sex: null,
jg: null, jg: null,
relation: null, relation: null,
jgNature: null, jgNature: null,
longLive: null, longLive: null,
hjAddress: null, hjAddress: null,
phone: null, phone: null,
head: null, head: null,
sameHeadIds: null, sameHeadIds: null,
off: null, off: null,
userId: null userId: null
}, },
// //
form: {}, form: {},
// //
rules: { rules: {
deptId: [ deptId: [
{ required: true, message: "部门id不能为空", trigger: "blur" } { required: true, message: "部门id不能为空", trigger: "blur" }
], ],
head: [ head: [
{ required: true, message: "是否户主 0:户主 1:非户主不能为空", trigger: "blur" } { required: true, message: "是否户主 0:户主 1:非户主不能为空", trigger: "blur" }
], ],
off: [ off: [
{ required: true, message: "是否注销 0:正常 1:注销不能为空", trigger: "blur" } { required: true, message: "是否注销 0:正常 1:注销不能为空", trigger: "blur" }
], ],
} }
};
},
created() {
this.getList();
},
methods: {
/** 查询居民信息列表 */
getList() {
this.loading = true;
listJminfo(this.queryParams).then(response => {
this.jminfoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
deptId: null,
deptName: null,
name: null,
oldName: null,
nationality: null,
idCard: null,
bornDate: null,
age: null,
sex: null,
jg: null,
relation: null,
jgNature: null,
longLive: null,
hjAddress: null,
phone: null,
head: null,
sameHeadIds: null,
off: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
userId: null
}; };
this.resetForm("form");
}, },
/** 搜索按钮操作 */ created() {
handleQuery() {
this.queryParams.pageNum = 1;
this.getList(); this.getList();
}, },
/** 重置按钮操作 */ methods: {
resetQuery() { /** 查询居民信息列表 */
this.resetForm("queryForm"); getList() {
this.handleQuery(); this.loading = true;
}, listJminfo(this.queryParams).then(response => {
// this.jminfoList = response.rows;
handleSelectionChange(selection) { this.total = response.total;
this.ids = selection.map(item => item.id) this.loading = false;
this.single = selection.length!==1 });
this.multiple = !selection.length },
}, //
/** 新增按钮操作 */ cancel() {
handleAdd() { this.open = false;
this.reset(); this.reset();
this.open = true; },
this.title = "添加居民信息"; //
}, reset() {
/** 修改按钮操作 */ this.form = {
handleUpdate(row) { id: null,
this.reset(); deptId: null,
const id = row.id || this.ids deptName: null,
getJminfo(id).then(response => { name: null,
this.form = response.data; oldName: null,
nationality: null,
cardId: null,
bornDate: null,
age: null,
sex: null,
jg: null,
relation: null,
jgNature: null,
longLive: null,
hjAddress: null,
phone: null,
head: null,
sameHeadIds: null,
off: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
userId: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true; this.open = true;
this.title = "修改居民信息"; this.title = "添加居民信息";
}); },
}, /** 修改按钮操作 */
/** 提交按钮 */ handleUpdate(row) {
submitForm() { this.reset();
this.$refs["form"].validate(valid => { const id = row.id || this.ids
if (valid) { getJminfo(id).then(response => {
if (this.form.id != null) { this.form = response.data;
updateJminfo(this.form).then(response => { this.open = true;
this.$modal.msgSuccess("修改成功"); this.title = "修改居民信息";
this.open = false; });
this.getList(); },
}); /** 提交按钮 */
} else { submitForm() {
addJminfo(this.form).then(response => { this.$refs["form"].validate(valid => {
this.$modal.msgSuccess("新增成功"); if (valid) {
this.open = false; if (this.form.id != null) {
this.getList(); updateJminfo(this.form).then(response => {
}); this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addJminfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
} }
} });
}); },
}, /** 删除按钮操作 */
/** 删除按钮操作 */ handleDelete(row) {
handleDelete(row) { const ids = row.id || this.ids;
const ids = row.id || this.ids; this.$modal.confirm('是否确认删除居民信息编号为"' + ids + '"的数据项?').then(function() {
this.$modal.confirm('是否确认删除居民信息编号为"' + ids + '"的数据项?').then(function() { return delJminfo(ids);
return delJminfo(ids); }).then(() => {
}).then(() => { this.getList();
this.getList(); this.$modal.msgSuccess("删除成功");
this.$modal.msgSuccess("删除成功"); }).catch(() => {});
}).catch(() => {}); },
}, /** 导出按钮操作 */
/** 导出按钮操作 */ handleExport() {
handleExport() { this.download('szxc/jminfo/export', {
this.download('szxc/jminfo/export', { ...this.queryParams
...this.queryParams }, `jminfo_${new Date().getTime()}.xlsx`)
}, `jminfo_${new Date().getTime()}.xlsx`) }
} }
} };
};
</script> </script>

Loading…
Cancel
Save