Commit 4694fb69 authored by hongguangwu's avatar hongguangwu

MVP1.7.12-保存档案

parent a68aad20
......@@ -17,25 +17,19 @@
package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.alibaba.fastjson.JSON;
import com.yifu.cloud.plus.v1.yifu.archives.config.GzConfig;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzOfferInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.TGzOfferInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.utils.GZSign;
import com.yifu.cloud.plus.v1.yifu.archives.utils.ReturnGz;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
......@@ -76,35 +70,27 @@ public class TGzController {
params.put("requestId", requestId);
params.put("appkey", appkey);
params.put("nonce", nonce);
// TODO - 真实使用时,请去除error日志
log.error("瓜子推送offer信息,gzOfferInfo=" + JSON.toJSONString(gzOfferInfo));
log.error("瓜子推送offer信息,params=" + JSON.toJSONString(params));
// 2. 计算期望的签名
String expectedSignature = GZSign.getSignature(params, gzConfig.getAppsecret());
log.error("瓜子推送offer信息,expectedSignature=" + expectedSignature);
// 3. 比较签名是否一致
if (!params.get("signature").equals(expectedSignature)) {
return ReturnGz.failed("签名验证失败");
}
log.error("签名验证通过,expectedSignature=" + expectedSignature);
// 5. 签名验证通过,处理业务逻辑
return this.saveData(gzOfferInfo);
}
/**
* 处理推送的业务数据
*
* @return 处理结果
*/
private ReturnGz<String> saveData(TGzOfferInfo tGzOfferInfo) {
//TGzOfferInfo tGzOfferInfo = new TGzOfferInfo();
// 这里实现你的业务逻辑
// 例如:解析参数、保存数据、触发后续处理等
tGzOfferInfo.setCreateBy("3");
tGzOfferInfo.setCreateName("瓜子推送");
tGzOfferInfo.setCreateTime(LocalDateTime.now());
/*tGzOfferInfo.setBizId(String.valueOf(params.get("bizId")));
tGzOfferInfo.setNationalId(String.valueOf(params.get("nationalId")));
tGzOfferInfo.setName(String.valueOf(params.get("name")));*/
tGzOfferInfoService.save(tGzOfferInfo);
return ReturnGz.ok();
}
......@@ -128,7 +114,7 @@ public class TGzController {
params.remove("startTime", startTime);
params.remove("endTime", endTime);
String sortedParams = GZSign.getEncodeString(params);
sortedParams += "&startTime="+startTime+"&endTime="+endTime;
sortedParams += "&startTime=" + startTime + "&endTime=" + endTime;
return gzConfig.getGzBankInfo(restTemplate, sortedParams);
}
......
......@@ -805,6 +805,28 @@ public class TGzEmpInfoServiceImpl extends ServiceImpl<TGzEmpInfoMapper, TGzEmpI
}
tEmpContactInfoService.saveOrUpdate(info);
}
// 附件
List<TAttaInfo> attaList = attaInfoService.getTAttaInfoListByDoMainId(gzEmpId);
if (attaList != null) {
// 先删除其他信息
attaInfoService.deleteByDomainIdAndOther(empId);
TAttaInfo attaEmp;
List<TAttaInfo> attaEmpList = new ArrayList<>();
String idStr = "id";
for (TAttaInfo atta : attaList) {
attaEmp = new TAttaInfo();
BeanUtil.copyProperties(atta, attaEmp, idStr);
if (Common.isEmpty(attaEmp.getAttaName())) {
attaEmp.setAttaName(CommonConstants.CENTER_SPLIT_LINE_STRING);
}
attaEmp.setDomainId(empId);
attaEmp.setCreateBy(user.getId());
attaEmp.setCreateName(user.getNickname());
attaEmp.setCreateTime(LocalDateTime.now());
attaEmpList.add(attaEmp);
}
attaInfoService.saveBatch(attaEmpList);
}
return R.ok();
}
......
......@@ -1147,7 +1147,7 @@ public class ExcelUtil <T> implements Serializable {
/**
* @param clazz 类
* @param nameDicMap 需要翻译的属性
* @param nameDictMap 需要翻译的属性
* @param redisLabelMap 字典MAP,这里传进来,额外加上固定需要翻译的值
* @Description: 组装需要翻译的map,并且组装固定的值的map
* @Author: hgw
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment