package com.ld.igds.n2.view;
|
|
import com.bstek.dorado.annotation.Expose;
|
import com.ld.igds.n2.manager.BasicSystemManager;
|
import com.ld.igds.util.ContextUtil;
|
|
import org.apache.commons.lang3.StringUtils;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Component;
|
|
import java.util.Map;
|
|
/**
|
* 系统管理页面中
|
*
|
* @author andy.jia
|
*/
|
@Component
|
public class BasicSystemService {
|
|
@Autowired
|
private BasicSystemManager basicSystemManager;
|
|
|
/**
|
* basicSystemService#pullDeviceBySer
|
* 根据分机ID获取远程控制柜的设备列表,并更新到数据库
|
*
|
* @param serId
|
* @return
|
*/
|
@Expose
|
public String pullDeviceBySer(String serId) {
|
return basicSystemManager.pullDevice(ContextUtil.getCompanyId(), serId);
|
}
|
|
|
/**
|
* basicSystemService#pullDepotBySer
|
* 根据分机ID获取远程控制柜的仓库列表,并更新到数据库
|
*
|
* @param serId
|
* @return
|
*/
|
@Expose
|
public String pullDepotBySer(String serId) {
|
return basicSystemManager.pullDepot(ContextUtil.getCompanyId(), serId);
|
}
|
|
|
/**
|
* 远程授权
|
* basicSystemService#pullAccess
|
*
|
* @param param
|
* @return
|
*/
|
@Expose
|
public String pullAccess(Map<String, Object> param) {
|
String serId = (String) param.get("serId");
|
String accessCode = (String) param.get("accessCode");
|
if (StringUtils.isEmpty(serId) || StringUtils.isEmpty(accessCode)) {
|
return "授权参数不完整,无法授权!";
|
}
|
|
return basicSystemManager.pullAccess(ContextUtil.getCompanyId(), serId, accessCode);
|
}
|
|
/**
|
*
|
* basicSystemService#updateDepotStatus
|
*
|
* @param param
|
* @return
|
*/
|
@Expose
|
public String updateDepotStatus(Map<String, Object> param) {
|
String depotId = (String) param.get("depotId");
|
String depotStatus = (String) param.get("depotStatus");
|
|
if(null == depotId || null == depotStatus) return "当前修改状态为空,不支持修改!";
|
|
return basicSystemManager.updateDepotStatus(ContextUtil.getCompanyId(),depotId,depotStatus);
|
}
|
}
|