add 对接人编辑时取得修改的内容
This commit is contained in:
+2
-9
@@ -378,18 +378,11 @@ public class PayMeetingController extends JeroController<PayMeeting, IPayMeeting
|
||||
int length = fileUrl.length;
|
||||
ossFile.setFileName(fileUrl[length - 1]);
|
||||
}
|
||||
Map<String, String> stringStringMap = AuthenticationUtils.encryptByRsaPriKey();
|
||||
String publicKey = stringStringMap.get("publicKey");
|
||||
String token = stringStringMap.get("token");
|
||||
String jsonString1 = JSONObject.toJSONString(ossFiles);
|
||||
String post = HttpUtil.post(AuthenticationUtils.URL + "/stablecrosstraining/stableCrossTraining/addStandardsFile?publicKey=" + publicKey + "&token=" + token, jsonString1);
|
||||
AuthenticationUtils.checkResult(post);
|
||||
AuthenticationUtils.post("/stablecrosstraining/stableCrossTraining/addStandardsFile",null,ossFiles);
|
||||
StableCrossTraining stableCrossTraining = new StableCrossTraining();
|
||||
stableCrossTraining.setId(id);
|
||||
stableCrossTraining.setMeetingFiles(fileIds);
|
||||
String jsonString = JSONObject.toJSONString(stableCrossTraining);
|
||||
String post1 = HttpUtil.post(AuthenticationUtils.URL + "/stablecrosstraining/stableCrossTraining/updateStandardsFile?publicKey=" + publicKey + "&token=" + token, jsonString);
|
||||
AuthenticationUtils.checkResult(post1);
|
||||
AuthenticationUtils.post("/stablecrosstraining/stableCrossTraining/updateStandardsFile",null,stableCrossTraining);
|
||||
}
|
||||
return Result.OK("上传资料成功!");
|
||||
}
|
||||
|
||||
+2
-2
@@ -131,12 +131,12 @@ public class PayMeetingSituation implements Serializable {
|
||||
private String speechTopic;
|
||||
|
||||
/**演讲ppt*/
|
||||
@ApiModelProperty(value = "演讲ppt")
|
||||
@ApiModelProperty(value = "演讲ppt文件")
|
||||
//@NotBlank(message = "演讲ppt不能为空",groups = Guest.class)
|
||||
private String speechPpt;
|
||||
|
||||
/**照片*/
|
||||
@ApiModelProperty(value = "照片")
|
||||
@ApiModelProperty(value = "照片文件")
|
||||
private String photo;
|
||||
|
||||
/**个人简介*/
|
||||
|
||||
+10
-2
@@ -368,7 +368,11 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
|
||||
PayMeeting payMeeting = meetingService.getById(meetingId);
|
||||
String meetingType = payMeeting.getMeetingType().toString();
|
||||
String id = payMeetingSituationVO.getId();
|
||||
PayMeetingSituation payMeetingSituation = getById(id);
|
||||
PayMeetingSituation payMeetingSituation = this.getById(id);
|
||||
//把原始数据保存下来,后面用于判断修改了那些字段
|
||||
PayMeetingSituation oldObject = new PayMeetingSituation();
|
||||
BeanUtils.copyProperties(payMeetingSituation, oldObject);
|
||||
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String sysUserId = sysUser.getId();
|
||||
if (meetingType.equals(MeetingCommon.INTERNATIONAL_MEETING)){
|
||||
@@ -390,7 +394,8 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
|
||||
PayMeetingSituation payMeetingSituation1 = getPayMeetingSituation(payMeetingSituation);
|
||||
//如果是对接人修改的
|
||||
if (sysUserId.equals(payMeetingSituation.getDockId())){
|
||||
String record = ObjRecordUtil.addRecord(payMeetingSituation, payMeetingSituation1);
|
||||
//判断修改了那些字段
|
||||
String record = ObjRecordUtil.addRecord(oldObject, payMeetingSituation1);
|
||||
if (StringUtils.isNotBlank(record)){
|
||||
//TODO 给负责人发送消息
|
||||
}
|
||||
@@ -580,6 +585,9 @@ public class PayMeetingSituationServiceImpl extends ServiceImpl<PayMeetingSituat
|
||||
LambdaQueryWrapper<PayMeetingSituation> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(PayMeetingSituation::getMeetingId, meetingId);
|
||||
wrapper.eq(PayMeetingSituation::getCompanyContactId, contactsManagementId);
|
||||
if (StringUtils.isNotBlank(payMeetingSituation.getId())){
|
||||
wrapper.ne(PayMeetingSituation::getId,payMeetingSituation.getId());
|
||||
}
|
||||
if ((count(wrapper) > 0)) {
|
||||
throw new JeroBootException("联系人不能多次参加相同会议");
|
||||
}
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
package com.jero.util;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.util.SpringContextUtils;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 比对两个对象,输出变更字段
|
||||
*
|
||||
* @author liJiaRao
|
||||
* @date 2021-09-22 17:05
|
||||
*/
|
||||
@@ -16,42 +25,65 @@ public class ObjRecordUtil {
|
||||
* @param newObj 修改后数据对象
|
||||
* @return
|
||||
*/
|
||||
public static String addRecord(Object oldObj, Object newObj){
|
||||
public static String addRecord(Object oldObj, Object newObj) {
|
||||
try {
|
||||
// 得到类对象
|
||||
Class<?> class1 = oldObj.getClass();
|
||||
Class<?> class2 = newObj.getClass();
|
||||
if(!class1.equals(class2)){
|
||||
if (!class1.equals(class2)) {
|
||||
throw new RuntimeException("请传入两个相同的实体类对象");
|
||||
}
|
||||
// 得到属性集合
|
||||
Field[] fields1 = class1.getDeclaredFields();
|
||||
Field[] fields2 = class2.getDeclaredFields();
|
||||
StringBuilder info = new StringBuilder();
|
||||
Long id = null;
|
||||
String id = null;
|
||||
for (Field field1 : fields1) {
|
||||
field1.setAccessible(true); // 设置属性是可以访问的(私有的也可以)
|
||||
if(id == null && field1.getName().equals("id")){
|
||||
id = (Long)field1.get(oldObj);
|
||||
if (id == null && field1.getName().equals("id")) {
|
||||
id = (String) field1.get(oldObj);
|
||||
}
|
||||
for (Field field2 : fields2) {
|
||||
field2.setAccessible(true); // 设置属性是可以访问的(私有的也可以)
|
||||
if(field1.equals(field2)){ // 比较属性名是否一样
|
||||
if(field2.get(newObj) == null || StringUtils.isEmpty(field2.get(newObj) + "")){
|
||||
if (field1.equals(field2)) { // 比较属性名是否一样
|
||||
if (field2.get(newObj) == null || StringUtils.isEmpty(field2.get(newObj) + "")) {
|
||||
break; // 属性名称一样就退出二级循环
|
||||
}
|
||||
if(!field1.get(oldObj).equals(field2.get(newObj))){ // 比较属性值是否一样
|
||||
if (!Objects.equals(field1.get(oldObj), 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("\",");
|
||||
Dict dict = field1.getAnnotation(Dict.class);
|
||||
if (pn != null) {
|
||||
Object old = field1.get(oldObj);
|
||||
Object newo = field2.get(newObj);
|
||||
if (pn.value().contains("id")) {
|
||||
break;
|
||||
} else if (pn.value().contains("文件")) {
|
||||
info.append(pn.value()).append("修改了,");
|
||||
|
||||
} else if (pn.value().contains("时间")) {
|
||||
DateTimeFormat dateTimeFormat = field1.getAnnotation(DateTimeFormat.class);
|
||||
String pattern = dateTimeFormat.pattern();
|
||||
old = DateUtil.format((Date) old, pattern);
|
||||
newo = DateUtil.format((Date) newo, pattern);
|
||||
info.append(pn.value()).append(":\"").append(old).append("\" 改成 \"").append(newo).append("\",");
|
||||
|
||||
} else if (dict != null) {
|
||||
String dicCode = dict.dicCode();
|
||||
ISysBaseAPI sysBaseAPI = SpringContextUtils.getBean(ISysBaseAPI.class);
|
||||
old = sysBaseAPI.translateDict(dicCode, String.valueOf(old));
|
||||
newo = sysBaseAPI.translateDict(dicCode, String.valueOf(newo));
|
||||
info.append(pn.value()).append(":\"").append(old).append("\" 改成 \"").append(newo).append("\",");
|
||||
} else {
|
||||
info.append(pn.value()).append(":\"").append(old).append("\" 改成 \"").append(newo).append("\",");
|
||||
}
|
||||
}
|
||||
}
|
||||
break; // 属性名称一样就退出二级循环
|
||||
}
|
||||
}
|
||||
}
|
||||
if(info.length() != 0){
|
||||
if (info.length() != 0) {
|
||||
// 设置日志信息
|
||||
return info.substring(0, info.length() - 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user