12 changed files with 907 additions and 27 deletions
@ -0,0 +1,93 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.vaccine.epidemic.controller; |
|||
|
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
|||
import com.elink.esua.epdc.dto.EpidemicUserInfoAuditDTO; |
|||
import com.elink.esua.epdc.vaccine.epidemic.service.EpidemicUserInfoAuditService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 疫情防控信息表 |
|||
* |
|||
* @author zhy qu@elink-cn.com |
|||
* @since v1.0.0 2022-06-29 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("epidemicuserinfoaudit") |
|||
public class EpidemicUserInfoAuditController { |
|||
|
|||
@Autowired |
|||
private EpidemicUserInfoAuditService epidemicUserInfoAuditService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<EpidemicUserInfoAuditDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<EpidemicUserInfoAuditDTO> page = epidemicUserInfoAuditService.page(params); |
|||
return new Result<PageData<EpidemicUserInfoAuditDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<EpidemicUserInfoAuditDTO> get(@PathVariable("id") String id){ |
|||
EpidemicUserInfoAuditDTO data = epidemicUserInfoAuditService.get(id); |
|||
return new Result<EpidemicUserInfoAuditDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody EpidemicUserInfoAuditDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
epidemicUserInfoAuditService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PostMapping("audit") |
|||
public Result audit(@RequestBody EpidemicUserInfoAuditDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
epidemicUserInfoAuditService.audit(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody EpidemicUserInfoAuditDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
epidemicUserInfoAuditService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
epidemicUserInfoAuditService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,43 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.vaccine.epidemic.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.dto.EpidemicUserInfoAuditDTO; |
|||
import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoAuditEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 疫情防控信息表 |
|||
* |
|||
* @author zhy qu@elink-cn.com |
|||
* @since v1.0.0 2022-06-29 |
|||
*/ |
|||
@Mapper |
|||
public interface EpidemicUserInfoAuditDao extends BaseDao<EpidemicUserInfoAuditEntity> { |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param idCard |
|||
* @return EpidemicUserInfoAuditDTO |
|||
* @author generator |
|||
* @date 2022-06-29 |
|||
*/ |
|||
EpidemicUserInfoAuditDTO getByIdCard(String idCard); |
|||
} |
@ -0,0 +1,204 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.vaccine.epidemic.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.elink.esua.epdc.vaccine.common.base.BasePingyinEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* 疫情防控信息表 |
|||
* |
|||
* @author zhy qu@elink-cn.com |
|||
* @since v1.0.0 2022-06-29 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epidemic_user_info_audit") |
|||
public class EpidemicUserInfoAuditEntity extends BasePingyinEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 姓名 |
|||
*/ |
|||
private String userName; |
|||
|
|||
/** |
|||
* 身份证号 |
|||
*/ |
|||
private String idCard; |
|||
|
|||
/** |
|||
* 户籍地code |
|||
*/ |
|||
private String householdRegisterCode; |
|||
|
|||
/** |
|||
* 户籍地名称 |
|||
*/ |
|||
private String householdRegisterName; |
|||
|
|||
/** |
|||
* 户籍地详细地址 |
|||
*/ |
|||
private String householdRegisterDetail; |
|||
|
|||
/** |
|||
* 性别 |
|||
*/ |
|||
private String gender; |
|||
|
|||
/** |
|||
* 民族 |
|||
*/ |
|||
private String nation; |
|||
|
|||
/** |
|||
* 与户主关系 |
|||
*/ |
|||
private String relation; |
|||
|
|||
/** |
|||
* 年龄 |
|||
*/ |
|||
private Integer age; |
|||
|
|||
/** |
|||
* 县内居住地code |
|||
*/ |
|||
private String liveAddressCode; |
|||
|
|||
/** |
|||
* 县内居住地镇街 |
|||
*/ |
|||
private String liveAddressName; |
|||
|
|||
/** |
|||
* 社区/村庄 |
|||
*/ |
|||
private String community; |
|||
|
|||
/** |
|||
* 网格名称 |
|||
|
|||
*/ |
|||
private String gridName; |
|||
|
|||
/** |
|||
* 手机号或座机号 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 所属部门ID |
|||
*/ |
|||
private Long deptId; |
|||
|
|||
/** |
|||
* 所属部门 |
|||
*/ |
|||
private String deptName; |
|||
|
|||
/** |
|||
* 父所有部门 |
|||
*/ |
|||
private String parentDeptIds; |
|||
|
|||
/** |
|||
* 父所有部门 |
|||
*/ |
|||
private String parentDeptNames; |
|||
|
|||
/** |
|||
* 所有部门ID |
|||
*/ |
|||
private String allDeptIds; |
|||
|
|||
/** |
|||
* 所有部门名称 |
|||
*/ |
|||
private String allDeptNames; |
|||
|
|||
/** |
|||
* 小区 |
|||
*/ |
|||
private String plot; |
|||
|
|||
/** |
|||
* 楼号 |
|||
*/ |
|||
private String buildingNo; |
|||
|
|||
/** |
|||
* 单元 |
|||
*/ |
|||
private String unit; |
|||
|
|||
/** |
|||
* 房间号 |
|||
*/ |
|||
private String roomNo; |
|||
|
|||
/** |
|||
* 现居住地详细地址 |
|||
*/ |
|||
private String outLiveAddressDetail; |
|||
|
|||
/** |
|||
* 现居住地code |
|||
*/ |
|||
private String outLiveAddressCode; |
|||
|
|||
/** |
|||
* 现居住地名称 |
|||
*/ |
|||
private String outLiveAddressName; |
|||
|
|||
/** |
|||
* infoID |
|||
*/ |
|||
private Long userId; |
|||
|
|||
/** |
|||
* recordID |
|||
*/ |
|||
private Long recordId; |
|||
|
|||
/** |
|||
* 房屋ID |
|||
*/ |
|||
private Long unitId; |
|||
|
|||
/** |
|||
* 审核类型 0 新增 1 修改 |
|||
*/ |
|||
private String auditType; |
|||
|
|||
/** |
|||
* 状态 0-待审核,2-审核不通过,4-审核通过 |
|||
*/ |
|||
private String auditState; |
|||
|
|||
/** |
|||
* 审核原因 |
|||
*/ |
|||
private String auditReason; |
|||
|
|||
} |
@ -0,0 +1,155 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.vaccine.epidemic.excel; |
|||
|
|||
import cn.afterturn.easypoi.excel.annotation.Excel; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 疫情防控信息表 |
|||
* |
|||
* @author zhy qu@elink-cn.com |
|||
* @since v1.0.0 2022-06-29 |
|||
*/ |
|||
@Data |
|||
public class EpidemicUserInfoAuditExcel { |
|||
|
|||
@Excel(name = "主键") |
|||
private Long id; |
|||
|
|||
@Excel(name = "姓名") |
|||
private String userName; |
|||
|
|||
@Excel(name = "身份证号") |
|||
private String idCard; |
|||
|
|||
@Excel(name = "户籍地code") |
|||
private String householdRegisterCode; |
|||
|
|||
@Excel(name = "户籍地名称") |
|||
private String householdRegisterName; |
|||
|
|||
@Excel(name = "户籍地详细地址") |
|||
private String householdRegisterDetail; |
|||
|
|||
@Excel(name = "乐观锁") |
|||
private Integer revision; |
|||
|
|||
@Excel(name = "创建人") |
|||
private String createdBy; |
|||
|
|||
@Excel(name = "创建时间") |
|||
private Date createdTime; |
|||
|
|||
@Excel(name = "更新人") |
|||
private String updatedBy; |
|||
|
|||
@Excel(name = "更新时间") |
|||
private Date updatedTime; |
|||
|
|||
@Excel(name = "逻辑删除标识") |
|||
private String delFlag; |
|||
|
|||
@Excel(name = "性别") |
|||
private String gender; |
|||
|
|||
@Excel(name = "民族") |
|||
private String nation; |
|||
|
|||
@Excel(name = "与户主关系") |
|||
private String relation; |
|||
|
|||
@Excel(name = "年龄") |
|||
private Integer age; |
|||
|
|||
@Excel(name = "县内居住地code") |
|||
private String liveAddressCode; |
|||
|
|||
@Excel(name = "县内居住地镇街") |
|||
private String liveAddressName; |
|||
|
|||
@Excel(name = "社区/村庄") |
|||
private String community; |
|||
|
|||
@Excel(name = "网格名称") |
|||
private String gridName; |
|||
|
|||
@Excel(name = "手机号或座机号") |
|||
private String mobile; |
|||
|
|||
@Excel(name = "所属部门ID") |
|||
private Long deptId; |
|||
|
|||
@Excel(name = "所属部门") |
|||
private String deptName; |
|||
|
|||
@Excel(name = "父所有部门") |
|||
private String parentDeptIds; |
|||
|
|||
@Excel(name = "父所有部门") |
|||
private String parentDeptNames; |
|||
|
|||
@Excel(name = "所有部门ID") |
|||
private String allDeptIds; |
|||
|
|||
@Excel(name = "所有部门名称") |
|||
private String allDeptNames; |
|||
|
|||
@Excel(name = "小区") |
|||
private String plot; |
|||
|
|||
@Excel(name = "楼号") |
|||
private String buildingNo; |
|||
|
|||
@Excel(name = "单元") |
|||
private String unit; |
|||
|
|||
@Excel(name = "房间号") |
|||
private String roomNo; |
|||
|
|||
@Excel(name = "现居住地详细地址") |
|||
private String outLiveAddressDetail; |
|||
|
|||
@Excel(name = "现居住地code") |
|||
private String outLiveAddressCode; |
|||
|
|||
@Excel(name = "现居住地名称") |
|||
private String outLiveAddressName; |
|||
|
|||
@Excel(name = "infoID") |
|||
private Long userId; |
|||
|
|||
@Excel(name = "recordID") |
|||
private Long recordId; |
|||
|
|||
@Excel(name = "房屋ID") |
|||
private Long unitId; |
|||
|
|||
@Excel(name = "审核类型 0 新增 1 修改") |
|||
private String auditType; |
|||
|
|||
@Excel(name = "状态 0-待审核,2-审核不通过,4-审核通过") |
|||
private String auditState; |
|||
|
|||
@Excel(name = "审核原因") |
|||
private String auditReason; |
|||
|
|||
|
|||
} |
@ -0,0 +1,47 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.vaccine.epidemic.redis; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 疫情防控信息表 |
|||
* |
|||
* @author zhy qu@elink-cn.com |
|||
* @since v1.0.0 2022-06-29 |
|||
*/ |
|||
@Component |
|||
public class EpidemicUserInfoAuditRedis { |
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
public void delete(Object[] ids) { |
|||
|
|||
} |
|||
|
|||
public void set(){ |
|||
|
|||
} |
|||
|
|||
public String get(String id){ |
|||
return null; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,116 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.vaccine.epidemic.service; |
|||
|
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.dto.EpidemicUserInfoAuditDTO; |
|||
import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoAuditEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 疫情防控信息表 |
|||
* |
|||
* @author zhy qu@elink-cn.com |
|||
* @since v1.0.0 2022-06-29 |
|||
*/ |
|||
public interface EpidemicUserInfoAuditService extends BaseService<EpidemicUserInfoAuditEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<EpidemicUserInfoAuditDTO> |
|||
* @author generator |
|||
* @date 2022-06-29 |
|||
*/ |
|||
PageData<EpidemicUserInfoAuditDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<EpidemicUserInfoAuditDTO> |
|||
* @author generator |
|||
* @date 2022-06-29 |
|||
*/ |
|||
List<EpidemicUserInfoAuditDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return EpidemicUserInfoAuditDTO |
|||
* @author generator |
|||
* @date 2022-06-29 |
|||
*/ |
|||
EpidemicUserInfoAuditDTO get(String id); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param idCard |
|||
* @return EpidemicUserInfoAuditDTO |
|||
* @author generator |
|||
* @date 2022-06-29 |
|||
*/ |
|||
EpidemicUserInfoAuditDTO getByIdCard(String idCard); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-06-29 |
|||
*/ |
|||
void save(EpidemicUserInfoAuditDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-06-29 |
|||
*/ |
|||
void update(EpidemicUserInfoAuditDTO dto); |
|||
|
|||
/** |
|||
* 审核 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-06-29 |
|||
*/ |
|||
void audit(EpidemicUserInfoAuditDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-06-29 |
|||
*/ |
|||
void delete(String[] ids); |
|||
} |
@ -0,0 +1,137 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.vaccine.epidemic.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|||
import com.elink.esua.epdc.commons.tools.constant.NumConstant; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|||
import com.elink.esua.epdc.dto.EpidemicUserInfoAuditDTO; |
|||
import com.elink.esua.epdc.dto.personroom.form.FamilyMemberInfoFormDTO; |
|||
import com.elink.esua.epdc.vaccine.epidemic.dao.EpidemicUserInfoAuditDao; |
|||
import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoAuditEntity; |
|||
import com.elink.esua.epdc.vaccine.epidemic.redis.EpidemicUserInfoAuditRedis; |
|||
import com.elink.esua.epdc.vaccine.epidemic.service.EpidemicUserInfoAuditService; |
|||
import com.elink.esua.epdc.vaccine.epidemic.service.EpidemicUserInfoService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 疫情防控信息表 |
|||
* |
|||
* @author zhy qu@elink-cn.com |
|||
* @since v1.0.0 2022-06-29 |
|||
*/ |
|||
@Service |
|||
public class EpidemicUserInfoAuditServiceImpl extends BaseServiceImpl<EpidemicUserInfoAuditDao, EpidemicUserInfoAuditEntity> implements EpidemicUserInfoAuditService { |
|||
|
|||
@Autowired |
|||
private EpidemicUserInfoAuditRedis epidemicUserInfoAuditRedis; |
|||
|
|||
@Autowired |
|||
private EpidemicUserInfoService epidemicUserInfoService; |
|||
|
|||
@Override |
|||
public PageData<EpidemicUserInfoAuditDTO> page(Map<String, Object> params) { |
|||
IPage<EpidemicUserInfoAuditEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, EpidemicUserInfoAuditDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<EpidemicUserInfoAuditDTO> list(Map<String, Object> params) { |
|||
List<EpidemicUserInfoAuditEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, EpidemicUserInfoAuditDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<EpidemicUserInfoAuditEntity> getWrapper(Map<String, Object> params) { |
|||
String id = (String) params.get(FieldConstant.ID_HUMP); |
|||
String idCard = (String) params.get("idCard"); |
|||
String userName = (String) params.get("userName"); |
|||
|
|||
QueryWrapper<EpidemicUserInfoAuditEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
wrapper.eq(StringUtils.isNotBlank(idCard), "ID_CARD", idCard); |
|||
wrapper.eq(StringUtils.isNotBlank(userName), "USER_NAME", userName); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public EpidemicUserInfoAuditDTO get(String id) { |
|||
EpidemicUserInfoAuditEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, EpidemicUserInfoAuditDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public EpidemicUserInfoAuditDTO getByIdCard(String idCard) { |
|||
return baseDao.getByIdCard(idCard); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(EpidemicUserInfoAuditDTO dto) { |
|||
EpidemicUserInfoAuditEntity entity = ConvertUtils.sourceToTarget(dto, EpidemicUserInfoAuditEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(EpidemicUserInfoAuditDTO dto) { |
|||
EpidemicUserInfoAuditEntity entity = ConvertUtils.sourceToTarget(dto, EpidemicUserInfoAuditEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void audit(EpidemicUserInfoAuditDTO dto) { |
|||
EpidemicUserInfoAuditEntity entity = new EpidemicUserInfoAuditEntity(); |
|||
entity.setId(dto.getId()); |
|||
entity.setAuditState(dto.getAuditState()); |
|||
entity.setAuditReason(dto.getAuditReason()); |
|||
updateById(entity); |
|||
|
|||
FamilyMemberInfoFormDTO formDTO = ConvertUtils.sourceToTarget(dto, FamilyMemberInfoFormDTO.class); |
|||
if (NumConstant.ZERO_STR.equals(dto.getAuditType())) { |
|||
epidemicUserInfoService.addFamilyMember(formDTO); |
|||
} else if (NumConstant.ONE_STR.equals(dto.getAuditType())) { |
|||
epidemicUserInfoService.updateFamilyMember(formDTO); |
|||
} |
|||
|
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,61 @@ |
|||
<?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"> |
|||
|
|||
<mapper namespace="com.elink.esua.epdc.vaccine.epidemic.dao.EpidemicUserInfoAuditDao"> |
|||
|
|||
<resultMap type="com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoAuditEntity" id="epidemicUserInfoAuditMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="userName" column="USER_NAME"/> |
|||
<result property="idCard" column="ID_CARD"/> |
|||
<result property="householdRegisterCode" column="HOUSEHOLD_REGISTER_CODE"/> |
|||
<result property="householdRegisterName" column="HOUSEHOLD_REGISTER_NAME"/> |
|||
<result property="householdRegisterDetail" column="HOUSEHOLD_REGISTER_DETAIL"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="gender" column="GENDER"/> |
|||
<result property="nation" column="NATION"/> |
|||
<result property="relation" column="RELATION"/> |
|||
<result property="age" column="AGE"/> |
|||
<result property="liveAddressCode" column="LIVE_ADDRESS_CODE"/> |
|||
<result property="liveAddressName" column="LIVE_ADDRESS_NAME"/> |
|||
<result property="community" column="COMMUNITY"/> |
|||
<result property="gridName" column="GRID_NAME"/> |
|||
<result property="mobile" column="MOBILE"/> |
|||
<result property="deptId" column="DEPT_ID"/> |
|||
<result property="deptName" column="DEPT_NAME"/> |
|||
<result property="parentDeptIds" column="PARENT_DEPT_IDS"/> |
|||
<result property="parentDeptNames" column="PARENT_DEPT_NAMES"/> |
|||
<result property="allDeptIds" column="ALL_DEPT_IDS"/> |
|||
<result property="allDeptNames" column="ALL_DEPT_NAMES"/> |
|||
<result property="plot" column="PLOT"/> |
|||
<result property="buildingNo" column="BUILDING_NO"/> |
|||
<result property="unit" column="UNIT"/> |
|||
<result property="roomNo" column="ROOM_NO"/> |
|||
<result property="outLiveAddressDetail" column="OUT_LIVE_ADDRESS_DETAIL"/> |
|||
<result property="outLiveAddressCode" column="OUT_LIVE_ADDRESS_CODE"/> |
|||
<result property="outLiveAddressName" column="OUT_LIVE_ADDRESS_NAME"/> |
|||
<result property="userId" column="USER_ID"/> |
|||
<result property="recordId" column="RECORD_ID"/> |
|||
<result property="unitId" column="UNIT_ID"/> |
|||
<result property="auditType" column="AUDIT_TYPE"/> |
|||
<result property="auditState" column="AUDIT_STATE"/> |
|||
<result property="auditReason" column="AUDIT_REASON"/> |
|||
</resultMap> |
|||
|
|||
<select id="getByIdCard" resultType="com.elink.esua.epdc.dto.EpidemicUserInfoAuditDTO"> |
|||
SELECT |
|||
* |
|||
FROM |
|||
epidemic_user_info_audit |
|||
WHERE |
|||
DEL_FLAG = '0' |
|||
AND ID_CARD = #{idCard} |
|||
ORDER BY |
|||
UPDATED_TIME DESC |
|||
LIMIT 1 |
|||
</select> |
|||
</mapper> |
Loading…
Reference in new issue