增加产品日志通用方法

This commit is contained in:
zhulianghua 2018-08-07 10:36:52 +08:00
parent 8dcc4697ac
commit 79c3c6d0a0

View File

@ -129,24 +129,24 @@ public class ProductManager{
this.sortNo = sortNo;
}
public String addProductDataLog(JBOTransaction tx) throws Exception {
public String addProductDataLog(JBOTransaction tx, String name, String operation, String opNumber, String target, String userId, String orgid) throws Exception {
//增加产品编辑日志
BizObjectManager bomPL = JBOFactory.getBizObjectManager(PRODUCT_LOG.CLASS_NAME, tx);
String info = userId + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + "A";
String info = userId + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + opNumber;
BizObject boPL = bomPL.newObject();
boPL.setAttributeValue("name", newProductID);
boPL.setAttributeValue("name", name);
boPL.setAttributeValue("information", info);
boPL.setAttributeValue("operation", "add");
boPL.setAttributeValue("target", "data");
boPL.setAttributeValue("operation", operation);
boPL.setAttributeValue("target", target);
boPL.setAttributeValue("inputuserid", userId);
boPL.setAttributeValue("inputorgid", orgId);
boPL.setAttributeValue("inputorgid", orgid);
boPL.setAttributeValue("imputtime", StringFunction.getTodayNow());
bomPL.saveObject(boPL);
return "success";
}
public String getSortNo(JBOTransaction tx) throws Exception {
addProductDataLog(tx);
addProductDataLog(tx, newProductID, "add", "A", "data", userId, orgId);
return this.checkTypeNo(tx);
}
@ -280,17 +280,7 @@ public class ProductManager{
bomPN.createQuery("delete from O where prdid = '" + productID + "'").executeUpdate();
//增加产品编辑日志
BizObjectManager bomPL = JBOFactory.getBizObjectManager(PRODUCT_LOG.CLASS_NAME, tx);
String info = userId + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + "D";
BizObject boPL = bomPL.newObject();
boPL.setAttributeValue("name", productID);
boPL.setAttributeValue("information", info);
boPL.setAttributeValue("operation", "delete");
boPL.setAttributeValue("target", "data");
boPL.setAttributeValue("inputuserid", userId);
boPL.setAttributeValue("inputorgid", orgId);
boPL.setAttributeValue("imputtime", StringFunction.getTodayNow());
bomPL.saveObject(boPL);
addProductDataLog(tx, productID, "delete", "D", "data", userId, orgId);
for(BusinessObject ps:psl){
String configFile = ps.getString("ConfigFile");
@ -348,16 +338,8 @@ public class ProductManager{
bomanager.updateDB();
//增加产品编辑日志
BizObjectManager bomPL = JBOFactory.getBizObjectManager(PRODUCT_LOG.CLASS_NAME, tx);
BizObject boPL = bomPL.newObject();
boPL.setAttributeValue("name", "Cata"+sortNo);
boPL.setAttributeValue("information", userId + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + "A");
boPL.setAttributeValue("operation", "add");
boPL.setAttributeValue("target", "catalog");
boPL.setAttributeValue("inputuserid", userId);
boPL.setAttributeValue("inputorgid", orgId);
boPL.setAttributeValue("imputtime", StringFunction.getTodayNow());
bomPL.saveObject(boPL);
addProductDataLog(tx, "Cata"+sortNo, "add", "A", "catalog", userId, orgId);
return "true";
}
@ -415,8 +397,6 @@ public class ProductManager{
* @throws Exception
*/
public String deleteCatalog(JBOTransaction tx) throws Exception{
String info = userId + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + "D";
String time = StringFunction.getTodayNow();
BizObjectManager bomPSL = JBOFactory.getBizObjectManager(PRD_SPECIFIC_LIBRARY.CLASS_NAME, tx);
BizObjectManager bomPS = JBOFactory.getBizObjectManager(PRD_STAGENODE.CLASS_NAME, tx);
BizObjectManager bomPN = JBOFactory.getBizObjectManager(PRD_NODECONFIG.CLASS_NAME, tx);
@ -436,28 +416,12 @@ public class ProductManager{
bomanager.deleteBusinessObject(bo);
//增加产品编辑日志
BizObject boPL = bomPL.newObject();
boPL.setAttributeValue("name", typeNo);
boPL.setAttributeValue("information", info);
boPL.setAttributeValue("operation", "delete");
boPL.setAttributeValue("target", "data");
boPL.setAttributeValue("inputuserid", userId);
boPL.setAttributeValue("inputorgid", orgId);
boPL.setAttributeValue("imputtime", time);
bomPL.saveObject(boPL);
addProductDataLog(tx, typeNo, "delete", "D", "data", userId, orgId);
}
bomanager.updateDB();
//增加产品编辑日志
BizObject boPL = bomPL.newObject();
boPL.setAttributeValue("name", catalogNo);
boPL.setAttributeValue("information", info);
boPL.setAttributeValue("operation", "delete");
boPL.setAttributeValue("target", "catalog");
boPL.setAttributeValue("inputuserid", userId);
boPL.setAttributeValue("inputorgid", orgId);
boPL.setAttributeValue("imputtime", time);
bomPL.saveObject(boPL);
addProductDataLog(tx, catalogNo, "delete", "D", "catalog", userId, orgId);
return "true";
}
@ -548,16 +512,7 @@ public class ProductManager{
DataOperatorUtil.copyJBOSet(PRD_NODECONFIG.CLASS_NAME, fromCondition, PRD_NODECONFIG.CLASS_NAME, new HashMap<String,String>(), otherProperty, null, tx);
//增加产品编辑日志
BizObjectManager bomPL = JBOFactory.getBizObjectManager(PRODUCT_LOG.CLASS_NAME, tx);
BizObject boPL = bomPL.newObject();
boPL.setAttributeValue("name", id);
boPL.setAttributeValue("information", userId + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + "A");
boPL.setAttributeValue("operation", "add");
boPL.setAttributeValue("target", "data");
boPL.setAttributeValue("inputuserid", userId);
boPL.setAttributeValue("inputorgid", orgId);
boPL.setAttributeValue("imputtime", StringFunction.getTodayNow());
bomPL.saveObject(boPL);
addProductDataLog(tx, id, "add", "A", "data", userId, orgId);
return "SUCCESS";
}