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 index 6fab8ca..1cde350 100644 --- 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 @@ -2377,30 +2377,40 @@ public class HfMerService { } - TbPlussMerchantHfInfo hfInfo = new TbPlussMerchantHfInfo(); - JSONObject object=new JSONObject(); - if(ObjectUtil.isNotNull(wxLiteAppId)&&ObjectUtil.isNotEmpty(wxLiteAppId)){ - JSONObject wxlite=new JSONObject(); - wxlite.put("appid",wxLiteAppId); - object.put("wx_lite",wxlite); - } + TbPlussMerchantHfInfo hfInfo= tbPlussMerchantHfInfoMapper.selectByMerchantCode(baseInfo.getMerchantcode()); + if(ObjectUtil.isEmpty(hfInfo)||hfInfo==null){ + hfInfo = new TbPlussMerchantHfInfo(); + JSONObject object=new JSONObject(); + if(ObjectUtil.isNotNull(wxLiteAppId)&&ObjectUtil.isNotEmpty(wxLiteAppId)){ + JSONObject wxlite=new JSONObject(); + wxlite.put("appid",wxLiteAppId); + object.put("wx_lite",wxlite); + } - if(ObjectUtil.isNotNull(wxPubAppId)&&ObjectUtil.isNotEmpty(wxPubAppId) - &&ObjectUtil.isNotNull(wxPubPath)&&ObjectUtil.isNotEmpty(wxPubPath) - ){ - JSONObject wxpub=new JSONObject(); - wxpub.put("appid",wxPubAppId); - wxpub.put("path",wxPubPath); - object.put("wx_pub",wxpub); - } + if(ObjectUtil.isNotNull(wxPubAppId)&&ObjectUtil.isNotEmpty(wxPubAppId) + &&ObjectUtil.isNotNull(wxPubPath)&&ObjectUtil.isNotEmpty(wxPubPath) + ){ + JSONObject wxpub=new JSONObject(); + wxpub.put("appid",wxPubAppId); + wxpub.put("path",wxPubPath); + object.put("wx_pub",wxpub); + } - hfInfo.setMerchantCode(baseInfo.getMerchantcode()); - hfInfo.setStatus("0"); - hfInfo.setPrivKey(privateKey); - hfInfo.setPucKey(publicKey); - hfInfo.setWxInfo(object.toJSONString()); - hfInfo.setCreateTime(new Date()); - tbPlussMerchantHfInfoMapper.insert(hfInfo); + hfInfo.setMerchantCode(baseInfo.getMerchantcode()); + hfInfo.setStatus("0"); + hfInfo.setPrivKey(privateKey); + hfInfo.setPucKey(publicKey); + hfInfo.setWxInfo(ObjectUtil.isEmpty(object)?null:object.toJSONString()); + hfInfo.setCreateTime(new Date()); + tbPlussMerchantHfInfoMapper.insert(hfInfo); + + }else { + hfInfo.setStatus("0"); + hfInfo.setPrivKey(privateKey); + hfInfo.setPucKey(publicKey); + hfInfo.setCreateTime(new Date()); + tbPlussMerchantHfInfoMapper.updateByPrimaryKeySelective(hfInfo); + } TbPlussMerchantAuditRecord merchantAuditRecord = new TbPlussMerchantAuditRecord(); merchantAuditRecord.setStatus("1"); @@ -2662,6 +2672,7 @@ public class HfMerService { String baseUrl = it; StringBuilder sb = new StringBuilder(baseUrl); sb.append("?title=").append(merchantBaseInfo.getAlias()); + sb.append("?type=").append("1"); sb.append("&password=").append(userInfo.getPassword().toLowerCase()); sb.append("&mcc=").append(merchantBaseInfo.getMcc()); sb.append("&mccName=").append(merchantBaseInfo.getMccname()); diff --git a/newadmin/merchant-service-api/src/main/java/com/chaozhanggui/merchant/service/LklAuditService.java b/newadmin/merchant-service-api/src/main/java/com/chaozhanggui/merchant/service/LklAuditService.java index 529bd89..2b1d5ca 100644 --- a/newadmin/merchant-service-api/src/main/java/com/chaozhanggui/merchant/service/LklAuditService.java +++ b/newadmin/merchant-service-api/src/main/java/com/chaozhanggui/merchant/service/LklAuditService.java @@ -107,9 +107,9 @@ public class LklAuditService { object1.put("merType", (baseInfo.getMerchanttype().equals(1) || baseInfo.getMerchanttype().equals("2")) ? "TP_PERSONAL" : "TP_MERCHANT"); //商户注册类型 TP_MERCHANT:企业 TP_PERSONAL:⼩微个⼈ object1.put("merName", baseInfo.getAlias()); //商户名称(经营名称) 不能少于七个中文 object1.put("merAddr", baseInfo.getAddress()); //去掉省,市区后的详细地址 - object1.put("provinceCode", tbPlussRegionLklMapper.selectByName(baseInfo.getProvince())); //省代码 通过【地区信息→获取地区查询】接口获取 对应 code字段 - object1.put("cityCode", tbPlussRegionLklMapper.selectByName(baseInfo.getCity())); // 市代码 通过【地区信息→获取地区查询】接口获取 对应 code字段 - object1.put("countyCode",tbPlussRegionLklMapper.selectByName(baseInfo.getDistrict())); // 区县代码 通过【地区信息→获取地区查询】接口获取 对应 code字段 + object1.put("provinceCode", tbPlussRegionLklMapper.selectByName(baseInfo.getProvince()).getCode()); //省代码 通过【地区信息→获取地区查询】接口获取 对应 code字段 + object1.put("cityCode", tbPlussRegionLklMapper.selectByName(baseInfo.getCity()).getCode()); // 市代码 通过【地区信息→获取地区查询】接口获取 对应 code字段 + object1.put("countyCode",tbPlussRegionLklMapper.selectByName(baseInfo.getDistrict()).getCode()); // 区县代码 通过【地区信息→获取地区查询】接口获取 对应 code字段