|
|
@@ -9,6 +9,8 @@ import com.uas.eis.utils.Constant;
|
|
|
import com.uas.eis.utils.HttpUtil;
|
|
|
import com.uas.eis.utils.JacksonUtil;
|
|
|
import com.uas.eis.utils.LogUtil;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -22,6 +24,8 @@ import java.util.Map;
|
|
|
*/
|
|
|
@Service
|
|
|
public class SaleReturnServiceImpl implements SaleReturnService{
|
|
|
+ private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
|
+
|
|
|
public static final String getSaleReturnFromYundingUrl = "http://dc.oclean.com/getoutrefund";
|
|
|
//public static final String getSaleReturnFromYundingUrl = "http://127.0.0.1:8008/test/getoutrefund";
|
|
|
|
|
|
@@ -40,7 +44,7 @@ public class SaleReturnServiceImpl implements SaleReturnService{
|
|
|
public void getSaleReturn() {
|
|
|
String timestamp = String.valueOf(System.currentTimeMillis()/1000);
|
|
|
|
|
|
- Map<String,Object> postMapData = new HashMap<>();
|
|
|
+ Map<String,Object> postMapData = new HashMap<String,Object>();
|
|
|
postMapData.put("app_key", Constant.yundingAppKey);
|
|
|
postMapData.put("time_stamp",timestamp);
|
|
|
postMapData.put("start_time","1970-01-01 00:00:00");
|
|
|
@@ -78,6 +82,7 @@ public class SaleReturnServiceImpl implements SaleReturnService{
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
+ logger.error("error",e);
|
|
|
ediLogDao.save(LogUtil.getSaleFailLog(responseText,e.getMessage()));
|
|
|
}
|
|
|
}
|
|
|
@@ -99,7 +104,6 @@ public class SaleReturnServiceImpl implements SaleReturnService{
|
|
|
|
|
|
try {
|
|
|
SaleReturn saleReturn = JacksonUtil.fromJson(data, SaleReturn.class);
|
|
|
- System.out.println(JacksonUtil.toJson(saleReturn));
|
|
|
saleReturn = saleReturnDao.save(saleReturn);
|
|
|
|
|
|
out = baseDao.callProcedure("SP_YUNDING_SALERETURN",new Object[]{saleReturn.getId()});
|
|
|
@@ -112,6 +116,7 @@ public class SaleReturnServiceImpl implements SaleReturnService{
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
+ logger.error("error",e);
|
|
|
ediLogDao.save(LogUtil.getSaleReturnFailLog(code,responseText,e.getMessage()));
|
|
|
}
|
|
|
}
|