Commit 4c02c4a2 authored by kevin's avatar kevin

$

parents fbeb6d31 7b8df0b0
...@@ -142,13 +142,13 @@ public class EbsApiController { ...@@ -142,13 +142,13 @@ public class EbsApiController {
return ApiResultDto.fail(); return ApiResultDto.fail();
} }
@RequestMapping(value = "/updateOrg", method = RequestMethod.POST) @RequestMapping(value = "/updateOrg", method = RequestMethod.POST)
public ApiResultDto updateOrg(@RequestBody @Valid List<OrganizationQueryDto> items) { public ApiResultDto updateOrg(@RequestParam("id") Long id,@RequestBody @Valid List<OrganizationQueryDto> items) {
if (CollectionUtils.isEmpty(items)) { if (CollectionUtils.isEmpty(items)) {
logger.debug("the updateOrg return items is empty"); logger.debug("the updateOrg return items is empty");
return ApiResultDto.success(Collections.emptyList()); return ApiResultDto.success(Collections.emptyList());
} }
try { try {
ebsApiService.queryRemoteServerThenUpdateOrg(items); ebsApiService.queryRemoteServerThenUpdateOrg(id,items);
return ApiResultDto.success(); return ApiResultDto.success();
} catch (Exception e) { } catch (Exception e) {
logger.error("updateOrg error.", e); logger.error("updateOrg error.", e);
......
...@@ -125,6 +125,17 @@ public class OrganizationAccountingRateDto implements Serializable { ...@@ -125,6 +125,17 @@ public class OrganizationAccountingRateDto implements Serializable {
*/ */
private Float rate; private Float rate;
/**
* Database Column Remarks:
* 数据日期
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.date
*
* @mbg.generated
*/
private Date date;
/** /**
* Database Column Remarks: * Database Column Remarks:
* 创建时间 * 创建时间
...@@ -443,6 +454,14 @@ public class OrganizationAccountingRateDto implements Serializable { ...@@ -443,6 +454,14 @@ public class OrganizationAccountingRateDto implements Serializable {
this.updateTime = updateTime; this.updateTime = updateTime;
} }
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate * This method corresponds to the database table organization_accounting_rate
......
...@@ -67,5 +67,5 @@ public interface EbsApiService { ...@@ -67,5 +67,5 @@ public interface EbsApiService {
* *
* @param items * @param items
*/ */
void queryRemoteServerThenUpdateOrg(List<OrganizationQueryDto> items); void queryRemoteServerThenUpdateOrg(Long id, List<OrganizationQueryDto> items);
} }
...@@ -48,6 +48,8 @@ public class EbsApiServiceImpl implements EbsApiService { ...@@ -48,6 +48,8 @@ public class EbsApiServiceImpl implements EbsApiService {
private OrganizationEmployeeMapper organizationEmployeeMapper; private OrganizationEmployeeMapper organizationEmployeeMapper;
@Resource @Resource
private OrganizationExtraMapper organizationExtraMapper; private OrganizationExtraMapper organizationExtraMapper;
@Resource
private DataImportLogMapper dataImportLogMapper;
@Resource @Resource
private DistributedIdService distributedIdService; private DistributedIdService distributedIdService;
...@@ -698,7 +700,7 @@ public class EbsApiServiceImpl implements EbsApiService { ...@@ -698,7 +700,7 @@ public class EbsApiServiceImpl implements EbsApiService {
result.setUpdateTime(new Date()); result.setUpdateTime(new Date());
} }
@Override @Override
public void queryRemoteServerThenUpdateOrg(List<OrganizationQueryDto> items) { public void queryRemoteServerThenUpdateOrg(Long id , List<OrganizationQueryDto> items) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
logger.debug("start queryRemoteServerThenUpdateOrg 机构表"); logger.debug("start queryRemoteServerThenUpdateOrg 机构表");
//判断数据是否存在 //判断数据是否存在
...@@ -714,6 +716,7 @@ public class EbsApiServiceImpl implements EbsApiService { ...@@ -714,6 +716,7 @@ public class EbsApiServiceImpl implements EbsApiService {
logger.error("break loop as catch:" + e, e); logger.error("break loop as catch:" + e, e);
} }
} }
updateDataImportLog(id,items.size());
logger.debug("end queryRemoteServerThenUpdateOrg 机构表,took [{}] ms", System.currentTimeMillis() - start); logger.debug("end queryRemoteServerThenUpdateOrg 机构表,took [{}] ms", System.currentTimeMillis() - start);
} }
...@@ -766,6 +769,21 @@ public class EbsApiServiceImpl implements EbsApiService { ...@@ -766,6 +769,21 @@ public class EbsApiServiceImpl implements EbsApiService {
oe.setEmployeesNumEnd(a.getStaffSize()); oe.setEmployeesNumEnd(a.getStaffSize());
organizationEmployeeMapper.insertSelective(oe); organizationEmployeeMapper.insertSelective(oe);
} }
private void updateDataImportLog(Long id, int size) {
DataImportLog dataImportLog = new DataImportLog();
dataImportLog.setId(id);
dataImportLog.setRecordSize(size);
dataImportLog.setImportResult(true);
int res = dataImportLogMapper.updateByPrimaryKeySelective(dataImportLog);
if (res < 0) {
logger.warn(String.format("无调用记录[%s]", id));
}
}
/** /**
* 获取格式化时间 * 获取格式化时间
* 返回时间类型 yyyy-MM-dd HH:mm:ss * 返回时间类型 yyyy-MM-dd HH:mm:ss
......
package pwc.taxtech.atms.service.impl; package pwc.taxtech.atms.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists;
import org.junit.Test; import org.junit.Test;
import pwc.taxtech.atms.CommonIT; import pwc.taxtech.atms.CommonIT;
import pwc.taxtech.atms.dto.ebsdto.*; import pwc.taxtech.atms.dto.ebsdto.*;
...@@ -9,7 +10,6 @@ import pwc.taxtech.atms.service.EbsApiService; ...@@ -9,7 +10,6 @@ import pwc.taxtech.atms.service.EbsApiService;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
public class EbsApiServiceImplTest extends CommonIT { public class EbsApiServiceImplTest extends CommonIT {
......
...@@ -44,6 +44,17 @@ public class OrganizationAccountingRate extends BaseEntity implements Serializab ...@@ -44,6 +44,17 @@ public class OrganizationAccountingRate extends BaseEntity implements Serializab
*/ */
private Integer period; private Integer period;
/**
* Database Column Remarks:
* 数据日期
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.date
*
* @mbg.generated
*/
private Date date;
/** /**
* Database Column Remarks: * Database Column Remarks:
* 来源 * 来源
...@@ -223,6 +234,30 @@ public class OrganizationAccountingRate extends BaseEntity implements Serializab ...@@ -223,6 +234,30 @@ public class OrganizationAccountingRate extends BaseEntity implements Serializab
this.period = period; this.period = period;
} }
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization_accounting_rate.date
*
* @return the value of organization_accounting_rate.date
*
* @mbg.generated
*/
public Date getDate() {
return date;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column organization_accounting_rate.date
*
* @param date the value for organization_accounting_rate.date
*
* @mbg.generated
*/
public void setDate(Date date) {
this.date = date;
}
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method returns the value of the database column organization_accounting_rate.source * This method returns the value of the database column organization_accounting_rate.source
...@@ -454,6 +489,7 @@ public class OrganizationAccountingRate extends BaseEntity implements Serializab ...@@ -454,6 +489,7 @@ public class OrganizationAccountingRate extends BaseEntity implements Serializab
sb.append(", id=").append(id); sb.append(", id=").append(id);
sb.append(", organizationId=").append(organizationId); sb.append(", organizationId=").append(organizationId);
sb.append(", period=").append(period); sb.append(", period=").append(period);
sb.append(", date=").append(date);
sb.append(", source=").append(source); sb.append(", source=").append(source);
sb.append(", convertionType=").append(convertionType); sb.append(", convertionType=").append(convertionType);
sb.append(", currencyFrom=").append(currencyFrom); sb.append(", currencyFrom=").append(currencyFrom);
......
...@@ -385,6 +385,66 @@ public class OrganizationAccountingRateExample { ...@@ -385,6 +385,66 @@ public class OrganizationAccountingRateExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andDateIsNull() {
addCriterion("date is null");
return (Criteria) this;
}
public Criteria andDateIsNotNull() {
addCriterion("date is not null");
return (Criteria) this;
}
public Criteria andDateEqualTo(Date value) {
addCriterion("date =", value, "date");
return (Criteria) this;
}
public Criteria andDateNotEqualTo(Date value) {
addCriterion("date <>", value, "date");
return (Criteria) this;
}
public Criteria andDateGreaterThan(Date value) {
addCriterion("date >", value, "date");
return (Criteria) this;
}
public Criteria andDateGreaterThanOrEqualTo(Date value) {
addCriterion("date >=", value, "date");
return (Criteria) this;
}
public Criteria andDateLessThan(Date value) {
addCriterion("date <", value, "date");
return (Criteria) this;
}
public Criteria andDateLessThanOrEqualTo(Date value) {
addCriterion("date <=", value, "date");
return (Criteria) this;
}
public Criteria andDateIn(List<Date> values) {
addCriterion("date in", values, "date");
return (Criteria) this;
}
public Criteria andDateNotIn(List<Date> values) {
addCriterion("date not in", values, "date");
return (Criteria) this;
}
public Criteria andDateBetween(Date value1, Date value2) {
addCriterion("date between", value1, value2, "date");
return (Criteria) this;
}
public Criteria andDateNotBetween(Date value1, Date value2) {
addCriterion("date not between", value1, value2, "date");
return (Criteria) this;
}
public Criteria andSourceIsNull() { public Criteria andSourceIsNull() {
addCriterion("source is null"); addCriterion("source is null");
return (Criteria) this; return (Criteria) this;
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id" />
<result column="organization_id" jdbcType="VARCHAR" property="organizationId" /> <result column="organization_id" jdbcType="VARCHAR" property="organizationId" />
<result column="period" jdbcType="INTEGER" property="period" /> <result column="period" jdbcType="INTEGER" property="period" />
<result column="date" jdbcType="TIMESTAMP" property="date" />
<result column="source" jdbcType="VARCHAR" property="source" /> <result column="source" jdbcType="VARCHAR" property="source" />
<result column="convertion_type" jdbcType="VARCHAR" property="convertionType" /> <result column="convertion_type" jdbcType="VARCHAR" property="convertionType" />
<result column="currency_from" jdbcType="VARCHAR" property="currencyFrom" /> <result column="currency_from" jdbcType="VARCHAR" property="currencyFrom" />
...@@ -90,7 +91,7 @@ ...@@ -90,7 +91,7 @@
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
id, organization_id, period, source, convertion_type, currency_from, currency_to, id, organization_id, period, date, source, convertion_type, currency_from, currency_to,
start_date, end_date, rate, create_time, update_time start_date, end_date, rate, create_time, update_time
</sql> </sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.entity.OrganizationAccountingRateExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="pwc.taxtech.atms.entity.OrganizationAccountingRateExample" resultMap="BaseResultMap">
...@@ -145,15 +146,15 @@ ...@@ -145,15 +146,15 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
insert into organization_accounting_rate (id, organization_id, period, insert into organization_accounting_rate (id, organization_id, period,
source, convertion_type, currency_from, date, source, convertion_type,
currency_to, start_date, end_date, currency_from, currency_to, start_date,
rate, create_time, update_time end_date, rate, create_time,
) update_time)
values (#{id,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR}, #{period,jdbcType=INTEGER}, values (#{id,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR}, #{period,jdbcType=INTEGER},
#{source,jdbcType=VARCHAR}, #{convertionType,jdbcType=VARCHAR}, #{currencyFrom,jdbcType=VARCHAR}, #{date,jdbcType=TIMESTAMP}, #{source,jdbcType=VARCHAR}, #{convertionType,jdbcType=VARCHAR},
#{currencyTo,jdbcType=VARCHAR}, #{startDate,jdbcType=TIMESTAMP}, #{endDate,jdbcType=TIMESTAMP}, #{currencyFrom,jdbcType=VARCHAR}, #{currencyTo,jdbcType=VARCHAR}, #{startDate,jdbcType=TIMESTAMP},
#{rate,jdbcType=REAL}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP} #{endDate,jdbcType=TIMESTAMP}, #{rate,jdbcType=REAL}, #{createTime,jdbcType=TIMESTAMP},
) #{updateTime,jdbcType=TIMESTAMP})
</insert> </insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.OrganizationAccountingRate"> <insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.OrganizationAccountingRate">
<!-- <!--
...@@ -171,6 +172,9 @@ ...@@ -171,6 +172,9 @@
<if test="period != null"> <if test="period != null">
period, period,
</if> </if>
<if test="date != null">
date,
</if>
<if test="source != null"> <if test="source != null">
source, source,
</if> </if>
...@@ -209,6 +213,9 @@ ...@@ -209,6 +213,9 @@
<if test="period != null"> <if test="period != null">
#{period,jdbcType=INTEGER}, #{period,jdbcType=INTEGER},
</if> </if>
<if test="date != null">
#{date,jdbcType=TIMESTAMP},
</if>
<if test="source != null"> <if test="source != null">
#{source,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR},
</if> </if>
...@@ -264,6 +271,9 @@ ...@@ -264,6 +271,9 @@
<if test="record.period != null"> <if test="record.period != null">
period = #{record.period,jdbcType=INTEGER}, period = #{record.period,jdbcType=INTEGER},
</if> </if>
<if test="record.date != null">
date = #{record.date,jdbcType=TIMESTAMP},
</if>
<if test="record.source != null"> <if test="record.source != null">
source = #{record.source,jdbcType=VARCHAR}, source = #{record.source,jdbcType=VARCHAR},
</if> </if>
...@@ -305,6 +315,7 @@ ...@@ -305,6 +315,7 @@
set id = #{record.id,jdbcType=BIGINT}, set id = #{record.id,jdbcType=BIGINT},
organization_id = #{record.organizationId,jdbcType=VARCHAR}, organization_id = #{record.organizationId,jdbcType=VARCHAR},
period = #{record.period,jdbcType=INTEGER}, period = #{record.period,jdbcType=INTEGER},
date = #{record.date,jdbcType=TIMESTAMP},
source = #{record.source,jdbcType=VARCHAR}, source = #{record.source,jdbcType=VARCHAR},
convertion_type = #{record.convertionType,jdbcType=VARCHAR}, convertion_type = #{record.convertionType,jdbcType=VARCHAR},
currency_from = #{record.currencyFrom,jdbcType=VARCHAR}, currency_from = #{record.currencyFrom,jdbcType=VARCHAR},
...@@ -331,6 +342,9 @@ ...@@ -331,6 +342,9 @@
<if test="period != null"> <if test="period != null">
period = #{period,jdbcType=INTEGER}, period = #{period,jdbcType=INTEGER},
</if> </if>
<if test="date != null">
date = #{date,jdbcType=TIMESTAMP},
</if>
<if test="source != null"> <if test="source != null">
source = #{source,jdbcType=VARCHAR}, source = #{source,jdbcType=VARCHAR},
</if> </if>
...@@ -369,6 +383,7 @@ ...@@ -369,6 +383,7 @@
update organization_accounting_rate update organization_accounting_rate
set organization_id = #{organizationId,jdbcType=VARCHAR}, set organization_id = #{organizationId,jdbcType=VARCHAR},
period = #{period,jdbcType=INTEGER}, period = #{period,jdbcType=INTEGER},
date = #{date,jdbcType=TIMESTAMP},
source = #{source,jdbcType=VARCHAR}, source = #{source,jdbcType=VARCHAR},
convertion_type = #{convertionType,jdbcType=VARCHAR}, convertion_type = #{convertionType,jdbcType=VARCHAR},
currency_from = #{currencyFrom,jdbcType=VARCHAR}, currency_from = #{currencyFrom,jdbcType=VARCHAR},
......
...@@ -358,7 +358,7 @@ webservices.factory('commonWebService', ['$http', 'apiConfig', 'loginContext', ' ...@@ -358,7 +358,7 @@ webservices.factory('commonWebService', ['$http', 'apiConfig', 'loginContext', '
}, },
_index :function (data) { _index :function (data) {
var index = 1; var index = 1;
for(var i in data){ for(var i in data){
i.index = index; i.index = index;
index++; index++;
} }
......
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