Commit f51b3340 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

parents d1da663a 3f21f623
......@@ -34,8 +34,7 @@ public class RevenueConfController extends BaseController {
@PostMapping("add")
public ApiResultDto addConf(@RequestBody RevConfAddDto addDto) {
revenueConfService.addConfig(addDto);
return ApiResultDto.success();
return revenueConfService.addConfig(addDto);
}
@PostMapping("update")
......
......@@ -215,6 +215,19 @@ public class DataImportLogDto implements Serializable {
*/
private Date updateTime;
/**
* Database Column Remarks:
* 导入类型
默认0;追加导入1;覆盖导入2;
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column data_import_log.import_type
*
* @mbg.generated
*/
private Integer importType;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table data_import_log
......@@ -623,12 +636,14 @@ public class DataImportLogDto implements Serializable {
this.recordSize = recordSize;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table data_import_log
*
* @mbg.generated
*/
public Integer getImportType() {
return importType;
}
public void setImportType(Integer importType) {
this.importType = importType;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
......@@ -637,6 +652,7 @@ public class DataImportLogDto implements Serializable {
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", organizationId=").append(organizationId);
sb.append(", taxpayerIdNum=").append(taxpayerIdNum);
sb.append(", type=").append(type);
sb.append(", companyCode=").append(companyCode);
sb.append(", companyName=").append(companyName);
......@@ -649,8 +665,10 @@ public class DataImportLogDto implements Serializable {
sb.append(", operateTime=").append(operateTime);
sb.append(", importResult=").append(importResult);
sb.append(", errorMsg=").append(errorMsg);
sb.append(", recordSize=").append(recordSize);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", importType=").append(importType);
sb.append("]");
return sb.toString();
}
......
......@@ -283,7 +283,8 @@ public class DataImportService extends BaseService {
EnumImportType.ProfitLoss.getCode(), period/100,
tmsPeriod%100, period%100,
companyName, fileType);
//添加导入类型
dataImportLog.setImportType(importType);
if (organizations.size() < 1) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.NoCompanyError);
......@@ -460,6 +461,8 @@ public class DataImportService extends BaseService {
EnumImportType.BalanceSheet.getCode(), period/100,
tmsPeriod%100, period%100,
companyName, fileType);
//添加导入类型
dataImportLog.setImportType(importType);
if (organizations.size() < 1) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.NoCompanyError);
......@@ -611,6 +614,8 @@ public class DataImportService extends BaseService {
EnumImportType.CashFlow.getCode(), period/100,
tmsPeriod%100, period%100,
companyName, fileType);
//添加导入类型
dataImportLog.setImportType(importType);
if (organizations.size() < 1) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.NoCompanyError);
......@@ -767,6 +772,8 @@ public class DataImportService extends BaseService {
EnumImportType.InvoiceData.getCode(), period/100,
tmsPeriod%100, period%100,
companyName, fileType);
//添加导入类型
dataImportLog.setImportType(importType);
if (organizations.size() < 1) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.NoCompanyError);
......@@ -978,7 +985,8 @@ public class DataImportService extends BaseService {
tmsPeriod%100, period%100,
rlits.get(0).getSubjectName(), "");
dataImportLog.setRecordSize(rlits.size());
//添加导入类型
dataImportLog.setImportType(importType);
if(orgs.size()<1){
dataImportLog.setErrorMsg(ErrorMessageCN.NoCompanyError);
dataImportLog.setImportResult(false);
......@@ -1081,7 +1089,8 @@ public class DataImportService extends BaseService {
tmsPeriod%100, ats.get(0).getPeriod()%100,
ats.get(0).getSegment1Name(), "");
dataImportLog.setRecordSize(ats.size());
//添加导入类型
dataImportLog.setImportType(importType);
if(orgs.size()<1){
dataImportLog.setErrorMsg(ErrorMessageCN.NoCompanyError);
dataImportLog.setImportResult(false);
......@@ -1185,7 +1194,8 @@ public class DataImportService extends BaseService {
tmsPeriod%100, cprs.get(0).getPeriod()%100,
"", "");
dataImportLog.setRecordSize(cprs.size());
//添加导入类型
dataImportLog.setImportType(importType);
if(orgs.size()<1){
dataImportLog.setErrorMsg(ErrorMessageCN.NoCompanyError);
dataImportLog.setImportResult(false);
......@@ -1289,6 +1299,8 @@ public class DataImportService extends BaseService {
EnumImportType.CertifiedInvoicesList.getCode(), period/100,
tmsPeriod%100, period%100,
"", fileType);
//添加导入类型
dataImportLog.setImportType(importType);
if (organizations.size() < 1) {
dataImportLog.setImportResult(false);
dataImportLog.setErrorMsg(ErrorMessageCN.NoCompanyError);
......@@ -1453,7 +1465,8 @@ public class DataImportService extends BaseService {
tmsPeriod%100, irs.get(0).getPeriod()%100,
irs.get(0).getBillingBody(), "");
dataImportLog.setRecordSize(irs.size());
//添加导入类型
dataImportLog.setImportType(importType);
if(orgs.size()<1){
dataImportLog.setErrorMsg(ErrorMessageCN.NoCompanyError);
dataImportLog.setImportResult(false);
......@@ -1552,6 +1565,7 @@ public class DataImportService extends BaseService {
private List<InvoiceRecord> generalIRs(Sheet sheet) {
List<InvoiceRecord> irs = Lists.newArrayList();
Set<String> orgsNot=new HashSet<>();
for (int j = 1; j <= sheet.getLastRowNum(); j++) {
InvoiceRecord ir = new InvoiceRecord();
Long irId = idService.nextId();
......@@ -1561,6 +1575,14 @@ public class DataImportService extends BaseService {
}
ir.setId(irId);
ir.setSeqNo(getCellIntegerValue(row.getCell(0)));
//所属机构
if(StringUtils.isBlank(getCellStringValue(row.getCell(1)))){
continue;
}
//如果存在有错误的机构也跳过
if(validIRExcelCell(row,orgsNot).contains(getCellStringValue(row.getCell(1)))){
continue;
}
ir.setBillingBody(getCellStringValue(row.getCell(1)));
ir.setCustomerCompanyName(getCellStringValue(row.getCell(2)));
ir.setInvoiceType(getCellStringValue(row.getCell(3)));
......@@ -1590,6 +1612,38 @@ public class DataImportService extends BaseService {
return irs;
}
/**
* 导入分发-已开增值税发票记录,校验1-发票类型、开票内容、所属机构、税率、税额、开票金额任意不为空;
* 且校验2-校验发票类型的值只能包含“增值税专用发票”、“增值税普通发票”、“增值税电子发票”和“机动车发票”,
* 存在校验1或校验2不通过的机构不进行导入
* @param row
* @return
*/
private Set<String> validIRExcelCell(Row row,Set<String> orgsNot ){
List<String> invoiceTypes=Arrays.asList(new String[]{"增值税专用发票","增值税普通发票","增值税电子发票","机动车发票"});
String orgName=getCellStringValue(row.getCell(1));
//发票类型
if(StringUtils.isBlank(getCellStringValue(row.getCell(3)))){
orgsNot.add(orgName);
}
else if(!invoiceTypes.contains(getCellStringValue(row.getCell(3)))){
orgsNot.add(orgName);
}
//开票内容
if(StringUtils.isBlank(getCellStringValue(row.getCell(4)))){
orgsNot.add(orgName);
}
//开票金额
if(StringUtils.isBlank(getCellStringValue(row.getCell(5)))){
orgsNot.add(orgName);
}
//税额
if(StringUtils.isBlank(getCellStringValue(row.getCell(20)))){
orgsNot.add(orgName);
}
return orgsNot;
}
private List<AdjustmentTable> generalATs(Sheet sheet) {
List<AdjustmentTable> ats = Lists.newArrayList();
for (int j = 1; j <= sheet.getLastRowNum(); j++) {
......
......@@ -8,6 +8,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.constant.enums.RevenueConfEnum;
import pwc.taxtech.atms.dpo.OrgSelectDto;
import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.dto.revenuconf.RevConfAddDto;
import pwc.taxtech.atms.dto.revenuconf.RevenueConfParam;
import pwc.taxtech.atms.dto.revenuconf.RevenueConfResult;
......@@ -71,14 +72,28 @@ public class RevenueConfService extends BaseService {
*
* @param addDto RevConfAddDto
*/
public void addConfig(RevConfAddDto addDto) {
public ApiResultDto addConfig(RevConfAddDto addDto) {
RevenueConfigExample revenueConfigExample = new RevenueConfigExample();
revenueConfigExample.createCriteria().andNameEqualTo(addDto.getName());
List<RevenueConfig> list = revenueConfigMapper.selectByExample(revenueConfigExample);
if (list.size() > 0) {
ApiResultDto apiResultDto = ApiResultDto.success();
apiResultDto.setMessage("DuplicateName");
return apiResultDto;
}
if (!CollectionUtils.isEmpty(addDto.getOrgList())) {
addDto.getOrgList().forEach(id -> {
addDto.setId(idService.nextId());
addDto.setOrgId(id);
revenueConfigMapper.insertSelective(parseEntity(addDto));
});
return ApiResultDto.success();
}
return ApiResultDto.fail();
}
/**
......
......@@ -41,11 +41,19 @@
<property name="rootInterface" value="pwc.taxtech.atms.MyMapper"/>
</javaClientGenerator>
<table tableName="analysis_expected_tax_return" domainObjectName="AnalysisExpectedTaxReturn">
<table tableName="data_import_log" domainObjectName="DataImportLog">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
<columnOverride column="type" javaType="java.lang.Integer" jdbcType="TINYINT"/>
<columnOverride column="tms_period_month" javaType="java.lang.Integer" jdbcType="TINYINT"/>
<columnOverride column="period_month" javaType="java.lang.Integer" jdbcType="TINYINT"/>
</table>
<!--<table tableName="analysis_expected_tax_return" domainObjectName="AnalysisExpectedTaxReturn">-->
<!--<property name="useActualColumnNames" value="false"/>-->
<!--<property name="ignoreQualifiersAtRuntime" value="true"/>-->
<!--</table>-->
<!--<table tableName="cit_distribution" domainObjectName="CitDistribution">-->
<!--<property name="useActualColumnNames" value="false"/>-->
<!--<property name="ignoreQualifiersAtRuntime" value="true"/>-->
......@@ -62,13 +70,7 @@
<columnOverride column="num_of_branches" javaType="java.lang.Integer" jdbcType="TINYINT"/>
</table>
<table tableName="data_import_log" domainObjectName="DataImportLog">
<property name="useActualColumnNames" value="false"/>
<property name="ignoreQualifiersAtRuntime" value="true"/>
<columnOverride column="type" javaType="java.lang.Integer" jdbcType="TINYINT"/>
<columnOverride column="tms_period_month" javaType="java.lang.Integer" jdbcType="TINYINT"/>
<columnOverride column="period_month" javaType="java.lang.Integer" jdbcType="TINYINT"/>
</table>
<table tableName="organization_extra" domainObjectName="OrganizationExtra">
<property name="useActualColumnNames" value="false"/>
......
......@@ -106,5 +106,6 @@ public interface DataImportLogMapper extends MyMapper {
*/
int updateByPrimaryKey(DataImportLog record);
int displayOld(@Param("type") Integer type);
}
\ No newline at end of file
......@@ -220,6 +220,18 @@ public class DataImportLog extends BaseEntity implements Serializable {
*/
private Date updateTime;
/**
* Database Column Remarks:
* 导入类型
默认0;追加导入1;覆盖导入2;
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column data_import_log.import_type
*
* @mbg.generated
*/
private Integer importType;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table data_import_log
......@@ -684,6 +696,30 @@ public class DataImportLog extends BaseEntity implements Serializable {
this.updateTime = updateTime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column data_import_log.import_type
*
* @return the value of data_import_log.import_type
*
* @mbg.generated
*/
public Integer getImportType() {
return importType;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column data_import_log.import_type
*
* @param importType the value for data_import_log.import_type
*
* @mbg.generated
*/
public void setImportType(Integer importType) {
this.importType = importType;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table data_import_log
......@@ -715,6 +751,7 @@ public class DataImportLog extends BaseEntity implements Serializable {
sb.append(", display=").append(display);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", importType=").append(importType);
sb.append("]");
return sb.toString();
}
......
......@@ -1414,6 +1414,66 @@ public class DataImportLogExample {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andImportTypeIsNull() {
addCriterion("import_type is null");
return (Criteria) this;
}
public Criteria andImportTypeIsNotNull() {
addCriterion("import_type is not null");
return (Criteria) this;
}
public Criteria andImportTypeEqualTo(Integer value) {
addCriterion("import_type =", value, "importType");
return (Criteria) this;
}
public Criteria andImportTypeNotEqualTo(Integer value) {
addCriterion("import_type <>", value, "importType");
return (Criteria) this;
}
public Criteria andImportTypeGreaterThan(Integer value) {
addCriterion("import_type >", value, "importType");
return (Criteria) this;
}
public Criteria andImportTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("import_type >=", value, "importType");
return (Criteria) this;
}
public Criteria andImportTypeLessThan(Integer value) {
addCriterion("import_type <", value, "importType");
return (Criteria) this;
}
public Criteria andImportTypeLessThanOrEqualTo(Integer value) {
addCriterion("import_type <=", value, "importType");
return (Criteria) this;
}
public Criteria andImportTypeIn(List<Integer> values) {
addCriterion("import_type in", values, "importType");
return (Criteria) this;
}
public Criteria andImportTypeNotIn(List<Integer> values) {
addCriterion("import_type not in", values, "importType");
return (Criteria) this;
}
public Criteria andImportTypeBetween(Integer value1, Integer value2) {
addCriterion("import_type between", value1, value2, "importType");
return (Criteria) this;
}
public Criteria andImportTypeNotBetween(Integer value1, Integer value2) {
addCriterion("import_type not between", value1, value2, "importType");
return (Criteria) this;
}
}
/**
......
......@@ -25,6 +25,7 @@
<result column="display" jdbcType="BIT" property="display" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="import_type" jdbcType="INTEGER" property="importType" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
......@@ -99,7 +100,7 @@
-->
id, organization_id, taxpayer_id_num, type, company_code, company_name, file_type,
period_year, tms_period_month, period_month, period_status, operator, operate_time,
import_result, error_msg, record_size, display, create_time, update_time
import_result, error_msg, record_size, display, create_time, update_time, import_type
</sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.entity.DataImportLogExample" resultMap="BaseResultMap">
<!--
......@@ -158,14 +159,14 @@
period_month, period_status, operator,
operate_time, import_result, error_msg,
record_size, display, create_time,
update_time)
update_time, import_type)
values (#{id,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR}, #{taxpayerIdNum,jdbcType=VARCHAR},
#{type,jdbcType=TINYINT}, #{companyCode,jdbcType=VARCHAR}, #{companyName,jdbcType=VARCHAR},
#{fileType,jdbcType=VARCHAR}, #{periodYear,jdbcType=INTEGER}, #{tmsPeriodMonth,jdbcType=TINYINT},
#{periodMonth,jdbcType=TINYINT}, #{periodStatus,jdbcType=VARCHAR}, #{operator,jdbcType=VARCHAR},
#{operateTime,jdbcType=TIMESTAMP}, #{importResult,jdbcType=BIT}, #{errorMsg,jdbcType=VARCHAR},
#{recordSize,jdbcType=INTEGER}, #{display,jdbcType=BIT}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
#{updateTime,jdbcType=TIMESTAMP}, #{importType,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.DataImportLog">
<!--
......@@ -231,6 +232,9 @@
<if test="updateTime != null">
update_time,
</if>
<if test="importType != null">
import_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
......@@ -290,6 +294,9 @@
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="importType != null">
#{importType,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="pwc.taxtech.atms.entity.DataImportLogExample" resultType="java.lang.Long">
......@@ -366,6 +373,9 @@
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.importType != null">
import_type = #{record.importType,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
......@@ -395,7 +405,8 @@
record_size = #{record.recordSize,jdbcType=INTEGER},
display = #{record.display,jdbcType=BIT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
import_type = #{record.importType,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -461,6 +472,9 @@
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="importType != null">
import_type = #{importType,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
......@@ -487,7 +501,8 @@
record_size = #{recordSize,jdbcType=INTEGER},
display = #{display,jdbcType=BIT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
update_time = #{updateTime,jdbcType=TIMESTAMP},
import_type = #{importType,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.entity.DataImportLogExample" resultMap="BaseResultMap">
......
/* fallback */
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(https://fonts.gstatic.com/s/materialicons/v47/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format('woff2');
}
.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
-webkit-font-feature-settings: 'liga';
-webkit-font-smoothing: antialiased;
}
This diff is collapsed.
......@@ -6,8 +6,8 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<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 rel="stylesheet" href="font_roboto.css">
<link rel="stylesheet" href="font_material.css">
</head>
<body>
<noscript>
......
......@@ -14,6 +14,7 @@ import pwc.taxtech.atms.common.DDUserInfoRes;
import pwc.taxtech.atms.common.HttpUtil;
import pwc.taxtech.atms.dto.AtmsTokenDto;
import pwc.taxtech.atms.web.AtmsWebSettings;
import pwc.taxtech.atms.web.service.OrangeHeapService;
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
......@@ -21,6 +22,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
@Controller
......@@ -50,6 +52,8 @@ public class IndexController {
@Autowired
private RestTemplate restTemplate;
@Autowired
private OrangeHeapService orangeHeapService;
/**
*
* @param atmsApiToken
......@@ -202,4 +206,17 @@ public class IndexController {
return JSON.toJSONString(ddUserInfoRes);
}
@RequestMapping(value = {"/getCookie"}, method = RequestMethod.GET)
@ResponseBody
public String getCookie( HttpServletRequest request,
HttpServletResponse response) {
orangeHeapService.getDDTicketByCookie();
return null;
}
}
......@@ -2,6 +2,8 @@ package pwc.taxtech.atms.web.controller;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -12,6 +14,7 @@ import pwc.taxtech.atms.dto.ApiResultDto;
import pwc.taxtech.atms.web.service.OrangeHeapService;
import javax.annotation.Resource;
import java.util.Optional;
@RestController
@RequestMapping("/OrangeHeap")
......@@ -20,6 +23,7 @@ public class OrangeHeapController {
@Resource
private OrangeHeapService tableauService;
private static Logger logger = LoggerFactory.getLogger(OrangeHeapController.class);
//以上是示范代码
//TODO 加入其他图表
......@@ -33,12 +37,14 @@ public class OrangeHeapController {
@ResponseBody
@GetMapping("getTableauTaxCategoryUnreturnedTax")
public ApiResultDto getTableauTaxCategoryUnreturnedTax() {
logger.info("进入税种未返还税金分析=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
return ApiResultDto.success(tableauService.getTableauTaxCategoryUnreturnedTax().orElse(StringUtils.EMPTY));
}
@ResponseBody
@GetMapping("getTableauDistrictUnreturnedTax")
public ApiResultDto getTableauDistrictUnreturnedTax() {
logger.info("地区未返还税金分析=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
return ApiResultDto.success(tableauService.getTableauDistrictUnreturnedTax().orElse(StringUtils.EMPTY));
}
......
......@@ -34,10 +34,10 @@ public class OrangeHeapService {
private static Logger logger = LoggerFactory.getLogger(OrangeHeapService.class);
@Autowired
HttpServletRequest request;
private HttpServletRequest request;
@Autowired
HttpServletResponse response;
private HttpServletResponse response;
@Value("${get_user_info_url}")
private String getUserInfoUrl;
......@@ -53,10 +53,12 @@ public class OrangeHeapService {
CloseableHttpClient httpClient = null;
try {
String ticketUrl = String.format(systemConfig.getTableauGetTicket(), username);
logger.info("进去获取tableau的url"+ticketUrl);
httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(ticketUrl);
HttpResponse httpResponse = httpClient.execute(httpPost);
String response = IOUtils.toString(httpResponse.getEntity().getContent(), "UTF-8");
logger.info("获取tableau的结果"+response);
return StringUtils.equals(response, "-1") ? Optional.empty() : Optional.of(response);
} catch (Exception e) {
logger.error("getTicket error.", e);
......@@ -156,7 +158,7 @@ public class OrangeHeapService {
return optional.map(s -> String.format(systemConfig.getTableauOtherTaxAnalysis(), getTicket(s).orElse(StringUtils.EMPTY)));
}
//sso通过cookie获取登录的DD用户
public String getDDUserName() {
logger.info("进入 获取DD user的方法~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
String ticket = getDDTicketByCookie();
......@@ -166,16 +168,18 @@ public class OrangeHeapService {
//通過cookie 取出ddTicket
public String getDDTicketByCookie() {
logger.info("进去获取cookie方法");
Map<String,Cookie> cookieMap = ReadCookieMap();
//TODO 修改token的名字到配置文件,判断ddTicket是否过期
if(cookieMap.containsKey("ddTicket")){
logger.info("ddTicket=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"+Optional.ofNullable(cookieMap.get("ddTicket")).map(s->s.getValue()).orElse(""));
return Optional.ofNullable(cookieMap.get("ddTicket")).map(s->s.getValue()).orElse("");
}else{
logger.info("code=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"+Optional.ofNullable(cookieMap.get("code")).map(z->z.getValue()).orElse(""));
return getDDTicket(Optional.ofNullable(cookieMap.get("code")).map(z->z.getValue()).orElse(""));
}
}
}
private String findUsernameByDDTicket(String ticket) {
Assert.hasText(ticket, "empty ticket");
......
......@@ -1821,6 +1821,7 @@
"CoverImportBalanceSheet": "Overwrite import BS",
"AddImportBalanceSheet": "Expand import BS",
"TMSPeriod": "TMS Period",
"ImportType": "Import Type",
"cashFlow": "Cash Flow",
"CashFlowDDTitle": "Cash Flow",
"invoiceData": "Invoice Data",
......@@ -1985,6 +1986,7 @@
"FileExportFailed": "File Export Failed",
"InputAllMandatoryInfo": "Please Input All The Mandatory Information",
"NameShouldUniqueWarn": "Name Should Be Unique",
"~MustBeEndOneApp": "I Must be the End One, please!"
}
\ No newline at end of file
......@@ -2076,8 +2076,7 @@
"CoverImportBalanceSheet": "覆盖导入资产负债表",
"AddImportBalanceSheet": "追加导入资产负债表",
"TMSPeriod": "税务系统期间",
"ImportType":"导入方式",
"invoiceData": "发票资料",
"InvoiceDataTitle": "发票资料",
"IDTotalAmount": "合计",
......@@ -2297,6 +2296,8 @@
"uploadProfileTable": "上传利润表",
"InputAllMandatoryInfo": "请输入所有必填信息",
"NameShouldUniqueWarn": "收入类型名称应当唯一",
"~MustBeEndOneApp": "我必须是最后一个!"
}
\ No newline at end of file
......@@ -28,9 +28,9 @@ controller('addExistDimensionModalController', ['$scope', '$log', '$translate',
$scope.$watch('operateType', function (newValue, oldValue) {
if (newValue) {
if (newValue == constant.Operation.Add) {
if (newValue === constant.Operation.Add) {
showModal();
} else if (newValue == constant.Operation.Edit) {
} else if (newValue === constant.Operation.Edit) {
}
}
......
......@@ -846,7 +846,7 @@
}, {
dataField: "periodMonth",
allowHeaderFiltering: false,
width: '10%',
width: '5%',
caption: $translate.instant('TMSPeriod')
}, {
dataField: "periodMonth",
......@@ -861,8 +861,23 @@
}, {
dataField: "errorMsg",
allowHeaderFiltering: false,
width: '15%',
width: '10%',
caption: $translate.instant('Status')
}, {
dataField: "importType",
allowHeaderFiltering: false,
width: '10%',
caption: $translate.instant('ImportType'),
calculateDisplayValue: function (data) {
var importType1 = _.find(constant.importTypeList, function (item) {
return item.value == data.importType;
});
if (importType1) {
return importType1.name;
} else {
return '未知';
}
}
}
],
onContentReady: function (e) {
......
......@@ -854,12 +854,12 @@
}, {
dataField: "periodYear",
allowHeaderFiltering: false,
width: '7%',
width: '5%',
caption: $translate.instant('YearPeriod')
}, {
dataField: "periodMonth",
allowHeaderFiltering: false,
width: '8%',
width: '5%',
caption: $translate.instant('TMSPeriod')
}, {
dataField: "periodMonth",
......@@ -874,8 +874,23 @@
}, {
dataField: "errorMsg",
allowHeaderFiltering: false,
width: '15%',
width: '10%',
caption: $translate.instant('Status')
}, {
dataField: "importType",
allowHeaderFiltering: false,
width: '10%',
caption: $translate.instant('ImportType'),
calculateDisplayValue: function (data) {
var importType1 = _.find(constant.importTypeList, function (item) {
return item.value == data.importType;
});
if (importType1) {
return importType1.name;
} else {
return '未知';
}
}
}
],
onContentReady: function (e) {
......
......@@ -823,7 +823,7 @@
}, {
dataField: "periodMonth",
allowHeaderFiltering: false,
width: '10%',
width: '5%',
caption: $translate.instant('TMSPeriod')
}, {
dataField: "periodMonth",
......@@ -838,8 +838,23 @@
}, {
dataField: "errorMsg",
allowHeaderFiltering: false,
width: '15%',
width: '10%',
caption: $translate.instant('Status')
}, {
dataField: "importType",
allowHeaderFiltering: false,
width: '10%',
caption: $translate.instant('ImportType'),
calculateDisplayValue: function (data) {
var importType1 = _.find(constant.importTypeList, function (item) {
return item.value == data.importType;
});
if (importType1) {
return importType1.name;
} else {
return '未知';
}
}
}
],
onContentReady: function (e) {
......
......@@ -263,7 +263,7 @@
}, {
dataField: "periodMonth",
allowHeaderFiltering: false,
width: '10%',
width: '5%',
caption: $translate.instant('TMSPeriod')
}, {
dataField: "periodMonth",
......@@ -278,8 +278,23 @@
}, {
dataField: "errorMsg",
allowHeaderFiltering: false,
width: '15%',
width: '10%',
caption: $translate.instant('Status')
}, {
dataField: "importType",
allowHeaderFiltering: false,
width: '10%',
caption: $translate.instant('ImportType'),
calculateDisplayValue: function (data) {
var importType1 = _.find(constant.importTypeList, function (item) {
return item.value == data.importType;
});
if (importType1) {
return importType1.name;
} else {
return '未知';
}
}
}
],
onContentReady: function (e) {
......
......@@ -259,8 +259,23 @@
}, {
dataField: "errorMsg",
allowHeaderFiltering: false,
width: '20%',
width: '10%',
caption: $translate.instant('Status')
}, {
dataField: "importType",
allowHeaderFiltering: false,
width: '10%',
caption: $translate.instant('ImportType'),
calculateDisplayValue: function (data) {
var importType1 = _.find(constant.importTypeList, function (item) {
return item.value == data.importType;
});
if (importType1) {
return importType1.name;
} else {
return '未知';
}
}
}
],
onContentReady: function (e) {
......
......@@ -252,8 +252,23 @@
}, {
dataField: "errorMsg",
allowHeaderFiltering: false,
width: '20%',
width: '10%',
caption: $translate.instant('Status')
}, {
dataField: "importType",
allowHeaderFiltering: false,
width: '10%',
caption: $translate.instant('ImportType'),
calculateDisplayValue: function (data) {
var importType1 = _.find(constant.importTypeList, function (item) {
return item.value == data.importType;
});
if (importType1) {
return importType1.name;
} else {
return '未知';
}
}
}
],
onContentReady: function (e) {
......
......@@ -251,8 +251,23 @@
}, {
dataField: "errorMsg",
allowHeaderFiltering: false,
width: '20%',
width: '10%',
caption: $translate.instant('Status')
}, {
dataField: "importType",
allowHeaderFiltering: false,
width: '10%',
caption: $translate.instant('ImportType'),
calculateDisplayValue: function (data) {
var importType1 = _.find(constant.importTypeList, function (item) {
return item.value == data.importType;
});
if (importType1) {
return importType1.name;
} else {
return '未知';
}
}
}
],
onContentReady: function (e) {
......
......@@ -267,8 +267,23 @@
}, {
dataField: "errorMsg",
allowHeaderFiltering: false,
width: '20%',
width: '10%',
caption: $translate.instant('Status')
}, {
dataField: "importType",
allowHeaderFiltering: false,
width: '10%',
caption: $translate.instant('ImportType'),
calculateDisplayValue: function (data) {
var importType1 = _.find(constant.importTypeList, function (item) {
return item.value == data.importType;
});
if (importType1) {
return importType1.name;
} else {
return '未知';
}
}
}
],
onContentReady: function (e) {
......
......@@ -260,8 +260,23 @@
}, {
dataField: "errorMsg",
allowHeaderFiltering: false,
width: '20%',
width: '10%',
caption: $translate.instant('Status')
}, {
dataField: "importType",
allowHeaderFiltering: false,
width: '10%',
caption: $translate.instant('ImportType'),
calculateDisplayValue: function (data) {
var importType1 = _.find(constant.importTypeList, function (item) {
return item.value == data.importType;
});
if (importType1) {
return importType1.name;
} else {
return '未知';
}
}
}
],
onContentReady: function (e) {
......
......@@ -285,8 +285,23 @@
}, {
dataField: "errorMsg",
allowHeaderFiltering: false,
width: '20%',
width: '10%',
caption: $translate.instant('Status')
}, {
dataField: "importType",
allowHeaderFiltering: false,
width: '10%',
caption: $translate.instant('ImportType'),
calculateDisplayValue: function (data) {
var importType1 = _.find(constant.importTypeList, function (item) {
return item.value == data.importType;
});
if (importType1) {
return importType1.name;
} else {
return '未知';
}
}
}
],
onContentReady: function (e) {
......
......@@ -262,8 +262,23 @@
}, {
dataField: "errorMsg",
allowHeaderFiltering: false,
width: '20%',
width: '10%',
caption: $translate.instant('Status')
}, {
dataField: "importType",
allowHeaderFiltering: false,
width: '10%',
caption: $translate.instant('ImportType'),
calculateDisplayValue: function (data) {
var importType1 = _.find(constant.importTypeList, function (item) {
return item.value == data.importType;
});
if (importType1) {
return importType1.name;
} else {
return '未知';
}
}
}
],
onContentReady: function (e) {
......
......@@ -288,7 +288,7 @@
}, {
dataField: "periodMonth",
allowHeaderFiltering: false,
width: '10%',
width: '5%',
caption: $translate.instant('TMSPeriod')
}, {
dataField: "periodMonth",
......@@ -303,8 +303,23 @@
}, {
dataField: "errorMsg",
allowHeaderFiltering: false,
width: '15%',
width: '10%',
caption: $translate.instant('Status')
}, {
dataField: "importType",
allowHeaderFiltering: false,
width: '10%',
caption: $translate.instant('ImportType'),
calculateDisplayValue: function (data) {
var importType1 = _.find(constant.importTypeList, function (item) {
return item.value == data.importType;
});
if (importType1) {
return importType1.name;
} else {
return '未知';
}
}
}
],
onContentReady: function (e) {
......
......@@ -274,7 +274,7 @@
}, {
dataField: "periodMonth",
allowHeaderFiltering: false,
width: '10%',
width: '5%',
caption: $translate.instant('TMSPeriod')
}, {
dataField: "periodMonth",
......@@ -289,8 +289,23 @@
}, {
dataField: "errorMsg",
allowHeaderFiltering: false,
width: '15%',
width: '10%',
caption: $translate.instant('Status')
}, {
dataField: "importType",
allowHeaderFiltering: false,
width: '10%',
caption: $translate.instant('ImportType'),
calculateDisplayValue: function (data) {
var importType1 = _.find(constant.importTypeList, function (item) {
return item.value == data.importType;
});
if (importType1) {
return importType1.name;
} else {
return '未知';
}
}
}
],
onContentReady: function (e) {
......
......@@ -272,7 +272,7 @@
}, {
dataField: "periodMonth",
allowHeaderFiltering: false,
width: '10%',
width: '5%',
caption: $translate.instant('TMSPeriod')
}, {
dataField: "periodMonth",
......@@ -287,8 +287,23 @@
}, {
dataField: "errorMsg",
allowHeaderFiltering: false,
width: '15%',
width: '10%',
caption: $translate.instant('Status')
}, {
dataField: "importType",
allowHeaderFiltering: false,
width: '10%',
caption: $translate.instant('ImportType'),
calculateDisplayValue: function (data) {
var importType1 = _.find(constant.importTypeList, function (item) {
return item.value == data.importType;
});
if (importType1) {
return importType1.name;
} else {
return '未知';
}
}
}
],
onContentReady: function (e) {
......
......@@ -274,7 +274,7 @@
}, {
dataField: "periodMonth",
allowHeaderFiltering: false,
width: '10%',
width: '5%',
caption: $translate.instant('TMSPeriod')
}, {
dataField: "periodMonth",
......@@ -289,8 +289,23 @@
}, {
dataField: "errorMsg",
allowHeaderFiltering: false,
width: '15%',
width: '10%',
caption: $translate.instant('Status')
}, {
dataField: "importType",
allowHeaderFiltering: false,
width: '10%',
caption: $translate.instant('ImportType'),
calculateDisplayValue: function (data) {
var importType1 = _.find(constant.importTypeList, function (item) {
return item.value == data.importType;
});
if (importType1) {
return importType1.name;
} else {
return '未知';
}
}
}
],
onContentReady: function (e) {
......
......@@ -302,7 +302,7 @@
}, {
dataField: "periodMonth",
allowHeaderFiltering: false,
width: '10%',
width: '5%',
caption: $translate.instant('TMSPeriod')
}, {
dataField: "periodMonth",
......@@ -317,8 +317,23 @@
}, {
dataField: "errorMsg",
allowHeaderFiltering: false,
width: '15%',
width: '10%',
caption: $translate.instant('Status')
}, {
dataField: "importType",
allowHeaderFiltering: false,
width: '10%',
caption: $translate.instant('ImportType'),
calculateDisplayValue: function (data) {
var importType1 = _.find(constant.importTypeList, function (item) {
return item.value == data.importType;
});
if (importType1) {
return importType1.name;
} else {
return '未知';
}
}
}
],
onContentReady: function (e) {
......
......@@ -839,7 +839,7 @@
}, {
dataField: "periodMonth",
allowHeaderFiltering: false,
width: '10%',
width: '5%',
caption: $translate.instant('TMSPeriod')
}, {
dataField: "periodMonth",
......@@ -854,8 +854,23 @@
}, {
dataField: "errorMsg",
allowHeaderFiltering: false,
width: '15%',
width: '10%',
caption: $translate.instant('Status')
}, {
dataField: "importType",
allowHeaderFiltering: false,
width: '10%',
caption: $translate.instant('ImportType'),
calculateDisplayValue: function (data) {
var importType1 = _.find(constant.importTypeList, function (item) {
return item.value == data.importType;
});
if (importType1) {
return importType1.name;
} else {
return '未知';
}
}
}
],
onContentReady: function (e) {
......
......@@ -45,6 +45,12 @@ constant.priority = {
high: 3
}
constant.importTypeList = [
{value:0,name:"默认导入"},
{value:1,name:"覆盖导入"},
{value:2,name:"追加导入"}
]
constant.customer = {
codeMaxLength: 50,
nameMaxLength: 100,
......
......@@ -178,7 +178,7 @@
$scope.formParam.status === undefined ||
$scope.formParam.startDate === undefined ||
$scope.formParam.endDate === undefined) {
SweetAlert.warning("InputAllMandatoryInfo");
SweetAlert.warning($translate.instant("InputAllMandatoryInfo"));
return;
}
......@@ -186,6 +186,10 @@
$http.post('/revenueConf/update', $scope.formParam, apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
if(res.message === "DuplicateName"){
SweetAlert.success($translate.instant('NameShouldUniqueWarn'));
return;
}
SweetAlert.success($translate.instant('RevenueAddSuccess'));
$scope.refreshConfigGrid();
$($scope.revenueConfAddDiv).modal('hide');
......@@ -198,6 +202,10 @@
$http.post('/revenueConf/add', $scope.formParam, apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
if(res.message === "DuplicateName"){
SweetAlert.success($translate.instant('NameShouldUniqueWarn'));
return;
}
SweetAlert.success($translate.instant('RevenueAddSuccess'));
$scope.refreshConfigGrid();
$($scope.revenueConfAddDiv).modal('hide');
......
/* fallback */
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(https://fonts.gstatic.com/s/materialicons/v47/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format('woff2');
}
.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
-webkit-font-feature-settings: 'liga';
-webkit-font-smoothing: antialiased;
}
This diff is collapsed.
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