给经手人和仓库优化接口

This commit is contained in:
jishenghua
2025-02-22 21:22:57 +08:00
parent 4c91e8cb08
commit a473484ffd
15 changed files with 166 additions and 277 deletions

View File

@@ -1,75 +0,0 @@
package com.jsh.erp.service.depot;
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 = "depot_component")
@DepotResource
public class DepotComponent implements ICommonQuery {
@Resource
private DepotService depotService;
@Override
public Object selectOne(Long id) throws Exception {
return depotService.getDepot(id);
}
@Override
public List<?> select(Map<String, String> map)throws Exception {
return getDepotList(map);
}
private List<?> getDepotList(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH);
String name = StringUtil.getInfo(search, "name");
Integer type = StringUtil.parseInteger(StringUtil.getInfo(search, "type"));
String remark = StringUtil.getInfo(search, "remark");
String order = QueryUtils.order(map);
return depotService.select(name, type, remark, 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");
Integer type = StringUtil.parseInteger(StringUtil.getInfo(search, "type"));
String remark = StringUtil.getInfo(search, "remark");
return depotService.countDepot(name, type, remark);
}
@Override
public int insert(JSONObject obj, HttpServletRequest request) throws Exception{
return depotService.insertDepot(obj, request);
}
@Override
public int update(JSONObject obj, HttpServletRequest request)throws Exception {
return depotService.updateDepot(obj, request);
}
@Override
public int delete(Long id, HttpServletRequest request)throws Exception {
return depotService.deleteDepot(id, request);
}
@Override
public int deleteBatch(String ids, HttpServletRequest request)throws Exception {
return depotService.batchDeleteDepot(ids, request);
}
@Override
public int checkIsNameExist(Long id, String name)throws Exception {
return depotService.checkIsNameExist(id, name);
}
}

View File

@@ -1,15 +0,0 @@
package com.jsh.erp.service.depot;
import com.jsh.erp.service.ResourceInfo;
import java.lang.annotation.*;
/**
* @author jishenghua qq752718920 2018-10-7 15:26:27
*/
@ResourceInfo(value = "depot")
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface DepotResource {
}

View File

@@ -91,26 +91,16 @@ public class DepotService {
return list;
}
public List<DepotEx> select(String name, Integer type, String remark, int offset, int rows)throws Exception {
public List<DepotEx> select(String name, Integer type, String remark)throws Exception {
List<DepotEx> list=null;
try{
list=depotMapperEx.selectByConditionDepot(name, type, remark, offset, rows);
list=depotMapperEx.selectByConditionDepot(name, type, remark);
}catch(Exception e){
JshException.readFail(logger, e);
}
return list;
}
public Long countDepot(String name, Integer type, String remark)throws Exception {
Long result=null;
try{
result=depotMapperEx.countsByDepot(name, type, remark);
}catch(Exception e){
JshException.readFail(logger, e);
}
return result;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int insertDepot(JSONObject obj, HttpServletRequest request)throws Exception {
Depot depot = JSONObject.parseObject(obj.toJSONString(), Depot.class);

View File

@@ -2,8 +2,6 @@ package com.jsh.erp.service.material;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.service.ICommonQuery;
import com.jsh.erp.service.depot.DepotResource;
import com.jsh.erp.service.depot.DepotService;
import com.jsh.erp.utils.Constants;
import com.jsh.erp.utils.QueryUtils;
import com.jsh.erp.utils.StringUtil;

View File

@@ -1,75 +0,0 @@
package com.jsh.erp.service.person;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.service.ICommonQuery;
import com.jsh.erp.service.depot.DepotResource;
import com.jsh.erp.service.depot.DepotService;
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 = "person_component")
@PersonResource
public class PersonComponent implements ICommonQuery {
@Resource
private PersonService personService;
@Override
public Object selectOne(Long id) throws Exception {
return personService.getPerson(id);
}
@Override
public List<?> select(Map<String, String> map)throws Exception {
return getPersonList(map);
}
private List<?> getPersonList(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 personService.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 personService.countPerson(name, type);
}
@Override
public int insert(JSONObject obj, HttpServletRequest request)throws Exception {
return personService.insertPerson(obj, request);
}
@Override
public int update(JSONObject obj, HttpServletRequest request)throws Exception {
return personService.updatePerson(obj, request);
}
@Override
public int delete(Long id, HttpServletRequest request)throws Exception {
return personService.deletePerson(id, request);
}
@Override
public int deleteBatch(String ids, HttpServletRequest request)throws Exception {
return personService.batchDeletePerson(ids, request);
}
@Override
public int checkIsNameExist(Long id, String name)throws Exception {
return personService.checkIsNameExist(id, name);
}
}

View File

@@ -1,15 +0,0 @@
package com.jsh.erp.service.person;
import com.jsh.erp.service.ResourceInfo;
import java.lang.annotation.*;
/**
* @author jishenghua qq752718920 2018-10-7 15:26:27
*/
@ResourceInfo(value = "person")
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface PersonResource {
}

View File

@@ -83,26 +83,16 @@ public class PersonService {
return list;
}
public List<Person> select(String name, String type, int offset, int rows)throws Exception {
public List<Person> select(String name, String type)throws Exception {
List<Person> list=null;
try{
list=personMapperEx.selectByConditionPerson(name, type, offset, rows);
list=personMapperEx.selectByConditionPerson(name, type);
}catch(Exception e){
JshException.readFail(logger, e);
}
return list;
}
public Long countPerson(String name, String type)throws Exception {
Long result=null;
try{
result=personMapperEx.countsByPerson(name, type);
}catch(Exception e){
JshException.readFail(logger, e);
}
return result;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int insertPerson(JSONObject obj, HttpServletRequest request)throws Exception {
Person person = JSONObject.parseObject(obj.toJSONString(), Person.class);

View File

@@ -2,8 +2,6 @@ package com.jsh.erp.service.supplier;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.service.ICommonQuery;
import com.jsh.erp.service.depot.DepotResource;
import com.jsh.erp.service.depot.DepotService;
import com.jsh.erp.utils.Constants;
import com.jsh.erp.utils.QueryUtils;
import com.jsh.erp.utils.StringUtil;

View File

@@ -3,11 +3,6 @@ package com.jsh.erp.service.userBusiness;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.service.ICommonQuery;
import com.jsh.erp.service.depot.DepotResource;
import com.jsh.erp.service.depot.DepotService;
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;