|
@@ -1,15 +1,15 @@
|
|
|
package com.dgtly.web.controller.system;
|
|
package com.dgtly.web.controller.system;
|
|
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
+import com.dgtly.system.domain.OrderSalesParameter;
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.ModelMap;
|
|
import org.springframework.ui.ModelMap;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
-import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
import com.dgtly.common.annotation.Log;
|
|
import com.dgtly.common.annotation.Log;
|
|
|
import com.dgtly.common.enums.BusinessType;
|
|
import com.dgtly.common.enums.BusinessType;
|
|
|
import com.dgtly.system.domain.AlertConfiguration;
|
|
import com.dgtly.system.domain.AlertConfiguration;
|
|
@@ -87,7 +87,7 @@ public class AlertConfigurationController extends BaseController
|
|
|
public AjaxResult addSave(AlertConfiguration alertConfiguration)
|
|
public AjaxResult addSave(AlertConfiguration alertConfiguration)
|
|
|
{
|
|
{
|
|
|
int num = alertConfigurationService.selectAlertConfigurationListFilter(alertConfiguration);
|
|
int num = alertConfigurationService.selectAlertConfigurationListFilter(alertConfiguration);
|
|
|
- if (alertConfiguration.getAlertStatus().equals("1")&&num==1){
|
|
|
|
|
|
|
+ if (alertConfiguration.getAlertStatus().equals("1") && num==1){
|
|
|
return error("弹幕通知只能有一个启动,请修改后重新添加");
|
|
return error("弹幕通知只能有一个启动,请修改后重新添加");
|
|
|
}
|
|
}
|
|
|
return toAjax(alertConfigurationService.insertAlertConfiguration(alertConfiguration));
|
|
return toAjax(alertConfigurationService.insertAlertConfiguration(alertConfiguration));
|
|
@@ -103,7 +103,6 @@ public class AlertConfigurationController extends BaseController
|
|
|
mmap.put("alertConfiguration", alertConfiguration);
|
|
mmap.put("alertConfiguration", alertConfiguration);
|
|
|
return prefix + "/edit";
|
|
return prefix + "/edit";
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 修改保存弹框配置
|
|
* 修改保存弹框配置
|
|
|
*/
|
|
*/
|
|
@@ -113,23 +112,31 @@ public class AlertConfigurationController extends BaseController
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public AjaxResult editSave(AlertConfiguration alertConfiguration)
|
|
public AjaxResult editSave(AlertConfiguration alertConfiguration)
|
|
|
{
|
|
{
|
|
|
- //没改之前的配置
|
|
|
|
|
- AlertConfiguration alertConfiguration1 = alertConfigurationService.selectAlertConfigurationById(alertConfiguration.getAlertId());
|
|
|
|
|
- //判断之前有没有
|
|
|
|
|
- int num = alertConfigurationService.selectAlertConfigurationListFilter(alertConfiguration);
|
|
|
|
|
- if(num==1){
|
|
|
|
|
- if (alertConfiguration1.getAlertStatus().equals("1")){
|
|
|
|
|
- return toAjax(alertConfigurationService.updateAlertConfiguration(alertConfiguration));
|
|
|
|
|
- }else {
|
|
|
|
|
- if (alertConfiguration.getAlertStatus().equals("1")){
|
|
|
|
|
- return AjaxResult.error("列表中只能有一条日志配置启动");
|
|
|
|
|
- }else {
|
|
|
|
|
- return toAjax(alertConfigurationService.updateAlertConfiguration(alertConfiguration));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }else {
|
|
|
|
|
|
|
+ if(("0").equals(alertConfiguration.getAlertStatus())){
|
|
|
return toAjax(alertConfigurationService.updateAlertConfiguration(alertConfiguration));
|
|
return toAjax(alertConfigurationService.updateAlertConfiguration(alertConfiguration));
|
|
|
}
|
|
}
|
|
|
|
|
+ return error("请取消发布后再做修改");
|
|
|
|
|
+ }
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 是否发布/取消发布弹框配置
|
|
|
|
|
+ */
|
|
|
|
|
+ @RequiresPermissions("system:configuration:edit")
|
|
|
|
|
+ @Log(title = "发布弹框", businessType = BusinessType.UPDATE)
|
|
|
|
|
+ @PostMapping("/release")
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ public AjaxResult release(AlertConfiguration alertConfiguration)
|
|
|
|
|
+ {
|
|
|
|
|
+ if(alertConfiguration.getAlertStatus().equals("0")){
|
|
|
|
|
+ return toAjax(alertConfigurationService.updateAlertConfiguration(alertConfiguration));
|
|
|
|
|
+ }else{
|
|
|
|
|
+ int num = alertConfigurationService.selectAlertConfigurationListFilter(alertConfiguration);
|
|
|
|
|
+ if(num==1){
|
|
|
|
|
+ return AjaxResult.error("已发布该组织弹框,请核查");
|
|
|
|
|
+ }else {
|
|
|
|
|
+ return toAjax(alertConfigurationService.updateAlertConfiguration(alertConfiguration));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -143,4 +150,34 @@ public class AlertConfigurationController extends BaseController
|
|
|
{
|
|
{
|
|
|
return toAjax(alertConfigurationService.deleteAlertConfigurationByIds(ids));
|
|
return toAjax(alertConfigurationService.deleteAlertConfigurationByIds(ids));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ @PostMapping("/searchOrg")
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ public Map searchProductParamByCustomerCode(@RequestBody OrderSalesParameter salesManager) {
|
|
|
|
|
+ if("".equals(salesManager.getParType()) || salesManager.getParType() ==null){
|
|
|
|
|
+ salesManager.setParType("div_level");
|
|
|
|
|
+ }
|
|
|
|
|
+ Map map = new HashMap();
|
|
|
|
|
+ List<Map<String,Object>> dataList = alertConfigurationService.searchProductParamByCustomerCode(
|
|
|
|
|
+ salesManager.getParType(),salesManager.getParValue());
|
|
|
|
|
+ if(dataList != null && dataList.size() > 0){
|
|
|
|
|
+ map.put("levelInfo",dataList.get(0));
|
|
|
|
|
+ if ("suboffice_level".equals(salesManager.getParType()) ||
|
|
|
|
|
+ "customer_level".equals(salesManager.getParType()) ||
|
|
|
|
|
+ "emp_level".equals(salesManager.getParType()) ||
|
|
|
|
|
+ "saledept_level".equals(salesManager.getParType())
|
|
|
|
|
+ ){
|
|
|
|
|
+ map.put("dataList",new ArrayList());
|
|
|
|
|
+ }else{
|
|
|
|
|
+ map.put("dataList",dataList);
|
|
|
|
|
+ }
|
|
|
|
|
+ return map;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ Map mapnull = new HashMap();
|
|
|
|
|
+ map.put("levelInfo",mapnull);
|
|
|
|
|
+ map.put("dataList",dataList);
|
|
|
|
|
+ return map;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|