Browse Source

解决冲突

master
zhizhi wu 5 years ago
parent
commit
a6c06525a3
  1. 2
      ct/src/main/java/com/ccsens/ct/api/SiteController.java
  2. 13
      ct/src/main/java/com/ccsens/ct/bean/dto/SiteDto.java
  3. 2
      ct/src/main/java/com/ccsens/ct/service/ISiteService.java
  4. 63
      ct/src/main/java/com/ccsens/ct/service/SiteService.java
  5. 6
      health/src/main/java/com/ccsens/health/api/AbnormalController.java
  6. 12
      health/src/main/java/com/ccsens/health/api/ClockController.java
  7. 2
      health/src/main/java/com/ccsens/health/api/HealthController.java
  8. 6
      health/src/main/java/com/ccsens/health/api/JourneyController.java
  9. 8
      health/src/main/java/com/ccsens/health/bean/dto/AbnormalDto.java
  10. 6
      health/src/main/java/com/ccsens/health/bean/dto/JourneyDto.java
  11. 4
      health/src/main/java/com/ccsens/health/bean/dto/UserDto.java
  12. 2
      health/src/main/java/com/ccsens/health/bean/vo/AbnormalVo.java
  13. 10
      health/src/main/java/com/ccsens/health/bean/vo/UserVo.java
  14. 2
      health/src/main/java/com/ccsens/health/persist/dao/JourneyAbnormalDao.java
  15. 6
      health/src/main/java/com/ccsens/health/service/AbnormalService.java
  16. 51
      health/src/main/java/com/ccsens/health/service/ClockService.java
  17. 2
      health/src/main/java/com/ccsens/health/service/IAbnormalService.java
  18. 4
      health/src/main/java/com/ccsens/health/service/IClockService.java
  19. 2
      health/src/main/java/com/ccsens/health/service/IJourneyService.java
  20. 15
      health/src/main/java/com/ccsens/health/service/JourneyService.java
  21. 18
      health/src/main/java/com/ccsens/health/service/UserService.java
  22. 12
      health/src/main/resources/mapper_dao/HealthAbnormalDao.xml
  23. 2
      health/src/main/resources/mapper_dao/HealthRecordDao.xml
  24. 9
      health/src/main/resources/mapper_dao/JourneyAbnormalDao.xml
  25. 8
      health/src/main/resources/mapper_dao/RealNameAuthDao.xml
  26. 6
      health/src/main/resources/mapper_dao/SiteDao.xml
  27. 4
      util/src/main/java/com/ccsens/util/wx/WxGzhUtil.java
  28. 1
      util/src/test/java/com/ccsens/util/KeyTest.java

2
ct/src/main/java/com/ccsens/ct/api/SiteController.java

@ -64,7 +64,7 @@ public class SiteController {
@RequestMapping(value = "siteAll", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<SiteVo.SiteInfoVo> selectSiteAllByBusinessId(@ApiParam @Validated @RequestBody QueryDto<BusinessDto.BusinessId> params) throws Exception {
log.info("透过商户id查看所有场所的信息:{}",params);
SiteVo.SiteInfoVo siteInfoVo = siteService.selectSiteAllByBusinessId(params);
SiteVo.SiteInfoVo siteInfoVo = siteService.selectSiteAllByBusinessId(params.getParam().getId());
return JsonResponse.newInstance().ok(siteInfoVo);
}

13
ct/src/main/java/com/ccsens/ct/bean/dto/SiteDto.java

@ -17,12 +17,19 @@ public class SiteDto {
@ApiModelProperty("所属商户id")
@NotNull(message = "商户id不能为空")
private Long id;
@ApiModelProperty("场所信息")
private List<SiteInfo> siteInfo;
@ApiModelProperty("场所名")
@NotEmpty(message = "场所名不能为空")
private String siteName;
@ApiModelProperty("经度")
private BigDecimal longitude;
@ApiModelProperty("纬度")
private BigDecimal latitude;
// @ApiModelProperty("场所信息")
// private List<SiteInfo> siteInfo;
}
@Data
@ApiModel("添加场所")
@ApiModel("添加场所信息")
public static class SiteInfo{
@ApiModelProperty("场所名")
@NotEmpty(message = "场所名不能为空")

2
ct/src/main/java/com/ccsens/ct/service/ISiteService.java

@ -15,7 +15,7 @@ public interface ISiteService {
SiteVo.SiteInfo updateSiteInfo(QueryDto<SiteDto.UpdateSite> params);
SiteVo.SiteInfoVo selectSiteAllByBusinessId(QueryDto<BusinessDto.BusinessId> params);
SiteVo.SiteInfoVo selectSiteAllByBusinessId(Long businessId);
String downloadQrCode(Long businessId);
}

63
ct/src/main/java/com/ccsens/ct/service/SiteService.java

@ -48,24 +48,24 @@ public class SiteService implements ISiteService {
List<SiteVo.SiteInfo> siteInfos = new ArrayList<>();
SiteDto.SiteInfoDto siteInfoDto = params.getParam();
if (CollectionUtil.isNotEmpty(siteInfoDto.getSiteInfo())){
if(siteInfoDto.getSiteInfo().size() > 5){
throw new BaseException(CodeEnum.SITE_EXCEED);
}
// if (CollectionUtil.isNotEmpty(siteInfoDto.getSiteInfo())){
// if(siteInfoDto.getSiteInfo().size() > 5){
// throw new BaseException(CodeEnum.SITE_EXCEED);
// }
//查找该商户下已有场所
SiteExample siteExample = new SiteExample();
siteExample.createCriteria().andBusinessIdEqualTo(siteInfoDto.getId());
List<Site> siteList = siteDao.selectByExample(siteExample);
//目前一个商户只能添加五个场所
if(CollectionUtil.isNotEmpty(siteList)) {
if (siteInfoDto.getSiteInfo().size() + siteList.size() > 5) {
if (siteList.size() >= 5) {
throw new BaseException(CodeEnum.SITE_EXCEED);
}
}
//添加场所
for (SiteDto.SiteInfo siteInfo : siteInfoDto.getSiteInfo()) {
// for (SiteDto.SiteInfo siteInfo : siteInfoDto.getSiteInfo()) {
SiteExample siteName = new SiteExample();
siteName.createCriteria().andBusinessIdEqualTo(siteInfoDto.getId()).andSiteNameEqualTo(siteInfo.getSiteName());
siteName.createCriteria().andBusinessIdEqualTo(siteInfoDto.getId()).andSiteNameEqualTo(siteInfoDto.getSiteName());
List<Site> sites = siteDao.selectByExample(siteName);
if(CollectionUtil.isNotEmpty(sites)){
throw new BaseException(CodeEnum.SITE_NAME_REPETITION);
@ -74,9 +74,9 @@ public class SiteService implements ISiteService {
Site site = new Site();
site.setId(snowflake.nextId());
site.setBusinessId(siteInfoDto.getId());
site.setSiteName(siteInfo.getSiteName());
site.setLongitude(siteInfo.getLongitude());
site.setLatitude(siteInfo.getLatitude());
site.setSiteName(siteInfoDto.getSiteName());
site.setLongitude(siteInfoDto.getLongitude());
site.setLatitude(siteInfoDto.getLatitude());
siteDao.insertSelective(site);
String path = WebConstant.UPLOAD_PATH_BASE + "/business/" + siteInfoDto.getId() + "/siteqrcode/" + site.getSiteName();
@ -102,29 +102,31 @@ public class SiteService implements ISiteService {
outSiteQrcode.setQrcodePath(WebConstant.TEST_URL_BASE_CT +"/business/" + siteInfoDto.getId() + "/siteqrcode/" + site.getSiteName() + "/out/" + outFileName);
outSiteQrcode.setBigQrcodePath(WebConstant.TEST_URL_BASE_CT + "/business/" + siteInfoDto.getId() + "/siteqrcode/" + site.getSiteName() + "/out/" + bigOutFileName);
siteQrcodeDao.insertSelective(outSiteQrcode);
//获取返回的场所信息
SiteVo.SiteInfo siteInfo1 = new SiteVo.SiteInfo();
siteInfo1.setId(site.getId());
siteInfo1.setName(site.getSiteName());
siteInfo1.setLongitude(site.getLongitude());
siteInfo1.setLatitude(site.getLatitude());
siteInfo1.setInQrCode(inSiteQrcode.getQrcodePath());
siteInfo1.setOutQrCode(outSiteQrcode.getQrcodePath());
siteInfos.add(siteInfo1);
}
}
// //获取返回的场所信息
//// SiteVo.SiteInfo siteInfo1 = new SiteVo.SiteInfo();
//// siteInfo1.setId(site.getId());
//// siteInfo1.setName(site.getSiteName());
//// siteInfo1.setLongitude(site.getLongitude());
//// siteInfo1.setLatitude(site.getLatitude());
//// siteInfo1.setInQrCode(inSiteQrcode.getQrcodePath());
//// siteInfo1.setOutQrCode(outSiteQrcode.getQrcodePath());
//// siteInfos.add(siteInfo1);
// }
// }
//生成场所二维码压缩包并返回下载路径
ZipUtil.zip(WebConstant.UPLOAD_PATH_BASE + "/business/" + siteInfoDto.getId() + "/siteqrcode",WebConstant.UPLOAD_PATH_BASE + "/business/" + siteInfoDto.getId() + "/QrCode.zip");
//查找商户信息
Business business = businessDao.selectByPrimaryKey(siteInfoDto.getId());
siteInfoVo.setBusinessId(business.getId());
siteInfoVo.setBusinessName(business.getName());
siteInfoVo.setSite(siteInfos);
siteInfoVo.setDownloadPath(WebConstant.TEST_URL_BASE_CT + "/business/" + siteInfoDto.getId() + "/QrCode.zip");
siteInfoVo.setPath("http://test.tall.wiki/ct-dev/sign-history");
// Business business = businessDao.selectByPrimaryKey(siteInfoDto.getId());
// siteInfoVo.setBusinessId(business.getId());
// siteInfoVo.setBusinessName(business.getName());
// siteInfoVo.setSite(siteInfos);
// siteInfoVo.setDownloadPath(WebConstant.TEST_URL_BASE_CT + "/business/" + siteInfoDto.getId() + "/QrCode.zip");
// siteInfoVo.setPath("http://test.tall.wiki/ct-dev/sign-history");
siteInfoVo = selectSiteAllByBusinessId(siteInfoDto.getId());
return siteInfoVo;
}
@ -205,14 +207,14 @@ public class SiteService implements ISiteService {
/**
* 通过商户id查询所有的场所信息
*
* @param params
* @param businessId
* @return
*/
@Override
public SiteVo.SiteInfoVo selectSiteAllByBusinessId(QueryDto<BusinessDto.BusinessId> params) {
public SiteVo.SiteInfoVo selectSiteAllByBusinessId(Long businessId) {
SiteVo.SiteInfoVo siteInfoVo = new SiteVo.SiteInfoVo();
//获取商户信息
Business business = businessDao.selectByPrimaryKey(params.getParam().getId());
Business business = businessDao.selectByPrimaryKey(businessId);
if (ObjectUtil.isNull(business)) {
throw new BaseException(CodeEnum.NOT_BUSINESS);
}
@ -220,6 +222,7 @@ public class SiteService implements ISiteService {
siteInfoVo.setBusinessName(business.getName());
//TODO
siteInfoVo.setPath("http://test.tall.wiki/ct-dev/sign-history");
siteInfoVo.setDownloadPath(WebConstant.TEST_URL_BASE_CT + "/business/" + business.getId() + "/QrCode.zip");
//获取场所信息
List<SiteVo.SiteInfo> siteInfoList = new ArrayList<>();
SiteExample siteExample = new SiteExample();

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

12
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);
}
@ -79,19 +79,19 @@ public class ClockController {
@MustLogin
@ApiOperation(value = "生成场所二维码", notes = "")
@RequestMapping(value = "qrCode", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<String> getQRCode(@ApiParam @Validated @RequestBody QueryDto<JourneyDto.CreateQRCode> params) throws Exception {
public JsonResponse<ClockVo.SiteList> getQRCode(@ApiParam @Validated @RequestBody QueryDto<JourneyDto.CreateQRCode> params) throws Exception {
log.info("生成场所二维码");
String codePath = clockService.getQRCode(params);
ClockVo.SiteList codePath = clockService.getQRCode(params);
return JsonResponse.newInstance().ok(codePath);
}
@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

2
health/src/main/java/com/ccsens/health/api/HealthController.java

@ -70,7 +70,7 @@ public class HealthController {
}
@MustLogin
@ApiOperation(value = "健康类型统计", notes = "")
@ApiOperation(value = "健康信息统计", notes = "")
@PostMapping("list")
public JsonResponse<PageInfo<HealthVo.HealthList>> list(@RequestBody QueryDto<HealthDto.QueryList> params){

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

8
health/src/main/java/com/ccsens/health/bean/dto/AbnormalDto.java

@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
@ -39,19 +40,18 @@ public class AbnormalDto {
@Data
@ApiModel("新增异常人员信息")
public static class AddAbnormal{
@NotNull
@NotEmpty
@ApiModelProperty("学号")
private String wkno;
@NotNull
@NotEmpty
@ApiModelProperty("姓名")
private String name;
@NotNull
@NotEmpty
@ApiModelProperty("班级(所在机构)")
private String department;
@NotNull
@ApiModelProperty("体温")
private BigDecimal animalHeat;
@NotNull
@ApiModelProperty("原因")
private String reason;
@NotNull

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

@ -8,6 +8,7 @@ import org.springframework.beans.BeanUtils;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
@ -78,6 +79,8 @@ public class JourneyDto {
public static class Query{
@ApiModelProperty("场所上级")
private String parentCode = "SXDX";
@ApiModelProperty("场所名称 不传则查询所有,传了就模糊查询符合条件的数据")
private String siteName;
@ApiModelProperty("第几页")
@Min(value = 1)
private int pageNum = 1;
@ -93,7 +96,6 @@ public class JourneyDto {
@NotNull
@ApiModelProperty("场所名字")
private String siteName;
@NotNull
@ApiModelProperty("场所code")
private String siteCode;
@NotNull
@ -145,7 +147,7 @@ public class JourneyDto {
@NotNull
@ApiModelProperty("出行方式 0铁路 1飞机 2客运车辆 3自驾 4船 5其他")
private int tripMode;
@NotNull
@NotEmpty
@ApiModelProperty("车次号")
private String carNo;
@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("姓名")

10
health/src/main/java/com/ccsens/health/bean/vo/UserVo.java

@ -39,6 +39,8 @@ public class UserVo {
public static class HealthCode{
@ApiModelProperty("打卡时间")
private Long time;
@JsonIgnore//健康状态id
private Long healthTypeId;
@ApiModelProperty("健康码等级 0正常 1隔离中或疑似 2确诊")
private int healthLevel;
@ApiModelProperty("健康码")
@ -67,10 +69,12 @@ public class UserVo {
private Long id;
@ApiModelProperty("场所名称")
private String name;
@ApiModelProperty("打卡时间")
@ApiModelProperty("进场打卡时间")
private Long time;
@ApiModelProperty("打卡类型 0进 1出")
private int type;
@ApiModelProperty("出场打卡时间")
private Long outTime;
// @ApiModelProperty("打卡类型 0进 1出")
// private int type;
}
}

2
health/src/main/java/com/ccsens/health/persist/dao/JourneyAbnormalDao.java

@ -9,5 +9,5 @@ import java.util.List;
@Repository
public interface JourneyAbnormalDao extends JourneyAbnormalMapper {
List<JourneyVo.AddAbnormalJourney> selectAbnormalJourney(@Param("carNo") String carNo, @Param("tripMode") int tripMode, @Param("startTime") Long startTime, @Param("endTime") Long endTime);
List<JourneyVo.AddAbnormalJourney> selectAbnormalJourney(@Param("carNo") String carNo, @Param("tripMode") Integer tripMode, @Param("startTime") Long startTime, @Param("endTime") Long endTime);
}

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;
}
/**

51
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);
@ -232,7 +232,9 @@ public class ClockService implements IClockService {
* @return
*/
@Override
public String getQRCode(QueryDto<JourneyDto.CreateQRCode> params) throws Exception {
public ClockVo.SiteList getQRCode(QueryDto<JourneyDto.CreateQRCode> params) throws Exception {
ClockVo.SiteList siteVo = new ClockVo.SiteList();
String qrcodePath = null;
JourneyDto.CreateQRCode createQRCode = params.getParam();
//根据id查找场馆信息
@ -266,8 +268,31 @@ public class ClockService implements IClockService {
//添加数据库
siteQrcodeDao.insertSelective(siteQrcode);
}
//返回的信息
siteVo.setId(site.getId());
siteVo.setSiteName(site.getSiteName());
siteVo.setSiteCode(site.getSiteCode());
siteVo.setLongitude(site.getLongitude());
siteVo.setLatitude(site.getLatitude());
//二维码
int a = createQRCode.getType() == 0 ? 1 : 0;
SiteQrcodeExample url = new SiteQrcodeExample();
url.createCriteria().andSiteIdEqualTo(createQRCode.getId())
.andOutOrInEqualTo((byte) a);
List<SiteQrcode> siteQrcodes = siteQrcodeDao.selectByExample(url);
if(a == 0){
siteVo.setOutUrl(qrcodePath);
if(CollectionUtil.isNotEmpty(siteQrcodes)){
siteVo.setInUrl(siteQrcodes.get(0).getQrcodePath());
}
}else {
siteVo.setInUrl(qrcodePath);
if(CollectionUtil.isNotEmpty(siteQrcodes)){
siteVo.setOutUrl(siteQrcodes.get(0).getQrcodePath());
}
}
return qrcodePath;
return siteVo;
}
@ -280,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);

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

@ -17,13 +17,13 @@ public interface IClockService {
List<ClockVo.SiteClockStatistics> getSiteClickStatistics(QueryDto<JourneyDto.StatisticsDate> params) throws Exception;
String getQRCode(QueryDto<JourneyDto.CreateQRCode> params) throws Exception;
ClockVo.SiteList getQRCode(QueryDto<JourneyDto.CreateQRCode> params) throws Exception;
PageInfo<ClockVo.SiteList> getAllSiteInfo(JourneyDto.Query query);
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;

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

@ -152,12 +152,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;
}
/**
@ -168,12 +172,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();
Integer page = abnormalJourney.getPage() == null ? 1 : abnormalJourney.getPage();
// 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;
}

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

@ -44,6 +44,8 @@ public class UserService implements IUserService{
private TallFeignClient tallFeignClient;
@Autowired
private HealthRecordsDao healthRecordsDao;
@Autowired
private HealthTypeDao healthTypeDao;
@Resource
private MemberDao memberDao;
@Resource
@ -94,7 +96,19 @@ public class UserService implements IUserService{
//查询健康码
List<UserVo.HealthCode> healthCodeList = healthRecordsDao.getHealthQrCodeByEmployeeId(userId,startTime,endTime);
if(CollectionUtil.isNotEmpty(healthCodeList)){
for(UserVo.HealthCode healthCode : healthCodeList){
healthCode.setHealthLevel(0);
//获取健康状态
HealthType healthType = healthTypeDao.selectByPrimaryKey(healthCode.getHealthTypeId());
if(ObjectUtil.isNotNull(healthType)){
//如果健康状态异常,健康码为橙色
if(healthType.getQuarantine() != 0){
healthCode.setHealthLevel(1);
}
}
}
}
userInfoVo.setHealthCodeList(healthCodeList);
return userInfoVo;
@ -169,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>

2
health/src/main/resources/mapper_dao/HealthRecordDao.xml

@ -17,6 +17,7 @@
<resultMap id="resultMap_healthCode" type="com.ccsens.health.bean.vo.UserVo$HealthCode">
<result column="hTime" property="time"/>
<result column="hHealthTypeId" property="healthTypeId"/>
<result column="hHealthCode" property="healthCode"/>
</resultMap>
@ -69,6 +70,7 @@
<select id="getHealthQrCodeByEmployeeId" resultMap="resultMap_healthCode" parameterType="java.util.Map">
select
h.health_type_id as hHealthTypeId,
h.time as hTime,
q.qrcode_path as hHealthCode
from

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>

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

@ -10,6 +10,7 @@
<id column="cId" property="id"/>
<result column="cName" property="name"/>
<result column="cTime" property="time"/>
<result column="cOutTime" property="outTime"/>
<result column="cType" property="type"/>
</collection>
</resultMap>
@ -21,7 +22,8 @@
m.wkno as wkno,
s.id as cId,
s.site_name as cName,
sc.time as cTime
sc.time as cTime,
sc.out_time as cOutTime
from
t_site s right JOIN t_site_qrcode sq on sq.site_id = s.id
right JOIN t_site_clock_in sc on sc.site_id = s.id
@ -29,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>

6
health/src/main/resources/mapper_dao/SiteDao.xml

@ -7,8 +7,12 @@
select t.id, t.site_name as siteName, t.site_code as siteCode, t.longitude, t.latitude, t1.qrcode_path as inUrl, t2.qrcode_path as outUrl
from
(select * from t_site
where rec_status = 0
<if test="parentCode != null and parentCode != ''">
where parent_code = #{parentCode, jdbcType=VARCHAR}
and parent_code = #{parentCode, jdbcType=VARCHAR}
</if>
<if test="siteName != null and siteName != ''">
and site_name like concat('%',#{siteName, jdbcType=VARCHAR},'%')
</if>
) t
left join

4
util/src/main/java/com/ccsens/util/wx/WxGzhUtil.java

@ -31,9 +31,9 @@ public class WxGzhUtil {
*/
private static WxAccessToken globalWxAccessToken;
/**
* accessToken 过期提前10分钟刷新
* accessToken 过期提前10分钟刷新(为防止过期改成提前一个小时刷新)
*/
private static final Integer ACCESS_TOKEN_RESERVED_SECONDS = 10 * 60;
private static final Integer ACCESS_TOKEN_RESERVED_SECONDS = 60 * 60;
private static final String URL_LOGIN
= "https://api.weixin.qq.com/sns/jscode2session?appid=%1$s&secret=%2$s&js_code=%3$s&grant_type=%4$s";

1
util/src/test/java/com/ccsens/util/KeyTest.java

@ -23,6 +23,7 @@ public class KeyTest {
/**加密*/
@Test
public void test3(){
// String key = "a6RlI/GctLgENUvF6DOY7w==";
String key = "g9RlI/GctLgDFJvF6DOY7w==";
String string = "po3OynBO[M3579p6L7)o";
SymmetricCrypto aes = new SymmetricCrypto(SymmetricAlgorithm.AES, Base64.decode(key));

Loading…
Cancel
Save