Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
5e16125f8a
|
|
@ -75,7 +75,7 @@ public class WxPayController extends BaseController {
|
|||
divMembers.add(new DivMember("C7D101", String.valueOf(financialMaster.getPayMoney()), true));
|
||||
// TODO 订单里需要补充支付金额、tittle、简要描述、分账信息、description
|
||||
PayParam payParam = new PayParam(orderMaster.getCode() + "_" + System.currentTimeMillis(),
|
||||
"0.01", "工圈子居家设备", "工圈子居家设备购买付费");
|
||||
String.valueOf(financialMaster.getPayMoney()), "工圈子居家设备", "工圈子居家设备购买付费");
|
||||
map = adapayService.wxLitePay(orderMaster.getDeptId(), payParam, expend, null, null);
|
||||
} catch (BaseAdaPayException e) {
|
||||
logger.error("获取微信用户信息失败", e);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@ import com.ghy.common.core.controller.BaseController;
|
|||
import com.ghy.common.core.domain.AjaxResult;
|
||||
import com.ghy.common.utils.ExceptionUtil;
|
||||
import com.ghy.common.utils.http.HttpUtils;
|
||||
import com.ghy.framework.web.domain.server.Sys;
|
||||
import com.ghy.system.domain.SysArea;
|
||||
import com.ghy.system.service.ISysAreaService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
|
@ -25,14 +28,38 @@ public class BaiduController extends BaseController {
|
|||
@Autowired
|
||||
private BaiduConfig baiduConfig;
|
||||
|
||||
@Autowired
|
||||
private ISysAreaService iSysAreaService;
|
||||
|
||||
@PostMapping("/getLocation")
|
||||
@ResponseBody
|
||||
public AjaxResult getLocationByLot(@RequestBody JSONObject jsonObject){
|
||||
try {
|
||||
JSONObject json = new JSONObject();
|
||||
|
||||
String location = jsonObject.getString("location");
|
||||
String url = baiduConfig.getUrl().replace("#AK#", baiduConfig.getAk()) + location;
|
||||
String result = HttpUtils.sendGet(url);
|
||||
return AjaxResult.success(result);
|
||||
result = result.replaceAll("\n", "").replaceAll("\t", "");
|
||||
JSONObject resultJson = JSONObject.parseObject(result);
|
||||
if("0".equals(resultJson.getString("status"))){
|
||||
JSONObject addressJson = resultJson.getJSONObject("result").getJSONObject("addressComponent");
|
||||
String provinceName = addressJson.getString("province");
|
||||
logger.info("provinceName :" + provinceName);
|
||||
SysArea provinceArea = iSysAreaService.selectByName(provinceName, "");
|
||||
String cityName = addressJson.getString("city");
|
||||
logger.info("cityName :" + cityName);
|
||||
SysArea cityArea = iSysAreaService.selectByName(cityName, provinceArea.getAreaCode());
|
||||
String countryName = addressJson.getString("district");
|
||||
logger.info("countryName :" + countryName);
|
||||
SysArea countryArea = iSysAreaService.selectByName(countryName, cityArea.getAreaCode());
|
||||
json.put("provinceArea", provinceArea);
|
||||
json.put("cityArea", cityArea);
|
||||
json.put("countryArea", countryArea);
|
||||
}else {
|
||||
return AjaxResult.error("Api服务异常!");
|
||||
}
|
||||
return AjaxResult.success(json);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
logger.error(e.getMessage());
|
||||
|
|
@ -40,4 +67,8 @@ public class BaiduController extends BaseController {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
String result = " {\"status\":0,\"result\":{\"location\":{\"lng\":113.29950224957551,\"lat\":23.019282373814027},\"formatted_address\":\"广东省广州市番禺区安平路\",\"business\":\"大石\",\"addressComponent\":{\"country\":\"中国\",\"country_code\":0,\"country_code_iso\":\"CHN\",\"country_code_iso2\":\"CN\",\"province\":\"广东省\",\"city\":\"广州市\",\"city_level\":2,\"district\":\"番禺区\",\"town\":\"\",\"town_code\":\"\",\"distance\":\"\",\"direction\":\"\",\"adcode\":\"440113\",\"street\":\"安平路\",\"street_number\":\"\"},\"pois\":[],\"roads\":[],\"poiRegions\":[],\"sematic_description\":\"\",\"cityCode\":257}}\n";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,4 +45,6 @@ public class Customer extends BaseEntity {
|
|||
@Excel(name = "祖级分销人", cellType = Excel.ColumnType.NUMERIC)
|
||||
private Long parentCustomerPlace;
|
||||
|
||||
private Integer placeStatus;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
<result property="openId" column="open_id" />
|
||||
<result property="password" column="password" />
|
||||
<result property="status" column="status" />
|
||||
<result property="placeStatus" column="place_status" />
|
||||
<result property="customerLogoUrl" column="customer_logo_url" />
|
||||
<result property="customerPlace" column="customer_place" />
|
||||
<result property="parentCustomerPlace" column="parent_customer_place" />
|
||||
|
|
@ -21,7 +22,7 @@
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectCustomer">
|
||||
SELECT customer_id, name, account, phone, open_id, password, status,
|
||||
SELECT customer_id, name, account, phone, open_id, password, status, place_status,
|
||||
customer_logo_url, customer_place, parent_customer_place, create_by, create_time, remark
|
||||
FROM customer
|
||||
</sql>
|
||||
|
|
@ -93,6 +94,7 @@
|
|||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="customerPlace != null">customer_place = #{customerPlace},</if>
|
||||
<if test="parentCustomerPlace != null">parent_customer_place = #{parentCustomerPlace},</if>
|
||||
<if test="placeStatus != null">place_status = #{placeStatus},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where customer_id = #{customerId}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ghy.system.mapper;
|
||||
|
||||
import com.ghy.system.domain.SysArea;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -46,4 +47,10 @@ public interface SysAreaMapper {
|
|||
*/
|
||||
public int insertSysArea(SysArea sysArea);
|
||||
|
||||
/**
|
||||
* @param sysArea 区域
|
||||
* @return 区域实体
|
||||
*/
|
||||
public SysArea selectByName(SysArea sysArea);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,4 +60,11 @@ public interface ISysAreaService {
|
|||
*/
|
||||
int selectAreaCount(Long areaId);
|
||||
|
||||
/**
|
||||
* @param name 区域名称
|
||||
* @param parentCode 父级id
|
||||
* @return 区域实体
|
||||
*/
|
||||
SysArea selectByName(String name, String parentCode);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,6 +79,14 @@ public class SysAreaServiceImpl implements ISysAreaService {
|
|||
return sysAreaMapper.selectSysAreaList(info).size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysArea selectByName(String name, String parentCode) {
|
||||
SysArea sysArea = new SysArea();
|
||||
sysArea.setAreaName(name);
|
||||
sysArea.setParentCode(parentCode);
|
||||
return sysAreaMapper.selectByName(sysArea);
|
||||
}
|
||||
|
||||
public int countUseSysAreaById(SysArea sysArea){
|
||||
//TODO 校验区域是否使用
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -133,4 +133,19 @@
|
|||
)
|
||||
</insert>
|
||||
|
||||
<select id="selectByName" resultMap="SysAreaResult">
|
||||
<include refid="selectSysArea" />
|
||||
<where>
|
||||
<if test="">
|
||||
and area_name like concat('%', #{areaName}, '%')
|
||||
</if>
|
||||
<if test="parentCode==null">
|
||||
and parent_code is null
|
||||
</if>
|
||||
<if test="parentCode!=null">
|
||||
and parent_code = #{parentCode}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue