diff --git a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/ThirdPartySettingInfoController.java b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/ThirdPartySettingInfoController.java new file mode 100644 index 000000000..b37ddfdd3 --- /dev/null +++ b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/ThirdPartySettingInfoController.java @@ -0,0 +1,104 @@ +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.ThirdPartySettingInfo; +import com.jsowell.pile.service.IThirdPartySettingInfoService; +import com.jsowell.common.util.poi.ExcelUtil; +import com.jsowell.common.core.page.TableDataInfo; + +/** + * 第三方平台配置Controller + * + * @author jsowell + * @date 2023-05-24 + */ +@RestController +@RequestMapping("/pile/info") +public class ThirdPartySettingInfoController extends BaseController +{ + @Autowired + private IThirdPartySettingInfoService thirdPartySettingInfoService; + + /** + * 查询第三方平台配置列表 + */ + @PreAuthorize("@ss.hasPermi('pile:info:list')") + @GetMapping("/list") + public TableDataInfo list(ThirdPartySettingInfo thirdPartySettingInfo) + { + startPage(); + List list = thirdPartySettingInfoService.selectThirdPartySettingInfoList(thirdPartySettingInfo); + return getDataTable(list); + } + + /** + * 导出第三方平台配置列表 + */ + @PreAuthorize("@ss.hasPermi('pile:info:export')") + @Log(title = "第三方平台配置", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ThirdPartySettingInfo thirdPartySettingInfo) + { + List list = thirdPartySettingInfoService.selectThirdPartySettingInfoList(thirdPartySettingInfo); + ExcelUtil util = new ExcelUtil(ThirdPartySettingInfo.class); + util.exportExcel(response, list, "第三方平台配置数据"); + } + + /** + * 获取第三方平台配置详细信息 + */ + @PreAuthorize("@ss.hasPermi('pile:info:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(thirdPartySettingInfoService.selectThirdPartySettingInfoById(id)); + } + + /** + * 新增第三方平台配置 + */ + @PreAuthorize("@ss.hasPermi('pile:info:add')") + @Log(title = "第三方平台配置", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ThirdPartySettingInfo thirdPartySettingInfo) + { + return toAjax(thirdPartySettingInfoService.insertThirdPartySettingInfo(thirdPartySettingInfo)); + } + + /** + * 修改第三方平台配置 + */ + @PreAuthorize("@ss.hasPermi('pile:info:edit')") + @Log(title = "第三方平台配置", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ThirdPartySettingInfo thirdPartySettingInfo) + { + return toAjax(thirdPartySettingInfoService.updateThirdPartySettingInfo(thirdPartySettingInfo)); + } + + /** + * 删除第三方平台配置 + */ + @PreAuthorize("@ss.hasPermi('pile:info:remove')") + @Log(title = "第三方平台配置", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(thirdPartySettingInfoService.deleteThirdPartySettingInfoByIds(ids)); + } +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/domain/ThirdPartySettingInfo.java b/jsowell-pile/src/main/java/com/jsowell/pile/domain/ThirdPartySettingInfo.java new file mode 100644 index 000000000..5b57eabb3 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/domain/ThirdPartySettingInfo.java @@ -0,0 +1,152 @@ +package com.jsowell.pile.domain; + +import com.jsowell.common.annotation.Excel; +import com.jsowell.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 第三方平台配置对象 thirdparty_setting_info + * + * @author jsowell + * @date 2023-05-24 + */ +public class ThirdPartySettingInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 对接类型(1-联联平台) */ + @Excel(name = "对接类型", readConverterExp = "1=-联联平台") + private String type; + + /** 站点id */ + @Excel(name = "站点id") + private String stationId; + + /** 运营商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(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setStationId(String stationId) + { + this.stationId = stationId; + } + + public String getStationId() + { + return stationId; + } + 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("type", getType()) + .append("stationId", getStationId()) + .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(); + } +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ThirdPartySettingInfoMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ThirdPartySettingInfoMapper.java new file mode 100644 index 000000000..46f3e026a --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ThirdPartySettingInfoMapper.java @@ -0,0 +1,61 @@ +package com.jsowell.pile.mapper; + +import java.util.List; +import com.jsowell.pile.domain.ThirdPartySettingInfo; + +/** + * 第三方平台配置Mapper接口 + * + * @author jsowell + * @date 2023-05-24 + */ +public interface ThirdPartySettingInfoMapper +{ + /** + * 查询第三方平台配置 + * + * @param id 第三方平台配置主键 + * @return 第三方平台配置 + */ + public ThirdPartySettingInfo selectThirdPartySettingInfoById(Long id); + + /** + * 查询第三方平台配置列表 + * + * @param thirdPartySettingInfo 第三方平台配置 + * @return 第三方平台配置集合 + */ + public List selectThirdPartySettingInfoList(ThirdPartySettingInfo thirdPartySettingInfo); + + /** + * 新增第三方平台配置 + * + * @param thirdPartySettingInfo 第三方平台配置 + * @return 结果 + */ + public int insertThirdPartySettingInfo(ThirdPartySettingInfo thirdPartySettingInfo); + + /** + * 修改第三方平台配置 + * + * @param thirdPartySettingInfo 第三方平台配置 + * @return 结果 + */ + public int updateThirdPartySettingInfo(ThirdPartySettingInfo thirdPartySettingInfo); + + /** + * 删除第三方平台配置 + * + * @param id 第三方平台配置主键 + * @return 结果 + */ + public int deleteThirdPartySettingInfoById(Long id); + + /** + * 批量删除第三方平台配置 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteThirdPartySettingInfoByIds(Long[] ids); +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/IThirdPartySettingInfoService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/IThirdPartySettingInfoService.java new file mode 100644 index 000000000..94302bc29 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/IThirdPartySettingInfoService.java @@ -0,0 +1,61 @@ +package com.jsowell.pile.service; + +import java.util.List; +import com.jsowell.pile.domain.ThirdPartySettingInfo; + +/** + * 第三方平台配置Service接口 + * + * @author jsowell + * @date 2023-05-24 + */ +public interface IThirdPartySettingInfoService +{ + /** + * 查询第三方平台配置 + * + * @param id 第三方平台配置主键 + * @return 第三方平台配置 + */ + public ThirdPartySettingInfo selectThirdPartySettingInfoById(Long id); + + /** + * 查询第三方平台配置列表 + * + * @param thirdPartySettingInfo 第三方平台配置 + * @return 第三方平台配置集合 + */ + public List selectThirdPartySettingInfoList(ThirdPartySettingInfo thirdPartySettingInfo); + + /** + * 新增第三方平台配置 + * + * @param thirdPartySettingInfo 第三方平台配置 + * @return 结果 + */ + public int insertThirdPartySettingInfo(ThirdPartySettingInfo thirdPartySettingInfo); + + /** + * 修改第三方平台配置 + * + * @param thirdPartySettingInfo 第三方平台配置 + * @return 结果 + */ + public int updateThirdPartySettingInfo(ThirdPartySettingInfo thirdPartySettingInfo); + + /** + * 批量删除第三方平台配置 + * + * @param ids 需要删除的第三方平台配置主键集合 + * @return 结果 + */ + public int deleteThirdPartySettingInfoByIds(Long[] ids); + + /** + * 删除第三方平台配置信息 + * + * @param id 第三方平台配置主键 + * @return 结果 + */ + public int deleteThirdPartySettingInfoById(Long id); +} diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartySettingInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartySettingInfoServiceImpl.java new file mode 100644 index 000000000..8250b9dcc --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartySettingInfoServiceImpl.java @@ -0,0 +1,96 @@ +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.ThirdPartySettingInfoMapper; +import com.jsowell.pile.domain.ThirdPartySettingInfo; +import com.jsowell.pile.service.IThirdPartySettingInfoService; + +/** + * 第三方平台配置Service业务层处理 + * + * @author jsowell + * @date 2023-05-24 + */ +@Service +public class ThirdPartySettingInfoServiceImpl implements IThirdPartySettingInfoService +{ + @Autowired + private ThirdPartySettingInfoMapper thirdPartySettingInfoMapper; + + /** + * 查询第三方平台配置 + * + * @param id 第三方平台配置主键 + * @return 第三方平台配置 + */ + @Override + public ThirdPartySettingInfo selectThirdPartySettingInfoById(Long id) + { + return thirdPartySettingInfoMapper.selectThirdPartySettingInfoById(id); + } + + /** + * 查询第三方平台配置列表 + * + * @param thirdPartySettingInfo 第三方平台配置 + * @return 第三方平台配置 + */ + @Override + public List selectThirdPartySettingInfoList(ThirdPartySettingInfo thirdPartySettingInfo) + { + return thirdPartySettingInfoMapper.selectThirdPartySettingInfoList(thirdPartySettingInfo); + } + + /** + * 新增第三方平台配置 + * + * @param thirdPartySettingInfo 第三方平台配置 + * @return 结果 + */ + @Override + public int insertThirdPartySettingInfo(ThirdPartySettingInfo thirdPartySettingInfo) + { + thirdPartySettingInfo.setCreateTime(DateUtils.getNowDate()); + return thirdPartySettingInfoMapper.insertThirdPartySettingInfo(thirdPartySettingInfo); + } + + /** + * 修改第三方平台配置 + * + * @param thirdPartySettingInfo 第三方平台配置 + * @return 结果 + */ + @Override + public int updateThirdPartySettingInfo(ThirdPartySettingInfo thirdPartySettingInfo) + { + thirdPartySettingInfo.setUpdateTime(DateUtils.getNowDate()); + return thirdPartySettingInfoMapper.updateThirdPartySettingInfo(thirdPartySettingInfo); + } + + /** + * 批量删除第三方平台配置 + * + * @param ids 需要删除的第三方平台配置主键 + * @return 结果 + */ + @Override + public int deleteThirdPartySettingInfoByIds(Long[] ids) + { + return thirdPartySettingInfoMapper.deleteThirdPartySettingInfoByIds(ids); + } + + /** + * 删除第三方平台配置信息 + * + * @param id 第三方平台配置主键 + * @return 结果 + */ + @Override + public int deleteThirdPartySettingInfoById(Long id) + { + return thirdPartySettingInfoMapper.deleteThirdPartySettingInfoById(id); + } +} diff --git a/jsowell-pile/src/main/resources/mapper/pile/ThirdPartySettingInfoMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/ThirdPartySettingInfoMapper.xml new file mode 100644 index 000000000..d9dcf819f --- /dev/null +++ b/jsowell-pile/src/main/resources/mapper/pile/ThirdPartySettingInfoMapper.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + select id, type, station_id, operator_id, operator_secret, sign_secret, data_secret, data_secret_IV, create_time, create_by, update_time, update_by, del_flag from thirdparty_setting_info + + + + + + + + insert into thirdparty_setting_info + + type, + station_id, + operator_id, + operator_secret, + sign_secret, + data_secret, + data_secret_IV, + create_time, + create_by, + update_time, + update_by, + del_flag, + + + #{type}, + #{stationId}, + #{operatorId}, + #{operatorSecret}, + #{signSecret}, + #{dataSecret}, + #{dataSecretIv}, + #{createTime}, + #{createBy}, + #{updateTime}, + #{updateBy}, + #{delFlag}, + + + + + update thirdparty_setting_info + + type = #{type}, + station_id = #{stationId}, + operator_id = #{operatorId}, + operator_secret = #{operatorSecret}, + sign_secret = #{signSecret}, + data_secret = #{dataSecret}, + data_secret_IV = #{dataSecretIv}, + create_time = #{createTime}, + create_by = #{createBy}, + update_time = #{updateTime}, + update_by = #{updateBy}, + del_flag = #{delFlag}, + + where id = #{id} + + + + delete from thirdparty_setting_info where id = #{id} + + + + delete from thirdparty_setting_info where id in + + #{id} + + + \ No newline at end of file