Commit 8f1741c5 by 杨琪琪

死亡登记标注死亡

parent f72bb9ca
package com.zq.api.utils; package com.zq.api.utils;
import cn.hutool.core.codec.Base64; import cn.hutool.core.codec.Base64;
import cn.hutool.core.io.FileTypeUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.io.resource.ClassPathResource;
import cn.hutool.core.lang.Console;
import cn.hutool.core.util.HashUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.URLUtil; import cn.hutool.core.util.URLUtil;
...@@ -19,11 +25,17 @@ import com.zq.common.encrypt.EncryptUtils; ...@@ -19,11 +25,17 @@ import com.zq.common.encrypt.EncryptUtils;
import com.zq.common.encrypt.RsaUtils; import com.zq.common.encrypt.RsaUtils;
import com.zq.common.vo.ResultVo; import com.zq.common.vo.ResultVo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.ognl.enhance.ContextClassLoader;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Properties;
import java.util.TreeMap; import java.util.TreeMap;
@Component @Component
...@@ -235,9 +247,9 @@ public class ApiUtils { ...@@ -235,9 +247,9 @@ public class ApiUtils {
} }
public static void main(String[] args) { public static void main(String[] args) {
String appId = "d469c70c4e8b11ecaa2900163e1475c7"; String appId = "c817c558589611ecaa2900163e1475c7";
String apiNo = IdUtil.simpleUUID(); String apiNo = IdUtil.simpleUUID();
String method = "getSingleUserInfo"; String method = "getSsoUserInfo";
String timestamp = System.currentTimeMillis() + ""; String timestamp = System.currentTimeMillis() + "";
String version = "1.0.0"; String version = "1.0.0";
String bizContent = "{}";//JSON字符串 String bizContent = "{}";//JSON字符串
...@@ -264,14 +276,14 @@ public class ApiUtils { ...@@ -264,14 +276,14 @@ public class ApiUtils {
for (Map.Entry<String, String> entry : signTreeMap.entrySet()) { for (Map.Entry<String, String> entry : signTreeMap.entrySet()) {
src.append(entry.getKey()).append("=").append(entry.getValue()).append("&"); src.append(entry.getKey()).append("=").append(entry.getValue()).append("&");
} }
src.append("key=").append("ce8fcdd1ae6e42efaabe8819e3fbd8da"); src.append("key=").append("82bb8e368055403f91bd67992db17800");
params.put("sign", MD5.create().digestHex(src.toString()).toUpperCase()); params.put("sign", MD5.create().digestHex(src.toString()).toUpperCase());
HttpRequest request = HttpRequest.post("http://127.0.0.1:9888/api/action") HttpRequest request = HttpRequest.post("http://106.52.179.107:9888/api/action")
.header("appId", appId) .header("appId", appId)
.header("appSecret", "e209eb5e4e8b11ecaa2900163e1475c7") .header("appSecret", "1f6baf5b589711ecaa2900163e1475c7")
.header("Authorization", "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImF1dGgiOiJhZG1pbiIsImp0aSI6IjY4OTJlY2E2OTAwNzRjZDRhOGI0NjJlNDM5NDNhZmI1In0.AB77eTqqiBsSunVChqfAx9jB8FN58I7fph1Dw-RfYEVWvN-U2AQYYvuMlCczsiBbduL0vCNALjBzo_1jjKlAPg") .header("Authorization", "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ0ZXN0MTIwODE1MzQiLCJhdXRoIjoiIiwianRpIjoiZjc4NmM4Nzk0OGQ1NDA3YWIzMjYyNTNmNDk3YzUzZjUifQ.-_ty93y4sIQu4Lx1lQM_819Ay8cMtYHMlKPKA6n12E9RwJIqmI1OMzU9G5ANSPYgo22jdL1r23heHElBJEEuBg")
.contentType("application/x-www-form-urlencoded") .contentType("application/x-www-form-urlencoded")
.formStr(params); .formStr(params);
......
...@@ -24,18 +24,13 @@ public class PageReqVo { ...@@ -24,18 +24,13 @@ public class PageReqVo {
@ApiModelProperty("每页记录条数") @ApiModelProperty("每页记录条数")
private int size = DEFAULT_SIZE; private int size = DEFAULT_SIZE;
@ApiModelProperty(value = "排序字段名", allowEmptyValue = true)
private String sort; private String sort;
@ApiModelProperty(value = "排序方向", allowableValues = "asc,desc", allowEmptyValue = true)
private String dir; private String dir;
public static PageReqVo of(int page, int size) { private int start;
PageReqVo pageReqVo = new PageReqVo();
pageReqVo.setPage(page); private int end;
pageReqVo.setSize(size);
return pageReqVo;
}
public PageReqVo() { public PageReqVo() {
} }
...@@ -77,4 +72,20 @@ public class PageReqVo { ...@@ -77,4 +72,20 @@ public class PageReqVo {
public void setDir(String dir) { public void setDir(String dir) {
this.dir = dir; this.dir = dir;
} }
}
\ No newline at end of file public int getEnd() {
return getPage() * getSize();
}
public void setEnd(int end) {
this.end = end;
}
public int getStart() {
return (getPage() - 1) * getSize();
}
public void setStart(int start) {
this.start = start;
}
}
...@@ -192,6 +192,12 @@ ...@@ -192,6 +192,12 @@
<artifactId>hutool-all</artifactId> <artifactId>hutool-all</artifactId>
<version>5.7.16</version> <version>5.7.16</version>
</dependency> </dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.7.18</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -3,13 +3,28 @@ package com.zq.system.modules.system.dao; ...@@ -3,13 +3,28 @@ package com.zq.system.modules.system.dao;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zq.common.constant.DBName; import com.zq.common.constant.DBName;
import com.zq.system.modules.system.domain.vo.ReportDeathVo;
import com.zq.system.modules.system.entity.ReportDeath; import com.zq.system.modules.system.entity.ReportDeath;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List;
@Repository @Repository
@DS(DBName.OZT) @DS(DBName.OZT)
public interface ReportDeathDao extends BaseMapper<ReportDeath> { public interface ReportDeathDao extends BaseMapper<ReportDeath> {
ReportDeath selectByIdCard(String idCard); ReportDeath selectByIdCard(String idCard);
List<ReportDeathVo> selectAllDeaths(ReportDeathVo vo);
int selectAllCount(ReportDeathVo vo);
ReportDeath selectByNameOrIdcard(ReportDeathVo vo);
int insertInTo(ReportDeath death);
List<ReportDeathVo> getDeathByName(ReportDeathVo vo);
int updateDeath(ReportDeath death);
} }
...@@ -20,6 +20,7 @@ import org.springframework.data.jpa.repository.JpaRepository; ...@@ -20,6 +20,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -59,6 +60,7 @@ public interface UserRepository extends JpaRepository<User, Long>, JpaSpecificat ...@@ -59,6 +60,7 @@ public interface UserRepository extends JpaRepository<User, Long>, JpaSpecificat
* @param lastPasswordResetTime / * @param lastPasswordResetTime /
*/ */
@Modifying @Modifying
@Transactional(rollbackFor = Exception.class)
@Query(value = "update sys_user set password = ?2 , pwd_reset_time = ?3 where username = ?1",nativeQuery = true) @Query(value = "update sys_user set password = ?2 , pwd_reset_time = ?3 where username = ?1",nativeQuery = true)
void updatePass(String username, String pass, Date lastPasswordResetTime); void updatePass(String username, String pass, Date lastPasswordResetTime);
...@@ -128,4 +130,20 @@ public interface UserRepository extends JpaRepository<User, Long>, JpaSpecificat ...@@ -128,4 +130,20 @@ public interface UserRepository extends JpaRepository<User, Long>, JpaSpecificat
@Query(value = "SELECT count(1) FROM sys_user u, sys_users_roles r WHERE " + @Query(value = "SELECT count(1) FROM sys_user u, sys_users_roles r WHERE " +
"u.user_id = r.user_id AND r.role_id in ?1", nativeQuery = true) "u.user_id = r.user_id AND r.role_id in ?1", nativeQuery = true)
int countByRoles(Set<Long> ids); int countByRoles(Set<Long> ids);
/**
* 根据电话查询
* @param phone/
* @return /
*/
@Query(value = "SELECT * FROM sys_user u WHERE u.phone= ?1", nativeQuery = true)
User findBySysname(String phone);
/**
* 根据电话查询
* @param currentUsername/
* @return /
*/
@Query(value = "SELECT * FROM sys_user u WHERE u.username= ?1", nativeQuery = true)
User findByname(String currentUsername);
} }
...@@ -13,10 +13,7 @@ import com.zq.system.modules.system.service.ReportDeathService; ...@@ -13,10 +13,7 @@ import com.zq.system.modules.system.service.ReportDeathService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
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 org.springframework.web.multipart.MultipartFile;
...@@ -45,10 +42,16 @@ public class DeathRegisterController { ...@@ -45,10 +42,16 @@ public class DeathRegisterController {
@ApiOperation("获取死亡列表") @ApiOperation("获取死亡列表")
@PostMapping(value = "/getDeathList") @PostMapping(value = "/getDeathList")
public ResultVo<PageVo<ReportDeath>> getDeathList(@RequestBody ReportDeathVo vo) { public ResultVo<PageVo<ReportDeathVo>> getDeathList(@RequestBody ReportDeathVo vo) {
return ResultVo.success(reportDeathService.getDeathList(vo)); return ResultVo.success(reportDeathService.getDeathList(vo));
} }
@ApiOperation("查询死亡记录")
@PostMapping(value = "/getDeathByName")
public ResultVo getDeathByName(@RequestBody ReportDeathVo vo) {
return ResultVo.success(reportDeathService.getDeathByName(vo));
}
@ApiOperation("获取死亡人详情") @ApiOperation("获取死亡人详情")
@AnonymousPostMapping(value = "/getDeathDetail") @AnonymousPostMapping(value = "/getDeathDetail")
public ResultVo getDeathDetail(@RequestBody ReportDeathVo vo) { public ResultVo getDeathDetail(@RequestBody ReportDeathVo vo) {
...@@ -61,5 +64,11 @@ public class DeathRegisterController { ...@@ -61,5 +64,11 @@ public class DeathRegisterController {
return ResultVo.success(reportDeathService.updateDeath(vo)); return ResultVo.success(reportDeathService.updateDeath(vo));
} }
@ApiOperation("是否能进入死亡登记系统")
@GetMapping(value = "/inSysDeath")
public ResultVo inSysDeath() {
return ResultVo.success(reportDeathService.inSysDeath());
}
} }
package com.zq.system.modules.system.rest; package com.zq.system.modules.system.rest;
import cn.hutool.core.lang.tree.TreeUtil;
import com.zq.common.annotation.rest.AnonymousGetMapping; import com.zq.common.annotation.rest.AnonymousGetMapping;
import com.zq.common.annotation.rest.AnonymousPostMapping; import com.zq.common.annotation.rest.AnonymousPostMapping;
import com.zq.common.config.redis.RedisUtils; import com.zq.common.config.redis.RedisUtils;
......
...@@ -180,6 +180,17 @@ public class UserController { ...@@ -180,6 +180,17 @@ public class UserController {
return ResultVo.success(); return ResultVo.success();
} }
@ApiOperation("重置sys登录密码")
@PostMapping(value = "/resetPassw")
@AnonymousAccess
public ResultVo resetPassw(@RequestBody LoginVo vo) {
AssertUtils.hasText(vo.getPhone(), "手机号不能为空");
AssertUtils.isTrue(ValidateUtil.isMobilePhoneNo(vo.getPhone()), "手机号格式不正确");
AssertUtils.hasText(vo.getVerifyCode(), "请输入验证码");
userService.resetPassword2(vo);
return ResultVo.success();
}
@ApiOperation("修改头像") @ApiOperation("修改头像")
@PostMapping(value = "/updateAvatar") @PostMapping(value = "/updateAvatar")
public ResponseEntity<Object> updateAvatar(@RequestParam MultipartFile avatar) { public ResponseEntity<Object> updateAvatar(@RequestParam MultipartFile avatar) {
......
...@@ -12,9 +12,13 @@ public interface ReportDeathService { ...@@ -12,9 +12,13 @@ public interface ReportDeathService {
Object importDeath(MultipartFile file); Object importDeath(MultipartFile file);
PageVo<ReportDeath> getDeathList(ReportDeathVo vo); PageVo<ReportDeathVo> getDeathList(ReportDeathVo vo);
Object getDeathDetail(ReportDeathVo vo); Object getDeathDetail(ReportDeathVo vo);
ResultVo updateDeath(ReportDeathVo vo); ResultVo updateDeath(ReportDeathVo vo);
ResultVo inSysDeath();
ResultVo getDeathByName(ReportDeathVo vo);
} }
...@@ -24,6 +24,7 @@ import com.zq.system.modules.system.dao.SysInfoDao; ...@@ -24,6 +24,7 @@ import com.zq.system.modules.system.dao.SysInfoDao;
import com.zq.system.modules.system.domain.Job; import com.zq.system.modules.system.domain.Job;
import com.zq.system.modules.system.domain.Role; import com.zq.system.modules.system.domain.Role;
import com.zq.system.modules.system.domain.User; import com.zq.system.modules.system.domain.User;
import com.zq.system.modules.system.domain.vo.ReportDeathVo;
import com.zq.system.modules.system.domain.vo.SsoLoginVo; import com.zq.system.modules.system.domain.vo.SsoLoginVo;
import com.zq.system.modules.system.domain.vo.SsoRegisterVo; import com.zq.system.modules.system.domain.vo.SsoRegisterVo;
import com.zq.system.modules.system.entity.AreaCode; import com.zq.system.modules.system.entity.AreaCode;
...@@ -246,12 +247,14 @@ public class SsoService { ...@@ -246,12 +247,14 @@ public class SsoService {
SysInfo sysInfo = sysInfoDao.selectOne(Wrappers.lambdaQuery(SysInfo.builder().appId(appId).build())); SysInfo sysInfo = sysInfoDao.selectOne(Wrappers.lambdaQuery(SysInfo.builder().appId(appId).build()));
BindUserInfo bindUserInfo = blindUserInfoDao.selectOne(Wrappers.lambdaQuery(BindUserInfo.builder().sysId(sysInfo.getId()).userId(adminContext.getUserId()).build()));
AssertUtils.notNull(bindUserInfo, 501, "用户未绑定该系统");
Map<String, Object> data = new HashMap<>(); Map<String, Object> data = new HashMap<>();
List<BindUserInfo> bindUserInfos = blindUserInfoDao.selectList(Wrappers.lambdaQuery(BindUserInfo.builder().sysId(sysInfo.getId()).userId(adminContext.getUserId()).build()));
AssertUtils.notNull(bindUserInfos.size()==0, 501, "用户未绑定该系统");
for (BindUserInfo bindUserInfo:bindUserInfos) {
data.put("userId", bindUserInfo.getSystemUserId()); data.put("userId", bindUserInfo.getSystemUserId());
data.put("username", bindUserInfo.getSystemUserName()); data.put("username", bindUserInfo.getSystemUserName());
}
return data; return data;
} }
......
...@@ -165,4 +165,6 @@ public interface UserService { ...@@ -165,4 +165,6 @@ public interface UserService {
* @return * @return
*/ */
ApiTokenVo passwdLogin(LoginVo vo); ApiTokenVo passwdLogin(LoginVo vo);
void resetPassword2(LoginVo vo);
} }
...@@ -5,12 +5,8 @@ import cn.hutool.core.convert.Convert; ...@@ -5,12 +5,8 @@ import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.poi.excel.ExcelReader; import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil; import cn.hutool.poi.excel.ExcelUtil;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.zq.common.exception.BusinessException; import com.zq.common.exception.BusinessException;
import com.zq.common.utils.AssertUtils;
import com.zq.common.utils.PagingUtils;
import com.zq.common.vo.PageVo; import com.zq.common.vo.PageVo;
import com.zq.common.vo.ResultVo; import com.zq.common.vo.ResultVo;
import com.zq.system.modules.system.dao.CremationInfoSumDao; import com.zq.system.modules.system.dao.CremationInfoSumDao;
...@@ -25,7 +21,6 @@ import com.zq.system.modules.system.service.ReportDeathService; ...@@ -25,7 +21,6 @@ import com.zq.system.modules.system.service.ReportDeathService;
import com.zq.system.modules.system.service.SsoService; import com.zq.system.modules.system.service.SsoService;
import com.zq.system.utils.SecurityUtils; import com.zq.system.utils.SecurityUtils;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -45,13 +40,12 @@ public class ReportDeathImpl implements ReportDeathService { ...@@ -45,13 +40,12 @@ public class ReportDeathImpl implements ReportDeathService {
private final HdptRstSwmdDao hdptRstSwmdDao; private final HdptRstSwmdDao hdptRstSwmdDao;
@Override @Override
public ResultVo save(ReportDeathVo vo) { public ResultVo save(ReportDeathVo vo) {
ReportDeath Death=reportDeathDao.selectByIdCard(vo.getIdCard()); ReportDeath Death = reportDeathDao.selectByIdCard(vo.getIdCard());
if (Death!=null){ if (Death != null) {
return ResultVo.fail("该死者已重复上报"); return ResultVo.fail("该死者已重复上报");
}else { } else {
ReportDeath reportDeath = new ReportDeath(); ReportDeath reportDeath = new ReportDeath();
reportDeath.setName(vo.getName()); reportDeath.setName(vo.getName());
reportDeath.setIdCard(vo.getIdCard()); reportDeath.setIdCard(vo.getIdCard());
...@@ -92,75 +86,107 @@ public class ReportDeathImpl implements ReportDeathService { ...@@ -92,75 +86,107 @@ public class ReportDeathImpl implements ReportDeathService {
reportDeath.setUserArea(user.getUserArea()); reportDeath.setUserArea(user.getUserArea());
reportDeath.setDeathType("1"); reportDeath.setDeathType("1");
ReportDeath reportDeaths = reportDeathDao.selectOne(Wrappers.lambdaQuery(ReportDeath.builder().idCard(Convert.toStr(CollUtil.get(objectList, 2))).build())); ReportDeath reportDeaths = reportDeathDao.selectOne(Wrappers.lambdaQuery(ReportDeath.builder().idCard(Convert.toStr(CollUtil.get(objectList, 2))).build()));
if (reportDeaths!=null){ if (reportDeaths != null) {
return "已上报过该死者"+reportDeaths.getName()+"信息"; return "已上报过该死者" + reportDeaths.getName() + "信息";
}else { } else {
reportDeathDao.insert(reportDeath); reportDeathDao.insert(reportDeath);
} }
} }
return null; return null;
} }
@Override @Override
public PageVo<ReportDeath> getDeathList(ReportDeathVo vo) { public PageVo<ReportDeathVo> getDeathList(ReportDeathVo vo) {
LambdaQueryWrapper<ReportDeath> lambdaQuery = Wrappers.lambdaQuery(ReportDeath.builder().build()); List<ReportDeathVo> list = reportDeathDao.selectAllDeaths(vo);
if (StringUtils.isNotBlank(vo.getIdCard())){ int i = reportDeathDao.selectAllCount(vo);
lambdaQuery.like(ReportDeath::getIdCard,vo.getIdCard()); PageVo<ReportDeathVo> p = new PageVo<ReportDeathVo>();
} if (vo.getPage() - 1 == 0) {
if (StringUtils.isNotBlank(vo.getName())){ vo.setStart(0);
lambdaQuery.like(ReportDeath::getName,vo.getName()); vo.setEnd(vo.getPage() * vo.getSize());
} } else {
if (StringUtils.isNotBlank(vo.getDeathType())) { vo.setStart((vo.getPage() - 1) * vo.getSize());
lambdaQuery.like(ReportDeath::getDeathType,vo.getDeathType()); vo.setEnd(vo.getPage() * vo.getSize());
} }
PageVo<ReportDeath> paging = PagingUtils.paging(vo, reportDeathDao, lambdaQuery); p.setRows(list);
return paging; p.setStart(vo.getPage());
p.setSize(vo.getSize());
p.setTotal(i);
return p;
} }
@Override @Override
public Object getDeathDetail(ReportDeathVo vo) { public Object getDeathDetail(ReportDeathVo vo) {
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
CremationInfoSum cremationInfoSum = cremationInfoSumDao.selectByNameOrIdcard(vo); switch (vo.getSource()) {
EnbuzMemberStop enbuzMemberStop = enbuzMemberStopDao.selectByNameOrIdcard(vo); case "1":
HdptRstSwmd hdptRstSwmd = hdptRstSwmdDao.selectByNameOrIdcard(vo); EnbuzMemberStop enbuzMemberStop = enbuzMemberStopDao.selectByNameOrIdcard(vo);
if (cremationInfoSum==null && enbuzMemberStop==null && hdptRstSwmd==null){ map.put("enbuzMemberStop", enbuzMemberStop);
return "未查到该死者信息"; break;
}else{ case "2":
map.put("此数据来源殡葬火化库",cremationInfoSum); CremationInfoSum cremationInfoSum = cremationInfoSumDao.selectByNameOrIdcard(vo);
map.put("此数据来源死亡上报小程序(低保)",enbuzMemberStop); map.put("cremationInfoSum", cremationInfoSum);
map.put("此数据来源共享平台死亡记录数",hdptRstSwmd); break;
case "3":
HdptRstSwmd hdptRstSwmd = hdptRstSwmdDao.selectByNameOrIdcard(vo);
map.put("hdptRstSwmd", hdptRstSwmd);
break;
case "4":
ReportDeath death = reportDeathDao.selectByNameOrIdcard(vo);
map.put("death", death);
default:
map.put("list", "无此人具体数据");
} }
return map; return map;
} }
@Override @Override
public ResultVo updateDeath(ReportDeathVo vo) { public ResultVo updateDeath(ReportDeathVo vo) {
ReportDeath reportDeath1 = reportDeathDao.selectByIdCard(vo.getIdCard());
ReportDeath death = new ReportDeath();
int i = 0;
User user = userRepository.findByname(SecurityUtils.getCurrentUsername());
death.setName(vo.getName().trim());
death.setIdCard(vo.getIdCard());
death.setDeathPlace(vo.getDeathPlace());
death.setDeathReason(vo.getDeathReason());
death.setDeathDate(vo.getDeathDate());
death.setDeathType(vo.getDeathType());
death.setNotes(vo.getNotes());
death.setSource(vo.getSource());
death.setUserArea(user.getUserArea());
death.setUserName(user.getUsername());
death.setUpdateTime(DateUtil.date());
if (reportDeath1 == null) {
i = reportDeathDao.insertInTo(death);
} else {
i = reportDeathDao.updateDeath(death);
}
return ResultVo.success(i > 0 ? "标注成功" : "标注失败");
}
@Override
public ResultVo inSysDeath() {
List<BindUserInfo> bindSysList = ssoService.getBindSysList(); List<BindUserInfo> bindSysList = ssoService.getBindSysList();
for (BindUserInfo bindUser:bindSysList) { String sysId = null;
if (bindUser.getSysId()==3||bindUser.getSysId()==9||bindUser.getSysId()==4) { for (BindUserInfo bindUser : bindSysList) {
User user = userRepository.findByUsername(SecurityUtils.getCurrentUsername()); sysId = bindUser.getSysId().toString();
ReportDeath reportDeath = reportDeathDao.selectById(vo.getId()); if (sysId.equals("3") || sysId.equals("9") || sysId.equals("4")) {
AssertUtils.notNull(reportDeath, "无此条记录"); return ResultVo.success();
ReportDeath death = new ReportDeath();
death.setId(vo.getId());
death.setName(vo.getName());
death.setIdCard(vo.getIdCard());
death.setDeathPlace(vo.getDeathPlace());
death.setDeathReason(vo.getDeathReason());
death.setDeathDate(vo.getDeathDate());
death.setDeathType(vo.getDeathType());
death.setNotes(vo.getNotes());
death.setSource(vo.getSource());
death.setUserArea(user.getUserArea());
death.setUserName(reportDeath.getUserName());
death.setUpdateTime(DateUtil.date());
reportDeathDao.updateById(death);
return ResultVo.success("标注成功");
}else{
return ResultVo.fail("无权限修改");
} }
} }
return ResultVo.success(); return ResultVo.fail("抱歉您目前无权限进入此系统");
}
@Override
public ResultVo getDeathByName(ReportDeathVo vo) {
List<ReportDeathVo> list = reportDeathDao.getDeathByName(vo);
if (list.size() == 0) {
return ResultVo.fail("抱歉查无此人信息!");
} else {
return ResultVo.success(list);
}
} }
} }
...@@ -12,6 +12,6 @@ ...@@ -12,6 +12,6 @@
</resultMap> </resultMap>
<select id="selectByNameOrIdcard" resultMap="BaseResultMap"> <select id="selectByNameOrIdcard" resultMap="BaseResultMap">
select * from GX_BZ.FIS_CREMATION_INFO_SUM t select * from GX_BZ.FIS_CREMATION_INFO_SUM t
where t.ID_CARD=#{idCard} and t.NAME=#{name} where t.ID_CARD=#{idCard} OR t.NAME=#{name}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -14,4 +14,4 @@ ...@@ -14,4 +14,4 @@
select t.MEMBER_NAME as name,t.IDENTIFCARD_ID as idCard,t.* from GX_BZ.ENBUZ_MEMBER_STOP t select t.MEMBER_NAME as name,t.IDENTIFCARD_ID as idCard,t.* from GX_BZ.ENBUZ_MEMBER_STOP t
where t.IDENTIFCARD_ID=#{idCard} and t.MEMBER_NAME=#{name} where t.IDENTIFCARD_ID=#{idCard} and t.MEMBER_NAME=#{name}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -15,6 +15,6 @@ ...@@ -15,6 +15,6 @@
FROM FROM
GX_BZ.HDPT_RST_SWMD GX_BZ.HDPT_RST_SWMD
WHERE WHERE
ID = ( SELECT MAX( ID ) FROM GX_BZ.HDPT_RST_SWMD t WHERE t.ID_CARD = #{idCard} AND t.NAME = #{name} ) ID = ( SELECT MAX( ID ) FROM GX_BZ.HDPT_RST_SWMD t WHERE t.ID_CARD = #{idCard} OR t.NAME = #{name} )
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -17,28 +17,90 @@ ...@@ -17,28 +17,90 @@
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap> </resultMap>
<insert id="insertInTo">
INSERT INTO GX_BZ.REPORT_DEATHS (NAME, ID_CARD, DEATH_REASON,DEATH_PLACE,DEATH_DATE, SOURCE,USER_AREA, USER_NAME, DEATH_TYPE, update_time)
VALUES (#{name,jdbcType=VARCHAR}, #{idCard,jdbcType=VARCHAR},#{deathReason,jdbcType=VARCHAR}, #{deathPlace,jdbcType=VARCHAR},#{deathDate,jdbcType=VARCHAR},#{source,jdbcType=VARCHAR},#{userArea,jdbcType=VARCHAR},#{userName,jdbcType=VARCHAR},#{deathType,jdbcType=VARCHAR},#{updateTime,jdbcType=TIMESTAMP})
</insert>
<update id="updateDeath">
UPDATE GX_BZ.REPORT_DEATHS SET DEATH_TYPE=#{deathType} WHERE ID_CARD=#{idCard}
</update>
<select id="selectByIdCard" resultMap="BaseResultMap"> <select id="selectByIdCard" resultMap="BaseResultMap">
select * from GX_BZ.REPORT_DEATHS t where t.ID_CARD=#{idCard} select *
from GX_BZ.REPORT_DEATHS t
where t.ID_CARD = #{idCard}
</select> </select>
<!-- <update id="updateByappId">-->
<!-- UPDATE report_death--> <select id="selectAllDeaths" resultType="com.zq.system.modules.system.domain.vo.ReportDeathVo">
<!-- <set>--> SELECT
<!-- <if test="appId != null">--> *
<!-- app_id = #{appId, jdbcType=OTHER},--> FROM
<!-- </if>--> ( SELECT t.*, ROWNUM r FROM GX_BZ.REPORT_DEATH t WHERE UPDATE_TIME IS NOT NULL) h
<!-- <if test="systemName != null">--> WHERE
<!-- system_name = #{systemName, jdbcType=OTHER},--> r BETWEEN ( ( #{page} - 1 ) * #{size} + 1 )
<!-- </if>--> AND ( #{page} * #{size} )
<!-- <if test="systemTag != null">--> <!-- <if test="idCard != null">-->
<!-- system_tag = #{systemTag, jdbcType=OTHER},--> <!-- AND h.ID_CARD = #{idCard, jdbcType=VARCHAR}-->
<!-- </if>--> <!-- </if>-->
<!-- <if test="createTime != null">--> <!-- <if test="name != null">-->
<!-- create_time = #{createTime, jdbcType=TIMESTAMP},--> <!-- AND h.NAME = #{name, jdbcType=VARCHAR}-->
<!-- </if>--> <!-- </if>-->
<!-- <if test="updateTime != null">--> ORDER BY UPDATE_TIME DESC
<!-- update_time = #{updateTime, jdbcType=TIMESTAMP},--> </select>
<!-- </if>--> <select id="selectAllCount" resultType="java.lang.Integer">
<!-- </set>--> select count(1) from GX_BZ.REPORT_DEATH t
<!-- WHERE app_id = #{appId}--> <where>
<!-- </update>--> <if test="idCard != null">
</mapper> AND t.ID_CARD = #{idCard, jdbcType=OTHER}
\ No newline at end of file </if>
<if test="name != null">
AND t.NAME = #{name, jdbcType=OTHER}
</if>
<if test="deathType != null">
AND t.DEATH_TYPE = #{deathType, jdbcType=OTHER}
</if>
</where>
</select>
<select id="selectByNameOrIdcard" resultType="com.zq.system.modules.system.entity.ReportDeath">
SELECT *
FROM GX_BZ.REPORT_DEATHS t
WHERE t.ID_CARD = #{idCard}
OR t.NAME LIKE CONCAT('#{name}','%' )
</select>
<select id="getDeathByName" resultType="com.zq.system.modules.system.domain.vo.ReportDeathVo">
select * from GX_BZ.REPORT_DEATH t
<where>
<if test="idCard != null">
AND t.ID_CARD = #{idCard}
</if>
<if test="name != null">
AND t.NAME LIKE CONCAT('${name}','%' )
</if>
<if test="deathType">
AND t.DEATH_TYPE = #{deathType}
</if>
</where>
</select>
<!-- <update id="updateByappId">-->
<!-- UPDATE report_death-->
<!-- <set>-->
<!-- <if test="appId != null">-->
<!-- app_id = #{appId, jdbcType=OTHER},-->
<!-- </if>-->
<!-- <if test="systemName != null">-->
<!-- system_name = #{systemName, jdbcType=OTHER},-->
<!-- </if>-->
<!-- <if test="systemTag != null">-->
<!-- system_tag = #{systemTag, jdbcType=OTHER},-->
<!-- </if>-->
<!-- <if test="createTime != null">-->
<!-- create_time = #{createTime, jdbcType=TIMESTAMP},-->
<!-- </if>-->
<!-- <if test="updateTime != null">-->
<!-- update_time = #{updateTime, jdbcType=TIMESTAMP},-->
<!-- </if>-->
<!-- </set>-->
<!-- WHERE app_id = #{appId}-->
<!-- </update>-->
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment