日志打印更改
This commit is contained in:
parent
3cad1b92db
commit
c3d24fc79e
|
@ -257,7 +257,6 @@ public class GoodsAutoAllotPluginInitializer extends PluginBaseEntity {
|
|||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("U8C->存货基本档案自动分配全公司implement(List<BdInvbasdocEntity> filterInvbasdocList)方法失败");
|
||||
//失败
|
||||
String ErrMessage = e.getMessage();
|
||||
|
|
|
@ -94,10 +94,18 @@ public class ShopPluginInitializer extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||
logger.info("调用:" + getPluginName() + "-插件");
|
||||
String prod = "prod";
|
||||
String param = String.valueOf(requestJson.get("param"));
|
||||
if (requestJson != null && ProfilesActiveConstant.TYPE_DATE.equals(requestJson.get("type"))) {
|
||||
//按日期
|
||||
if (param != null && !"".equals(param)) {
|
||||
String[] split = param.split("/");
|
||||
if (!(split.length == 2)) {
|
||||
Assert.state(false, "时间格式传递不正确");
|
||||
}
|
||||
Assert.notNull(split[0], "开始时间不能为空");
|
||||
Assert.notNull(split[1], "结束时间不能为空");
|
||||
startImplement(split[0], split[1]);
|
||||
}
|
||||
} else if (requestJson != null && ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
|
||||
|
@ -108,7 +116,7 @@ public class ShopPluginInitializer extends PluginBaseEntity {
|
|||
String integration_task_living_details_id = (String) requestJson.get("integration_task_living_details_id");
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integration_task_living_details_id);
|
||||
startImplement(integrationTaskLivingDetailsEntity.getRootAppPk());
|
||||
} else {
|
||||
} else if(ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(prod)){
|
||||
startImplement();
|
||||
}
|
||||
return null;
|
||||
|
@ -117,12 +125,18 @@ public class ShopPluginInitializer extends PluginBaseEntity {
|
|||
|
||||
public void startImplement(String startDate, String endDate) {
|
||||
try {
|
||||
Date business_start = DateUtil.parse(startDate);
|
||||
Date business_end = DateUtil.parse(endDate);
|
||||
String start = DateUtil.format(business_start, "yyyy-MM-dd") + " 00:00:00";
|
||||
String end = DateUtil.format(business_end, "yyyy-MM-dd") + " 23:59:59";
|
||||
|
||||
OfsShopDto shopEntity = new OfsShopDto();
|
||||
shopEntity.setLastUpdated_start(startDate);
|
||||
shopEntity.setLastUpdated_end(endDate);
|
||||
shopEntity.setLastUpdated_start(start);
|
||||
shopEntity.setLastUpdated_end(end);
|
||||
shopEntity.setPageNo("1");
|
||||
|
||||
List<OfsShopDto> list = queryfromofs(shopEntity);
|
||||
//过滤数据
|
||||
List<OfsShopDto> shopEntities = filterShopEntity(list);
|
||||
implementcustdoc(shopEntities);
|
||||
|
||||
|
@ -192,7 +206,6 @@ public class ShopPluginInitializer extends PluginBaseEntity {
|
|||
}
|
||||
|
||||
|
||||
|
||||
public void implementcustdoc(List<OfsShopDto> shopEntityList) {
|
||||
Assert.notNull(shopEntityList, "shopEntityList不能为空");
|
||||
|
||||
|
@ -241,13 +254,10 @@ public class ShopPluginInitializer extends PluginBaseEntity {
|
|||
integrationTaskLivingDetailsEntity.setRootAppBill(shopEntity.getName());
|
||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||
//TODO 更新店铺状态
|
||||
// CbdocResultVo cbdocResultVo1 = JSONObject.parseObject(response, CbdocResultVo.class);
|
||||
// String errormsg = cbdocResultVo1.getErrormsg();
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("丽知:OFS店铺档案--->U8C客商档案,implement()方法报错:", e);
|
||||
String ErrMessage = e.getMessage();
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N);
|
||||
|
@ -259,7 +269,7 @@ public class ShopPluginInitializer extends PluginBaseEntity {
|
|||
integrationTaskLivingDetailsEntity.setRootAppBill(shopEntity.getName());
|
||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||
logger.error("丽知:OFS店铺档案--->U8C客商档案,implement()方法报错:", e);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -322,7 +332,7 @@ public class ShopPluginInitializer extends PluginBaseEntity {
|
|||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("丽知:OFS店铺档案--->自定义档案,implement()方法报错:", e);
|
||||
String ErrMessage = e.getMessage();
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N);
|
||||
|
@ -334,7 +344,7 @@ public class ShopPluginInitializer extends PluginBaseEntity {
|
|||
integrationTaskLivingDetailsEntity.setRootAppBill(shopEntity.getName());
|
||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||
logger.error("丽知:OFS店铺档案--->自定义档案,implement()方法报错:", e);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -402,7 +412,8 @@ public class ShopPluginInitializer extends PluginBaseEntity {
|
|||
List<OfsShopDto> list = unified.getData();
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
logger.error("丽知:OFS店铺档案查询失败,queryfromofs()方法报错:", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,8 +94,22 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
|
|||
|
||||
@Override
|
||||
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
|
||||
logger.info("调用:" + getPluginName() + "-插件");
|
||||
String prod = "prod";
|
||||
|
||||
String param = String.valueOf(requestJson.get("param"));
|
||||
if (requestJson != null && ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
|
||||
if (requestJson != null && ProfilesActiveConstant.TYPE_DATE.equals(requestJson.get("type"))) {
|
||||
//按日期
|
||||
if (param != null && !"".equals(param)) {
|
||||
String[] split = param.split("/");
|
||||
if (!(split.length == 2)) {
|
||||
Assert.state(false, "时间格式传递不正确");
|
||||
}
|
||||
Assert.notNull(split[0], "开始时间不能为空");
|
||||
Assert.notNull(split[1], "结束时间不能为空");
|
||||
startImplement(split[0], split[1]);
|
||||
}
|
||||
} else if (requestJson != null && ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
|
||||
if (param != null && !"".equals(param)) {
|
||||
startImplement(param);
|
||||
}
|
||||
|
@ -103,7 +117,7 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
|
|||
String integration_task_living_details_id = (String) requestJson.get("integration_task_living_details_id");
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integration_task_living_details_id);
|
||||
startImplement(integrationTaskLivingDetailsEntity.getRootAppPk());
|
||||
} else {
|
||||
} else if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(prod)){
|
||||
startImplement();
|
||||
}
|
||||
return null;
|
||||
|
@ -115,7 +129,6 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
|
|||
*/
|
||||
public void startImplement() {
|
||||
try {
|
||||
//获取当前时间
|
||||
//获取当前时间
|
||||
Date currentDate = new Date();
|
||||
Date startTime = DateUtil.offset(currentDate, DateField.MINUTE, -10);
|
||||
|
@ -168,9 +181,13 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
|
|||
*/
|
||||
public void startImplement(String startTime, String endTime) {
|
||||
try {
|
||||
Date business_start = DateUtil.parse(startTime);
|
||||
Date business_end = DateUtil.parse(endTime);
|
||||
String start = DateUtil.format(business_start, "yyyy-MM-dd") + " 00:00:00";
|
||||
String end = DateUtil.format(business_end, "yyyy-MM-dd") + " 23:59:59";
|
||||
OfsSupplierDto supplierDto = new OfsSupplierDto();
|
||||
supplierDto.setLastUpdated_start(startTime);
|
||||
supplierDto.setLastUpdated_end(endTime);
|
||||
supplierDto.setLastUpdated_start(start);
|
||||
supplierDto.setLastUpdated_end(end);
|
||||
supplierDto.setClientCode("LETS");
|
||||
supplierDto.setPageNo("1");
|
||||
List<OfsSupplierDto> queryfromofs = queryfromofs(supplierDto);
|
||||
|
@ -234,12 +251,11 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
|
|||
integrationTaskLivingDetailsEntity.setRootAppBill(supplierEntity.getName());
|
||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||
//TODO 更新供应商状态
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("丽知:OFS供应商档案--->U8C客商档案,implement()方法报错:", e);
|
||||
String ErrMessage = e.getMessage();
|
||||
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity();
|
||||
integrationTaskLivingDetailsEntity.setNewState(ProfilesActiveConstant.LOG_STATUS_N);
|
||||
|
@ -251,7 +267,7 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
|
|||
integrationTaskLivingDetailsEntity.setRootAppBill(supplierEntity.getName());
|
||||
integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
|
||||
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
|
||||
logger.error("丽知:OFS供应商档案--->U8C客商档案,implement()方法报错:", e);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -294,7 +310,8 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
|
|||
List<OfsSupplierDto> list = unified.getData();
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
logger.error("丽知:OFS供应商档案查询失败,queryfromofs()方法报错:", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue