Merge remote-tracking branch 'origin/main'

main
wanglei 2 years ago
commit 478200ba70

@ -1,25 +1,19 @@
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.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.szxc.domain.SzxcHjAddress;
import com.ruoyi.szxc.service.ISzxcHjAddressService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
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
@ -77,7 +71,7 @@ public class SzxcHjAddressController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody SzxcHjAddress szxcHjAddress)
{
return toAjax(szxcHjAddressService.insertSzxcHjAddress(szxcHjAddress));
return szxcHjAddressService.insertSzxcHjAddress(szxcHjAddress);
}
/**
@ -88,7 +82,7 @@ public class SzxcHjAddressController extends BaseController
@PutMapping
public AjaxResult edit(@RequestBody SzxcHjAddress szxcHjAddress)
{
return toAjax(szxcHjAddressService.updateSzxcHjAddress(szxcHjAddress));
return szxcHjAddressService.updateSzxcHjAddress(szxcHjAddress);
}
/**

@ -76,7 +76,7 @@ public class SzxcJmInfoController extends BaseController
szxcJmInfo.setDeptId(getDeptId());
}
szxcJmInfo.setUserId(getUserId());
return toAjax(szxcJmInfoService.insertSzxcJmInfo(szxcJmInfo));
return szxcJmInfoService.insertSzxcJmInfo(szxcJmInfo);
}
/**
@ -87,7 +87,7 @@ public class SzxcJmInfoController extends BaseController
@PutMapping
public AjaxResult edit(@RequestBody SzxcJmInfo szxcJmInfo)
{
return toAjax(szxcJmInfoService.updateSzxcJmInfo(szxcJmInfo));
return szxcJmInfoService.updateSzxcJmInfo(szxcJmInfo);
}
/**

@ -7,9 +7,9 @@ import com.ruoyi.common.core.domain.BaseEntity;
/**
* szxc_hj_address
*
*
* @author hs
* @date 2024-03-15
* @date 2024-03-27
*/
public class SzxcHjAddress extends BaseEntity
{
@ -18,6 +18,10 @@ public class SzxcHjAddress extends BaseEntity
/** id */
private Long id;
/** 居民id */
@Excel(name = "居民id")
private Long jmId;
/** 姓名 */
@Excel(name = "姓名")
private String name;
@ -46,75 +50,84 @@ public class SzxcHjAddress extends BaseEntity
@Excel(name = "创建者ID")
private Long userId;
public void setId(Long id)
public void setId(Long id)
{
this.id = id;
}
public Long getId()
public Long getId()
{
return id;
}
public void setName(String name)
public void setJmId(Long jmId)
{
this.jmId = jmId;
}
public Long getJmId()
{
return jmId;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
public String getName()
{
return name;
}
public void setIdCard(String idCard)
public void setIdCard(String idCard)
{
this.idCard = idCard;
}
public String getIdCard()
public String getIdCard()
{
return idCard;
}
public void setAcountNo(Long acountNo)
public void setAcountNo(Long acountNo)
{
this.acountNo = acountNo;
}
public Long getAcountNo()
public Long getAcountNo()
{
return acountNo;
}
public void setHjAddress(String hjAddress)
public void setHjAddress(String hjAddress)
{
this.hjAddress = hjAddress;
}
public String getHjAddress()
public String getHjAddress()
{
return hjAddress;
}
public void setDeptId(Long deptId)
public void setDeptId(Long deptId)
{
this.deptId = deptId;
}
public Long getDeptId()
public Long getDeptId()
{
return deptId;
}
public void setDeptName(String deptName)
public void setDeptName(String deptName)
{
this.deptName = deptName;
}
public String getDeptName()
public String getDeptName()
{
return deptName;
}
public void setUserId(Long userId)
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
public Long getUserId()
{
return userId;
}
@ -122,18 +135,19 @@ public class SzxcHjAddress extends BaseEntity
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("name", getName())
.append("idCard", getIdCard())
.append("acountNo", getAcountNo())
.append("hjAddress", getHjAddress())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("deptId", getDeptId())
.append("deptName", getDeptName())
.append("userId", getUserId())
.toString();
.append("id", getId())
.append("jmId", getJmId())
.append("name", getName())
.append("idCard", getIdCard())
.append("acountNo", getAcountNo())
.append("hjAddress", getHjAddress())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("deptId", getDeptId())
.append("deptName", getDeptName())
.append("userId", getUserId())
.toString();
}
}

@ -1,8 +1,10 @@
package com.ruoyi.szxc.service;
import java.util.List;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.szxc.domain.SzxcHjAddress;
import java.util.List;
/**
* Service
*
@ -33,7 +35,7 @@ public interface ISzxcHjAddressService
* @param szxcHjAddress
* @return
*/
public int insertSzxcHjAddress(SzxcHjAddress szxcHjAddress);
public AjaxResult insertSzxcHjAddress(SzxcHjAddress szxcHjAddress);
/**
*
@ -41,7 +43,7 @@ public interface ISzxcHjAddressService
* @param szxcHjAddress
* @return
*/
public int updateSzxcHjAddress(SzxcHjAddress szxcHjAddress);
public AjaxResult updateSzxcHjAddress(SzxcHjAddress szxcHjAddress);
/**
*

@ -1,5 +1,6 @@
package com.ruoyi.szxc.service;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.szxc.domain.SzxcJmInfo;
import java.util.List;
@ -34,7 +35,7 @@ public interface ISzxcJmInfoService
* @param szxcJmInfo
* @return
*/
public int insertSzxcJmInfo(SzxcJmInfo szxcJmInfo);
public AjaxResult insertSzxcJmInfo(SzxcJmInfo szxcJmInfo);
/**
*
@ -42,7 +43,7 @@ public interface ISzxcJmInfoService
* @param szxcJmInfo
* @return
*/
public int updateSzxcJmInfo(SzxcJmInfo szxcJmInfo);
public AjaxResult updateSzxcJmInfo(SzxcJmInfo szxcJmInfo);
/**
*

@ -1,12 +1,14 @@
package com.ruoyi.szxc.service.impl;
import java.util.List;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.szxc.mapper.SzxcHjAddressMapper;
import com.ruoyi.szxc.domain.SzxcHjAddress;
import com.ruoyi.szxc.mapper.SzxcHjAddressMapper;
import com.ruoyi.szxc.service.ISzxcHjAddressService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* Service
@ -17,7 +19,7 @@ import com.ruoyi.szxc.service.ISzxcHjAddressService;
@Service
public class SzxcHjAddressServiceImpl implements ISzxcHjAddressService
{
@Autowired
@Resource
private SzxcHjAddressMapper szxcHjAddressMapper;
/**
@ -51,10 +53,28 @@ public class SzxcHjAddressServiceImpl implements ISzxcHjAddressService
* @return
*/
@Override
public int insertSzxcHjAddress(SzxcHjAddress szxcHjAddress)
public AjaxResult insertSzxcHjAddress(SzxcHjAddress szxcHjAddress)
{
//户号重复验证
SzxcHjAddress hjAddress = new SzxcHjAddress();
hjAddress.setAcountNo(szxcHjAddress.getAcountNo());
List<SzxcHjAddress> szxcHjAddresses = szxcHjAddressMapper.selectSzxcHjAddressList(hjAddress);
if(szxcHjAddresses!=null&&szxcHjAddresses.size()>0){
return AjaxResult.error("户号已存在");
}
//身份证重复验证
hjAddress.setAcountNo(null);
hjAddress.setIdCard(szxcHjAddress.getIdCard());
szxcHjAddresses=szxcHjAddressMapper.selectSzxcHjAddressList(hjAddress);
if(szxcHjAddresses!=null&&szxcHjAddresses.size()>0){
return AjaxResult.error("身份证号已存在");
}
szxcHjAddress.setCreateTime(DateUtils.getNowDate());
return szxcHjAddressMapper.insertSzxcHjAddress(szxcHjAddress);
int result = szxcHjAddressMapper.insertSzxcHjAddress(szxcHjAddress);
if (result>0){
return AjaxResult.success("操作成功");
}
return AjaxResult.error("操作失败");
}
/**
@ -64,10 +84,28 @@ public class SzxcHjAddressServiceImpl implements ISzxcHjAddressService
* @return
*/
@Override
public int updateSzxcHjAddress(SzxcHjAddress szxcHjAddress)
public AjaxResult updateSzxcHjAddress(SzxcHjAddress szxcHjAddress)
{
//户号重复验证
SzxcHjAddress hjAddress = new SzxcHjAddress();
hjAddress.setAcountNo(szxcHjAddress.getAcountNo());
List<SzxcHjAddress> szxcHjAddresses = szxcHjAddressMapper.selectSzxcHjAddressList(hjAddress);
if(szxcHjAddresses!=null&&szxcHjAddresses.size()>0){
return AjaxResult.error("户号已存在");
}
//身份证重复验证
hjAddress.setAcountNo(null);
hjAddress.setIdCard(szxcHjAddress.getIdCard());
szxcHjAddresses=szxcHjAddressMapper.selectSzxcHjAddressList(hjAddress);
if(szxcHjAddresses!=null&&szxcHjAddresses.size()>0){
return AjaxResult.error("身份证号已存在");
}
szxcHjAddress.setUpdateTime(DateUtils.getNowDate());
return szxcHjAddressMapper.updateSzxcHjAddress(szxcHjAddress);
int result = szxcHjAddressMapper.updateSzxcHjAddress(szxcHjAddress);
if(result>0){
return AjaxResult.success("操作成功");
}
return AjaxResult.error("操作失败");
}
/**

@ -69,6 +69,11 @@ public class SzxcHkbgRecardServiceImpl implements ISzxcHkbgRecardService
jmInfo.setRelation(szxcHkbgRecard.getRelation());
jmInfo.setLongLive(szxcHkbgRecard.getLongLive());
jmInfo.setJgNature(szxcHkbgRecard.getJgNature());
if(szxcHkbgRecard.getRelation().equals("1")){
jmInfo.setHead("0");
}else {
jmInfo.setHead("1");
}
try {
szxcJmInfoMapper.updateSzxcJmInfo(jmInfo);
} catch (Exception e) {

@ -1,6 +1,7 @@
package com.ruoyi.szxc.service.impl;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.szxc.domain.SzxcJmInfo;
import com.ruoyi.szxc.mapper.SzxcJmInfoMapper;
@ -66,10 +67,21 @@ public class SzxcJmInfoServiceImpl implements ISzxcJmInfoService
* @return
*/
@Override
public int insertSzxcJmInfo(SzxcJmInfo szxcJmInfo)
public AjaxResult insertSzxcJmInfo(SzxcJmInfo szxcJmInfo)
{
//身份证号重复验证
SzxcJmInfo hj = new SzxcJmInfo();
hj.setCardId(szxcJmInfo.getCardId());
List<SzxcJmInfo> szxcJmInfos = szxcJmInfoMapper.selectSzxcJmInfoList(hj);
if(szxcJmInfos!=null&&szxcJmInfos.size()>0){
return AjaxResult.error("身份证号已存在");
}
szxcJmInfo.setCreateTime(DateUtils.getNowDate());
return szxcJmInfoMapper.insertSzxcJmInfo(szxcJmInfo);
int result = szxcJmInfoMapper.insertSzxcJmInfo(szxcJmInfo);
if(result>0){
return AjaxResult.success();
}
return AjaxResult.error();
}
/**
@ -79,10 +91,21 @@ public class SzxcJmInfoServiceImpl implements ISzxcJmInfoService
* @return
*/
@Override
public int updateSzxcJmInfo(SzxcJmInfo szxcJmInfo)
public AjaxResult updateSzxcJmInfo(SzxcJmInfo szxcJmInfo)
{
//身份证号重复验证
SzxcJmInfo hj = new SzxcJmInfo();
hj.setCardId(szxcJmInfo.getCardId());
List<SzxcJmInfo> szxcJmInfos = szxcJmInfoMapper.selectSzxcJmInfoList(hj);
if(szxcJmInfos!=null&&szxcJmInfos.size()>0){
return AjaxResult.error("身份证号已存在");
}
szxcJmInfo.setUpdateTime(DateUtils.getNowDate());
return szxcJmInfoMapper.updateSzxcJmInfo(szxcJmInfo);
int result = szxcJmInfoMapper.updateSzxcJmInfo(szxcJmInfo);
if(result>0){
return AjaxResult.success();
}
return AjaxResult.error();
}
/**

@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.szxc.mapper.SzxcHjAddressMapper">
<resultMap type="SzxcHjAddress" id="SzxcHjAddressResult">
<result property="id" column="id" />
<result property="jmId" column="jm_id" />
<result property="name" column="name" />
<result property="idCard" column="id_card" />
<result property="acountNo" column="acount_no" />
@ -20,12 +21,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectSzxcHjAddressVo">
select id, name, id_card, acount_no, hj_address, create_by, create_time, update_by, update_time, dept_id, dept_name, user_id from szxc_hj_address
select id, jm_id, name, id_card, acount_no, hj_address, create_by, create_time, update_by, update_time, dept_id, dept_name, user_id from szxc_hj_address
</sql>
<select id="selectSzxcHjAddressList" parameterType="SzxcHjAddress" resultMap="SzxcHjAddressResult">
<include refid="selectSzxcHjAddressVo"/>
<where>
<where>
<if test="jmId != null "> and jm_id = #{jmId}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="idCard != null and idCard != ''"> and id_card = #{idCard}</if>
<if test="acountNo != null "> and acount_no = #{acountNo}</if>
@ -35,15 +37,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userId != null "> and user_id = #{userId}</if>
</where>
</select>
<select id="selectSzxcHjAddressById" parameterType="Long" resultMap="SzxcHjAddressResult">
<include refid="selectSzxcHjAddressVo"/>
where id = #{id}
</select>
<insert id="insertSzxcHjAddress" parameterType="SzxcHjAddress" useGeneratedKeys="true" keyProperty="id">
insert into szxc_hj_address
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="jmId != null">jm_id,</if>
<if test="name != null">name,</if>
<if test="idCard != null">id_card,</if>
<if test="acountNo != null">acount_no,</if>
@ -55,8 +58,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deptId != null">dept_id,</if>
<if test="deptName != null">dept_name,</if>
<if test="userId != null">user_id,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="jmId != null">#{jmId},</if>
<if test="name != null">#{name},</if>
<if test="idCard != null">#{idCard},</if>
<if test="acountNo != null">#{acountNo},</if>
@ -68,12 +72,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deptId != null">#{deptId},</if>
<if test="deptName != null">#{deptName},</if>
<if test="userId != null">#{userId},</if>
</trim>
</trim>
</insert>
<update id="updateSzxcHjAddress" parameterType="SzxcHjAddress">
update szxc_hj_address
<trim prefix="SET" suffixOverrides=",">
<if test="jmId != null">jm_id = #{jmId},</if>
<if test="name != null">name = #{name},</if>
<if test="idCard != null">id_card = #{idCard},</if>
<if test="acountNo != null">acount_no = #{acountNo},</if>
@ -94,7 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteSzxcHjAddressByIds" parameterType="String">
delete from szxc_hj_address where id in
delete from szxc_hj_address where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>

Loading…
Cancel
Save