Browse Source

0324.3

master
zhangye 5 years ago
parent
commit
987caa24c4
  1. 6
      health/src/main/java/com/ccsens/health/api/AbnormalController.java
  2. 8
      health/src/main/java/com/ccsens/health/api/ClockController.java
  3. 6
      health/src/main/java/com/ccsens/health/api/JourneyController.java
  4. 1
      health/src/main/java/com/ccsens/health/bean/dto/JourneyDto.java
  5. 4
      health/src/main/java/com/ccsens/health/bean/dto/UserDto.java
  6. 2
      health/src/main/java/com/ccsens/health/bean/vo/AbnormalVo.java
  7. 6
      health/src/main/java/com/ccsens/health/service/AbnormalService.java
  8. 22
      health/src/main/java/com/ccsens/health/service/ClockService.java
  9. 2
      health/src/main/java/com/ccsens/health/service/IAbnormalService.java
  10. 2
      health/src/main/java/com/ccsens/health/service/IClockService.java
  11. 2
      health/src/main/java/com/ccsens/health/service/IJourneyService.java
  12. 12
      health/src/main/java/com/ccsens/health/service/JourneyService.java
  13. 2
      health/src/main/java/com/ccsens/health/service/UserService.java
  14. 12
      health/src/main/resources/mapper_dao/HealthAbnormalDao.xml
  15. 9
      health/src/main/resources/mapper_dao/JourneyAbnormalDao.xml
  16. 4
      health/src/main/resources/mapper_dao/RealNameAuthDao.xml

6
health/src/main/java/com/ccsens/health/api/AbnormalController.java

@ -41,10 +41,10 @@ public class AbnormalController {
@MustLogin
@ApiOperation(value = "异常人员添加", notes = "")
@RequestMapping(value = "add", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse addAbnormal(@ApiParam @Validated @RequestBody QueryDto<AbnormalDto.AddAbnormal> params) throws Exception {
public JsonResponse<AbnormalVo.AbnormalStatisticsVo> addAbnormal(@ApiParam @Validated @RequestBody QueryDto<AbnormalDto.AddAbnormal> params) throws Exception {
log.info("异常人员添加:{}",params);
abnormalService.addAbnormal(params);
return JsonResponse.newInstance().ok();
AbnormalVo.AbnormalStatisticsVo abnormalStatisticsVo = abnormalService.addAbnormal(params);
return JsonResponse.newInstance().ok(abnormalStatisticsVo);
}
@MustLogin

8
health/src/main/java/com/ccsens/health/api/ClockController.java

@ -71,7 +71,7 @@ public class ClockController {
@ApiOperation(value = "通过二维码内的id获取场所的信息", notes = "")
@RequestMapping(value = "site", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<ClockVo.SiteInfo> getSiteInfoById(@ApiParam @Validated @RequestBody QueryDto<ClockDto.CreateQRCodeId> params) throws Exception {
log.info("获取所有场景信息");
log.info("通过二维码内的id获取场所的信息");
ClockVo.SiteInfo siteInfo = clockService.getSiteInfoById(params.getParam().getId());
return JsonResponse.newInstance().ok(siteInfo);
}
@ -88,10 +88,10 @@ public class ClockController {
@MustLogin
@ApiOperation(value = "添加场所", notes = "")
@RequestMapping(value = "addSite", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<String> addSite(@ApiParam @Validated @RequestBody QueryDto<JourneyDto.SiteAdd> params) throws Exception {
public JsonResponse<ClockVo.SiteList> addSite(@ApiParam @Validated @RequestBody QueryDto<JourneyDto.SiteAdd> params) throws Exception {
log.info("添加场所:{}", params);
clockService.addSite(params.getParam().toSite());
return JsonResponse.newInstance().ok();
ClockVo.SiteList codePath = clockService.addSite(params.getParam().toSite());
return JsonResponse.newInstance().ok(codePath);
}
@MustLogin

6
health/src/main/java/com/ccsens/health/api/JourneyController.java

@ -52,10 +52,10 @@ public class JourneyController {
@MustLogin
@ApiOperation(value = "添加异常行程信息", notes = "")
@RequestMapping(value = "addAbnormalJourney", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse addAbnormalJourney(@ApiParam @Validated @RequestBody QueryDto<JourneyDto.AddAbnormalJourney> params) throws Exception {
public JsonResponse<JourneyVo.AddAbnormalJourney> addAbnormalJourney(@ApiParam @Validated @RequestBody QueryDto<JourneyDto.AddAbnormalJourney> params) throws Exception {
log.info("添加异常行程信息:{}",params);
journeyService.addAbnormalJourney(params);
return JsonResponse.newInstance().ok();
JourneyVo.AddAbnormalJourney abnormalJourney = journeyService.addAbnormalJourney(params);
return JsonResponse.newInstance().ok(abnormalJourney);
}
@MustLogin

1
health/src/main/java/com/ccsens/health/bean/dto/JourneyDto.java

@ -96,7 +96,6 @@ public class JourneyDto {
@NotNull
@ApiModelProperty("场所名字")
private String siteName;
@NotNull
@ApiModelProperty("场所code")
private String siteCode;
@NotNull

4
health/src/main/java/com/ccsens/health/bean/dto/UserDto.java

@ -12,8 +12,8 @@ public class UserDto {
public static class UserInfo{
@ApiModelProperty("姓名")
private String name;
@ApiModelProperty("身份证号")
private String idCard;
// @ApiModelProperty("身份证号")
// private String idCard;
@ApiModelProperty("身份 0学生 1老师 2工作人员")
private int post;
@ApiModelProperty("学号")

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

@ -44,7 +44,7 @@ public class AbnormalVo {
@ApiModel("异常人员统计返回")
public static class AbnormalStatisticsVo{
@ApiModelProperty("id")
private String id;
private Long id;
@ApiModelProperty("学号")
private String wkno;
@ApiModelProperty("姓名")

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

@ -64,12 +64,16 @@ public class AbnormalService implements IAbnormalService{
* @param params
*/
@Override
public void addAbnormal(QueryDto<AbnormalDto.AddAbnormal> params) {
public AbnormalVo.AbnormalStatisticsVo addAbnormal(QueryDto<AbnormalDto.AddAbnormal> params) {
AbnormalDto.AddAbnormal addAbnormal = params.getParam();
HealthAbnormal healthAbnormal = new HealthAbnormal();
healthAbnormal.setId(snowflake.nextId());
BeanUtil.copyProperties(addAbnormal,healthAbnormal);
healthAbnormalDao.insertSelective(healthAbnormal);
AbnormalVo.AbnormalStatisticsVo abnormalStatisticsVo = new AbnormalVo.AbnormalStatisticsVo();
BeanUtil.copyProperties(healthAbnormal,abnormalStatisticsVo);
return abnormalStatisticsVo;
}
/**

22
health/src/main/java/com/ccsens/health/service/ClockService.java

@ -74,7 +74,7 @@ public class ClockService implements IClockService {
}
//判断经纬度是否正确
boolean inCircle = DistanceUtil.isInCircle(site.getLongitude(), site.getLatitude(), clickIn.getLocationLongitude(), clickIn.getLocationLatitude(), "0.05");
boolean inCircle = DistanceUtil.isInCircle(site.getLongitude(), site.getLatitude(), clickIn.getLocationLongitude(), clickIn.getLocationLatitude(), "1");
log.info("是否在半径内:{}", inCircle);
if (!inCircle) {
throw new BaseException(CodeEnum.LOCATION_LONG);
@ -305,9 +305,27 @@ public class ClockService implements IClockService {
@Override
public void addSite(Site site) {
public ClockVo.SiteList addSite(Site site) {
//验证场所名是否重复
SiteExample siteExample = new SiteExample();
siteExample.createCriteria().andParentCodeEqualTo(site.getParentCode()).andSiteNameEqualTo(site.getSiteName());
List<Site> siteList = siteDao.selectByExample(siteExample);
if(CollectionUtil.isNotEmpty(siteList)){
throw new BaseException(CodeEnum.SITE_NAME_REPETITION);
}
site.setId(snowflake.nextId());
siteDao.insertSelective(site);
//返回的信息
ClockVo.SiteList siteVo = new ClockVo.SiteList();
siteVo.setId(site.getId());
siteVo.setSiteName(site.getSiteName());
siteVo.setSiteCode(site.getSiteCode());
siteVo.setLongitude(site.getLongitude());
siteVo.setLatitude(site.getLatitude());
return siteVo;
}
/**

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

@ -9,7 +9,7 @@ import java.util.List;
public interface IAbnormalService {
List<AbnormalVo.AbnormalOverview> abnormalOverview(QueryDto<AbnormalDto.SelectAbnormal> params) throws Exception;
void addAbnormal(QueryDto<AbnormalDto.AddAbnormal> params);
AbnormalVo.AbnormalStatisticsVo addAbnormal(QueryDto<AbnormalDto.AddAbnormal> params);
List<AbnormalVo.AbnormalStatisticsVo> abnormalStatistics(QueryDto<AbnormalDto.AbnormalStatisticsDto> params);

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

@ -23,7 +23,7 @@ public interface IClockService {
ClockVo.SiteInfo getSiteInfoById(Long id);
void addSite(Site site);
ClockVo.SiteList addSite(Site site);
void delSite(Long id);

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

@ -13,7 +13,7 @@ public interface IJourneyService {
List<JourneyVo.JourneyInfo> getJourney(QueryDto<JourneyDto.SelectDate> params) throws Exception;
void addAbnormalJourney(QueryDto<JourneyDto.AddAbnormalJourney> params);
JourneyVo.AddAbnormalJourney addAbnormalJourney(QueryDto<JourneyDto.AddAbnormalJourney> params);
List<JourneyVo.AddAbnormalJourney> selectAbnormalJourney(QueryDto<JourneyDto.SelectAbnormalJourney> params) throws Exception;

12
health/src/main/java/com/ccsens/health/service/JourneyService.java

@ -150,12 +150,16 @@ public class JourneyService implements IJourneyService{
* @param params
*/
@Override
public void addAbnormalJourney(QueryDto<JourneyDto.AddAbnormalJourney> params) {
public JourneyVo.AddAbnormalJourney addAbnormalJourney(QueryDto<JourneyDto.AddAbnormalJourney> params) {
JourneyDto.AddAbnormalJourney addAbnormalJourney = params.getParam();
JourneyAbnormal journeyAbnormal = new JourneyAbnormal();
BeanUtil.copyProperties(addAbnormalJourney,journeyAbnormal);
journeyAbnormal.setId(snowflake.nextId());
journeyAbnormalDao.insertSelective(journeyAbnormal);
JourneyVo.AddAbnormalJourney abnormalJourney = new JourneyVo.AddAbnormalJourney();
BeanUtil.copyProperties(journeyAbnormal,abnormalJourney);
return abnormalJourney;
}
/**
@ -166,13 +170,13 @@ public class JourneyService implements IJourneyService{
@Override
public List<JourneyVo.AddAbnormalJourney> selectAbnormalJourney(QueryDto<JourneyDto.SelectAbnormalJourney> params) throws Exception {
JourneyDto.SelectAbnormalJourney abnormalJourney = params.getParam();
Long startTime = abnormalJourney.getStartTime() == null ? DateUtil.getZeroTime(new Date()) : abnormalJourney.getStartTime();
Long endTime = abnormalJourney.getEndTime() == null ? System.currentTimeMillis() : abnormalJourney.getEndTime();
// Long startTime = abnormalJourney.getStartTime() == null ? DateUtil.getZeroTime(new Date()) : abnormalJourney.getStartTime();
// Long endTime = abnormalJourney.getEndTime() == null ? System.currentTimeMillis() : abnormalJourney.getEndTime();
int page = abnormalJourney.getPage() == null ? 1 : abnormalJourney.getPage();
PageHelper.startPage(page, 10);
List<JourneyVo.AddAbnormalJourney> addAbnormalJourneyList =
journeyAbnormalDao.selectAbnormalJourney(abnormalJourney.getCarNo(),abnormalJourney.getTripMode(),startTime,endTime);
journeyAbnormalDao.selectAbnormalJourney(abnormalJourney.getCarNo(),abnormalJourney.getTripMode(),abnormalJourney.getStartTime(),abnormalJourney.getEndTime());
return addAbnormalJourneyList;
}

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

@ -183,7 +183,7 @@ public class UserService implements IUserService{
RealNameAuth realNameAuth = new RealNameAuth();
realNameAuth.setId(snowflake.nextId());
realNameAuth.setUserId(userId);
realNameAuth.setIdCard(userInfo.getIdCard());
// realNameAuth.setIdCard(userInfo.getIdCard());
realNameAuth.setName(userInfo.getName());
realNameAuth.setNo(userInfo.getNo());
realNameAuth.setPost((byte) userInfo.getPost());

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

@ -35,19 +35,19 @@
t_health_abnormal a left join t_member m on a.wkno = m.wkno
where
a.rec_status = 0
<if test="post == 0">
<if test="post != null and post !='' and post == 0">
and
m.type != 2
</if>
<if test="post != 0">
<if test="post != null and post !='' and post != 0">
and
m.type = 2
</if>
<if test="department != null">
<if test="department != null and department !=''">
and
a.department = #{department}
</if>
<if test="healthType != null">
<if test="healthType != null and healthType !=''">
and
a.health_status = #{healthType}
</if>
@ -65,7 +65,7 @@
t_health_abnormal ha LEFT JOIN t_member m on ha.wkno = m.wkno
WHERE
ha.rec_status = 0
<if test="department != null">
<if test="department != null and department !=''">
and
m.department = #{department}
</if>
@ -99,7 +99,7 @@
JOIN t_member m on rn.no = m.wkno
WHERE
j.rec_status = 0
<if test="department != null">
<if test="department != null and department !=''">
and
m.department = #{department}
</if>

9
health/src/main/resources/mapper_dao/JourneyAbnormalDao.xml

@ -23,18 +23,21 @@
t_journey_abnormal
where
rec_status = 0
<if test="carNo == null">
<if test="carNo != null and carNo !=''">
and
car_no = #{carNo}
</if>
<if test="tripMode == null">
<if test="tripMode != null">
and
trip_mode = #{tripMode}
</if>
<if test="endTime != null">
and
start_time &lt;= #{endTime}
</if>
<if test="startTime != null">
and
end_time &gt;= #{startTime}
ORDER By h.time DESC
</if>
</select>
</mapper>

4
health/src/main/resources/mapper_dao/RealNameAuthDao.xml

@ -31,11 +31,11 @@
join t_member m on r.no = m.wkno
where
m.rec_status = 0
<if test="name != null">
<if test="name != null and name !=''">
and
m.name = #{name}
</if>
<if test="wkno != null">
<if test="wkno != null and wkno !=''">
and
m.wkno = #{wkno}
</if>

Loading…
Cancel
Save