Commit b2ffa029 authored by chase's avatar chase

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

parents 1fc68560 6d78f520
package pwc.taxtech.atms.constant.enums;
public enum EnumCitAssetType {
//固定资产
FixedAssets(1),
//长期待摊
LongTermPrepaid (2),
//无形资产
InvisibleAssets (3);
private Integer code;
EnumCitAssetType(Integer code) {
this.code = code;
}
public Integer getCode() {
return code;
}
public static EnumCitAssetType valueOf(Integer value) {
for (EnumCitAssetType item : EnumCitAssetType.values()) {
if (item.getCode().equals(value)) {
return item;
}
}
return null;
}
}
...@@ -43,7 +43,8 @@ public class CitImportExcelController { ...@@ -43,7 +43,8 @@ public class CitImportExcelController {
OperationResultDto citImportExcel(@RequestParam MultipartFile file, @RequestParam(required = false) String orgIds, OperationResultDto citImportExcel(@RequestParam MultipartFile file, @RequestParam(required = false) String orgIds,
@RequestParam String periodDate, @RequestParam String periodDate,
@RequestParam Integer importType, @RequestParam Integer importType,
@RequestParam Integer importFileType){ @RequestParam Integer importFileType,
@RequestParam(required = false) Integer month){
logger.info("CIT文件导入"); logger.info("CIT文件导入");
OperationResultDto opeResultDto = new OperationResultDto(); OperationResultDto opeResultDto = new OperationResultDto();
try{ try{
...@@ -55,7 +56,7 @@ public class CitImportExcelController { ...@@ -55,7 +56,7 @@ public class CitImportExcelController {
} }
logger.debug("file name: " + file.getOriginalFilename()); logger.debug("file name: " + file.getOriginalFilename());
List<String> orgList = (List<String>) JSONArray.parse(orgIds); List<String> orgList = (List<String>) JSONArray.parse(orgIds);
opeResultDto = citImportExcelService.citImportExcel(file, orgList, file.getOriginalFilename(), periodDate, importType, importFileType); opeResultDto = citImportExcelService.citImportExcel(file, orgList, file.getOriginalFilename(), periodDate, importType, importFileType, month);
return opeResultDto; return opeResultDto;
}catch (Exception e){ }catch (Exception e){
logger.error("文件导入失败,错误信息如下:"); logger.error("文件导入失败,错误信息如下:");
...@@ -122,7 +123,7 @@ public class CitImportExcelController { ...@@ -122,7 +123,7 @@ public class CitImportExcelController {
*/ */
@RequestMapping(value = "/getCitDataImportLog", method = RequestMethod.GET) @RequestMapping(value = "/getCitDataImportLog", method = RequestMethod.GET)
public ApiResultDto getCitDataImportLog(Integer type){ public ApiResultDto getCitDataImportLog(Integer type){
logger.info("获取CIT调整版日记账"); logger.info("获取CIT导入记录");
ApiResultDto apiResultDto = new ApiResultDto(); ApiResultDto apiResultDto = new ApiResultDto();
apiResultDto.setCode(1); apiResultDto.setCode(1);
apiResultDto.setData(citImportExcelService.getCitDataImportLog(type)); apiResultDto.setData(citImportExcelService.getCitDataImportLog(type));
......
...@@ -4,16 +4,14 @@ import com.github.pagehelper.Page; ...@@ -4,16 +4,14 @@ import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.message.ErrorMessage; import pwc.taxtech.atms.common.message.ErrorMessage;
import pwc.taxtech.atms.common.util.JxlsUtils; import pwc.taxtech.atms.common.util.JxlsUtils;
import pwc.taxtech.atms.constant.Constant; import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.constant.CountTypeConstant; import pwc.taxtech.atms.constant.CountTypeConstant;
import pwc.taxtech.atms.constant.ExportTemplatePathConstant; import pwc.taxtech.atms.constant.ExportTemplatePathConstant;
import pwc.taxtech.atms.dao.CitJournalEntryAdjustMapper; import pwc.taxtech.atms.dao.*;
import pwc.taxtech.atms.dao.CitTbamMapper;
import pwc.taxtech.atms.dao.CitTrialBalanceMapper;
import pwc.taxtech.atms.dao.OrganizationMapper;
import pwc.taxtech.atms.dto.CitJournalAdjustDto; import pwc.taxtech.atms.dto.CitJournalAdjustDto;
import pwc.taxtech.atms.dpo.CitTrialBalanceDto; import pwc.taxtech.atms.dpo.CitTrialBalanceDto;
import pwc.taxtech.atms.dto.CitTrialBalanceExportDto; import pwc.taxtech.atms.dto.CitTrialBalanceExportDto;
...@@ -56,6 +54,10 @@ public class CitDataPreviewServiceImpl extends BaseService { ...@@ -56,6 +54,10 @@ public class CitDataPreviewServiceImpl extends BaseService {
private CitTrialBalanceMapper citTbMapper; private CitTrialBalanceMapper citTbMapper;
@Resource @Resource
private CitTbamMapper citTbamMapper; private CitTbamMapper citTbamMapper;
@Resource
private ProjectMapper projectMapper;
@Resource
private OrganizationMapper organizationMapper;
/** /**
* 获取日记账合并版 * 获取日记账合并版
...@@ -64,9 +66,12 @@ public class CitDataPreviewServiceImpl extends BaseService { ...@@ -64,9 +66,12 @@ public class CitDataPreviewServiceImpl extends BaseService {
*/ */
public PageInfo<CitJournalAdjustDto> getJournalMergeData(CitJournalAdjustDto citJournalAdjustDto) { public PageInfo<CitJournalAdjustDto> getJournalMergeData(CitJournalAdjustDto citJournalAdjustDto) {
CitJournalEntryAdjust citJournalEntryAdjust = beanUtil.copyProperties(citJournalAdjustDto, new CitJournalEntryAdjust()); CitJournalEntryAdjust citJournalEntryAdjust = beanUtil.copyProperties(citJournalAdjustDto, new CitJournalEntryAdjust());
List<String> orgList = getOrgList(citJournalAdjustDto.getProjectId());
if(citJournalEntryAdjust.getPeriodEnd()!=null && citJournalEntryAdjust.getPeriodEnd()%100 ==12){
citJournalEntryAdjust.setPeriodEnd(citJournalEntryAdjust.getPeriodEnd()/100*100+13);
}
Page page = PageHelper.startPage(citJournalAdjustDto.getPageInfo().getPageIndex(), citJournalAdjustDto.getPageInfo().getPageSize()); Page page = PageHelper.startPage(citJournalAdjustDto.getPageInfo().getPageIndex(), citJournalAdjustDto.getPageInfo().getPageSize());
List<CitJournalEntryAdjust> journalMerges = citJournalMapper.getJournalMergeByOrgList(citJournalEntryAdjust,orgList);
List<CitJournalEntryAdjust> journalMerges = citJournalMapper.getJournalMerge(citJournalEntryAdjust);
List<CitJournalAdjustDto> journalAdjustDtos = Lists.newArrayList(); List<CitJournalAdjustDto> journalAdjustDtos = Lists.newArrayList();
journalMerges.forEach(journal -> { journalMerges.forEach(journal -> {
CitJournalAdjustDto citJournalDto = new CitJournalAdjustDto(); CitJournalAdjustDto citJournalDto = new CitJournalAdjustDto();
...@@ -80,6 +85,27 @@ public class CitDataPreviewServiceImpl extends BaseService { ...@@ -80,6 +85,27 @@ public class CitDataPreviewServiceImpl extends BaseService {
return pageInfo; return pageInfo;
} }
/**
* 根据卡片主键获取隶属的机构及子机构,若本身就是子机构那么只获取本身
* @param projectId
* @return
*/
public List<String> getOrgList(String projectId){
Project project = projectMapper.selectByPrimaryKey(projectId);
Organization organization = organizationMapper.selectByPrimaryKey(project.getOrganizationId());
List<String> orgList = new ArrayList<>();
orgList.add(project.getOrganizationId());
if(StringUtils.isBlank(organization.getParentId())){
OrganizationExample organizationExample = new OrganizationExample();
organizationExample.createCriteria().andParentIdEqualTo(project.getOrganizationId());
List<Organization> organizations = organizationMapper.selectByExample(organizationExample);
for (Organization org:organizations) {
orgList.add(org.getId());
}
}
return orgList;
}
/** /**
* 日记账导出(第一种方式)--暂时不使用 * 日记账导出(第一种方式)--暂时不使用
* @param citJournalAdjustDto * @param citJournalAdjustDto
...@@ -114,7 +140,8 @@ public class CitDataPreviewServiceImpl extends BaseService { ...@@ -114,7 +140,8 @@ public class CitDataPreviewServiceImpl extends BaseService {
*/ */
public int exportJournalMergeData2(CitJournalAdjustDto citJournalAdjustDto, HttpServletResponse response){ public int exportJournalMergeData2(CitJournalAdjustDto citJournalAdjustDto, HttpServletResponse response){
CitJournalEntryAdjust citJournalEntryAdjust = beanUtil.copyProperties(citJournalAdjustDto, new CitJournalEntryAdjust()); CitJournalEntryAdjust citJournalEntryAdjust = beanUtil.copyProperties(citJournalAdjustDto, new CitJournalEntryAdjust());
List<CitJournalEntryAdjust> journalMerges = citJournalMapper.getJournalMerge(citJournalEntryAdjust); List<String> orgList = getOrgList(citJournalAdjustDto.getProjectId());
List<CitJournalEntryAdjust> journalMerges = citJournalMapper.getJournalMergeByOrgList(citJournalEntryAdjust,orgList);
if(journalMerges.size()==0){ if(journalMerges.size()==0){
return 0; return 0;
} }
......
...@@ -1448,10 +1448,10 @@ public class DataImportService extends BaseService { ...@@ -1448,10 +1448,10 @@ public class DataImportService extends BaseService {
organizationExample.createCriteria().andNameEqualTo(billingBody); organizationExample.createCriteria().andNameEqualTo(billingBody);
List<Organization> orgs = organizationMapper.selectByExample(organizationExample); List<Organization> orgs = organizationMapper.selectByExample(organizationExample);
DataImportLog dataImportLog = generalDataImportLog(irs.get(0).getBillingBody(),"", "", DataImportLog dataImportLog = generalDataImportLog("","", "",
EnumImportType.InvoiceRecord.getCode(), irs.get(0).getPeriod()/100, EnumImportType.InvoiceRecord.getCode(), irs.get(0).getPeriod()/100,
tmsPeriod%100, irs.get(0).getPeriod()%100, tmsPeriod%100, irs.get(0).getPeriod()%100,
"", ""); irs.get(0).getBillingBody(), "");
dataImportLog.setRecordSize(irs.size()); dataImportLog.setRecordSize(irs.size());
if(orgs.size()<1){ if(orgs.size()<1){
...@@ -1788,8 +1788,6 @@ public class DataImportService extends BaseService { ...@@ -1788,8 +1788,6 @@ public class DataImportService extends BaseService {
DataImportLogExample.Criteria criteria =example.createCriteria(); DataImportLogExample.Criteria criteria =example.createCriteria();
Page page = PageHelper.startPage(param.getPageInfo().getPageIndex(), param.getPageInfo().getPageSize());
List<String> orgIds = organizationService.getMyOrgList().stream().map(OrgSelectDto::getId).collect(Collectors.toList()); List<String> orgIds = organizationService.getMyOrgList().stream().map(OrgSelectDto::getId).collect(Collectors.toList());
// 这里会导致任何人都可以看到未映射到主体的数据 // 这里会导致任何人都可以看到未映射到主体的数据
orgIds.add(""); orgIds.add("");
...@@ -1798,7 +1796,7 @@ public class DataImportService extends BaseService { ...@@ -1798,7 +1796,7 @@ public class DataImportService extends BaseService {
criteria.andOrganizationIdIn(orgIds); criteria.andOrganizationIdIn(orgIds);
} }
example.setOrderByClause("update_time desc"); example.setOrderByClause("update_time desc");
Page page = PageHelper.startPage(param.getPageInfo().getPageIndex(), param.getPageInfo().getPageSize());
PageInfo<DataImportLogDto> pageInfo = new PageInfo<>(dataImportLogMapper.selectByExample(example).stream() PageInfo<DataImportLogDto> pageInfo = new PageInfo<>(dataImportLogMapper.selectByExample(example).stream()
.map(o -> beanUtil.copyProperties(o, new DataImportLogDto())).collect(Collectors.toList())); .map(o -> beanUtil.copyProperties(o, new DataImportLogDto())).collect(Collectors.toList()));
pageInfo.setTotal(page.getTotal()); pageInfo.setTotal(page.getTotal());
......
...@@ -326,4 +326,22 @@ public class FormulaAgent { ...@@ -326,4 +326,22 @@ public class FormulaAgent {
} }
return citTbams.get(0).getEndingBalance(); return citTbams.get(0).getEndingBalance();
} }
/**
* 本年底的Q列,预提
* @param projectId
* @return
*/
public BigDecimal getAdvance(String projectId){
return adminMp.getAdvance(projectId);
}
/**
* 下年初的S列,已批准标准发票金额
* @param projectId
* @return
*/
public BigDecimal getApprovedStandardInvoiceAmount(String projectId){
return adminMp.getApprovedStandardInvoiceAmount(projectId);
}
} }
package pwc.taxtech.atms.vat.service.impl.report.functions;
import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import java.math.BigDecimal;
import java.util.*;
/**
* 预提重分类 获取预提费用
*/
public class YT extends FunctionBase implements FreeRefFunction {
public YT(FormulaContext formulaContext) {
super(formulaContext);
}
@Override
public ValueEval evaluate(ValueEval[] args, OperationEvaluationContext ec) {
try{
List<Object> dataSource = new ArrayList<>();
String formulaExpression = "YT()";
logger.debug(formulaExpression);
//预提
BigDecimal advance = agent.getAdvance(formulaContext.getProjectId());
//已批准标准发票金额
BigDecimal approvedStandardInvoiceAmount = agent.getApprovedStandardInvoiceAmount(formulaContext.getProjectId());
BigDecimal value = advance.subtract(approvedStandardInvoiceAmount);
Long dataSourceId = saveDataSource(ec, Collections.singletonList(dataSource),
FormulaDataSourceDetailType.AssetDetailDataSourceDto,
value, formulaContext.getPeriod(), formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId());
saveFormulaBlock(0, ec, formulaExpression, value, dataSourceId, formulaContext.getProjectId());
return new NumberEval(value.doubleValue());
}catch (Exception e){
return new NumberEval(0.00);
}
}
}
\ No newline at end of file
...@@ -106,5 +106,5 @@ public interface CitDataImportLogMapper extends MyMapper { ...@@ -106,5 +106,5 @@ public interface CitDataImportLogMapper extends MyMapper {
*/ */
int updateByPrimaryKey(CitDataImportLog record); int updateByPrimaryKey(CitDataImportLog record);
int updateDisplayOld(@Param("type") Integer type); int updateDisplayOld(@Param("type") Integer type, @Param("operator") String operator);
} }
\ No newline at end of file
...@@ -130,4 +130,12 @@ public interface CitJournalEntryAdjustMapper extends MyMapper { ...@@ -130,4 +130,12 @@ public interface CitJournalEntryAdjustMapper extends MyMapper {
* @return List<CitJournalEntryAdjust> * @return List<CitJournalEntryAdjust>
*/ */
List<CitJournalEntryAdjust> getJournalMerge(CitJournalEntryAdjust record); List<CitJournalEntryAdjust> getJournalMerge(CitJournalEntryAdjust record);
/**
* fetch data by projectId
*
* @param record
* @return List<CitJournalEntryAdjust>
*/
List<CitJournalEntryAdjust> getJournalMergeByOrgList(@Param("record") CitJournalEntryAdjust record, @Param("orgList") List<String> orgList);
} }
\ No newline at end of file
...@@ -187,4 +187,10 @@ public interface FormulaAdminMapper extends MyMapper { ...@@ -187,4 +187,10 @@ public interface FormulaAdminMapper extends MyMapper {
@Param("selectFilter") String selectFilter, @Param("selectFilter") String selectFilter,
@Param("year") String year, @Param("year") String year,
@Param("selectPeriod") String selectPeriod); @Param("selectPeriod") String selectPeriod);
@Select("select sum(advance) from cit_salary_advance where project_id = #{projectId} and month=0 and po_no in(select po_no from cit_salary_advance where month=1)")
BigDecimal getAdvance(@Param("projectId") String projectId);
@Select("select sum(approved_standard_invoice_amount) from cit_salary_advance where project_id = #{projectId} and month=1 and po_no in(select po_no from cit_salary_advance where month=0)")
BigDecimal getApprovedStandardInvoiceAmount(@Param("projectId") String projectId);
} }
...@@ -249,4 +249,6 @@ public interface ProjectMapper extends MyMapper { ...@@ -249,4 +249,6 @@ public interface ProjectMapper extends MyMapper {
List<ProjectAnaylsisDto> getTemlateWithServiceType(@Param("list") List<String> orgIds, @Param("year") Integer year, @Param("month") Integer month,@Param("reportName")String reportName); List<ProjectAnaylsisDto> getTemlateWithServiceType(@Param("list") List<String> orgIds, @Param("year") Integer year, @Param("month") Integer month,@Param("reportName")String reportName);
List<ProjectAnaylsisDto> getTemlateWithServiceType2(@Param("orgId")String orgId, @Param("year") Integer year, @Param("month") Integer month,@Param("code")String code); List<ProjectAnaylsisDto> getTemlateWithServiceType2(@Param("orgId")String orgId, @Param("year") Integer year, @Param("month") Integer month,@Param("code")String code);
List<Project> queryChildOrgAndProjectByOrgId(@Param("year")Integer year ,@Param("orgId")String orgId);
} }
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.CitDataImportLogMapper"> <mapper namespace="pwc.taxtech.atms.dao.CitDataImportLogMapper">
<update id="updateDisplayOld" parameterType="java.lang.Integer"> <update id="updateDisplayOld" parameterType="map">
update cit_data_import_log update cit_data_import_log
set display = 0 set display = 0
where where
type = #{type,jdbcType=TINYINT} type = #{type,jdbcType=TINYINT}
and display = 1 and display = 1
and operator = #{operator,jdbcType=VARCHAR}
</update> </update>
</mapper> </mapper>
\ No newline at end of file
...@@ -338,7 +338,6 @@ ...@@ -338,7 +338,6 @@
group by jfinal.subject_code group by jfinal.subject_code
</select> </select>
<select id="getJournalMerge" parameterType="map" resultMap="BaseResultMap"> <select id="getJournalMerge" parameterType="map" resultMap="BaseResultMap">
select select
id, organization_id, project_id, period, date, source, ledger_id, ledger_name, currency_code, id, organization_id, project_id, period, date, source, ledger_id, ledger_name, currency_code,
...@@ -394,7 +393,7 @@ ...@@ -394,7 +393,7 @@
and segment1_name = #{orgName,jdbcType=VARCHAR} and segment1_name = #{orgName,jdbcType=VARCHAR}
</if> </if>
<if test="subjectName != null and subjectName != ''"> <if test="subjectName != null and subjectName != ''">
and segment3_name LIKE CONCAT('%' ,#{segment3_name},'%') and segment3_name LIKE CONCAT('%' ,#{subjectName},'%')
</if> </if>
<if test="description != null and description != ''"> <if test="description != null and description != ''">
and description LIKE CONCAT('%' ,#{description},'%') and description LIKE CONCAT('%' ,#{description},'%')
...@@ -407,4 +406,72 @@ ...@@ -407,4 +406,72 @@
</if> </if>
</select> </select>
<select id="getJournalMergeByOrgList" parameterType="map" resultMap="BaseResultMap">
select
id, organization_id, project_id, period, date, source, ledger_id, ledger_name, currency_code,
status, header_id, line_num, approval_status, posted_status, account_period, accounting_date,
journal_source, category, name, voucher_num, description, org_code, subject_code,
org_name, segment2_name, subject_name, segment4_name, segment5_name, segment6_name, segment7_name, segment8_name,
segment9_name, segment10_name, journal_currency_code, sob_currency_code, accounted_dr, accounted_cr,
entered_dr, entered_cr, cf_item, attribute1, attribute2, attribute3, attribute4, attribute5,
attribute6, attribute7, attribute8, attribute9, attribute10, attribute11, attribute12, attribute13, attribute14, attribute15,
attribute16,
created_by, created_date, late_updated_by,
late_updated_date, create_time, update_time,is_select
from cit_journal_entry_adjust where period like #{record.period}
<if test="orgList != null and orgList.size > 0">
AND organization_id in
<foreach item="item" index="index" collection="orgList" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="record.subjectCode != null and record.subjectCode != ''">
and subject_code LIKE CONCAT('%' ,#{record.subjectCode},'%')
</if>
<if test="record.subjectName != null and record.subjectName != ''">
and subject_name LIKE CONCAT('%' ,#{record.subjectName},'%')
</if>
<if test="record.description != null and record.description != ''">
and description LIKE CONCAT('%' ,#{description},'%')
</if>
<if test="record.periodStart!=null">
AND account_period >= #{record.periodStart,jdbcType=INTEGER}
</if>
<if test="record.periodEnd!=null">
AND account_period &lt;= #{record.periodEnd,jdbcType=INTEGER}
</if>
UNION ALL
select
id, organization_id, project_id, tms_period as period ,date,source, ledger_id, ledger_name, currency_code,
status, header_id, line_num, approval_status, posted_status, period as account_period, accounting_date,
journal_source, category, name, voucher_num, description, segment1 as org_code, segment3 as subject_code,
segment1_name as org_name, segment2_name, segment3_name as subject_name, segment4_name, segment5_name, segment6_name,
segment7_name, segment8_name, segment9_name, segment10_name, journal_currency_code, sob_currency_code,
accounted_dr, accounted_cr, entered_dr, entered_cr, cf_item, attribute1, attribute2, attribute3, attribute4, attribute5,
attribute6, attribute7, attribute8, attribute9, attribute10, attribute11, attribute12, attribute13, attribute14, attribute15,
attribute16, created_by, created_date, late_updated_by, late_updated_date, create_time, update_time, is_select
from journal_entry where tms_period like #{record.period}
<if test="orgList != null and orgList.size > 0">
AND organization_id in
<foreach item="item" index="index" collection="orgList" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="record.subjectCode != null and record.subjectCode != ''">
and segment3 LIKE CONCAT('%' ,#{record.subjectCode},'%')
</if>
<if test="record.subjectName != null and record.subjectName != ''">
and segment3_name LIKE CONCAT('%' ,#{record.subjectName},'%')
</if>
<if test="record.description != null and record.description != ''">
and description LIKE CONCAT('%' ,#{record.description},'%')
</if>
<if test="record.periodStart!=null">
AND period &gt;= #{record.periodStart,jdbcType=INTEGER}
</if>
<if test="record.periodEnd!=null">
AND period &lt;= #{record.periodEnd,jdbcType=INTEGER}
</if>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -37,5 +37,13 @@ ...@@ -37,5 +37,13 @@
and t.code = #{code} and t.code = #{code}
</select> </select>
<select id="queryChildOrgAndProjectByOrgId" parameterType="map" resultMap="BaseResultMap">
select p.*
from project p
left join organization o on p.organization_id=o.id
where p.year = #{year,jdbcType=INTEGER}
and o.parent_id = #{orgId,jdbcType=VARCHAR}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -6,19 +6,13 @@ import org.slf4j.Logger; ...@@ -6,19 +6,13 @@ 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.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.*;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import pwc.taxtech.atms.common.DDUserInfoRes;
import pwc.taxtech.atms.common.HttpUtil; import pwc.taxtech.atms.common.HttpUtil;
import pwc.taxtech.atms.dto.AtmsTokenDto; import pwc.taxtech.atms.dto.AtmsTokenDto;
import pwc.taxtech.atms.dto.LoginOutputDto;
import pwc.taxtech.atms.web.AtmsWebSettings; import pwc.taxtech.atms.web.AtmsWebSettings;
import javax.servlet.ServletException; import javax.servlet.ServletException;
...@@ -56,6 +50,16 @@ public class IndexController { ...@@ -56,6 +50,16 @@ public class IndexController {
@Autowired @Autowired
private RestTemplate restTemplate; private RestTemplate restTemplate;
/**
*
* @param atmsApiToken
* @param ltpaToken
* @param request
* @param response
* @return
* @throws IOException
* @throws ServletException
*/
@RequestMapping(value = {"/", "/index", "/index.html"}, method = RequestMethod.GET) @RequestMapping(value = {"/", "/index", "/index.html"}, method = RequestMethod.GET)
public String login(@CookieValue(value = "AtmsApiToken", required = false) String atmsApiToken, public String login(@CookieValue(value = "AtmsApiToken", required = false) String atmsApiToken,
@CookieValue(value = "LtpaToken", required = false) String ltpaToken, @CookieValue(value = "LtpaToken", required = false) String ltpaToken,
...@@ -93,15 +97,24 @@ public class IndexController { ...@@ -93,15 +97,24 @@ public class IndexController {
return "redirect:Account/LogOn"; return "redirect:Account/LogOn";
} }
/**
*
* @param jumpto
* @param code
* @param response
* @throws IOException
* @throws ServletException
*/
@RequestMapping(value = {"/sso/callback"}) @RequestMapping(value = {"/sso/callback"})
public void ddSSOCallback(@RequestParam(value = "jumpto") String jumpto, public void ddSSOCallback(@RequestParam(value = "jumpto") String jumpto,
@RequestParam(value = "code") String code, @RequestParam(value = "code") String code,
HttpServletResponse response) throws IOException, ServletException { HttpServletResponse response) throws IOException, ServletException {
try{ try {
logger.info("jumpto=" + jumpto + "code=" + code);
String ticketStr = getTicket(code); String ticketStr = getTicket(code);
response.sendRedirect(jumpto+"?code="+code+"&ticketStr="+ticketStr); response.sendRedirect(jumpto + "?code=" + code + "&ticketStr=" + ticketStr);
}catch (Exception e){ } catch (Exception e) {
logger.error("ddSSOCallback error",e); logger.error("ddSSOCallback error", e);
} }
} }
...@@ -109,56 +122,84 @@ public class IndexController { ...@@ -109,56 +122,84 @@ public class IndexController {
* 18/03/2019 20:46 * 18/03/2019 20:46
* 跨站cookie的问题,所以做了一次跳转 * 跨站cookie的问题,所以做了一次跳转
* [code, ticketStr, request, response] * [code, ticketStr, request, response]
* @author Gary J Li *
* @return * @return
* @author Gary J Li
*/ */
@RequestMapping(value = {"/sso/accept"}) @RequestMapping(value = {"/sso/accept"})
public String accept(@RequestParam(value = "code") String code, public String accept(@RequestParam(value = "code") String code,
@RequestParam(value = "ticketStr") String ticketStr,HttpServletRequest request, @RequestParam(value = "ticketStr") String ticketStr, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException { HttpServletResponse response) throws IOException, ServletException {
StringBuffer url = request.getRequestURL(); StringBuffer url = request.getRequestURL();
String tempContextUrl = url.delete(url.length() - request.getRequestURI().length(), url.length()).append("/").toString(); String tempContextUrl = url.delete(url.length() - request.getRequestURI().length(), url.length()).append("/").toString();
try{ try {
Cookie codeCookie = new Cookie("ddCode",URLEncoder.encode(code, "UTF-8")); Cookie codeCookie = new Cookie("ddCode", URLEncoder.encode(code, "UTF-8"));
codeCookie.setPath("/"); codeCookie.setPath("/");
codeCookie.setMaxAge(18000); codeCookie.setMaxAge(18000);
Cookie ddTicket = new Cookie("ddTicket",URLEncoder.encode(ticketStr, "UTF-8")); Cookie ddTicket = new Cookie("ddTicket", URLEncoder.encode(ticketStr, "UTF-8"));
ddTicket.setPath("/"); ddTicket.setPath("/");
ddTicket.setMaxAge(18000); ddTicket.setMaxAge(18000);
response.addCookie(codeCookie); response.addCookie(codeCookie);
response.addCookie(ddTicket); response.addCookie(ddTicket);
}catch (Exception e){ } catch (Exception e) {
logger.error("ddSSOCallback error",e); logger.error("ddSSOCallback error", e);
} }
return "redirect:"+tempContextUrl; return "redirect:" + tempContextUrl;
} }
@RequestMapping(value = {"/admin", "/admin.html"}, method = RequestMethod.GET) @RequestMapping(value = {"/admin", "/admin.html"}, method = RequestMethod.GET)
public String admin(@CookieValue(value = "AtmsApiToken", required = false) String atmsApiToken) { public String admin(@CookieValue(value = "AtmsApiToken", required = false) String atmsApiToken) {
if (StringUtils.hasText(atmsApiToken)) { if (StringUtils.hasText( atmsApiToken)) {
return "admin"; return "admin";
} }
return "redirect:Account/LogOn"; return "redirect:Account/LogOn";
} }
public String getTicket(String code) { public String getTicket(String code) {
try{ try {
JSONObject object; JSONObject object;
String ddResp = HttpUtil.post(getUserInfoUrl + "check_code", "code=" + code + "&app_key=" + appKey+ "&app_id=" + appId, "application/x-www-form-urlencoded", "UTF-8", 10000, 10000); String url = getUserInfoUrl + "check_code";
String ddResp = HttpUtil.post(url, "code=" + code + "&app_key=" + appKey + "&app_id=" + appId, "application/x-www-form-urlencoded", "UTF-8", 10000, 10000);
object = JSONObject.parseObject(ddResp); object = JSONObject.parseObject(ddResp);
logger.info("get ddTicket by code , object=" + object);
Map<String, Object> res = object.getInnerMap(); Map<String, Object> res = object.getInnerMap();
int errno = (int) res.get("errno"); int errno = (int) res.get("errno");
if (errno != 0) { if (errno != 0) {
logger.warn(String.format("DD Ticket get Failed:[%s]", object.toJSONString())); logger.warn(String.format("DD Ticket get Failed:[%s]", object.toJSONString()));
return null; return null;
}else{ } else {
Map<String, String> data = (Map)res.get("data");
Map<String, String> data = (Map) res.get("data");
logger.info("check_code data=" + data);
return data.get("ticket"); return data.get("ticket");
} }
}catch (Exception e){ } catch (Exception e) {
logger.error(String.format("通过code:[%s]获取Ticket失败",code)); logger.error(String.format("通过code:[%s]获取Ticket失败", code));
} }
return null; return null;
} }
/**
* sam
* @param ticket
* @param request
* @param response
* @return
*/
@RequestMapping(value = {"/sso/getUser"}, method = RequestMethod.GET)
@ResponseBody
public String accept(@RequestParam(value = "ticket") String ticket, HttpServletRequest request,
HttpServletResponse response) {
DDUserInfoRes ddUserInfoRes = null;
try {
String responseDD = HttpUtil.post(getUserInfoUrl + "get_user_by_ticket", "ticket=" + ticket + "&app_id=" + appId, "application/x-www-form-urlencoded", "UTF-8", 10000, 10000);
logger.info(String.format("DD-get_user_by_ticket返回:[%s]", responseDD));
ddUserInfoRes = JSONObject.parseObject(responseDD, DDUserInfoRes.class);
} catch (Exception e) {
logger.info(String.format("调用DDSSO获取用户信息失败:[%s]", e.getMessage()), e);
}
return JSON.toJSONString(ddUserInfoRes);
}
} }
...@@ -1153,6 +1153,9 @@ ...@@ -1153,6 +1153,9 @@
"ItemData": "Item Data", "ItemData": "Item Data",
"GenerateJournalMergeAndTB": "Handle Journal", "GenerateJournalMergeAndTB": "Handle Journal",
"ProcessSuccess": "Process Success", "ProcessSuccess": "Process Success",
"ProcessFail": "Process Fail" "ProcessFail": "Process Fail",
"EndOfThisYear": "End Of This Year",
"BeginOfNextYear": "Begin Of Next Year",
"PreClassified": "Pre Classified"
} }
\ No newline at end of file
...@@ -1206,7 +1206,10 @@ ...@@ -1206,7 +1206,10 @@
"ItemData": "条数据", "ItemData": "条数据",
"GenerateJournalMergeAndTB": "处理日记账", "GenerateJournalMergeAndTB": "处理日记账",
"ProcessSuccess": "处理成功", "ProcessSuccess": "处理成功",
"ProcessFail": "处理失败" "ProcessFail": "处理失败",
"EndOfThisYear": "本年底",
"BeginOfNextYear": "下年初",
"PreClassified": "预提重分类"
......
...@@ -519,7 +519,7 @@ ...@@ -519,7 +519,7 @@
rowData.taxDepreciationPeriod = null; rowData.taxDepreciationPeriod = null;
} else { } else {
rowData.assetDetailGroupId = aseetDetailList[0].id; rowData.assetDetailGroupId = aseetDetailList[0].id;
rowData.taxDepreciationPeriod = aseetDetailList[0].groupYear * 12; rowData.taxDepreciationPeriod = aseetDetailList[0].groupYear;
} }
; ;
}, },
...@@ -543,7 +543,7 @@ ...@@ -543,7 +543,7 @@
return item.id == value; return item.id == value;
}); });
if (aseetDetailList.length > 0) { if (aseetDetailList.length > 0) {
rowData.taxDepreciationPeriod = aseetDetailList[0].groupYear * 12; rowData.taxDepreciationPeriod = aseetDetailList[0].groupYear;
} }
}, },
lookup: { lookup: {
...@@ -657,7 +657,8 @@ ...@@ -657,7 +657,8 @@
{ {
caption: $translate.instant('ResidualRate'), caption: $translate.instant('ResidualRate'),
dataField: "residualRate", dataField: "residualRate",
format: {type: 'percent', precision: 2}, // format: {type: 'percent', precision: 2},
format: {type: 'fixedPoint', precision: 2},
width: 80, width: 80,
allowEditing: false allowEditing: false
}, },
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
$scope.queryParams = { $scope.queryParams = {
pageInfo: {}, pageInfo: {},
period: vatSessionService.year,
periodStart: '', periodStart: '',
periodEnd: '', periodEnd: '',
subjectCode: null, subjectCode: null,
...@@ -90,6 +91,7 @@ ...@@ -90,6 +91,7 @@
var doDataFilterReset = function () { var doDataFilterReset = function () {
$scope.queryParams = { $scope.queryParams = {
pageInfo: {}, pageInfo: {},
period: vatSessionService.year,
periodStart: '', periodStart: '',
periodEnd: '', periodEnd: '',
subjectCode: null, subjectCode: null,
...@@ -185,7 +187,8 @@ ...@@ -185,7 +187,8 @@
$scope.pagingOptions = { $scope.pagingOptions = {
pageIndex: 1, //当前页码 pageIndex: 1, //当前页码
totalItems: 0, //总数据 totalItems: 0, //总数据
pageSize: 50 //每页多少条数据 pageSize: 50, //每页多少条数据
pageSizeString:"50"
}; };
$('#input-invoice-period-picker').focus(function () { $('#input-invoice-period-picker').focus(function () {
...@@ -281,6 +284,7 @@ ...@@ -281,6 +284,7 @@
initPeriods(); initPeriods();
//初始化查询条件-期间范围 //初始化查询条件-期间范围
$scope.queryParams.period = vatSessionService.year;
$scope.queryParams.periodStart = vatSessionService.year * 100 + 1; $scope.queryParams.periodStart = vatSessionService.year * 100 + 1;
$scope.queryParams.periodEnd = vatSessionService.year * 100 + 12; $scope.queryParams.periodEnd = vatSessionService.year * 100 + 12;
$scope.queryParams.organizationId = vatSessionService.project.organizationID; $scope.queryParams.organizationId = vatSessionService.project.organizationID;
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
$scope.selectedDate = new Date(vatSessionService.year, vatSessionService.month - 1, 1); $scope.selectedDate = new Date(vatSessionService.year, vatSessionService.month - 1, 1);
$scope.startDate = new Date(year - 20, 1, 1); $scope.startDate = new Date(year - 20, 1, 1);
$scope.endDate = new Date(year + 20, 1, 1); $scope.endDate = new Date(year + 20, 1, 1);
$scope.viewMode = 1; $scope.viewMode = 2;
$scope.dateFormat = $translate.instant('dateFormat4YearMonth'); $scope.dateFormat = $translate.instant('dateFormat4Year');
$scope.importExcelFile = null; $scope.importExcelFile = null;
$scope.UploadPeriodTime = null; $scope.UploadPeriodTime = null;
...@@ -38,6 +38,28 @@ ...@@ -38,6 +38,28 @@
$scope.checkedCompanyTypeList = ""; $scope.checkedCompanyTypeList = "";
$scope.maxTitleLength = constant.maxButtonTitleLength; $scope.maxTitleLength = constant.maxButtonTitleLength;
$scope.month = 0;
//税会差异选项内容
$scope.applyFilterTypes = [{
key: "0",
name: $translate.instant('EndOfThisYear')
}, {
key: "1",
name: $translate.instant('BeginOfNextYear')
}];
//初始化税会差异选项
$scope.endBeginOptions = {
items: $scope.applyFilterTypes,
value: $scope.applyFilterTypes[0].key,
valueExpr: "key",
displayExpr: "name",
onValueChanged: function (data) {
$scope.month = data.value;
}
};
//写日志 //写日志
var logDto = { var logDto = {
...@@ -157,7 +179,8 @@ ...@@ -157,7 +179,8 @@
orgIds : orgIds, orgIds : orgIds,
periodDate : period, periodDate : period,
importType : importType, importType : importType,
importFileType : constant.citImportFileType.SalaryAdvance importFileType : constant.citImportFileType.SalaryAdvance,
month: $scope.month
}, },
file: impExl, file: impExl,
headers: { headers: {
......
...@@ -31,6 +31,11 @@ ...@@ -31,6 +31,11 @@
</li> </li>
</ul> </ul>
</div> </div>
<!--本年底、下年初的选择-->
<span class="text-bold" translate="PreClassified"></span>:
<div class="option" style="display: inline-block">
<div id="endBeginButton" dx-select-box="endBeginOptions" style="width: 130px"></div>
</div>
<span class="text-bold" translate="InvoiceQJ"></span>: <span class="text-bold" translate="InvoiceQJ"></span>:
<div class="period-picker" style="margin-left:10px"> <div class="period-picker" style="margin-left:10px">
<input type="text" id="periodDatepicker" class="datepicker imp-subheader" style="width:120px;" <input type="text" id="periodDatepicker" class="datepicker imp-subheader" style="width:120px;"
......
...@@ -149,10 +149,10 @@ ...@@ -149,10 +149,10 @@
} }
input { input {
width: 50px; //width: 50px;
outline: none; outline: none;
border-radius: 3px; border-radius: 3px;
border: 1px solid #3c3a36; //border: 1px solid #3c3a36;
padding: 2px; padding: 2px;
text-align: center; text-align: center;
} }
...@@ -342,4 +342,22 @@ ...@@ -342,4 +342,22 @@
float:left; float:left;
padding-left: 15px; padding-left: 15px;
} }
}
.option {
margin-top: 10px;
margin-bottom: 10px;
}
.option > span {
margin-right: 10px;
}
.option > .dx-selectbox {
display: inline-block;
vertical-align: middle;
}
.option > input {
width: auto;
} }
\ No newline at end of file
...@@ -9,8 +9,8 @@ webservices.factory('citImportDataService', ['$http', 'apiConfig', function ($ht ...@@ -9,8 +9,8 @@ webservices.factory('citImportDataService', ['$http', 'apiConfig', function ($ht
}, },
/***************************************批量数据导入服务(真) end**************************************************************/ /***************************************批量数据导入服务(真) end**************************************************************/
autoGeneTB: function () { // autoGeneTB: function () {
return $http.post('/citImport/getCitDataImportLog', apiConfig.create()); // return $http.post('/citImport/getCitDataImportLog', apiConfig.create());
}, // },
}; };
}]); }]);
\ No newline at end of file
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
width: '10%', width: '10%',
caption: $translate.instant('LogOperationTime'), caption: $translate.instant('LogOperationTime'),
calculateCellValue: function(data) { calculateCellValue: function(data) {
return new Date(data.operateTime).formatDateTime('yyyy-MM-dd hh:mm:ss'); return new Date(data.operateTime).formatDateTime('yyyy-MM-dd HH:mm:ss');
} }
} }
], ],
......
...@@ -6,23 +6,6 @@ ...@@ -6,23 +6,6 @@
<meta name=viewport content="width=device-width,initial-scale=1"> <meta name=viewport content="width=device-width,initial-scale=1">
<link rel=icon href=favicon.ico> <link rel=icon href=favicon.ico>
<title>didi2</title> <title>didi2</title>
<link rel=stylesheet href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
<link rel=stylesheet href="https://fonts.googleapis.com/css?family=Material+Icons">
<link href=js/about.17654e8a.js rel=prefetch>
<link href=css/app.cf16809e.css rel=preload as=style>
<link href=css/chunk-vendors.2f35f377.css rel=preload as=style>
<link href=js/app.c8b0fed0.js rel=preload as=script>
<link href=js/chunk-vendors.39b13767.js rel=preload as=script>
<link href=css/chunk-vendors.2f35f377.css rel=stylesheet>
<link href=css/app.cf16809e.css rel=stylesheet>
</head>
<body>
<noscript>
<strong>We're sorry but didi2 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<script src=js/chunk-vendors.39b13767.js></script>
<script src=js/app.c8b0fed0.js></script>
<script> <script>
//获取地址栏参数,name:参数名称 //获取地址栏参数,name:参数名称
var z =function getUrlParms(name){ var z =function getUrlParms(name){
...@@ -32,8 +15,10 @@ ...@@ -32,8 +15,10 @@
return unescape(r[2]); return unescape(r[2]);
return null; return null;
} }
var code = z("code");
var ticket=z("ticketStr"); var ddTicket = z("ticketStr");
//設置cookie
var sc= function setCookie(name,value) { var sc= function setCookie(name,value) {
var Days = 30; var Days = 30;
var exp = new Date(); var exp = new Date();
...@@ -41,20 +26,54 @@ ...@@ -41,20 +26,54 @@
document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString(); document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
} }
sc("ddCode",code); sc("ddTicket",ddTicket);
sc("ddTicket",ticket );
var gc= function getCookie(name)
{
var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)"); var ReUrl="https://me.xiaojukeji.com/project/stargate-auth/html/login.html?redirect_uri=http%3A%2F%2Fmis.diditaxi.com.cn%2Fauth%3Fapp_id%3D2500%26version%3D1.0%26jumpto%3Dhttp://dts-test.erp.didichuxing.com/orangeweb/index.html%26callback_index%3D0"
if(arr=document.cookie.match(reg)) if(ddTicket==undefined || ddTicket=="" || ddTicket == null){
return unescape(arr[2]); document.location=ReUrl;
else }
return null; else {
//创建核心对象
xmlhttp = null;
if (window.XMLHttpRequest) {// code for Firefox, Opera, IE7, etc.
xmlhttp = new XMLHttpRequest();
} else if (window.ActiveXObject) {// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
//编写回调函数
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
//
}
}
//這個 url 測試的
var getUserUrl="http://dts-test.erp.didichuxing.com/H5/sso/getUser?ticket=";
//open设置请求方式和请求路径
xmlhttp.open("get", getUserUrl+ddTicket);
//send 发送
xmlhttp.send();
} }
</script> </script>
<link rel=stylesheet href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
<link rel=stylesheet href="https://fonts.googleapis.com/css?family=Material+Icons">
<link href=js/about.17654e8a.js rel=prefetch>
<link href=css/app.cf16809e.css rel=preload as=style>
<link href=css/chunk-vendors.2f35f377.css rel=preload as=style>
<link href=js/app.c8b0fed0.js rel=preload as=script>
<link href=js/chunk-vendors.39b13767.js rel=preload as=script>
<link href=css/chunk-vendors.2f35f377.css rel=stylesheet>
<link href=css/app.cf16809e.css rel=stylesheet>
</head>
<body>
<noscript>
<strong>We're sorry but didi2 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<script src=js/chunk-vendors.39b13767.js></script>
<script src=js/app.c8b0fed0.js></script>
</body> </body>
</html> </html>
\ No newline at end of file
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