Commit eb7518ea authored by 杨阳's avatar 杨阳

发货单

新增/编辑/详情接口 更新发货单状态接口
parent b06741c0
...@@ -54,5 +54,6 @@ public class MobileLoginParamDto { ...@@ -54,5 +54,6 @@ public class MobileLoginParamDto {
@ApiModelProperty("注册类型为2-手机验证登录时使用:验证码") @ApiModelProperty("注册类型为2-手机验证登录时使用:验证码")
private String verifyCode; private String verifyCode;
@ApiModelProperty("农户信息")
private PeasantHouseholdDto peasantHouseholdDto; private PeasantHouseholdDto peasantHouseholdDto;
} }
...@@ -105,13 +105,13 @@ public class PeasantHouseholdDto extends BaseDto { ...@@ -105,13 +105,13 @@ public class PeasantHouseholdDto extends BaseDto {
private List<String> permanentAddressText; private List<String> permanentAddressText;
@ApiModelProperty(value = "区域公司id") @ApiModelProperty(value = "区域公司id")
private String companyId; private String regionalCompaniesSeq;
@ApiModelProperty(value = "区域公司code") @ApiModelProperty(value = "区域公司code")
private String companyCode; private String regionalCompaniesCode;
@ApiModelProperty(value = "区域公司名称") @ApiModelProperty(value = "区域公司名称")
private String companyName; private String regionalCompaniesName;
@ApiModelProperty(value = "身份证正面") @ApiModelProperty(value = "身份证正面")
@TableField(typeHandler = FastjsonTypeHandler.class) @TableField(typeHandler = FastjsonTypeHandler.class)
...@@ -126,10 +126,4 @@ public class PeasantHouseholdDto extends BaseDto { ...@@ -126,10 +126,4 @@ public class PeasantHouseholdDto extends BaseDto {
@ApiModelProperty(value = "是否已认证(0-未认证,1-已认证)") @ApiModelProperty(value = "是否已认证(0-未认证,1-已认证)")
private Integer isCertified; private Integer isCertified;
@ApiModelProperty(value = "微信注册账号")
private String loginId;
@ApiModelProperty(value = "微信注册密码")
private String loginPassword;
} }
...@@ -19,15 +19,9 @@ import java.util.List; ...@@ -19,15 +19,9 @@ import java.util.List;
* @date 2023/8/21 13:16 * @date 2023/8/21 13:16
*/ */
@Data @Data
@ApiModel (value="PeasantHouseholdWxDto", description="农户信息") @ApiModel (value="PeasantHouseholdWxDto", description="微信农户登录信息")
public class PeasantHouseholdWxDto { public class PeasantHouseholdWxDto {
@ApiModelProperty (value = "登录方式")
private String loginType;
@ApiModelProperty (value = "验证码登录code")
private String verifyCode;
@ApiModelProperty @ApiModelProperty
private String userState; private String userState;
......
...@@ -143,18 +143,18 @@ public class PeasantHousehold extends BaseEntity { ...@@ -143,18 +143,18 @@ public class PeasantHousehold extends BaseEntity {
/* /*
* 区域公司id * 区域公司id
* */ * */
@TableField("company_id") @TableField("regional_companies_seq")
private String companyId; private String regionalCompaniesSeq;
/* /*
* 区域公司code * 区域公司code
* */ * */
@TableField("company_code") @TableField("regional_companies_code")
private String companyCode; private String regionalCompaniesCode;
/* /*
* 区域公司名称 * 区域公司名称
* */ * */
@TableField("company_name") @TableField("regional_companies_name")
private String companyName; private String regionalCompaniesName;
/* /*
* 身份证正面 * 身份证正面
* */ * */
...@@ -175,15 +175,5 @@ public class PeasantHousehold extends BaseEntity { ...@@ -175,15 +175,5 @@ public class PeasantHousehold extends BaseEntity {
* */ * */
@TableField("is_certified") @TableField("is_certified")
private Integer isCertified; private Integer isCertified;
/*
* 微信注册账号
* */
@TableField("login_id")
private String loginId;
/*
* 微信注册密码
* */
@TableField("login_password")
private String loginPassword;
} }
...@@ -13,7 +13,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest; ...@@ -13,7 +13,7 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.io.InputStream; import java.io.InputStream;
/** /**
* TODO(一句话描述该类的功能) * 农户微信小程序
* *
* @author Provence * @author Provence
* @version v1.0 * @version v1.0
...@@ -41,22 +41,13 @@ public class WxServiceImpl { ...@@ -41,22 +41,13 @@ public class WxServiceImpl {
public JSONObject getCode2Session(String code) { public JSONObject getCode2Session(String code) {
String url = buildOpenIdUrl(appId, secret, code); String url = buildOpenIdUrl(appId, secret, code);
String resultStr = HttpUtil.sendHttpGet(url); String resultStr = HttpUtil.sendHttpGet(url);
ResponeVo responeVo = JSONObject.parseObject(resultStr, ResponeVo.class); // resultStr => {"session_key":"Mj5xbDhcZU73DtUduI1xKg==","openid":"oRraY5aYJkxkDJiG4rBaaw4MSmPA"}
log.error("手机号解析结果" + JSONObject.toJSONString(responeVo)); log.info("微信 Code2Session, code =>{}, 结果 => {}", code, resultStr);
System.out.println("手机号解析结果" + JSONObject.toJSONString(responeVo)); JSONObject jsonObject = JSONObject.parseObject(resultStr);
JSONObject jsonObject = JSONObject.parseObject(responeVo.getContent()); if (jsonObject == null || jsonObject.getIntValue("errcode") != 0) {
if (jsonObject != null) { throw new BadRequest(jsonObject.getString("errmsg"));
int errcode = jsonObject.getIntValue("errcode");
if (errcode == 0) {
// session_key 会话秘钥
// String openId = jsonObject.getString("openid");
return jsonObject;
} else {
throw new BadRequest(jsonObject.getString("errmsg"));
}
} else {
throw new BadRequest("微信接口调用失败");
} }
return jsonObject;
} }
private String buildOpenIdUrl(String appId, String secret, String code) { private String buildOpenIdUrl(String appId, String secret, String code) {
...@@ -73,4 +64,13 @@ public class WxServiceImpl { ...@@ -73,4 +64,13 @@ public class WxServiceImpl {
byte[] inStream; byte[] inStream;
InputStream inputStream; InputStream inputStream;
} }
public String getOpenId(String code) {
JSONObject jsonObject = getCode2Session(code);
String openId = null;
if (jsonObject != null) {
openId = jsonObject.getString("openid");
}
return openId;
}
} }
...@@ -112,9 +112,15 @@ hygf.user.group.id=1679755750924120066 ...@@ -112,9 +112,15 @@ hygf.user.group.id=1679755750924120066
unitInfo.station.examine.planId=51776087-a9cf-4a87-9a03-24fd24a8cf45 unitInfo.station.examine.planId=51776087-a9cf-4a87-9a03-24fd24a8cf45
hygf.sms.tempCodeJXS=SMS_HYGF_0002 hygf.sms.tempCodeJXS=SMS_HYGF_0002
# ============================================= v20230821 add properties =============================================
security.productWeb=AMOS_STUDIO_WEB
security.appKey=AMOS_STUDIO
login.environment= login.environment=dev
security.productWeb= # 光伏农户微信小程序信息
security.appKey=
hygfProgram.appid=wx2188769349b1ddeb hygfProgram.appid=wx2188769349b1ddeb
hygfProgram.secret= hygfProgram.secret=3bfd098cfdac002126e728d2dbf83c0d
\ No newline at end of file # 默认微信小程序农户经销商
farmer.orgCode=86
farmer.sequenceNbr=1620981815542046722
farmer.orgNamesWithoutRole=智信能源科技有限公司
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment