从源更新

This commit is contained in:
qiankunpingtai
2019-06-06 18:13:41 +08:00
40 changed files with 106 additions and 153 deletions

View File

@@ -30,8 +30,8 @@ public class CommonQueryManager {
* @param apiName 接口名称
* @param id ID
*/
public Object selectOne(String apiName, String id) throws Exception{
if (StringUtil.isNotEmpty(apiName) && StringUtil.isNotEmpty(id)) {
public Object selectOne(String apiName, Long id) throws Exception {
if (StringUtil.isNotEmpty(apiName) && id!=null) {
return container.getCommonQuery(apiName).selectOne(id);
}
return null;

View File

@@ -13,12 +13,12 @@ import java.util.Map;
*/
public interface ICommonQuery {
/**
* 查询解析JSON查询资源
* 根据id查询明细
*
* @param condition 资源id
* @param id 资源id
* @return 资源
*/
Object selectOne(String condition) throws Exception;
Object selectOne(Long id) throws Exception;
/**
* 自定义查询

View File

@@ -19,8 +19,8 @@ public class AccountComponent implements ICommonQuery {
private AccountService accountService;
@Override
public Object selectOne(String condition) {
return null;
public Object selectOne(Long id) throws Exception {
return accountService.getAccount(id);
}
@Override

View File

@@ -58,7 +58,7 @@ public class AccountService {
@Resource
private UserService userService;
public Account getAccount(long id) {
public Account getAccount(long id) throws Exception{
return accountMapper.selectByPrimaryKey(id);
}

View File

@@ -19,8 +19,8 @@ public class AccountHeadComponent implements ICommonQuery {
private AccountHeadService accountHeadService;
@Override
public Object selectOne(String condition) throws Exception {
return null;
public Object selectOne(Long id) throws Exception {
return accountHeadService.getAccountHead(id);
}
@Override

View File

@@ -19,8 +19,8 @@ public class AccountItemComponent implements ICommonQuery {
private AccountItemService accountItemService;
@Override
public Object selectOne(String condition)throws Exception {
return null;
public Object selectOne(Long id) throws Exception {
return accountItemService.getAccountItem(id);
}
@Override

View File

@@ -19,8 +19,8 @@ public class AppComponent implements ICommonQuery {
private AppService appService;
@Override
public Object selectOne(String condition)throws Exception {
return null;
public Object selectOne(Long id) throws Exception {
return appService.getApp(id);
}
@Override

View File

@@ -20,8 +20,8 @@ public class DepotComponent implements ICommonQuery {
private DepotService depotService;
@Override
public Object selectOne(String condition)throws Exception {
return null;
public Object selectOne(Long id) throws Exception {
return depotService.getDepot(id);
}
@Override

View File

@@ -19,8 +19,8 @@ public class DepotHeadComponent implements ICommonQuery {
private DepotHeadService depotHeadService;
@Override
public Object selectOne(String condition)throws Exception {
return null;
public Object selectOne(Long id) throws Exception {
return depotHeadService.getDepotHead(id);
}
@Override
@@ -35,9 +35,9 @@ public class DepotHeadComponent implements ICommonQuery {
String number = StringUtil.getInfo(search, "number");
String beginTime = StringUtil.getInfo(search, "beginTime");
String endTime = StringUtil.getInfo(search, "endTime");
String dhIds = StringUtil.getInfo(search, "dhIds");
String order = QueryUtils.order(map);
return depotHeadService.select(type, subType, number, beginTime, endTime, dhIds, QueryUtils.offset(map), QueryUtils.rows(map));
String materialParam = StringUtil.getInfo(search, "materialParam");
String depotIds = StringUtil.getInfo(search, "depotIds");
return depotHeadService.select(type, subType, number, beginTime, endTime, materialParam, depotIds, QueryUtils.offset(map), QueryUtils.rows(map));
}
@Override
@@ -48,8 +48,9 @@ public class DepotHeadComponent implements ICommonQuery {
String number = StringUtil.getInfo(search, "number");
String beginTime = StringUtil.getInfo(search, "beginTime");
String endTime = StringUtil.getInfo(search, "endTime");
String dhIds = StringUtil.getInfo(search, "dhIds");
return depotHeadService.countDepotHead(type, subType, number, beginTime, endTime, dhIds);
String materialParam = StringUtil.getInfo(search, "materialParam");
String depotIds = StringUtil.getInfo(search, "depotIds");
return depotHeadService.countDepotHead(type, subType, number, beginTime, endTime, materialParam, depotIds);
}
@Override

View File

@@ -88,11 +88,12 @@ public class DepotHeadService {
return list;
}
public List<DepotHeadVo4List> select(String type, String subType, String number, String beginTime, String endTime, String dhIds, int offset, int rows)throws Exception {
public List<DepotHeadVo4List> select(String type, String subType, String number, String beginTime, String endTime,
String materialParam, String depotIds, int offset, int rows)throws Exception {
List<DepotHeadVo4List> resList = new ArrayList<DepotHeadVo4List>();
List<DepotHeadVo4List> list=null;
try{
list=depotHeadMapperEx.selectByConditionDepotHead(type, subType, number, beginTime, endTime, dhIds, offset, rows);
list=depotHeadMapperEx.selectByConditionDepotHead(type, subType, number, beginTime, endTime, materialParam, depotIds, offset, rows);
}catch(Exception e){
logger.error("异常码[{}],异常提示[{}],异常[{}]",
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
@@ -127,10 +128,11 @@ public class DepotHeadService {
public Long countDepotHead(String type, String subType, String number, String beginTime, String endTime, String dhIds) throws Exception{
public Long countDepotHead(String type, String subType, String number, String beginTime, String endTime,
String materialParam, String depotIds) throws Exception{
Long result=null;
try{
result=depotHeadMapperEx.countsByDepotHead(type, subType, number, beginTime, endTime, dhIds);
result=depotHeadMapperEx.countsByDepotHead(type, subType, number, beginTime, endTime, materialParam, depotIds);
}catch(Exception e){
logger.error("异常码[{}],异常提示[{}],异常[{}]",
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);

View File

@@ -19,8 +19,8 @@ public class DepotItemComponent implements ICommonQuery {
private DepotItemService depotItemService;
@Override
public Object selectOne(String condition)throws Exception {
return null;
public Object selectOne(Long id) throws Exception {
return depotItemService.getDepotItem(id);
}
@Override

View File

@@ -188,19 +188,6 @@ public class DepotItemService {
return list==null?0:list.size();
}
public List<DepotItemVo4HeaderId> getHeaderIdByMaterial(String materialParam, String depotIds)throws Exception {
List<DepotItemVo4HeaderId> list =null;
try{
list = depotItemMapperEx.getHeaderIdByMaterial(materialParam, depotIds);
}catch(Exception e){
logger.error("异常码[{}],异常提示[{}],异常[{}]",
ExceptionConstants.DATA_READ_FAIL_CODE,ExceptionConstants.DATA_READ_FAIL_MSG,e);
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
ExceptionConstants.DATA_READ_FAIL_MSG);
}
return list;
}
public List<DepotItemVo4DetailByTypeAndMId> findDetailByTypeAndMaterialIdList(Map<String, String> map)throws Exception {
String mIdStr = map.get("mId");
Long mId = null;

View File

@@ -21,8 +21,8 @@ public class FunctionsComponent implements ICommonQuery {
private FunctionsService functionsService;
@Override
public Object selectOne(String condition)throws Exception {
return null;
public Object selectOne(Long id) throws Exception {
return functionsService.getFunctions(id);
}
@Override

View File

@@ -19,8 +19,8 @@ public class InOutItemComponent implements ICommonQuery {
private InOutItemService inOutItemService;
@Override
public Object selectOne(String condition)throws Exception {
return null;
public Object selectOne(Long id) throws Exception {
return inOutItemService.getInOutItem(id);
}
@Override

View File

@@ -19,8 +19,8 @@ public class LogComponent implements ICommonQuery {
private LogService logService;
@Override
public Object selectOne(String condition)throws Exception {
return null;
public Object selectOne(Long id) throws Exception {
return logService.getLog(id);
}
@Override

View File

@@ -21,8 +21,8 @@ public class MaterialComponent implements ICommonQuery {
private MaterialService materialService;
@Override
public Object selectOne(String condition)throws Exception {
return null;
public Object selectOne(Long id) throws Exception {
return materialService.getMaterial(id);
}
@Override

View File

@@ -21,8 +21,8 @@ public class MaterialCategoryComponent implements ICommonQuery {
private MaterialCategoryService materialCategoryService;
@Override
public Object selectOne(String condition)throws Exception {
return null;
public Object selectOne(Long id) throws Exception {
return materialCategoryService.getMaterialCategory(id);
}
@Override

View File

@@ -19,8 +19,8 @@ public class MaterialPropertyComponent implements ICommonQuery {
private MaterialPropertyService materialPropertyService;
@Override
public Object selectOne(String condition)throws Exception {
return null;
public Object selectOne(Long id) throws Exception {
return materialPropertyService.getMaterialProperty(id);
}
@Override

View File

@@ -21,9 +21,10 @@ import java.util.Map;
public class OrgaUserRelComponent implements ICommonQuery {
@Resource
private OrgaUserRelService orgaUserRelService;
@Override
public Object selectOne(String condition)throws Exception {
return null;
public Object selectOne(Long id) throws Exception {
return orgaUserRelService.getOrgaUserRel(id);
}
@Override

View File

@@ -41,6 +41,11 @@ public class OrgaUserRelService {
private UserService userService;
@Resource
private LogService logService;
public OrgaUserRel getOrgaUserRel(long id) throws Exception{
return orgaUserRelMapper.selectByPrimaryKey(id);
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int insertOrgaUserRel(String beanJson, HttpServletRequest request) throws Exception{
OrgaUserRel orgaUserRel = JSONObject.parseObject(beanJson, OrgaUserRel.class);

View File

@@ -22,9 +22,10 @@ import java.util.Map;
public class OrganizationComponent implements ICommonQuery {
@Resource
private OrganizationService organizationService;
@Override
public Object selectOne(String condition)throws Exception {
return null;
public Object selectOne(Long id) throws Exception {
return organizationService.getOrganization(id);
}
@Override

View File

@@ -44,6 +44,11 @@ public class OrganizationService {
private UserService userService;
@Resource
private LogService logService;
public Organization getOrganization(long id) throws Exception {
return organizationMapper.selectByPrimaryKey(id);
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int insertOrganization(String beanJson, HttpServletRequest request)throws Exception {
Organization organization = JSONObject.parseObject(beanJson, Organization.class);

View File

@@ -21,8 +21,8 @@ public class PersonComponent implements ICommonQuery {
private PersonService personService;
@Override
public Object selectOne(String condition)throws Exception {
return null;
public Object selectOne(Long id) throws Exception {
return personService.getPerson(id);
}
@Override

View File

@@ -19,8 +19,8 @@ public class RoleComponent implements ICommonQuery {
private RoleService roleService;
@Override
public Object selectOne(String condition)throws Exception {
return null;
public Object selectOne(Long id) throws Exception {
return roleService.getRole(id);
}
@Override

View File

@@ -26,8 +26,8 @@ public class SerialNumberComponent implements ICommonQuery {
private SerialNumberService serialNumberService;
@Override
public Object selectOne(String condition)throws Exception {
return null;
public Object selectOne(Long id) throws Exception {
return serialNumberService.getSerialNumber(id);
}
@Override

View File

@@ -21,8 +21,8 @@ public class SupplierComponent implements ICommonQuery {
private SupplierService supplierService;
@Override
public Object selectOne(String condition)throws Exception {
return null;
public Object selectOne(Long id) throws Exception {
return supplierService.getSupplier(id);
}
@Override

View File

@@ -21,8 +21,8 @@ public class SystemConfigComponent implements ICommonQuery {
private SystemConfigService systemConfigService;
@Override
public Object selectOne(String condition)throws Exception {
return null;
public Object selectOne(Long id) throws Exception {
return systemConfigService.getSystemConfig(id);
}
@Override

View File

@@ -20,8 +20,8 @@ public class UnitComponent implements ICommonQuery {
private UnitService unitService;
@Override
public Object selectOne(String condition)throws Exception {
return null;
public Object selectOne(Long id) throws Exception {
return unitService.getUnit(id);
}
@Override

View File

@@ -18,8 +18,8 @@ public class UserComponent implements ICommonQuery {
private UserService userService;
@Override
public Object selectOne(String condition)throws Exception {
return null;
public Object selectOne(Long id) throws Exception {
return userService.getUser(id);
}
@Override

View File

@@ -22,8 +22,8 @@ public class UserBusinessComponent implements ICommonQuery {
private UserBusinessService userBusinessService;
@Override
public Object selectOne(String condition)throws Exception {
return null;
public Object selectOne(Long id) throws Exception {
return userBusinessService.getUserBusiness(id);
}
@Override