Commit acf7968e authored by eddie.woo's avatar eddie.woo

Merge branch 'dev_mysql' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_mysql

# Conflicts:
#	atms-api/src/main/java/pwc/taxtech/atms/service/impl/OrganizationServiceImpl.java
#	atms-dao/src/main/java/pwc/taxtech/atms/dao/OrganizationMapper.java
parents 80390685 025ef438
...@@ -2,16 +2,20 @@ package pwc.taxtech.atms; ...@@ -2,16 +2,20 @@ package pwc.taxtech.atms;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.message.ErrorMessage; import pwc.taxtech.atms.common.message.ErrorMessage;
import pwc.taxtech.atms.controller.BaseController; import pwc.taxtech.atms.controller.BaseController;
import pwc.taxtech.atms.dto.ApiResultDto; import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.analysis.AnalysisDomesticlParam;
import pwc.taxtech.atms.dto.analysis.AnalysisInternationlParam; import pwc.taxtech.atms.dto.analysis.AnalysisInternationlParam;
import pwc.taxtech.atms.dto.vatdto.CertifiedInvoicesListParam;
import pwc.taxtech.atms.exception.ServiceException; import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.service.impl.AnalysisServiceImpl; import pwc.taxtech.atms.service.impl.AnalysisServiceImpl;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
/** /**
...@@ -46,6 +50,14 @@ public class AnalysisController extends BaseController { ...@@ -46,6 +50,14 @@ public class AnalysisController extends BaseController {
} }
} }
@RequestMapping(value = "downloadDomesticFile/get", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadCILQueryData(@RequestBody AnalysisDomesticlParam param, HttpServletResponse response) {
logger.debug("enter downloadDomesticFile");
String fileName="testFile";
analysisServiceImpl.downloadDomesticFile(response, param, fileName);
}
@ResponseBody @ResponseBody
@RequestMapping(value = "getAnalysisInternationalCompanyList", method = RequestMethod.GET) @RequestMapping(value = "getAnalysisInternationalCompanyList", method = RequestMethod.GET)
public List<String> getAnalysisInternationalCompanyList(@RequestParam Integer type, @RequestParam String period) { public List<String> getAnalysisInternationalCompanyList(@RequestParam Integer type, @RequestParam String period) {
......
...@@ -7,5 +7,7 @@ public class ErrorMessageCN { ...@@ -7,5 +7,7 @@ public class ErrorMessageCN {
public static final String InconsistentPeriod = "单表中期间不一致"; public static final String InconsistentPeriod = "单表中期间不一致";
public static final String DoNotSelectPeriod = "未选择期间"; public static final String DoNotSelectPeriod = "未选择期间";
public static final String DoNotSelectCompany = "非选定主体"; public static final String DoNotSelectCompany = "非选定主体";
public static final String StrctureRepeat = "层级重复!";
public static final String BusinssUnitRepeat = "事业部重复!";
} }
...@@ -2,6 +2,7 @@ package pwc.taxtech.atms.controller; ...@@ -2,6 +2,7 @@ package pwc.taxtech.atms.controller;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import pwc.taxtech.atms.dto.ReturnData; import pwc.taxtech.atms.dto.ReturnData;
...@@ -42,11 +43,11 @@ public class OperationLogFileTypeController { ...@@ -42,11 +43,11 @@ public class OperationLogFileTypeController {
*/ */
@RequestMapping("/selectListForLog") @RequestMapping("/selectListForLog")
@ResponseBody @ResponseBody
public ReturnData selectListForLog(List<String> fileTypeIds){ public ReturnData selectListForLog(@RequestBody OperationLogFileType operationLogFileType){
List<OperationLogFileType> operationLogFileType = operationLogFileTypeService.selectListForLog(fileTypeIds); List<OperationLogFileType> operationLogFileTypes = operationLogFileTypeService.selectListForLog(operationLogFileType.getFileTypeIds());
ReturnData returnData = new ReturnData(); ReturnData returnData = new ReturnData();
returnData.setItems(operationLogFileType); returnData.setItems(operationLogFileTypes);
returnData.setTotalCount(operationLogFileType.size()); returnData.setTotalCount(operationLogFileTypes.size());
return returnData; return returnData;
} }
......
package pwc.taxtech.atms.controller; package pwc.taxtech.atms.controller;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -14,22 +15,25 @@ import org.springframework.http.MediaType; ...@@ -14,22 +15,25 @@ import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import pwc.taxtech.atms.common.message.ErrorMessage; import pwc.taxtech.atms.common.message.ErrorMessage;
import pwc.taxtech.atms.common.message.ErrorMessageCN;
import pwc.taxtech.atms.common.util.MyAsserts; import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.constant.enums.EnumAnalysisImportType; import pwc.taxtech.atms.constant.enums.EnumAnalysisImportType;
import pwc.taxtech.atms.constant.enums.EnumCitImportType; import pwc.taxtech.atms.constant.enums.EnumCitImportType;
import pwc.taxtech.atms.constant.enums.EnumImportType; import pwc.taxtech.atms.constant.enums.EnumImportType;
import pwc.taxtech.atms.dpo.TemplateUniqDto; import pwc.taxtech.atms.dpo.TemplateUniqDto;
import pwc.taxtech.atms.dto.*; import pwc.taxtech.atms.dto.*;
import pwc.taxtech.atms.dto.didiFileUpload.DidiFileIUploadParam;
import pwc.taxtech.atms.dto.didiFileUpload.DidiFileUploadDetailResult;
import pwc.taxtech.atms.dto.vatdto.TemplateByGroupDto; import pwc.taxtech.atms.dto.vatdto.TemplateByGroupDto;
import pwc.taxtech.atms.entity.Template; import pwc.taxtech.atms.entity.Template;
import pwc.taxtech.atms.exception.ApplicationException; import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.exception.BadParameterException; import pwc.taxtech.atms.exception.BadParameterException;
import pwc.taxtech.atms.exception.NotFoundException; import pwc.taxtech.atms.exception.NotFoundException;
import pwc.taxtech.atms.exception.ServiceException; import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.service.impl.DidiFileUploadService;
import pwc.taxtech.atms.service.impl.HttpFileService; import pwc.taxtech.atms.service.impl.HttpFileService;
import pwc.taxtech.atms.service.impl.ReportUploadService; import pwc.taxtech.atms.service.impl.ReportUploadService;
import pwc.taxtech.atms.service.impl.TemplateServiceImpl; import pwc.taxtech.atms.service.impl.TemplateServiceImpl;
import pwc.taxtech.atms.vat.entity.PeriodTemplate;
import pwc.taxtech.atms.vat.entity.ReportUpload; import pwc.taxtech.atms.vat.entity.ReportUpload;
import javax.servlet.ServletContext; import javax.servlet.ServletContext;
...@@ -37,8 +41,10 @@ import javax.servlet.ServletOutputStream; ...@@ -37,8 +41,10 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.io.*;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map;
@RestController @RestController
@RequestMapping(value = "api/v1/template") @RequestMapping(value = "api/v1/template")
...@@ -55,6 +61,8 @@ public class TemplateController extends BaseController { ...@@ -55,6 +61,8 @@ public class TemplateController extends BaseController {
@Autowired @Autowired
ReportUploadService reportUploadService; ReportUploadService reportUploadService;
@Autowired
DidiFileUploadService didiFileUploadService;
@RequestMapping(value = "get", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "get", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public @ResponseBody public @ResponseBody
List<TemplateDto> get(@RequestParam(name = "templateGroupID") Long templateGroupId, @RequestParam(name = "reportType") String reportType) { List<TemplateDto> get(@RequestParam(name = "templateGroupID") Long templateGroupId, @RequestParam(name = "reportType") String reportType) {
...@@ -170,6 +178,81 @@ public class TemplateController extends BaseController { ...@@ -170,6 +178,81 @@ public class TemplateController extends BaseController {
} }
} }
@RequestMapping(value = "getPeriodTemplateJson", method = RequestMethod.POST, produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
public @ResponseBody
void getPeriodTemplateBlob(@RequestParam(name = "templateId") Long templateId,
@RequestParam(name = "period") Integer period,
@RequestParam(name = "projectId") String projectId,
HttpServletResponse response) throws URISyntaxException {
String filePath;
File templateFile;
InputStream inputStream = null;
List<PeriodTemplate> templates = templateService.getPeriodTemplates(templateId,period,projectId);
MyAsserts.assertNotEmpty(templates, new NotFoundException());
PeriodTemplate template = templates.get(0);
String templatePath = template.getPath();
MyAsserts.assertNotEmpty(templatePath, new NotFoundException());
filePath = this.getClass().getResource("").toURI().getPath();
String tempPath = filePath.substring(0, filePath.indexOf("classes") + "\\classes".length());
templateFile = new File(tempPath + templatePath);
OutputStream out = null;
try {
//如果是系统报表就取本地文件夹,如果不是就取FTP
if (template.getIsSystemType()) {
inputStream = new BufferedInputStream(new FileInputStream(templateFile));
} else {
if (templatePath.indexOf("/") <= 0) {
DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
fileParam.setUuids(Arrays.asList(templatePath));
PageInfo<DidiFileUploadDetailResult> uploadDetail = didiFileUploadService.queryPage(fileParam);
Map<String, String> urlMap = null;
if (CollectionUtils.isNotEmpty(uploadDetail.getList())) {
templatePath = uploadDetail.getList().get(0).getViewHttpUrl();
}
}
inputStream = httpFileService.getUserTemplate(templatePath);
}
//客户端保存的文件名
String customFileName = "template_" + DateTime.now().toString("yyyyMMddHHmmss") + ".xlsx";
response.setHeader("Content-Disposition", String.format("inline; filename=\"" + customFileName + "\""));
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
// int len = 0;
// byte[] buffer = new byte[1024];
// out = response.getOutputStream();
// while ((len = inputStream.read(buffer)) > 0) {
// out.write(buffer, 0, len);
// }
out = response.getOutputStream();
IOUtils.copy(handleFomularView(inputStream), out);
out.flush();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (Exception e) {
logger.error("Error downloading template file template.xlsx", e);
throw new ApplicationException("Error downloading template file template.xlsx", e);
} finally {
if (out != null) {
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
out = null;
}
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
inputStream = null;
}
}
}
private File getTempFile(String templatePath) throws URISyntaxException { private File getTempFile(String templatePath) throws URISyntaxException {
String filePath = this.getClass().getResource("").toURI().getPath(); String filePath = this.getClass().getResource("").toURI().getPath();
String tempPath = filePath.substring(0, filePath.indexOf("classes") + "\\classes".length()); String tempPath = filePath.substring(0, filePath.indexOf("classes") + "\\classes".length());
......
/*
package pwc.taxtech.atms.data; package pwc.taxtech.atms.data;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -19,11 +20,13 @@ import pwc.taxtech.atms.entity.RoleExample; ...@@ -19,11 +20,13 @@ import pwc.taxtech.atms.entity.RoleExample;
import javax.annotation.Resource; import javax.annotation.Resource;
*/
/** /**
* @Auther: Gary J Li * @Auther: Gary J Li
* @Date: 11/01/2019 14:53 * @Date: 11/01/2019 14:53
* @Description:将Role存入ehcache,提高查询效率 * @Description:将Role存入ehcache,提高查询效率
*/ *//*
@Service @Service
public class RoleData { public class RoleData {
...@@ -32,13 +35,15 @@ public class RoleData { ...@@ -32,13 +35,15 @@ public class RoleData {
@Resource @Resource
private RoleMapper roleMapper; private RoleMapper roleMapper;
/** */
/**
* 11/01/2019 16:15 * 11/01/2019 16:15
* 根据serviceTypeId查询,存入ehcache * 根据serviceTypeId查询,存入ehcache
* [serviceTypeId] * [serviceTypeId]
* @author Gary J Li * @author Gary J Li
* @return List<Role> roleList * @return List<Role> roleList
*/ *//*
@Cacheable(value = "roleByServiceTypeIdCache", key = "#serviceTypeId") @Cacheable(value = "roleByServiceTypeIdCache", key = "#serviceTypeId")
public List<Role> selectByServiceTypeId(String serviceTypeId){ public List<Role> selectByServiceTypeId(String serviceTypeId){
List<Role> roleList = new ArrayList<>(); List<Role> roleList = new ArrayList<>();
...@@ -54,13 +59,15 @@ public class RoleData { ...@@ -54,13 +59,15 @@ public class RoleData {
return roleList; return roleList;
} }
/** */
/**
* 11/01/2019 16:16 * 11/01/2019 16:16
* 根据id查询,存入ehcache * 根据id查询,存入ehcache
* [id] * [id]
* @author Gary J Li * @author Gary J Li
* @return Role role * @return Role role
*/ *//*
@Cacheable(value = "roleByIdCache", key = "#id") @Cacheable(value = "roleByIdCache", key = "#id")
public Role selectByPrimaryKey(String id){ public Role selectByPrimaryKey(String id){
Role role = new Role(); Role role = new Role();
...@@ -72,13 +79,15 @@ public class RoleData { ...@@ -72,13 +79,15 @@ public class RoleData {
return role; return role;
} }
/** */
/**
* 11/01/2019 16:17 * 11/01/2019 16:17
* 根据主键id删除,并把ehcache里的role都删掉 * 根据主键id删除,并把ehcache里的role都删掉
* [roleDto] * [roleDto]
* @author Gary J Li * @author Gary J Li
* @return int res * @return int res
*/ *//*
@Caching(evict= {@CacheEvict(value = "roleByServiceTypeIdCache", key = "#role.getServiceTypeId()"),@CacheEvict(value = "roleByIdCache", key = "#role.getId()")} ) @Caching(evict= {@CacheEvict(value = "roleByServiceTypeIdCache", key = "#role.getServiceTypeId()"),@CacheEvict(value = "roleByIdCache", key = "#role.getId()")} )
public int deleteByPrimaryKey(RoleDto roleDto){ public int deleteByPrimaryKey(RoleDto roleDto){
int res = 0; int res = 0;
...@@ -90,13 +99,15 @@ public class RoleData { ...@@ -90,13 +99,15 @@ public class RoleData {
return res; return res;
} }
/** */
/**
* 11/01/2019 16:20 * 11/01/2019 16:20
* role写入,并在缓存里写入两个Hash(ServiceTypeId,Id)里 * role写入,并在缓存里写入两个Hash(ServiceTypeId,Id)里
* [role] * [role]
* @author Gary J Li * @author Gary J Li
* @return Role role * @return Role role
*/ *//*
@Caching(put= {@CachePut(value = "roleByServiceTypeIdCache", key = "#role.getServiceTypeId()"),@CachePut(value = "roleByIdCache", key = "#role.getId()")} ) @Caching(put= {@CachePut(value = "roleByServiceTypeIdCache", key = "#role.getServiceTypeId()"),@CachePut(value = "roleByIdCache", key = "#role.getId()")} )
public Role insert(Role role){ public Role insert(Role role){
try{ try{
...@@ -107,13 +118,15 @@ public class RoleData { ...@@ -107,13 +118,15 @@ public class RoleData {
return role; return role;
} }
/** */
/**
* 11/01/2019 16:22 * 11/01/2019 16:22
* role更新,并在缓存里更新两个Hash(ServiceTypeId,Id)里 * role更新,并在缓存里更新两个Hash(ServiceTypeId,Id)里
* [role] * [role]
* @author Gary J Li * @author Gary J Li
* @return Role role * @return Role role
*/ *//*
@Caching(put= {@CachePut(value = "roleByServiceTypeIdCache", key = "#role.getServiceTypeId()"),@CachePut(value = "roleByIdCache", key = "#role.getId()")} ) @Caching(put= {@CachePut(value = "roleByServiceTypeIdCache", key = "#role.getServiceTypeId()"),@CachePut(value = "roleByIdCache", key = "#role.getId()")} )
public Role updateByPrimaryKey(Role role){ public Role updateByPrimaryKey(Role role){
try{ try{
...@@ -124,3 +137,4 @@ public class RoleData { ...@@ -124,3 +137,4 @@ public class RoleData {
return role; return role;
} }
} }
*/
/*
package pwc.taxtech.atms.data; package pwc.taxtech.atms.data;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -11,11 +12,13 @@ import pwc.taxtech.atms.entity.RolePermission; ...@@ -11,11 +12,13 @@ import pwc.taxtech.atms.entity.RolePermission;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
*/
/** /**
* @Auther: Gary J Li * @Auther: Gary J Li
* @Date: 11/01/2019 14:53 * @Date: 11/01/2019 14:53
* @Description: * @Description:
*/ *//*
@Service @Service
public class RolePermissionData { public class RolePermissionData {
...@@ -30,3 +33,4 @@ public class RolePermissionData { ...@@ -30,3 +33,4 @@ public class RolePermissionData {
} }
} }
*/
/*
package pwc.taxtech.atms.data; package pwc.taxtech.atms.data;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -8,11 +9,13 @@ import org.springframework.stereotype.Service; ...@@ -8,11 +9,13 @@ import org.springframework.stereotype.Service;
import pwc.taxtech.atms.dao.UserMapper; import pwc.taxtech.atms.dao.UserMapper;
import pwc.taxtech.atms.entity.User; import pwc.taxtech.atms.entity.User;
*/
/** /**
* @Auther: Gary J Li * @Auther: Gary J Li
* @Date: 11/01/2019 14:32 * @Date: 11/01/2019 14:32
* @Description: * @Description:
*/ *//*
@Service @Service
public class UserData { public class UserData {
private static final Logger logger = LoggerFactory.getLogger(UserData.class); private static final Logger logger = LoggerFactory.getLogger(UserData.class);
...@@ -25,3 +28,4 @@ public class UserData { ...@@ -25,3 +28,4 @@ public class UserData {
return userMapper.selectByUserNameIgnoreCase(inputLoginName); return userMapper.selectByUserNameIgnoreCase(inputLoginName);
} }
} }
*/
package pwc.taxtech.atms.dto.analysis;
/**
* @Auther: Gary J Li
* @Date: 14/03/2019 11:28
* @Description:
*/
public class AnalysisDomesticlParam {
private Integer type;
private String period;
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getPeriod() {
return period;
}
public void setPeriod(String period) {
this.period = period;
}
}
...@@ -14,6 +14,7 @@ import pwc.taxtech.atms.dto.analysis.*; ...@@ -14,6 +14,7 @@ import pwc.taxtech.atms.dto.analysis.*;
import pwc.taxtech.atms.exception.ServiceException; import pwc.taxtech.atms.exception.ServiceException;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream; import java.io.InputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.DecimalFormat; import java.text.DecimalFormat;
...@@ -613,6 +614,33 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -613,6 +614,33 @@ public class AnalysisServiceImpl extends BaseService {
return objects; return objects;
} }
public void downloadDomesticFile(HttpServletResponse response, AnalysisDomesticlParam param, String fileName) {
/*String excelTemplatePathInClassPath = ExportTemplatePathConstant.CERTIFIED_INVOICES_LIST;
CertifiedInvoicesListCondition condition = beanUtil.copyProperties(param, new CertifiedInvoicesListCondition());
List<CertifiedInvoicesList> datas = certifiedInvoicesListMapper.selectByCondition(condition);
if(datas.size()<1){
throw new ServiceException(ErrorMessage.ExportFailed);
}
CertifiedInvoicesListHeader header = new CertifiedInvoicesListHeader();
Organization org = organizationMapper.selectByPrimaryKey(param.getOrgId());
header.setTaxPayerNumber(org.getTaxPayerNumber());
header.setPeriod(param.getPeriodStart());
header.setUnit(datas.get(0).getUnit());
List<CertifiedInvoicesListDto> dtoList = Lists.newArrayList();
datas.forEach(cil -> {
CertifiedInvoicesListDto dto = beanUtil.copyProperties(cil, new CertifiedInvoicesListDto());
dtoList.add(dto);
});
OutputStream outputStream = commonDocumentHelper.toXlsxFileUsingJxls(header,dtoList, excelTemplatePathInClassPath);
try {
return responseMessageBuilder.getDownloadTmpResponseMessage(response, outputStream, fileName);
} catch (Exception e) {
logger.error(String.format("导出已认证发票清单异常:%s",e.getMessage()));
}
return null;*/
}
public List<String> getAnalysisInternationalCompanyList(Integer type, String periodStr) { public List<String> getAnalysisInternationalCompanyList(Integer type, String periodStr) {
List<String> companyList = Lists.newArrayList(); List<String> companyList = Lists.newArrayList();
Integer period = DateUtils.strToPeriod(periodStr); Integer period = DateUtils.strToPeriod(periodStr);
...@@ -717,5 +745,4 @@ public class AnalysisServiceImpl extends BaseService { ...@@ -717,5 +745,4 @@ public class AnalysisServiceImpl extends BaseService {
} }
return false; return false;
} }
} }
...@@ -91,7 +91,7 @@ public class AreaRegionServiceImpl { ...@@ -91,7 +91,7 @@ public class AreaRegionServiceImpl {
AreaRegion provinceRegion = new AreaRegion(); AreaRegion provinceRegion = new AreaRegion();
provinceRegion.setId(CommonUtils.getUUID()); provinceRegion.setId(CommonUtils.getUUID());
provinceRegion.setAreaId(area.getId()); provinceRegion.setAreaId(area.getId());
provinceRegion.setRegionId(null==provinceId?"":area.getId()); provinceRegion.setRegionId(null==provinceId?"":provinceId);
areaRegionMapper.insert(provinceRegion); areaRegionMapper.insert(provinceRegion);
} }
// city // city
......
...@@ -12,6 +12,7 @@ import pwc.taxtech.atms.common.CommonUtils; ...@@ -12,6 +12,7 @@ import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.OperateLogType; import pwc.taxtech.atms.common.OperateLogType;
import pwc.taxtech.atms.common.OperationAction; import pwc.taxtech.atms.common.OperationAction;
import pwc.taxtech.atms.common.OperationModule; import pwc.taxtech.atms.common.OperationModule;
import pwc.taxtech.atms.common.message.ErrorMessageCN;
import pwc.taxtech.atms.dao.BusinessUnitMapper; import pwc.taxtech.atms.dao.BusinessUnitMapper;
import pwc.taxtech.atms.dto.BusinessUnitDto; import pwc.taxtech.atms.dto.BusinessUnitDto;
import pwc.taxtech.atms.dto.BusinessUnitInputDto; import pwc.taxtech.atms.dto.BusinessUnitInputDto;
...@@ -128,6 +129,9 @@ public class BusinessUnitServiceImpl { ...@@ -128,6 +129,9 @@ public class BusinessUnitServiceImpl {
if (businessUnit == null) { if (businessUnit == null) {
throw new ApplicationException("can't find business unit, id: " + businessUnitDto.getId()); throw new ApplicationException("can't find business unit, id: " + businessUnitDto.getId());
} }
if(businessUnit.getName().equals(businessUnitDto.getName())){
throw new ApplicationException(ErrorMessageCN.BusinssUnitRepeat);
}
// copy current businessUnit as tmp // copy current businessUnit as tmp
BusinessUnit originBusinessUnit = new BusinessUnit(); BusinessUnit originBusinessUnit = new BusinessUnit();
......
...@@ -6,7 +6,6 @@ import org.springframework.stereotype.Service; ...@@ -6,7 +6,6 @@ import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import pwc.taxtech.atms.common.CommonConstants; import pwc.taxtech.atms.common.CommonConstants;
import pwc.taxtech.atms.common.CommonUtils; import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.data.RoleData;
import pwc.taxtech.atms.dto.datainit.DataCountDto; import pwc.taxtech.atms.dto.datainit.DataCountDto;
import pwc.taxtech.atms.dto.datainit.DataInitDto; import pwc.taxtech.atms.dto.datainit.DataInitDto;
import pwc.taxtech.atms.dto.user.UserTemp; import pwc.taxtech.atms.dto.user.UserTemp;
...@@ -31,9 +30,6 @@ public class DataInitServiceImpl extends AbstractService { ...@@ -31,9 +30,6 @@ public class DataInitServiceImpl extends AbstractService {
@Autowired @Autowired
private FileService fileService; private FileService fileService;
@Autowired
private RoleData roleData;
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
...@@ -646,7 +642,7 @@ public class DataInitServiceImpl extends AbstractService { ...@@ -646,7 +642,7 @@ public class DataInitServiceImpl extends AbstractService {
/** /**
* 导入机构层级数据 * 导入机构层级数据
* *
* @param orgStructureList * @param dataInitDto
* @return * @return
*/ */
private void importOrgStructure(DataInitDto dataInitDto) { private void importOrgStructure(DataInitDto dataInitDto) {
...@@ -717,7 +713,7 @@ public class DataInitServiceImpl extends AbstractService { ...@@ -717,7 +713,7 @@ public class DataInitServiceImpl extends AbstractService {
/** /**
* 导入区域数据 * 导入区域数据
* *
* @param orgStructureList * @param dataInitDto
* @return * @return
*/ */
private void importArea(DataInitDto dataInitDto) { private void importArea(DataInitDto dataInitDto) {
...@@ -774,7 +770,7 @@ public class DataInitServiceImpl extends AbstractService { ...@@ -774,7 +770,7 @@ public class DataInitServiceImpl extends AbstractService {
/** /**
* 导入企业科目数据 * 导入企业科目数据
* *
* @param orgStructureList * @param dataInitDto
* @return * @return
*/ */
private void importEnterpriseAccount(DataInitDto dataInitDto) { private void importEnterpriseAccount(DataInitDto dataInitDto) {
...@@ -916,8 +912,8 @@ public class DataInitServiceImpl extends AbstractService { ...@@ -916,8 +912,8 @@ public class DataInitServiceImpl extends AbstractService {
RoleCategory newObject = queryList.stream().filter(a -> Objects.equals(a.getName(), oldId)).findFirst().orElse(null); RoleCategory newObject = queryList.stream().filter(a -> Objects.equals(a.getName(), oldId)).findFirst().orElse(null);
role.setRoleCategoryId(newObject == null ? null : newObject.getId()); role.setRoleCategoryId(newObject == null ? null : newObject.getId());
try { try {
// roleMapper.insert(role); roleMapper.insert(role);
roleData.insert(role); // roleData.insert(role);
} catch (Exception e) { } catch (Exception e) {
logger.debug("Error inserting 角色: " + e.getMessage()); logger.debug("Error inserting 角色: " + e.getMessage());
errorCount++; errorCount++;
...@@ -950,8 +946,8 @@ public class DataInitServiceImpl extends AbstractService { ...@@ -950,8 +946,8 @@ public class DataInitServiceImpl extends AbstractService {
// 插入User // 插入User
userTempList = dataInitDto.getImportUserTemp(); userTempList = dataInitDto.getImportUserTemp();
List<Organization> orgList = organizationMapper.selectByExample(null); List<Organization> orgList = organizationMapper.selectByExample(null);
// List<Role> roleList = roleMapper.selectByExample(null); List<Role> roleList = roleMapper.selectByExample(null);
List<Role> roleList = roleData.selectByServiceTypeId("All"); // List<Role> roleList = roleData.selectByServiceTypeId("All");
for (UserTemp item : userTempList) { for (UserTemp item : userTempList) {
try { try {
User user = new User(); User user = new User();
......
...@@ -51,7 +51,9 @@ public class OperationLogFileTypeServiceImpl { ...@@ -51,7 +51,9 @@ public class OperationLogFileTypeServiceImpl {
public List<OperationLogFileType> selectListForLog(List<String> fileTypeIds) { public List<OperationLogFileType> selectListForLog(List<String> fileTypeIds) {
OperationLogFileTypeExample example = new OperationLogFileTypeExample(); OperationLogFileTypeExample example = new OperationLogFileTypeExample();
OperationLogFileTypeExample.Criteria criteria = example.createCriteria(); OperationLogFileTypeExample.Criteria criteria = example.createCriteria();
criteria.andIdIn(fileTypeIds); if (null != fileTypeIds && fileTypeIds.size()>0){
criteria.andIdIn(fileTypeIds);
}
return operationLogFileTypeMapper.selectByExample(example); return operationLogFileTypeMapper.selectByExample(example);
} }
} }
...@@ -3240,4 +3240,8 @@ public class OrganizationServiceImpl extends BaseService{ ...@@ -3240,4 +3240,8 @@ public class OrganizationServiceImpl extends BaseService{
return organizationMapper.getMyOrgCodeList(uid); return organizationMapper.getMyOrgCodeList(uid);
} }
} }
public String queryBusinessByCompanyId(String companyId) {
return organizationMapper.queryBusinessByCompanyId(companyId);
}
} }
...@@ -12,6 +12,7 @@ import pwc.taxtech.atms.common.CommonUtils; ...@@ -12,6 +12,7 @@ import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.OperateLogType; import pwc.taxtech.atms.common.OperateLogType;
import pwc.taxtech.atms.common.OperationAction; import pwc.taxtech.atms.common.OperationAction;
import pwc.taxtech.atms.common.OperationModule; import pwc.taxtech.atms.common.OperationModule;
import pwc.taxtech.atms.common.message.ErrorMessageCN;
import pwc.taxtech.atms.dao.OrganizationStructureMapper; import pwc.taxtech.atms.dao.OrganizationStructureMapper;
import pwc.taxtech.atms.dto.IdModel; import pwc.taxtech.atms.dto.IdModel;
import pwc.taxtech.atms.dto.OperationLogDto; import pwc.taxtech.atms.dto.OperationLogDto;
...@@ -66,6 +67,11 @@ public class OrganizationStructureServiceImpl { ...@@ -66,6 +67,11 @@ public class OrganizationStructureServiceImpl {
} }
public void addOrganizationStructure(OrganizationStructureInputDto organizationStructureDto) { public void addOrganizationStructure(OrganizationStructureInputDto organizationStructureDto) {
OrganizationStructureExample example = new OrganizationStructureExample();
example.createCriteria().andNameEqualTo(organizationStructureDto.getName());
if(organizationStructureMapper.countByExample(example)>0){
throw new ApplicationException(ErrorMessageCN.StrctureRepeat);
}
OrganizationStructure organizationStructure = rotateOrganizationStructureDto(organizationStructureDto); OrganizationStructure organizationStructure = rotateOrganizationStructureDto(organizationStructureDto);
organizationStructure.setId(CommonUtils.getUUID()); organizationStructure.setId(CommonUtils.getUUID());
organizationStructure.setCreateTime(new Date()); organizationStructure.setCreateTime(new Date());
...@@ -136,8 +142,8 @@ public class OrganizationStructureServiceImpl { ...@@ -136,8 +142,8 @@ public class OrganizationStructureServiceImpl {
OrganizationStructure originOrganizationStructure = new OrganizationStructure(); OrganizationStructure originOrganizationStructure = new OrganizationStructure();
CommonUtils.copyProperties(organizationStructure, originOrganizationStructure); CommonUtils.copyProperties(organizationStructure, originOrganizationStructure);
if (organizationStructureDto.getIsActive().equals(organizationStructure.getIsActive()) || if (!organizationStructureDto.getIsActive().equals(organizationStructure.getIsActive()) ||
org.apache.commons.lang3.StringUtils.equals( organizationStructureDto.getName(),organizationStructure.getName())) { !org.apache.commons.lang3.StringUtils.equals( organizationStructureDto.getName(),organizationStructure.getName())) {
isStatusChangeOperation = true; isStatusChangeOperation = true;
organizationStructure.setIsActive(organizationStructureDto.getIsActive()); organizationStructure.setIsActive(organizationStructureDto.getIsActive());
organizationStructure.setName(organizationStructureDto.getName()); organizationStructure.setName(organizationStructureDto.getName());
......
...@@ -47,6 +47,12 @@ public class TaxDocumentServiceImpl { ...@@ -47,6 +47,12 @@ public class TaxDocumentServiceImpl {
@Autowired @Autowired
DidiFileUploadService didiFileUploadService; DidiFileUploadService didiFileUploadService;
@Autowired
private BusinessUnitServiceImpl businessUnitService;
@Autowired
private OrganizationServiceImpl organizationService;
public List<TaxDocument> selectTaxDocumentList(TaxDocumentDto taxDocumentDto) { public List<TaxDocument> selectTaxDocumentList(TaxDocumentDto taxDocumentDto) {
List<TaxDocument> dataList = taxDocumentMapper.selectByExample(getExample(taxDocumentDto)); List<TaxDocument> dataList = taxDocumentMapper.selectByExample(getExample(taxDocumentDto));
DidiFileIUploadParam fileParam = new DidiFileIUploadParam(); DidiFileIUploadParam fileParam = new DidiFileIUploadParam();
...@@ -123,15 +129,15 @@ public class TaxDocumentServiceImpl { ...@@ -123,15 +129,15 @@ public class TaxDocumentServiceImpl {
} }
//实物索引号 physicalIndexNumber //实物索引号 physicalIndexNumber
if (StringUtils.isNotBlank(taxDocumentDto.getPhysicalIndexNumber())) { if (StringUtils.isNotBlank(taxDocumentDto.getPhysicalIndexNumber())) {
criteria.andPhysicalIndexNumberEqualTo(taxDocumentDto.getPhysicalIndexNumber()); criteria.andPhysicalIndexNumberLike("%" + taxDocumentDto.getPhysicalIndexNumber() + "%");
} }
//实物存放地点 storageArea //实物存放地点 storageArea
if (StringUtils.isNotBlank(taxDocumentDto.getStorageArea())) { if (StringUtils.isNotBlank(taxDocumentDto.getStorageArea())) {
criteria.andStorageAreaEqualTo(taxDocumentDto.getStorageArea()); criteria.andStorageAreaLike("%" + taxDocumentDto.getStorageArea() + "%");
} }
//实物保管人 keeper //实物保管人 keeper
if (StringUtils.isNotBlank(taxDocumentDto.getKeeper())) { if (StringUtils.isNotBlank(taxDocumentDto.getKeeper())) {
criteria.andKeeperEqualTo(taxDocumentDto.getKeeper()); criteria.andKeeperLike("%" + taxDocumentDto.getKeeper() + "%");
} }
//审批状态 auditStatus //审批状态 auditStatus
if (null != taxDocumentDto.getAuditStatus()) { if (null != taxDocumentDto.getAuditStatus()) {
...@@ -179,6 +185,11 @@ public class TaxDocumentServiceImpl { ...@@ -179,6 +185,11 @@ public class TaxDocumentServiceImpl {
taxDocument.setUploadTime(new Date()); taxDocument.setUploadTime(new Date());
taxDocument.setYearRedundancy(Calendar.getInstance().get(Calendar.YEAR)); taxDocument.setYearRedundancy(Calendar.getInstance().get(Calendar.YEAR));
Long id = taxDocumentMapper.insert(taxDocument); Long id = taxDocumentMapper.insert(taxDocument);
//根据公司Id 设置业务线
String businessLine = organizationService.queryBusinessByCompanyId(taxDocument.getCompanyId());
if (StringUtils.isNotBlank(businessLine)) {
taxDocument.setBusinessLine(businessLine);
}
if (id > 0) { if (id > 0) {
OperationLogTaxDocument actionEntity = buildOperationLogTaxDocument(); OperationLogTaxDocument actionEntity = buildOperationLogTaxDocument();
actionEntity.setId(id.toString()); actionEntity.setId(id.toString());
...@@ -232,24 +243,22 @@ public class TaxDocumentServiceImpl { ...@@ -232,24 +243,22 @@ public class TaxDocumentServiceImpl {
@Transactional @Transactional
public boolean batchDelete(List<Long> ids) { public boolean batchDelete(List<Long> ids) {
try { try {
if ( null == ids || ids.size() < 1) { if (null == ids || ids.size() < 1) {
return false; return false;
} }
for (Long id : ids) { int num = taxDocumentMapper.batchDelete(ids);
int num = taxDocumentMapper.deleteByPrimaryKey(id); if (num > 0) {
if (num > 0) { for (Long id : ids) {
OperationLogTaxDocument actionEntity = buildOperationLogTaxDocument(); OperationLogTaxDocument actionEntity = buildOperationLogTaxDocument();
actionEntity.setOperationAction("删除"); actionEntity.setOperationAction("删除");
actionEntity.setId(id.toString()); actionEntity.setId(id.toString());
boolean result = operationLogTaxDocService.addTaxDocumentList(actionEntity); boolean result = operationLogTaxDocService.addTaxDocumentList(actionEntity);
if (result) { if (!result) {
return true;
} else {
throw new RuntimeException("TaxDocumentServiceImpl batchDeleteTaxDocument log error"); throw new RuntimeException("TaxDocumentServiceImpl batchDeleteTaxDocument log error");
} }
} else {
return false;
} }
} else {
return false;
} }
return true; return true;
} catch (Exception e) { } catch (Exception e) {
......
...@@ -18,8 +18,12 @@ import pwc.taxtech.atms.dto.didiFileUpload.DidiFileUploadDetailResult; ...@@ -18,8 +18,12 @@ import pwc.taxtech.atms.dto.didiFileUpload.DidiFileUploadDetailResult;
import pwc.taxtech.atms.dto.vatdto.TemplateByGroupDto; import pwc.taxtech.atms.dto.vatdto.TemplateByGroupDto;
import pwc.taxtech.atms.entity.*; import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.vat.dao.PeriodReportMapper; import pwc.taxtech.atms.vat.dao.PeriodReportMapper;
import pwc.taxtech.atms.vat.dao.PeriodTemplateMapper;
import pwc.taxtech.atms.vat.entity.PeriodReportExample; import pwc.taxtech.atms.vat.entity.PeriodReportExample;
import pwc.taxtech.atms.vat.entity.PeriodTemplate;
import pwc.taxtech.atms.vat.entity.PeriodTemplateExample;
import javax.annotation.Resource;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -28,9 +32,11 @@ import static java.util.stream.Collectors.groupingBy; ...@@ -28,9 +32,11 @@ import static java.util.stream.Collectors.groupingBy;
@Service @Service
public class TemplateServiceImpl extends AbstractService { public class TemplateServiceImpl extends AbstractService {
@Autowired @Resource
private PeriodReportMapper periodReportMapper; private PeriodReportMapper periodReportMapper;
@Resource
private PeriodTemplateMapper periodTemplateMapper;
@Autowired @Autowired
private DidiFileUploadService didiFileUploadService; private DidiFileUploadService didiFileUploadService;
public void addExistTemplate(TemplateAddExistDto templateAddExistDto){ public void addExistTemplate(TemplateAddExistDto templateAddExistDto){
...@@ -112,6 +118,12 @@ public class TemplateServiceImpl extends AbstractService { ...@@ -112,6 +118,12 @@ public class TemplateServiceImpl extends AbstractService {
return templateDtos; return templateDtos;
} }
public List<PeriodTemplate> getPeriodTemplates(Long templateId,Integer period,String projectId ){
PeriodTemplateExample example = new PeriodTemplateExample();
example.createCriteria().andProjectIdEqualTo(projectId).andTemplateIdEqualTo(templateId).andPeriodEqualTo(period);
return periodTemplateMapper.selectByExample(example);
}
public String getTemplatePath(Long templateId) { public String getTemplatePath(Long templateId) {
String result = ""; String result = "";
Template template = templateMapper.selectByPrimaryKey(templateId); Template template = templateMapper.selectByPrimaryKey(templateId);
......
...@@ -12,7 +12,6 @@ import pwc.taxtech.atms.common.*; ...@@ -12,7 +12,6 @@ import pwc.taxtech.atms.common.*;
import pwc.taxtech.atms.common.message.UserMessage; import pwc.taxtech.atms.common.message.UserMessage;
import pwc.taxtech.atms.dao.UserHistoricalPasswordMapper; import pwc.taxtech.atms.dao.UserHistoricalPasswordMapper;
import pwc.taxtech.atms.dao.UserMapper; import pwc.taxtech.atms.dao.UserMapper;
import pwc.taxtech.atms.data.RoleData;
import pwc.taxtech.atms.dto.ForgetPasswordDto; import pwc.taxtech.atms.dto.ForgetPasswordDto;
import pwc.taxtech.atms.dto.LoginOutputDto; import pwc.taxtech.atms.dto.LoginOutputDto;
import pwc.taxtech.atms.dto.MailMto; import pwc.taxtech.atms.dto.MailMto;
...@@ -20,13 +19,8 @@ import pwc.taxtech.atms.dto.OperationResultDto; ...@@ -20,13 +19,8 @@ import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.UpdateLogParams; import pwc.taxtech.atms.dto.UpdateLogParams;
import pwc.taxtech.atms.dto.user.UserAndUserRoleSaveDto; import pwc.taxtech.atms.dto.user.UserAndUserRoleSaveDto;
import pwc.taxtech.atms.dto.user.UserPasswordDto; import pwc.taxtech.atms.dto.user.UserPasswordDto;
import pwc.taxtech.atms.entity.Role; import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.entity.User;
import pwc.taxtech.atms.entity.UserHistoricalPassword;
import pwc.taxtech.atms.entity.UserHistoricalPasswordExample;
import pwc.taxtech.atms.entity.UserHistoricalPasswordExample.Criteria; 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.security.AtmsPasswordEncoder;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -58,8 +52,6 @@ public class UserAccountServiceImpl extends AbstractService { ...@@ -58,8 +52,6 @@ public class UserAccountServiceImpl extends AbstractService {
private AuthUserHelper authUserHelper; private AuthUserHelper authUserHelper;
@Autowired @Autowired
private AtmsApiSettings atmsApiSettings; private AtmsApiSettings atmsApiSettings;
@Autowired
private RoleData roleData;
public OperationResultDto<LoginOutputDto> changeExternalUserPassword(UserPasswordDto userPasswordDto) { public OperationResultDto<LoginOutputDto> changeExternalUserPassword(UserPasswordDto userPasswordDto) {
logger.debug("修改密码 Start"); logger.debug("修改密码 Start");
...@@ -318,8 +310,8 @@ public class UserAccountServiceImpl extends AbstractService { ...@@ -318,8 +310,8 @@ public class UserAccountServiceImpl extends AbstractService {
logger.debug("Start to insert new user [ {} ]", user.getId()); logger.debug("Start to insert new user [ {} ]", user.getId());
userMapper.insert(user); userMapper.insert(user);
List<String> arrRoles = userAndUserRoleSaveDto.getRoleIds(); List<String> arrRoles = userAndUserRoleSaveDto.getRoleIds();
// List<Role> roleQuery = roleMapper.selectByExample(new RoleExample()); List<Role> roleQuery = roleMapper.selectByExample(new RoleExample());
List<Role> roleQuery = roleData.selectByServiceTypeId("All"); // List<Role> roleQuery = roleData.selectByServiceTypeId("All");
if (arrRoles != null && !arrRoles.isEmpty()) { if (arrRoles != null && !arrRoles.isEmpty()) {
for (String role : arrRoles) { for (String role : arrRoles) {
UserRole userRole = new UserRole(); UserRole userRole = new UserRole();
......
...@@ -17,7 +17,6 @@ import pwc.taxtech.atms.common.message.LogMessage; ...@@ -17,7 +17,6 @@ import pwc.taxtech.atms.common.message.LogMessage;
import pwc.taxtech.atms.common.message.UserMessage; import pwc.taxtech.atms.common.message.UserMessage;
import pwc.taxtech.atms.constant.DimensionConstant; import pwc.taxtech.atms.constant.DimensionConstant;
import pwc.taxtech.atms.constant.UserConstant; import pwc.taxtech.atms.constant.UserConstant;
import pwc.taxtech.atms.data.RoleData;
import pwc.taxtech.atms.dpo.DimensionValueOrgDto; import pwc.taxtech.atms.dpo.DimensionValueOrgDto;
import pwc.taxtech.atms.dpo.OrganizationDto; import pwc.taxtech.atms.dpo.OrganizationDto;
import pwc.taxtech.atms.dpo.RoleInfo; import pwc.taxtech.atms.dpo.RoleInfo;
...@@ -65,9 +64,6 @@ public class UserRoleServiceImpl extends AbstractService { ...@@ -65,9 +64,6 @@ public class UserRoleServiceImpl extends AbstractService {
@Autowired @Autowired
private UserServiceImpl userService; private UserServiceImpl userService;
@Autowired
private RoleData roleData;
public OrgRoleDtoList getUserRoleByUserId(String userId) { public OrgRoleDtoList getUserRoleByUserId(String userId) {
logger.debug("UserRoleServiceImpl getUserRoleByUserId [ userId: {} ]", userId); logger.debug("UserRoleServiceImpl getUserRoleByUserId [ userId: {} ]", userId);
OrgRoleDtoList result = new OrgRoleDtoList(); OrgRoleDtoList result = new OrgRoleDtoList();
...@@ -1245,8 +1241,8 @@ public class UserRoleServiceImpl extends AbstractService { ...@@ -1245,8 +1241,8 @@ public class UserRoleServiceImpl extends AbstractService {
} }
// 添加日志 // 添加日志
for (UserDimensionValueRole r : target) { for (UserDimensionValueRole r : target) {
// Role role = roleMapper.selectByPrimaryKey(r.getRoleId()); Role role = roleMapper.selectByPrimaryKey(r.getRoleId());
Role role = roleData.selectByPrimaryKey(r.getRoleId()); // Role role = roleData.selectByPrimaryKey(r.getRoleId());
String roleName = role == null ? "" : role.getName(); String roleName = role == null ? "" : role.getName();
addOrDeleteDataAddLog( addOrDeleteDataAddLog(
dimensionName + CommonConstants.DashSignSeparator + dimensionValueName dimensionName + CommonConstants.DashSignSeparator + dimensionValueName
...@@ -1296,8 +1292,8 @@ public class UserRoleServiceImpl extends AbstractService { ...@@ -1296,8 +1292,8 @@ public class UserRoleServiceImpl extends AbstractService {
} }
private RoleDto getRoleDtoById(String roleId) { private RoleDto getRoleDtoById(String roleId) {
// Role query = roleMapper.selectByPrimaryKey(roleId); Role query = roleMapper.selectByPrimaryKey(roleId);
Role query = roleData.selectByPrimaryKey(roleId); // Role query = roleData.selectByPrimaryKey(roleId);
return query == null ? new RoleDto() : CommonUtils.copyProperties(query, new RoleDto()); return query == null ? new RoleDto() : CommonUtils.copyProperties(query, new RoleDto());
} }
...@@ -1334,8 +1330,8 @@ public class UserRoleServiceImpl extends AbstractService { ...@@ -1334,8 +1330,8 @@ public class UserRoleServiceImpl extends AbstractService {
userOrganizationRoleMapper.deleteByPrimaryKey(r.getId()); userOrganizationRoleMapper.deleteByPrimaryKey(r.getId());
// 添加日志 // 添加日志
// Role role = roleMapper.selectByPrimaryKey(r.getRoleId()); Role role = roleMapper.selectByPrimaryKey(r.getRoleId());
Role role = roleData.selectByPrimaryKey(r.getRoleId()); // Role role = roleData.selectByPrimaryKey(r.getRoleId());
String roleName = role == null ? "" : role.getName(); String roleName = role == null ? "" : role.getName();
addOrDeleteDataAddLog(orgName + CommonConstants.DashSignSeparator + roleName, operateUserName, addOrDeleteDataAddLog(orgName + CommonConstants.DashSignSeparator + roleName, operateUserName,
OperationModule.UserOrganizationRole.value(), OperationAction.Delete.value(), ""); OperationModule.UserOrganizationRole.value(), OperationAction.Delete.value(), "");
...@@ -1380,8 +1376,8 @@ public class UserRoleServiceImpl extends AbstractService { ...@@ -1380,8 +1376,8 @@ public class UserRoleServiceImpl extends AbstractService {
userRole.getRoleId()); userRole.getRoleId());
userOrganizationRoleMapper.insert(userRole); userOrganizationRoleMapper.insert(userRole);
// 添加日志 // 添加日志
// Role roleObject = roleMapper.selectByPrimaryKey(item.getRoleId()); Role roleObject = roleMapper.selectByPrimaryKey(item.getRoleId());
Role roleObject = roleData.selectByPrimaryKey(item.getRoleId()); // Role roleObject = roleData.selectByPrimaryKey(item.getRoleId());
String roleName = roleObject == null ? "" : roleObject.getName(); String roleName = roleObject == null ? "" : roleObject.getName();
addOrDeleteDataAddLog(orgName + CommonConstants.DashSignSeparator + roleName, operateUserName, addOrDeleteDataAddLog(orgName + CommonConstants.DashSignSeparator + roleName, operateUserName,
OperationModule.UserOrganizationRole.value(), OperationAction.New.value(), ""); OperationModule.UserOrganizationRole.value(), OperationAction.New.value(), "");
......
...@@ -30,7 +30,6 @@ import pwc.taxtech.atms.dao.RolePermissionMapper; ...@@ -30,7 +30,6 @@ import pwc.taxtech.atms.dao.RolePermissionMapper;
import pwc.taxtech.atms.dao.UserMapper; import pwc.taxtech.atms.dao.UserMapper;
import pwc.taxtech.atms.dao.UserOrganizationMapper; import pwc.taxtech.atms.dao.UserOrganizationMapper;
import pwc.taxtech.atms.dao.UserRoleMapper; import pwc.taxtech.atms.dao.UserRoleMapper;
import pwc.taxtech.atms.data.RoleData;
import pwc.taxtech.atms.dpo.RoleInfo; import pwc.taxtech.atms.dpo.RoleInfo;
import pwc.taxtech.atms.dpo.UserDto; import pwc.taxtech.atms.dpo.UserDto;
import pwc.taxtech.atms.dpo.UserRoleInfo; import pwc.taxtech.atms.dpo.UserRoleInfo;
...@@ -99,8 +98,6 @@ public class UserServiceImpl extends AbstractService { ...@@ -99,8 +98,6 @@ public class UserServiceImpl extends AbstractService {
@Autowired @Autowired
private UserRoleServiceImpl userRoleService; private UserRoleServiceImpl userRoleService;
@Autowired @Autowired
private RoleData roleData;
@Autowired
private JwtAuthenticationService jwtAuthenticationService; private JwtAuthenticationService jwtAuthenticationService;
@Value("${api.url}") @Value("${api.url}")
...@@ -804,8 +801,8 @@ public class UserServiceImpl extends AbstractService { ...@@ -804,8 +801,8 @@ public class UserServiceImpl extends AbstractService {
logger.debug("Start to delete userRole [ {} ]", userRole.getId()); logger.debug("Start to delete userRole [ {} ]", userRole.getId());
userRoleMapper.deleteByPrimaryKey(userRole.getId()); userRoleMapper.deleteByPrimaryKey(userRole.getId());
} }
// List<Role> roleQuery = roleMapper.selectByExample(new RoleExample()); List<Role> roleQuery = roleMapper.selectByExample(new RoleExample());
List<Role> roleQuery = roleData.selectByServiceTypeId("All"); // List<Role> roleQuery = roleData.selectByServiceTypeId("All");
for (String role : userDto.getRoleIds()) { for (String role : userDto.getRoleIds()) {
if (oldUserRoleList.stream().anyMatch(sa -> Objects.equals(sa.getRoleId(), role))) { if (oldUserRoleList.stream().anyMatch(sa -> Objects.equals(sa.getRoleId(), role))) {
continue; continue;
...@@ -1001,8 +998,8 @@ public class UserServiceImpl extends AbstractService { ...@@ -1001,8 +998,8 @@ public class UserServiceImpl extends AbstractService {
logger.debug("Start to delete UserOrganizationRole [ {} ]", oneTarget.getId()); logger.debug("Start to delete UserOrganizationRole [ {} ]", oneTarget.getId());
userOrganizationRoleMapper.deleteByPrimaryKey(oneTarget.getId()); userOrganizationRoleMapper.deleteByPrimaryKey(oneTarget.getId());
// 添加日志 // 添加日志
// Role role = roleMapper.selectByPrimaryKey(oneTarget.getRoleId()); Role role = roleMapper.selectByPrimaryKey(oneTarget.getRoleId());
Role role = roleData.selectByPrimaryKey(oneTarget.getRoleId()); // Role role = roleData.selectByPrimaryKey(oneTarget.getRoleId());
String roleName = role == null ? "" : role.getName(); String roleName = role == null ? "" : role.getName();
operationLogService operationLogService
.addOrDeleteDataAddLog(generateUpdateLogParams(OperateLogType.OperationLogUser.value(), .addOrDeleteDataAddLog(generateUpdateLogParams(OperateLogType.OperationLogUser.value(),
......
...@@ -10,6 +10,8 @@ import pwc.taxtech.atms.dpo.*; ...@@ -10,6 +10,8 @@ import pwc.taxtech.atms.dpo.*;
import pwc.taxtech.atms.entity.Organization; import pwc.taxtech.atms.entity.Organization;
import pwc.taxtech.atms.entity.OrganizationExample; import pwc.taxtech.atms.entity.OrganizationExample;
import java.util.List;
@Mapper @Mapper
public interface OrganizationMapper extends MyMapper { public interface OrganizationMapper extends MyMapper {
/** /**
...@@ -145,4 +147,6 @@ public interface OrganizationMapper extends MyMapper { ...@@ -145,4 +147,6 @@ public interface OrganizationMapper extends MyMapper {
@Select("select id, code from organization;") @Select("select id, code from organization;")
List<OrgCodeIdDto> getAllOrgCodeList(); List<OrgCodeIdDto> getAllOrgCodeList();
String queryBusinessByCompanyId(String companyId);
} }
\ No newline at end of file
...@@ -113,4 +113,6 @@ public interface TaxDocumentMapper extends MyMapper { ...@@ -113,4 +113,6 @@ public interface TaxDocumentMapper extends MyMapper {
* @return * @return
*/ */
int updateEnableToF(Long id); int updateEnableToF(Long id);
int batchDelete(List<Long> ids);
} }
\ No newline at end of file
...@@ -39,10 +39,14 @@ public class UserRoleInfo { ...@@ -39,10 +39,14 @@ public class UserRoleInfo {
@JsonProperty("businessUnitID") @JsonProperty("businessUnitID")
private String businessUnitId; private String businessUnitId;
private String businessUnitName;
/// 区域Id /// 区域Id
@JsonProperty("areaID") @JsonProperty("areaID")
private String areaId; private String areaId;
private String areaName;
public Boolean isAccessible; public Boolean isAccessible;
/// 角色列表 /// 角色列表
...@@ -203,4 +207,19 @@ public class UserRoleInfo { ...@@ -203,4 +207,19 @@ public class UserRoleInfo {
this.roleInfoList = roleInfoList; this.roleInfoList = roleInfoList;
} }
public String getBusinessUnitName() {
return businessUnitName;
}
public void setBusinessUnitName(String businessUnitName) {
this.businessUnitName = businessUnitName;
}
public String getAreaName() {
return areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
} }
...@@ -2,6 +2,7 @@ package pwc.taxtech.atms.entity; ...@@ -2,6 +2,7 @@ package pwc.taxtech.atms.entity;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* *
...@@ -110,6 +111,16 @@ public class OperationLogFileType implements Serializable { ...@@ -110,6 +111,16 @@ public class OperationLogFileType implements Serializable {
*/ */
private Date createTime; private Date createTime;
private List<String> fileTypeIds;
public List<String> getFileTypeIds() {
return fileTypeIds;
}
public void setFileTypeIds(List<String> fileTypeIds) {
this.fileTypeIds = fileTypeIds;
}
/** /**
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
* This field corresponds to the database table operation_log_file_type * This field corresponds to the database table operation_log_file_type
......
...@@ -500,6 +500,11 @@ public class TaxDocumentExample { ...@@ -500,6 +500,11 @@ public class TaxDocumentExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andPhysicalIndexNumberLike(String value) {
addCriterion("physical_index_number like", value, "physicalIndexNumber");
return (Criteria) this;
}
public Criteria andFileNameNotLike(String value) { public Criteria andFileNameNotLike(String value) {
addCriterion("file_name not like", value, "fileName"); addCriterion("file_name not like", value, "fileName");
return (Criteria) this; return (Criteria) this;
......
...@@ -671,4 +671,10 @@ ...@@ -671,4 +671,10 @@
ACC_SET.is_active = 1 ACC_SET.is_active = 1
AND SET_ORG.enterprise_account_set_id = ACC_SET.id AND SET_ORG.enterprise_account_set_id = ACC_SET.id
</select> </select>
<select id="queryBusinessByCompanyId" resultType="string">
SELECT bus.name
FROM organization org
LEFT JOIN business_unit bus ON org.business_unit_id = bus.id
WHERE bus.is_active = 1 AND org.id = #{companyId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -150,6 +150,15 @@ ...@@ -150,6 +150,15 @@
delete from tax_document delete from tax_document
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</delete> </delete>
<delete id="batchDelete">
DELETE FROM tax_document
WHERE id IN
<foreach collection="list" item="id" separator="," open="(" close=")">
#{id}
</foreach>
</delete>
<delete id="deleteByExample" parameterType="pwc.taxtech.atms.entity.TaxDocumentExample"> <delete id="deleteByExample" parameterType="pwc.taxtech.atms.entity.TaxDocumentExample">
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
......
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
"ProjectYearCol" : "年份", "ProjectYearCol" : "年份",
"AssignRoleCol" : "分配角色", "AssignRoleCol" : "分配角色",
"SequenceNoCol":"序号", "SequenceNoCol":"序号",
"DocumentID":"Doc ID",
"TaxGroup":"税种", "TaxGroup":"税种",
"ReportTemplate":"Report Template", "ReportTemplate":"Report Template",
......
...@@ -893,5 +893,8 @@ ...@@ -893,5 +893,8 @@
"TBEBITForm":"TB EBIT 表格", "TBEBITForm":"TB EBIT 表格",
"ClickEnsureTip": "请点击确定按钮!", "ClickEnsureTip": "请点击确定按钮!",
"true": "是",
"false": "否",
"~MustBeEndOneApp": "I Must be the End One, please!" "~MustBeEndOneApp": "I Must be the End One, please!"
} }
...@@ -93,6 +93,7 @@ ...@@ -93,6 +93,7 @@
"ProjectYearCol": "年份", "ProjectYearCol": "年份",
"AssignRoleCol": "分配角色", "AssignRoleCol": "分配角色",
"SequenceNoCol": "序号", "SequenceNoCol": "序号",
"DocumentID": "档案ID",
"TaxGroup":"税种", "TaxGroup":"税种",
"DocumentAttr": "档案属性", "DocumentAttr": "档案属性",
"DocumentType": "档案类型", "DocumentType": "档案类型",
......
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
required: $translate.instant('BusinessUnitEmptyNode'), required: $translate.instant('BusinessUnitEmptyNode'),
minlength: $translate.instant('BusinessUnitEmptyNode'), minlength: $translate.instant('BusinessUnitEmptyNode'),
maxlength: $translate.instant('BusinessUnitOutOfLengthNode'), maxlength: $translate.instant('BusinessUnitOutOfLengthNode'),
BURepeated: $translate.instant('BusinessUnitDuplicateNode') BURepeated: $translate.instant('TaxData')
}, },
IsActive: $translate.instant('BusinessUnitStatusUnsureness') IsActive: $translate.instant('BusinessUnitStatusUnsureness')
}, },
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
columns: [ columns: [
{ {
dataField: "id", dataField: "id",
caption: $translate.instant('SequenceNoCol'), caption: $translate.instant('DocumentID'),
allowHeaderFiltering: true, allowHeaderFiltering: true,
cellTemplate: function (container, options) { cellTemplate: function (container, options) {
try { try {
...@@ -185,15 +185,15 @@ ...@@ -185,15 +185,15 @@
} }
}, },
{ {
dataField: "createTime", dataField: "updateTime",
caption: $translate.instant('CreatedTime'), caption: $translate.instant('UpdateTime'),
allowHeaderFiltering: true, allowHeaderFiltering: true,
cellTemplate: function (container, options) { cellTemplate: function (container, options) {
try { try {
var style = options.data.status == 1 ? '' : 'style="color:#999"'; var style = options.data.status == 1 ? '' : 'style="color:#999"';
if (options.data.createTime) { if (options.data.updateTime) {
$('<span '+style+'>').text($filter('date')(options.data.createTime, 'yyyy-MM-dd')).appendTo(container); $('<span '+style+'>').text($filter('date')(options.data.updateTime, 'yyyy-MM-dd')).appendTo(container);
} else { } else {
$('<span>').text().appendTo(container); $('<span>').text().appendTo(container);
} }
...@@ -209,8 +209,10 @@ ...@@ -209,8 +209,10 @@
cellTemplate: function (container, options) { cellTemplate: function (container, options) {
try { try {
if (options.data.status == 1) { if (options.data.status == 1) {
$('<span>').text($translate.instant('Enabled')).appendTo(container); options.data.status = $translate.instant('Enabled');
$('<span>').text(options.data.status).appendTo(container);
} else { } else {
options.data.status = $translate.instant('Disabled');
$('<span style="color:#999">').text($translate.instant('Disabled')).appendTo(container); $('<span style="color:#999">').text($translate.instant('Disabled')).appendTo(container);
} }
} catch (e) { } catch (e) {
...@@ -224,13 +226,11 @@ ...@@ -224,13 +226,11 @@
allowHeaderFiltering: false, allowHeaderFiltering: false,
cellTemplate: function (container, options) { cellTemplate: function (container, options) {
try { try {
var eventTarget = $('<a style="color:#506bf7;" href="javascript:void(0)" ng-click="openEditPop(' var eventTarget = $('<a style="color:#506bf7;" data-id="'+options.data.id+'" href="javascript:void(0)"><span>'+$translate.instant("Edit")+'</span></a>');
+ options.data.id eventTarget.off('click').on('click',function(){
+ ')">' $scope.openEditPop(options.data.id);
+ '<span>{{"Edit"|translate}}</span></a>'); });
$compile(eventTarget)($scope);
container.append(eventTarget); container.append(eventTarget);
} catch (e) { } catch (e) {
$log.error(e); $log.error(e);
} }
...@@ -248,6 +248,10 @@ ...@@ -248,6 +248,10 @@
$scope.localData.forEach(function (item) { $scope.localData.forEach(function (item) {
if (item.id == rowId) { if (item.id == rowId) {
$scope.editModel = angular.copy(item); $scope.editModel = angular.copy(item);
if($scope.editModel.status != 1 || $scope.editModel.status != 0){
// 特殊处理状态值,1 = “已启用”, 0 = “已禁用”
$scope.editModel.status = item.status == $translate.instant("Enabled") ? 1 : 0;
}
} }
}); });
} }
......
...@@ -145,12 +145,14 @@ ...@@ -145,12 +145,14 @@
<label class="col-sm-5 DM-state-label"> <label class="col-sm-5 DM-state-label">
<input type="radio" name="editModelState" <input type="radio" name="editModelState"
value=1 value=1
ng-checked="editModel.status == 1"
ng-model="editModel.status" required /> ng-model="editModel.status" required />
<span translate="Enable"></span> <span translate="Enable"></span>
</label> </label>
<label class="col-sm-5 DM-state-label"> <label class="col-sm-5 DM-state-label">
<input type="radio" name="editModelState" <input type="radio" name="editModelState"
value=0 value=0
ng-checked="editModel.status == 0"
ng-model="editModel.status" required /> ng-model="editModel.status" required />
<span translate="Disable"></span> <span translate="Disable"></span>
</label> </label>
......
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
color: #333333; color: #333333;
} }
.dx-datagrid-rowsview .dx-datagrid-table .dx-freespace-row{
height: 31.11px !important;
}
.content-container { .content-container {
background-color: #ffffff; background-color: #ffffff;
...@@ -103,6 +107,8 @@ ...@@ -103,6 +107,8 @@
/*height: 600px;*/ /*height: 600px;*/
margin-bottom: 15px; margin-bottom: 15px;
} }
} }
} }
.page-footer { .page-footer {
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<div class="align-right" style="margin-top:5px;"> <div class="align-right" style="margin-top:5px;">
<!--<button class="btn btn-export" type="button" ng-click="" translate="Export"></button>--> <!--<button class="btn btn-export" type="button" ng-click="" translate="Export"></button>-->
<export-button style="float: right; margin-left: 0px; margin-top: 7px"><export-button> <!--<export-button style="float: right; margin-left: 0px; margin-top: 7px"><export-button>-->
</div> </div>
<div class="right-operate "> <div class="right-operate ">
......
...@@ -584,8 +584,27 @@ ...@@ -584,8 +584,27 @@
// 转换大小写 // 转换大小写
var userName = user.userName ? user.userName.toLowerCase() : ''; var userName = user.userName ? user.userName.toLowerCase() : '';
var email = user.email ? user.email.toLowerCase() : ''; var email = user.email ? user.email.toLowerCase() : '';
var businessUnit = user.businessUnitName ? user.businessUnitName.toLowerCase() : '';
var area = user.areaName ? user.areaName.toLowerCase() : '';
var org = user.organizationName ? user.organizationName.toLowerCase() : '';
var userNameExist = !(userName.indexOf($scope.queryUser.toLowerCase()) === -1);
var emailExist = !(email.indexOf($scope.queryUser.toLowerCase()) === -1);
var businessUnitExist = !(businessUnit.indexOf($scope.queryUser.toLowerCase()) === -1);
var areaExist = !(area.indexOf($scope.queryUser.toLowerCase()) === -1);
var orgExist = !(org.indexOf($scope.queryUser.toLowerCase()) === -1);
var userRoleExist = false;
user.roleInfoList.forEach(function (m) {
if (!(m.name.indexOf($scope.queryUser.toLowerCase()) === -1)) {
userRoleExist = true;
}
});
var isExist = userNameExist || emailExist || businessUnitExist || userRoleExist || areaExist || orgExist;
if (userName.indexOf($scope.queryUser.toLowerCase()) === -1 && email.indexOf($scope.queryUser.toLowerCase()) === -1) { if (!isExist) {
continue; continue;
} }
...@@ -593,6 +612,7 @@ ...@@ -593,6 +612,7 @@
if (!$scope.showActiveUser && user.status != enums.userStatus.disabled) { if (!$scope.showActiveUser && user.status != enums.userStatus.disabled) {
continue; continue;
} }
} else { } else {
// 用户状态筛选 // 用户状态筛选
// 只显示启用的 // 只显示启用的
......
...@@ -166,6 +166,7 @@ ...@@ -166,6 +166,7 @@
<span class="more-icon">...</span> <span class="more-icon">...</span>
</div> </div>
<!--<p ng-show="isNotHundred" class="has-error label"> {{'isNotHundred'|translate}}</p>-->
</div> </div>
<div class="line-1 " ng-click="goToUserDetail(x.id)"></div> <div class="line-1 " ng-click="goToUserDetail(x.id)"></div>
<div class="user-info " ng-click="goToUserDetail(x.id)"> <div class="user-info " ng-click="goToUserDetail(x.id)">
......
...@@ -156,7 +156,18 @@ ...@@ -156,7 +156,18 @@
}; };
var doExport = function () { var doExport = function () {
var localDate=$filter('date')(new Date(), 'yyyyMMddHHmmss');
var fileName = '';
constant.anlDownLoadFileNameList.forEach(function (m) {
if (m.code === $scope.importType) {
fileName = m.name + $scope.UploadPeriodTime+"_" +localDate;
}
});
vatImportService.downloadDomesticFile($scope.queryParams,fileName).then(function (data) {
if (data) {
ackMessageBox.success(translate('FileExportSuccess'));
}
});
}; };
......
...@@ -104,7 +104,6 @@ controller('editBusinessUnitModalController', ['$scope', '$log', 'SweetAlert', ' ...@@ -104,7 +104,6 @@ controller('editBusinessUnitModalController', ['$scope', '$log', 'SweetAlert', '
if ($scope.isEdit) { if ($scope.isEdit) {
businessUnitService.updateBusinessUnit(businessUnitArray).success(successedFun); businessUnitService.updateBusinessUnit(businessUnitArray).success(successedFun);
} else { } else {
businessUnitService.addBusinessUnit(businessUnitArray).success(successedFun); businessUnitService.addBusinessUnit(businessUnitArray).success(successedFun);
} }
...@@ -114,8 +113,7 @@ controller('editBusinessUnitModalController', ['$scope', '$log', 'SweetAlert', ' ...@@ -114,8 +113,7 @@ controller('editBusinessUnitModalController', ['$scope', '$log', 'SweetAlert', '
var intiValidate = function () { var intiValidate = function () {
/*$.validator.addMethod("BusinessUnitRepeated", function (value, element, param) {
$.validator.addMethod("BusinessUnitRepeated", function (value, element, param) {
if ($scope.businessUnitList && $scope.businessUnitList.length > 0) { if ($scope.businessUnitList && $scope.businessUnitList.length > 0) {
var objects = $.grep($scope.businessUnitList, function (n, i) { var objects = $.grep($scope.businessUnitList, function (n, i) {
return $scope.editingObject.id != n.id && $.trim(n.name) == $.trim(value); return $scope.editingObject.id != n.id && $.trim(n.name) == $.trim(value);
...@@ -123,10 +121,8 @@ controller('editBusinessUnitModalController', ['$scope', '$log', 'SweetAlert', ' ...@@ -123,10 +121,8 @@ controller('editBusinessUnitModalController', ['$scope', '$log', 'SweetAlert', '
return objects.length < 1; return objects.length < 1;
} }
return true; return true;
});*/
});
formValidator = $(editModalSelector).find("#edit-form").validate({ formValidator = $(editModalSelector).find("#edit-form").validate({
debug: true, debug: true,
......
...@@ -8,17 +8,17 @@ ...@@ -8,17 +8,17 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form class="form-horizontal" role="form" id="userForm"> <form class="form-horizontal" role="form" id="userForm">
<!--<div class="form-group">--> <div class="form-group">
<label class="control-label col-sm-3" for="isAdmin" translate="Admin"></label>
<div class="col-sm-9">
<div class="checkbox">
<label>
<input id="isAdmin" type="checkbox" ng-model="editUserModel.isAdmin"> Admin
</label>
</div>
</div>
</div>
<!--<label class="control-label col-sm-3" for="checkIsAdmin" translate="Admin"></label>-->
<!--<div class="col-sm-9">-->
<!--<div class="checkbox">-->
<!--<label>-->
<!--<input type="checkbox" ng-model="editUserModel.isAdmin"> Admin-->
<!--</label>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-3" for="inputUserName"><span class="red-color">*</span><span translate="UserNameColon"></span></label> <label class="control-label col-sm-3" for="inputUserName"><span class="red-color">*</span><span translate="UserNameColon"></span></label>
<div class="col-sm-9"> <div class="col-sm-9">
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-3"><span class="red-color">*</span><span translate="Company"></label> <label class="control-label col-sm-3"><span class="red-color">*</span><span translate="Company"></label>
<div class="col-sm-9"> <div class="col-sm-9">
<input id="orgName" type="text" name="orgName" maxlength="100" class="form-control" style="width: 300px;" ng-model="editUserModel.orgName" readonly="readonly" required> <input id="orgName" type="text" name="orgName" maxlength="100" class="form-control" style="width: 300px;" ng-model="editUserModel.OrgName" readonly="readonly" required>
<!--<org-selector selected-org-name="editUserModel.OrgName" selected-org-id="editUserModel.OrganizationID" component-selected-org="" is-show-all="false" is-require="true" <!--<org-selector selected-org-name="editUserModel.OrgName" selected-org-id="editUserModel.OrganizationID" component-selected-org="" is-show-all="false" is-require="true"
style="width: 300px;"></org-selector> style="width: 300px;"></org-selector>
<label class="error-label" style="font-size:12px;" ng-show="editUserModel.organizationIDError">{{editUserModel.organizationIDError}}</label>--> <label class="error-label" style="font-size:12px;" ng-show="editUserModel.organizationIDError">{{editUserModel.organizationIDError}}</label>-->
......
...@@ -87,7 +87,9 @@ ...@@ -87,7 +87,9 @@
}; };
var loadSheet = function (templateId) { var loadSheet = function (templateId) {
return templateService.getTemplateJson(templateId).then(function (reportSpread) { var prokjectId = vatSessionService.project.id;
var period = vatSessionService.month;
return templateService.getPeriodTemplateJson(templateId,period,prokjectId).then(function (reportSpread) {
var spreadCtrl = getSpreadControl(); var spreadCtrl = getSpreadControl();
if (spreadCtrl) { if (spreadCtrl) {
spreadCtrl.destroy(); spreadCtrl.destroy();
......
...@@ -1528,10 +1528,9 @@ constant.exportExcelFileName = { ...@@ -1528,10 +1528,9 @@ constant.exportExcelFileName = {
invoiceData: "invoice_data_" invoiceData: "invoice_data_"
}; };
constant.anlTemplateNameList = [ constant.anlTemplateNameList = [
{code:0,name:"各税种税额 _所属期间_模版"}, {code:0,name:"各税种税额_所属期间_模版"},
{code:1,name:"实际返还税额 _所属期间_模版"}, {code:1,name:"实际返还税额_所属期间_模版"},
{code:2,name:"業務線_所属期间_模版"}, {code:2,name:"業務線_所属期间_模版"},
{code:3,name:"职工人数_所属期间_模版"}, {code:3,name:"职工人数_所属期间_模版"},
{code:4,name:"司機人數_所属期间_模版"}, {code:4,name:"司機人數_所属期间_模版"},
...@@ -1539,6 +1538,16 @@ constant.anlTemplateNameList = [ ...@@ -1539,6 +1538,16 @@ constant.anlTemplateNameList = [
{code:101,name:"国际税税务数据_国家_公司_所属期间_模版"} {code:101,name:"国际税税务数据_国家_公司_所属期间_模版"}
]; ];
constant.anlDownLoadFileNameList = [
{code:0,name:"各税种税额_"},
{code:1,name:"实际返还税额_"},
{code:2,name:"業務線_"},
{code:3,name:"职工人数_"},
{code:4,name:"司機人數_"},
{code:100,name:"国际税业务数据_"},
{code:101,name:"国际税税务数据_"}
];
......
...@@ -417,6 +417,14 @@ ...@@ -417,6 +417,14 @@
}, },
getAnalysisInternationalCountryList: function (type,period) { getAnalysisInternationalCountryList: function (type,period) {
return $http.get('/Analysis/getAnalysisInternationalCountryList?type=' + type + '&period=' + period, apiConfig.create()); return $http.get('/Analysis/getAnalysisInternationalCountryList?type=' + type + '&period=' + period, apiConfig.create());
},
downloadDomesticFile: function (queryParm, fileName) {
var thisConfig = apiConfig.create();
thisConfig.responseType = "arraybuffer";
return $http.post('/Analysis/downloadDomesticFile/get', queryParm, thisConfig).then(function (response) {
var data = new Blob([response.data], {type: response.headers('Content-Type')});
FileSaver.saveAs(data, fileName + '.xlsx');
});
} }
/***************************************批量数据导入服务(真) end**************************************************************/ /***************************************批量数据导入服务(真) end**************************************************************/
......
...@@ -13,6 +13,16 @@ webservices.factory('templateService', ['$log', '$http', '$q', 'apiConfig', 'htt ...@@ -13,6 +13,16 @@ webservices.factory('templateService', ['$log', '$http', '$q', 'apiConfig', 'htt
return getJsonFromExcel(templateID); return getJsonFromExcel(templateID);
//} //}
}; };
var getPeriodTemplateJson = function (templateId,period,projectId) {
//return $http.get('/template/getTemplateJson?templateID=' + templateID, apiConfig.create());
//var url = '/template/getTemplateJson?templateID=' + templateID;
//var result = httpCacheService.get(url);
// if (result.finishedCache) {
// return result;
// } else {
return getJsonFromExcelForPeriod(templateId,period,projectId);
//}
};
var getCookie = function (cname) { var getCookie = function (cname) {
...@@ -105,6 +115,38 @@ webservices.factory('templateService', ['$log', '$http', '$q', 'apiConfig', 'htt ...@@ -105,6 +115,38 @@ webservices.factory('templateService', ['$log', '$http', '$q', 'apiConfig', 'htt
}; };
var getJsonFromExcelForPeriod = function (templateID,period,projectId) {
var deferred = $q.defer();
var promise = deferred.promise;
var url = loginContext.apiHost + constant.webapi.prefix + '/template/getPeriodTemplateJson?templateId=' + templateID+"&period="+period+"&projectId="+projectId;
var xhr = new XMLHttpRequest();
xhr.open('POST', url, true); // 也可以使用POST方式,根据接口
xhr.responseType = "blob"; // 返回类型blob
var apiTokenObj = JSON.parse(getCookie('AtmsApiToken'));
var apiToken = apiTokenObj.access_token;
var tokenType = apiTokenObj.token_type;
xhr.setRequestHeader('Authorization', tokenType + ' ' + apiToken);
// 定义请求完成的处理函数,请求前也可以增加加载框/禁用下载按钮逻辑
xhr.onload = function () {
// 请求完成
if (this.status === 200) {
// 返回200
var blob = this.response;
var excelIo = new GC.Spread.Excel.IO();
excelIo.open(blob, function (json) {
deferred.resolve(json);
}, function (e) {
// console.error(e.errorMessage);
//alert(e.errorMessage);
deferred.reject(e.errorMessage);
}, {});
}
};
// 发送ajax请求
xhr.send();
return promise;
};
var renderSpreadExcelSimple = function (id, templateID) { var renderSpreadExcelSimple = function (id, templateID) {
var deferred = $q.defer(); var deferred = $q.defer();
var promise = deferred.promise; var promise = deferred.promise;
...@@ -126,6 +168,7 @@ webservices.factory('templateService', ['$log', '$http', '$q', 'apiConfig', 'htt ...@@ -126,6 +168,7 @@ webservices.factory('templateService', ['$log', '$http', '$q', 'apiConfig', 'htt
renderSpreadExcelSimple: renderSpreadExcelSimple, renderSpreadExcelSimple: renderSpreadExcelSimple,
setRowColName: setRowColName, setRowColName: setRowColName,
getTemplateJson: getTemplateJson, getTemplateJson: getTemplateJson,
getPeriodTemplateJson:getPeriodTemplateJson,
downloadTemplate: function (fileType) { downloadTemplate: function (fileType) {
return $http.get('/template/file/downloadTemplate?fileType=' + fileType , apiConfig.create({ responseType: 'arraybuffer' })); return $http.get('/template/file/downloadTemplate?fileType=' + fileType , apiConfig.create({ responseType: 'arraybuffer' }));
}, },
......
...@@ -68,20 +68,42 @@ ...@@ -68,20 +68,42 @@
overflow: hidden; overflow: hidden;
outline: none; outline: none;
} }
.input-reset-button:before { .input-arrow-drop-button {
position: absolute;
margin: 0;
border: 0;
background: #fff;
top: 0;
right: 0;
color: #969696;
overflow: hidden;
outline: none;
}
.input-arrow-drop-button:before {
content: "▾";
height: inherit;
width: inherit;
position: relative;
background: inherit;
}
.input-reset-button:after {
content: "x"; content: "x";
height: inherit; height: inherit;
width: inherit; width: inherit;
position: relative; position: relative;
background: inherit;
} }
</style> </style>
<div class="select-simulator"> <div class="select-simulator">
<input class="for-fake-input" <input class="for-fake-input"
ng-click="showMenu();" ng-click="showMenu();"
placeholder="请选择" placeholder="请选择"
title="{{selected}}"
readonly readonly
ng-model="selected"> ng-model="selected">
<button class="input-reset-button" <button type="button" class="input-arrow-drop-button">
</button>
<button type="button" class="input-reset-button"
ng-click="clearInput()" ng-click="clearInput()"
ng-mouseleave="activeWatcher()" ng-mouseleave="activeWatcher()"
ng-mouseenter="closeWatcher()" ng-mouseenter="closeWatcher()"
...@@ -99,7 +121,7 @@ ...@@ -99,7 +121,7 @@
<input type="{{optionType}}" <input type="{{optionType}}"
name="simulatorOptionMenu" name="simulatorOptionMenu"
value="{{value}}" value="{{value}}"
ng-checked="defaultChecked[optionKeys[$index]]" ng-checked="selected.indexOf(optionValues[$index]) > -1"
data-key="{{optionKeys[$index]}}"/> data-key="{{optionKeys[$index]}}"/>
<span>{{value}}</span> <span>{{value}}</span>
</label> </label>
......
...@@ -43,12 +43,12 @@ frameworkModule.directive('appMultiSelect', ['$log', ...@@ -43,12 +43,12 @@ frameworkModule.directive('appMultiSelect', ['$log',
function runDefaultChecked(){ function runDefaultChecked(){
if($scope.defaultChecked.length){ if($scope.defaultChecked.length){
// 一般defaultChecked就是optionMap的下表数组 // 一般defaultChecked就是optionMap的下表数组
$scope.optionKeys.forEach(function (item) { $scope.optionKeys.forEach(function (key) {
var defaultLen = $scope.defaultChecked.length; var defaultLen = $scope.defaultChecked.length;
while(defaultLen--){ while(defaultLen--){
if($scope.defaultChecked[defaultLen] == item){ if($scope.defaultChecked[defaultLen] == $scope.optionMap[key]){
$scope.checkedKeys.push(item); $scope.checkedKeys.push(key);
$scope.checkedValues.push($scope.optionMap[item]); $scope.checkedValues.push($scope.optionMap[key]);
break; break;
} }
} }
...@@ -142,7 +142,7 @@ frameworkModule.directive('appMultiSelect', ['$log', ...@@ -142,7 +142,7 @@ frameworkModule.directive('appMultiSelect', ['$log',
$scope.checkedValues.length = 0; $scope.checkedValues.length = 0;
$scope.checkedKeys.length = 0; $scope.checkedKeys.length = 0;
$scope.selected = ""; $scope.selected = "";
confirmSelected(false); // confirmSelected(false);
} else { } else {
// 如果弹出下拉菜单时,当前输入框内容为空,就直接关闭下拉菜单 // 如果弹出下拉菜单时,当前输入框内容为空,就直接关闭下拉菜单
$scope.showOptionMenu = false; $scope.showOptionMenu = false;
......
...@@ -105,11 +105,11 @@ frameworkModule.controller('appUsrOperateLogController', ...@@ -105,11 +105,11 @@ frameworkModule.controller('appUsrOperateLogController',
} }
} }
}, },
{ // {
dataField: "operationObject", // dataField: "operationObject",
caption: $translate.instant('LogOperateObject'), // caption: $translate.instant('LogOperateObject'),
allowHeaderFiltering: true, // allowHeaderFiltering: true,
}, // },
{ {
dataField: "operationAction", dataField: "operationAction",
caption: $translate.instant('LogOperationDescription'), caption: $translate.instant('LogOperationDescription'),
......
...@@ -54,14 +54,21 @@ ...@@ -54,14 +54,21 @@
max-width: 68%; max-width: 68%;
padding-left: 1rem; padding-left: 1rem;
box-sizing: border-box; box-sizing: border-box;
position: relative;
} }
.TDL-query-bar .TDL-query-val .TDL-query-val-multi { .TDL-query-bar .TDL-query-val .TDL-query-val-multi {
width: 45%; width: 45%;
max-width: 45%; max-width: 45%;
left: 0;
display: inline-block; display: inline-block;
margin: 0; margin: 0;
position: absolute;
top: -24px;
left: 1rem;
}
.TDL-query-bar .TDL-query-val .TDL-query-val-multi:nth-child(even){
left: 45%;
border-radius: 0 4px 4px 0;
} }
.TDL-query-bar .TDL-query-more { .TDL-query-bar .TDL-query-more {
...@@ -467,8 +474,16 @@ ...@@ -467,8 +474,16 @@
<span translate="TaxType"></span> <span translate="TaxType"></span>
</div> </div>
<div class="TDL-query-val"> <div class="TDL-query-val">
<input type="text" class="form-control radius3" <!--<input type="text" class="form-control radius3"-->
ng-model="queryFieldModel.taxType"/> <!--ng-model="queryFieldModel.taxType"/>-->
<select ng-model="queryFieldModel.taxType"
class="form-control radius3">
<option ng-repeat="taxType in taxTypeSelects track by $index"
ng-selected="(queryFieldModel.taxType == taxType)"
value="{{taxType}}">{{taxType}}
</option>
</select>
</div> </div>
</div> </div>
<div class="TDL-query-block"> <div class="TDL-query-block">
...@@ -728,7 +743,7 @@ ...@@ -728,7 +743,7 @@
</label> </label>
<div class="col-sm-11" style="width:61.67%"> <div class="col-sm-11" style="width:61.67%">
<input type='text' placeholder="{{'PleaseSelected' | translate}}" date-time-picker <input type='text' placeholder="{{'PleaseSelected' | translate}}" date-time-picker
data-date-format="yyyy/mm/dd" data-date-format="yyyy/mm"
class="form-control" ng-model="editFieldModel.ownTime" required class="form-control" ng-model="editFieldModel.ownTime" required
data-min-view-mode="1"/> data-min-view-mode="1"/>
</div> </div>
...@@ -963,7 +978,7 @@ ...@@ -963,7 +978,7 @@
</label> </label>
<div class="col-sm-11" style="width:61.67%"> <div class="col-sm-11" style="width:61.67%">
<input type='text' placeholder="{{'PleaseSelected' | translate}}" <input type='text' placeholder="{{'PleaseSelected' | translate}}"
date-time-picker data-date-format="yyyy/mm/dd" date-time-picker data-date-format="yyyy/mm"
class="form-control" ng-model="editFieldItem.ownTime" required class="form-control" ng-model="editFieldItem.ownTime" required
data-min-view-mode="1"/> data-min-view-mode="1"/>
</div> </div>
......
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