Merge branch 'uat' into 'master'
Uat See merge request eshop/biz_service_ebtp_extend!73
This commit is contained in:
@ -1,11 +1,13 @@
|
||||
package com.chinaunicom.mall.ebtp.extend.bizmessage.controller;
|
||||
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.dto.BizMessageRawDTO;
|
||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.service.BizMessageProducerService;
|
||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.vo.DescribeSiteMsgDetailVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -13,6 +15,8 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Api(value = "创建消息", description = "创建消息")
|
||||
@RestController
|
||||
@ -37,4 +41,11 @@ public class BizMessageProducerController {
|
||||
}).orElseGet(DescribeSiteMsgDetailVO::new);
|
||||
}
|
||||
|
||||
@ApiOperation("删除信息.")
|
||||
@DeleteMapping
|
||||
@ResponseStatus(code = HttpStatus.OK)
|
||||
public BaseResponse<Map<String,Integer>> deleteMessageByCode(@ApiParam(value = "消息内容", required = true)@RequestParam("code") String code) {
|
||||
|
||||
return BaseResponse.success(service.deleteMessageByCode(code));
|
||||
}
|
||||
}
|
||||
|
@ -21,4 +21,9 @@ public interface BizMessageMapper extends BaseMapper<BizMessage> {
|
||||
|
||||
List<BizMessageAuthorize> findAuthorizeList(BizMessageAuthorize vo);
|
||||
|
||||
List<BizMessage> findMessageByLikeCode(String code);
|
||||
|
||||
Integer deleteMessageByServicecdoe(List<String> magIds);
|
||||
|
||||
Integer deleteAuthorizeByServicecdoe(List<String> magIds);
|
||||
}
|
||||
|
@ -80,4 +80,23 @@
|
||||
and state = #{state}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="findMessageByLikeCode" resultType="com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessage" parameterType="java.lang.String">
|
||||
select * from biz_message where servicecode like CONCAT('%"questId":"',#{code},'"%')
|
||||
</select>
|
||||
|
||||
<delete id="deleteMessageByServicecdoe" parameterType="List">
|
||||
delete from biz_message where id in
|
||||
<foreach item="id" collection="magIds" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAuthorizeByServicecdoe" parameterType="java.lang.String">
|
||||
delete from biz_message_authorize
|
||||
where message_id in
|
||||
<foreach item="id" collection="magIds" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -3,10 +3,12 @@ package com.chinaunicom.mall.ebtp.extend.bizmessage.service;
|
||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.dto.BizMessageRawDTO;
|
||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.entity.BizMessage;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface BizMessageProducerService {
|
||||
|
||||
Optional<BizMessage> produce(BizMessageRawDTO messageRaw);
|
||||
|
||||
Map<String,Integer> deleteMessageByCode(String questId);
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.chinaunicom.mall.ebtp.extend.bizmessage.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.Snowflake;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.dao.BizMessageAuthorizeMapper;
|
||||
import com.chinaunicom.mall.ebtp.extend.bizmessage.dao.BizMessageCategoryMapper;
|
||||
@ -25,8 +26,11 @@ import org.springframework.util.Assert;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 消息生产服务
|
||||
@ -159,4 +163,25 @@ public class BizMessageProducerServiceImpl implements BizMessageProducerService
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param questId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String,Integer> deleteMessageByCode(String questId) {
|
||||
List<BizMessage> messageList = messageMapper.findMessageByLikeCode(questId);
|
||||
log.info(" 删除查询结果 messageList: "+messageList);
|
||||
List<String> magIds = messageList.stream().map(BizMessage::getId).distinct().collect(Collectors.toList());
|
||||
Map<String,Integer> map = new HashMap<>();
|
||||
Integer m = new Integer(0);
|
||||
Integer a = new Integer(0);
|
||||
if(magIds!=null&&magIds.size()>0) {
|
||||
m = messageMapper.deleteMessageByServicecdoe(magIds);
|
||||
a = messageMapper.deleteAuthorizeByServicecdoe(magIds);
|
||||
}
|
||||
map.put("deleteMessage", m);
|
||||
map.put("deleteAuthorize", a);
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,70 @@
|
||||
package com.chinaunicom.mall.ebtp.extend.blockchain.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.chinaunicom.mall.ebtp.common.config.CustomLocalDateTimeTypeHandler;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 实体类 BlockChainLog
|
||||
*
|
||||
* @auto.generated
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class BlockChainLogVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty(value = "")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty(value = "")
|
||||
private String tpId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty(value = "")
|
||||
private String sectionId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty(value = "")
|
||||
private String assessRoomId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty(value = "")
|
||||
private String turnId;
|
||||
|
||||
/**
|
||||
* 0-成功 1-失败
|
||||
*/
|
||||
@ApiModelProperty(value = "0-成功 1-失败")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("开始时间")
|
||||
private String startTime;
|
||||
|
||||
@ApiModelProperty("结束时间")
|
||||
private String endTime;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.chinaunicom.mall.ebtp.extend.config;
|
||||
|
||||
import io.seata.core.context.RootContext;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* seata拦截器配置类 解除seata绑定
|
||||
*
|
||||
* @author fqj
|
||||
* @date 2022-01-13
|
||||
*/
|
||||
@Configuration
|
||||
public class SeataInterceptorConfig implements WebMvcConfigurer {
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
InterceptorRegistration interceptor = registry.addInterceptor(new HandlerInterceptor() {
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
if (!Objects.isNull(RootContext.getXID())) {
|
||||
RootContext.unbind();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
interceptor.addPathPatterns("/**");
|
||||
}
|
||||
}
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.chinaunicom.baas.util.AccessToken;
|
||||
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
|
||||
import com.chinaunicom.mall.ebtp.extend.blockchain.entity.BlockChainLogVo;
|
||||
import com.chinaunicom.mall.ebtp.extend.crypconfigure.entity.CrypBean;
|
||||
import com.chinaunicom.mall.ebtp.extend.crypconfigure.entity.CrypConfigure;
|
||||
import com.chinaunicom.mall.ebtp.extend.crypconfigure.service.ICrypConfigureService;
|
||||
@ -120,6 +121,18 @@ public class CrypConfigureController{
|
||||
return BaseResponse.success(this.iCrypConfigureService.callUniInterface(bean));
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载失败日志再发送
|
||||
*
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("加载失败日志再发送")
|
||||
@PostMapping("/errorLogsGoToCryp")
|
||||
public BaseResponse<Boolean> errorLogsGoToCryp(@RequestBody(required = false) BlockChainLogVo vo) {
|
||||
|
||||
return BaseResponse.success(this.iCrypConfigureService.errorLogsGoToCryp(vo));
|
||||
}
|
||||
/**
|
||||
* 区块链数据加密
|
||||
*
|
||||
|
@ -2,6 +2,7 @@ package com.chinaunicom.mall.ebtp.extend.crypconfigure.service;
|
||||
|
||||
|
||||
import com.chinaunicom.mall.ebtp.common.base.service.IBaseService;
|
||||
import com.chinaunicom.mall.ebtp.extend.blockchain.entity.BlockChainLogVo;
|
||||
import com.chinaunicom.mall.ebtp.extend.crypconfigure.entity.CrypBean;
|
||||
import com.chinaunicom.mall.ebtp.extend.crypconfigure.entity.CrypConfigure;
|
||||
|
||||
@ -17,7 +18,12 @@ public interface ICrypConfigureService extends IBaseService<CrypConfigure> {
|
||||
* @return
|
||||
*/
|
||||
Boolean callUniInterface(CrypBean bean);
|
||||
|
||||
/**
|
||||
* 加载失败日志再发送
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
Boolean errorLogsGoToCryp(BlockChainLogVo vo);
|
||||
/**
|
||||
* 加密
|
||||
* @param object
|
||||
|
@ -1,8 +1,12 @@
|
||||
package com.chinaunicom.mall.ebtp.extend.crypconfigure.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.chinaunicom.baas.util.AccessToken;
|
||||
import com.chinaunicom.mall.ebtp.common.base.service.IBaseCacheUserService;
|
||||
import com.chinaunicom.mall.ebtp.common.base.service.impl.BaseServiceImpl;
|
||||
@ -14,6 +18,7 @@ import com.chinaunicom.mall.ebtp.common.uniBss.entity.*;
|
||||
import com.chinaunicom.mall.ebtp.common.uniBss.service.UniBssServiceImpl;
|
||||
import com.chinaunicom.mall.ebtp.common.util.PropertyUtils;
|
||||
import com.chinaunicom.mall.ebtp.extend.blockchain.entity.BlockChainLog;
|
||||
import com.chinaunicom.mall.ebtp.extend.blockchain.entity.BlockChainLogVo;
|
||||
import com.chinaunicom.mall.ebtp.extend.blockchain.service.IBlockChainLogService;
|
||||
import com.chinaunicom.mall.ebtp.extend.crypconfigure.dao.CrypConfigureMapper;
|
||||
import com.chinaunicom.mall.ebtp.extend.crypconfigure.entity.CrypBean;
|
||||
@ -24,6 +29,7 @@ import org.apache.commons.io.IOUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.InputStream;
|
||||
@ -132,6 +138,82 @@ public class CrypConfigureServiceImpl extends BaseServiceImpl<CrypConfigureMappe
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载失败日志再发送
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean errorLogsGoToCryp(BlockChainLogVo vo){
|
||||
log.info("区块链------callUniInterface:---入参-----"+JSON.toJSONString(vo));
|
||||
if(vo.getStatus()==null||"".equals(vo.getStatus())){
|
||||
vo.setStatus(1);//默认失败
|
||||
}
|
||||
SimpleDateFormat dateFormate = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String date = dateFormate.format(new Date());
|
||||
if(vo.getStartTime()==null||"".equals(vo.getStartTime())){
|
||||
vo.setStartTime(date+" 00:00:00");//默认当天00000
|
||||
}
|
||||
if(vo.getEndTime()==null||"".equals(vo.getEndTime())){
|
||||
vo.setEndTime(date+" 23:59:59");//默认当天235959
|
||||
}
|
||||
|
||||
BlockChainLog blog = BeanUtil.toBean(vo,BlockChainLog.class);
|
||||
|
||||
LambdaQueryWrapper<BlockChainLog> query = Wrappers.lambdaQuery(blog);
|
||||
//状态
|
||||
if(vo.getStatus()!=null&&!"".equals(vo.getStatus())){
|
||||
query.eq(BlockChainLog::getStatus,vo.getStatus());
|
||||
}
|
||||
//时间
|
||||
if(vo.getStartTime()!=null&&!"".equals(vo.getStartTime())){
|
||||
query.ge(BlockChainLog::getCreateDate,vo.getStartTime());
|
||||
}
|
||||
if(vo.getEndTime()!=null&&!"".equals(vo.getEndTime())){
|
||||
query.le(BlockChainLog::getCreateDate,vo.getEndTime());
|
||||
}
|
||||
|
||||
List<BlockChainLog> logList = this.iBlockChainLogService.list(query);
|
||||
|
||||
logList.forEach(blockChainLog->{
|
||||
log.info("请求路径:"+blockChainLog.getInterfaceUrl());
|
||||
|
||||
try {
|
||||
|
||||
String json = blockChainLog.getParam();
|
||||
|
||||
//blockChainLog.setParam(json);//请求参数
|
||||
String str = UniBssServiceImpl.uniBssHttpPost(blockChainLog.getInterfaceUrl(), json);
|
||||
blockChainLog.setResult(str);//返回参数
|
||||
UniBss uniBssRsp = JSONArray.parseObject(str, UniBss.class);
|
||||
if (uniBssRsp != null && UniBssConstant.RESP_CODE_00000.equals(uniBssRsp.getUniBssHead().getRespCode())) {
|
||||
System.out.println("返回接口:"+uniBssRsp);
|
||||
|
||||
if(str!=null&&!"".equals(str)&&str.indexOf("_RSP\":{\"Code\":200,")>=0){
|
||||
blockChainLog.setStatus(0);//成功
|
||||
this.iBlockChainLogService.saveOrUpdate(blockChainLog);
|
||||
|
||||
}else{
|
||||
blockChainLog.setStatus(1);//失败
|
||||
}
|
||||
} else {
|
||||
blockChainLog.setStatus(1);//失败
|
||||
log.error("天擎接口调用错误," +
|
||||
"RESP_CODE:" + uniBssRsp.getUniBssHead().getRespCode() + "" +
|
||||
"(" + UniBssConstant.getRESP_CODE_Map(uniBssRsp.getUniBssHead().getRespCode()) + ")。" +
|
||||
"RESP_DESC:" + uniBssRsp.getUniBssHead().getRespDesc());
|
||||
}
|
||||
}catch (Exception e){
|
||||
blockChainLog.setStatus(1);
|
||||
blockChainLog.setResult(e.getMessage());
|
||||
}
|
||||
|
||||
this.iBlockChainLogService.saveOrUpdate(blockChainLog);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加密
|
||||
* @param object
|
||||
|
@ -23,10 +23,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -125,9 +122,7 @@ public class ReviewReportImpl implements ExportService {
|
||||
|
||||
for (int i = 0; i < registerList.size(); i++) {
|
||||
Map<String, Object> map = new HashMap<>(16);
|
||||
int num = i + 1;
|
||||
BizSupplierRegister register = registerList.get(i);
|
||||
map.put("num", num);
|
||||
map.put("id", register.getCompanyId());
|
||||
map.put("tbr", register.getCompanyName());
|
||||
list3.add(map);
|
||||
@ -154,8 +149,8 @@ public class ReviewReportImpl implements ExportService {
|
||||
|
||||
|
||||
//表五 价格评审数据 投标人,投标价,评审价格,价格得分
|
||||
map.put("bj", detail.getPrice() == null ? BigDecimal.ZERO : detail.getPrice());
|
||||
map.put("psjg", detail.getPriceReview() == null ? BigDecimal.ZERO : detail.getPriceReview());
|
||||
map.put("bj", detail.getPrice() == null ? BigDecimal.ZERO : detail.getPrice().stripTrailingZeros().toPlainString());
|
||||
map.put("psjg", detail.getPriceReview() == null ? BigDecimal.ZERO : detail.getPriceReview().stripTrailingZeros().toPlainString());
|
||||
map.put("jgdf", StrUtil.isNotBlank(detail.getPriceScore()) ? detail.getPriceScore() : "");
|
||||
|
||||
|
||||
@ -167,10 +162,27 @@ public class ReviewReportImpl implements ExportService {
|
||||
|
||||
String finalZbfs = zbfs;
|
||||
String finalPbwyhzz = pbwyhzz;
|
||||
List<Map<String, Object>> sortList3 = list3.stream().sorted(Comparator.comparing(m -> {
|
||||
Map<String, Object> m1 = (Map<String, Object>) m;
|
||||
return String.valueOf(m1.get("jgdf"));
|
||||
}).reversed()).collect(Collectors.toList());
|
||||
for (int i = 0; i < sortList3.size(); i++) {
|
||||
int num = i + 1;
|
||||
sortList3.get(i).put("num", num);
|
||||
}
|
||||
List<Map<String, Object>> list4 = list3.stream().sorted(Comparator.comparing(m -> {
|
||||
Map<String, Object> m1 = (Map<String, Object>) m;
|
||||
return String.valueOf(m1.get("zhdf"));
|
||||
}).reversed()).collect(Collectors.toList());
|
||||
for (int i = 0; i < list4.size(); i++) {
|
||||
int num = i + 1;
|
||||
list4.get(i).put("num", num);
|
||||
}
|
||||
Map<String, Object> all = new HashMap<String, Object>() {{
|
||||
put("table1", list1);
|
||||
put("table2", list2);
|
||||
put("table3", list3);
|
||||
put("table3", sortList3);
|
||||
put("table4", list4);
|
||||
put("zbdljg", project.getTenderAgencyName());
|
||||
put("zbbh", project.getEbpProjectNumber());
|
||||
put("zbfs", finalZbfs);
|
||||
@ -184,6 +196,7 @@ public class ReviewReportImpl implements ExportService {
|
||||
.bind("table1", policy)
|
||||
.bind("table2", policy)
|
||||
.bind("table3", policy)
|
||||
.bind("table4", policy)
|
||||
.build();
|
||||
|
||||
|
||||
|
Binary file not shown.
Reference in New Issue
Block a user