diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerController.java b/ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerController.java index d73de4f8..56727927 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerController.java @@ -23,7 +23,7 @@ import java.util.List; public class CustomerController extends BaseController { private String prefix = "customer"; - + @Autowired private CustomerService customerService; @@ -56,13 +56,17 @@ public class CustomerController extends BaseController { @ResponseBody public AjaxResult updateCustomer(@RequestBody Customer customer){ try { + if (customer.getCustomerPlace() != null) { + // 更新父级分销人时需要查询是否有祖父分销人,并进行同步更新 + Customer customerPlaceInfo = customerService.selectByCustomerId(customer.getCustomerPlace()); + customer.setParentCustomerPlace(customerPlaceInfo.getCustomerPlace()); + } customerService.updateCustomer(customer); - return AjaxResult.success("更新消费者手机号成功"); - }catch (Exception e){ + return AjaxResult.success("更新消费者信息成功"); + } catch (Exception e){ ExceptionUtil.getExceptionMessage(e); return AjaxResult.error(e.getMessage()); } } - } diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/tool/WxController.java b/ghy-admin/src/main/java/com/ghy/web/controller/tool/WxController.java index 4207e57e..88abe364 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/tool/WxController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/tool/WxController.java @@ -161,14 +161,14 @@ public class WxController extends BaseController { @PostMapping("/unlimited/wxacode") @ResponseBody - public AjaxResult getUnlimitedWxacode(@RequestBody JSONObject requestObj, HttpServletRequest request) throws Exception { + public AjaxResult getUnlimitedWxacode(@RequestBody JSONObject requestObj) throws Exception { String base64Code = null; try { String scene = requestObj.getString("scene"); String envVersion = requestObj.getString("env_version"); - String from = request.getHeader("from"); - String deptId = request.getHeader("deptId"); + String from = requestObj.getString("from"); + String deptId = requestObj.getString("deptId"); SysDeptConfig sysDeptConfig = sysDeptConfigService.selectByDeptId(Long.parseLong(deptId)); String token = null; diff --git a/ghy-custom/src/main/resources/mapper/customer/CustomerMapper.xml b/ghy-custom/src/main/resources/mapper/customer/CustomerMapper.xml index 06690134..18d55c07 100644 --- a/ghy-custom/src/main/resources/mapper/customer/CustomerMapper.xml +++ b/ghy-custom/src/main/resources/mapper/customer/CustomerMapper.xml @@ -91,6 +91,8 @@ status = #{status}, remark = #{remark}, update_by = #{updateBy}, + customer_place = #{customerPlace}, + parent_customer_place = #{parentCustomerPlace}, update_time = sysdate() where customer_id = #{customerId}