|
|
package com.yoho.ufo.order.service.impl;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
import org.elasticsearch.common.collect.Lists;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.yoho.core.common.utils.DateUtil;
|
|
|
import com.yoho.order.dal.ExpressScreenshotsMapper;
|
|
|
import com.yoho.order.model.ExpressScreenshots;
|
|
|
import com.yoho.ufo.order.response.ExpressScreenshotsRsp;
|
|
|
import com.yoho.ufo.order.service.IExpressScreenshotsService;
|
|
|
import com.yoho.ufo.service.impl.UserHelper;
|
|
|
|
|
|
/**
|
|
|
* @author craig.qin
|
|
|
*/
|
|
|
@Service
|
|
|
public class ExpressScreenshotsServiceImpl implements IExpressScreenshotsService {
|
|
|
|
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(ExpressScreenshotsServiceImpl.class);
|
|
|
|
|
|
@Autowired
|
|
|
private ExpressScreenshotsMapper expressScreenshotsMapper;
|
|
|
|
|
|
@Override
|
|
|
public int save(String waybillCode, String url){
|
|
|
ExpressScreenshots record = new ExpressScreenshots();
|
|
|
record.setWaybillCode(waybillCode);
|
|
|
record.setUrl(url);
|
|
|
record.setCreateTime(DateUtil.getCurrentTimeSecond());
|
|
|
// UserHelper userInfo = new UserHelper();
|
|
|
// record.setCreateUid(userInfo.getUserId());
|
|
|
// record.setCreateUserName(userInfo.getUserName());
|
|
|
record.setCreateUid(10961101);
|
|
|
record.setCreateUserName("测试名字");
|
|
|
|
|
|
return expressScreenshotsMapper.insert(record);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<ExpressScreenshotsRsp> queryListByWaybillCode(String waybillCode) {
|
|
|
List<ExpressScreenshots> list = expressScreenshotsMapper.selectByWaybillCode(waybillCode);
|
|
|
List<ExpressScreenshotsRsp> rspList = Lists.newArrayList();
|
|
|
for(ExpressScreenshots item : list) {
|
|
|
ExpressScreenshotsRsp rsp = new ExpressScreenshotsRsp();
|
|
|
rsp.setWaybillCode(item.getWaybillCode());
|
|
|
rsp.setUrl(item.getUrl());
|
|
|
rsp.setCreateTimeStr(DateUtil.getDateStrBySecond(item.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
rsp.setCreateUserName(item.getCreateUserName());
|
|
|
rspList.add(rsp);
|
|
|
}
|
|
|
|
|
|
return rspList;
|
|
|
}
|
|
|
|
|
|
|
|
|
} |
...
|
...
|
|