Browse Source

0319.2

master
zhangye 5 years ago
parent
commit
2cff667a85
  1. 14
      health/src/main/java/com/ccsens/health/bean/vo/AbnormalVo.java
  2. 1
      health/src/main/java/com/ccsens/health/persist/dao/HealthAbnormalDao.java
  3. 13
      health/src/main/java/com/ccsens/health/service/AbnormalService.java
  4. 2
      health/src/main/java/com/ccsens/health/service/IAbnormalService.java
  5. 30
      health/src/main/resources/mapper_dao/HealthAbnormalDao.xml
  6. 1
      tall/src/main/java/com/ccsens/tall/config/SpringConfig.java
  7. 2
      tall/src/main/java/com/ccsens/tall/service/IUserService.java
  8. 29
      tall/src/main/java/com/ccsens/tall/service/UserService.java
  9. 12
      tall/src/main/java/com/ccsens/tall/web/UserController.java

14
health/src/main/java/com/ccsens/health/bean/vo/AbnormalVo.java

@ -1,5 +1,6 @@
package com.ccsens.health.bean.vo; package com.ccsens.health.bean.vo;
import cn.hutool.core.util.ObjectUtil;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -18,9 +19,20 @@ public class AbnormalVo {
@ApiModelProperty("异常状态名称") @ApiModelProperty("异常状态名称")
private String abnormalName; private String abnormalName;
@ApiModelProperty("异常状态code") @ApiModelProperty("异常状态code")
private String code; private Integer code;
@ApiModelProperty("数量") @ApiModelProperty("数量")
private Long number; private Long number;
public String getAbnormalName(){
switch (code){
case 0: abnormalName = "健康"; break;
case 1: abnormalName = "治愈"; break;
case 2: abnormalName = "隔离"; break;
case 3: abnormalName = "疑似"; break;
case 4: abnormalName = "确诊"; break;
default:abnormalName = null;
}
return null;
}
} }
@Data @Data

1
health/src/main/java/com/ccsens/health/persist/dao/HealthAbnormalDao.java

@ -13,4 +13,5 @@ import java.util.List;
public interface HealthAbnormalDao extends HealthAbnormalMapper { public interface HealthAbnormalDao extends HealthAbnormalMapper {
List<AbnormalVo.AbnormalStatisticsVo> getAbnormalList(@Param("post") Integer post, @Param("department")String department, @Param("healthType")Integer healthType); List<AbnormalVo.AbnormalStatisticsVo> getAbnormalList(@Param("post") Integer post, @Param("department")String department, @Param("healthType")Integer healthType);
List<AbnormalVo.AbnormalOverview> abnormalOverview(@Param("department")String department, @Param("startTime")Long startTime, @Param("endTime")Long endTime);
} }

13
health/src/main/java/com/ccsens/health/service/AbnormalService.java

@ -5,10 +5,12 @@ import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.ccsens.health.bean.dto.AbnormalDto; import com.ccsens.health.bean.dto.AbnormalDto;
import com.ccsens.health.bean.dto.JourneyDto;
import com.ccsens.health.bean.po.HealthAbnormal; import com.ccsens.health.bean.po.HealthAbnormal;
import com.ccsens.health.bean.vo.AbnormalVo; import com.ccsens.health.bean.vo.AbnormalVo;
import com.ccsens.health.persist.dao.HealthAbnormalDao; import com.ccsens.health.persist.dao.HealthAbnormalDao;
import com.ccsens.util.CodeEnum; import com.ccsens.util.CodeEnum;
import com.ccsens.util.DateUtil;
import com.ccsens.util.bean.dto.QueryDto; import com.ccsens.util.bean.dto.QueryDto;
import com.ccsens.util.exception.BaseException; import com.ccsens.util.exception.BaseException;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
@ -18,6 +20,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List; import java.util.List;
@Slf4j @Slf4j
@ -35,9 +38,15 @@ public class AbnormalService implements IAbnormalService{
* @return * @return
*/ */
@Override @Override
public List<AbnormalVo.AbnormalOverview> abnormalOverview(QueryDto<AbnormalDto.SelectAbnormal> params) { public List<AbnormalVo.AbnormalOverview> abnormalOverview(QueryDto<AbnormalDto.SelectAbnormal> params) throws Exception {
AbnormalDto.SelectAbnormal selectAbnormal = params.getParam();
Long startTime = selectAbnormal.getStartTime() == null ? DateUtil.getZeroTime(new Date()) : selectAbnormal.getStartTime();
Long endTime = selectAbnormal.getEndTime() == null ? System.currentTimeMillis() : selectAbnormal.getEndTime();
return null; List<AbnormalVo.AbnormalOverview> abnormalOverviewList =
healthAbnormalDao.abnormalOverview(selectAbnormal.getDepartment(),startTime,endTime);
return abnormalOverviewList;
} }
/** /**

2
health/src/main/java/com/ccsens/health/service/IAbnormalService.java

@ -7,7 +7,7 @@ import com.ccsens.util.bean.dto.QueryDto;
import java.util.List; import java.util.List;
public interface IAbnormalService { public interface IAbnormalService {
List<AbnormalVo.AbnormalOverview> abnormalOverview(QueryDto<AbnormalDto.SelectAbnormal> params); List<AbnormalVo.AbnormalOverview> abnormalOverview(QueryDto<AbnormalDto.SelectAbnormal> params) throws Exception;
void addAbnormal(QueryDto<AbnormalDto.AddAbnormal> params); void addAbnormal(QueryDto<AbnormalDto.AddAbnormal> params);

30
health/src/main/resources/mapper_dao/HealthAbnormalDao.xml

@ -14,6 +14,11 @@
<result column="endTime" property="endTime"/> <result column="endTime" property="endTime"/>
</resultMap> </resultMap>
<resultMap id="resultMap_abnormal_overview" type="com.ccsens.health.bean.vo.AbnormalVo$AbnormalOverview">
<result column="code" property="code"/>
<result column="number" property="number"/>
</resultMap>
<select id="getAbnormalList" resultMap="resultMap_abnormal_statistics" parameterType="java.util.Map"> <select id="getAbnormalList" resultMap="resultMap_abnormal_statistics" parameterType="java.util.Map">
select select
a.id as id, a.id as id,
@ -46,4 +51,29 @@
a.health_status = #{healthType} a.health_status = #{healthType}
</if> </if>
</select> </select>
<select id="getAbnormalList" resultMap="resultMap_abnormal_statistics" parameterType="java.util.Map">
SELECT
a.health_status as code,
count(*) as number
FROM
t_health_abnormal a join (
SELECT
ha.health_status as h_status
FROM
t_health_abnormal ha LEFT JOIN t_member m on ha.wkno = m.wkno
WHERE
ha.rec_status = 0
<if test="department != null">
and
m.department = #{department}
</if>
and
ha.start_time &lt;= #{endTime}
and
ha.end_time &gt;= #{startTime}
) h on a.health_status = h.h_status
GROUP BY a.health_status
</select>
</mapper> </mapper>

1
tall/src/main/java/com/ccsens/tall/config/SpringConfig.java

@ -143,6 +143,7 @@ public class SpringConfig implements WebMvcConfigurer {
.excludePathPatterns("/users/member") .excludePathPatterns("/users/member")
.excludePathPatterns("/users/allMemberAll") .excludePathPatterns("/users/allMemberAll")
.excludePathPatterns("/users/userId") .excludePathPatterns("/users/userId")
.excludePathPatterns("/users/mergeUserId")
.addPathPatterns("/plugins/**") .addPathPatterns("/plugins/**")
.excludePathPatterns("/plugins/sign") .excludePathPatterns("/plugins/sign")
.excludePathPatterns("/plugins/fuzzy") .excludePathPatterns("/plugins/fuzzy")

2
tall/src/main/java/com/ccsens/tall/service/IUserService.java

@ -74,4 +74,6 @@ public interface IUserService {
UserVo.UserSign changePhoneNotPassword(Long userId,UserDto.WxBindingPhone phoneInfo) throws Exception; UserVo.UserSign changePhoneNotPassword(Long userId,UserDto.WxBindingPhone phoneInfo) throws Exception;
UserVo.TokenBean getTokenByUserId(Long userId); UserVo.TokenBean getTokenByUserId(Long userId);
void mergeUserId(Long userId, Long uselessId);
} }

29
tall/src/main/java/com/ccsens/tall/service/UserService.java

@ -1244,6 +1244,35 @@ public class UserService implements IUserService {
sysBalanceLogDao.insertSelective(balanceLog); sysBalanceLogDao.insertSelective(balanceLog);
} }
/**
* 输入两个userid合并账号
*/
@Override
public void mergeUserId(Long userId, Long uselessId) {
SysUser user = userDao.selectByPrimaryKey(userId);
SysUser uselessUser = userDao.selectByPrimaryKey(userId);
if(ObjectUtil.isNull(user) || ObjectUtil.isNull(uselessUser)){
throw new BaseException(CodeEnum.NOT_MEMBER);
}
userDao.replaceAuth(userId, uselessId);
//查询所有关联userId的数据库表 auth表 attention表 balance表 project表 member表 DeliverPostLog表 proLog表
//依次将查出的数据的旧userId 替换成新的userId
userDao.replaceAttention(userId, uselessId);
userDao.replaceBalance(userId, uselessId);
userDao.replaceProject(userId, uselessId);
userDao.replaceMember(userId, uselessId);
userDao.replaceDeliverPostLog(userId, uselessId);
userDao.replaceProLog(userId, uselessId);
//将以前的余额添加至此账号
SysUser oldUser = userDao.selectByPrimaryKey(userId);
SysUser newUser = userDao.selectByPrimaryKey(uselessId);
updateBalance(oldUser, newUser);
//将以前的user删除
oldUser.setRecStatus((byte) 2);
userDao.updateByPrimaryKeySelective(oldUser);
}
/** /**
* 修改用户信息添加微信信息 * 修改用户信息添加微信信息
* *

12
tall/src/main/java/com/ccsens/tall/web/UserController.java

@ -302,6 +302,18 @@ public class UserController {
return JsonResponse.newInstance().ok(); return JsonResponse.newInstance().ok();
} }
@ApiOperation(value = "输入两个userid将两个账号合并(保留企业用户的id)",notes = "")
@ApiImplicitParams({
@ApiImplicitParam(name="userId",value = "需要保留的userId",required = true,paramType = "query"),
@ApiImplicitParam(name="uselessId",value = "不需要保留的userId",required = true,paramType = "query")
})
@RequestMapping(value = "/mergeUserId",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
public JsonResponse mergeUserId(HttpServletRequest request,
@RequestParam(required = true) Long userId,Long uselessId) throws Exception {
userService.mergeUserId(userId,uselessId);
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "通过userId获取token",notes = "") @ApiOperation(value = "通过userId获取token",notes = "")
@ApiImplicitParams({ @ApiImplicitParams({

Loading…
Cancel
Save