Commit 9ab96cbf authored by neo's avatar neo

[DEL] delete common service interface

parent 0ad0d662
package pwc.taxtech.atms.controller;
import java.util.List;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -11,12 +10,12 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.ApiOperation;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.arearegion.AreaRegionDto;
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
@RequestMapping("/api/v1/areaRegion/")
......@@ -25,12 +24,13 @@ public class AreaRegionController {
private static Logger logger = LoggerFactory.getLogger(AreaRegionController.class);
@Autowired
private AreaRegionService areaRegionService;
private AreaRegionServiceImpl areaRegionService;
@SuppressWarnings("rawtypes")
@ApiOperation(value = "Adds the specified area.")
@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");
return areaRegionService.add(areaRegionInfo);
}
......@@ -38,21 +38,24 @@ public class AreaRegionController {
@SuppressWarnings("rawtypes")
@ApiOperation(value = "Update the specified area.")
@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");
return areaRegionService.update(areaRegionInfo);
}
@ApiOperation(value = "Get cities")
@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");
return areaRegionService.getCities(parentId);
}
@ApiOperation(value = "Get Provinces")
@RequestMapping(value = "getProvinces", method = RequestMethod.GET)
public @ResponseBody List<AreaRegionDto> getProvinces() {
public @ResponseBody
List<AreaRegionDto> getProvinces() {
logger.info("/api/v1/areaRegion/getCities");
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;
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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import pwc.taxtech.atms.common.AuthUserHelper;
import pwc.taxtech.atms.common.CommonConstants;
import pwc.taxtech.atms.common.CommonUtils;
......@@ -36,8 +30,13 @@ import pwc.taxtech.atms.entity.Region;
import pwc.taxtech.atms.entity.RegionExample;
import pwc.taxtech.atms.service.OperationLogService;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class AreaRegionServiceImpl implements pwc.taxtech.atms.service.AreaRegionService {
public class AreaRegionServiceImpl {
@Autowired
private AreaRegionMapper areaRegionMapper;
......@@ -52,7 +51,6 @@ public class AreaRegionServiceImpl implements pwc.taxtech.atms.service.AreaRegio
@Autowired
private RegionMapper regionMapper;
@Override
public List<AreaRegion> findAreaRegionsByArea(String areaId) {
return areaRegionMapper.selectAreaRegionByAreaId(areaId);
......@@ -60,12 +58,11 @@ public class AreaRegionServiceImpl implements pwc.taxtech.atms.service.AreaRegio
/*
* (non-Javadoc)
*
*
* @see
* pwc.taxtech.atms.service.AreaRegionService#add(pwc.taxtech.atms.service.dto.
* AreaRegionInfo)
*/
@Override
@Transactional
public OperationResultDto add(AreaRegionInfo areaRegionInfo) {
......@@ -124,12 +121,11 @@ public class AreaRegionServiceImpl implements pwc.taxtech.atms.service.AreaRegio
/*
* (non-Javadoc)
*
*
* @see
* pwc.taxtech.atms.service.AreaRegionService#update(pwc.taxtech.atms.service.
* dto.AreaRegionInfo)
*/
@Override
@Transactional
public OperationResultDto update(AreaRegionInfo areaRegionInfo) {
......@@ -237,14 +233,12 @@ public class AreaRegionServiceImpl implements pwc.taxtech.atms.service.AreaRegio
return new OperationResultDto(true);
}
@Override
public List<AreaRegionDto> getProvinces(){
public List<AreaRegionDto> getProvinces() {
List<AreaRegionDto> provinces = getRegions(CommonConstants.REGION_LEVELTYPE_PROVINCE);
return provinces;
}
@Override
public List<AreaRegionDto> getCities(String parentId) {
List<AreaRegionDto> cities = getRegions(CommonConstants.REGION_LEVELTYPE_CITY);
List<AreaRegionDto> query = cities.stream().filter(s -> s.getRegionParentId().equals(parentId))
......
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.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.CommonConstants;
import pwc.taxtech.atms.dao.MailQueueMapper;
import pwc.taxtech.atms.dpo.EnterpriseAccountSetOrgDto;
import pwc.taxtech.atms.dto.MailMto;
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
public class CommonServiceImpl implements CommonService {
public class CommonServiceImpl {
private static final Logger logger = LoggerFactory.getLogger(CommonServiceImpl.class);
@Autowired
private MailQueueMapper mailQueueMapper;
@Override
public void sendMail(MailMto mailmto) {
logger.debug("enter sendMail");
mailmto.setFrom(CommonConstants.MailFrom);
......@@ -71,7 +68,6 @@ public class CommonServiceImpl implements CommonService {
}
@Override
public boolean isOrganizationDateTimeOverlap(List<EnterpriseAccountSetOrgDto> list) {
for (int i = list.size() - 1; i >= 0; i--) {
list.get(i).setOverlapList(new ArrayList<>());
......
......@@ -56,7 +56,6 @@ import pwc.taxtech.atms.dto.user.NameDto;
import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.entity.OrganizationExample.Criteria;
import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.service.CommonService;
import pwc.taxtech.atms.service.OperationLogService;
import java.text.SimpleDateFormat;
......@@ -100,7 +99,7 @@ public class OrganizationServiceImpl {
private DimensionServiceImpl dimensionService;
@Autowired
private CommonService commonService;
private CommonServiceImpl commonService;
@Autowired
private RoleServiceImpl roleService;
......
......@@ -18,7 +18,6 @@ import pwc.taxtech.atms.entity.AreaRegionExample;
import pwc.taxtech.atms.entity.Region;
import pwc.taxtech.atms.entity.RegionExample;
import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.service.AreaRegionService;
import pwc.taxtech.atms.service.AreaService;
import java.util.ArrayList;
......@@ -37,7 +36,7 @@ public class RegionServiceImpl extends AbstractService {
private AreaService areaService;
@Autowired
private AreaRegionService areaRegionService;
private AreaRegionServiceImpl areaRegionService;
@Autowired
private RegionMapper regionMapper;
......
......@@ -28,7 +28,6 @@ import pwc.taxtech.atms.entity.UserHistoricalPasswordExample.Criteria;
import pwc.taxtech.atms.entity.UserOrganization;
import pwc.taxtech.atms.entity.UserRole;
import pwc.taxtech.atms.security.AtmsPasswordEncoder;
import pwc.taxtech.atms.service.CommonService;
import java.util.ArrayList;
import java.util.Date;
......@@ -51,7 +50,7 @@ public class UserAccountServiceImpl extends AbstractService {
@Autowired
private UserServiceImpl userService;
@Autowired
private CommonService commonService;
private CommonServiceImpl commonService;
@Autowired
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