Browse Source

解决冲突

master
zhizhi wu 5 years ago
parent
commit
637dbcbcb6
  1. 12
      health/src/main/java/com/ccsens/health/bean/vo/HealthVo.java
  2. 2
      health/src/main/java/com/ccsens/health/persist/dao/HealthRecordsDao.java
  3. 185
      health/src/main/java/com/ccsens/health/service/HealthService.java
  4. 4
      health/src/main/resources/application.yml
  5. 43
      health/src/main/resources/mapper_dao/HealthRecordDao.xml
  6. 4
      util/src/main/java/com/ccsens/util/wx/WxXcxUtil.java

12
health/src/main/java/com/ccsens/health/bean/vo/HealthVo.java

@ -53,8 +53,8 @@ public class HealthVo {
private String healthCode; private String healthCode;
@ApiModelProperty("健康状态名字") @ApiModelProperty("健康状态名字")
private String healthTypeName; private String healthTypeName;
@ApiModelProperty("备注的文件信息") @ApiModelProperty("备注的文件路径")
private List<HealthRemarkFileInfo> fileInfoList; private List<String> filePath;
} }
@Data @Data
@ -171,4 +171,12 @@ public class HealthVo {
@ApiModelProperty("上传时间") @ApiModelProperty("上传时间")
private Long time; private Long time;
} }
@Data
public static class HealthTypeNumber{
private String name;
private int independent;
private int number;
}
} }

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

@ -33,4 +33,6 @@ public interface HealthRecordsDao extends HealthRecordsMapper {
* @return * @return
*/ */
List<HealthVo.HealthList> list(HealthDto.QueryList param); List<HealthVo.HealthList> list(HealthDto.QueryList param);
List<HealthVo.HealthTypeNumber> selectHealthTypeNumber(@Param("startTime")Long startTime, @Param("endTime")Long endTime);
} }

185
health/src/main/java/com/ccsens/health/service/HealthService.java

@ -41,7 +41,7 @@ import java.util.concurrent.Future;
@Slf4j @Slf4j
@Service @Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class HealthService implements IHealthService{ public class HealthService implements IHealthService {
@Autowired @Autowired
private Snowflake snowflake; private Snowflake snowflake;
@ -83,13 +83,13 @@ public class HealthService implements IHealthService{
/** /**
* 上报健康信息 * 上报健康信息
*
* @param params * @param params
* @return * @return
*/ */
@Override @Override
public HealthVo.HealthInfo addHealthInfo(QueryDto<HealthDto.healthInfo> params) throws Exception { public HealthVo.HealthInfo addHealthInfo(QueryDto<HealthDto.healthInfo> params) throws Exception {
log.info("保存健康码:{}", params); log.info("保存健康码:{}", params);
HealthVo.HealthInfo healthInfoVo = new HealthVo.HealthInfo(); HealthVo.HealthInfo healthInfoVo = new HealthVo.HealthInfo();
//1、获取健康信息和userId //1、获取健康信息和userId
HealthDto.healthInfo healthInfo = params.getParam(); HealthDto.healthInfo healthInfo = params.getParam();
@ -112,7 +112,7 @@ public class HealthService implements IHealthService{
healthRecords.setId(snowflake.nextId()); healthRecords.setId(snowflake.nextId());
healthRecords.setTime(System.currentTimeMillis()); healthRecords.setTime(System.currentTimeMillis());
healthRecords.setUserId(userId); healthRecords.setUserId(userId);
BeanUtil.copyProperties(healthInfo,healthRecords); BeanUtil.copyProperties(healthInfo, healthRecords);
healthRecordsDao.insertSelective(healthRecords); healthRecordsDao.insertSelective(healthRecords);
healthInfoVo.setHealthLevel(0); healthInfoVo.setHealthLevel(0);
@ -122,17 +122,18 @@ public class HealthService implements IHealthService{
//如果健康状态异常,健康码为橙色 //如果健康状态异常,健康码为橙色
if(healthType.getQuarantine() != 0){ if(healthType.getQuarantine() != 0){
healthInfoVo.setHealthLevel(1); healthInfoVo.setHealthLevel(1);
}else { } else {
//如果选择状态正常,检查温度是否正常(36.0°~37.3°) //如果选择状态正常,检查温度是否正常(36.0°~37.3°)
BigDecimal minAnimalHeat = BigDecimal.valueOf(36.0); BigDecimal minAnimalHeat = BigDecimal.valueOf(36.0);
BigDecimal maxAnimalHeat = BigDecimal.valueOf(37.3); BigDecimal maxAnimalHeat = BigDecimal.valueOf(37.3);
if(healthInfo.getAnimalHeat().compareTo(minAnimalHeat) == -1 || if (healthInfo.getAnimalHeat().compareTo(minAnimalHeat) == -1 ||
healthInfo.getAnimalHeat().compareTo(maxAnimalHeat) == 1){ healthInfo.getAnimalHeat().compareTo(maxAnimalHeat) == 1) {
throw new BaseException(CodeEnum.ANIMAL_HEAT_ERROR); throw new BaseException(CodeEnum.ANIMAL_HEAT_ERROR);
} }
} }
healthInfoVo.setHealthTypeName(healthType.getName()); healthInfoVo.setHealthTypeName(healthType.getName());
} }
Long aa2 = System.currentTimeMillis();
//TODO 4、生成健康码,返回地址 //TODO 4、生成健康码,返回地址
// String fileName = "/qrCode/" + cn.hutool.core.date.DateUtil.today() + "/" + System.currentTimeMillis() + ".png"; // String fileName = "/qrCode/" + cn.hutool.core.date.DateUtil.today() + "/" + System.currentTimeMillis() + ".png";
// String path = WebConstant.UPLOAD_PATH_BASE+fileName; // String path = WebConstant.UPLOAD_PATH_BASE+fileName;
@ -140,25 +141,24 @@ public class HealthService implements IHealthService{
// ,"d="+userId,color,path); // ,"d="+userId,color,path);
// String qrcodePath = PropUtil.qrCode + fileName; // String qrcodePath = PropUtil.qrCode + fileName;
//关联备注文件信息 //关联备注文件信息
List<HealthVo.HealthRemarkFileInfo> healthRemarkFileInfoList = new ArrayList<>(); List<String> filePath = new ArrayList<>();
if(CollectionUtil.isNotEmpty(healthInfo.getFileIdList())){ if (CollectionUtil.isNotEmpty(healthInfo.getFileIdList())) {
for(Long fileId : healthInfo.getFileIdList()){ for (Long fileId : healthInfo.getFileIdList()) {
HealthRemarkFile healthRemarkFile = healthRemarkFileDao.selectByPrimaryKey(fileId); HealthRemarkFile healthRemarkFile = healthRemarkFileDao.selectByPrimaryKey(fileId);
if(ObjectUtil.isNull(healthRemarkFile)){ if (ObjectUtil.isNull(healthRemarkFile)) {
throw new BaseException(CodeEnum.NOT_DELIVER_FILE); throw new BaseException(CodeEnum.NOT_DELIVER_FILE);
} }
healthRemarkFile.setHealthRecordsId(healthRecords.getId()); healthRemarkFile.setHealthRecordsId(healthRecords.getId());
healthRemarkFileDao.updateByPrimaryKeySelective(healthRemarkFile); healthRemarkFileDao.updateByPrimaryKeySelective(healthRemarkFile);
//添加至返回信息 //添加至返回信息
HealthVo.HealthRemarkFileInfo fileInfo = new HealthVo.HealthRemarkFileInfo(); filePath.add(healthRemarkFile.getPath());
fileInfo.setFileId(healthRemarkFile.getId()); // HealthVo.HealthRemarkFileInfo fileInfo = new HealthVo.HealthRemarkFileInfo();
fileInfo.setFileName(healthRemarkFile.getName()); // fileInfo.setFileId(healthRemarkFile.getId());
fileInfo.setFilePath(healthRemarkFile.getPath()); // fileInfo.setFileName(healthRemarkFile.getName());
fileInfo.setTime(healthRemarkFile.getTime()); // fileInfo.setFilePath(healthRemarkFile.getPath());
healthRemarkFileInfoList.add(fileInfo); // fileInfo.setTime(healthRemarkFile.getTime());
// healthRemarkFileInfoList.add(fileInfo);
} }
} }
@ -175,11 +175,13 @@ public class HealthService implements IHealthService{
healthQRCode.setQrcodePath(qrcodePath); healthQRCode.setQrcodePath(qrcodePath);
healthQRCode.setTime(System.currentTimeMillis()); healthQRCode.setTime(System.currentTimeMillis());
healthQRCodeDao.insertSelective(healthQRCode); healthQRCodeDao.insertSelective(healthQRCode);
//6、查询健康信息和健康码地址返回前端 //6、查询健康信息和健康码地址返回前端
BeanUtil.copyProperties(healthRecords,healthInfoVo); BeanUtil.copyProperties(healthRecords, healthInfoVo);
healthInfoVo.setUserId(userId); healthInfoVo.setUserId(userId);
healthInfoVo.setHealthCode(qrcodePath); healthInfoVo.setHealthCode(qrcodePath);
healthInfoVo.setFileInfoList(healthRemarkFileInfoList); healthInfoVo.setFilePath(filePath);
return healthInfoVo; return healthInfoVo;
} }
@ -199,6 +201,7 @@ public class HealthService implements IHealthService{
/** /**
* 获取个人健康信息 * 获取个人健康信息
*
* @param params * @param params
* @return * @return
*/ */
@ -209,34 +212,32 @@ public class HealthService implements IHealthService{
Long startTime = selectDate.getStartTime() == null ? DateUtil.getZeroTime(new Date()) : selectDate.getStartTime(); Long startTime = selectDate.getStartTime() == null ? DateUtil.getZeroTime(new Date()) : selectDate.getStartTime();
Long endTime = selectDate.getEndTime() == null ? System.currentTimeMillis() : selectDate.getEndTime(); Long endTime = selectDate.getEndTime() == null ? System.currentTimeMillis() : selectDate.getEndTime();
Long userId = params.getUserId(); Long userId = params.getUserId();
// if(StrUtil.isEmpty(userId)){ log.info("获取个人健康打卡记录 userid:{}", userId);
// throw new BaseException(CodeEnum.NOT_LOGIN);
// }
// //2、通过userid查询出成员id
// Employee employee = userService.getEmployeeByUserId(Long.valueOf(userId));
//3、查询该成员符合时间的记录
List<HealthVo.HealthInfo> healthInfoList = healthRecordsDao.selectHealthInfoByDate(userId,startTime,endTime);
if(CollectionUtil.isNotEmpty(healthInfoList)){
for(HealthVo.HealthInfo healthInfo : healthInfoList){
healthInfo.setHealthLevel(0);
//获取健康状态
HealthType healthType = healthTypeDao.selectByPrimaryKey(healthInfo.getHealthTypeId());
if(ObjectUtil.isNotNull(healthType)){
//如果健康状态异常,健康码为橙色
if(healthType.getQuarantine() != 0){
healthInfo.setHealthLevel(1);
}
healthInfo.setHealthTypeName(healthType.getName());
}
} //3、查询该成员符合时间的记录
} List<HealthVo.HealthInfo> healthInfoList = healthRecordsDao.selectHealthInfoByDate(userId, startTime, endTime);
// if(CollectionUtil.isNotEmpty(healthInfoList)){
// for(HealthVo.HealthInfo healthInfo : healthInfoList){
// healthInfo.setHealthLevel(0);
// //获取健康状态
// HealthType healthType = healthTypeDao.selectByPrimaryKey(healthInfo.getHealthTypeId());
// if(ObjectUtil.isNotNull(healthType)){
// //如果健康状态异常,健康码为橙色
// if(healthType.getQuarantine() != 0){
// healthInfo.setHealthLevel(1);
// }
// healthInfo.setHealthTypeName(healthType.getName());
// }
//
// }
// }
//4、返回 //4、返回
return healthInfoList; return healthInfoList;
} }
/** /**
* 获取健康类型 * 获取健康类型
*
* @return * @return
*/ */
@Override @Override
@ -246,8 +247,8 @@ public class HealthService implements IHealthService{
HealthTypeExample healthTypeExample = new HealthTypeExample(); HealthTypeExample healthTypeExample = new HealthTypeExample();
healthTypeExample.clear(); healthTypeExample.clear();
List<HealthType> healthTypeList = healthTypeDao.selectByExample(healthTypeExample); List<HealthType> healthTypeList = healthTypeDao.selectByExample(healthTypeExample);
if(CollectionUtil.isNotEmpty(healthTypeList)){ if (CollectionUtil.isNotEmpty(healthTypeList)) {
for(HealthType healthType : healthTypeList){ for (HealthType healthType : healthTypeList) {
HealthVo.HealthTypeVo healthTypeVo = new HealthVo.HealthTypeVo(); HealthVo.HealthTypeVo healthTypeVo = new HealthVo.HealthTypeVo();
healthTypeVo.setId(healthType.getId()); healthTypeVo.setId(healthType.getId());
healthTypeVo.setName(healthType.getName()); healthTypeVo.setName(healthType.getName());
@ -259,6 +260,7 @@ public class HealthService implements IHealthService{
/** /**
* 健康状态统计 * 健康状态统计
*
* @param * @param
* @return * @return
*/ */
@ -270,47 +272,81 @@ public class HealthService implements IHealthService{
Long startTime = statisticsDate.getStartTime() == null ? DateUtil.getZeroTime(new Date()) : statisticsDate.getStartTime(); Long startTime = statisticsDate.getStartTime() == null ? DateUtil.getZeroTime(new Date()) : statisticsDate.getStartTime();
Long endTime = statisticsDate.getEndTime() == null ? System.currentTimeMillis() : statisticsDate.getEndTime(); Long endTime = statisticsDate.getEndTime() == null ? System.currentTimeMillis() : statisticsDate.getEndTime();
//2、获取所有健康状态
int otherNumber = 0; List<HealthVo.HealthTypeNumber> healthTypeNumberList = healthRecordsDao.selectHealthTypeNumber(startTime, endTime);
HealthTypeExample healthTypeExample = new HealthTypeExample(); int other = 0;
healthTypeExample.clear(); if(CollectionUtil.isNotEmpty(healthTypeNumberList)){
List<HealthType> healthTypeList = healthTypeDao.selectByExample(healthTypeExample); for(HealthVo.HealthTypeNumber healthTypeNumber : healthTypeNumberList){
if(CollectionUtil.isNotEmpty(healthTypeList)){ if(healthTypeNumber.getIndependent() == 0){
for(HealthType healthType : healthTypeList){ other += healthTypeNumber.getNumber();
//3、若需要单独统计则单独返回,否则都归为其他类返回总数 }else {
if(healthType.getIndependent() == 1){
//查询此状态在时间内的打卡人数
int number = healthRecordsDao.selectByTypeId(healthType.getId(),startTime,endTime);
HealthVo.HealthTypeStatistics healthTypeStatistics = new HealthVo.HealthTypeStatistics(); HealthVo.HealthTypeStatistics healthTypeStatistics = new HealthVo.HealthTypeStatistics();
healthTypeStatistics.setName(healthType.getName()); healthTypeStatistics.setName(healthTypeNumber.getName());
healthTypeStatistics.setNumber(number); healthTypeStatistics.setNumber(healthTypeNumber.getNumber());
healthTypeStatisticsList.add(healthTypeStatistics); healthTypeStatisticsList.add(healthTypeStatistics);
}else {
//查询此状态在时间内的打卡人数
int number = healthRecordsDao.selectByTypeId(healthType.getId(),startTime,endTime);
otherNumber += number;
} }
} }
HealthVo.HealthTypeStatistics healthTypeStatistics = new HealthVo.HealthTypeStatistics(); HealthVo.HealthTypeStatistics healthTypeStatistics = new HealthVo.HealthTypeStatistics();
healthTypeStatistics.setName("其他"); healthTypeStatistics.setName("其他");
healthTypeStatistics.setNumber(otherNumber); healthTypeStatistics.setNumber(other);
healthTypeStatisticsList.add(healthTypeStatistics); healthTypeStatisticsList.add(healthTypeStatistics);
}
//获取查询的天数(正常应该一天打卡一次)
Long days = (endTime - startTime) / (3600 * 24 * 1000) + 1;
//未上报的次数
HealthVo.NotUpload notUpload = healthRecordsDao.getNotUpload(days, startTime, endTime);
//获取查询的天数(正常应该一天打卡一次) HealthVo.HealthTypeStatistics notUploadStatistics = new HealthVo.HealthTypeStatistics();
Long days = (endTime - startTime) / (3600 * 24 * 1000) + 1; notUploadStatistics.setName("未上报");
//未上报的次数 if (ObjectUtil.isNotNull(notUpload)) {
HealthVo.NotUpload notUpload = healthRecordsDao.getNotUpload(days,startTime,endTime); notUploadStatistics.setNumber((int) (notUpload.getNumber() * days - notUpload.getTimes()));
} else {
HealthVo.HealthTypeStatistics notUploadStatistics = new HealthVo.HealthTypeStatistics(); notUploadStatistics.setNumber(0);
notUploadStatistics.setName("未上报");
if(ObjectUtil.isNotNull(notUpload)){
notUploadStatistics.setNumber((int) (notUpload.getNumber() * days - notUpload.getTimes()));
}else {
notUploadStatistics.setNumber(0);
}
healthTypeStatisticsList.add(notUploadStatistics);
} }
healthTypeStatisticsList.add(notUploadStatistics);
// //2、获取所有健康状态
// int otherNumber = 0;
// HealthTypeExample healthTypeExample = new HealthTypeExample();
// healthTypeExample.clear();
// List<HealthType> healthTypeList = healthTypeDao.selectByExample(healthTypeExample);
// if(CollectionUtil.isNotEmpty(healthTypeList)){
// for(HealthType healthType : healthTypeList){
// //3、若需要单独统计则单独返回,否则都归为其他类返回总数
// if(healthType.getIndependent() == 1){
// //查询此状态在时间内的打卡人数
// int number = healthRecordsDao.selectByTypeId(healthType.getId(),startTime,endTime);
// HealthVo.HealthTypeStatistics healthTypeStatistics = new HealthVo.HealthTypeStatistics();
// healthTypeStatistics.setName(healthType.getName());
// healthTypeStatistics.setNumber(number);
// healthTypeStatisticsList.add(healthTypeStatistics);
// }else {
// //查询此状态在时间内的打卡人数
// int number = healthRecordsDao.selectByTypeId(healthType.getId(),startTime,endTime);
// otherNumber += number;
// }
// }
// HealthVo.HealthTypeStatistics healthTypeStatistics = new HealthVo.HealthTypeStatistics();
// healthTypeStatistics.setName("其他");
// healthTypeStatistics.setNumber(otherNumber);
// healthTypeStatisticsList.add(healthTypeStatistics);
//
//
// //获取查询的天数(正常应该一天打卡一次)
// Long days = (endTime - startTime) / (3600 * 24 * 1000) + 1;
// //未上报的次数
// HealthVo.NotUpload notUpload = healthRecordsDao.getNotUpload(days,startTime,endTime);
//
// HealthVo.HealthTypeStatistics notUploadStatistics = new HealthVo.HealthTypeStatistics();
// notUploadStatistics.setName("未上报");
// if(ObjectUtil.isNotNull(notUpload)){
// notUploadStatistics.setNumber((int) (notUpload.getNumber() * days - notUpload.getTimes()));
// }else {
// notUploadStatistics.setNumber(0);
// }
// healthTypeStatisticsList.add(notUploadStatistics);
// }
return healthTypeStatisticsList; return healthTypeStatisticsList;
} }
@ -324,6 +360,7 @@ public class HealthService implements IHealthService{
/** /**
* 上传备注文件 * 上传备注文件
*
* @param filePath * @param filePath
* @param name * @param name
* @return * @return

4
health/src/main/resources/application.yml

@ -1,4 +1,4 @@
spring: spring:
profiles: profiles:
active: test active: dev
include: common, util-test include: common, util-dev

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

@ -8,6 +8,7 @@
<result column="hDistrict" property="district"/> <result column="hDistrict" property="district"/>
<result column="hAddress" property="address"/> <result column="hAddress" property="address"/>
<result column="hHealthTypeId" property="healthTypeId"/> <result column="hHealthTypeId" property="healthTypeId"/>
<result column="hAnimalHeat" property="animalHeat"/>
<result column="hHospital" property="hospital"/> <result column="hHospital" property="hospital"/>
<result column="hTouchHuBei" property="touchHubei"/> <result column="hTouchHuBei" property="touchHubei"/>
<result column="hTouchSick" property="touchSick"/> <result column="hTouchSick" property="touchSick"/>
@ -18,11 +19,11 @@
<result column="hRemark" property="remark"/> <result column="hRemark" property="remark"/>
<result column="hHealthAgreement" property="healthAgreement"/> <result column="hHealthAgreement" property="healthAgreement"/>
<result column="hSelfFill" property="selfFill"/> <result column="hSelfFill" property="selfFill"/>
<collection property="fileInfoList" ofType="com.ccsens.health.bean.vo.HealthVo$HealthRemarkFileInfo"> <result column="hHealthCode" property="healthCode"/>
<id column="fileId" property="fileId"/> <result column="hHealthTypeName" property="healthTypeName"/>
<result column="fileName" property="fileName"/> <result column="hHealthLevel" property="healthLevel"/>
<result column="filePath" property="filePath"/> <collection property="filePath" ofType="String">
<result column="fTime" property="time"/> <result column="fFilePath"/>
</collection> </collection>
</resultMap> </resultMap>
@ -37,6 +38,12 @@
<result column="times" property="times"/> <result column="times" property="times"/>
</resultMap> </resultMap>
<resultMap id="resultMap_healthTypeNumber" type="com.ccsens.health.bean.vo.HealthVo$HealthTypeNumber">
<result column="name" property="name"/>
<result column="independent" property="independent"/>
<result column="number" property="number"/>
</resultMap>
<select id="selectHealthInfoByDate" resultMap="resultMap_HealthInfo" parameterType="java.util.Map"> <select id="selectHealthInfoByDate" resultMap="resultMap_HealthInfo" parameterType="java.util.Map">
select select
h.id as hId, h.id as hId,
@ -45,6 +52,7 @@
h.district as hDistrict, h.district as hDistrict,
h.address as hAddress, h.address as hAddress,
h.health_type_id as hHealthTypeId, h.health_type_id as hHealthTypeId,
h.animal_heat as hAnimalHeat,
h.hospital as hHospital, h.hospital as hHospital,
h.touch_hubei as hTouchHuBei, h.touch_hubei as hTouchHuBei,
h.touch_sick as hTouchSick, h.touch_sick as hTouchSick,
@ -55,14 +63,14 @@
h.remark as hRemark, h.remark as hRemark,
h.health_agreement as hHealthAgreement, h.health_agreement as hHealthAgreement,
h.self_fill as hSelfFill, h.self_fill as hSelfFill,
f.id as fileId, f.path as fFilePath,
f.name as fileName, q.qrcode_path as hHealthCode,
f.path as filePath, ht.name as hHealthTypeName,
f.time as fTime, if(ht.quarantine = 0,0,1) as hHealthLevel
q.qrcode_path as hHealthCode
from from
t_health_records h join t_health_qrcode q on q.health_records_id = h.id t_health_records h join t_health_qrcode q on q.health_records_id = h.id
left join t_health_remark_file f on f.health_records_id = h.id left join t_health_remark_file f on f.health_records_id = h.id
join t_health_type ht on h.health_type_id = ht.id
where where
h.rec_status = 0 h.rec_status = 0
and and
@ -74,7 +82,7 @@
ORDER By h.time DESC ORDER By h.time DESC
</select> </select>
<select id="selectByTypeId" parameterType="java.util.Map" resultType="int"> <select id="selectByTypeId" parameterType="java.util.Map" resultType="int">
select select
COUNT(*) COUNT(*)
@ -109,7 +117,18 @@
limit 1 limit 1
</select> </select>
<select id="getNotUpload" parameterType="java.util.Map" resultMap="resultMap_notUpload"> <select id="selectHealthTypeNumber" resultMap="resultMap_healthTypeNumber" parameterType="java.util.Map">
select
if(t.independent = 1 , t.name , '其他') as name,
t.independent as independent,
count(*) as number
from
t_health_type t left join t_health_records r
on t.id = r.health_type_id
GROUP BY t.name
</select>
<select id="getNotUpload" parameterType="java.util.Map" resultMap="resultMap_notUpload">
SELECT SELECT
count(*) as number, count(*) as number,
a.times as times a.times as times

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

@ -235,6 +235,7 @@ public class WxXcxUtil {
* @throws Exception * @throws Exception
*/ */
public static void getWxCode(String page,String scene,LineColor color,String path) throws Exception { public static void getWxCode(String page,String scene,LineColor color,String path) throws Exception {
String url = String.format(URL_GET_WX_CODE_B, WxGzhUtil.getAccessToken()); String url = String.format(URL_GET_WX_CODE_B, WxGzhUtil.getAccessToken());
WechatCode wechatCode = new WechatCode(); WechatCode wechatCode = new WechatCode();
@ -247,7 +248,8 @@ public class WxXcxUtil {
String postStr = JacksonUtil.beanToJson(wechatCode); String postStr = JacksonUtil.beanToJson(wechatCode);
System.out.println(postStr); System.out.println(postStr);
HttpsUtil.httpsRequest(url,"POST",postStr,path); HttpsUtil.httpsRequest(url,"POST",postStr,path);
}
}
/** /**
* 获取小程序二维码/小程序码(长度128有数量限制) * 获取小程序二维码/小程序码(长度128有数量限制)

Loading…
Cancel
Save