Browse Source

0324.3

master
zhangye 6 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 @MustLogin
@ApiOperation(value = "异常人员添加", notes = "") @ApiOperation(value = "异常人员添加", notes = "")
@RequestMapping(value = "add", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) @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); log.info("异常人员添加:{}",params);
abnormalService.addAbnormal(params); AbnormalVo.AbnormalStatisticsVo abnormalStatisticsVo = abnormalService.addAbnormal(params);
return JsonResponse.newInstance().ok(); return JsonResponse.newInstance().ok(abnormalStatisticsVo);
} }
@MustLogin @MustLogin

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

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

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

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

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

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

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

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

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

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

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

@ -64,12 +64,16 @@ public class AbnormalService implements IAbnormalService{
* @param params * @param params
*/ */
@Override @Override
public void addAbnormal(QueryDto<AbnormalDto.AddAbnormal> params) { public AbnormalVo.AbnormalStatisticsVo addAbnormal(QueryDto<AbnormalDto.AddAbnormal> params) {
AbnormalDto.AddAbnormal addAbnormal = params.getParam(); AbnormalDto.AddAbnormal addAbnormal = params.getParam();
HealthAbnormal healthAbnormal = new HealthAbnormal(); HealthAbnormal healthAbnormal = new HealthAbnormal();
healthAbnormal.setId(snowflake.nextId()); healthAbnormal.setId(snowflake.nextId());
BeanUtil.copyProperties(addAbnormal,healthAbnormal); BeanUtil.copyProperties(addAbnormal,healthAbnormal);
healthAbnormalDao.insertSelective(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); log.info("是否在半径内:{}", inCircle);
if (!inCircle) { if (!inCircle) {
throw new BaseException(CodeEnum.LOCATION_LONG); throw new BaseException(CodeEnum.LOCATION_LONG);
@ -305,9 +305,27 @@ public class ClockService implements IClockService {
@Override @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()); site.setId(snowflake.nextId());
siteDao.insertSelective(site); 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 { public interface IAbnormalService {
List<AbnormalVo.AbnormalOverview> abnormalOverview(QueryDto<AbnormalDto.SelectAbnormal> params) throws Exception; 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); 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); ClockVo.SiteInfo getSiteInfoById(Long id);
void addSite(Site site); ClockVo.SiteList addSite(Site site);
void delSite(Long id); 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; 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; 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 * @param params
*/ */
@Override @Override
public void addAbnormalJourney(QueryDto<JourneyDto.AddAbnormalJourney> params) { public JourneyVo.AddAbnormalJourney addAbnormalJourney(QueryDto<JourneyDto.AddAbnormalJourney> params) {
JourneyDto.AddAbnormalJourney addAbnormalJourney = params.getParam(); JourneyDto.AddAbnormalJourney addAbnormalJourney = params.getParam();
JourneyAbnormal journeyAbnormal = new JourneyAbnormal(); JourneyAbnormal journeyAbnormal = new JourneyAbnormal();
BeanUtil.copyProperties(addAbnormalJourney,journeyAbnormal); BeanUtil.copyProperties(addAbnormalJourney,journeyAbnormal);
journeyAbnormal.setId(snowflake.nextId()); journeyAbnormal.setId(snowflake.nextId());
journeyAbnormalDao.insertSelective(journeyAbnormal); 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 @Override
public List<JourneyVo.AddAbnormalJourney> selectAbnormalJourney(QueryDto<JourneyDto.SelectAbnormalJourney> params) throws Exception { public List<JourneyVo.AddAbnormalJourney> selectAbnormalJourney(QueryDto<JourneyDto.SelectAbnormalJourney> params) throws Exception {
JourneyDto.SelectAbnormalJourney abnormalJourney = params.getParam(); JourneyDto.SelectAbnormalJourney abnormalJourney = params.getParam();
Long startTime = abnormalJourney.getStartTime() == null ? DateUtil.getZeroTime(new Date()) : abnormalJourney.getStartTime(); // Long startTime = abnormalJourney.getStartTime() == null ? DateUtil.getZeroTime(new Date()) : abnormalJourney.getStartTime();
Long endTime = abnormalJourney.getEndTime() == null ? System.currentTimeMillis() : abnormalJourney.getEndTime(); // Long endTime = abnormalJourney.getEndTime() == null ? System.currentTimeMillis() : abnormalJourney.getEndTime();
int page = abnormalJourney.getPage() == null ? 1 : abnormalJourney.getPage(); int page = abnormalJourney.getPage() == null ? 1 : abnormalJourney.getPage();
PageHelper.startPage(page, 10); PageHelper.startPage(page, 10);
List<JourneyVo.AddAbnormalJourney> addAbnormalJourneyList = List<JourneyVo.AddAbnormalJourney> addAbnormalJourneyList =
journeyAbnormalDao.selectAbnormalJourney(abnormalJourney.getCarNo(),abnormalJourney.getTripMode(),startTime,endTime); journeyAbnormalDao.selectAbnormalJourney(abnormalJourney.getCarNo(),abnormalJourney.getTripMode(),abnormalJourney.getStartTime(),abnormalJourney.getEndTime());
return addAbnormalJourneyList; 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 realNameAuth = new RealNameAuth();
realNameAuth.setId(snowflake.nextId()); realNameAuth.setId(snowflake.nextId());
realNameAuth.setUserId(userId); realNameAuth.setUserId(userId);
realNameAuth.setIdCard(userInfo.getIdCard()); // realNameAuth.setIdCard(userInfo.getIdCard());
realNameAuth.setName(userInfo.getName()); realNameAuth.setName(userInfo.getName());
realNameAuth.setNo(userInfo.getNo()); realNameAuth.setNo(userInfo.getNo());
realNameAuth.setPost((byte) userInfo.getPost()); 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 t_health_abnormal a left join t_member m on a.wkno = m.wkno
where where
a.rec_status = 0 a.rec_status = 0
<if test="post == 0"> <if test="post != null and post !='' and post == 0">
and and
m.type != 2 m.type != 2
</if> </if>
<if test="post != 0"> <if test="post != null and post !='' and post != 0">
and and
m.type = 2 m.type = 2
</if> </if>
<if test="department != null"> <if test="department != null and department !=''">
and and
a.department = #{department} a.department = #{department}
</if> </if>
<if test="healthType != null"> <if test="healthType != null and healthType !=''">
and and
a.health_status = #{healthType} a.health_status = #{healthType}
</if> </if>
@ -65,7 +65,7 @@
t_health_abnormal ha LEFT JOIN t_member m on ha.wkno = m.wkno t_health_abnormal ha LEFT JOIN t_member m on ha.wkno = m.wkno
WHERE WHERE
ha.rec_status = 0 ha.rec_status = 0
<if test="department != null"> <if test="department != null and department !=''">
and and
m.department = #{department} m.department = #{department}
</if> </if>
@ -99,7 +99,7 @@
JOIN t_member m on rn.no = m.wkno JOIN t_member m on rn.no = m.wkno
WHERE WHERE
j.rec_status = 0 j.rec_status = 0
<if test="department != null"> <if test="department != null and department !=''">
and and
m.department = #{department} m.department = #{department}
</if> </if>

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

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

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

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

Loading…
Cancel
Save