8 changed files with 595 additions and 0 deletions
@ -0,0 +1,120 @@ |
|||
package com.epmet.dto; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 核酸上报记录 |
|||
|
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-03-25 |
|||
*/ |
|||
@Data |
|||
public class IcNatDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户Id CUSTOMER.id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 居民端上报时存储用户所在网格的组织id.居民信息的人存储居民所在组织id.单个新增或者导入的存储登录用户所属的组织id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 居民端小程序的用户id、数字社区的icResiUserId、其他情况无值 |
|||
*/ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 居民端小程序的人:resi;数字社区的居民:icresi;未关联上的:other |
|||
*/ |
|||
private String userType; |
|||
|
|||
/** |
|||
* 人员姓名 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 手机号 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 身份证号 |
|||
*/ |
|||
private String idCard; |
|||
|
|||
/** |
|||
* 检测时间,精确到分钟 |
|||
*/ |
|||
private Date testingTime; |
|||
|
|||
/** |
|||
* 检测结果(0:阴性 1:阳性) |
|||
*/ |
|||
private String testingResult; |
|||
|
|||
/** |
|||
* 检测地点 |
|||
*/ |
|||
private String testingAddress; |
|||
|
|||
/** |
|||
* 文件名 |
|||
*/ |
|||
private String fileName; |
|||
|
|||
/** |
|||
* 文件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) |
|||
*/ |
|||
private String attachmentType; |
|||
|
|||
/** |
|||
* url地址 |
|||
*/ |
|||
private String attachmentUrl; |
|||
|
|||
/** |
|||
* 删除标识 |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,92 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @Description 核酸检测-上报核酸记录 |
|||
* @Author sun |
|||
*/ |
|||
@Data |
|||
public class AddIcNatFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 9156247659994638103L; |
|||
|
|||
public interface Nat extends CustomerClientShowGroup { |
|||
} |
|||
|
|||
/** |
|||
* 当前网格所属组织Id |
|||
*/ |
|||
@NotBlank(message = "组织Id不能为空", groups = Nat.class) |
|||
private String agencyId; |
|||
/** |
|||
* 居民端小程序的用户id、数字社区的icResiUserId、其他情况无值 |
|||
*/ |
|||
private String userId; |
|||
/** |
|||
* 居民端小程序的人:resi;数字社区的居民:icresi;未关联上的:other |
|||
*/ |
|||
@NotBlank(message = "居民来源不能为空", groups = Nat.class) |
|||
private String userType; |
|||
/** |
|||
* 姓名 |
|||
*/ |
|||
@NotBlank(message = "姓名不能为空", groups = Nat.class) |
|||
private String name; |
|||
/** |
|||
* 手机号 |
|||
*/ |
|||
@NotBlank(message = "手机号不能为空", groups = Nat.class) |
|||
private String mobile; |
|||
/** |
|||
* 身份证号 |
|||
*/ |
|||
@NotBlank(message = "身份证号不能为空", groups = Nat.class) |
|||
private String idCard; |
|||
/** |
|||
* 检测时间 |
|||
*/ |
|||
@NotBlank(message = "检测时间不能为空", groups = Nat.class) |
|||
@JsonFormat(pattern="yyyy-MM-dd HH:mm") |
|||
private Date testingTime; |
|||
/** |
|||
* 检测结果 |
|||
*/ |
|||
private String testingResult; |
|||
/** |
|||
* 检测地点 |
|||
*/ |
|||
private String testingAddress; |
|||
/** |
|||
* 文件名 |
|||
*/ |
|||
private String fileName; |
|||
/** |
|||
* 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) |
|||
*/ |
|||
private String attachmentType; |
|||
|
|||
/** |
|||
* 附件地址 |
|||
*/ |
|||
private String attachmentUrl; |
|||
/** |
|||
* 通知渠道 0小程序通知,1短信通知,多选用逗号分隔(0,1) |
|||
*/ |
|||
private String channel; |
|||
/** |
|||
* 通知内容 |
|||
*/ |
|||
private String content; |
|||
|
|||
//token中信息
|
|||
private String staffId; |
|||
private String customerId; |
|||
|
|||
|
|||
} |
@ -0,0 +1,89 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.AssertUtils; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.commons.tools.validator.group.AddGroup; |
|||
import com.epmet.commons.tools.validator.group.DefaultGroup; |
|||
import com.epmet.commons.tools.validator.group.UpdateGroup; |
|||
import com.epmet.dto.IcNatDTO; |
|||
import com.epmet.dto.form.AddIcNatFormDTO; |
|||
import com.epmet.service.IcNatService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 核酸上报记录 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-03-25 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("icNuclein") |
|||
public class IcNatController { |
|||
|
|||
@Autowired |
|||
private IcNatService icNucleinService; |
|||
|
|||
@RequestMapping("page") |
|||
public Result<PageData<IcNatDTO>> page(@RequestParam Map<String, Object> params) { |
|||
PageData<IcNatDTO> page = icNucleinService.page(params); |
|||
return new Result<PageData<IcNatDTO>>().ok(page); |
|||
} |
|||
|
|||
@RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET}) |
|||
public Result<IcNatDTO> get(@PathVariable("id") String id) { |
|||
IcNatDTO data = icNucleinService.get(id); |
|||
return new Result<IcNatDTO>().ok(data); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping("save") |
|||
public Result save(@RequestBody IcNatDTO dto) { |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
icNucleinService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping("update") |
|||
public Result update(@RequestBody IcNatDTO dto) { |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
icNucleinService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PostMapping("delete") |
|||
public Result delete(@RequestBody String[] ids) { |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
icNucleinService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 核酸检测-上报核酸记录 |
|||
**/ |
|||
@NoRepeatSubmit |
|||
@PostMapping("add") |
|||
public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddIcNatFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, AddIcNatFormDTO.Nat.class); |
|||
formDTO.setStaffId(tokenDto.getUserId()); |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
icNucleinService.add(formDTO); |
|||
return new Result(); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,17 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.IcNatEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 核酸上报记录 |
|||
|
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-03-25 |
|||
*/ |
|||
@Mapper |
|||
public interface IcNatDao extends BaseDao<IcNatEntity> { |
|||
|
|||
} |
@ -0,0 +1,90 @@ |
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 核酸上报记录 |
|||
|
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-03-25 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("ic_nat") |
|||
public class IcNatEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户Id CUSTOMER.id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 居民端上报时存储用户所在网格的组织id.居民信息的人存储居民所在组织id.单个新增或者导入的存储登录用户所属的组织id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 居民端小程序的用户id、数字社区的icResiUserId、其他情况无值 |
|||
*/ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 居民端小程序的人:resi;数字社区的居民:icresi;未关联上的:other |
|||
*/ |
|||
private String userType; |
|||
|
|||
/** |
|||
* 人员姓名 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 手机号 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 身份证号 |
|||
*/ |
|||
private String idCard; |
|||
|
|||
/** |
|||
* 检测时间,精确到分钟 |
|||
*/ |
|||
private Date testingTime; |
|||
|
|||
/** |
|||
* 检测结果(0:阴性 1:阳性) |
|||
*/ |
|||
private String testingResult; |
|||
|
|||
/** |
|||
* 检测地点 |
|||
*/ |
|||
private String testingAddress; |
|||
|
|||
/** |
|||
* 文件名 |
|||
*/ |
|||
private String fileName; |
|||
|
|||
/** |
|||
* 文件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) |
|||
*/ |
|||
private String attachmentType; |
|||
|
|||
/** |
|||
* url地址 |
|||
*/ |
|||
private String attachmentUrl; |
|||
|
|||
} |
@ -0,0 +1,86 @@ |
|||
package com.epmet.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.dto.IcNatDTO; |
|||
import com.epmet.dto.form.AddIcNatFormDTO; |
|||
import com.epmet.entity.IcNatEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 核酸上报记录 |
|||
|
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-03-25 |
|||
*/ |
|||
public interface IcNatService extends BaseService<IcNatEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<IcNucleinDTO> |
|||
* @author generator |
|||
* @date 2022-03-25 |
|||
*/ |
|||
PageData<IcNatDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<IcNucleinDTO> |
|||
* @author generator |
|||
* @date 2022-03-25 |
|||
*/ |
|||
List<IcNatDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return IcNucleinDTO |
|||
* @author generator |
|||
* @date 2022-03-25 |
|||
*/ |
|||
IcNatDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-03-25 |
|||
*/ |
|||
void save(IcNatDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-03-25 |
|||
*/ |
|||
void update(IcNatDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-03-25 |
|||
*/ |
|||
void delete(String[] ids); |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 核酸检测-上报核酸记录 |
|||
**/ |
|||
void add(AddIcNatFormDTO formDTO); |
|||
} |
@ -0,0 +1,94 @@ |
|||
package com.epmet.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.constant.FieldConstant; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.dao.IcNatDao; |
|||
import com.epmet.dto.IcNatDTO; |
|||
import com.epmet.dto.form.AddIcNatFormDTO; |
|||
import com.epmet.entity.IcNatEntity; |
|||
import com.epmet.service.IcNatService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 核酸上报记录 |
|||
|
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-03-25 |
|||
*/ |
|||
@Service |
|||
public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> implements IcNatService { |
|||
|
|||
|
|||
@Override |
|||
public PageData<IcNatDTO> page(Map<String, Object> params) { |
|||
IPage<IcNatEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, IcNatDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<IcNatDTO> list(Map<String, Object> params) { |
|||
List<IcNatEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, IcNatDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<IcNatEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<IcNatEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public IcNatDTO get(String id) { |
|||
IcNatEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, IcNatDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(IcNatDTO dto) { |
|||
IcNatEntity entity = ConvertUtils.sourceToTarget(dto, IcNatEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(IcNatDTO dto) { |
|||
IcNatEntity entity = ConvertUtils.sourceToTarget(dto, IcNatEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 核酸检测-上报核酸记录 |
|||
**/ |
|||
@Override |
|||
public void add(AddIcNatFormDTO formDTO) { |
|||
|
|||
} |
|||
|
|||
} |
@ -0,0 +1,7 @@ |
|||
<?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.epmet.dao.IcNatDao"> |
|||
|
|||
|
|||
</mapper> |
Loading…
Reference in new issue