package cn.com.goldenwater.dcproj.service.impl.tac; import cn.com.goldenwater.core.service.AbstractCrudService; import cn.com.goldenwater.dcproj.constValue.SmsCodeEnum; import cn.com.goldenwater.dcproj.dao.AttAdXBaseDao; import cn.com.goldenwater.dcproj.dao.BisInspAllRlationPersDao; import cn.com.goldenwater.dcproj.dao.TacInspYearBatchAreaDao; import cn.com.goldenwater.dcproj.dao.TacInspYearBatchDao; import cn.com.goldenwater.dcproj.dao.TacInspYearBatchGroupDao; import cn.com.goldenwater.dcproj.dao.TacInspYearBatchGroupPersDao; import cn.com.goldenwater.dcproj.dao.TacInspYearBatchObjDao; import cn.com.goldenwater.dcproj.dao.TacPawpRgstrDao; import cn.com.goldenwater.dcproj.dao.TacWorkerBDao; import cn.com.goldenwater.dcproj.dto.TacInspYearBatchGroupDto; import cn.com.goldenwater.dcproj.dto.TacInspYearBatchObjDto; import cn.com.goldenwater.dcproj.model.AttAdXBase; import cn.com.goldenwater.dcproj.model.TacInspYearBatch; import cn.com.goldenwater.dcproj.model.TacInspYearBatchArea; import cn.com.goldenwater.dcproj.model.TacInspYearBatchGroup; import cn.com.goldenwater.dcproj.model.TacInspYearBatchGroupPers; import cn.com.goldenwater.dcproj.model.TacInspYearBatchObj; import cn.com.goldenwater.dcproj.model.TacWorkerB; import cn.com.goldenwater.dcproj.param.AttAdXBaseParam; import cn.com.goldenwater.dcproj.param.TacInspYearBatchAreaParam; import cn.com.goldenwater.dcproj.param.TacInspYearBatchGroupParam; import cn.com.goldenwater.dcproj.param.TacInspYearBatchGroupPersParam; import cn.com.goldenwater.dcproj.param.TacInspYearBatchObjParam; import cn.com.goldenwater.dcproj.param.TacPawpRgstrParam; import cn.com.goldenwater.dcproj.param.TacWorkerBParam; import cn.com.goldenwater.dcproj.service.TacInspYearBatchGroupService; import cn.com.goldenwater.dcproj.utils.DateUtils; import cn.com.goldenwater.dcproj.utils.HttpClientUtils; import cn.com.goldenwater.id.util.UuidUtil; import cn.com.goldenwater.target.CheckException; import net.sf.json.JSONObject; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; /** * @author lune * @date 2019-9-6 */ @Service @Transactional public class TacInspYearBatchGroupServiceImpl
extends AbstractCrudService implements TacInspYearBatchGroupService { private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private TacInspYearBatchGroupDao tacInspYearBatchGroupDao; @Autowired private TacInspYearBatchDao yearBatchDao; @Autowired private TacWorkerBDao workerBDao; @Autowired private TacPawpRgstrDao tacPawpRgstrDao; @Autowired private AttAdXBaseDao attAdXBaseDao; @Autowired private TacInspYearBatchAreaDao areaDao; @Autowired private TacInspYearBatchGroupPersDao groupPersDao; @Autowired private TacInspYearBatchObjDao tacInspYearBatchObjDao; @Autowired private BisInspAllRlationPersDao rlationPersDao; @Value("${api.url}") private String apiUrl; //稽察专家回复超时时间 // @Value("${replyTimeout}") // private long replyTimeout; private static String apiKey = "1036432406699048960"; private static String apiSecrect = "bbSsX1wvmaKdca5x2+yBDgeFtl9hj4zJmnegunWuLuHLwLo+QjxOr3//P4BJNrVADa7tN4w0DX1KS/VSec5G0x+ucDeAcSt9tWgFGyoBVtblybh+vzLbwH4sJa92hQfu\n"; public TacInspYearBatchGroupServiceImpl(TacInspYearBatchGroupDao tacInspYearBatchGroupDao) { super(tacInspYearBatchGroupDao); this.tacInspYearBatchGroupDao = tacInspYearBatchGroupDao; } @Override public List getGroupListByLoginId(TacInspYearBatchGroupParam tacInspYearBatchGroupParam) { List groupList = tacInspYearBatchGroupDao.getGroupListApp(tacInspYearBatchGroupParam); if (groupList.size() > 0) { groupList.forEach(group -> { TacInspYearBatchAreaParam areaParam = new TacInspYearBatchAreaParam(); areaParam.setGroupId(group.getId()); List areaList = this.areaDao.findList(areaParam); if (areaList.size() > 0) { String str = ""; for (TacInspYearBatchArea area : areaList) { str = str + area.getAdName() + ","; } if (str.length() > 0) { str = str.substring(0, str.length() - 1); } group.setAreas(str); } }); } return groupList; } @Override public int insertGroupList(TacInspYearBatchGroupDto groupDto) { if (groupDto == null) { return 0; } List adCodes = groupDto.getAdCodes(); if (adCodes.size() > 0) { for (String adCode : adCodes) { TacInspYearBatchGroup group = new TacInspYearBatchGroup(); group.setId(UuidUtil.uuid()); group.setYearBatchId(groupDto.getBatchId()); group.setTenet(groupDto.getTenet()); group.setInTm(new Date()); TacInspYearBatchGroupParam groupParam = new TacInspYearBatchGroupParam(); groupParam.setYearBatchId(groupDto.getBatchId()); String groupNum = this.tacInspYearBatchGroupDao.getMaxGourpNum(groupParam); if (StringUtils.isBlank(groupNum)) { groupNum = "1"; } group.setProvince(groupDto.getProvince()); group.setGroupNm(Long.valueOf(groupNum)); group.setConfirmer("0"); tacInspYearBatchGroupDao.insert(group); if (adCode.contains(",")) { String[] ads = adCode.split(","); for (String ad : ads) { TacInspYearBatchArea area = new TacInspYearBatchArea(); area.setId(UuidUtil.uuid()); area.setGroupId(group.getId()); area.setYearBatchId(group.getYearBatchId()); area.setAdCode(ad); area.setInTm(new Date()); area.setUpTm(new Date()); area.setProvince(groupDto.getProvince()); areaDao.insert(area); } } else { TacInspYearBatchArea area = new TacInspYearBatchArea(); area.setId(UuidUtil.uuid()); area.setGroupId(group.getId()); area.setYearBatchId(group.getYearBatchId()); area.setAdCode(adCode); area.setInTm(new Date()); area.setUpTm(new Date()); area.setProvince(groupDto.getProvince()); areaDao.insert(area); } } TacInspYearBatch yearBatch = new TacInspYearBatch(); yearBatch.setId(groupDto.getBatchId()); yearBatch.setIsAreaGroup("1"); yearBatchDao.update(yearBatch); } return 0; } @Override public List getGroupList(TacInspYearBatchGroupParam groupParam) { List groupList = this.tacInspYearBatchGroupDao.findList(groupParam); List result = new ArrayList<>(); if (groupList.size() > 0) { for (TacInspYearBatchGroup tacInspYearBatchGroup : groupList) { TacWorkerBParam workerBParam = new TacWorkerBParam(); workerBParam.setGroupId(tacInspYearBatchGroup.getId()); workerBParam.setProvince(groupParam.getProvince()); if(StringUtils.isNotBlank(groupParam.getName()) && StringUtils.isBlank(groupParam.getPersName())){ groupParam.setPersName(groupParam.getName()); } if (StringUtils.isNotBlank(groupParam.getPersName())) { workerBParam.setName(groupParam.getPersName()); List bs = workerBDao.getWorkListByGroupId(workerBParam); if (bs.size() == 0) { continue; } workerBParam.setName(""); tacInspYearBatchGroup.setWorkersList(workerBDao.getWorkListByGroupId(workerBParam)); } else { List bs = workerBDao.getWorkListByGroupId(workerBParam); tacInspYearBatchGroup.setWorkersList(bs); } //获取督查区域 TacInspYearBatchAreaParam areaParam = new TacInspYearBatchAreaParam(); areaParam.setGroupId(tacInspYearBatchGroup.getId()); areaParam.setProvince(groupParam.getProvince()); if (StringUtils.isNotBlank(groupParam.getAdCode())) { areaParam.setAdCode(groupParam.getAdCode()); List areaList = this.areaDao.findList(areaParam); if (areaList.size() == 0) { continue; } areaParam.setAdCode(""); } List areaList = this.areaDao.findList(areaParam); if (areaList.size() > 0) { String str = ""; for (TacInspYearBatchArea area : areaList) { str = str + area.getAdName() + ","; } if (str.length() > 0) { str = str.substring(0, str.length() - 1); } tacInspYearBatchGroup.setAreas(str); } tacInspYearBatchGroup.setAreaList(areaList); TacInspYearBatchObjParam objParam = new TacInspYearBatchObjParam(); objParam.setGroupId(tacInspYearBatchGroup.getId()); objParam.setProvince(groupParam.getProvince()); if (StringUtils.isNotBlank(groupParam.getType())) { objParam.setType(groupParam.getType()); List list = tacInspYearBatchObjDao.getObjList(objParam); if (list.size() == 0) { continue; } objParam.setType(""); } List objs = tacInspYearBatchObjDao.getObjAndType(objParam); tacInspYearBatchGroup.setObjList(objs); result.add(tacInspYearBatchGroup); } } return result; } @Override public int deleteGroupById(String id, String province) { this.tacInspYearBatchGroupDao.delete(id); TacInspYearBatchAreaParam areaParam = new TacInspYearBatchAreaParam(); areaParam.setGroupId(id); areaParam.setProvince(province); areaDao.deleteBy(areaParam); TacInspYearBatchObjParam tacInspYearBatchObjParam = new TacInspYearBatchObjParam(); tacInspYearBatchObjParam.setGroupId(id); tacInspYearBatchObjDao.deleteBy(tacInspYearBatchObjParam); TacPawpRgstrParam tacPawpRgstrParam = new TacPawpRgstrParam(); tacPawpRgstrParam.setGroupId(id); tacPawpRgstrDao.deleteBy(tacPawpRgstrParam); TacInspYearBatchGroupPersParam groupPersParam = new TacInspYearBatchGroupPersParam(); groupPersParam.setGroupId(id); int a = groupPersDao.deleteGroupPersByGroupId(groupPersParam); return 1; } @Override public int deleteGroupList(TacInspYearBatchGroupDto dto) { if (dto == null || dto.getGroupList() == null) { return 0; } List groupIdList = dto.getGroupList().stream().map(m -> m.getId()).collect(Collectors.toList()); List batchObjList = this.tacInspYearBatchObjDao.getObjListByGroupIdList(groupIdList); if(null != batchObjList && batchObjList.size()>0){ // 这个组下面有项目,不能删除组 throw new CheckException("删除的组里有项目,请先去掉组里的项目!!!"); } dto.getGroupList().forEach(group -> { this.tacInspYearBatchGroupDao.delete(group.getId()); TacInspYearBatchObjParam tacInspYearBatchObjParam = new TacInspYearBatchObjParam(); tacInspYearBatchObjParam.setGroupId(group.getId()); tacInspYearBatchObjParam.setProvince(dto.getProvince()); tacInspYearBatchObjDao.deleteBy(tacInspYearBatchObjParam); TacPawpRgstrParam tacPawpRgstrParam = new TacPawpRgstrParam(); tacPawpRgstrParam.setGroupId(group.getId()); tacPawpRgstrParam.setProvince(dto.getProvince()); tacPawpRgstrDao.deleteBy(tacPawpRgstrParam); TacInspYearBatchAreaParam areaParam = new TacInspYearBatchAreaParam(); areaParam.setGroupId(group.getId()); areaParam.setProvince(dto.getProvince()); areaDao.deleteBy(areaParam); TacInspYearBatchGroupPersParam groupPersParam = new TacInspYearBatchGroupPersParam(); groupPersParam.setGroupId(group.getId()); int a = groupPersDao.deleteGroupPersByGroupId(groupPersParam); }); return 0; } @Override public TacInspYearBatchGroup getGroupById(String id, String province) { TacInspYearBatchGroup group = tacInspYearBatchGroupDao.get(id); TacInspYearBatchAreaParam areaParam = new TacInspYearBatchAreaParam(); areaParam.setGroupId(group.getId()); areaParam.setProvince(province); List list = areaDao.findList(areaParam); group.setAreaList(list); return group; } @Override public int updateGroupArea(TacInspYearBatchGroup group) { Map> map = new HashMap<>(); if (group.getAreaList() != null) { group.getAreaList().forEach(tacInspYearBatchArea -> { if (map.keySet().contains(tacInspYearBatchArea.getAdName())) { map.get(tacInspYearBatchArea.getAdName()).add(tacInspYearBatchArea); } else { List list = new ArrayList<>(); list.add(tacInspYearBatchArea); map.put(tacInspYearBatchArea.getAdName(), list); } }); } if (group.getAdNames() != null) { for (Map stringMap : group.getAdNames()) { String adName = stringMap.get("adName"); if (map.containsKey(adName)) { map.remove(adName); continue; } AttAdXBaseParam adXBaseParam = new AttAdXBaseParam(); adXBaseParam.setAdName(adName); AttAdXBase attAdXBase = attAdXBaseDao.getByName(adXBaseParam); if (attAdXBase == null) { continue; } TacInspYearBatchArea batchArea = new TacInspYearBatchArea(); batchArea.setId(UuidUtil.uuid()); batchArea.setGroupId(group.getId()); batchArea.setYearBatchId(group.getYearBatchId()); batchArea.setGroupNm(group.getGroupNm()); batchArea.setAdCode(attAdXBase.getAdCode()); batchArea.setAdName(adName); batchArea.setBatch(group.getBatch()); batchArea.setYear(group.getYear()); batchArea.setInTm(new Date()); batchArea.setUpTm(new Date()); batchArea.setProvince(group.getProvince()); areaDao.insert(batchArea); } List areaList = new ArrayList(); for (List list : map.values()) { areaList.addAll(list); } if (areaList.size() > 0) { TacInspYearBatchGroupPersParam groupPersParam = new TacInspYearBatchGroupPersParam(); for (TacInspYearBatchArea area : areaList) { groupPersParam.setGroupId(area.getGroupId()); groupPersDao.deleteBy(groupPersParam); if (area.getId().contains(",")) { for (String id : area.getId().split(",")) { areaDao.delete(id); } } else { areaDao.delete(area.getId()); } } } } return 0; } @Override public List getGroupListAndObj(TacInspYearBatchGroupParam groupParam) { List groupList = this.tacInspYearBatchGroupDao.findList(groupParam); if (groupList.size() > 0) { for (TacInspYearBatchGroup tacInspYearBatchGroup : groupList) { TacWorkerBParam workerBParam = new TacWorkerBParam(); workerBParam.setGroupId(tacInspYearBatchGroup.getId()); workerBParam.setProvince(groupParam.getProvince()); tacInspYearBatchGroup.setWorkersList(workerBDao.getWorkListByGroupId(workerBParam)); //获取督查区域 TacInspYearBatchAreaParam areaParam = new TacInspYearBatchAreaParam(); areaParam.setGroupId(tacInspYearBatchGroup.getId()); areaParam.setProvince(groupParam.getProvince()); List areaList = this.areaDao.findList(areaParam); if (areaList.size() > 0) { String str = ""; for (TacInspYearBatchArea area : areaList) { str = str + area.getAdName() + ","; } if (str.length() > 0) { str = str.substring(0, str.length() - 1); } tacInspYearBatchGroup.setAreas(str); } TacInspYearBatchObjParam objParam = new TacInspYearBatchObjParam(); objParam.setGroupId(tacInspYearBatchGroup.getId()); objParam.setProvince(groupParam.getProvince()); List objs = tacInspYearBatchObjDao.findList(objParam); tacInspYearBatchGroup.setObjList(objs); } } return groupList; } @Override public List getGroupListByPersId(TacInspYearBatchGroupParam groupParam) { List list = tacInspYearBatchGroupDao.getGroupListByPersId(groupParam); if (list.size() > 0) { for (TacInspYearBatchGroup tacInspYearBatchGroup : list) { TacInspYearBatchAreaParam areaParam = new TacInspYearBatchAreaParam(); areaParam.setGroupId(tacInspYearBatchGroup.getId()); areaParam.setProvince(groupParam.getProvince()); List areaList = this.areaDao.findList(areaParam); tacInspYearBatchGroup.setAreaList(areaList); } } return list; } @Override public List getGroupListApp(TacInspYearBatchGroupParam tacInspYearBatchGroupParam) { if (StringUtils.isNotBlank(tacInspYearBatchGroupParam.getPersId())) { if ("1".equals(rlationPersDao.get(tacInspYearBatchGroupParam.getPersId()).getPersType())) { tacInspYearBatchGroupParam.setPersId(""); } } List list = tacInspYearBatchGroupDao.getGroupListApp(tacInspYearBatchGroupParam); if (list.size() > 0) { for (TacInspYearBatchGroup tacInspYearBatchGroup : list) { TacInspYearBatchAreaParam areaParam = new TacInspYearBatchAreaParam(); areaParam.setGroupId(tacInspYearBatchGroup.getId()); areaParam.setProvince(tacInspYearBatchGroupParam.getProvince()); List areaList = this.areaDao.findList(areaParam); tacInspYearBatchGroup.setAreaList(areaList); } } return list; } @Override public int updateGroupList(TacInspYearBatchGroupDto dto) { if (dto == null) { return 0; } if (dto.getGroupList() == null && StringUtils.isBlank(dto.getBatchId())) { return 0; } if (dto.getGroupList() != null) { dto.getGroupList().forEach(group -> { group.setUpTm(new Date()); tacInspYearBatchGroupDao.update(group); }); } if (StringUtils.isNotBlank(dto.getBatchId())) { TacInspYearBatchGroup group = new TacInspYearBatchGroup(); SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); group.setYearBatchId(dto.getBatchId()); try { if (StringUtils.isNotBlank(dto.getSttm()) && StringUtils.isNotBlank(dto.getEntm())) { group.setStTm(fmt.parse(dto.getSttm())); group.setEnTm(fmt.parse(dto.getEntm())); int a = tacInspYearBatchGroupDao.updateByBatchId(group); } } catch (ParseException e) { } } return 0; } @Override public String sendGroupMessage(TacInspYearBatchGroupParam tacInspYearBatchGroupParam) throws Exception { List smsWorkListByGroupId = groupPersDao.getSmsWorkListByGroupId(tacInspYearBatchGroupParam); //分组数据 TacInspYearBatchGroup by = tacInspYearBatchGroupDao.get(tacInspYearBatchGroupParam.getId()); String sttm= DateUtils.Date2Str(by.getStTm(),"yyyy-MM-dd"); String entm= DateUtils.Date2Str(by.getEnTm(),"yyyy-MM-dd"); //获取督查区域 TacInspYearBatchAreaParam areaParam = new TacInspYearBatchAreaParam(); areaParam.setGroupId(tacInspYearBatchGroupParam.getId()); areaParam.setProvince(tacInspYearBatchGroupParam.getProvince()); List areaList = this.areaDao.findList(areaParam); String areas = ""; if (areaList.size() > 0) { for (TacInspYearBatchArea area : areaList) { areas = areas + area.getAdName() + ","; } if (areas.length() > 0) { areas = areas.substring(0, areas.length() - 1); } } TacInspYearBatchObjParam objParam = new TacInspYearBatchObjParam(); objParam.setGroupId(tacInspYearBatchGroupParam.getId()); objParam.setProvince(tacInspYearBatchGroupParam.getProvince()); List objList = tacInspYearBatchObjDao.getObjAndType(objParam); String objs = ""; if (objList.size() > 0) { for (TacInspYearBatchObj obj : objList) { objs = objs + obj.getOjbNm() + ","; } if (areas.length() > 0) { objs = objs.substring(0, objs.length() - 1); } } //发送短信 String resultCode = sendMessageByGroup(smsWorkListByGroupId,sttm,entm, areas, objs); //定时任务24小时以后查看短信是否回复状态 // ReplyTimeout(tacInspYearBatchGroupParam); return resultCode; } /** * 排除特定专业后剩余专家是否选中 * * @param smsWorkListByGroupId * @return *//* boolean professionalCoverage(List smsWorkListByGroupId) { List getRoleTypes = new ArrayList<>(); for (TacInspYearBatchGroupPers tacInspYearBatchGroupPers : smsWorkListByGroupId) { if (StringUtils.isNotBlank(tacInspYearBatchGroupPers.getRoleType())) { getRoleTypes.add(tacInspYearBatchGroupPers.getRoleType()); } } if (getRoleTypes.size() > 0) { //排除非必选专业专家,与所分配专家对比。 //全部专业专家类型特派员:20; 助理:19; 前期专家:11 建管专家:12;计划专家:13;财务专家:14;质量专家:15;安全专家:16 List professions = Stream.of("11", "12", "13", "14", "15", "16", "19", "20").collect(Collectors.toList()); List filtrationMajors = Stream.of(filtrationMajor.split(",")).collect(Collectors.toList()); //去除非必选专业专家 List collect = professions.stream().filter(s -> filtrationMajors.stream().noneMatch(x -> x.contains(s))).collect(Collectors.toList()); for (String s : collect) { for (String major : getRoleTypes) { if (!major.contains(s)) { return false; } } } return true; } else { return false; } } */ String sendMessageByGroup(List smsWorkListByGroupId,String sttm,String entm, String areas, String objs) throws Exception { Map params = new HashMap(); params.put("apiKey", apiKey); params.put("apiSecrect", apiSecrect); params.put("signName", "金水云平台"); params.put("templeteCode", "SMS_210060995"); for (TacInspYearBatchGroupPers groupPers : smsWorkListByGroupId) { if ("1".equals(groupPers.getIsSms())) { continue; } if (StringUtils.isBlank(groupPers.getPhone())) { continue; } params.put("templateParam", "{\"year\":\"" + groupPers.getYear() + "\",\"batch\":\"" + groupPers.getBatch() + "\",\"groupNm\":\"" + groupPers.getGroupNm() + "\",\"sttm\":\"" + sttm + "\",\"entm\":\"" + entm + "\",\"area\":\"" + areas+ "\",\"objList\":\"" + objs + "\"}"); params.put("mobile", groupPers.getPhone()); logger.info("稽察通知短信发送前:" + groupPers.getPhone()); Map headerMap=new HashMap(); // String content = HttpClientUtils.doHttpsPost2(apiUrl + "/api/sms/send", params,headerMap); // String content ="{\"success\":true,\"code\":null,\"message\":null,\"path\":null,\"throwable\":null,\"data\":[{\"id\":\"a2397b8cc0464d03b5ac26c3ff1a2289\",\"phoneNumber\":\"17521189449\",\"content\":\"1\",\"sendTime\":1615200000000,\"destCode\":\"2478260\",\"sequenceId\":\"8.39577428E8\"}]}"; String content = HttpClientUtils.simplePostInvoke(apiUrl + "/gateway/api/sms/send", params); // String content="{\"success\":true,\"code\":null,\"message\":null,\"path\":null,\"throwable\":null,\"data\":{\"requestId\":\"42FC6AA4-D083-4393-BE55-30995E545BDF\",\"bizId\":\"831619709317356433^0\",\"code\":\"OK\",\"message\":\"OK\"},\"accessToken\":null}"; logger.info("稽察通知短信发送后:" + content); if(StringUtils.isNotBlank(content)){ JSONObject jsonContent = JSONObject.fromObject(content); if (jsonContent.get("success") != null && (Boolean) jsonContent.get("success")) { //修改专家是否已发短信,已通知。 groupPers.setIsSms("1"); groupPers.setIsNotice("1"); groupPers.setNoticeInfo("发送至:" + params.get("mobile") + "," + params.get("templateParam")); groupPers.setSendsmsTm(new Date()); groupPersDao.update(groupPers); } else { continue; } }else{ continue; } } return SmsCodeEnum.SUCCESS.getKey();//短信发送成功 } /*void ReplyTimeout(TacInspYearBatchGroupParam tacInspYearBatchGroupParam) { if (replyTimeout > 0) { //创建定时任务 Timer timer = new Timer("发送短信通知定时任务"); TimerTask task = new TimerTask() { @Override public void run() { System.out.println("短信定时任务开启"); if (StringUtils.isNotBlank(tacInspYearBatchGroupParam.getYearBatchId()) && StringUtils.isNotBlank(tacInspYearBatchGroupParam.getId())) { TacInspYearBatchGroupPersParam tacInspYearBatchGroupPersParam = new TacInspYearBatchGroupPersParam(); tacInspYearBatchGroupPersParam.setGroupId(tacInspYearBatchGroupParam.getId()); tacInspYearBatchGroupPersParam.setYearBatchId(tacInspYearBatchGroupParam.getYearBatchId()); List list = groupPersDao.findList(tacInspYearBatchGroupPersParam); if (list.size() > 0) { list.forEach(groupPers -> { if ("1".equals(groupPers.getIsNotice()) && "1".equals(groupPers.getIsSms())) { if ("0".equals(groupPers.getIsJoin()) || StringUtils.isBlank(groupPers.getIsJoin())) { TacInspYearBatchReason tacInspYearBatchReason = new TacInspYearBatchReason(); tacInspYearBatchReason.setId(UuidUtil.uuid()); tacInspYearBatchReason.setInTm(new Date()); tacInspYearBatchReason.setUpTm(new Date()); //回复超时 tacInspYearBatchReason.setNinReason("回复超时"); tacInspYearBatchReasonDao.insert(tacInspYearBatchReason); TacInspYearBatchGroupPersParam persParam = new TacInspYearBatchGroupPersParam(); persParam.setYearBatchId(groupPers.getYearBatchId()); persParam.setGroupId(groupPers.getId()); persParam.setPersId(groupPers.getPersId()); groupPersDao.deleteGroupPersInfo(groupPers); } } }); } } } }; timer.schedule(task, replyTimeout); } }*/ @Override public int confirmerGroup(TacInspYearBatchGroupParam tacInspYearBatchGroupParam) { int update = 0; TacInspYearBatchGroup tacInspYearBatchGroup = tacInspYearBatchGroupDao.get(tacInspYearBatchGroupParam.getId()); if (tacInspYearBatchGroup != null) { tacInspYearBatchGroup.setConfirmer("1"); update = tacInspYearBatchGroupDao.update(tacInspYearBatchGroup); return update; } return update; } }