add 设定对接人的权限
This commit is contained in:
+10
@@ -27,8 +27,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.jero.meeting.vo.*;
|
import com.jero.meeting.vo.*;
|
||||||
import com.jero.meeting.vo.excel.*;
|
import com.jero.meeting.vo.excel.*;
|
||||||
|
import com.jero.project.common.PayProjectCommon;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import com.jero.common.system.base.controller.JeroController;
|
import com.jero.common.system.base.controller.JeroController;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
@@ -69,6 +71,14 @@ public class PayMeetingSituationController extends JeroController<PayMeetingSitu
|
|||||||
QueryWrapper<PayMeetingSituation> queryWrapper = QueryGenerator.initQueryWrapper(payMeetingSituation, req.getParameterMap());
|
QueryWrapper<PayMeetingSituation> queryWrapper = QueryGenerator.initQueryWrapper(payMeetingSituation, req.getParameterMap());
|
||||||
Page<PayMeetingSituation> page = new Page<>(pageNo, pageSize);
|
Page<PayMeetingSituation> page = new Page<>(pageNo, pageSize);
|
||||||
IPage<PayMeetingSituation> pageList = payMeetingSituationService.page(page, queryWrapper);
|
IPage<PayMeetingSituation> pageList = payMeetingSituationService.page(page, queryWrapper);
|
||||||
|
List<PayMeetingSituation> situationList = pageList.getRecords();
|
||||||
|
for (PayMeetingSituation meetingSituation : situationList) {
|
||||||
|
Integer payMode = meetingSituation.getPayMode();
|
||||||
|
//汇款并且缴费凭证为空
|
||||||
|
if (payMode.equals(1)&& StringUtils.isBlank(meetingSituation.getPaymentRecord())){
|
||||||
|
meetingSituation.setIdentification(PayProjectCommon.YES);
|
||||||
|
}
|
||||||
|
}
|
||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
@@ -383,4 +383,10 @@ public class PayMeetingSituation implements Serializable {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String invitationCode;
|
private String invitationCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参会未付款
|
||||||
|
*/
|
||||||
|
@Dict(dicCode = "yn")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer identification;
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-2
@@ -111,16 +111,18 @@
|
|||||||
<result column="dock_name" property="dockName"/>
|
<result column="dock_name" property="dockName"/>
|
||||||
<result column="check_result" property="checkResult"/>
|
<result column="check_result" property="checkResult"/>
|
||||||
<result column="invoice_amount" property="invoiceAmount"/>
|
<result column="invoice_amount" property="invoiceAmount"/>
|
||||||
|
<result column="director_name" property="directorName"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<select id="contractPage" resultMap="MeetingSituationContractVOMap">
|
<select id="contractPage" resultMap="MeetingSituationContractVOMap">
|
||||||
select pms.*,ps.meeting_name
|
select pms.*, ps.meeting_name, su.username as director_name
|
||||||
from pay_meeting_situation pms
|
from pay_meeting_situation pms
|
||||||
left join pay_meeting ps on pms.meeting_id = ps.id
|
left join pay_meeting ps on pms.meeting_id = ps.id
|
||||||
|
left join sys_user su on ps.director_id = su.id
|
||||||
left join pay_income_contract_associated pica on pica.project_id = pms.id
|
left join pay_income_contract_associated pica on pica.project_id = pms.id
|
||||||
<where>
|
<where>
|
||||||
pms.company_id = #{param.companyId}
|
pms.company_id = #{param.companyId}
|
||||||
<if test="param.meetingName != null and param.meetingName != ''">
|
<if test="param.meetingName != null and param.meetingName != ''">
|
||||||
and ps.meeting_name like concat('%',#{param.meetingName},'%')
|
and ps.meeting_name like concat('%', #{param.meetingName}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="param.particularYear != null and param.particularYear != ''">
|
<if test="param.particularYear != null and param.particularYear != ''">
|
||||||
and ps.particular_year = #{param.particularYear}
|
and ps.particular_year = #{param.particularYear}
|
||||||
|
|||||||
+34
-1
@@ -40,7 +40,9 @@ import com.jero.project.service.IPayWorkingGroupSubItemService;
|
|||||||
import com.jero.standards.memberinfo.service.IMemberInfoService;
|
import com.jero.standards.memberinfo.service.IMemberInfoService;
|
||||||
import com.jero.temporary.service.IPayCompanyManagementTemporaryService;
|
import com.jero.temporary.service.IPayCompanyManagementTemporaryService;
|
||||||
import com.jero.temporary.service.IPayContactsManagementTemporaryService;
|
import com.jero.temporary.service.IPayContactsManagementTemporaryService;
|
||||||
|
import com.jero.util.ObjRecordUtil;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.shiro.SecurityUtils;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -348,7 +350,6 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
|
|||||||
throw new JeroBootException("请上传缴费凭证后再签到");
|
throw new JeroBootException("请上传缴费凭证后再签到");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
meetingSituation.setCheckIn(PayProjectCommon.YES);
|
meetingSituation.setCheckIn(PayProjectCommon.YES);
|
||||||
saveOrUpdate(meetingSituation);
|
saveOrUpdate(meetingSituation);
|
||||||
}
|
}
|
||||||
@@ -365,13 +366,37 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void editById(PayMeetingSituationVO payMeetingSituationVO) {
|
public void editById(PayMeetingSituationVO payMeetingSituationVO) {
|
||||||
|
String meetingId = payMeetingSituationVO.getMeetingId();
|
||||||
|
PayMeeting payMeeting = meetingService.getById(meetingId);
|
||||||
|
String meetingType = payMeeting.getMeetingType().toString();
|
||||||
String id = payMeetingSituationVO.getId();
|
String id = payMeetingSituationVO.getId();
|
||||||
PayMeetingSituation payMeetingSituation = getById(id);
|
PayMeetingSituation payMeetingSituation = getById(id);
|
||||||
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
String sysUserId = sysUser.getId();
|
||||||
|
if (meetingType.equals(MeetingCommon.INTERNATIONAL_MEETING)){
|
||||||
|
//只有会议负责人,对接人,参会人可以修改
|
||||||
|
if (!payMeeting.getDirectorId().equals(sysUserId)&&!sysUserId.equals(payMeetingSituation.getCompanyContactId())&&!sysUserId.equals(payMeetingSituation.getDockId())) {
|
||||||
|
throw new JeroBootException("只有会议负责人,对接人,参会人可以修改");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
//只有会议负责人,参会人可以修改
|
||||||
|
if (!payMeeting.getDirectorId().equals(sysUserId)&&!sysUserId.equals(payMeetingSituation.getCompanyContactId())) {
|
||||||
|
throw new JeroBootException("只有会议负责人,参会人可以修改");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ObjectUtil.isNull(payMeetingSituation)) {
|
if (ObjectUtil.isNull(payMeetingSituation)) {
|
||||||
throw new JeroBootException("参会人错误!");
|
throw new JeroBootException("参会人错误!");
|
||||||
}
|
}
|
||||||
BeanUtils.copyProperties(payMeetingSituationVO, payMeetingSituation);
|
BeanUtils.copyProperties(payMeetingSituationVO, payMeetingSituation);
|
||||||
PayMeetingSituation payMeetingSituation1 = getPayMeetingSituation(payMeetingSituation);
|
PayMeetingSituation payMeetingSituation1 = getPayMeetingSituation(payMeetingSituation);
|
||||||
|
//如果是对接人修改的
|
||||||
|
if (sysUserId.equals(payMeetingSituation.getDockId())){
|
||||||
|
String record = ObjRecordUtil.addRecord(payMeetingSituation, payMeetingSituation1);
|
||||||
|
if (StringUtils.isNotBlank(record)){
|
||||||
|
//TODO 给负责人发送消息
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
saveOrUpdate(payMeetingSituation1);
|
saveOrUpdate(payMeetingSituation1);
|
||||||
}
|
}
|
||||||
@@ -597,6 +622,14 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
|
|||||||
*/
|
*/
|
||||||
private void removeSituationPack(String id) {
|
private void removeSituationPack(String id) {
|
||||||
PayMeetingSituation payMeetingSituation = getById(id);
|
PayMeetingSituation payMeetingSituation = getById(id);
|
||||||
|
String meetingId = payMeetingSituation.getMeetingId();
|
||||||
|
PayMeeting payMeeting = meetingService.getById(meetingId);
|
||||||
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
String sysUserId = sysUser.getId();
|
||||||
|
//只有会议负责人可以删除
|
||||||
|
if (!payMeeting.getDirectorId().equals(sysUserId)) {
|
||||||
|
throw new JeroBootException("只有会议负责人可以删除");
|
||||||
|
}
|
||||||
Integer inAccount = payMeetingSituation.getInAccount();
|
Integer inAccount = payMeetingSituation.getInAccount();
|
||||||
if (!inAccount.equals(PayProjectCommon.IN_ACCOUNT0)) {
|
if (!inAccount.equals(PayProjectCommon.IN_ACCOUNT0)) {
|
||||||
throw new JeroBootException(payMeetingSituation.getCompanyContactName() + " 参会人已经有到账,无法删除");
|
throw new JeroBootException(payMeetingSituation.getCompanyContactName() + " 参会人已经有到账,无法删除");
|
||||||
|
|||||||
+7
-2
@@ -53,9 +53,14 @@ public class MeetingSituationContractVO {
|
|||||||
@ApiModelProperty(value = "会议id")
|
@ApiModelProperty(value = "会议id")
|
||||||
@NotBlank(message = "会议项目不能为空")
|
@NotBlank(message = "会议项目不能为空")
|
||||||
private String meetingId;
|
private String meetingId;
|
||||||
|
/**
|
||||||
|
* 会议名称
|
||||||
|
*/
|
||||||
private String meetingName;
|
private String meetingName;
|
||||||
|
/**
|
||||||
|
* 负责人名称
|
||||||
|
*/
|
||||||
|
private String directorName;
|
||||||
/**企业id*/
|
/**企业id*/
|
||||||
@ApiModelProperty(value = "企业id")
|
@ApiModelProperty(value = "企业id")
|
||||||
@NotBlank(message = "企业名称不能为空")
|
@NotBlank(message = "企业名称不能为空")
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.jero.util;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 比对两个对象,输出变更字段
|
||||||
|
* @author liJiaRao
|
||||||
|
* @date 2021-09-22 17:05
|
||||||
|
*/
|
||||||
|
public class ObjRecordUtil {
|
||||||
|
/**
|
||||||
|
* @param oldObj 原数据对象
|
||||||
|
* @param newObj 修改后数据对象
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String addRecord(Object oldObj, Object newObj){
|
||||||
|
try {
|
||||||
|
// 得到类对象
|
||||||
|
Class<?> class1 = oldObj.getClass();
|
||||||
|
Class<?> class2 = newObj.getClass();
|
||||||
|
if(!class1.equals(class2)){
|
||||||
|
throw new RuntimeException("请传入两个相同的实体类对象");
|
||||||
|
}
|
||||||
|
// 得到属性集合
|
||||||
|
Field[] fields1 = class1.getDeclaredFields();
|
||||||
|
Field[] fields2 = class2.getDeclaredFields();
|
||||||
|
StringBuilder info = new StringBuilder();
|
||||||
|
Long id = null;
|
||||||
|
for (Field field1 : fields1) {
|
||||||
|
field1.setAccessible(true); // 设置属性是可以访问的(私有的也可以)
|
||||||
|
if(id == null && field1.getName().equals("id")){
|
||||||
|
id = (Long)field1.get(oldObj);
|
||||||
|
}
|
||||||
|
for (Field field2 : fields2) {
|
||||||
|
field2.setAccessible(true); // 设置属性是可以访问的(私有的也可以)
|
||||||
|
if(field1.equals(field2)){ // 比较属性名是否一样
|
||||||
|
if(field2.get(newObj) == null || StringUtils.isEmpty(field2.get(newObj) + "")){
|
||||||
|
break; // 属性名称一样就退出二级循环
|
||||||
|
}
|
||||||
|
if(!field1.get(oldObj).equals(field2.get(newObj))){ // 比较属性值是否一样
|
||||||
|
// 得到注解
|
||||||
|
ApiModelProperty pn = field1.getAnnotation(ApiModelProperty.class);
|
||||||
|
if(pn != null){
|
||||||
|
info.append(pn.value()).append(":\"").append(field1.get(oldObj)).append("\" 改成 \"").append(field2.get(newObj)).append("\",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break; // 属性名称一样就退出二级循环
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(info.length() != 0){
|
||||||
|
// 设置日志信息
|
||||||
|
return info.substring(0, info.length() - 1);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user