Merge branch 'uat' into 'master'

20220422发版

See merge request eshop/biz_service_ebtp_extend!82
This commit is contained in:
张芹彬
2022-04-22 17:27:05 +08:00
8 changed files with 54 additions and 10 deletions

View File

@ -13,7 +13,7 @@ public interface BizMessageMapper extends BaseMapper<BizMessage> {
IPage<BizMessage> findMessage(@Param("param") IPage<BizMessage> page, @Param("userId") String userId);
IPage<BizMessageVo> findMessageVo(@Param("param") IPage<BizMessageVo> page, @Param("userId") String userId);
IPage<BizMessageVo> findMessageVo(@Param("param") IPage<BizMessageVo> page, @Param("userId") String userId,@Param("templatecodes") List<String> templatecodes);
Boolean updateState(@Param("userId") String userId,@Param("messageId") String messageId);

View File

@ -23,16 +23,30 @@
FROM biz_message
left join biz_message_template on biz_message.templatecode = biz_message_template.code
WHERE authorize = 0
<if test="templatecodes!=null and templatecodes.size()>0 ">
and biz_message.templatecode in
<foreach item="item" collection="templatecodes" separator="," open="(" close=")" index="">
#{item, jdbcType=NUMERIC}
</foreach>
</if>
<if test="userId!=null and userId!=''">
UNION ALL
SELECT a.*,IFNULL(b.state,1) as authorizestate
FROM ( SELECT biz_message.*,biz_message_template.type as templatetype
FROM biz_message
left join biz_message_template on biz_message.templatecode = biz_message_template.code
WHERE authorize = 1) a
WHERE authorize = 1
<if test="templatecodes!=null and templatecodes.size()>0 ">
and biz_message.templatecode in
<foreach item="item" collection="templatecodes" separator="," open="(" close=")" index="">
#{item, jdbcType=NUMERIC}
</foreach>
</if>
) a
INNER JOIN
( SELECT * FROM biz_message_authorize WHERE user_id = #{userId}) b ON a.id = b.message_id
</if>
ORDER BY createtime DESC
</select>
@ -60,6 +74,12 @@
<if test="templatetype!=null and templatetype!=''">
and biz_message_template.type = #{templatetype}
</if>
<if test="templatecodes!=null and templatecodes.size()>0 ">
and biz_message.templatecode in
<foreach item="item" collection="templatecodes" separator="," open="(" close=")" index="">
#{item, jdbcType=NUMERIC}
</foreach>
</if>
ORDER BY createtime DESC
</select>

View File

@ -3,6 +3,8 @@ package com.chinaunicom.mall.ebtp.extend.bizmessage.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* 分页明细
*
@ -26,4 +28,7 @@ public class PageDTO {
this.pageSize = 15;
}
@ApiModelProperty(required = false, value = "指定消息类型,null 查全部")
private List<String> templatecodes;
}

View File

@ -1,7 +1,10 @@
package com.chinaunicom.mall.ebtp.extend.bizmessage.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class BizMessageVo extends BizMessage{
@ -11,4 +14,6 @@ public class BizMessageVo extends BizMessage{
private Long datanum;
private Integer size;
@ApiModelProperty(required = false, value = "指定消息类型,null 查全部")
private List<String> templatecodes;
}

View File

@ -42,9 +42,9 @@ public class BizMessageConsumerServiceImpl implements BizMessageConsumerService
@Override
public IBizMessagePage<DescribeSiteMsgVO> listOutline(PageDTO page) {
page = createPageCondition(page);
IPage<BizMessageVo> pageEntity = new Page<BizMessageVo>(page.getPageNo(), page.getPageSize());
IPage<BizMessageVo> pageEntity = mapper.findMessageVo(new Page<BizMessageVo>(page.getPageNo(), page.getPageSize()),
service.getCacheUser().getUserId());
pageEntity = mapper.findMessageVo(pageEntity,service.getCacheUser().getUserId(),page.getTemplatecodes());
// DAT -> VO 转换
IBizMessagePage<DescribeSiteMsgVO> result = new BizMessagePage<>();

View File

@ -10,6 +10,9 @@ 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;
import com.chinaunicom.mall.ebtp.common.exception.common.CommonExceptionEnum;
import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogBusinessModule;
import com.chinaunicom.mall.ebtp.common.log.enums.EbtpLogType;
import com.chinaunicom.mall.ebtp.common.log.service.OperationLogService;
import com.chinaunicom.mall.ebtp.common.uniBss.constant.UniBssConstant;
import com.chinaunicom.mall.ebtp.common.uniBss.entity.UniBss;
import com.chinaunicom.mall.ebtp.common.uniBss.entity.UniBssAttached;
@ -53,6 +56,9 @@ public class CrypConfigureServiceImpl extends BaseServiceImpl<CrypConfigureMappe
private @Autowired
IBaseCacheUserService service;
@Autowired
private OperationLogService operationLogService;
// 测试 PEM_PATH = "admin_certPrivateNew.pem" CRT_PATH = "adminNew.crt"
// 生产 PEM_PATH = "bidding_certPrivate.pem" CRT_PATH = "bidding.crt"
// 私钥文件路径 - 加密
@ -97,7 +103,8 @@ public class CrypConfigureServiceImpl extends BaseServiceImpl<CrypConfigureMappe
log.info("解密文件:" + CRT_PATH);
log.info("请求路径:" + bean.getUrl());
blockChainLog.setInterfaceUrl(bean.getUrl());
String json = "";
String str = "";
try {
Map<String, Object> map = JSONArray.parseObject(JSONArray.toJSONString(bean.getObject()), Map.class);
@ -106,10 +113,10 @@ public class CrypConfigureServiceImpl extends BaseServiceImpl<CrypConfigureMappe
map.put("SIGN", sign);
String json = getUniBss(bean.getReqName(), map);
json = getUniBss(bean.getReqName(), map);
blockChainLog.setParam(json);//请求参数
String str = UniBssServiceImpl.uniBssHttpPost(bean.getUrl(), json);
str = UniBssServiceImpl.uniBssHttpPost(bean.getUrl(), json);
blockChainLog.setResult(str);//返回参数
UniBss uniBssRsp = JSONArray.parseObject(str, UniBss.class);
if (uniBssRsp != null && UniBssConstant.RESP_CODE_00000.equals(uniBssRsp.getUniBssHead().getRespCode())) {
@ -132,9 +139,15 @@ public class CrypConfigureServiceImpl extends BaseServiceImpl<CrypConfigureMappe
} catch (Exception e) {
blockChainLog.setStatus(1);
blockChainLog.setResult(e.getMessage());
}finally {
if(blockChainLog.getStatus().equals(1)){
log.error("区块链调用失败!~-----------------");
operationLogService.addOperationLog("区块链同步失败信息,参数{}"+json+"返回信息{}"+str,false, EbtpLogBusinessModule.OTHER, EbtpLogType.INSERT);
}
}
this.iBlockChainLogService.save(blockChainLog);
//this.iBlockChainLogService.save(blockChainLog);
return false;
}

View File

@ -56,7 +56,7 @@ public class BizExportDict implements Serializable {
*
*/
@ApiModelProperty(value = "")
private Integer queryType;
private String queryType;
/**
* 使能0、不可用1、可用

View File

@ -9,6 +9,7 @@
<result column="path" jdbcType="VARCHAR" property="path"/>
<result column="level" jdbcType="VARCHAR" property="level"/>
<result column="url" jdbcType="VARCHAR" property="url"/>
<result column="query_type" jdbcType="VARCHAR" property="queryType"/>
<result column="active" jdbcType="VARCHAR" property="active"/>
<result column="method_dict" jdbcType="VARCHAR" property="methodDict"/>
</resultMap>
@ -22,7 +23,7 @@
</update>
<select id="selectDictList" parameterType="java.lang.String" resultMap="BaseResultMap">
SELECT `id`, `dic_name`, `path`, `level`, `url`
SELECT `id`, `dic_name`, `path`, `level`, `url`, `query_type`
FROM `biz_export_dict`
where active = 1 AND (method_dict = #{type} OR method_dict = '0')
ORDER BY id