diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerPlaceController.java b/ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerPlaceController.java index 17a95d46..05e8a12c 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerPlaceController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/customer/CustomerPlaceController.java @@ -4,8 +4,13 @@ import java.util.List; import com.ghy.common.enums.PlaceStatus; import com.ghy.common.utils.CacheUtils; +import com.ghy.common.utils.ExceptionUtil; +import com.ghy.common.utils.ObjectUtils; import com.ghy.customer.domain.Customer; import com.ghy.customer.service.CustomerService; +import com.ghy.worker.domain.Worker; +import com.ghy.worker.domain.WorkerBank; +import com.ghy.worker.domain.WorkerCertification; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -170,4 +175,29 @@ public class CustomerPlaceController extends BaseController { return toAjax(customerPlaceService.deleteCustomerPlaceByIds(ids)); } + + @PostMapping("/changeStatus") + @ResponseBody + public AjaxResult changeStatus(String ids,Integer status){ + try { + int result = customerPlaceService.changeStatus(ids, status); + if(result > 0){ + String [] idArray = ids.split(","); + for (String id : idArray){ + CustomerPlace customerPlace = customerPlaceService.selectCustomerPlaceById(id); + Customer customer = new Customer(); + customer.setCustomerId(customerPlace.getCustomerId()); + customer.setPlaceStatus(status); + customerService.updateCustomer(customer); + } + return AjaxResult.success("操作成功!"); + }else { + return AjaxResult.warn("操作失败!"); + } + }catch (Exception e){ + e.printStackTrace(); + logger.error(ExceptionUtil.getExceptionMessage(e)); + return AjaxResult.error("操作失败!"); + } + } } diff --git a/ghy-admin/src/main/resources/templates/customer/place/place.html b/ghy-admin/src/main/resources/templates/customer/place/place.html index b136b562..4bacf724 100644 --- a/ghy-admin/src/main/resources/templates/customer/place/place.html +++ b/ghy-admin/src/main/resources/templates/customer/place/place.html @@ -36,15 +36,15 @@