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