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. 10
      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"}) @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 { public JsonResponse<SiteVo.SiteInfoVo> selectSiteAllByBusinessId(@ApiParam @Validated @RequestBody QueryDto<BusinessDto.BusinessId> params) throws Exception {
log.info("透过商户id查看所有场所的信息:{}",params); log.info("透过商户id查看所有场所的信息:{}",params);
SiteVo.SiteInfoVo siteInfoVo = siteService.selectSiteAllByBusinessId(params); SiteVo.SiteInfoVo siteInfoVo = siteService.selectSiteAllByBusinessId(params.getParam().getId());
return JsonResponse.newInstance().ok(siteInfoVo); 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") @ApiModelProperty("所属商户id")
@NotNull(message = "商户id不能为空") @NotNull(message = "商户id不能为空")
private Long id; private Long id;
@ApiModelProperty("场所信息") @ApiModelProperty("场所名")
private List<SiteInfo> siteInfo; @NotEmpty(message = "场所名不能为空")
private String siteName;
@ApiModelProperty("经度")
private BigDecimal longitude;
@ApiModelProperty("纬度")
private BigDecimal latitude;
// @ApiModelProperty("场所信息")
// private List<SiteInfo> siteInfo;
} }
@Data @Data
@ApiModel("添加场所") @ApiModel("添加场所信息")
public static class SiteInfo{ public static class SiteInfo{
@ApiModelProperty("场所名") @ApiModelProperty("场所名")
@NotEmpty(message = "场所名不能为空") @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.SiteInfo updateSiteInfo(QueryDto<SiteDto.UpdateSite> params);
SiteVo.SiteInfoVo selectSiteAllByBusinessId(QueryDto<BusinessDto.BusinessId> params); SiteVo.SiteInfoVo selectSiteAllByBusinessId(Long businessId);
String downloadQrCode(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<>(); List<SiteVo.SiteInfo> siteInfos = new ArrayList<>();
SiteDto.SiteInfoDto siteInfoDto = params.getParam(); SiteDto.SiteInfoDto siteInfoDto = params.getParam();
if (CollectionUtil.isNotEmpty(siteInfoDto.getSiteInfo())){ // if (CollectionUtil.isNotEmpty(siteInfoDto.getSiteInfo())){
if(siteInfoDto.getSiteInfo().size() > 5){ // if(siteInfoDto.getSiteInfo().size() > 5){
throw new BaseException(CodeEnum.SITE_EXCEED); // throw new BaseException(CodeEnum.SITE_EXCEED);
} // }
//查找该商户下已有场所 //查找该商户下已有场所
SiteExample siteExample = new SiteExample(); SiteExample siteExample = new SiteExample();
siteExample.createCriteria().andBusinessIdEqualTo(siteInfoDto.getId()); siteExample.createCriteria().andBusinessIdEqualTo(siteInfoDto.getId());
List<Site> siteList = siteDao.selectByExample(siteExample); List<Site> siteList = siteDao.selectByExample(siteExample);
//目前一个商户只能添加五个场所 //目前一个商户只能添加五个场所
if(CollectionUtil.isNotEmpty(siteList)) { if(CollectionUtil.isNotEmpty(siteList)) {
if (siteInfoDto.getSiteInfo().size() + siteList.size() > 5) { if (siteList.size() >= 5) {
throw new BaseException(CodeEnum.SITE_EXCEED); throw new BaseException(CodeEnum.SITE_EXCEED);
} }
} }
//添加场所 //添加场所
for (SiteDto.SiteInfo siteInfo : siteInfoDto.getSiteInfo()) { // for (SiteDto.SiteInfo siteInfo : siteInfoDto.getSiteInfo()) {
SiteExample siteName = new SiteExample(); 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); List<Site> sites = siteDao.selectByExample(siteName);
if(CollectionUtil.isNotEmpty(sites)){ if(CollectionUtil.isNotEmpty(sites)){
throw new BaseException(CodeEnum.SITE_NAME_REPETITION); throw new BaseException(CodeEnum.SITE_NAME_REPETITION);
@ -74,9 +74,9 @@ public class SiteService implements ISiteService {
Site site = new Site(); Site site = new Site();
site.setId(snowflake.nextId()); site.setId(snowflake.nextId());
site.setBusinessId(siteInfoDto.getId()); site.setBusinessId(siteInfoDto.getId());
site.setSiteName(siteInfo.getSiteName()); site.setSiteName(siteInfoDto.getSiteName());
site.setLongitude(siteInfo.getLongitude()); site.setLongitude(siteInfoDto.getLongitude());
site.setLatitude(siteInfo.getLatitude()); site.setLatitude(siteInfoDto.getLatitude());
siteDao.insertSelective(site); siteDao.insertSelective(site);
String path = WebConstant.UPLOAD_PATH_BASE + "/business/" + siteInfoDto.getId() + "/siteqrcode/" + site.getSiteName(); 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.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); outSiteQrcode.setBigQrcodePath(WebConstant.TEST_URL_BASE_CT + "/business/" + siteInfoDto.getId() + "/siteqrcode/" + site.getSiteName() + "/out/" + bigOutFileName);
siteQrcodeDao.insertSelective(outSiteQrcode); siteQrcodeDao.insertSelective(outSiteQrcode);
//获取返回的场所信息 // //获取返回的场所信息
SiteVo.SiteInfo siteInfo1 = new SiteVo.SiteInfo(); //// SiteVo.SiteInfo siteInfo1 = new SiteVo.SiteInfo();
siteInfo1.setId(site.getId()); //// siteInfo1.setId(site.getId());
siteInfo1.setName(site.getSiteName()); //// siteInfo1.setName(site.getSiteName());
siteInfo1.setLongitude(site.getLongitude()); //// siteInfo1.setLongitude(site.getLongitude());
siteInfo1.setLatitude(site.getLatitude()); //// siteInfo1.setLatitude(site.getLatitude());
siteInfo1.setInQrCode(inSiteQrcode.getQrcodePath()); //// siteInfo1.setInQrCode(inSiteQrcode.getQrcodePath());
siteInfo1.setOutQrCode(outSiteQrcode.getQrcodePath()); //// siteInfo1.setOutQrCode(outSiteQrcode.getQrcodePath());
siteInfos.add(siteInfo1); //// siteInfos.add(siteInfo1);
} // }
} // }
//生成场所二维码压缩包并返回下载路径 //生成场所二维码压缩包并返回下载路径
ZipUtil.zip(WebConstant.UPLOAD_PATH_BASE + "/business/" + siteInfoDto.getId() + "/siteqrcode",WebConstant.UPLOAD_PATH_BASE + "/business/" + siteInfoDto.getId() + "/QrCode.zip"); 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()); // Business business = businessDao.selectByPrimaryKey(siteInfoDto.getId());
siteInfoVo.setBusinessId(business.getId()); // siteInfoVo.setBusinessId(business.getId());
siteInfoVo.setBusinessName(business.getName()); // siteInfoVo.setBusinessName(business.getName());
siteInfoVo.setSite(siteInfos); // siteInfoVo.setSite(siteInfos);
siteInfoVo.setDownloadPath(WebConstant.TEST_URL_BASE_CT + "/business/" + siteInfoDto.getId() + "/QrCode.zip"); // siteInfoVo.setDownloadPath(WebConstant.TEST_URL_BASE_CT + "/business/" + siteInfoDto.getId() + "/QrCode.zip");
siteInfoVo.setPath("http://test.tall.wiki/ct-dev/sign-history"); // siteInfoVo.setPath("http://test.tall.wiki/ct-dev/sign-history");
siteInfoVo = selectSiteAllByBusinessId(siteInfoDto.getId());
return siteInfoVo; return siteInfoVo;
} }
@ -205,14 +207,14 @@ public class SiteService implements ISiteService {
/** /**
* 通过商户id查询所有的场所信息 * 通过商户id查询所有的场所信息
* *
* @param params * @param businessId
* @return * @return
*/ */
@Override @Override
public SiteVo.SiteInfoVo selectSiteAllByBusinessId(QueryDto<BusinessDto.BusinessId> params) { public SiteVo.SiteInfoVo selectSiteAllByBusinessId(Long businessId) {
SiteVo.SiteInfoVo siteInfoVo = new SiteVo.SiteInfoVo(); SiteVo.SiteInfoVo siteInfoVo = new SiteVo.SiteInfoVo();
//获取商户信息 //获取商户信息
Business business = businessDao.selectByPrimaryKey(params.getParam().getId()); Business business = businessDao.selectByPrimaryKey(businessId);
if (ObjectUtil.isNull(business)) { if (ObjectUtil.isNull(business)) {
throw new BaseException(CodeEnum.NOT_BUSINESS); throw new BaseException(CodeEnum.NOT_BUSINESS);
} }
@ -220,6 +222,7 @@ public class SiteService implements ISiteService {
siteInfoVo.setBusinessName(business.getName()); siteInfoVo.setBusinessName(business.getName());
//TODO //TODO
siteInfoVo.setPath("http://test.tall.wiki/ct-dev/sign-history"); 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<>(); List<SiteVo.SiteInfo> siteInfoList = new ArrayList<>();
SiteExample siteExample = new SiteExample(); SiteExample siteExample = new SiteExample();

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

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

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

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

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 io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -39,19 +40,18 @@ public class AbnormalDto {
@Data @Data
@ApiModel("新增异常人员信息") @ApiModel("新增异常人员信息")
public static class AddAbnormal{ public static class AddAbnormal{
@NotNull @NotEmpty
@ApiModelProperty("学号") @ApiModelProperty("学号")
private String wkno; private String wkno;
@NotNull @NotEmpty
@ApiModelProperty("姓名") @ApiModelProperty("姓名")
private String name; private String name;
@NotNull @NotEmpty
@ApiModelProperty("班级(所在机构)") @ApiModelProperty("班级(所在机构)")
private String department; private String department;
@NotNull @NotNull
@ApiModelProperty("体温") @ApiModelProperty("体温")
private BigDecimal animalHeat; private BigDecimal animalHeat;
@NotNull
@ApiModelProperty("原因") @ApiModelProperty("原因")
private String reason; private String reason;
@NotNull @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.Max;
import javax.validation.constraints.Min; import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -78,6 +79,8 @@ public class JourneyDto {
public static class Query{ public static class Query{
@ApiModelProperty("场所上级") @ApiModelProperty("场所上级")
private String parentCode = "SXDX"; private String parentCode = "SXDX";
@ApiModelProperty("场所名称 不传则查询所有,传了就模糊查询符合条件的数据")
private String siteName;
@ApiModelProperty("第几页") @ApiModelProperty("第几页")
@Min(value = 1) @Min(value = 1)
private int pageNum = 1; private int pageNum = 1;
@ -93,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
@ -145,7 +147,7 @@ public class JourneyDto {
@NotNull @NotNull
@ApiModelProperty("出行方式 0铁路 1飞机 2客运车辆 3自驾 4船 5其他") @ApiModelProperty("出行方式 0铁路 1飞机 2客运车辆 3自驾 4船 5其他")
private int tripMode; private int tripMode;
@NotNull @NotEmpty
@ApiModelProperty("车次号") @ApiModelProperty("车次号")
private String carNo; private String carNo;
@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("姓名")

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

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

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); log.info("是否在半径内:{}", inCircle);
if (!inCircle) { if (!inCircle) {
throw new BaseException(CodeEnum.LOCATION_LONG); throw new BaseException(CodeEnum.LOCATION_LONG);
@ -232,7 +232,9 @@ public class ClockService implements IClockService {
* @return * @return
*/ */
@Override @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; String qrcodePath = null;
JourneyDto.CreateQRCode createQRCode = params.getParam(); JourneyDto.CreateQRCode createQRCode = params.getParam();
//根据id查找场馆信息 //根据id查找场馆信息
@ -266,8 +268,31 @@ public class ClockService implements IClockService {
//添加数据库 //添加数据库
siteQrcodeDao.insertSelective(siteQrcode); 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 @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);

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; 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); PageInfo<ClockVo.SiteList> getAllSiteInfo(JourneyDto.Query query);
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;

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

@ -152,12 +152,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;
} }
/** /**
@ -168,12 +172,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();
Integer 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;
} }

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

@ -44,6 +44,8 @@ public class UserService implements IUserService{
private TallFeignClient tallFeignClient; private TallFeignClient tallFeignClient;
@Autowired @Autowired
private HealthRecordsDao healthRecordsDao; private HealthRecordsDao healthRecordsDao;
@Autowired
private HealthTypeDao healthTypeDao;
@Resource @Resource
private MemberDao memberDao; private MemberDao memberDao;
@Resource @Resource
@ -94,7 +96,19 @@ public class UserService implements IUserService{
//查询健康码 //查询健康码
List<UserVo.HealthCode> healthCodeList = healthRecordsDao.getHealthQrCodeByEmployeeId(userId,startTime,endTime); 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); userInfoVo.setHealthCodeList(healthCodeList);
return userInfoVo; return userInfoVo;
@ -169,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>

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

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>

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

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

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 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 from
(select * from t_site (select * from t_site
where rec_status = 0
<if test="parentCode != null and parentCode != ''"> <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> </if>
) t ) t
left join left join

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

@ -31,9 +31,9 @@ public class WxGzhUtil {
*/ */
private static WxAccessToken globalWxAccessToken; 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 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"; = "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 @Test
public void test3(){ public void test3(){
// String key = "a6RlI/GctLgENUvF6DOY7w==";
String key = "g9RlI/GctLgDFJvF6DOY7w=="; String key = "g9RlI/GctLgDFJvF6DOY7w==";
String string = "po3OynBO[M3579p6L7)o"; String string = "po3OynBO[M3579p6L7)o";
SymmetricCrypto aes = new SymmetricCrypto(SymmetricAlgorithm.AES, Base64.decode(key)); SymmetricCrypto aes = new SymmetricCrypto(SymmetricAlgorithm.AES, Base64.decode(key));

Loading…
Cancel
Save