124 lines
4.1 KiB
Plaintext
124 lines
4.1 KiB
Plaintext
|
|
package com.nationalelectric.greenH5;
|
|||
|
|
|
|||
|
|
import static com.jysoft.unipush.constant.AppInfo.APPID;
|
|||
|
|
import static com.jysoft.unipush.constant.AppInfo.push;
|
|||
|
|
|
|||
|
|
import java.text.SimpleDateFormat;
|
|||
|
|
import java.util.ArrayList;
|
|||
|
|
import java.util.Date;
|
|||
|
|
import java.util.HashMap;
|
|||
|
|
import java.util.Iterator;
|
|||
|
|
import java.util.List;
|
|||
|
|
import java.util.Map;
|
|||
|
|
import java.util.UUID;
|
|||
|
|
|
|||
|
|
import javax.annotation.Resource;
|
|||
|
|
|
|||
|
|
import org.apache.commons.lang.StringUtils;
|
|||
|
|
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.gexin.fastjson.JSONArray;
|
|||
|
|
import com.jysoft.unipush.AliasManage;
|
|||
|
|
import com.jysoft.weChat.service.WechatService;
|
|||
|
|
import com.jysoft.weChat.vo.ContentVo;
|
|||
|
|
import com.nationalelectirc.Constant.ApplyRoleConstant;
|
|||
|
|
import com.nationalelectirc.Constant.Constant;
|
|||
|
|
import com.nationalelectirc.utils.RestResult;
|
|||
|
|
import com.nationalelectric.greenH5.GreenBaseController;
|
|||
|
|
import com.nationalelectric.greenH5.DTO.GreenMealTicketApplyDTO;
|
|||
|
|
import com.nationalelectric.greenH5.bizc.BaseServiceImpl;
|
|||
|
|
import com.nationalelectric.greenH5.bizc.IGreenApplyBizc;
|
|||
|
|
import com.nationalelectric.greenH5.bizc.IGreenApplyListBizc;
|
|||
|
|
import com.nationalelectric.greenH5.bizc.IGreenFaultRepairInfoBizc;
|
|||
|
|
import com.nationalelectric.greenH5.bizc.IGreenOperateLogBizc;
|
|||
|
|
import com.nationalelectric.greenH5.po.GreenApply;
|
|||
|
|
import com.nationalelectric.greenH5.po.GreenApplyList;
|
|||
|
|
import com.nationalelectric.greenH5.po.GreenFaultRepairInfo;
|
|||
|
|
import com.nationalelectric.greenH5.po.GreenFaultReply;
|
|||
|
|
import com.nationalelectric.greenH5.po.GreenNotice;
|
|||
|
|
import com.nationalelectric.greenH5.po.GreenSeekmedicalRecord;
|
|||
|
|
import com.nationalelectric.greenH5.po.GreenUserInfo;
|
|||
|
|
import com.nationalelectric.greenH5.po.Result;
|
|||
|
|
import com.nationalelectric.greenH5.utils.DateUtil;
|
|||
|
|
import com.sgcc.uap.persistence.IHibernateDao;
|
|||
|
|
import com.sgcc.uap.service.validator.ServiceValidatorBaseException;
|
|||
|
|
import com.sgcc.uap.service.validator.ServiceValidatorUtil;
|
|||
|
|
|
|||
|
|
import Decoder.BASE64Encoder;
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* <b>概述</b>:<br>
|
|||
|
|
* <p>
|
|||
|
|
* <b>功能</b>:<br>
|
|||
|
|
*
|
|||
|
|
* @author dell
|
|||
|
|
*/
|
|||
|
|
@Controller
|
|||
|
|
@RequestMapping("/aliasManageController")
|
|||
|
|
public class AliasManageController extends GreenBaseController {
|
|||
|
|
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* HibernateDao逻辑构件
|
|||
|
|
*/
|
|||
|
|
@Autowired
|
|||
|
|
IHibernateDao hibernateDao;
|
|||
|
|
@Autowired
|
|||
|
|
private BaseServiceImpl baseService;
|
|||
|
|
|
|||
|
|
|
|||
|
|
@RequestMapping(value = "/pushToSingleBatch", method = RequestMethod.POST)
|
|||
|
|
public @ResponseBody void pushToSingleBatch(List<Map<String,Object>> userList,String title,String text,String url) {
|
|||
|
|
try {
|
|||
|
|
if("true".equals(Constant.SEND_ALIAS)){
|
|||
|
|
List<GreenNotice> gnList = new ArrayList<GreenNotice>();
|
|||
|
|
for(int i=0;i<userList.size();i++){
|
|||
|
|
String userId = (String) userList.get(i).get("id");
|
|||
|
|
GreenNotice gn = new GreenNotice();
|
|||
|
|
gn.setTitle(title);
|
|||
|
|
gn.setText(text);
|
|||
|
|
gn.setUrl(url);
|
|||
|
|
gn.setUserId(userId);
|
|||
|
|
gn.setCreateBy(userId);
|
|||
|
|
gn.setCreateTime(new Date());
|
|||
|
|
gnList.add(gn);
|
|||
|
|
}
|
|||
|
|
hibernateDao.saveAllObject(gnList);
|
|||
|
|
AliasManage.pushToSingleBatch(userList, title, text, url);
|
|||
|
|
}
|
|||
|
|
} catch (Exception e) {
|
|||
|
|
e.printStackTrace();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@RequestMapping(value = "/pushToSingle", method = RequestMethod.POST)
|
|||
|
|
public @ResponseBody void pushToSingle(String userId,String title,String text,String url) {
|
|||
|
|
try {
|
|||
|
|
if("true".equals(Constant.SEND_ALIAS)){
|
|||
|
|
GreenNotice gn = new GreenNotice();
|
|||
|
|
gn.setTitle(title);
|
|||
|
|
gn.setText(text);
|
|||
|
|
gn.setUrl(url);
|
|||
|
|
gn.setUserId(userId);
|
|||
|
|
gn.setCreateBy(userId);
|
|||
|
|
gn.setCreateTime(new Date());
|
|||
|
|
hibernateDao.saveObject(gn);
|
|||
|
|
AliasManage.pushToSingle(userId, title, text, url,hibernateDao);
|
|||
|
|
}
|
|||
|
|
} catch (Exception e) {
|
|||
|
|
e.printStackTrace();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|