diff --git a/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/controller/NotifyController.java b/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/controller/NotifyController.java new file mode 100644 index 0000000..bec9b88 --- /dev/null +++ b/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/controller/NotifyController.java @@ -0,0 +1,43 @@ +package com.chaozhanggui.admin.system.controller; + +import com.alibaba.fastjson.JSON; +import com.chaozhanggui.merchant.service.HfMerService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.ibatis.annotations.Param; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import java.util.Map; + +@Slf4j +@RestController +@RequiredArgsConstructor +@RequestMapping("/notifyCallback") +public class NotifyController { + + + @Autowired + private HfMerService hfMerService; + + + + @PostMapping("feedCallBack") + public String feedCallBack(HttpServletRequest request) throws Exception { + log.info(JSON.toJSONString(request.getParameterMap())); + String type = request.getParameter("type"); + //验签请参data + String data = request.getParameter("data"); + //验签请参sign + String sign = request.getParameter("sign"); + hfMerService.callBack(type,data,sign); + return "SUCCESS"; + } + + @PostMapping("merchantResident") + public String merchantResident(@RequestParam("userId") String userId){ + hfMerService.merchantResident(userId,null); + return "SUCCESS"; + } +} diff --git a/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/interceptor/LoginInterceptor.java b/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/interceptor/LoginInterceptor.java index 5f8d382..dd4aa4c 100644 --- a/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/interceptor/LoginInterceptor.java +++ b/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/interceptor/LoginInterceptor.java @@ -38,6 +38,11 @@ public class LoginInterceptor implements HandlerInterceptor { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { // 获取进过拦截器的路径 String requestURI = request.getRequestURI(); + + if("/admin/notifyCallback/feedCallBack".equals(requestURI)||"/admin/notifyCallback/merchantResident".equals(requestURI)){ + return true; + } + String loginName=request.getHeader("loginName"); String token=request.getHeader("token"); String userId=request.getHeader("userId"); diff --git a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbBlussBankBranchHfMapper.java b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbBlussBankBranchHfMapper.java new file mode 100644 index 0000000..e616f99 --- /dev/null +++ b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbBlussBankBranchHfMapper.java @@ -0,0 +1,24 @@ +package com.chaozhanggui.dao.system.dao; + +import com.chaozhanggui.dao.system.entity.TbBlussBankBranchHf; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Component; + +@Component +@Mapper +public interface TbBlussBankBranchHfMapper { + int deleteByPrimaryKey(String bankCode); + + int insert(TbBlussBankBranchHf record); + + int insertSelective(TbBlussBankBranchHf record); + + TbBlussBankBranchHf selectByPrimaryKey(String bankCode); + + int updateByPrimaryKeySelective(TbBlussBankBranchHf record); + + int updateByPrimaryKey(TbBlussBankBranchHf record); + + + TbBlussBankBranchHf selectByName(String bankName); +} \ No newline at end of file diff --git a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussCitysHfMapper.java b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussCitysHfMapper.java new file mode 100644 index 0000000..ce0bf3f --- /dev/null +++ b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussCitysHfMapper.java @@ -0,0 +1,24 @@ +package com.chaozhanggui.dao.system.dao; + +import com.chaozhanggui.dao.system.entity.TbPlussCitysHf; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +@Component +@Mapper +public interface TbPlussCitysHfMapper { + int deleteByPrimaryKey(String cityCode); + + int insert(TbPlussCitysHf record); + + int insertSelective(TbPlussCitysHf record); + + TbPlussCitysHf selectByPrimaryKey(String cityCode); + + int updateByPrimaryKeySelective(TbPlussCitysHf record); + + int updateByPrimaryKey(TbPlussCitysHf record); + + TbPlussCitysHf selectByCodeAndParentCode(@Param("cityName") String cityName,@Param("parentCode") String parentCode); +} \ No newline at end of file diff --git a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussMccInfoHfMapper.java b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussMccInfoHfMapper.java new file mode 100644 index 0000000..dff2ef8 --- /dev/null +++ b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussMccInfoHfMapper.java @@ -0,0 +1,15 @@ +package com.chaozhanggui.dao.system.dao; + +import com.chaozhanggui.dao.system.entity.TbPlussMccInfoHf; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Component; + +@Component +@Mapper +public interface TbPlussMccInfoHfMapper { + int insert(TbPlussMccInfoHf record); + + int insertSelective(TbPlussMccInfoHf record); + + TbPlussMccInfoHf selectByMccCode(String mccCode); +} \ No newline at end of file diff --git a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussMerchantAuditRecordMapper.java b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussMerchantAuditRecordMapper.java index 53986a1..347ad19 100644 --- a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussMerchantAuditRecordMapper.java +++ b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussMerchantAuditRecordMapper.java @@ -5,6 +5,8 @@ import com.chaozhanggui.dao.system.entity.TbPlussMerchantAuditRecord; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Component; +import java.util.List; + @Component @Mapper public interface TbPlussMerchantAuditRecordMapper { @@ -19,4 +21,8 @@ public interface TbPlussMerchantAuditRecordMapper { int updateByPrimaryKeySelective(TbPlussMerchantAuditRecord record); int updateByPrimaryKey(TbPlussMerchantAuditRecord record); + + TbPlussMerchantAuditRecord selectByApplicationid(String applicationid); + + List selectByStatus(); } \ No newline at end of file diff --git a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussMerchantHfInfoMapper.java b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussMerchantHfInfoMapper.java new file mode 100644 index 0000000..eb960f7 --- /dev/null +++ b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussMerchantHfInfoMapper.java @@ -0,0 +1,27 @@ +package com.chaozhanggui.dao.system.dao; + +import com.chaozhanggui.dao.system.entity.TbPlussMerchantHfInfo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +@Component +@Mapper +public interface TbPlussMerchantHfInfoMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbPlussMerchantHfInfo record); + + int insertSelective(TbPlussMerchantHfInfo record); + + TbPlussMerchantHfInfo selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbPlussMerchantHfInfo record); + + int updateByPrimaryKey(TbPlussMerchantHfInfo record); + + TbPlussMerchantHfInfo selectByMerchantCodeAndSubApiKey(@Param("merchantCode") String merchantCode,@Param("liveApiKey") String liveApiKey); + + + TbPlussMerchantHfInfo selectByMerchantCode(String merchantCode); +} \ No newline at end of file diff --git a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/TbBlussBankBranchHf.java b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/TbBlussBankBranchHf.java new file mode 100644 index 0000000..8a136c4 --- /dev/null +++ b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/TbBlussBankBranchHf.java @@ -0,0 +1,27 @@ +package com.chaozhanggui.dao.system.entity; + +import java.io.Serializable; + +public class TbBlussBankBranchHf implements Serializable { + private String bankCode; + + private String bankName; + + private static final long serialVersionUID = 1L; + + public String getBankCode() { + return bankCode; + } + + public void setBankCode(String bankCode) { + this.bankCode = bankCode == null ? null : bankCode.trim(); + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName == null ? null : bankName.trim(); + } +} \ No newline at end of file diff --git a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/TbPlussCitysHf.java b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/TbPlussCitysHf.java new file mode 100644 index 0000000..a66996c --- /dev/null +++ b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/TbPlussCitysHf.java @@ -0,0 +1,48 @@ +package com.chaozhanggui.dao.system.entity; + +import java.io.Serializable; +import java.util.Date; + +public class TbPlussCitysHf implements Serializable { + private String cityCode; + + private String cityName; + + private String parentCityCode; + + private Date createTime; + + private static final long serialVersionUID = 1L; + + public String getCityCode() { + return cityCode; + } + + public void setCityCode(String cityCode) { + this.cityCode = cityCode == null ? null : cityCode.trim(); + } + + public String getCityName() { + return cityName; + } + + public void setCityName(String cityName) { + this.cityName = cityName == null ? null : cityName.trim(); + } + + public String getParentCityCode() { + return parentCityCode; + } + + public void setParentCityCode(String parentCityCode) { + this.parentCityCode = parentCityCode == null ? null : parentCityCode.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } +} \ No newline at end of file diff --git a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/TbPlussMccInfoHf.java b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/TbPlussMccInfoHf.java new file mode 100644 index 0000000..44edbcc --- /dev/null +++ b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/TbPlussMccInfoHf.java @@ -0,0 +1,98 @@ +package com.chaozhanggui.dao.system.entity; + +import java.io.Serializable; +import java.util.Date; + +public class TbPlussMccInfoHf implements Serializable { + private String mccCode; + + private String aliClsId; + + private String aliCategoryId; + + private String wxPersonal; + + private String wxBusiness; + + private String mccTxt; + + private String fatherTxt; + + private String grandpaTxt; + + private Date createTime; + + private static final long serialVersionUID = 1L; + + public String getMccCode() { + return mccCode; + } + + public void setMccCode(String mccCode) { + this.mccCode = mccCode == null ? null : mccCode.trim(); + } + + public String getAliClsId() { + return aliClsId; + } + + public void setAliClsId(String aliClsId) { + this.aliClsId = aliClsId == null ? null : aliClsId.trim(); + } + + public String getAliCategoryId() { + return aliCategoryId; + } + + public void setAliCategoryId(String aliCategoryId) { + this.aliCategoryId = aliCategoryId == null ? null : aliCategoryId.trim(); + } + + public String getWxPersonal() { + return wxPersonal; + } + + public void setWxPersonal(String wxPersonal) { + this.wxPersonal = wxPersonal == null ? null : wxPersonal.trim(); + } + + public String getWxBusiness() { + return wxBusiness; + } + + public void setWxBusiness(String wxBusiness) { + this.wxBusiness = wxBusiness == null ? null : wxBusiness.trim(); + } + + public String getMccTxt() { + return mccTxt; + } + + public void setMccTxt(String mccTxt) { + this.mccTxt = mccTxt == null ? null : mccTxt.trim(); + } + + public String getFatherTxt() { + return fatherTxt; + } + + public void setFatherTxt(String fatherTxt) { + this.fatherTxt = fatherTxt == null ? null : fatherTxt.trim(); + } + + public String getGrandpaTxt() { + return grandpaTxt; + } + + public void setGrandpaTxt(String grandpaTxt) { + this.grandpaTxt = grandpaTxt == null ? null : grandpaTxt.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } +} \ No newline at end of file diff --git a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/TbPlussMerchantHfInfo.java b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/TbPlussMerchantHfInfo.java new file mode 100644 index 0000000..9d8db5d --- /dev/null +++ b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/TbPlussMerchantHfInfo.java @@ -0,0 +1,118 @@ +package com.chaozhanggui.dao.system.entity; + +import java.io.Serializable; +import java.util.Date; + +public class TbPlussMerchantHfInfo implements Serializable { + private Integer id; + + private String merchantCode; + + private String status; + + private String testApiKey; + + private String liveApiKey; + + private String appIdList; + + private String appId; + + private String appName; + + private String loginPwd; + + private Date createTime; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getMerchantCode() { + return merchantCode; + } + + public void setMerchantCode(String merchantCode) { + this.merchantCode = merchantCode == null ? null : merchantCode.trim(); + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status == null ? null : status.trim(); + } + + public String getTestApiKey() { + return testApiKey; + } + + public void setTestApiKey(String testApiKey) { + this.testApiKey = testApiKey == null ? null : testApiKey.trim(); + } + + public String getLiveApiKey() { + return liveApiKey; + } + + public void setLiveApiKey(String liveApiKey) { + this.liveApiKey = liveApiKey == null ? null : liveApiKey.trim(); + } + + public String getAppIdList() { + return appIdList; + } + + public void setAppIdList(String appIdList) { + this.appIdList = appIdList == null ? null : appIdList.trim(); + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId == null ? null : appId.trim(); + } + + public String getAppName() { + return appName; + } + + public void setAppName(String appName) { + this.appName = appName == null ? null : appName.trim(); + } + + public String getLoginPwd() { + return loginPwd; + } + + public void setLoginPwd(String loginPwd) { + this.loginPwd = loginPwd == null ? null : loginPwd.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } +} \ No newline at end of file diff --git a/newadmin/dao-api/src/main/resources/generator-mapper/generatorConfig.xml b/newadmin/dao-api/src/main/resources/generator-mapper/generatorConfig.xml index 2ec1c00..a36747d 100644 --- a/newadmin/dao-api/src/main/resources/generator-mapper/generatorConfig.xml +++ b/newadmin/dao-api/src/main/resources/generator-mapper/generatorConfig.xml @@ -21,7 +21,7 @@ + driverClass="com.mysql.cj.jdbc.Driver" password="mysqlroot@123" userId="ysk_test"> @@ -53,7 +53,7 @@ -
diff --git a/newadmin/dao-api/src/main/resources/mapper/TbBlussBankBranchHfMapper.xml b/newadmin/dao-api/src/main/resources/mapper/TbBlussBankBranchHfMapper.xml new file mode 100644 index 0000000..b5862d3 --- /dev/null +++ b/newadmin/dao-api/src/main/resources/mapper/TbBlussBankBranchHfMapper.xml @@ -0,0 +1,63 @@ + + + + + + + + + bank_code, bank_name + + + + delete from tb_pluss_bank_branch_hf + where bank_code = #{bankCode,jdbcType=VARCHAR} + + + insert into tb_pluss_bank_branch_hf (bank_code, bank_name) + values (#{bankCode,jdbcType=VARCHAR}, #{bankName,jdbcType=VARCHAR}) + + + insert into tb_pluss_bank_branch_hf + + + bank_code, + + + bank_name, + + + + + #{bankCode,jdbcType=VARCHAR}, + + + #{bankName,jdbcType=VARCHAR}, + + + + + update tb_pluss_bank_branch_hf + + + bank_name = #{bankName,jdbcType=VARCHAR}, + + + where bank_code = #{bankCode,jdbcType=VARCHAR} + + + update tb_pluss_bank_branch_hf + set bank_name = #{bankName,jdbcType=VARCHAR} + where bank_code = #{bankCode,jdbcType=VARCHAR} + + + + \ No newline at end of file diff --git a/newadmin/dao-api/src/main/resources/mapper/TbPlussCitysHfMapper.xml b/newadmin/dao-api/src/main/resources/mapper/TbPlussCitysHfMapper.xml new file mode 100644 index 0000000..1116a41 --- /dev/null +++ b/newadmin/dao-api/src/main/resources/mapper/TbPlussCitysHfMapper.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + city_code, city_name, parent_city_code, create_time + + + + delete from tb_pluss_citys_hf + where city_code = #{cityCode,jdbcType=VARCHAR} + + + insert into tb_pluss_citys_hf (city_code, city_name, parent_city_code, + create_time) + values (#{cityCode,jdbcType=VARCHAR}, #{cityName,jdbcType=VARCHAR}, #{parentCityCode,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}) + + + insert into tb_pluss_citys_hf + + + city_code, + + + city_name, + + + parent_city_code, + + + create_time, + + + + + #{cityCode,jdbcType=VARCHAR}, + + + #{cityName,jdbcType=VARCHAR}, + + + #{parentCityCode,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + + + update tb_pluss_citys_hf + + + city_name = #{cityName,jdbcType=VARCHAR}, + + + parent_city_code = #{parentCityCode,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + where city_code = #{cityCode,jdbcType=VARCHAR} + + + update tb_pluss_citys_hf + set city_name = #{cityName,jdbcType=VARCHAR}, + parent_city_code = #{parentCityCode,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP} + where city_code = #{cityCode,jdbcType=VARCHAR} + + + + \ No newline at end of file diff --git a/newadmin/dao-api/src/main/resources/mapper/TbPlussMccInfoHfMapper.xml b/newadmin/dao-api/src/main/resources/mapper/TbPlussMccInfoHfMapper.xml new file mode 100644 index 0000000..04645e1 --- /dev/null +++ b/newadmin/dao-api/src/main/resources/mapper/TbPlussMccInfoHfMapper.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + insert into tb_pluss_mcc_info_hf (mcc_code, ali_cls_id, ali_category_id, + wx_personal, wx_business, mcc_txt, + father_txt, grandpa_txt, create_time + ) + values (#{mccCode,jdbcType=VARCHAR}, #{aliClsId,jdbcType=VARCHAR}, #{aliCategoryId,jdbcType=VARCHAR}, + #{wxPersonal,jdbcType=VARCHAR}, #{wxBusiness,jdbcType=VARCHAR}, #{mccTxt,jdbcType=VARCHAR}, + #{fatherTxt,jdbcType=VARCHAR}, #{grandpaTxt,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP} + ) + + + insert into tb_pluss_mcc_info_hf + + + mcc_code, + + + ali_cls_id, + + + ali_category_id, + + + wx_personal, + + + wx_business, + + + mcc_txt, + + + father_txt, + + + grandpa_txt, + + + create_time, + + + + + #{mccCode,jdbcType=VARCHAR}, + + + #{aliClsId,jdbcType=VARCHAR}, + + + #{aliCategoryId,jdbcType=VARCHAR}, + + + #{wxPersonal,jdbcType=VARCHAR}, + + + #{wxBusiness,jdbcType=VARCHAR}, + + + #{mccTxt,jdbcType=VARCHAR}, + + + #{fatherTxt,jdbcType=VARCHAR}, + + + #{grandpaTxt,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + + + + \ No newline at end of file diff --git a/newadmin/dao-api/src/main/resources/mapper/TbPlussMerchantAuditRecordMapper.xml b/newadmin/dao-api/src/main/resources/mapper/TbPlussMerchantAuditRecordMapper.xml index 95cc335..a70f58b 100644 --- a/newadmin/dao-api/src/main/resources/mapper/TbPlussMerchantAuditRecordMapper.xml +++ b/newadmin/dao-api/src/main/resources/mapper/TbPlussMerchantAuditRecordMapper.xml @@ -150,4 +150,12 @@ applicationId = #{applicationid,jdbcType=VARCHAR} where id = #{id,jdbcType=INTEGER} + + + + \ No newline at end of file diff --git a/newadmin/dao-api/src/main/resources/mapper/TbPlussMerchantChannelStatusMapper.xml b/newadmin/dao-api/src/main/resources/mapper/TbPlussMerchantChannelStatusMapper.xml index 7f4c79f..d825c71 100644 --- a/newadmin/dao-api/src/main/resources/mapper/TbPlussMerchantChannelStatusMapper.xml +++ b/newadmin/dao-api/src/main/resources/mapper/TbPlussMerchantChannelStatusMapper.xml @@ -488,7 +488,7 @@ resultType="com.chaozhanggui.dao.system.entity.TbPlussMerchantChannelStatus"> SELECT * FROM tb_pluss_merchant_channel_status WHERE merchantCode=#{merchantCode} - AND channelId=#{channelId} + AND channel=#{channelId} + select + + from tb_pluss_merchant_hf_info + where id = #{id,jdbcType=INTEGER} + + + delete from tb_pluss_merchant_hf_info + where id = #{id,jdbcType=INTEGER} + + + insert into tb_pluss_merchant_hf_info (id, merchant_code, status, + test_api_key, live_api_key, app_id_list, + app_id, app_name, login_pwd, + create_time, update_time) + values (#{id,jdbcType=INTEGER}, #{merchantCode,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, + #{testApiKey,jdbcType=VARCHAR}, #{liveApiKey,jdbcType=VARCHAR}, #{appIdList,jdbcType=VARCHAR}, + #{appId,jdbcType=VARCHAR}, #{appName,jdbcType=VARCHAR}, #{loginPwd,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}) + + + insert into tb_pluss_merchant_hf_info + + + id, + + + merchant_code, + + + status, + + + test_api_key, + + + live_api_key, + + + app_id_list, + + + app_id, + + + app_name, + + + login_pwd, + + + create_time, + + + update_time, + + + + + #{id,jdbcType=INTEGER}, + + + #{merchantCode,jdbcType=VARCHAR}, + + + #{status,jdbcType=VARCHAR}, + + + #{testApiKey,jdbcType=VARCHAR}, + + + #{liveApiKey,jdbcType=VARCHAR}, + + + #{appIdList,jdbcType=VARCHAR}, + + + #{appId,jdbcType=VARCHAR}, + + + #{appName,jdbcType=VARCHAR}, + + + #{loginPwd,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + + + update tb_pluss_merchant_hf_info + + + merchant_code = #{merchantCode,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=VARCHAR}, + + + test_api_key = #{testApiKey,jdbcType=VARCHAR}, + + + live_api_key = #{liveApiKey,jdbcType=VARCHAR}, + + + app_id_list = #{appIdList,jdbcType=VARCHAR}, + + + app_id = #{appId,jdbcType=VARCHAR}, + + + app_name = #{appName,jdbcType=VARCHAR}, + + + login_pwd = #{loginPwd,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_pluss_merchant_hf_info + set merchant_code = #{merchantCode,jdbcType=VARCHAR}, + status = #{status,jdbcType=VARCHAR}, + test_api_key = #{testApiKey,jdbcType=VARCHAR}, + live_api_key = #{liveApiKey,jdbcType=VARCHAR}, + app_id_list = #{appIdList,jdbcType=VARCHAR}, + app_id = #{appId,jdbcType=VARCHAR}, + app_name = #{appName,jdbcType=VARCHAR}, + login_pwd = #{loginPwd,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=INTEGER} + + + + + + \ No newline at end of file diff --git a/newadmin/merchant-service-api/lib/adapay-core-sdk-1.2.10.jar b/newadmin/merchant-service-api/lib/adapay-core-sdk-1.2.10.jar new file mode 100644 index 0000000..7e32682 Binary files /dev/null and b/newadmin/merchant-service-api/lib/adapay-core-sdk-1.2.10.jar differ diff --git a/newadmin/merchant-service-api/lib/adapay-java-sdk-1.2.10.jar b/newadmin/merchant-service-api/lib/adapay-java-sdk-1.2.10.jar new file mode 100644 index 0000000..b3f2186 Binary files /dev/null and b/newadmin/merchant-service-api/lib/adapay-java-sdk-1.2.10.jar differ diff --git a/newadmin/merchant-service-api/lib/adapay-sdk-merchant-1.2.6.jar b/newadmin/merchant-service-api/lib/adapay-sdk-merchant-1.2.6.jar new file mode 100644 index 0000000..092f18d Binary files /dev/null and b/newadmin/merchant-service-api/lib/adapay-sdk-merchant-1.2.6.jar differ diff --git a/newadmin/merchant-service-api/pom.xml b/newadmin/merchant-service-api/pom.xml index 7a8b439..6774431 100644 --- a/newadmin/merchant-service-api/pom.xml +++ b/newadmin/merchant-service-api/pom.xml @@ -17,6 +17,30 @@ UTF-8 + + org.apache.commons + commons-lang3 + 3.6 + + + org.apache.httpcomponents + httpclient + 4.5.2 + + + + org.apache.httpcomponents + httpmime + 4.5.2 + + + + com.alibaba + fastjson + 1.2.48 + + + com.chaozhanggui.system common-api @@ -52,6 +76,33 @@ org.springframework.boot spring-boot-starter-webflux + + + com.huifu.adapay + adapay-sdk-merchant + 1.2.6 + ${project.basedir}/lib/adapay-sdk-merchant-1.2.6.jar + system + + + + + com.huifu.adapay + adapay-core-sdk + 1.2.10 + ${project.basedir}/lib/adapay-core-sdk-1.2.10.jar + system + + + + + com.huifu.adapay + adapay-java-sdk + 1.2.10 + ${project.basedir}/lib/adapay-java-sdk-1.2.10.jar + system + + \ No newline at end of file diff --git a/newadmin/merchant-service-api/src/main/java/com/chaozhanggui/merchant/service/HfMerService.java b/newadmin/merchant-service-api/src/main/java/com/chaozhanggui/merchant/service/HfMerService.java new file mode 100644 index 0000000..0b0d323 --- /dev/null +++ b/newadmin/merchant-service-api/src/main/java/com/chaozhanggui/merchant/service/HfMerService.java @@ -0,0 +1,2807 @@ +package com.chaozhanggui.merchant.service; + + +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.chaozhanggui.common.system.config.MsgException; +import com.chaozhanggui.common.system.util.MD5Util; +import com.chaozhanggui.dao.system.dao.*; +import com.chaozhanggui.dao.system.entity.*; +import com.chaozhanggui.merchant.util.RSAUtils; +import com.chaozhanggui.merchant.util.SnowFlakeUtil; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.huifu.adapay.Adapay; +import com.huifu.adapay.core.AdapayCore; +import com.huifu.adapay.core.exception.BaseAdaPayException; +import com.huifu.adapay.core.util.AdapaySign; +import com.huifu.adapay.merchant.AdapayMerchant; +import com.huifu.adapay.merchant.model.MerchantConfig; +import com.huifu.adapay.merchant.model.MerchantEntry; +import com.huifu.adapay.merchant.model.MerchantResident; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; +import org.springframework.mock.web.MockMultipartFile; +import org.springframework.stereotype.Component; +import org.springframework.web.client.RestTemplate; +import org.springframework.web.multipart.MultipartFile; + +import java.io.*; +import java.net.URI; +import java.net.URISyntaxException; +import java.security.NoSuchAlgorithmException; +import java.util.*; +import java.util.stream.Collectors; + +@Component +@Slf4j +public class HfMerService { + + + + @Autowired + TbPlussAccountMapper tbPlussAccountMapper; + + @Autowired + TbPlussBankCardMapper tbPlussBankCardMapper; + + @Autowired + TbBlussBankBranchHfMapper tbBlussBankBranchHfMapper; + + + @Autowired + TbPlussMerchantChannelStatusMapper tbPlussMerchantChannelStatusMapper; + + + + @Autowired + TbPlussMerchantAuditRecordMapper tbPlussMerchantAuditRecordMapper; + + + @Autowired + TbPlussMerchantHfInfoMapper tbPlussMerchantHfInfoMapper; + + @Autowired + TbPlussMccReflectMapper tbPlussMccReflectMapper; + + + @Autowired + TbPlussMccInfoHfMapper tbPlussMccInfoHfMapper; + + + @Autowired + TbPlussCitysHfMapper tbPlussCitysHfMapper; + + @Autowired + TbPlussMerchantBaseInfoMapper tbPlussMerchantBaseInfoMapper; + + @Autowired + TbPlussIdCardMapper tbPlussIdCardMapper; + + + @Autowired + TbPlussMerchantImageMapper tbPlussMerchantImageMapper; + + + + private static List provList=null; + + + static { + String s="[\n" + + "\t {\n" + + "\t\t\"value\": \"0011\",\n" + + "\t\t\"title\": \"北京市\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1100\",\n" + + "\t\t\t\"title\": \"北京市\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0012\",\n" + + "\t\t\"title\": \"天津市\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1200\",\n" + + "\t\t\t\"title\": \"天津市\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0013\",\n" + + "\t\t\"title\": \"河北省\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1301\",\n" + + "\t\t\t\"title\": \"石家庄\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1302\",\n" + + "\t\t\t\"title\": \"保定\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1303\",\n" + + "\t\t\t\"title\": \"沧州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1304\",\n" + + "\t\t\t\"title\": \"承德\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1305\",\n" + + "\t\t\t\"title\": \"邯郸\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1306\",\n" + + "\t\t\t\"title\": \"衡水\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1307\",\n" + + "\t\t\t\"title\": \"廊坊\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1308\",\n" + + "\t\t\t\"title\": \"秦皇岛\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1309\",\n" + + "\t\t\t\"title\": \"唐山\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1310\",\n" + + "\t\t\t\"title\": \"邢台\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1311\",\n" + + "\t\t\t\"title\": \"张家口\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0014\",\n" + + "\t\t\"title\": \"山西省\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1401\",\n" + + "\t\t\t\"title\": \"太原\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1402\",\n" + + "\t\t\t\"title\": \"长治\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1403\",\n" + + "\t\t\t\"title\": \"大同\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1404\",\n" + + "\t\t\t\"title\": \"晋城\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1405\",\n" + + "\t\t\t\"title\": \"离石\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1406\",\n" + + "\t\t\t\"title\": \"临汾\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1407\",\n" + + "\t\t\t\"title\": \"朔州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1408\",\n" + + "\t\t\t\"title\": \"忻州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1409\",\n" + + "\t\t\t\"title\": \"阳泉\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1410\",\n" + + "\t\t\t\"title\": \"榆次\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1411\",\n" + + "\t\t\t\"title\": \"运城\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1412\",\n" + + "\t\t\t\"title\": \"晋中\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1413\",\n" + + "\t\t\t\"title\": \"吕梁\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0015\",\n" + + "\t\t\"title\": \"内蒙古自治区\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1501\",\n" + + "\t\t\t\"title\": \"呼和浩特\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1502\",\n" + + "\t\t\t\"title\": \"包头\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1503\",\n" + + "\t\t\t\"title\": \"阿拉善\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1504\",\n" + + "\t\t\t\"title\": \"巴彦淖尔\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1505\",\n" + + "\t\t\t\"title\": \"赤峰\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1506\",\n" + + "\t\t\t\"title\": \"呼伦贝尔\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1507\",\n" + + "\t\t\t\"title\": \"乌海\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1508\",\n" + + "\t\t\t\"title\": \"乌兰察布\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1509\",\n" + + "\t\t\t\"title\": \"锡林郭勒\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1510\",\n" + + "\t\t\t\"title\": \"兴安\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1511\",\n" + + "\t\t\t\"title\": \"鄂尔多斯\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1512\",\n" + + "\t\t\t\"title\": \"通辽\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"1513\",\n" + + "\t\t\t\"title\": \"满洲里\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0021\",\n" + + "\t\t\"title\": \"辽宁省\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2101\",\n" + + "\t\t\t\"title\": \"沈阳\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2102\",\n" + + "\t\t\t\"title\": \"大连\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2103\",\n" + + "\t\t\t\"title\": \"鞍山\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2104\",\n" + + "\t\t\t\"title\": \"本溪\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2105\",\n" + + "\t\t\t\"title\": \"朝阳\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2106\",\n" + + "\t\t\t\"title\": \"丹东\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2107\",\n" + + "\t\t\t\"title\": \"抚顺\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2108\",\n" + + "\t\t\t\"title\": \"阜新\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2109\",\n" + + "\t\t\t\"title\": \"葫芦岛\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2110\",\n" + + "\t\t\t\"title\": \"锦州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2111\",\n" + + "\t\t\t\"title\": \"辽阳\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2112\",\n" + + "\t\t\t\"title\": \"盘锦\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2113\",\n" + + "\t\t\t\"title\": \"铁岭\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2114\",\n" + + "\t\t\t\"title\": \"营口\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0022\",\n" + + "\t\t\"title\": \"吉林省\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2201\",\n" + + "\t\t\t\"title\": \"长春\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2202\",\n" + + "\t\t\t\"title\": \"白城\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2203\",\n" + + "\t\t\t\"title\": \"白山\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2204\",\n" + + "\t\t\t\"title\": \"吉林\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2205\",\n" + + "\t\t\t\"title\": \"辽源\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2206\",\n" + + "\t\t\t\"title\": \"四平\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2207\",\n" + + "\t\t\t\"title\": \"松原\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2208\",\n" + + "\t\t\t\"title\": \"通化\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2209\",\n" + + "\t\t\t\"title\": \"延边\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0023\",\n" + + "\t\t\"title\": \"黑龙江省\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2301\",\n" + + "\t\t\t\"title\": \"哈尔滨\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2302\",\n" + + "\t\t\t\"title\": \"大庆\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2303\",\n" + + "\t\t\t\"title\": \"大兴安岭\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2304\",\n" + + "\t\t\t\"title\": \"鹤岗\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2305\",\n" + + "\t\t\t\"title\": \"黑河\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2306\",\n" + + "\t\t\t\"title\": \"鸡西\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2307\",\n" + + "\t\t\t\"title\": \"佳木斯\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2308\",\n" + + "\t\t\t\"title\": \"牡丹江\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2309\",\n" + + "\t\t\t\"title\": \"七台河\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2310\",\n" + + "\t\t\t\"title\": \"齐齐哈尔\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2311\",\n" + + "\t\t\t\"title\": \"双鸭山\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2312\",\n" + + "\t\t\t\"title\": \"绥化\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"2313\",\n" + + "\t\t\t\"title\": \"伊春\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0031\",\n" + + "\t\t\"title\": \"上海市\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3100\",\n" + + "\t\t\t\"title\": \"上海市\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0032\",\n" + + "\t\t\"title\": \"江苏省\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3201\",\n" + + "\t\t\t\"title\": \"南京\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3202\",\n" + + "\t\t\t\"title\": \"常州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3203\",\n" + + "\t\t\t\"title\": \"淮安\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3204\",\n" + + "\t\t\t\"title\": \"连云港\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3205\",\n" + + "\t\t\t\"title\": \"南通\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3206\",\n" + + "\t\t\t\"title\": \"苏州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3207\",\n" + + "\t\t\t\"title\": \"宿迁\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3208\",\n" + + "\t\t\t\"title\": \"泰州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3209\",\n" + + "\t\t\t\"title\": \"无锡\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3210\",\n" + + "\t\t\t\"title\": \"徐州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3211\",\n" + + "\t\t\t\"title\": \"盐城\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3212\",\n" + + "\t\t\t\"title\": \"扬州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3213\",\n" + + "\t\t\t\"title\": \"镇江\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3214\",\n" + + "\t\t\t\"title\": \"胥浦\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3215\",\n" + + "\t\t\t\"title\": \"昆山\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0033\",\n" + + "\t\t\"title\": \"浙江省\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3301\",\n" + + "\t\t\t\"title\": \"杭州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3302\",\n" + + "\t\t\t\"title\": \"宁波\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3303\",\n" + + "\t\t\t\"title\": \"湖州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3304\",\n" + + "\t\t\t\"title\": \"嘉兴\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3305\",\n" + + "\t\t\t\"title\": \"金华\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3306\",\n" + + "\t\t\t\"title\": \"绍兴\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3307\",\n" + + "\t\t\t\"title\": \"台州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3308\",\n" + + "\t\t\t\"title\": \"温州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3309\",\n" + + "\t\t\t\"title\": \"舟山\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3310\",\n" + + "\t\t\t\"title\": \"衢州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3311\",\n" + + "\t\t\t\"title\": \"丽水\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0034\",\n" + + "\t\t\"title\": \"安徽省\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3401\",\n" + + "\t\t\t\"title\": \"合肥\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3402\",\n" + + "\t\t\t\"title\": \"安庆\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3403\",\n" + + "\t\t\t\"title\": \"蚌埠\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3404\",\n" + + "\t\t\t\"title\": \"巢湖\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3405\",\n" + + "\t\t\t\"title\": \"池州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3406\",\n" + + "\t\t\t\"title\": \"滁州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3407\",\n" + + "\t\t\t\"title\": \"阜阳\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3408\",\n" + + "\t\t\t\"title\": \"淮北\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3409\",\n" + + "\t\t\t\"title\": \"淮南\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3410\",\n" + + "\t\t\t\"title\": \"黄山\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3411\",\n" + + "\t\t\t\"title\": \"六安\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3412\",\n" + + "\t\t\t\"title\": \"马鞍山\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3414\",\n" + + "\t\t\t\"title\": \"铜陵\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3415\",\n" + + "\t\t\t\"title\": \"芜湖\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3416\",\n" + + "\t\t\t\"title\": \"宣城\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3417\",\n" + + "\t\t\t\"title\": \"亳州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3418\",\n" + + "\t\t\t\"title\": \"宿州\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0035\",\n" + + "\t\t\"title\": \"福建省\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3501\",\n" + + "\t\t\t\"title\": \"福州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3502\",\n" + + "\t\t\t\"title\": \"厦门\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3503\",\n" + + "\t\t\t\"title\": \"龙岩\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3504\",\n" + + "\t\t\t\"title\": \"南平\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3505\",\n" + + "\t\t\t\"title\": \"宁德\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3506\",\n" + + "\t\t\t\"title\": \"莆田\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3507\",\n" + + "\t\t\t\"title\": \"泉州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3508\",\n" + + "\t\t\t\"title\": \"三明\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3509\",\n" + + "\t\t\t\"title\": \"漳州\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0036\",\n" + + "\t\t\"title\": \"江西省\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3601\",\n" + + "\t\t\t\"title\": \"南昌\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3602\",\n" + + "\t\t\t\"title\": \"抚州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3603\",\n" + + "\t\t\t\"title\": \"赣州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3604\",\n" + + "\t\t\t\"title\": \"吉安\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3605\",\n" + + "\t\t\t\"title\": \"景德镇\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3606\",\n" + + "\t\t\t\"title\": \"九江\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3607\",\n" + + "\t\t\t\"title\": \"萍乡\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3608\",\n" + + "\t\t\t\"title\": \"上饶\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3609\",\n" + + "\t\t\t\"title\": \"新余\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3610\",\n" + + "\t\t\t\"title\": \"宜春\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3611\",\n" + + "\t\t\t\"title\": \"鹰潭\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0037\",\n" + + "\t\t\"title\": \"山东省\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3701\",\n" + + "\t\t\t\"title\": \"济南\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3702\",\n" + + "\t\t\t\"title\": \"青岛\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3703\",\n" + + "\t\t\t\"title\": \"滨州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3704\",\n" + + "\t\t\t\"title\": \"德州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3705\",\n" + + "\t\t\t\"title\": \"东营\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3706\",\n" + + "\t\t\t\"title\": \"菏泽\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3707\",\n" + + "\t\t\t\"title\": \"济宁\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3708\",\n" + + "\t\t\t\"title\": \"莱芜\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3709\",\n" + + "\t\t\t\"title\": \"聊城\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3710\",\n" + + "\t\t\t\"title\": \"临沂\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3711\",\n" + + "\t\t\t\"title\": \"日照\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3712\",\n" + + "\t\t\t\"title\": \"泰安\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3713\",\n" + + "\t\t\t\"title\": \"威海\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3714\",\n" + + "\t\t\t\"title\": \"潍坊\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3715\",\n" + + "\t\t\t\"title\": \"烟台\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3716\",\n" + + "\t\t\t\"title\": \"枣庄\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"3717\",\n" + + "\t\t\t\"title\": \"淄博\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0041\",\n" + + "\t\t\"title\": \"河南省\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4101\",\n" + + "\t\t\t\"title\": \"郑州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4102\",\n" + + "\t\t\t\"title\": \"安阳\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4103\",\n" + + "\t\t\t\"title\": \"焦作\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4104\",\n" + + "\t\t\t\"title\": \"鹤壁\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4105\",\n" + + "\t\t\t\"title\": \"开封\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4106\",\n" + + "\t\t\t\"title\": \"洛阳\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4107\",\n" + + "\t\t\t\"title\": \"南阳\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4108\",\n" + + "\t\t\t\"title\": \"平顶山\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4109\",\n" + + "\t\t\t\"title\": \"三门峡\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4110\",\n" + + "\t\t\t\"title\": \"商丘\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4111\",\n" + + "\t\t\t\"title\": \"新乡\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4112\",\n" + + "\t\t\t\"title\": \"信阳\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4113\",\n" + + "\t\t\t\"title\": \"许昌\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4114\",\n" + + "\t\t\t\"title\": \"周口\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4115\",\n" + + "\t\t\t\"title\": \"驻马店\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4116\",\n" + + "\t\t\t\"title\": \"漯河\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4117\",\n" + + "\t\t\t\"title\": \"濮阳\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4118\",\n" + + "\t\t\t\"title\": \"济源\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0042\",\n" + + "\t\t\"title\": \"湖北省\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4201\",\n" + + "\t\t\t\"title\": \"武汉\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4202\",\n" + + "\t\t\t\"title\": \"鄂州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4203\",\n" + + "\t\t\t\"title\": \"恩施\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4204\",\n" + + "\t\t\t\"title\": \"黄冈\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4205\",\n" + + "\t\t\t\"title\": \"黄石\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4206\",\n" + + "\t\t\t\"title\": \"荆门\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4207\",\n" + + "\t\t\t\"title\": \"荆州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4208\",\n" + + "\t\t\t\"title\": \"十堰\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4209\",\n" + + "\t\t\t\"title\": \"随州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4210\",\n" + + "\t\t\t\"title\": \"咸宁\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4211\",\n" + + "\t\t\t\"title\": \"襄樊\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4212\",\n" + + "\t\t\t\"title\": \"孝感\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4213\",\n" + + "\t\t\t\"title\": \"神农架\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4214\",\n" + + "\t\t\t\"title\": \"天门\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4215\",\n" + + "\t\t\t\"title\": \"宜昌\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4216\",\n" + + "\t\t\t\"title\": \"三峡\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4217\",\n" + + "\t\t\t\"title\": \"潜江\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4218\",\n" + + "\t\t\t\"title\": \"仙桃\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0043\",\n" + + "\t\t\"title\": \"湖南省\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4301\",\n" + + "\t\t\t\"title\": \"长沙\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4302\",\n" + + "\t\t\t\"title\": \"常德\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4303\",\n" + + "\t\t\t\"title\": \"郴州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4304\",\n" + + "\t\t\t\"title\": \"衡阳\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4305\",\n" + + "\t\t\t\"title\": \"怀化\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4306\",\n" + + "\t\t\t\"title\": \"娄底\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4307\",\n" + + "\t\t\t\"title\": \"邵阳\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4308\",\n" + + "\t\t\t\"title\": \"湘潭\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4309\",\n" + + "\t\t\t\"title\": \"湘西\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4310\",\n" + + "\t\t\t\"title\": \"益阳\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4311\",\n" + + "\t\t\t\"title\": \"永州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4312\",\n" + + "\t\t\t\"title\": \"岳阳\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4313\",\n" + + "\t\t\t\"title\": \"张家界\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4314\",\n" + + "\t\t\t\"title\": \"株洲\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4331\",\n" + + "\t\t\t\"title\": \"吉首\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0044\",\n" + + "\t\t\"title\": \"广东省\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4401\",\n" + + "\t\t\t\"title\": \"广州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4402\",\n" + + "\t\t\t\"title\": \"深圳\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4403\",\n" + + "\t\t\t\"title\": \"潮州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4404\",\n" + + "\t\t\t\"title\": \"东莞\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4405\",\n" + + "\t\t\t\"title\": \"佛山\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4406\",\n" + + "\t\t\t\"title\": \"惠州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4407\",\n" + + "\t\t\t\"title\": \"江门\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4408\",\n" + + "\t\t\t\"title\": \"揭阳\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4409\",\n" + + "\t\t\t\"title\": \"茂名\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4410\",\n" + + "\t\t\t\"title\": \"梅州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4411\",\n" + + "\t\t\t\"title\": \"清远\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4412\",\n" + + "\t\t\t\"title\": \"汕头\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4413\",\n" + + "\t\t\t\"title\": \"汕尾\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4414\",\n" + + "\t\t\t\"title\": \"韶关\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4415\",\n" + + "\t\t\t\"title\": \"阳江\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4416\",\n" + + "\t\t\t\"title\": \"云浮\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4417\",\n" + + "\t\t\t\"title\": \"湛江\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4418\",\n" + + "\t\t\t\"title\": \"肇庆\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4419\",\n" + + "\t\t\t\"title\": \"中山\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4420\",\n" + + "\t\t\t\"title\": \"河源\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4421\",\n" + + "\t\t\t\"title\": \"珠海\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0045\",\n" + + "\t\t\"title\": \"广西壮族自治区\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4501\",\n" + + "\t\t\t\"title\": \"南宁\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4502\",\n" + + "\t\t\t\"title\": \"百色\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4503\",\n" + + "\t\t\t\"title\": \"北海\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4504\",\n" + + "\t\t\t\"title\": \"桂林\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4505\",\n" + + "\t\t\t\"title\": \"河池\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4506\",\n" + + "\t\t\t\"title\": \"柳州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4507\",\n" + + "\t\t\t\"title\": \"梧州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4508\",\n" + + "\t\t\t\"title\": \"玉林\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4509\",\n" + + "\t\t\t\"title\": \"崇左\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4510\",\n" + + "\t\t\t\"title\": \"防城港\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4511\",\n" + + "\t\t\t\"title\": \"贵港\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4512\",\n" + + "\t\t\t\"title\": \"贺州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4513\",\n" + + "\t\t\t\"title\": \"来宾\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4514\",\n" + + "\t\t\t\"title\": \"钦州\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0046\",\n" + + "\t\t\"title\": \"海南省\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4601\",\n" + + "\t\t\t\"title\": \"海口\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4602\",\n" + + "\t\t\t\"title\": \"三亚\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4603\",\n" + + "\t\t\t\"title\": \"白沙\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4604\",\n" + + "\t\t\t\"title\": \"保亭\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4605\",\n" + + "\t\t\t\"title\": \"昌江\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4606\",\n" + + "\t\t\t\"title\": \"澄迈\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4607\",\n" + + "\t\t\t\"title\": \"儋州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4608\",\n" + + "\t\t\t\"title\": \"定安\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4609\",\n" + + "\t\t\t\"title\": \"东方\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4610\",\n" + + "\t\t\t\"title\": \"乐东\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4611\",\n" + + "\t\t\t\"title\": \"临高\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4612\",\n" + + "\t\t\t\"title\": \"陵水\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4613\",\n" + + "\t\t\t\"title\": \"琼海\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4614\",\n" + + "\t\t\t\"title\": \"琼中\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4615\",\n" + + "\t\t\t\"title\": \"屯昌\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4616\",\n" + + "\t\t\t\"title\": \"万宁\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4617\",\n" + + "\t\t\t\"title\": \"文昌\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4618\",\n" + + "\t\t\t\"title\": \"五指山\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"4619\",\n" + + "\t\t\t\"title\": \"洋浦\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0050\",\n" + + "\t\t\"title\": \"重庆市\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5000\",\n" + + "\t\t\t\"title\": \"重庆市\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0051\",\n" + + "\t\t\"title\": \"四川省\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5101\",\n" + + "\t\t\t\"title\": \"成都\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5102\",\n" + + "\t\t\t\"title\": \"巴中\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5103\",\n" + + "\t\t\t\"title\": \"达州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5104\",\n" + + "\t\t\t\"title\": \"德阳\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5105\",\n" + + "\t\t\t\"title\": \"广安\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5106\",\n" + + "\t\t\t\"title\": \"广元\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5107\",\n" + + "\t\t\t\"title\": \"乐山\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5108\",\n" + + "\t\t\t\"title\": \"凉山\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5109\",\n" + + "\t\t\t\"title\": \"眉山\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5110\",\n" + + "\t\t\t\"title\": \"绵阳\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5111\",\n" + + "\t\t\t\"title\": \"南充\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5112\",\n" + + "\t\t\t\"title\": \"内江\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5113\",\n" + + "\t\t\t\"title\": \"攀枝花\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5114\",\n" + + "\t\t\t\"title\": \"遂宁\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5115\",\n" + + "\t\t\t\"title\": \"雅安\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5116\",\n" + + "\t\t\t\"title\": \"宜宾\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5117\",\n" + + "\t\t\t\"title\": \"自贡\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5118\",\n" + + "\t\t\t\"title\": \"泸州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5119\",\n" + + "\t\t\t\"title\": \"阿坝\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5120\",\n" + + "\t\t\t\"title\": \"甘孜\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5121\",\n" + + "\t\t\t\"title\": \"资阳\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0052\",\n" + + "\t\t\"title\": \"贵州省\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5201\",\n" + + "\t\t\t\"title\": \"贵阳\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5202\",\n" + + "\t\t\t\"title\": \"安顺\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5203\",\n" + + "\t\t\t\"title\": \"毕节\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5204\",\n" + + "\t\t\t\"title\": \"六盘水\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5205\",\n" + + "\t\t\t\"title\": \"铜仁\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5206\",\n" + + "\t\t\t\"title\": \"遵义\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5207\",\n" + + "\t\t\t\"title\": \"黔东南\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5208\",\n" + + "\t\t\t\"title\": \"黔南\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5209\",\n" + + "\t\t\t\"title\": \"黔西南\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0053\",\n" + + "\t\t\"title\": \"云南省\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5301\",\n" + + "\t\t\t\"title\": \"昆明\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5302\",\n" + + "\t\t\t\"title\": \"西双版纳\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5303\",\n" + + "\t\t\t\"title\": \"保山\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5304\",\n" + + "\t\t\t\"title\": \"楚雄\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5305\",\n" + + "\t\t\t\"title\": \"大理\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5306\",\n" + + "\t\t\t\"title\": \"德宏\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5307\",\n" + + "\t\t\t\"title\": \"红河\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5308\",\n" + + "\t\t\t\"title\": \"丽江\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5309\",\n" + + "\t\t\t\"title\": \"临沧\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5310\",\n" + + "\t\t\t\"title\": \"怒江\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5311\",\n" + + "\t\t\t\"title\": \"曲靖\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5312\",\n" + + "\t\t\t\"title\": \"思茅\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5313\",\n" + + "\t\t\t\"title\": \"文山\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5314\",\n" + + "\t\t\t\"title\": \"玉溪\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5315\",\n" + + "\t\t\t\"title\": \"昭通\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5316\",\n" + + "\t\t\t\"title\": \"中甸\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5317\",\n" + + "\t\t\t\"title\": \"迪庆州\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0054\",\n" + + "\t\t\"title\": \"西藏自治区\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5401\",\n" + + "\t\t\t\"title\": \"拉萨\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5402\",\n" + + "\t\t\t\"title\": \"阿里\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5403\",\n" + + "\t\t\t\"title\": \"昌都\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5404\",\n" + + "\t\t\t\"title\": \"林芝\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5405\",\n" + + "\t\t\t\"title\": \"那曲\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5406\",\n" + + "\t\t\t\"title\": \"日喀则\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5407\",\n" + + "\t\t\t\"title\": \"山南\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"5424\",\n" + + "\t\t\t\"title\": \"樟木口岸\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0061\",\n" + + "\t\t\"title\": \"陕西省\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6101\",\n" + + "\t\t\t\"title\": \"西安\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6102\",\n" + + "\t\t\t\"title\": \"安康\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6103\",\n" + + "\t\t\t\"title\": \"宝鸡\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6104\",\n" + + "\t\t\t\"title\": \"汉中\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6105\",\n" + + "\t\t\t\"title\": \"商洛\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6106\",\n" + + "\t\t\t\"title\": \"铜川\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6107\",\n" + + "\t\t\t\"title\": \"渭南\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6108\",\n" + + "\t\t\t\"title\": \"咸阳\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6109\",\n" + + "\t\t\t\"title\": \"延安\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6110\",\n" + + "\t\t\t\"title\": \"榆林\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0062\",\n" + + "\t\t\"title\": \"甘肃省\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6201\",\n" + + "\t\t\t\"title\": \"兰州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6202\",\n" + + "\t\t\t\"title\": \"白银\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6203\",\n" + + "\t\t\t\"title\": \"定西\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6204\",\n" + + "\t\t\t\"title\": \"东风\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6205\",\n" + + "\t\t\t\"title\": \"合作\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6206\",\n" + + "\t\t\t\"title\": \"嘉峪关\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6207\",\n" + + "\t\t\t\"title\": \"金昌\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6208\",\n" + + "\t\t\t\"title\": \"酒泉\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6209\",\n" + + "\t\t\t\"title\": \"矿区\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6210\",\n" + + "\t\t\t\"title\": \"临夏\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6211\",\n" + + "\t\t\t\"title\": \"陇南\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6212\",\n" + + "\t\t\t\"title\": \"平凉\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6213\",\n" + + "\t\t\t\"title\": \"庆阳\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6214\",\n" + + "\t\t\t\"title\": \"天水\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6215\",\n" + + "\t\t\t\"title\": \"武威\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6216\",\n" + + "\t\t\t\"title\": \"张掖\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6217\",\n" + + "\t\t\t\"title\": \"甘南州\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0063\",\n" + + "\t\t\"title\": \"青海省\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6301\",\n" + + "\t\t\t\"title\": \"西宁\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6302\",\n" + + "\t\t\t\"title\": \"海东\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6322\",\n" + + "\t\t\t\"title\": \"海北\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6323\",\n" + + "\t\t\t\"title\": \"黄南\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6325\",\n" + + "\t\t\t\"title\": \"海南\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6326\",\n" + + "\t\t\t\"title\": \"果洛\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6327\",\n" + + "\t\t\t\"title\": \"玉树\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6328\",\n" + + "\t\t\t\"title\": \"海西\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0064\",\n" + + "\t\t\"title\": \"宁夏回族自治区\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6401\",\n" + + "\t\t\t\"title\": \"银川\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6402\",\n" + + "\t\t\t\"title\": \"中卫\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6403\",\n" + + "\t\t\t\"title\": \"固原\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6404\",\n" + + "\t\t\t\"title\": \"石嘴山\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6405\",\n" + + "\t\t\t\"title\": \"吴忠\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"0065\",\n" + + "\t\t\"title\": \"新疆维吾尔自治区\",\n" + + "\t\t\"cities\": [\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6501\",\n" + + "\t\t\t\"title\": \"乌鲁木齐\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6502\",\n" + + "\t\t\t\"title\": \"阿克苏\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6503\",\n" + + "\t\t\t\"title\": \"阿勒泰\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6504\",\n" + + "\t\t\t\"title\": \"巴州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6505\",\n" + + "\t\t\t\"title\": \"博州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6506\",\n" + + "\t\t\t\"title\": \"昌吉\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6507\",\n" + + "\t\t\t\"title\": \"哈密\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6508\",\n" + + "\t\t\t\"title\": \"和田\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6509\",\n" + + "\t\t\t\"title\": \"喀什\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6510\",\n" + + "\t\t\t\"title\": \"克拉玛依\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6511\",\n" + + "\t\t\t\"title\": \"马兰\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6512\",\n" + + "\t\t\t\"title\": \"石河子\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6513\",\n" + + "\t\t\t\"title\": \"塔城\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6514\",\n" + + "\t\t\t\"title\": \"吐鲁番\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6515\",\n" + + "\t\t\t\"title\": \"伊犁\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6516\",\n" + + "\t\t\t\"title\": \"克州\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6517\",\n" + + "\t\t\t\"title\": \"阿拉尔\"\n" + + "\t\t },\n" + + "\t\t {\n" + + "\t\t\t\"value\": \"6518\",\n" + + "\t\t\t\"title\": \"五家渠\"\n" + + "\t\t }\n" + + "\t\t]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"2003\",\n" + + "\t\t\"title\": \"台湾省\",\n" + + "\t\t\"cities\": [{\n" + + "\t\t\t\"value\": \"9903\",\n" + + "\t\t\t\"title\": \"台湾省\"\n" + + "\t\t}]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"2001\",\n" + + "\t\t\"title\": \"香港特别行政区\",\n" + + "\t\t\"cities\": [{\n" + + "\t\t\t\"value\": \"9901\",\n" + + "\t\t\t\"title\": \"香港特别行政区\"\n" + + "\t\t}]\n" + + "\t },\n" + + "\t {\n" + + "\t\t\"value\": \"2002\",\n" + + "\t\t\"title\": \"澳门特别行政区\",\n" + + "\t\t\"cities\": [{\n" + + "\t\t \"value\": \"9902\",\n" + + "\t\t \"title\": \"澳门特别行政区\"\n" + + "\t\t}]\n" + + "\t }\n" + + "\t]"; + + provList=JSON.parseArray(s,Prov.class); + + + + + + + } + + + public static void init(){ + /** + * debug 模式,开启后有详细的日志 + */ + Adapay.debug = true; + + /** + * prodMode 模式,默认为生产模式,false可以使用mock模式 + */ + Adapay.prodMode = true; + + /** + * 初始化商户配置,服务器启动前,必须通过该方式初始化商户配置完成 + * apiKey为prod模式的API KEY + * mockApiKey为mock模式的API KEY + * rsaPrivateKey为商户发起请求时,用于请求参数加签所需要的RSA私钥 + */ + String apiKey = "api_live_c5fbe553-0680-436a-a457-3252fc841697"; + String mockApiKey = "api_test_ecb5e50f-c1bc-4854-af2d-eee4b98bcf6f"; + String rsaPrivateKey = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAImujrgtJxw2Qm5TXNiRF4WuoYmyr37vpFX/LK4VUb0Qp7darJbNqNGvGBxbYmUccsKrAGyAJPwra71BtBEfTDsg4w0RO/6Wk4qx32ZHEaxpqYTLuOujUMvorL5AVr/SAlUtRlzwz82q4yQZxchYRGXlj3OP8iq1FzdXUxv+UeyjAgMBAAECgYAk7R04Blwr892DS3ZmWxus7fZDQRpSeCFiMysfkXY3uATTZ01MsOHrQwO7b0MHjUa2MTjO4NuKina97qZFxVgjSuByVrxkib+QY4vdqCL2I+tKH6qMSYlom0g8ybGWZrqQm2CzMFzf+ub4bpkJxINQ+7zjDsrRa5Lgk9B2xHkvoQJBAMG4hH7GWS67gYdpsTFtxbQiTrlreLAYJjwbaOhvpPiH3JaooPRcdceALe42eMZDAn5Mrg1jaA7/eM1iVMDXljMCQQC18fY9c1dHmLyOF3yaeVM+0kLrAyf//67xDV0QROYXo998vsIhpbeFm0cRTsjp4uXIq4W1KBAkBw0aqtEK/3/RAkBdl7czxMKrqF3BPZglSGK/T9/3B2xsr44xdhCuU9pBVOqHQ3tX9B/XPh9yupCJQTDAMm3Y/BD3RghoOjy2WrIvAkAGN0kBWnJt6MLwW88O+/wjFk3g94+jSFnytFEsoB34Ssn02hOJ0L6PWvm3lqh4jR7qlymPQdojUPZapeFUbdwxAkEAo+UYAbvDe1ewHpVtnbxMpWmtJeLRg8PlNhFfQjwfuaTOyyiuZU1pPtwUXjHsb4zqoA1QMR5vu0C0s2IpP8dljQ=="; + + MerchantConfig config = new MerchantConfig(); + config.setApiKey(apiKey); + config.setApiMockKey(mockApiKey); + config.setRSAPrivateKey(rsaPrivateKey); + config.setDeviceId("hfpay001"); + + try { + AdapayMerchant.initWithMerConfig(config); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + public void feed(TbPlussMerchantBaseInfo baseInfo, TbPlussMerchantChannelStatus channelStatus){ + + + TbPlussAccount account= tbPlussAccountMapper.selectByUser(baseInfo.getUserid(),"D1"); + MsgException.checkNull(account,"结算信息未提交"); + + + TbPlussBankCard bankCard= tbPlussBankCardMapper.selectByPrimaryKey(Integer.valueOf(account.getBankcardid())); + MsgException.checkNull(bankCard, "结算卡信息未提交"); + + + TbPlussIdCard idCard=tbPlussIdCardMapper.selectCertByUserId(baseInfo.getUserid(),baseInfo.getMerchanttype().equals("3")?"03":"01"); + MsgException.checkNull(idCard, "商户基本信息不完整"); + + + + init(); + String requestId= SnowFlakeUtil.nextId().toString(); + + Map keyMap = null; + try { + keyMap = RSAUtils.genKeyPair(); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + } + String publicKey=keyMap.get(0); + String privateKey=keyMap.get(1); + log.info("公钥:{}",publicKey); + log.info("私钥:{}",privateKey); + + Map merchantEntryParams = new HashMap<>(10); + merchantEntryParams.put("request_id", requestId);//请求流水号 + merchantEntryParams.put("usr_phone", baseInfo.getContactmobile());//注册手机号 + merchantEntryParams.put("cont_name", baseInfo.getContactname()); //联系人姓名 + merchantEntryParams.put("cont_phone", baseInfo.getContactmobile());//联系人电话 + merchantEntryParams.put("customer_email", "hphshiwo@outlook.com");//邮箱 + if("3".equals(baseInfo.getMerchanttype())){ + merchantEntryParams.put("mer_name", baseInfo.getBussauthname()); //商户名,小微商户填负责人姓名 + merchantEntryParams.put("license_code", baseInfo.getBussauthnum());//营业执照编码,如三证合一传三证合一码,企业时必填 + }else { + merchantEntryParams.put("mer_name", baseInfo.getContactname()); //商户名,小微商户填负责人姓名 + } + + merchantEntryParams.put("mer_short_name", baseInfo.getAlias());//简称 + + StringBuffer startSb = new StringBuffer(); + StringBuffer endSb = new StringBuffer(); + + if(baseInfo.getMerchanttype().equals("3")){ + if (baseInfo.getBussauthstarttime().contains("年")||baseInfo.getBussauthstarttime().contains("-")) { + startSb.append(baseInfo.getBussauthstarttime().substring(0, 4)); + startSb.append(baseInfo.getBussauthstarttime().substring(5, 7)); + startSb.append(baseInfo.getBussauthstarttime().substring(8, 10)); + } else { + startSb.append(baseInfo.getBussauthstarttime()); + } + + if (ObjectUtil.isEmpty(baseInfo.getBussauthendtime()) || "长期".equals(baseInfo.getBuslictype())) { + endSb.append("20991231"); + } else { + if (baseInfo.getBussauthendtime().contains("年")||baseInfo.getBussauthendtime().contains("-")) { + endSb.append(baseInfo.getBussauthendtime().substring(0, 4)); + endSb.append(baseInfo.getBussauthendtime().substring(5, 7)); + endSb.append(baseInfo.getBussauthendtime().substring(8, 10)); + } else { + endSb.append(baseInfo.getBussauthendtime()); + } + + } + + + merchantEntryParams.put("reg_addr", baseInfo.getBussauthaddress());//注册地址 + merchantEntryParams.put("cust_addr", baseInfo.getBussauthaddress());//经营地址 + merchantEntryParams.put("cust_tel", baseInfo.getPrincipalmobile()); //商户电话 + + + merchantEntryParams.put("mer_start_valid_date", startSb); //商户有效日期(始),格式 YYYYMMDD (若开户企业类商户,必填) + merchantEntryParams.put("mer_valid_date", endSb);// 商户有效日期(至) + merchantEntryParams.put("legal_name", baseInfo.getPrincipalperson()); //法人/负责人 姓名 + merchantEntryParams.put("legal_type", "0"); //法人/负责人证件类型,0-身份证 + merchantEntryParams.put("legal_idno", baseInfo.getPrincipalcertno()); //法人/负责人证件号码 + merchantEntryParams.put("legal_mp", baseInfo.getPrincipalmobile()); //法人/负责人手机号 + }else { + + + merchantEntryParams.put("reg_addr", baseInfo.getProvince().concat(baseInfo.getCity()).concat(baseInfo.getDistrict()).concat(baseInfo.getAddress()));//注册地址 + merchantEntryParams.put("cust_addr",baseInfo.getProvince().concat(baseInfo.getCity()).concat(baseInfo.getDistrict()).concat(baseInfo.getAddress()));//经营地址 + merchantEntryParams.put("cust_tel", baseInfo.getContactmobile()); //商户电话 + + + merchantEntryParams.put("legal_name", baseInfo.getContactname()); //法人/负责人 姓名 + merchantEntryParams.put("legal_type", "0"); //法人/负责人证件类型,0-身份证 + merchantEntryParams.put("legal_idno", idCard.getCertno()); //法人/负责人证件号码 + merchantEntryParams.put("legal_mp", baseInfo.getContactmobile()); //法人/负责人手机号 + } + + + + merchantEntryParams.put("legal_start_cert_id_expires", idCard.getCertstarttime());//法人/负责人身份证有效期(始),格式 YYYYMMDD + merchantEntryParams.put("legal_id_expires", idCard.getCertendtime()); //法人/负责人身份证有效期(至),格式 YYYYMMDD + merchantEntryParams.put("card_id_mask", bankCard.getBankcardno());//结算银行卡号 + + + TbBlussBankBranchHf blussBankBranchHf= tbBlussBankBranchHfMapper.selectByName(bankCard.getBankname()); + MsgException.checkNull(blussBankBranchHf,"对应的银行信息不存在"); + merchantEntryParams.put("bank_code", blussBankBranchHf.getBankCode()); //结算银行卡所属银行code + merchantEntryParams.put("card_name", bankCard.getBankholder()); //结算银行卡开户姓名 + merchantEntryParams.put("bank_acct_type", bankCard.getAccounttype().equals("01")?"2":"1");//1对公、2对私 + Prov prov=provList.stream().filter(p->p.getTitle().startsWith(bankCard.getBranchprovince())).collect(Collectors.toList()).get(0); + merchantEntryParams.put("prov_code", prov.getValue()); //结算银行卡省份编码 + + if(bankCard.getBranchcity().endsWith("市")){ + bankCard.setBranchcity(bankCard.getBranchcity().substring(0,bankCard.getBranchcity().length()-1)); + } + + Cities cities= prov.getCities().stream().filter(t->t.getTitle().startsWith(bankCard.getBranchcity())).collect(Collectors.toList()).get(0); + merchantEntryParams.put("area_code", cities.getValue()); //结算银行卡地区编码 + merchantEntryParams.put("rsa_public_key", keyMap.get(0));//商户RSA公钥 + + merchantEntryParams.put("entry_mer_type", baseInfo.getMerchanttype().equals("3")?"1":"2");//1-企业;2-小微。默认为企业 + merchantEntryParams.put("notify_url", "https://p40312246f.goho.co/admin/notifyCallback/feedCallBack"); + merchantEntryParams.put("fee_rate_list","[{\n" + + " \"rate_channel\": \"wx_pub_online\",\n" + + " \"fee_rate\": \"0.007\"\n" + + "}, {\n" + + " \"rate_channel\": \"wx_pub_offline\",\n" + + " \"fee_rate\": \"0.0036\"\n" + + "}, {\n" + + " \"rate_channel\": \"wx_lite_online\",\n" + + " \"fee_rate\": \"0.007\"\n" + + "}, {\n" + + " \"rate_channel\": \"wx_lite_offline\",\n" + + " \"fee_rate\": \"0.0036\"\n" + + "}, {\n" + + " \"rate_channel\": \"wx_scan\",\n" + + " \"fee_rate\": \"0.0036\"\n" + + "}, {\n" + + " \"rate_channel\": \"alipay_qr_online\",\n" + + " \"fee_rate\": \"0.007\"\n" + + "}, {\n" + + " \"rate_channel\": \"alipay_qr_offline\",\n" + + " \"fee_rate\": \"0.0036\"\n" + + "}, {\n" + + " \"rate_channel\": \"alipay_scan\",\n" + + " \"fee_rate\": \"0.0036\"\n" + + "}, {\n" + + " \"rate_channel\": \"alipay_lite_online\",\n" + + " \"fee_rate\": \"0.007\"\n" + + "}, {\n" + + " \"rate_channel\": \"alipay_lite_offline\",\n" + + " \"fee_rate\": \"0.0036\"\n" + + "}, {\n" + + " \"rate_channel\": \"alipay_call\",\n" + + " \"fee_rate\": \"0.007\"\n" + + "}, {\n" + + " \"rate_channel\": \"union_qr_under\",\n" + + " \"fee_rate\": \"0.0065\"\n" + + "}, {\n" + + " \"rate_channel\": \"union_qr_beyond\",\n" + + " \"fee_rate\": \"0.0065\"\n" + + "}, {\n" + + " \"rate_channel\": \"union\",\n" + + " \"fee_rate\": \"0.007\"\n" + + "}]"); + + log.info("开户进件merchantEntryParams="+ JSON.toJSONString(merchantEntryParams)); + Map merchantEntry = null; + try { + merchantEntry = MerchantEntry.create(merchantEntryParams); + log.info("response:{}", JSON.toJSONString(merchantEntry)); + if(ObjectUtil.isNotEmpty(merchantEntry)&&"pending".equals(merchantEntry.get("status").toString())){ + channelStatus.setChannel(7); + channelStatus.setUpdatetime(new Date()); + channelStatus.setMerchantcode(baseInfo.getMerchantcode()); + channelStatus.setStatus("1"); + channelStatus.setThirdstatus("-100"); + channelStatus.setCallbackstatus("0"); + channelStatus.setRemark("汇付审核中"); + + if(ObjectUtil.isEmpty(channelStatus.getId())){ + channelStatus.setCreatetime(new Date()); + tbPlussMerchantChannelStatusMapper.insert(channelStatus); + }else { + channelStatus.setUpdatetime(new Date()); + channelStatus.setMercname(null); + tbPlussMerchantChannelStatusMapper.updateByPrimaryKeySelective(channelStatus); + } + + TbPlussMerchantAuditRecord merchantAuditRecord = new TbPlussMerchantAuditRecord(); + merchantAuditRecord.setStatus("1"); + merchantAuditRecord.setMerchantcode(baseInfo.getMerchantcode()); + merchantAuditRecord.setChannel(7); + merchantAuditRecord.setThirdstatus("0"); + merchantAuditRecord.setApplicationid(merchantEntry.get("request_id").toString()); + merchantAuditRecord.setCreatetime(new Date()); + tbPlussMerchantAuditRecordMapper.insert(merchantAuditRecord); + } + } catch (BaseAdaPayException e) { + e.printStackTrace(); + } + + } + + + + public void callBack(String type,String data,String sign){ + + + String publicKey= AdapayCore.PUBLIC_KEY; + + try { + Map map=(Map) JSON.parse(data); + + String requestId=map.get("request_id").toString(); + if(AdapaySign.verifySign(data,sign,publicKey)){ + switch (type){ + case "userEntry.succeeded": + TbPlussMerchantAuditRecord record= tbPlussMerchantAuditRecordMapper.selectByApplicationid(requestId); + if(ObjectUtil.isNotEmpty(record)){ + TbPlussMerchantChannelStatus channelStatus= tbPlussMerchantChannelStatusMapper.selectByMerchantCode(record.getMerchantcode(),7); + TbPlussMerchantHfInfo tbPlussMerchantHfInfo=tbPlussMerchantHfInfoMapper.selectByMerchantCodeAndSubApiKey(channelStatus.getMerchantcode(),map.get("live_api_key").toString()); + if(ObjectUtil.isNotEmpty(channelStatus)){ + if(ObjectUtil.isEmpty(tbPlussMerchantHfInfo)){ + tbPlussMerchantHfInfo=new TbPlussMerchantHfInfo(); + tbPlussMerchantHfInfo.setMerchantCode(record.getMerchantcode()); + tbPlussMerchantHfInfo.setTestApiKey(map.get("test_api_key").toString()); + tbPlussMerchantHfInfo.setLiveApiKey(map.get("live_api_key").toString()); + List app_id_list = (List) map.get("app_id_list"); + tbPlussMerchantHfInfo.setAppIdList(JSON.toJSONString(app_id_list)); + Map app = (Map) app_id_list.get(0); + tbPlussMerchantHfInfo.setAppId(app.get("app_id").toString()); + tbPlussMerchantHfInfo.setAppName(app.get("app_name").toString()); + tbPlussMerchantHfInfo.setStatus("1"); //开户成功 + tbPlussMerchantHfInfo.setLoginPwd(MD5Util.md5("hf".concat(map.get("login_pwd").toString()))); + tbPlussMerchantHfInfo.setCreateTime(new Date()); + tbPlussMerchantHfInfoMapper.insert(tbPlussMerchantHfInfo); + + channelStatus.setMerchantid(map.get("live_api_key").toString()); + channelStatus.setApplicationid(requestId); + channelStatus.setUpdatetime(new Date()); + channelStatus.setMercname(null); + tbPlussMerchantChannelStatusMapper.updateByPrimaryKeySelective(channelStatus); + + TbPlussMerchantBaseInfo baseInfo= tbPlussMerchantBaseInfoMapper.selectByMerchantcode(channelStatus.getMerchantcode()); + if(ObjectUtil.isNotEmpty(baseInfo)){ + merchantResident(baseInfo,tbPlussMerchantHfInfo.getLiveApiKey(),tbPlussMerchantHfInfo.getAppId(),tbPlussMerchantHfInfo); + } + } + + + + + record.setStatus("9"); + record.setUpdatetime(new Date()); + + + } + } + break; + case "userEntry.failed": + record= tbPlussMerchantAuditRecordMapper.selectByApplicationid(requestId); + if(ObjectUtil.isNotEmpty(record)){ + TbPlussMerchantChannelStatus channelStatus= tbPlussMerchantChannelStatusMapper.selectByMerchantCode(record.getMerchantcode(),7); + if(ObjectUtil.isNotEmpty(channelStatus)){ + channelStatus.setStatus("2"); + channelStatus.setRemark(map.get("error_msg").toString()); + channelStatus.setMercname(null); + tbPlussMerchantChannelStatusMapper.updateByPrimaryKeySelective(channelStatus); + } + } + break; + case "resident.succeeded": + record= tbPlussMerchantAuditRecordMapper.selectByApplicationid(requestId); + if(ObjectUtil.isNotEmpty(record)&&!"5".equals(record.getThirdstatus())){ + TbPlussMerchantHfInfo hfInfo= tbPlussMerchantHfInfoMapper.selectByMerchantCodeAndSubApiKey(record.getMerchantcode(),record.getMerchantid()); + + hfInfo.setStatus("3"); //入驻成功 + hfInfo.setUpdateTime(new Date()); + tbPlussMerchantHfInfoMapper.updateByPrimaryKey(hfInfo); + + + + record.setThirdstatus("5"); + record.setUpdatetime(new Date()); + tbPlussMerchantAuditRecordMapper.updateByPrimaryKeySelective(record); + + + + //上传证照 + TbPlussMerchantBaseInfo baseInfo= tbPlussMerchantBaseInfoMapper.selectByMerchantcode(record.getMerchantcode()); + if(ObjectUtil.isNotEmpty(baseInfo)){ + map=new HashMap<>(); + TbPlussAccount account= tbPlussAccountMapper.selectByUser(baseInfo.getUserid(),"D1"); + MsgException.checkNull(account,"结算信息未提交"); + + TbPlussBankCard bankCard= tbPlussBankCardMapper.selectByPrimaryKey(Integer.valueOf(account.getBankcardid())); + MsgException.checkNull(bankCard, "结算卡信息未提交"); + + TbPlussIdCard idCard=tbPlussIdCardMapper.selectCertByUserId(baseInfo.getUserid(),baseInfo.getMerchanttype().equals("3")?"03":"01"); + MsgException.checkNull(idCard, "商户基本信息不完整"); + + + Map f=HfMerService.fileUpload(idCard.getImgpositive(),"03",record.getMerchantid()); + + if(ObjectUtil.isNotEmpty(f)&&"succeeded".equals(f.get("status"))){ + map.put("legalCertIdBackId",f.get("pic_id")); + } + + + Map z=HfMerService.fileUpload(idCard.getImgnegative(),"02",record.getMerchantid()); + + if(ObjectUtil.isNotEmpty(z)&&"succeeded".equals(z.get("status"))){ + map.put("legalCertIdFrontId",z.get("pic_id")); + } + + Map cz=null; + + Map yyzz=null; + + if(baseInfo.getMerchanttype().equals("3")){ + + TbPlussMerchantImage image= tbPlussMerchantImageMapper.selectByMerchantCodeType(baseInfo.getMerchantcode(),"03"); + MsgException.checkNull(image, "营业执照不存在"); + + yyzz= HfMerService.fileUpload(idCard.getImgpositive(),"02",record.getMerchantid()); + + if(ObjectUtil.isNotEmpty(yyzz)&&"succeeded".equals(yyzz.get("status"))){ + map.put("socialCreditCodeId",yyzz.get("pic_id")); + } + + cz=HfMerService.fileUpload(bankCard.getLicenseurl(),"05",record.getMerchantid()); + yyzz=HfMerService.fileUpload(image.getPicUrl1(),"01",record.getMerchantid()); + }else { + cz=HfMerService.fileUpload(bankCard.getImgurl(),"05",record.getMerchantid()); + StringBuffer sb=new StringBuffer(); + TbPlussMerchantImage image =tbPlussMerchantImageMapper.selectByMerchantCodeType(baseInfo.getMerchantcode(),"06"); + MsgException.checkNull(image, "门头照片不存在"); + Map mtz=HfMerService.fileUpload(image.getPicurl(),"04",record.getMerchantid()); + if(ObjectUtil.isNotEmpty(mtz)&&"succeeded".equals(mtz.get("status"))){ + sb.append(mtz.get("pic_id")); + } + image =tbPlussMerchantImageMapper.selectByMerchantCodeType(baseInfo.getMerchantcode(),"09"); + MsgException.checkNull(image, "商铺内部照片不存在"); + Map mtzz=HfMerService.fileUpload(image.getPicurl(),"04",record.getMerchantid()); + if(ObjectUtil.isNotEmpty(mtzz)&&"succeeded".equals(mtzz.get("status"))){ + sb.append("|"); + sb.append(mtzz.get("pic_id")); + } + + image =tbPlussMerchantImageMapper.selectByMerchantCodeType(baseInfo.getMerchantcode(),"08"); + MsgException.checkNull(image, "收银台照片不存在"); + Map mtzzzz=HfMerService.fileUpload(idCard.getImgnegative(),"04",record.getMerchantid()); + if(ObjectUtil.isNotEmpty(mtzzzz)&&"succeeded".equals(mtzzzz.get("status"))){ + sb.append("|"); + sb.append(mtzzzz.get("pic_id")); + } + if(ObjectUtil.isNotEmpty(sb)){ + map.put("storeId",sb.toString()); + } + } + + if(ObjectUtil.isNotEmpty(cz)&&"succeeded".equals(cz.get("status"))){ + map.put("accountOpeningPermitId",cz.get("pic_id")); + } + + if(ObjectUtil.isNotEmpty(yyzz)&&"succeeded".equals(yyzz.get("status"))){ + map.put("socialCreditCodeId",yyzz.get("pic_id")); + + } + + log.info("request:{}",JSON.toJSONString(map)); + Map response= commitUpload(map,record.getMerchantid()); + if(ObjectUtil.isNotEmpty(response)&&(response.get("audit_status").equals("I")&&"p".equals(response.get("audit_status")))){ + + hfInfo.setStatus("4"); //商户证照一提交 + hfInfo.setUpdateTime(new Date()); + tbPlussMerchantHfInfoMapper.updateByPrimaryKey(hfInfo); + + record.setThirdstatus("5"); + record.setUpdatetime(new Date()); + tbPlussMerchantAuditRecordMapper.updateByPrimaryKeySelective(record); + +// if(response.get("audit_status").equals("P")){ +// //提交实名 +// } + } + } + } + break; + case "resident.failed": + record= tbPlussMerchantAuditRecordMapper.selectByApplicationid(requestId); + if(ObjectUtil.isNotEmpty(record)){ + TbPlussMerchantHfInfo hfInfo= tbPlussMerchantHfInfoMapper.selectByMerchantCodeAndSubApiKey(record.getMerchantcode(),record.getMerchantid()); + + hfInfo.setStatus("4"); //入驻失败 + hfInfo.setUpdateTime(new Date()); + tbPlussMerchantHfInfoMapper.updateByPrimaryKey(hfInfo); + } + break; + case "resident.modify.succeeded": + break; + case "resident.modify.failed": + break; + case "corp_member.succeeded": + break; + case "corp_member.failed": + break; + case "corp_member_update.succeeded": + break; + case "corp_member_update.failed": + break; + } + } + } catch (Exception e) { + throw new RuntimeException(e); + } + + } + + + +// public void authUser(){ +// String requestId= SnowFlakeUtil.nextId().toString(); +// +// } + + + public void merchantResident(String userId,String merchantcode){ + TbPlussMerchantBaseInfo baseInfo=null; + if(ObjectUtil.isNotEmpty(userId)){ + baseInfo=tbPlussMerchantBaseInfoMapper.selectByUserId(userId); + } + + if(ObjectUtil.isNotEmpty(merchantcode)){ + baseInfo=tbPlussMerchantBaseInfoMapper.selectByMerchantcode(merchantcode); + } + + MsgException.checkNull(baseInfo,"商户基本信息不存在"); + + TbPlussMerchantHfInfo hfInfo= tbPlussMerchantHfInfoMapper.selectByMerchantCode(baseInfo.getMerchantcode()); + MsgException.checkNull(hfInfo,"商户未进件"); + this.merchantResident(baseInfo,hfInfo.getLiveApiKey(),hfInfo.getAppId(),hfInfo); + } + + + + + public void merchantResident(TbPlussMerchantBaseInfo baseInfo,String sub_Api_Key,String app_id,TbPlussMerchantHfInfo tbPlussMerchantHfInfo){ + + TbPlussMccReflect tbPlussMccReflect= tbPlussMccReflectMapper.selectByMccCodeAndChannel(baseInfo.getMcc(),"7"); + TbPlussMccInfoHf tbPlussMccInfoHf=null; + if(ObjectUtil.isNotEmpty(tbPlussMccReflect)){ + tbPlussMccInfoHf= tbPlussMccInfoHfMapper.selectByMccCode(tbPlussMccReflect.getMccCode()); + } + + MsgException.checkNull(tbPlussMccInfoHf,"没有对应的mcc码"); + init(); + String requestId= SnowFlakeUtil.nextId().toString(); + Map merchantEntryParams = new HashMap<>(10); + merchantEntryParams.put("request_id", requestId);//测试时每次请求需修改流水 + merchantEntryParams.put("sub_Api_Key", sub_Api_Key);//商户进件后返回的生产或者测试API Key + merchantEntryParams.put("fee_type", "02");//费率01-标准费率线上,02-标准费率线下 + merchantEntryParams.put("app_id", app_id);//商户进件后返回的应用ID + merchantEntryParams.put("wx_category", baseInfo.getMerchanttype().equals("3")?tbPlussMccInfoHf.getWxBusiness():tbPlussMccInfoHf.getWxPersonal());//经营类目,请参考微信经营类目表 企业758 小微商户770 + merchantEntryParams.put("alipay_category", tbPlussMccInfoHf.getAliCategoryId());//经营类目,请参考支付宝经营类目表 综合零售2015091000052157 + merchantEntryParams.put("cls_id", tbPlussMccInfoHf.getAliClsId());//行业分类,支付宝必填 综合零售5399 + merchantEntryParams.put("model_type", 1);//入驻模式,1-服务商模式 + merchantEntryParams.put("mer_type", baseInfo.getMerchanttype().equals("3")?"3":baseInfo.getMerchanttype().equals("2")?"2":"8");//商户种类 3-私营企业 8-小微 + + + + TbPlussCitysHf province= tbPlussCitysHfMapper.selectByCodeAndParentCode(baseInfo.getProvince(),"0"); + + merchantEntryParams.put("province_code",province.getCityCode() );//省份编码 上海310000 + + TbPlussCitysHf city= tbPlussCitysHfMapper.selectByCodeAndParentCode(baseInfo.getCity(),province.getCityCode()); + merchantEntryParams.put("city_code", city.getCityCode());//城市编码 上海310100 + + + TbPlussCitysHf district_code= tbPlussCitysHfMapper.selectByCodeAndParentCode(baseInfo.getDistrict(),city.getCityCode()); + merchantEntryParams.put("district_code", district_code.getCityCode());//区县编码 黄埔310101 + + merchantEntryParams.put("add_value_list", " {\"wx_lite\":{\"appid\":\"wxfc7bd92a462eb191\"},\"wx_scan\":\"\", \"alipay\":\"\",\"alipay_wap\":\"\",\"alipay_lite\":\"\",\"alipay_qr\":\"\",\"alipay_scan\":\"\"}"); + merchantEntryParams.put("notify_url","https://p40312246f.goho.co/admin/notifyCallback/feedCallBack"); + + //调用sdk商户配置方法,得到商户配置返回对象 + Map merchantResident = null; + try { + merchantResident = MerchantResident.create(merchantEntryParams); + if(ObjectUtil.isNotEmpty(merchantResident)){ + TbPlussMerchantAuditRecord merchantAuditRecord = new TbPlussMerchantAuditRecord(); + merchantAuditRecord.setStatus("1"); + merchantAuditRecord.setMerchantcode(baseInfo.getMerchantcode()); + merchantAuditRecord.setChannel(7); + merchantAuditRecord.setMerchantid(sub_Api_Key); + merchantAuditRecord.setThirdstatus("1"); + merchantAuditRecord.setApplicationid(requestId); + merchantAuditRecord.setCreatetime(new Date()); + tbPlussMerchantAuditRecordMapper.insert(merchantAuditRecord); + + + tbPlussMerchantHfInfo.setStatus("2"); //商户入驻待审核 + tbPlussMerchantHfInfo.setUpdateTime(new Date()); + tbPlussMerchantHfInfoMapper.updateByPrimaryKey(tbPlussMerchantHfInfo); + } + + + + } catch (BaseAdaPayException e) { + e.printStackTrace(); + } + log.info("商户入驻merchant config result=" + JSON.toJSONString(merchantResident)); + } + + + + public void queryMerchantResident(){ + List records= tbPlussMerchantAuditRecordMapper.selectByStatus(); + if(ObjectUtil.isEmpty(records)){ + log.info("没有待查询的入驻信息"); + return; + } + for (TbPlussMerchantAuditRecord record : records) { + + } + } + + + + + + public void queryResident(String requestId){ + +// MerchantResident.query() + } + + + + + + @SneakyThrows + public static Map fileUpload(String url, String type, String subApiKey) { + + URI uri = null; + try { + uri = new URI(url); + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } + RestTemplate restTemplate1 = new RestTemplate(); + ResponseEntity exchange = restTemplate1.exchange(uri, HttpMethod.GET, null, byte[].class); + MultipartFile file1 = new MockMultipartFile("file", exchange.getBody()); + File file = convert(file1); + + init(); + Map request = new HashMap<>(10); + request.put("subApiKey",subApiKey); + request.put("fileType",type); + + Map map= MerchantResident.uploadProfilePic(file,request); + log.info("type:{},response:{}",type,JSON.toJSONString(map)); + return map; + } + + + public static Map commitUpload(Map map,String subApiKey){ + Map request = new HashMap<>(10); + request.put("subApiKey", subApiKey);//商户子apiKey + if(map.containsKey("socialCreditCodeId")){ + request.put("socialCreditCodeId",map.get("socialCreditCodeId"));//统一社会信用代码图片ID + } + + request.put("legalCertIdFrontId", map.get("legalCertIdFrontId"));//法人身份证正面图片ID + request.put("legalCertIdBackId",map.get("legalCertIdBackId"));//法人身份证反面图片ID +// request.put("businessAdd", "http://www.baidu.com");//线上业务网址或者商城地址 + if(map.containsKey("storeId")){ + request.put("storeId", map.get("storeId"));//门店图片ID + } + + request.put("accountOpeningPermitId", map.get("accountOpeningPermitId"));//开户许可证图片 + + Map merchantResident = null; + try { + merchantResident = MerchantResident.auditProfileInfo(request); + } catch (BaseAdaPayException e) { + e.printStackTrace(); + } + log.info("商户证照merchant resident modify result=" + JSON.toJSONString(merchantResident)); + return merchantResident; + } + + + + + + + public static File convert(MultipartFile multipartFile) throws IOException { + InputStream inputStream = multipartFile.getInputStream(); + File file = File.createTempFile(ObjectUtil.isEmpty(multipartFile.getOriginalFilename()) ? System.currentTimeMillis() + "" : multipartFile.getOriginalFilename(), ".png"); + FileOutputStream outputStream = new FileOutputStream(file); + byte[] buffer = new byte[1024]; + int bytesRead = 0; + while ((bytesRead = inputStream.read(buffer)) != -1) { + outputStream.write(buffer, 0, bytesRead); + } + outputStream.close(); + file.deleteOnExit(); + return file; + } + + + + static class Prov{ + private String title; + private String value; + + private List cities; + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public List getCities() { + return cities; + } + + public void setCities(List cities) { + this.cities = cities; + } + } + + static class Cities{ + + private String title; + private String value; + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + } + + + public static void writer(String content){ + BufferedWriter out=null; + try { + out=new BufferedWriter(new OutputStreamWriter(new FileOutputStream("C:\\Users\\admin\\Desktop\\city.sql",true))); + out.write(content); + } catch (FileNotFoundException e) { + throw new RuntimeException(e); + } catch (IOException e) { + throw new RuntimeException(e); + }finally { + if(out!=null){ + try { + out.close(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + } + + + } + public static void main(String[] args) { +// +// File file=new File("C:\\Users\\admin\\Desktop\\6666.json"); +// ObjectMapper objectMapper=new ObjectMapper(); +// try { +// Map map= objectMapper.readValue(file,Map.class); +// Iterator> iterator= map.entrySet().iterator(); +// String parentCode=null; +// while(iterator.hasNext()){ +// Map.Entry entity=iterator.next(); +// Map t= (Map) entity.getValue(); +// Iterator> iterators= t.entrySet().iterator(); +// while (iterators.hasNext()){ +// Map.Entry e=iterators.next(); +// if(e.getValue() instanceof String){ //省份 +// parentCode =e.getValue().toString(); +// StringBuffer sb=new StringBuffer(); +// sb.append("INSERT INTO `tb_pluss_citys_hf` (`city_code`, `city_name`, `parent_city_code`, `create_time`) VALUES ("); +// sb.append("'"+e.getValue()+"'"); +// sb.append(","); +// sb.append("'"+entity.getKey()+"'"); +// sb.append(","); +// sb.append("'"+0+"'"); +// sb.append(", now());"); +// HfMerService.writer(sb.toString()); +// HfMerService.writer("\n"); +// +// }else if(e.getValue() instanceof LinkedHashMap){ +// Map c= (Map) e.getValue(); +// Iterator> ic= c.entrySet().iterator(); +// while (ic.hasNext()){ +// String CityParentCode=null; +// Map.Entry mc=ic.next(); +// Map cit= (Map) mc.getValue(); +// Iterator> citi= cit.entrySet().iterator(); +// while(citi.hasNext()){ +// ; +// Map.Entry mccc=citi.next(); +// +// if(mccc.getValue() instanceof String){ +// CityParentCode=mccc.getValue().toString(); +// StringBuffer sb=new StringBuffer(); +// sb.append("INSERT INTO `tb_pluss_citys_hf` (`city_code`, `city_name`, `parent_city_code`, `create_time`) VALUES ("); +// sb.append("'"+mccc.getValue()+"'"); +// sb.append(","); +// sb.append("'"+mc.getKey()+"'"); +// sb.append(","); +// sb.append("'"+parentCode+"'"); +// sb.append(", now());"); +// HfMerService.writer(sb.toString()); +// HfMerService.writer("\n"); +// +// }else if(mccc.getValue() instanceof LinkedHashMap){ +// Map dd= (Map) mccc.getValue();; +// Iterator> ddi= dd.entrySet().iterator(); +// while (ddi.hasNext()){ +// Map.Entry dddd=ddi.next(); +// if(dddd.getValue() instanceof String){ +// +// StringBuffer sb=new StringBuffer(); +// sb.append("INSERT INTO `tb_pluss_citys_hf` (`city_code`, `city_name`, `parent_city_code`, `create_time`) VALUES ("); +// sb.append("'"+dddd.getValue()+"'"); +// sb.append(","); +// sb.append("'"+dddd.getKey()+"'"); +// sb.append(","); +// sb.append("'"+CityParentCode+"'"); +// sb.append(", now());"); +// HfMerService.writer(sb.toString()); +// HfMerService.writer("\n"); +// }else if(dddd.getValue() instanceof LinkedHashMap){ +// Map ttttt= (Map) dddd.getValue(); +// System.out.println("dd:"+dddd.getKey()+">>name:"+dddd.getValue()); +// } +// +// +// } +// +// } +// } +// +// } +// } +// } +// } +// +// System.out.println("执行完成"); +// } catch (IOException e) { +// throw new RuntimeException(e); +// } + +// init(); +// String requestId= SnowFlakeUtil.nextId().toString(); +// +// Map keyMap = null; +// try { +// keyMap = RSAUtils.genKeyPair(); +// } catch (NoSuchAlgorithmException e) { +// e.printStackTrace(); +// } +// log.info("公钥:" + keyMap.get(0)); +// log.info("私钥:" + keyMap.get(1)); +// +// Map merchantEntryParams = new HashMap<>(10); +// merchantEntryParams.put("request_id", requestId);//请求流水号 +// merchantEntryParams.put("usr_phone", "15668897172");//注册手机号 +// merchantEntryParams.put("cont_name", "蔺佳佳"); //联系人姓名 +// merchantEntryParams.put("cont_phone", "15668897171");//联系人电话 +// merchantEntryParams.put("customer_email", "hphshiwo@outlook.com");//邮箱 +// merchantEntryParams.put("mer_name", "蔺佳佳"); //商户名,小微商户填负责人姓名 +// merchantEntryParams.put("mer_short_name", "进件小能手");//简称 +//// merchantEntryParams.put("license_code", "91610131MA6TXACP28");//营业执照编码,如三证合一传三证合一码,企业时必填 +// merchantEntryParams.put("reg_addr", "陕西省西安市高新区科技路37号海星城市广场B座2002-080室");//注册地址 +// merchantEntryParams.put("cust_addr", "陕西省西安市高新区科技路37号海星城市广场B座2002-080室");//经营地址 +// merchantEntryParams.put("cust_tel", "15668897171"); //商户电话 +//// merchantEntryParams.put("mer_start_valid_date", "20151208"); //商户有效日期(始),格式 YYYYMMDD (若开户企业类商户,必填) +//// merchantEntryParams.put("mer_valid_date", "20991231");// 商户有效日期(至) +// merchantEntryParams.put("legal_name", "蔺佳佳"); //法人/负责人 姓名 +// merchantEntryParams.put("legal_type", "0"); //法人/负责人证件类型,0-身份证 +// merchantEntryParams.put("legal_idno", "612501199212187875"); //法人/负责人证件号码 +// merchantEntryParams.put("legal_mp", "15668897171"); //法人/负责人手机号 +// merchantEntryParams.put("legal_start_cert_id_expires", "20190201");//法人/负责人身份证有效期(始),格式 YYYYMMDD +// merchantEntryParams.put("legal_id_expires", "20390201"); //法人/负责人身份证有效期(至),格式 YYYYMMDD +// merchantEntryParams.put("card_id_mask", "6230200212918366");//结算银行卡号 +// merchantEntryParams.put("bank_code", "03040000"); //结算银行卡所属银行code +// merchantEntryParams.put("card_name", "蔺佳佳"); //结算银行卡开户姓名 +// merchantEntryParams.put("bank_acct_type", "2");//1对公、2对私 +// merchantEntryParams.put("prov_code", "0061"); //结算银行卡省份编码 +// merchantEntryParams.put("area_code", "6101"); //结算银行卡地区编码 +// merchantEntryParams.put("rsa_public_key", keyMap.get(0));//商户RSA公钥 +// merchantEntryParams.put("entry_mer_type", 2);//1-企业;2-小微。默认为企业 +// merchantEntryParams.put("notify_url", "https://p40312246f.goho.co//admin/notifyCallback/feedCallBack"); +// merchantEntryParams.put("fee_rate_list","[{\n" + +// " \"rate_channel\": \"wx_pub_online\",\n" + +// " \"fee_rate\": \"0.007\"\n" + +// "}, {\n" + +// " \"rate_channel\": \"wx_pub_offline\",\n" + +// " \"fee_rate\": \"0.0036\"\n" + +// "}, {\n" + +// " \"rate_channel\": \"wx_lite_online\",\n" + +// " \"fee_rate\": \"0.007\"\n" + +// "}, {\n" + +// " \"rate_channel\": \"wx_lite_offline\",\n" + +// " \"fee_rate\": \"0.0036\"\n" + +// "}, {\n" + +// " \"rate_channel\": \"wx_scan\",\n" + +// " \"fee_rate\": \"0.0036\"\n" + +// "}, {\n" + +// " \"rate_channel\": \"alipay_qr_online\",\n" + +// " \"fee_rate\": \"0.007\"\n" + +// "}, {\n" + +// " \"rate_channel\": \"alipay_qr_offline\",\n" + +// " \"fee_rate\": \"0.0036\"\n" + +// "}, {\n" + +// " \"rate_channel\": \"alipay_scan\",\n" + +// " \"fee_rate\": \"0.0036\"\n" + +// "}, {\n" + +// " \"rate_channel\": \"alipay_lite_online\",\n" + +// " \"fee_rate\": \"0.007\"\n" + +// "}, {\n" + +// " \"rate_channel\": \"alipay_lite_offline\",\n" + +// " \"fee_rate\": \"0.0036\"\n" + +// "}, {\n" + +// " \"rate_channel\": \"alipay_call\",\n" + +// " \"fee_rate\": \"0.007\"\n" + +// "}, {\n" + +// " \"rate_channel\": \"union_qr_under\",\n" + +// " \"fee_rate\": \"0.0065\"\n" + +// "}, {\n" + +// " \"rate_channel\": \"union_qr_beyond\",\n" + +// " \"fee_rate\": \"0.0065\"\n" + +// "}, {\n" + +// " \"rate_channel\": \"union\",\n" + +// " \"fee_rate\": \"0.007\"\n" + +// "}]"); +// +// log.info("开户进件merchantEntryParams="+ JSON.toJSONString(merchantEntryParams)); +// Map merchantEntry = null; +// try { +// merchantEntry = MerchantEntry.create(merchantEntryParams); +// log.info("response:{}", JSON.toJSONString(merchantEntry)); +// } catch (BaseAdaPayException e) { +// e.printStackTrace(); +// } + + + +// Map merchantEntryParams = new HashMap<>(10); +// merchantEntryParams.put("request_id", requestId);//测试时每次请求需修改流水 +// merchantEntryParams.put("sub_Api_Key", "api_live_b98e6ea4-ef6d-4565-8c79-47aa8a61d6b6");//商户进件后返回的生产或者测试API Key +// merchantEntryParams.put("fee_type", "01");//费率01-标准费率线上,02-标准费率线下 +// merchantEntryParams.put("app_id", "app_71663e98-69ac-43bf-92e7-624eab429a92");//商户进件后返回的应用ID +// merchantEntryParams.put("wx_category", "770");//经营类目,请参考微信经营类目表 企业758 小微商户770 +// merchantEntryParams.put("alipay_category", "2016062900190337");//经营类目,请参考支付宝经营类目表 综合零售2015091000052157 +// merchantEntryParams.put("cls_id", "5969");//行业分类,支付宝必填 综合零售5399 +// merchantEntryParams.put("model_type", 1);//入驻模式,1-服务商模式 +// merchantEntryParams.put("mer_type", "8");//商户种类 3-私营企业 8-小微 +// merchantEntryParams.put("province_code","610000" );//省份编码 上海310000 +// merchantEntryParams.put("city_code", "610100");//城市编码 上海310100 +// merchantEntryParams.put("district_code", "610112");//区县编码 黄埔310101 +// +// merchantEntryParams.put("add_value_list", " {\"wx_lite\":{\"appid\":\"wxfc7bd92a462eb191\"},\"wx_scan\":\"\", \"alipay\":\"\",\"alipay_wap\":\"\",\"alipay_lite\":\"\",\"alipay_qr\":\"\",\"alipay_scan\":\"\"}"); +// merchantEntryParams.put("notify_url","https://p40312246f.goho.co/admin/notifyCallback/feedCallBack"); +// +// //调用sdk商户配置方法,得到商户配置返回对象 +// Map merchantResident = null; +// try { +// merchantResident = MerchantResident.create(merchantEntryParams); +// } catch (BaseAdaPayException e) { +// e.printStackTrace(); +// } +// log.info("商户入驻merchant config result=" + JSON.toJSONString(merchantResident)); + + + + + +// +// Map request = new HashMap<>(10); +// request.put("subApiKey", "");//商户子apiKey +// request.put("socialCreditCodeId", license.getSocialCreditCodeId());//统一社会信用代码图片ID +// request.put("legalCertIdFrontId", license.getLegalCertIdFrontId());//法人身份证正面图片ID +// request.put("legalCertIdBackId", license.getLegalCertIdBackId());//法人身份证反面图片ID +// request.put("businessAdd", "http://www.baidu.com");//线上业务网址或者商城地址 +// request.put("storeId", license.getStoreId());//门店图片ID +// request.put("accountOpeningPermitId", license.getAccountOpeningPermitId());//开户许可证图片 +// +// +// Map merchantResident = null; +// try { +// merchantResident = MerchantResident.auditProfileInfo(request); +// } catch (BaseAdaPayException e) { +// e.printStackTrace(); +// } +// log.info("商户证照merchant resident modify result=" + JSON.toJSONString(merchantResident)); + + Map map=new HashMap<>(); + + Map z= HfMerService.fileUpload("https://czg-oss.oss-cn-hangzhou.aliyuncs.com/images/66c50670c9c948a9ab79c1e9fe63022b.png?Expires=2013671665&OSSAccessKeyId=LTAI5tPdEfYSZcqHbjCrtPRD&Signature=k86Ait9W7xhEKuG5NHbVanOoZ5g%3D","02","api_live_75bea44d-aaf0-4ee5-a388-7edd7348b5bb"); + + if(ObjectUtil.isNotEmpty(z)&&"succeeded".equals(z.get("status"))){ + map.put("legalCertIdFrontId",z.get("pic_id")); + } + + Map f=HfMerService.fileUpload("https://czg-oss.oss-cn-hangzhou.aliyuncs.com/images/1130d3e64fa64e419832b20c37b936e9.png?Expires=2013671696&OSSAccessKeyId=LTAI5tPdEfYSZcqHbjCrtPRD&Signature=JxIBKn3RMqPgm147wWJgG%2FtArhk%3D","03","api_live_75bea44d-aaf0-4ee5-a388-7edd7348b5bb"); + + if(ObjectUtil.isNotEmpty(f)&&"succeeded".equals(f.get("status"))){ + map.put("legalCertIdBackId",f.get("pic_id")); + } + + Map cz=HfMerService.fileUpload("https://czg-oss.oss-cn-hangzhou.aliyuncs.com/images/d0324999aa1c4c03858a075d8617ab21.png?Expires=2013671786&OSSAccessKeyId=LTAI5tPdEfYSZcqHbjCrtPRD&Signature=3vfGGKAsc2XSMa13vrgaQPnf9pU%3D","05","api_live_75bea44d-aaf0-4ee5-a388-7edd7348b5bb"); + + if(ObjectUtil.isNotEmpty(cz)&&"succeeded".equals(cz.get("status"))){ + map.put("accountOpeningPermitId",cz.get("pic_id")); + } + + Map response= commitUpload(map,"api_live_75bea44d-aaf0-4ee5-a388-7edd7348b5bb"); + + System.out.println(JSON.toJSONString(response)); + } + + + + + + + +} diff --git a/newadmin/merchant-service-api/src/main/java/com/chaozhanggui/merchant/service/MerchantService.java b/newadmin/merchant-service-api/src/main/java/com/chaozhanggui/merchant/service/MerchantService.java index 8058fd1..bcfee02 100644 --- a/newadmin/merchant-service-api/src/main/java/com/chaozhanggui/merchant/service/MerchantService.java +++ b/newadmin/merchant-service-api/src/main/java/com/chaozhanggui/merchant/service/MerchantService.java @@ -40,6 +40,9 @@ public class MerchantService { @Resource private TbPlussNoticeMapper tbPlussNoticeMapper; + @Autowired + HfMerService hfMerService; + /** * 通用进件方法 * @param userId @@ -105,6 +108,9 @@ public class MerchantService { case "6": ysAuditServiceV3.merchantAuditV3(userId,false, Integer.valueOf(channelId)); break; + case "7": + hfMerService.feed(baseInfo,channelStatus); + break; default: MsgException.throwException("未知的进件通道"); } diff --git a/newadmin/merchant-service-api/src/main/java/com/chaozhanggui/merchant/util/RSAUtils.java b/newadmin/merchant-service-api/src/main/java/com/chaozhanggui/merchant/util/RSAUtils.java new file mode 100644 index 0000000..4315783 --- /dev/null +++ b/newadmin/merchant-service-api/src/main/java/com/chaozhanggui/merchant/util/RSAUtils.java @@ -0,0 +1,115 @@ +package com.chaozhanggui.merchant.util; + +import javax.crypto.Cipher; +import java.security.*; +import java.security.interfaces.RSAPrivateKey; +import java.security.interfaces.RSAPublicKey; +import java.security.spec.PKCS8EncodedKeySpec; +import java.security.spec.X509EncodedKeySpec; +import java.util.Base64; +import java.util.HashMap; +import java.util.Map; + +/** + * Java RSA 加密工具类 + * + */ +public class RSAUtils { + /** + * 密钥长度 于原文长度对应 以及越长速度越慢 + */ + private final static int KEY_SIZE = 1024; + /** + * 用于封装随机产生的公钥与私钥 + */ + private static Map keyMap = new HashMap(); + + /** + * 随机生成密钥对 + */ + public static Map genKeyPair() throws NoSuchAlgorithmException { + // KeyPairGenerator类用于生成公钥和私钥对,基于RSA算法生成对象 + KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance("RSA"); + // 初始化密钥对生成器 + keyPairGen.initialize(KEY_SIZE, new SecureRandom()); + // 生成一个密钥对,保存在keyPair中 + KeyPair keyPair = keyPairGen.generateKeyPair(); + // 得到私钥 + RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate(); + // 得到公钥 + RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic(); + String publicKeyString = Base64.getEncoder().encodeToString(publicKey.getEncoded()); + // 得到私钥字符串 + String privateKeyString = Base64.getEncoder().encodeToString(privateKey.getEncoded()); + // 将公钥和私钥保存到Map + //0表示公钥 + keyMap.put(0, publicKeyString); + //1表示私钥 + keyMap.put(1, privateKeyString); + + return keyMap; + } + + /** + * RSA公钥加密 + * + * @param str 加密字符串 + * @param publicKey 公钥 + * @return 密文 + * @throws Exception 加密过程中的异常信息 + */ + public static String encrypt(String str, String publicKey) throws Exception { + //base64编码的公钥 + byte[] decoded = Base64.getDecoder().decode(publicKey); + RSAPublicKey pubKey = (RSAPublicKey) KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(decoded)); + //RSA加密 + Cipher cipher = Cipher.getInstance("RSA"); + cipher.init(Cipher.ENCRYPT_MODE, pubKey); + String outStr = Base64.getEncoder().encodeToString(cipher.doFinal(str.getBytes("UTF-8"))); + return outStr; + } + + /** + * RSA私钥解密 + * + * @param str 加密字符串 + * @param privateKey 私钥 + * @return 明文 + * @throws Exception 解密过程中的异常信息 + */ + public static String decrypt(String str, String privateKey) throws Exception { + //64位解码加密后的字符串 + byte[] inputByte = Base64.getDecoder().decode(str); + //base64编码的私钥 + byte[] decoded = Base64.getDecoder().decode(privateKey); + RSAPrivateKey priKey = (RSAPrivateKey) KeyFactory.getInstance("RSA").generatePrivate(new PKCS8EncodedKeySpec(decoded)); + //RSA解密 + Cipher cipher = Cipher.getInstance("RSA"); + cipher.init(Cipher.DECRYPT_MODE, priKey); + String outStr = new String(cipher.doFinal(inputByte)); + return outStr; + } + + public static void main(String[] args) throws Exception { + long temp = System.currentTimeMillis(); + //生成公钥和私钥 + genKeyPair(); + //加密字符串 + System.out.println("公钥:" + keyMap.get(0)); + System.out.println("私钥:" + keyMap.get(1)); + System.out.println("生成密钥消耗时间:" + (System.currentTimeMillis() - temp) / 1000.0 + "秒"); + //客户id + 授权时间 + 所用模块 + String message = "4028138151b3cf300151b419df090007" + "2015-12-17 11:30:22" + "A01,A02"; + System.out.println("原文:" + message); + temp = System.currentTimeMillis(); + //通过原文,和公钥加密。 + String messageEn = encrypt(message, keyMap.get(0)); + System.out.println("密文:" + messageEn); + System.out.println("加密消耗时间:" + (System.currentTimeMillis() - temp) / 1000.0 + "秒"); + temp = System.currentTimeMillis(); + //通过密文,和私钥解密。 + String messageDe = decrypt(messageEn, keyMap.get(1)); + System.out.println("解密:" + messageDe); + System.out.println("解密消耗时间:" + (System.currentTimeMillis() - temp) / 1000.0 + "秒"); + } +} diff --git a/newadmin/merchant-service-api/src/main/java/com/chaozhanggui/merchant/util/SnowFlakeUtil.java b/newadmin/merchant-service-api/src/main/java/com/chaozhanggui/merchant/util/SnowFlakeUtil.java new file mode 100644 index 0000000..5d60ae6 --- /dev/null +++ b/newadmin/merchant-service-api/src/main/java/com/chaozhanggui/merchant/util/SnowFlakeUtil.java @@ -0,0 +1,22 @@ +package com.chaozhanggui.merchant.util; + +import cn.hutool.core.lang.Snowflake; +import cn.hutool.core.util.IdUtil; +import lombok.extern.slf4j.Slf4j; + +/** + * @author Exrickx + */ +@Slf4j +public class SnowFlakeUtil { + + /** + * 派号器workid:0~31 + * 机房datacenterid:0~31 + */ + private static Snowflake snowflake = IdUtil.createSnowflake(1, 1); + + public static Long nextId() { + return snowflake.nextId(); + } +}