mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
Merge branch 'dev' of http://192.168.2.2:8099/jsowell/jsowell-charger-web into dev
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
package com.jsowell.web.controller.pile;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.jsowell.common.annotation.Log;
|
||||
import com.jsowell.common.core.controller.BaseController;
|
||||
import com.jsowell.common.core.domain.AjaxResult;
|
||||
import com.jsowell.common.enums.BusinessType;
|
||||
import com.jsowell.pile.domain.DockingPlatformConfig;
|
||||
import com.jsowell.pile.service.IDockingPlatformConfigService;
|
||||
import com.jsowell.common.util.poi.ExcelUtil;
|
||||
import com.jsowell.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 对接平台配置信息Controller
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2023-05-27
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/pile/config")
|
||||
public class DockingPlatformConfigController extends BaseController {
|
||||
@Autowired
|
||||
private IDockingPlatformConfigService dockingPlatformConfigService;
|
||||
|
||||
/**
|
||||
* 查询对接平台配置信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pile:config:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DockingPlatformConfig dockingPlatformConfig) {
|
||||
startPage();
|
||||
List<DockingPlatformConfig> list = dockingPlatformConfigService.selectDockingPlatformConfigList(dockingPlatformConfig);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出对接平台配置信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pile:config:export')")
|
||||
@Log(title = "对接平台配置信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DockingPlatformConfig dockingPlatformConfig) {
|
||||
List<DockingPlatformConfig> list = dockingPlatformConfigService.selectDockingPlatformConfigList(dockingPlatformConfig);
|
||||
ExcelUtil<DockingPlatformConfig> util = new ExcelUtil<DockingPlatformConfig>(DockingPlatformConfig.class);
|
||||
util.exportExcel(response, list, "对接平台配置信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取对接平台配置信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pile:config:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Integer id) {
|
||||
return AjaxResult.success(dockingPlatformConfigService.selectDockingPlatformConfigById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增对接平台配置信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pile:config:add')")
|
||||
@Log(title = "对接平台配置信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DockingPlatformConfig dockingPlatformConfig) {
|
||||
return toAjax(dockingPlatformConfigService.insertDockingPlatformConfig(dockingPlatformConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改对接平台配置信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pile:config:edit')")
|
||||
@Log(title = "对接平台配置信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DockingPlatformConfig dockingPlatformConfig) {
|
||||
return toAjax(dockingPlatformConfigService.updateDockingPlatformConfig(dockingPlatformConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除对接平台配置信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pile:config:remove')")
|
||||
@Log(title = "对接平台配置信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Integer[] ids) {
|
||||
return toAjax(dockingPlatformConfigService.deleteDockingPlatformConfigByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.jsowell.pile.domain;
|
||||
|
||||
import com.jsowell.common.annotation.Excel;
|
||||
import com.jsowell.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 对接平台配置信息对象 docking_platform_config
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2023-05-27
|
||||
*/
|
||||
public class DockingPlatformConfig extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Integer id;
|
||||
|
||||
/** 对接平台名称 */
|
||||
@Excel(name = "对接平台名称")
|
||||
private String name;
|
||||
|
||||
/** 运营商id */
|
||||
@Excel(name = "运营商id")
|
||||
private String operatorId;
|
||||
|
||||
/** 运营商密钥 */
|
||||
@Excel(name = "运营商密钥")
|
||||
private String operatorSecret;
|
||||
|
||||
/** 签名密钥 */
|
||||
@Excel(name = "签名密钥")
|
||||
private String signSecret;
|
||||
|
||||
/** 消息密钥 */
|
||||
@Excel(name = "消息密钥")
|
||||
private String dataSecret;
|
||||
|
||||
/** 消息密钥初始化向量 */
|
||||
@Excel(name = "消息密钥初始化向量")
|
||||
private String dataSecretIv;
|
||||
|
||||
/** 删除标识 */
|
||||
private String delFlag;
|
||||
|
||||
public void setId(Integer id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setOperatorId(String operatorId)
|
||||
{
|
||||
this.operatorId = operatorId;
|
||||
}
|
||||
|
||||
public String getOperatorId()
|
||||
{
|
||||
return operatorId;
|
||||
}
|
||||
public void setOperatorSecret(String operatorSecret)
|
||||
{
|
||||
this.operatorSecret = operatorSecret;
|
||||
}
|
||||
|
||||
public String getOperatorSecret()
|
||||
{
|
||||
return operatorSecret;
|
||||
}
|
||||
public void setSignSecret(String signSecret)
|
||||
{
|
||||
this.signSecret = signSecret;
|
||||
}
|
||||
|
||||
public String getSignSecret()
|
||||
{
|
||||
return signSecret;
|
||||
}
|
||||
public void setDataSecret(String dataSecret)
|
||||
{
|
||||
this.dataSecret = dataSecret;
|
||||
}
|
||||
|
||||
public String getDataSecret()
|
||||
{
|
||||
return dataSecret;
|
||||
}
|
||||
public void setDataSecretIv(String dataSecretIv)
|
||||
{
|
||||
this.dataSecretIv = dataSecretIv;
|
||||
}
|
||||
|
||||
public String getDataSecretIv()
|
||||
{
|
||||
return dataSecretIv;
|
||||
}
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.JSON_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("operatorId", getOperatorId())
|
||||
.append("operatorSecret", getOperatorSecret())
|
||||
.append("signSecret", getSignSecret())
|
||||
.append("dataSecret", getDataSecret())
|
||||
.append("dataSecretIv", getDataSecretIv())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("delFlag", getDelFlag())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.jsowell.pile.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.jsowell.pile.domain.DockingPlatformConfig;
|
||||
|
||||
/**
|
||||
* 对接平台配置信息Mapper接口
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2023-05-27
|
||||
*/
|
||||
public interface DockingPlatformConfigMapper
|
||||
{
|
||||
/**
|
||||
* 查询对接平台配置信息
|
||||
*
|
||||
* @param id 对接平台配置信息主键
|
||||
* @return 对接平台配置信息
|
||||
*/
|
||||
public DockingPlatformConfig selectDockingPlatformConfigById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询对接平台配置信息列表
|
||||
*
|
||||
* @param dockingPlatformConfig 对接平台配置信息
|
||||
* @return 对接平台配置信息集合
|
||||
*/
|
||||
public List<DockingPlatformConfig> selectDockingPlatformConfigList(DockingPlatformConfig dockingPlatformConfig);
|
||||
|
||||
/**
|
||||
* 新增对接平台配置信息
|
||||
*
|
||||
* @param dockingPlatformConfig 对接平台配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDockingPlatformConfig(DockingPlatformConfig dockingPlatformConfig);
|
||||
|
||||
/**
|
||||
* 修改对接平台配置信息
|
||||
*
|
||||
* @param dockingPlatformConfig 对接平台配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDockingPlatformConfig(DockingPlatformConfig dockingPlatformConfig);
|
||||
|
||||
/**
|
||||
* 删除对接平台配置信息
|
||||
*
|
||||
* @param id 对接平台配置信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDockingPlatformConfigById(Integer id);
|
||||
|
||||
/**
|
||||
* 批量删除对接平台配置信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDockingPlatformConfigByIds(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 通过operatorId查询配置信息
|
||||
* @param operatorId
|
||||
* @return
|
||||
*/
|
||||
DockingPlatformConfig getInfoByOperatorId(String operatorId);
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.jsowell.pile.domain.DockingPlatformConfig;
|
||||
|
||||
/**
|
||||
* 对接平台配置信息Service接口
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2023-05-27
|
||||
*/
|
||||
public interface IDockingPlatformConfigService
|
||||
{
|
||||
/**
|
||||
* 查询对接平台配置信息
|
||||
*
|
||||
* @param id 对接平台配置信息主键
|
||||
* @return 对接平台配置信息
|
||||
*/
|
||||
public DockingPlatformConfig selectDockingPlatformConfigById(Integer id);
|
||||
|
||||
/**
|
||||
* 查询对接平台配置信息列表
|
||||
*
|
||||
* @param dockingPlatformConfig 对接平台配置信息
|
||||
* @return 对接平台配置信息集合
|
||||
*/
|
||||
public List<DockingPlatformConfig> selectDockingPlatformConfigList(DockingPlatformConfig dockingPlatformConfig);
|
||||
|
||||
/**
|
||||
* 新增对接平台配置信息
|
||||
*
|
||||
* @param dockingPlatformConfig 对接平台配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDockingPlatformConfig(DockingPlatformConfig dockingPlatformConfig);
|
||||
|
||||
/**
|
||||
* 修改对接平台配置信息
|
||||
*
|
||||
* @param dockingPlatformConfig 对接平台配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDockingPlatformConfig(DockingPlatformConfig dockingPlatformConfig);
|
||||
|
||||
/**
|
||||
* 批量删除对接平台配置信息
|
||||
*
|
||||
* @param ids 需要删除的对接平台配置信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDockingPlatformConfigByIds(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 删除对接平台配置信息信息
|
||||
*
|
||||
* @param id 对接平台配置信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDockingPlatformConfigById(Integer id);
|
||||
|
||||
/**
|
||||
* 通过operatorId查询配置信息
|
||||
* @param operatorId
|
||||
* @return
|
||||
*/
|
||||
DockingPlatformConfig getInfoByOperatorId(String operatorId);
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.jsowell.pile.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.jsowell.pile.mapper.DockingPlatformConfigMapper;
|
||||
import com.jsowell.pile.domain.DockingPlatformConfig;
|
||||
import com.jsowell.pile.service.IDockingPlatformConfigService;
|
||||
|
||||
/**
|
||||
* 对接平台配置信息Service业务层处理
|
||||
*
|
||||
* @author jsowell
|
||||
* @date 2023-05-27
|
||||
*/
|
||||
@Service
|
||||
public class DockingPlatformConfigServiceImpl implements IDockingPlatformConfigService {
|
||||
@Autowired
|
||||
private DockingPlatformConfigMapper dockingPlatformConfigMapper;
|
||||
|
||||
/**
|
||||
* 查询对接平台配置信息
|
||||
*
|
||||
* @param id 对接平台配置信息主键
|
||||
* @return 对接平台配置信息
|
||||
*/
|
||||
@Override
|
||||
public DockingPlatformConfig selectDockingPlatformConfigById(Integer id) {
|
||||
return dockingPlatformConfigMapper.selectDockingPlatformConfigById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询对接平台配置信息列表
|
||||
*
|
||||
* @param dockingPlatformConfig 对接平台配置信息
|
||||
* @return 对接平台配置信息
|
||||
*/
|
||||
@Override
|
||||
public List<DockingPlatformConfig> selectDockingPlatformConfigList(DockingPlatformConfig dockingPlatformConfig) {
|
||||
return dockingPlatformConfigMapper.selectDockingPlatformConfigList(dockingPlatformConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增对接平台配置信息
|
||||
*
|
||||
* @param dockingPlatformConfig 对接平台配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDockingPlatformConfig(DockingPlatformConfig dockingPlatformConfig) {
|
||||
dockingPlatformConfig.setCreateTime(DateUtils.getNowDate());
|
||||
return dockingPlatformConfigMapper.insertDockingPlatformConfig(dockingPlatformConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改对接平台配置信息
|
||||
*
|
||||
* @param dockingPlatformConfig 对接平台配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDockingPlatformConfig(DockingPlatformConfig dockingPlatformConfig) {
|
||||
dockingPlatformConfig.setUpdateTime(DateUtils.getNowDate());
|
||||
return dockingPlatformConfigMapper.updateDockingPlatformConfig(dockingPlatformConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除对接平台配置信息
|
||||
*
|
||||
* @param ids 需要删除的对接平台配置信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDockingPlatformConfigByIds(Integer[] ids) {
|
||||
return dockingPlatformConfigMapper.deleteDockingPlatformConfigByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除对接平台配置信息信息
|
||||
*
|
||||
* @param id 对接平台配置信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDockingPlatformConfigById(Integer id) {
|
||||
return dockingPlatformConfigMapper.deleteDockingPlatformConfigById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过operatorId查询配置信息
|
||||
*
|
||||
* @param operatorId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public DockingPlatformConfig getInfoByOperatorId(String operatorId) {
|
||||
return dockingPlatformConfigMapper.getInfoByOperatorId(operatorId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jsowell.pile.mapper.DockingPlatformConfigMapper">
|
||||
|
||||
<resultMap type="com.jsowell.pile.domain.DockingPlatformConfig" id="DockingPlatformConfigResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="operatorId" column="operator_id" />
|
||||
<result property="operatorSecret" column="operator_secret" />
|
||||
<result property="signSecret" column="sign_secret" />
|
||||
<result property="dataSecret" column="data_secret" />
|
||||
<result property="dataSecretIv" column="data_secret_IV" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDockingPlatformConfigVo">
|
||||
select id, name, operator_id, operator_secret, sign_secret, data_secret, data_secret_IV, create_time, create_by, update_time, update_by, del_flag from docking_platform_config
|
||||
</sql>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, name, operator_id, operator_secret, sign_secret, data_secret, data_secret_IV, create_time, create_by, update_time, update_by, del_flag
|
||||
</sql>
|
||||
|
||||
<select id="selectDockingPlatformConfigList" parameterType="com.jsowell.pile.domain.DockingPlatformConfig" resultMap="DockingPlatformConfigResult">
|
||||
<include refid="selectDockingPlatformConfigVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="operatorId != null and operatorId != ''"> and operator_id = #{operatorId}</if>
|
||||
<if test="operatorSecret != null and operatorSecret != ''"> and operator_secret = #{operatorSecret}</if>
|
||||
<if test="signSecret != null and signSecret != ''"> and sign_secret = #{signSecret}</if>
|
||||
<if test="dataSecret != null and dataSecret != ''"> and data_secret = #{dataSecret}</if>
|
||||
<if test="dataSecretIv != null and dataSecretIv != ''"> and data_secret_IV = #{dataSecretIv}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDockingPlatformConfigById" parameterType="Integer" resultMap="DockingPlatformConfigResult">
|
||||
<include refid="selectDockingPlatformConfigVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertDockingPlatformConfig" parameterType="com.jsowell.pile.domain.DockingPlatformConfig" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into docking_platform_config
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">name,</if>
|
||||
<if test="operatorId != null">operator_id,</if>
|
||||
<if test="operatorSecret != null">operator_secret,</if>
|
||||
<if test="signSecret != null">sign_secret,</if>
|
||||
<if test="dataSecret != null">data_secret,</if>
|
||||
<if test="dataSecretIv != null">data_secret_IV,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="operatorId != null">#{operatorId},</if>
|
||||
<if test="operatorSecret != null">#{operatorSecret},</if>
|
||||
<if test="signSecret != null">#{signSecret},</if>
|
||||
<if test="dataSecret != null">#{dataSecret},</if>
|
||||
<if test="dataSecretIv != null">#{dataSecretIv},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDockingPlatformConfig" parameterType="com.jsowell.pile.domain.DockingPlatformConfig">
|
||||
update docking_platform_config
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="operatorId != null">operator_id = #{operatorId},</if>
|
||||
<if test="operatorSecret != null">operator_secret = #{operatorSecret},</if>
|
||||
<if test="signSecret != null">sign_secret = #{signSecret},</if>
|
||||
<if test="dataSecret != null">data_secret = #{dataSecret},</if>
|
||||
<if test="dataSecretIv != null">data_secret_IV = #{dataSecretIv},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDockingPlatformConfigById" parameterType="Integer">
|
||||
delete from docking_platform_config where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDockingPlatformConfigByIds" parameterType="String">
|
||||
delete from docking_platform_config where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getInfoByOperatorId" resultMap="DockingPlatformConfigResult">
|
||||
select <include refid="Base_Column_List"/>
|
||||
from docking_platform_config
|
||||
where operator_id = #{operatorId,jdbcType=VARCHAR}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -88,6 +88,9 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
@Autowired
|
||||
private IThirdPartySettingInfoService thirdPartySettingInfoService;
|
||||
|
||||
@Autowired
|
||||
private IDockingPlatformConfigService dockingPlatformConfigService;
|
||||
|
||||
@Override
|
||||
public void pushMerchantInfo(Long merchantId) {
|
||||
// 通过id查询运营商信息
|
||||
@@ -1231,7 +1234,11 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
public Map<String, String> generateToken(QueryTokenDTO dto) throws UnsupportedEncodingException {
|
||||
String operatorID = dto.getOperatorID();
|
||||
// 通过operatorID 查出 operatorSecret TODO 建表 设置密钥
|
||||
String operatorSecret = "123123123123aaaa";
|
||||
DockingPlatformConfig platformConfig = dockingPlatformConfigService.getInfoByOperatorId(operatorID);
|
||||
if (platformConfig == null) {
|
||||
return null;
|
||||
}
|
||||
String operatorSecret = platformConfig.getOperatorSecret();
|
||||
|
||||
Map<String, String> map = Maps.newLinkedHashMap();
|
||||
map.put("OperatorID", dto.getOperatorID());
|
||||
@@ -1270,9 +1277,15 @@ public class LianLianServiceImpl implements LianLianService {
|
||||
|
||||
Map<String, String> resultMap = Maps.newLinkedHashMap();
|
||||
// 加密数据 TODO vo对象加密
|
||||
resultMap.put("data", "");
|
||||
byte[] encryptText = Cryptos.aesEncrypt(JSONObject.toJSONString(vo).getBytes(),
|
||||
platformConfig.getDataSecret().getBytes(), platformConfig.getDataSecretIv().getBytes());
|
||||
String encryptData = Encodes.encodeBase64(encryptText);
|
||||
|
||||
resultMap.put("Data", encryptData);
|
||||
// 生成sig TODO 生成sig
|
||||
resultMap.put("sig", "");
|
||||
String resultSign = GBSignUtils.sign(resultMap, operatorSecret);
|
||||
resultMap.put("Sig", resultSign);
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user