hz-zhhq-app-service/greenH5modul/.svn/pristine/4e/4e43806a4e7a73d5967bff6e1e2...

96 lines
2.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.nationalelectric.greenH5;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.annotation.Resource;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.type.TypeReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.jysoft.unipush.AliasManage;
import com.nationalelectirc.Constant.Constant;
import com.nationalelectirc.utils.RestResult;
import com.nationalelectric.greenH5.bizc.BaseServiceImpl;
import com.nationalelectric.greenH5.bizc.IGreenOperateLogBizc;
import com.nationalelectric.greenH5.po.GreenApply;
import com.nationalelectric.greenH5.po.GreenFaultRepairInfo;
import com.nationalelectric.greenH5.po.GreenProblemCollect;
import com.nationalelectric.greenH5.po.GreenUserInfo;
import com.nationalelectric.greenH5.utils.DateUtil;
import com.sgcc.uap.persistence.IHibernateDao;
import com.sgcc.uap.service.validator.ServiceValidatorBaseException;
/**
* <b>概述</b><br>
* <p>
* <b>功能</b><br>
*
* @author dell
*/
@Controller
@RequestMapping("/greenProblemCollect")
public class GreenProblemCollectController extends GreenBaseController {
/**
* 用户controller
*/
@Resource
private GreenUserInfoController greenUserInfoController;
/**
* 保存图片controller
*/
@Resource
private GreenImageInfoController greenImageInfoController;
/**
* HibernateDao逻辑构件
*/
@Autowired
IHibernateDao hibernateDao;
@Autowired
private BaseServiceImpl baseService;
@Resource
private IGreenOperateLogBizc greenOperateLogBizc;
/**
* 保存故障报修申请信息
* @param greenTempParkInfo
* @return
*/
@SuppressWarnings("unchecked")
@Transactional(rollbackFor=Exception.class)
@RequestMapping(value = "/save", method = RequestMethod.POST)
public @ResponseBody RestResult save(GreenProblemCollect greenProblemCollect){
try {
String userId = greenProblemCollect.getCreateBy();
GreenUserInfo info = getUserInfo(userId);
if(info==null){
return new RestResult(Constant.FAILED, "非法用户");
}
//添加故障报修信息到故障报修信息表
hibernateDao.saveObject(greenProblemCollect);
return new RestResult(Constant.SUCCESS, "提交成功");
} catch (Exception e) {
e.printStackTrace();
return new RestResult(Constant.FAILED, "提交失败,请重试");
}
}
}