Commit fb618bd0 by wqc

修改接口

parent 849b549a
...@@ -35,7 +35,7 @@ redis.password: ...@@ -35,7 +35,7 @@ redis.password:
#数据库源配置 #数据库源配置
jdbc.driver-class-name: com.mysql.cj.jdbc.Driver jdbc.driver-class-name: com.mysql.cj.jdbc.Driver
jdbc.username: root jdbc.username: root
jdbc.password: Dk2019!23456 jdbc.password: ZqTestDB#2024#
jdbc.master.url: jdbc:mysql://119.45.183.210:13308/mz_big_data?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai jdbc.master.url: jdbc:mysql://119.45.183.210:13308/mz_big_data?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
jdbc.gxbz.url: jdbc:mysql://119.45.183.210:13308/gx-bz?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai jdbc.gxbz.url: jdbc:mysql://119.45.183.210:13308/gx-bz?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
jdbc.gxcj.url: jdbc:mysql://119.45.183.210:13308/gx-cj?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai jdbc.gxcj.url: jdbc:mysql://119.45.183.210:13308/gx-cj?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
......
...@@ -59,4 +59,10 @@ public class ReportDeathVo extends PageReqVo { ...@@ -59,4 +59,10 @@ public class ReportDeathVo extends PageReqVo {
@ApiModelProperty("更新时间") @ApiModelProperty("更新时间")
private Date updateTime; private Date updateTime;
@ApiModelProperty("更新时间")
private String startTime;
@ApiModelProperty("更新时间")
private String endTime;
} }
...@@ -89,7 +89,7 @@ public class SsoController { ...@@ -89,7 +89,7 @@ public class SsoController {
@ApiOperation("用户绑定系统") @ApiOperation("用户绑定系统")
@PostMapping(value = "/bindSystem") @PostMapping(value = "/bindSystem")
public ResultVo bindSystem(@RequestBody SsoLoginVo vo) { public ResultVo bindSystem(@RequestBody SsoLoginVo vo) throws Exception {
AssertUtils.notNull(vo.getSystemId(), "缺少系统ID"); AssertUtils.notNull(vo.getSystemId(), "缺少系统ID");
AssertUtils.hasText(vo.getUsername(), "缺少用户名"); AssertUtils.hasText(vo.getUsername(), "缺少用户名");
AssertUtils.hasText(vo.getPasswd(), "缺少密码"); AssertUtils.hasText(vo.getPasswd(), "缺少密码");
......
...@@ -49,6 +49,7 @@ import org.springframework.stereotype.Service; ...@@ -49,6 +49,7 @@ import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
...@@ -126,7 +127,7 @@ public class SsoService { ...@@ -126,7 +127,7 @@ public class SsoService {
AssertUtils.isTrue(user == null, "用户名已存在"); AssertUtils.isTrue(user == null, "用户名已存在");
} }
public void bindSystem(SsoLoginVo vo) { public void bindSystem(SsoLoginVo vo) throws Exception {
OnlineUserDto adminContext = ContextUtils.getAdminContext(); OnlineUserDto adminContext = ContextUtils.getAdminContext();
List<BindUserInfo> bindUserInfos = blindUserInfoDao.selectList(Wrappers.lambdaQuery(BindUserInfo.builder().userId(adminContext.getUserId()) List<BindUserInfo> bindUserInfos = blindUserInfoDao.selectList(Wrappers.lambdaQuery(BindUserInfo.builder().userId(adminContext.getUserId())
.sysId(vo.getSystemId()).build())); .sysId(vo.getSystemId()).build()));
...@@ -137,9 +138,18 @@ public class SsoService { ...@@ -137,9 +138,18 @@ public class SsoService {
AssertUtils.hasText(sysInfo.getLoginUrl(), "系统缺少验证配置"); AssertUtils.hasText(sysInfo.getLoginUrl(), "系统缺少验证配置");
String passwd = null;
try {
passwd = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, vo.getPasswd());
} catch (Exception e) {
e.printStackTrace();
}
// AssertUtils.hasText(passwd, "密码解密失败");
// String encodePasswd = passwordEncoder.encode(passwd);
HttpRequest request = HttpRequest.post(sysInfo.getLoginUrl()) HttpRequest request = HttpRequest.post(sysInfo.getLoginUrl())
.form("username", vo.getUsername()) .form("username", vo.getUsername())
.form("password", vo.getPasswd()); .form("password", passwd);
HttpResponse response = request.execute(); HttpResponse response = request.execute();
...@@ -271,10 +281,11 @@ public class SsoService { ...@@ -271,10 +281,11 @@ public class SsoService {
* @param phone * @param phone
* @param code * @param code
*/ */
public void verificationCode(String phone, String code) { public ResultVo verificationCode(String phone, String code) {
String cacheCode = redisUtils.getStr(CacheKeys.authCodeKey(phone)); String cacheCode = redisUtils.getStr(CacheKeys.authCodeKey(phone));
AssertUtils.isTrue(StringUtils.isNotBlank(cacheCode) && cacheCode.equalsIgnoreCase(code), "验证码错误"); AssertUtils.isTrue(StringUtils.isNotBlank(cacheCode) && cacheCode.equalsIgnoreCase(code), "验证码错误");
redisUtils.deleteStr(CacheKeys.authCodeKey(phone)); redisUtils.deleteStr(CacheKeys.authCodeKey(phone));
return ResultVo.success();
} }
public ResultVo verifyToken(SsoLoginVo vo, HttpServletRequest request, HttpServletResponse response) { public ResultVo verifyToken(SsoLoginVo vo, HttpServletRequest request, HttpServletResponse response) {
......
...@@ -5,6 +5,7 @@ import cn.hutool.core.convert.Convert; ...@@ -5,6 +5,7 @@ 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.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.vo.PageVo; import com.zq.common.vo.PageVo;
...@@ -56,7 +57,9 @@ public class ReportDeathImpl implements ReportDeathService { ...@@ -56,7 +57,9 @@ public class ReportDeathImpl implements ReportDeathService {
reportDeath.setUserName(vo.getUserName()); reportDeath.setUserName(vo.getUserName());
reportDeath.setSource(vo.getSource()); reportDeath.setSource(vo.getSource());
reportDeath.setDeathType("1"); reportDeath.setDeathType("1");
reportDeath.setDeathDate(vo.getDeathDate());
reportDeath.setCreateTime(DateUtil.date()); reportDeath.setCreateTime(DateUtil.date());
reportDeath.setUpdateTime(DateUtil.date());
reportDeathDao.insert(reportDeath); reportDeathDao.insert(reportDeath);
} }
return ResultVo.success(reportDeathDao.selectList(Wrappers.lambdaQuery(null))); return ResultVo.success(reportDeathDao.selectList(Wrappers.lambdaQuery(null)));
...@@ -85,6 +88,7 @@ public class ReportDeathImpl implements ReportDeathService { ...@@ -85,6 +88,7 @@ public class ReportDeathImpl implements ReportDeathService {
reportDeath.setCreateTime(DateUtil.date()); reportDeath.setCreateTime(DateUtil.date());
reportDeath.setUserArea(user.getUserArea()); reportDeath.setUserArea(user.getUserArea());
reportDeath.setDeathType("1"); reportDeath.setDeathType("1");
reportDeath.setUpdateTime(DateUtil.date());
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() + "信息";
......
...@@ -22,7 +22,41 @@ ...@@ -22,7 +22,41 @@
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}) 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> </insert>
<update id="updateDeath"> <update id="updateDeath">
UPDATE GX_BZ.REPORT_DEATHS SET DEATH_TYPE=#{deathType} WHERE ID_CARD=#{idCard} UPDATE GX_BZ.REPORT_DEATHS
<set>
<if test="name != null">
NAME = #{name},
</if>
<if test="idCard != null">
ID_CARD = #{idCard},
</if>
<if test="deathReason != null">
DEATH_REASON = #{deathReason},
</if>
<if test="deathPlace != null">
DEATH_PLACE = #{deathPlace},
</if>
<if test="deathDate != null">
DEATH_DATE = #{deathDate},
</if>
<if test="notes != null">
NOTES = #{notes},
</if>
<if test="source != null">
SOURCE = #{source},
</if>
<if test="userArea != null">
USER_AREA = #{userArea},
</if>
<if test="userName != null">
USER_NAME = #{userName},
</if>
<if test="deathType != null">
DEATH_TYPE = #{deathType}
</if>
</set>
WHERE ID_CARD=#{idCard}
</update> </update>
<select id="selectByIdCard" resultMap="BaseResultMap"> <select id="selectByIdCard" resultMap="BaseResultMap">
...@@ -77,10 +111,20 @@ ...@@ -77,10 +111,20 @@
<if test="name != null"> <if test="name != null">
AND t.NAME LIKE CONCAT('${name}','%' ) AND t.NAME LIKE CONCAT('${name}','%' )
</if> </if>
<if test="deathType"> <if test="deathType !=null">
AND t.DEATH_TYPE = #{deathType} AND t.DEATH_TYPE = #{deathType}
</if> </if>
<if test="userArea !=null">
AND t.USER_AREA LIKE CONCAT(,'${userArea}','%' )
</if>
<if test="startTime !=null &amp;&amp; endTime !=null">
AND t.CREATE_TIME
BETWEEN TO_DATE('${startTime}', 'YYYY-MM-DD') AND TO_DATE('${endTime}', 'YYYY-MM-DD')
</if>
</where> </where>
<!-- TRUNC(t.CREATE_TIME,'YYYY-MM-DD') &gt;= TRUNC(TO_DATE(#{startTime},'YYYY-MM-DD'))
AND TRUNC(t.CREATE_TIME,'YYYY-MM-DD') &lt;= TRUNC(TO_DATE(#{endTime},'YYYY-MM-DD'))-->
</select> </select>
<!-- <update id="updateByappId">--> <!-- <update id="updateByappId">-->
<!-- UPDATE report_death--> <!-- UPDATE report_death-->
......
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