给经手人和仓库优化接口
This commit is contained in:
@@ -1,73 +0,0 @@
|
||||
package com.jsh.erp.service.functions;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.service.ICommonQuery;
|
||||
import com.jsh.erp.utils.Constants;
|
||||
import com.jsh.erp.utils.QueryUtils;
|
||||
import com.jsh.erp.utils.StringUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service(value = "function_component")
|
||||
@FunctionResource
|
||||
public class FunctionComponent implements ICommonQuery {
|
||||
|
||||
@Resource
|
||||
private FunctionService functionService;
|
||||
|
||||
@Override
|
||||
public Object selectOne(Long id) throws Exception {
|
||||
return functionService.getFunction(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<?> select(Map<String, String> map)throws Exception {
|
||||
return getFunctionsList(map);
|
||||
}
|
||||
|
||||
private List<?> getFunctionsList(Map<String, String> map) throws Exception{
|
||||
String search = map.get(Constants.SEARCH);
|
||||
String name = StringUtil.getInfo(search, "name");
|
||||
String type = StringUtil.getInfo(search, "type");
|
||||
String order = QueryUtils.order(map);
|
||||
return functionService.select(name, type, QueryUtils.offset(map), QueryUtils.rows(map));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long counts(Map<String, String> map) throws Exception{
|
||||
String search = map.get(Constants.SEARCH);
|
||||
String name = StringUtil.getInfo(search, "name");
|
||||
String type = StringUtil.getInfo(search, "type");
|
||||
return functionService.countFunction(name, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insert(JSONObject obj, HttpServletRequest request)throws Exception {
|
||||
return functionService.insertFunction(obj, request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(JSONObject obj, HttpServletRequest request)throws Exception {
|
||||
return functionService.updateFunction(obj, request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(Long id, HttpServletRequest request)throws Exception {
|
||||
return functionService.deleteFunction(id, request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteBatch(String ids, HttpServletRequest request)throws Exception {
|
||||
return functionService.batchDeleteFunction(ids, request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int checkIsNameExist(Long id, String name)throws Exception {
|
||||
return functionService.checkIsNameExist(id, name);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.jsh.erp.service.functions;
|
||||
|
||||
import com.jsh.erp.service.ResourceInfo;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author jishenghua qq752718920 2018-10-7 15:26:27
|
||||
*/
|
||||
@ResourceInfo(value = "function")
|
||||
@Inherited
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface FunctionResource {
|
||||
}
|
||||
@@ -77,11 +77,11 @@ public class FunctionService {
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<FunctionEx> select(String name, String type, int offset, int rows)throws Exception {
|
||||
public List<FunctionEx> select(String name, String type)throws Exception {
|
||||
List<FunctionEx> list=null;
|
||||
try{
|
||||
if(BusinessConstants.DEFAULT_MANAGER.equals(userService.getCurrentUser().getLoginName())) {
|
||||
list = functionMapperEx.selectByConditionFunction(name, type, offset, rows);
|
||||
list = functionMapperEx.selectByConditionFunction(name, type);
|
||||
}
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
@@ -89,18 +89,6 @@ public class FunctionService {
|
||||
return list;
|
||||
}
|
||||
|
||||
public Long countFunction(String name, String type)throws Exception {
|
||||
Long result=null;
|
||||
try{
|
||||
if(BusinessConstants.DEFAULT_MANAGER.equals(userService.getCurrentUser().getLoginName())) {
|
||||
result = functionMapperEx.countsByFunction(name, type);
|
||||
}
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int insertFunction(JSONObject obj, HttpServletRequest request)throws Exception {
|
||||
Function functions = JSONObject.parseObject(obj.toJSONString(), Function.class);
|
||||
|
||||
Reference in New Issue
Block a user