Commit 63205c2c by yukang

更换dao为DaoUtils

parent 7bdaedd0
...@@ -143,7 +143,7 @@ public class ServiceHPSC001 extends ServiceBase { ...@@ -143,7 +143,7 @@ public class ServiceHPSC001 extends ServiceBase {
for (int i = 0; i < eiBlock.getRowCount(); i++) { for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
hpsc001.fromMap(map); hpsc001.fromMap(map);
this.dao.update("HPSC001.check", hpsc001.toMap()); DaoUtils.update("HPSC001.check", hpsc001.toMap());
if(hpsc001.getStatus() == 1){ if(hpsc001.getStatus() == 1){
Map sqlMap = new HashMap(); Map sqlMap = new HashMap();
sqlMap.put("id",hpsc001.getId()); sqlMap.put("id",hpsc001.getId());
......
...@@ -70,7 +70,6 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -70,7 +70,6 @@ public class ServiceHPSC002 extends ServiceBase {
*/ */
@Override @Override
public EiInfo insert(EiInfo inInfo) { public EiInfo insert(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try { try {
HPSC002 hppz002 = new HPSC002(); HPSC002 hppz002 = new HPSC002();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
...@@ -85,14 +84,10 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -85,14 +84,10 @@ public class ServiceHPSC002 extends ServiceBase {
BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue()))); BigDecimal totalWt = new BigDecimal(decimalFormat.format(Math.round(num.multiply(unitWt).floatValue())));
hppz002.setDelStatus(1); hppz002.setDelStatus(1);
hppz002.setTotalWt(totalWt); hppz002.setTotalWt(totalWt);
hppz002.setCreatedBy(UserSession.getUserId());
hppz002.setCreatedTime(sdf.format(new Date()));
hppz002.setUpdatedBy(null);
hppz002.setUpdatedTime(null);
if (StringUtils.isNotEmpty(hppz002.getPrdtCode()) && !hppz002.getParentPrdtCode().equals("root")) { if (StringUtils.isNotEmpty(hppz002.getPrdtCode()) && !hppz002.getParentPrdtCode().equals("root")) {
hppz002.setPrdtName(HPPZTools.getPz004ByCode(hppz002.getPrdtCode()).getInventName()); hppz002.setPrdtName(HPPZTools.getPz004ByCode(hppz002.getPrdtCode()).getInventName());
} }
this.dao.insert("HPSC002.insert", hppz002.toMap()); DaoUtils.insert("HPSC002.insert", hppz002.toMap());
if (!hppz002.getParentPrdtCode().equals("root")) { if (!hppz002.getParentPrdtCode().equals("root")) {
this.checkTreeNodeLeaf(new Long(hppz002.getParentPrdtCode())); this.checkTreeNodeLeaf(new Long(hppz002.getParentPrdtCode()));
} }
...@@ -115,16 +110,13 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -115,16 +110,13 @@ public class ServiceHPSC002 extends ServiceBase {
* 修改操作. * 修改操作.
*/ */
public EiInfo update(EiInfo inInfo) { public EiInfo update(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try { try {
HPSC002 hppz002 = new HPSC002(); HPSC002 hppz002 = new HPSC002();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) { for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
hppz002.fromMap(map); hppz002.fromMap(map);
hppz002.setUpdatedBy(UserSession.getUserId()); DaoUtils.update("HPSC001.update", hppz002.toMap());
hppz002.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPSC001.update", hppz002.toMap());
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!"); inInfo.setMsg("修改成功!");
...@@ -226,7 +218,7 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -226,7 +218,7 @@ public class ServiceHPSC002 extends ServiceBase {
}else{ }else{
queryMap.put("leaf", "1"); queryMap.put("leaf", "1");
} }
this.dao.update("HPSC002.updateTreeNodeLeaf", queryMap); DaoUtils.update("HPSC002.updateTreeNodeLeaf", queryMap);
} }
...@@ -248,7 +240,7 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -248,7 +240,7 @@ public class ServiceHPSC002 extends ServiceBase {
// 二级如果已经审核了则需要去看看计划是否已经更新 // 二级如果已经审核了则需要去看看计划是否已经更新
} }
} }
this.dao.update("HPSC002.check", hppz002.toMap()); DaoUtils.update("HPSC002.check", hppz002.toMap());
} }
// 处理三级审核之后判断是否都审核完成,如果都审核完成则二级直接审核通过 // 处理三级审核之后判断是否都审核完成,如果都审核完成则二级直接审核通过
...@@ -271,7 +263,7 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -271,7 +263,7 @@ public class ServiceHPSC002 extends ServiceBase {
map2.put("status",0); map2.put("status",0);
map2.put("id",THPSC002.getParentPrdtCode()); map2.put("id",THPSC002.getParentPrdtCode());
} }
this.dao.update("HPSC002.check",map2); DaoUtils.update("HPSC002.check",map2);
//处理项目管理中物料状态 //处理项目管理中物料状态
Map map3 = new HashMap(); Map map3 = new HashMap();
...@@ -288,13 +280,13 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -288,13 +280,13 @@ public class ServiceHPSC002 extends ServiceBase {
Map map4 = new HashMap(); Map map4 = new HashMap();
map4.put("projCode",THPSC002.getProjCode()); map4.put("projCode",THPSC002.getProjCode());
map4.put("materialStatus",2); map4.put("materialStatus",2);
this.dao.update("HPSC001.checkByProjCode",map4); DaoUtils.update("HPSC001.checkByProjCode",map4);
} else if (num1 > 0 && num1 < num2) { } else if (num1 > 0 && num1 < num2) {
// 部分审批 // 部分审批
Map map4 = new HashMap(); Map map4 = new HashMap();
map4.put("projCode",THPSC002.getProjCode()); map4.put("projCode",THPSC002.getProjCode());
map4.put("materialStatus",1); map4.put("materialStatus",1);
this.dao.update("HPSC001.checkByProjCode",map4); DaoUtils.update("HPSC001.checkByProjCode",map4);
} }
} }
...@@ -323,7 +315,7 @@ public class ServiceHPSC002 extends ServiceBase { ...@@ -323,7 +315,7 @@ public class ServiceHPSC002 extends ServiceBase {
Map sqlMap = new HashMap(); Map sqlMap = new HashMap();
sqlMap.put("id",hppz002.getId()); sqlMap.put("id",hppz002.getId());
sqlMap.put("filePath1",hppz002.getFilePath1()); sqlMap.put("filePath1",hppz002.getFilePath1());
this.dao.update("HPSC002.bindDocIdById", hppz002.toMap()); DaoUtils.update("HPSC002.bindDocIdById", hppz002.toMap());
} }
} catch (PlatException e) { } catch (PlatException e) {
eiInfo.setStatus(EiConstant.STATUS_FAILURE); eiInfo.setStatus(EiConstant.STATUS_FAILURE);
......
...@@ -86,7 +86,6 @@ public class ServiceHPSC003 extends ServiceBase { ...@@ -86,7 +86,6 @@ public class ServiceHPSC003 extends ServiceBase {
* 修改操作. * 修改操作.
*/ */
public EiInfo update(EiInfo inInfo) { public EiInfo update(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try { try {
HPSC003 HPSC003 = new HPSC003(); HPSC003 HPSC003 = new HPSC003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
...@@ -94,9 +93,7 @@ public class ServiceHPSC003 extends ServiceBase { ...@@ -94,9 +93,7 @@ public class ServiceHPSC003 extends ServiceBase {
for (int i = 0; i < eiBlock.getRowCount(); i++) { for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
HPSC003.fromMap(map); HPSC003.fromMap(map);
HPSC003.setUpdatedBy(UserSession.getUserId()); DaoUtils.update("HPSC003.update", HPSC003.toMap());
HPSC003.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPSC003.update", HPSC003.toMap());
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!"); inInfo.setMsg("修改成功!");
...@@ -112,16 +109,13 @@ public class ServiceHPSC003 extends ServiceBase { ...@@ -112,16 +109,13 @@ public class ServiceHPSC003 extends ServiceBase {
} }
public EiInfo updateHPSC0004(EiInfo inInfo) { public EiInfo updateHPSC0004(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try { try {
HPSC004 HPSC004 = new HPSC004(); HPSC004 HPSC004 = new HPSC004();
EiBlock eiBlock = inInfo.getBlock("detail"); EiBlock eiBlock = inInfo.getBlock("detail");
for (int i = 0; i < eiBlock.getRowCount(); i++) { for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
HPSC004.fromMap(map); HPSC004.fromMap(map);
HPSC004.setUpdatedBy(UserSession.getUserId()); DaoUtils.update("HPSC004.updateHPSC0004", HPSC004.toMap());
HPSC004.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPSC004.updateHPSC0004", HPSC004.toMap());
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!"); inInfo.setMsg("修改成功!");
......
...@@ -45,17 +45,12 @@ public class ServiceHPSC004 extends ServiceBase { ...@@ -45,17 +45,12 @@ public class ServiceHPSC004 extends ServiceBase {
*/ */
@Override @Override
public EiInfo insert(EiInfo inInfo) { public EiInfo insert(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try { try {
HPSC004 HPSC004 = new HPSC004(); HPSC004 HPSC004 = new HPSC004();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) { for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
HPSC004.fromMap(map); HPSC004.fromMap(map);
HPSC004.setCreatedBy(UserSession.getUserId());
HPSC004.setCreatedTime(sdf.format(new Date()));
HPSC004.setUpdatedBy(null);
HPSC004.setUpdatedTime(null);
DaoUtils.insert("HPSC004.insert", HPSC004.toMap()); DaoUtils.insert("HPSC004.insert", HPSC004.toMap());
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
...@@ -76,16 +71,13 @@ public class ServiceHPSC004 extends ServiceBase { ...@@ -76,16 +71,13 @@ public class ServiceHPSC004 extends ServiceBase {
* 修改操作. * 修改操作.
*/ */
public EiInfo update(EiInfo inInfo) { public EiInfo update(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try { try {
HPSC004 HPSC004 = new HPSC004(); HPSC004 HPSC004 = new HPSC004();
EiBlock eiBlock = inInfo.getBlock("detail"); EiBlock eiBlock = inInfo.getBlock("detail");
for (int i = 0; i < eiBlock.getRowCount(); i++) { for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
HPSC004.fromMap(map); HPSC004.fromMap(map);
HPSC004.setUpdatedBy(UserSession.getUserId()); DaoUtils.update("HPSC004.update", HPSC004.toMap());
HPSC004.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPSC004.update", HPSC004.toMap());
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!"); inInfo.setMsg("修改成功!");
......
...@@ -49,17 +49,12 @@ public class ServiceHPSC005 extends ServiceBase { ...@@ -49,17 +49,12 @@ public class ServiceHPSC005 extends ServiceBase {
*/ */
@Override @Override
public EiInfo insert(EiInfo inInfo) { public EiInfo insert(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try { try {
HPSC005 HPSC005 = new HPSC005(); HPSC005 HPSC005 = new HPSC005();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) { for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
HPSC005.fromMap(map); HPSC005.fromMap(map);
HPSC005.setCreatedBy(UserSession.getUserId());
HPSC005.setCreatedTime(sdf.format(new Date()));
HPSC005.setUpdatedBy(null);
HPSC005.setUpdatedTime(null);
DaoUtils.insert("HPSC005.insert", HPSC005.toMap()); DaoUtils.insert("HPSC005.insert", HPSC005.toMap());
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
...@@ -80,16 +75,13 @@ public class ServiceHPSC005 extends ServiceBase { ...@@ -80,16 +75,13 @@ public class ServiceHPSC005 extends ServiceBase {
* 修改操作. * 修改操作.
*/ */
public EiInfo update(EiInfo inInfo) { public EiInfo update(EiInfo inInfo) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try { try {
HPSC005 HPSC005 = new HPSC005(); HPSC005 HPSC005 = new HPSC005();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock); EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (int i = 0; i < eiBlock.getRowCount(); i++) { for (int i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i); Map<?, ?> map = eiBlock.getRow(i);
HPSC005.fromMap(map); HPSC005.fromMap(map);
HPSC005.setUpdatedBy(UserSession.getUserId()); DaoUtils.update("HPSC005.update", HPSC005.toMap());
HPSC005.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPSC005.update", HPSC005.toMap());
} }
inInfo.setStatus(EiConstant.STATUS_SUCCESS); inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("修改成功!"); inInfo.setMsg("修改成功!");
...@@ -136,7 +128,6 @@ public class ServiceHPSC005 extends ServiceBase { ...@@ -136,7 +128,6 @@ public class ServiceHPSC005 extends ServiceBase {
*/ */
public EiInfo assign(EiInfo eiInfo) { public EiInfo assign(EiInfo eiInfo) {
try { try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String ids = eiInfo.get("ids").toString(); String ids = eiInfo.get("ids").toString();
String orgId = eiInfo.get("orgId").toString(); String orgId = eiInfo.get("orgId").toString();
//先找到分派的组织 //先找到分派的组织
...@@ -150,9 +141,7 @@ public class ServiceHPSC005 extends ServiceBase { ...@@ -150,9 +141,7 @@ public class ServiceHPSC005 extends ServiceBase {
HPSC005.setStatus(1); HPSC005.setStatus(1);
HPSC005.setOrgNo(map.get("orgId").toString()); HPSC005.setOrgNo(map.get("orgId").toString());
HPSC005.setOrgName(map.get("orgCname").toString()); HPSC005.setOrgName(map.get("orgCname").toString());
HPSC005.setUpdatedBy(UserSession.getUserId()); DaoUtils.update("HPSC005.updateAssign", HPSC005.toMap());
HPSC005.setUpdatedTime(sdf.format(new Date()));
this.dao.update("HPSC005.updateAssign", HPSC005.toMap());
} }
eiInfo.setStatus(EiConstant.STATUS_SUCCESS); eiInfo.setStatus(EiConstant.STATUS_SUCCESS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment