2019 数据集测试成功OK
This commit is contained in:
parent
5dd9b37668
commit
d776d99a58
|
@ -0,0 +1,95 @@
|
|||
package com.alihealth.d2d.provtest.service.handle.business;
|
||||
|
||||
import com.alihealth.d2d.provtest.domain.WarehouseStockApplyInfo;
|
||||
import com.alihealth.d2d.provtest.entity.EventBasic;
|
||||
import com.alihealth.d2d.provtest.entity.EventBody;
|
||||
import com.alihealth.d2d.provtest.entity.InstanceDetail;
|
||||
import com.alihealth.d2d.provtest.entity.ItemDetail;
|
||||
import com.alihealth.d2d.provtest.service.IWarehouseStockApplyInfoService;
|
||||
import com.alihealth.d2d.provtest.service.handle.AbstractEventDataHandler;
|
||||
import com.alihealth.d2d.provtest.service.handle.EventSubType;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
@Service
|
||||
@EventSubType("2019")
|
||||
public class SubType2019Handler extends AbstractEventDataHandler<WarehouseStockApplyInfo> {
|
||||
|
||||
@Autowired
|
||||
private IWarehouseStockApplyInfoService service;
|
||||
|
||||
@Override
|
||||
protected Class<WarehouseStockApplyInfo> getEntityClass() {
|
||||
return WarehouseStockApplyInfo.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IService<WarehouseStockApplyInfo> getService() {
|
||||
return service;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected WarehouseStockApplyInfo convertToEntity(EventBody eventBody, ItemDetail item, InstanceDetail instance) {
|
||||
EventBasic evtBasic = eventBody.getEvtBasic();
|
||||
//时间格式
|
||||
SimpleDateFormat formatterDatetime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
//日期格式
|
||||
SimpleDateFormat formatterDate = new SimpleDateFormat("yyyyMMdd");
|
||||
|
||||
try {
|
||||
return WarehouseStockApplyInfo.builder()
|
||||
.eventId(eventBody.getEventID())
|
||||
.recTime(formatterDatetime.parse(eventBody.getRecTime()))
|
||||
|
||||
.yptymc(item.getString("YPTYMC"))
|
||||
.gjypbsm(item.getString("GJYPBSM"))
|
||||
.ypscph(item.getString("YPSCPH"))
|
||||
.ypscrq(formatterDate.parse(item.getString("YPSCRQ")))
|
||||
.ypyxqjzrq(formatterDate.parse(item.getString("YPYXQJZRQ")))
|
||||
.kcsl(item.getInt("KCSL"))
|
||||
.sjkcsl(item.getInt("SJKCSL"))
|
||||
.yppzwh(item.getString("YPPZWH"))
|
||||
.ypssxkcyrdm(item.getString("YPSSXKCYRDMD"))
|
||||
.ypssxkcyrmc(item.getString("YPSSXKCYRMC"))
|
||||
.ypscqydm(item.getString("YPSCQYDM"))
|
||||
.ypscqymc(item.getString("YPSCQYMC"))
|
||||
.jx(item.getString("JX"))
|
||||
.bzgg(item.getString("BZGG"))
|
||||
.zjgg(item.getString("ZJGG"))
|
||||
.bzzhb(new BigDecimal(item.getString("BZZHB")))
|
||||
.bzzhbdw(item.getString("BZZHBDW"))
|
||||
.ypzcfl(item.getString("YPZCFL"))
|
||||
.tsypglfl(item.getString("TSYPGLFL"))
|
||||
|
||||
.tyshxydmkcdw(evtBasic.getString("TYSHXYDMDKCDW"))
|
||||
.kcdwjzdwbm(evtBasic.getString("KCDWJZDWBM"))
|
||||
.kctjsj(formatterDate.parse(evtBasic.getString("KCTJSJ")))
|
||||
.ckdz(evtBasic.getString("CKDZ"))
|
||||
.kcdwmc(evtBasic.getString("KCDWMC"))
|
||||
.kcdwlx(evtBasic.getString("KCDWLX"))
|
||||
.kcdwlxxl(evtBasic.getString("KCDWLXXL"))
|
||||
|
||||
|
||||
|
||||
|
||||
.build();
|
||||
} catch (ParseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSubType() {
|
||||
return "2019";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleBase(String xml, String eventId) {
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue