Commit 9ab96cbf authored by neo's avatar neo

[DEL] delete common service interface

parent 0ad0d662
package pwc.taxtech.atms.controller; package pwc.taxtech.atms.controller;
import java.util.List; import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -11,12 +10,12 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -11,12 +10,12 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.ApiOperation;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.arearegion.AreaRegionDto; import pwc.taxtech.atms.dto.arearegion.AreaRegionDto;
import pwc.taxtech.atms.dto.arearegion.AreaRegionInfo; import pwc.taxtech.atms.dto.arearegion.AreaRegionInfo;
import pwc.taxtech.atms.service.AreaRegionService; import pwc.taxtech.atms.service.impl.AreaRegionServiceImpl;
import java.util.List;
@RestController @RestController
@RequestMapping("/api/v1/areaRegion/") @RequestMapping("/api/v1/areaRegion/")
...@@ -25,12 +24,13 @@ public class AreaRegionController { ...@@ -25,12 +24,13 @@ public class AreaRegionController {
private static Logger logger = LoggerFactory.getLogger(AreaRegionController.class); private static Logger logger = LoggerFactory.getLogger(AreaRegionController.class);
@Autowired @Autowired
private AreaRegionService areaRegionService; private AreaRegionServiceImpl areaRegionService;
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
@ApiOperation(value = "Adds the specified area.") @ApiOperation(value = "Adds the specified area.")
@RequestMapping(value = "add", method = RequestMethod.POST) @RequestMapping(value = "add", method = RequestMethod.POST)
public @ResponseBody OperationResultDto add(@RequestBody AreaRegionInfo areaRegionInfo) { public @ResponseBody
OperationResultDto add(@RequestBody AreaRegionInfo areaRegionInfo) {
logger.info("/api/v1/areaRegion/add"); logger.info("/api/v1/areaRegion/add");
return areaRegionService.add(areaRegionInfo); return areaRegionService.add(areaRegionInfo);
} }
...@@ -38,21 +38,24 @@ public class AreaRegionController { ...@@ -38,21 +38,24 @@ public class AreaRegionController {
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
@ApiOperation(value = "Update the specified area.") @ApiOperation(value = "Update the specified area.")
@RequestMapping(value = "update", method = RequestMethod.POST) @RequestMapping(value = "update", method = RequestMethod.POST)
public @ResponseBody OperationResultDto update(@RequestBody AreaRegionInfo areaRegionInfo) { public @ResponseBody
OperationResultDto update(@RequestBody AreaRegionInfo areaRegionInfo) {
logger.info("/api/v1/areaRegion/update"); logger.info("/api/v1/areaRegion/update");
return areaRegionService.update(areaRegionInfo); return areaRegionService.update(areaRegionInfo);
} }
@ApiOperation(value = "Get cities") @ApiOperation(value = "Get cities")
@RequestMapping(value = "getCities", method = RequestMethod.GET) @RequestMapping(value = "getCities", method = RequestMethod.GET)
public @ResponseBody List<AreaRegionDto> getCities(@RequestParam(name = "parentID") String parentId) { public @ResponseBody
List<AreaRegionDto> getCities(@RequestParam(name = "parentID") String parentId) {
logger.info("/api/v1/areaRegion/getProvinces"); logger.info("/api/v1/areaRegion/getProvinces");
return areaRegionService.getCities(parentId); return areaRegionService.getCities(parentId);
} }
@ApiOperation(value = "Get Provinces") @ApiOperation(value = "Get Provinces")
@RequestMapping(value = "getProvinces", method = RequestMethod.GET) @RequestMapping(value = "getProvinces", method = RequestMethod.GET)
public @ResponseBody List<AreaRegionDto> getProvinces() { public @ResponseBody
List<AreaRegionDto> getProvinces() {
logger.info("/api/v1/areaRegion/getCities"); logger.info("/api/v1/areaRegion/getCities");
return areaRegionService.getProvinces(); return areaRegionService.getProvinces();
} }
......
package pwc.taxtech.atms.service;
import java.util.List;
import pwc.taxtech.atms.dto.MailMto;
import pwc.taxtech.atms.dpo.EnterpriseAccountSetOrgDto;
public interface CommonService {
void sendMail(MailMto mailmto);
boolean isOrganizationDateTimeOverlap(List<EnterpriseAccountSetOrgDto> list);
}
package pwc.taxtech.atms.service.impl; package pwc.taxtech.atms.service.impl;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import pwc.taxtech.atms.common.AuthUserHelper; import pwc.taxtech.atms.common.AuthUserHelper;
import pwc.taxtech.atms.common.CommonConstants; import pwc.taxtech.atms.common.CommonConstants;
import pwc.taxtech.atms.common.CommonUtils; import pwc.taxtech.atms.common.CommonUtils;
...@@ -36,8 +30,13 @@ import pwc.taxtech.atms.entity.Region; ...@@ -36,8 +30,13 @@ import pwc.taxtech.atms.entity.Region;
import pwc.taxtech.atms.entity.RegionExample; import pwc.taxtech.atms.entity.RegionExample;
import pwc.taxtech.atms.service.OperationLogService; import pwc.taxtech.atms.service.OperationLogService;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
@Service @Service
public class AreaRegionServiceImpl implements pwc.taxtech.atms.service.AreaRegionService { public class AreaRegionServiceImpl {
@Autowired @Autowired
private AreaRegionMapper areaRegionMapper; private AreaRegionMapper areaRegionMapper;
...@@ -52,7 +51,6 @@ public class AreaRegionServiceImpl implements pwc.taxtech.atms.service.AreaRegio ...@@ -52,7 +51,6 @@ public class AreaRegionServiceImpl implements pwc.taxtech.atms.service.AreaRegio
@Autowired @Autowired
private RegionMapper regionMapper; private RegionMapper regionMapper;
@Override
public List<AreaRegion> findAreaRegionsByArea(String areaId) { public List<AreaRegion> findAreaRegionsByArea(String areaId) {
return areaRegionMapper.selectAreaRegionByAreaId(areaId); return areaRegionMapper.selectAreaRegionByAreaId(areaId);
...@@ -65,7 +63,6 @@ public class AreaRegionServiceImpl implements pwc.taxtech.atms.service.AreaRegio ...@@ -65,7 +63,6 @@ public class AreaRegionServiceImpl implements pwc.taxtech.atms.service.AreaRegio
* pwc.taxtech.atms.service.AreaRegionService#add(pwc.taxtech.atms.service.dto. * pwc.taxtech.atms.service.AreaRegionService#add(pwc.taxtech.atms.service.dto.
* AreaRegionInfo) * AreaRegionInfo)
*/ */
@Override
@Transactional @Transactional
public OperationResultDto add(AreaRegionInfo areaRegionInfo) { public OperationResultDto add(AreaRegionInfo areaRegionInfo) {
...@@ -129,7 +126,6 @@ public class AreaRegionServiceImpl implements pwc.taxtech.atms.service.AreaRegio ...@@ -129,7 +126,6 @@ public class AreaRegionServiceImpl implements pwc.taxtech.atms.service.AreaRegio
* pwc.taxtech.atms.service.AreaRegionService#update(pwc.taxtech.atms.service. * pwc.taxtech.atms.service.AreaRegionService#update(pwc.taxtech.atms.service.
* dto.AreaRegionInfo) * dto.AreaRegionInfo)
*/ */
@Override
@Transactional @Transactional
public OperationResultDto update(AreaRegionInfo areaRegionInfo) { public OperationResultDto update(AreaRegionInfo areaRegionInfo) {
...@@ -238,13 +234,11 @@ public class AreaRegionServiceImpl implements pwc.taxtech.atms.service.AreaRegio ...@@ -238,13 +234,11 @@ public class AreaRegionServiceImpl implements pwc.taxtech.atms.service.AreaRegio
return new OperationResultDto(true); return new OperationResultDto(true);
} }
@Override public List<AreaRegionDto> getProvinces() {
public List<AreaRegionDto> getProvinces(){
List<AreaRegionDto> provinces = getRegions(CommonConstants.REGION_LEVELTYPE_PROVINCE); List<AreaRegionDto> provinces = getRegions(CommonConstants.REGION_LEVELTYPE_PROVINCE);
return provinces; return provinces;
} }
@Override
public List<AreaRegionDto> getCities(String parentId) { public List<AreaRegionDto> getCities(String parentId) {
List<AreaRegionDto> cities = getRegions(CommonConstants.REGION_LEVELTYPE_CITY); List<AreaRegionDto> cities = getRegions(CommonConstants.REGION_LEVELTYPE_CITY);
List<AreaRegionDto> query = cities.stream().filter(s -> s.getRegionParentId().equals(parentId)) List<AreaRegionDto> query = cities.stream().filter(s -> s.getRegionParentId().equals(parentId))
......
package pwc.taxtech.atms.service.impl; package pwc.taxtech.atms.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.nutz.lang.Strings; import org.nutz.lang.Strings;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.CommonConstants; import pwc.taxtech.atms.common.CommonConstants;
import pwc.taxtech.atms.dao.MailQueueMapper; import pwc.taxtech.atms.dao.MailQueueMapper;
import pwc.taxtech.atms.dpo.EnterpriseAccountSetOrgDto; import pwc.taxtech.atms.dpo.EnterpriseAccountSetOrgDto;
import pwc.taxtech.atms.dto.MailMto; import pwc.taxtech.atms.dto.MailMto;
import pwc.taxtech.atms.entity.MailQueue; import pwc.taxtech.atms.entity.MailQueue;
import pwc.taxtech.atms.service.CommonService;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Service @Service
public class CommonServiceImpl implements CommonService { public class CommonServiceImpl {
private static final Logger logger = LoggerFactory.getLogger(CommonServiceImpl.class); private static final Logger logger = LoggerFactory.getLogger(CommonServiceImpl.class);
@Autowired @Autowired
private MailQueueMapper mailQueueMapper; private MailQueueMapper mailQueueMapper;
@Override
public void sendMail(MailMto mailmto) { public void sendMail(MailMto mailmto) {
logger.debug("enter sendMail"); logger.debug("enter sendMail");
mailmto.setFrom(CommonConstants.MailFrom); mailmto.setFrom(CommonConstants.MailFrom);
...@@ -71,7 +68,6 @@ public class CommonServiceImpl implements CommonService { ...@@ -71,7 +68,6 @@ public class CommonServiceImpl implements CommonService {
} }
@Override
public boolean isOrganizationDateTimeOverlap(List<EnterpriseAccountSetOrgDto> list) { public boolean isOrganizationDateTimeOverlap(List<EnterpriseAccountSetOrgDto> list) {
for (int i = list.size() - 1; i >= 0; i--) { for (int i = list.size() - 1; i >= 0; i--) {
list.get(i).setOverlapList(new ArrayList<>()); list.get(i).setOverlapList(new ArrayList<>());
......
...@@ -56,7 +56,6 @@ import pwc.taxtech.atms.dto.user.NameDto; ...@@ -56,7 +56,6 @@ import pwc.taxtech.atms.dto.user.NameDto;
import pwc.taxtech.atms.entity.*; import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.entity.OrganizationExample.Criteria; import pwc.taxtech.atms.entity.OrganizationExample.Criteria;
import pwc.taxtech.atms.exception.ApplicationException; import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.service.CommonService;
import pwc.taxtech.atms.service.OperationLogService; import pwc.taxtech.atms.service.OperationLogService;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
...@@ -100,7 +99,7 @@ public class OrganizationServiceImpl { ...@@ -100,7 +99,7 @@ public class OrganizationServiceImpl {
private DimensionServiceImpl dimensionService; private DimensionServiceImpl dimensionService;
@Autowired @Autowired
private CommonService commonService; private CommonServiceImpl commonService;
@Autowired @Autowired
private RoleServiceImpl roleService; private RoleServiceImpl roleService;
......
...@@ -18,7 +18,6 @@ import pwc.taxtech.atms.entity.AreaRegionExample; ...@@ -18,7 +18,6 @@ import pwc.taxtech.atms.entity.AreaRegionExample;
import pwc.taxtech.atms.entity.Region; import pwc.taxtech.atms.entity.Region;
import pwc.taxtech.atms.entity.RegionExample; import pwc.taxtech.atms.entity.RegionExample;
import pwc.taxtech.atms.exception.ApplicationException; import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.service.AreaRegionService;
import pwc.taxtech.atms.service.AreaService; import pwc.taxtech.atms.service.AreaService;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -37,7 +36,7 @@ public class RegionServiceImpl extends AbstractService { ...@@ -37,7 +36,7 @@ public class RegionServiceImpl extends AbstractService {
private AreaService areaService; private AreaService areaService;
@Autowired @Autowired
private AreaRegionService areaRegionService; private AreaRegionServiceImpl areaRegionService;
@Autowired @Autowired
private RegionMapper regionMapper; private RegionMapper regionMapper;
......
...@@ -28,7 +28,6 @@ import pwc.taxtech.atms.entity.UserHistoricalPasswordExample.Criteria; ...@@ -28,7 +28,6 @@ import pwc.taxtech.atms.entity.UserHistoricalPasswordExample.Criteria;
import pwc.taxtech.atms.entity.UserOrganization; import pwc.taxtech.atms.entity.UserOrganization;
import pwc.taxtech.atms.entity.UserRole; import pwc.taxtech.atms.entity.UserRole;
import pwc.taxtech.atms.security.AtmsPasswordEncoder; import pwc.taxtech.atms.security.AtmsPasswordEncoder;
import pwc.taxtech.atms.service.CommonService;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
...@@ -51,7 +50,7 @@ public class UserAccountServiceImpl extends AbstractService { ...@@ -51,7 +50,7 @@ public class UserAccountServiceImpl extends AbstractService {
@Autowired @Autowired
private UserServiceImpl userService; private UserServiceImpl userService;
@Autowired @Autowired
private CommonService commonService; private CommonServiceImpl commonService;
@Autowired @Autowired
private AtmsPasswordEncoder atmsPasswordEncoder; private AtmsPasswordEncoder atmsPasswordEncoder;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment