|
@@ -1,8 +1,16 @@
|
|
|
package com.ruoyi.system.service.impl;
|
|
|
|
|
|
import java.util.List;
|
|
|
+
|
|
|
+import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
+import com.ruoyi.common.exception.ServiceException;
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
+import com.ruoyi.common.utils.SecurityUtils;
|
|
|
+import com.ruoyi.system.domain.ProposalInfo;
|
|
|
+import com.ruoyi.system.domain.ProposalUnitReply;
|
|
|
import com.ruoyi.system.domain.urge.ZxUrge;
|
|
|
+import com.ruoyi.system.mapper.ProposalInfoMapper;
|
|
|
+import com.ruoyi.system.mapper.ProposalUnitReplyMapper;
|
|
|
import com.ruoyi.system.mapper.ZxUrgeMapper;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -19,6 +27,10 @@ public class ZxUrgeServiceImpl implements IZxUrgeService
|
|
|
{
|
|
|
@Autowired
|
|
|
private ZxUrgeMapper zxUrgeMapper;
|
|
|
+ @Autowired
|
|
|
+ private ProposalInfoMapper proposalInfoMapper;
|
|
|
+ @Autowired
|
|
|
+ private ProposalUnitReplyMapper proposalUnitReplyMapper;
|
|
|
|
|
|
/**
|
|
|
* 查询政协催办
|
|
@@ -53,6 +65,29 @@ public class ZxUrgeServiceImpl implements IZxUrgeService
|
|
|
@Override
|
|
|
public int insertZxUrge(ZxUrge zxUrge)
|
|
|
{
|
|
|
+ SysUser user = SecurityUtils.getLoginUser().getUser();
|
|
|
+ //查询提案或者社情民意
|
|
|
+ if("1".equals(zxUrge.getUrgeType())){
|
|
|
+ //提案
|
|
|
+ ProposalInfo proposalInfo = proposalInfoMapper.selectProposalInfoByProposalId(zxUrge.getScoreId());
|
|
|
+ //查询主办单位
|
|
|
+ ProposalUnitReply proposalUnitReply = new ProposalUnitReply();
|
|
|
+ proposalUnitReply.setProposalId(zxUrge.getScoreId());
|
|
|
+ proposalUnitReply.setType("2");
|
|
|
+ List<ProposalUnitReply> proposalUnitReplies = proposalUnitReplyMapper.selectProposalUnitReplyList(proposalUnitReply);
|
|
|
+ if(proposalUnitReplies!=null && proposalUnitReplies.size()>0){
|
|
|
+ zxUrge.setAcceptDeptId(proposalUnitReplies.get(0).getDeptId());
|
|
|
+ zxUrge.setAcceptDept(proposalUnitReplies.get(0).getDeptName());
|
|
|
+ }else {
|
|
|
+ throw new ServiceException("当前提案未分配主办单位,催办失败!");
|
|
|
+ }
|
|
|
+ zxUrge.setUrgeTitle(proposalInfo.getTitle()+"的催办");
|
|
|
+ zxUrge.setIssuerId(user.getUserId());
|
|
|
+ zxUrge.setIssuer(user.getNickName());
|
|
|
+ }else{
|
|
|
+
|
|
|
+ }
|
|
|
+ zxUrge.setUrgeTime(DateUtils.getNowDate());
|
|
|
zxUrge.setCreateTime(DateUtils.getNowDate());
|
|
|
return zxUrgeMapper.insertZxUrge(zxUrge);
|
|
|
}
|