90 lines
2.5 KiB
Plaintext
90 lines
2.5 KiB
Plaintext
package com.nationalelectric.greenH5.bizc;
|
|
|
|
import java.io.Serializable;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import com.nationalelectirc.Constant.Constant;
|
|
import com.nationalelectirc.utils.RestResult;
|
|
import com.nationalelectric.greenH5.po.GreenApply;
|
|
import com.nationalelectric.greenH5.po.GreenRole;
|
|
import com.sgcc.uap.mdd.runtime.base.BizCDefaultImpl;
|
|
import com.sgcc.uap.rest.support.QueryResultObject;
|
|
import com.sgcc.uap.rest.support.RequestCondition;
|
|
|
|
@Service
|
|
public class GreenApplyBizc extends BizCDefaultImpl<GreenApply, Serializable> implements IGreenApplyBizc {
|
|
|
|
@Override
|
|
protected void afterAdd(GreenApply arg0) {
|
|
// TODO Auto-generated method stub
|
|
System.out.println("9999999");
|
|
}
|
|
|
|
@Override
|
|
protected void afterDelete(GreenApply arg0) {
|
|
// TODO Auto-generated method stub
|
|
|
|
}
|
|
|
|
@Override
|
|
protected void afterUpdate(GreenApply arg0, Serializable arg1) {
|
|
// TODO Auto-generated method stub
|
|
|
|
}
|
|
|
|
@Override
|
|
protected boolean beforeAdd(GreenApply arg0) {
|
|
// TODO Auto-generated method stub
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
protected boolean beforeDelete(GreenApply arg0) {
|
|
// TODO Auto-generated method stub
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
protected boolean beforeUpdate(GreenApply arg0, Serializable arg1) {
|
|
// TODO Auto-generated method stub
|
|
return false;
|
|
}
|
|
/**
|
|
* 故障受理
|
|
*/
|
|
@Transactional(rollbackFor=Exception.class)
|
|
public RestResult hitch(String userId, Integer type, Long id, String personId){
|
|
GreenApply apply = hibernateDao.getObject(GreenApply.class, id);
|
|
if (apply == null) {
|
|
return new RestResult(Constant.FAILED, "未查询到该记录");
|
|
}
|
|
if (!apply.getApplyType().equals(Constant.FAULT_REPAIR_APPLY)) {
|
|
return new RestResult(Constant.FAILED, "数据有误");
|
|
}
|
|
if (apply.getStatus().equals(Constant.ACCEPT_YES)) {
|
|
return new RestResult(Constant.FAILED, "该记录已处理");
|
|
}
|
|
if (apply.getStatus().equals(Constant.ACCEPT_NO)) {
|
|
return new RestResult(Constant.FAILED, "该记录已处理");
|
|
}
|
|
String status = Constant.ACCEPT_NO;
|
|
if (type == 1) {
|
|
String sql = "update green_fault_repair_info set person_id = ? where id = ?";
|
|
List<Object> params = new ArrayList<Object>();
|
|
params.add(personId);
|
|
params.add(apply.getDetailId());
|
|
|
|
hibernateDao.executeSqlUpdate(sql, params.toArray());
|
|
status = Constant.ACCEPT_YES;
|
|
}
|
|
apply.setStatus(status);
|
|
hibernateDao.updateObject(apply);
|
|
return new RestResult(Constant.SUCCESS, "操作成功");
|
|
}
|
|
|
|
}
|