Commit 4c02c4a2 authored by kevin's avatar kevin

$

parents fbeb6d31 7b8df0b0
......@@ -142,13 +142,13 @@ public class EbsApiController {
return ApiResultDto.fail();
}
@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)) {
logger.debug("the updateOrg return items is empty");
return ApiResultDto.success(Collections.emptyList());
}
try {
ebsApiService.queryRemoteServerThenUpdateOrg(items);
ebsApiService.queryRemoteServerThenUpdateOrg(id,items);
return ApiResultDto.success();
} catch (Exception e) {
logger.error("updateOrg error.", e);
......
......@@ -125,6 +125,17 @@ public class OrganizationAccountingRateDto implements Serializable {
*/
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:
* 创建时间
......@@ -443,6 +454,14 @@ public class OrganizationAccountingRateDto implements Serializable {
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 corresponds to the database table organization_accounting_rate
......
......@@ -67,5 +67,5 @@ public interface EbsApiService {
*
* @param items
*/
void queryRemoteServerThenUpdateOrg(List<OrganizationQueryDto> items);
void queryRemoteServerThenUpdateOrg(Long id, List<OrganizationQueryDto> items);
}
......@@ -48,6 +48,8 @@ public class EbsApiServiceImpl implements EbsApiService {
private OrganizationEmployeeMapper organizationEmployeeMapper;
@Resource
private OrganizationExtraMapper organizationExtraMapper;
@Resource
private DataImportLogMapper dataImportLogMapper;
@Resource
private DistributedIdService distributedIdService;
......@@ -698,7 +700,7 @@ public class EbsApiServiceImpl implements EbsApiService {
result.setUpdateTime(new Date());
}
@Override
public void queryRemoteServerThenUpdateOrg(List<OrganizationQueryDto> items) {
public void queryRemoteServerThenUpdateOrg(Long id , List<OrganizationQueryDto> items) {
long start = System.currentTimeMillis();
logger.debug("start queryRemoteServerThenUpdateOrg 机构表");
//判断数据是否存在
......@@ -714,6 +716,7 @@ public class EbsApiServiceImpl implements EbsApiService {
logger.error("break loop as catch:" + e, e);
}
}
updateDataImportLog(id,items.size());
logger.debug("end queryRemoteServerThenUpdateOrg 机构表,took [{}] ms", System.currentTimeMillis() - start);
}
......@@ -766,6 +769,21 @@ public class EbsApiServiceImpl implements EbsApiService {
oe.setEmployeesNumEnd(a.getStaffSize());
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
......
package pwc.taxtech.atms.service.impl;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists;
import org.junit.Test;
import pwc.taxtech.atms.CommonIT;
import pwc.taxtech.atms.dto.ebsdto.*;
......@@ -9,7 +10,6 @@ import pwc.taxtech.atms.service.EbsApiService;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class EbsApiServiceImplTest extends CommonIT {
......
......@@ -44,6 +44,17 @@ public class OrganizationAccountingRate extends BaseEntity implements Serializab
*/
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:
* 来源
......@@ -223,6 +234,30 @@ public class OrganizationAccountingRate extends BaseEntity implements Serializab
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 returns the value of the database column organization_accounting_rate.source
......@@ -454,6 +489,7 @@ public class OrganizationAccountingRate extends BaseEntity implements Serializab
sb.append(", id=").append(id);
sb.append(", organizationId=").append(organizationId);
sb.append(", period=").append(period);
sb.append(", date=").append(date);
sb.append(", source=").append(source);
sb.append(", convertionType=").append(convertionType);
sb.append(", currencyFrom=").append(currencyFrom);
......
......@@ -385,6 +385,66 @@ public class OrganizationAccountingRateExample {
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() {
addCriterion("source is null");
return (Criteria) this;
......
......@@ -9,6 +9,7 @@
<id column="id" jdbcType="BIGINT" property="id" />
<result column="organization_id" jdbcType="VARCHAR" property="organizationId" />
<result column="period" jdbcType="INTEGER" property="period" />
<result column="date" jdbcType="TIMESTAMP" property="date" />
<result column="source" jdbcType="VARCHAR" property="source" />
<result column="convertion_type" jdbcType="VARCHAR" property="convertionType" />
<result column="currency_from" jdbcType="VARCHAR" property="currencyFrom" />
......@@ -90,7 +91,7 @@
WARNING - @mbg.generated
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
</sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.entity.OrganizationAccountingRateExample" resultMap="BaseResultMap">
......@@ -145,15 +146,15 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into organization_accounting_rate (id, organization_id, period,
source, convertion_type, currency_from,
currency_to, start_date, end_date,
rate, create_time, update_time
)
date, source, convertion_type,
currency_from, currency_to, start_date,
end_date, rate, create_time,
update_time)
values (#{id,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR}, #{period,jdbcType=INTEGER},
#{source,jdbcType=VARCHAR}, #{convertionType,jdbcType=VARCHAR}, #{currencyFrom,jdbcType=VARCHAR},
#{currencyTo,jdbcType=VARCHAR}, #{startDate,jdbcType=TIMESTAMP}, #{endDate,jdbcType=TIMESTAMP},
#{rate,jdbcType=REAL}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
#{date,jdbcType=TIMESTAMP}, #{source,jdbcType=VARCHAR}, #{convertionType,jdbcType=VARCHAR},
#{currencyFrom,jdbcType=VARCHAR}, #{currencyTo,jdbcType=VARCHAR}, #{startDate,jdbcType=TIMESTAMP},
#{endDate,jdbcType=TIMESTAMP}, #{rate,jdbcType=REAL}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.OrganizationAccountingRate">
<!--
......@@ -171,6 +172,9 @@
<if test="period != null">
period,
</if>
<if test="date != null">
date,
</if>
<if test="source != null">
source,
</if>
......@@ -209,6 +213,9 @@
<if test="period != null">
#{period,jdbcType=INTEGER},
</if>
<if test="date != null">
#{date,jdbcType=TIMESTAMP},
</if>
<if test="source != null">
#{source,jdbcType=VARCHAR},
</if>
......@@ -264,6 +271,9 @@
<if test="record.period != null">
period = #{record.period,jdbcType=INTEGER},
</if>
<if test="record.date != null">
date = #{record.date,jdbcType=TIMESTAMP},
</if>
<if test="record.source != null">
source = #{record.source,jdbcType=VARCHAR},
</if>
......@@ -305,6 +315,7 @@
set id = #{record.id,jdbcType=BIGINT},
organization_id = #{record.organizationId,jdbcType=VARCHAR},
period = #{record.period,jdbcType=INTEGER},
date = #{record.date,jdbcType=TIMESTAMP},
source = #{record.source,jdbcType=VARCHAR},
convertion_type = #{record.convertionType,jdbcType=VARCHAR},
currency_from = #{record.currencyFrom,jdbcType=VARCHAR},
......@@ -331,6 +342,9 @@
<if test="period != null">
period = #{period,jdbcType=INTEGER},
</if>
<if test="date != null">
date = #{date,jdbcType=TIMESTAMP},
</if>
<if test="source != null">
source = #{source,jdbcType=VARCHAR},
</if>
......@@ -369,6 +383,7 @@
update organization_accounting_rate
set organization_id = #{organizationId,jdbcType=VARCHAR},
period = #{period,jdbcType=INTEGER},
date = #{date,jdbcType=TIMESTAMP},
source = #{source,jdbcType=VARCHAR},
convertion_type = #{convertionType,jdbcType=VARCHAR},
currency_from = #{currencyFrom,jdbcType=VARCHAR},
......
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