1个文件已删除
10个文件已修改
10个文件已添加
| | |
| | | // strategy.setTablePrefix(pc.getModuleName() + ""); |
| | | // strategy.setLikeTable(new LikeTable("room")); |
| | | //strategy.setLikeTable(new LikeTable("member")); |
| | | strategy.setLikeTable(new LikeTable("t_sys_inspection"));// 生成表名 |
| | | strategy.setLikeTable(new LikeTable("t_sys_obs_config"));// 生成表名 |
| | | // strategy.setLikeTable(new LikeTable("t_hotel"));// 生成表名 |
| | | // strategy.setLikeTable(new LikeTable("t_scan_message"));// 生成表名 |
| | | // strategy.setNotLikeTable(new LikeTable("hotel_info"));// 不生成表名 |
| | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | 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.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.R; |
| | |
| | | private final TErpSupplierWarehousingService erpSupplierWarehousingService; |
| | | private final TErpSupplierOutboundGoodsService erpSupplierOutboundGoodsService; |
| | | private final TErpMaintenanceReminderService erpMaintenanceReminderService; |
| | | private final TCrmClinicService crmClinicService; |
| | | private final TCrmSupplierService crmSupplierService; |
| | | |
| | | @Autowired |
| | | public TErpGoodsController(TErpGoodsService erpGoodsService, TokenService tokenService, TErpGoodsTypeService erpGoodsTypeService, TErpGoodsUnitService erpGoodsUnitService, |
| | | TErpSupplierWarehousingBatchService erpSupplierWarehousingBatchService, TErpSupplierWarehousingService erpSupplierWarehousingService, |
| | | TErpSupplierOutboundGoodsService erpSupplierOutboundGoodsService, TErpMaintenanceReminderService erpMaintenanceReminderService) { |
| | | TErpSupplierOutboundGoodsService erpSupplierOutboundGoodsService, TErpMaintenanceReminderService erpMaintenanceReminderService, TCrmClinicService crmClinicService, TCrmSupplierService crmSupplierService) { |
| | | this.erpGoodsService = erpGoodsService; |
| | | this.tokenService = tokenService; |
| | | this.erpGoodsTypeService = erpGoodsTypeService; |
| | |
| | | this.erpSupplierWarehousingService = erpSupplierWarehousingService; |
| | | this.erpSupplierOutboundGoodsService = erpSupplierOutboundGoodsService; |
| | | this.erpMaintenanceReminderService = erpMaintenanceReminderService; |
| | | this.crmClinicService = crmClinicService; |
| | | this.crmSupplierService = crmSupplierService; |
| | | } |
| | | |
| | | |
| | |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<TErpGoodsVO>> pageList(@RequestBody TErpGoodsQuery query) { |
| | | SysUser user = tokenService.getLoginUser().getUser(); |
| | | Integer roleType = user.getRoleType(); |
| | | if(roleType == 4){ |
| | | // 供应商 |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | query.setSupplierClinicId(crmSupplier.getId()); |
| | | } |
| | | if(roleType == 5){ |
| | | // 诊所 |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | query.setSupplierClinicId(crmClinic.getId()); |
| | | } |
| | | return R.ok(erpGoodsService.pageList(query,user)); |
| | | } |
| | | |
| | |
| | | if (erpGoodsService.isExit(dto.getGoodsIdCode(), dto.getQuasiNumber())) { |
| | | return R.fail("erp商品已存在"); |
| | | } |
| | | Integer roleType = user.getRoleType(); |
| | | TErpGoods goods = new TErpGoods(); |
| | | goods.setSupplierClinicId(user.getUserId().toString()); |
| | | if(roleType == 4){ |
| | | // 供应商 |
| | | TCrmSupplier crmSupplier = crmSupplierService.getOne(Wrappers.lambdaQuery(TCrmSupplier.class) |
| | | .eq(TCrmSupplier::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | goods.setSupplierClinicId(crmSupplier.getId()); |
| | | goods.setGoodsSource(1); |
| | | } |
| | | if(roleType == 5){ |
| | | // 诊所 |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | goods.setSupplierClinicId(crmClinic.getId()); |
| | | goods.setGoodsSource(2); |
| | | } |
| | | goods.setCreateId(user.getUserId().toString()); |
| | | goods.setGoodsIdCode(dto.getGoodsIdCode()); |
| | | goods.setQuasiNumber(dto.getQuasiNumber()); |
| | |
| | | } |
| | | // 计算结束时间 |
| | | dto.setEndTime(dto.getStartTime().plusMinutes(dto.getExpectedDuration())); |
| | | dto.setPassword(SecurityUtils.encryptPassword(dto.getPassword())); |
| | | return R.ok(sysLiveService.save(dto)); |
| | | } |
| | | |
| | |
| | | // } |
| | | // 计算结束时间 |
| | | dto.setEndTime(dto.getStartTime().plusMinutes(dto.getExpectedDuration())); |
| | | dto.setPassword(SecurityUtils.encryptPassword(dto.getPassword())); |
| | | return R.ok(sysLiveService.updateById(dto)); |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.model.TSysLive; |
| | | import com.ruoyi.system.model.TSysObsConfig; |
| | | import com.ruoyi.system.service.TSysLiveService; |
| | | import com.ruoyi.system.service.TSysObsConfigService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * obs文件上传配置 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-09-11 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/t-sys-obs-config") |
| | | public class TSysObsConfigController { |
| | | private final TSysObsConfigService sysObsConfigService; |
| | | @Autowired |
| | | public TSysObsConfigController(TSysObsConfigService sysObsConfigService) { |
| | | this.sysObsConfigService = sysObsConfigService; |
| | | } |
| | | /** |
| | | * 查看obs文件上传配置 |
| | | */ |
| | | @GetMapping(value = "/getDetailById") |
| | | public R<TSysObsConfig> getDetailById() { |
| | | return R.ok(sysObsConfigService.getById(1)); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.model.TSysObsConfig; |
| | | import com.ruoyi.system.service.TSysObsConfigService; |
| | | import com.ruoyi.system.utils.util.ObsUploadUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | |
| | | /** |
| | | * <p> |
| | | * obs文件上传 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-09-11 |
| | | */ |
| | | @Api(tags = "obs文件上传") |
| | | @RestController |
| | | @RequestMapping("/obs-upload") |
| | | public class TSysObsUploadController { |
| | | /** |
| | | * obs文件上传 |
| | | */ |
| | | @ApiOperation(value = "obs文件上传") |
| | | @PostMapping(value = "/upload", headers = "content-type=multipart/form-data") |
| | | public R<String> upload(@RequestParam(value = "file") MultipartFile file) { |
| | | try { |
| | | String url = ObsUploadUtil.obsUpload(file); |
| | | return R.ok(url); |
| | | } catch (IOException e) { |
| | | return R.fail("上传失败"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.web.controller.tool; |
| | | |
| | | import com.aliyun.dysmsapi20170525.models.SendSmsRequest; |
| | | import com.aliyun.dysmsapi20170525.models.SendSmsResponse; |
| | | import com.aliyun.tea.TeaException; |
| | | import com.aliyun.teaopenapi.models.Config; |
| | | import com.aliyun.teautil.models.RuntimeOptions; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | @Slf4j |
| | | public class MsgUtils { |
| | | |
| | | @Value("${code.config.accessKeyId}") |
| | | private String accessKeyId; |
| | | @Value("${code.config.accessKeySecret}") |
| | | private String accessKeySecret; |
| | | @Value("${code.config.signName}") |
| | | private String signName; |
| | | |
| | | /** |
| | | * 使用AK&SK初始化账号Client |
| | | * @param accessKeyId |
| | | * @param accessKeySecret |
| | | * @return Client |
| | | * @throws Exception |
| | | */ |
| | | public static com.aliyun.dysmsapi20170525.Client createClient(String accessKeyId, String accessKeySecret) throws Exception { |
| | | Config config = new Config() |
| | | // 您的 AccessKey ID |
| | | .setAccessKeyId(accessKeyId) |
| | | // 您的 AccessKey Secret |
| | | .setAccessKeySecret(accessKeySecret); |
| | | // 访问的域名 |
| | | config.endpoint = "dysmsapi.aliyuncs.com"; |
| | | return new com.aliyun.dysmsapi20170525.Client(config); |
| | | } |
| | | |
| | | public void sendMsg(String phone,String code,String templateCode) throws Exception { |
| | | com.aliyun.dysmsapi20170525.Client client = MsgUtils.createClient(accessKeyId,accessKeySecret); |
| | | SendSmsRequest sendSmsRequest = new SendSmsRequest() |
| | | .setSignName(signName) |
| | | .setTemplateCode(templateCode) |
| | | .setPhoneNumbers(phone) |
| | | .setTemplateParam("{\"code\":\""+code+"\"}"); |
| | | RuntimeOptions runtime = new RuntimeOptions(); |
| | | try { |
| | | // 复制代码运行请自行打印 API 的返回值 |
| | | SendSmsResponse sendSmsResponse = client.sendSmsWithOptions(sendSmsRequest, runtime); |
| | | log.info("短信发送成功:{},{}",sendSmsResponse.getBody().getMessage(),sendSmsResponse.getStatusCode()); |
| | | } catch (TeaException error) { |
| | | // 如有需要,请打印 error |
| | | com.aliyun.teautil.Common.assertAsString(error.message); |
| | | log.info("短信发送失败:{}",error.message); |
| | | } catch (Exception _error) { |
| | | TeaException error = new TeaException(_error.getMessage(), _error); |
| | | // 如有需要,请打印 error |
| | | com.aliyun.teautil.Common.assertAsString(error.message); |
| | | log.info("短信发送失败:{}",error.message); |
| | | } |
| | | } |
| | | } |
| | |
| | | #OSS及短信配置 |
| | | code: |
| | | config: |
| | | templateCodeTest: "SMS_154950909" |
| | | signNameTest: "阿里云短信测试" |
| | | accessKeyId: LTAI5tAdba8HtT1C6UqtSxBt |
| | | accessKeySecret: 0SRb6XGkciQDPWn2rYqbJtq2qRMDY8 |
| | | signName: "四川金达通信工程" |
| | | templateCode: "SMS_293985284" |
| | | cos: |
| | | client: |
| | | accessKey: AKIDCF5EF2c0DE1e5JK8r4EGJF4mNsMgp26x |
| | | secretKey: lLl184rUyFOOE0d5KNGC3kmfNsCWk4GU |
| | | bucket: xzgt-1305134071 |
| | | bucketAddr: ap-chengdu |
| | | # bucket: xzgttest-1305134071 |
| | | # rootSrc: https://xzgttest-1305134071.cos.ap-chengdu.myqcloud.com/ |
| | | rootSrc: https://xzgt-1305134071.cos.ap-chengdu.myqcloud.com |
| | | location: /xizang |
| | | sms: |
| | | enable: true |
| | | appId: 1400957506 |
| | | secretid: AKIDCF5EF2c0DE1e5JK8r4EGJF4mNsMgp26x |
| | | secretkey: lLl184rUyFOOE0d5KNGC3kmfNsCWk4GU |
| | | sign: 畅云出行 |
| | | com: |
| | | taxi591: |
| | | bank: |
| | | cer-path: /usr/local/bank/TrustPay.cer |
| | | base-url: http://hello.enjoy.abchina.com |
| | | enable: true |
| | | keystore-password: gggs6666 |
| | | pfx-path: /usr/local/bank/103882597000441.pfx |
| | | accessKeyId: LTAI5t99NH2Wwoq48ho72u8M |
| | | accessKeySecret: wAGHKUEBrrTgDcbfjnBKTEt5858Ru5 |
| | | signName: "海诊通" |
| | |
| | | conf: |
| | | appId: wxe91f1af7638aa5dd |
| | | secretId: a787e1a462715604e0c9528b6d8960d1 |
| | | sms: |
| | | enable: true |
| | | appId: 1400957506 |
| | | secretid: AKIDCF5EF2c0DE1e5JK8r4EGJF4mNsMgp26x |
| | | secretkey: lLl184rUyFOOE0d5KNGC3kmfNsCWk4GU |
| | | sign: 畅云出行 |
| | | #OSS及短信配置 |
| | | code: |
| | | config: |
| | | accessKeyId: LTAI5t99NH2Wwoq48ho72u8M |
| | | accessKeySecret: wAGHKUEBrrTgDcbfjnBKTEt5858Ru5 |
| | | signName: "海诊通" |
New file |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.model.TSysLive; |
| | | import com.ruoyi.system.query.TSysLiveQuery; |
| | | import com.ruoyi.system.service.TSysLiveService; |
| | | import com.ruoyi.system.vo.TSysLiveVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 直播管理 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-08-20 |
| | | */ |
| | | @Api(tags = "直播管理") |
| | | @RestController |
| | | @RequestMapping("/t-sys-live") |
| | | public class TSysLiveController { |
| | | |
| | | private final TSysLiveService sysLiveService; |
| | | private final TokenService tokenService; |
| | | @Autowired |
| | | public TSysLiveController(TSysLiveService sysLiveService, TokenService tokenService) { |
| | | this.sysLiveService = sysLiveService; |
| | | this.tokenService = tokenService; |
| | | } |
| | | |
| | | /** |
| | | * 获取直播管理管理列表 |
| | | */ |
| | | @ApiOperation(value = "获取直播管理分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<TSysLiveVO>> pageList(@RequestBody TSysLiveQuery query) { |
| | | return R.ok(sysLiveService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 查看直播管理详情 |
| | | */ |
| | | @ApiOperation(value = "查看直播管理详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public R<TSysLive> getDetailById(@RequestParam String id) { |
| | | return R.ok(sysLiveService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 直播管理推送用户 |
| | | */ |
| | | @Log(title = "直播管理信息-推送用户", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "直播管理信息推送用户") |
| | | @PutMapping(value = "/pushUser") |
| | | public R<String> pushUser(@RequestParam(value = "id") String id, |
| | | @RequestParam(value = "pushType")String pushType) { |
| | | sysLiveService.pushUser(id,pushType); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | <artifactId>easyexcel</artifactId> |
| | | <version>2.1.6</version> |
| | | </dependency> |
| | | |
| | | <!--华为云的obs--> |
| | | <dependency> |
| | | <groupId>com.huaweicloud</groupId> |
| | | <artifactId>esdk-obs-java</artifactId> |
| | | <version>3.19.5</version> |
| | | </dependency> |
| | | |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.apache.httpcomponents</groupId>--> |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.model.TSysObsConfig; |
| | | |
| | | /** |
| | | * <p> |
| | | * obs文件上传配置 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-09-11 |
| | | */ |
| | | public interface TSysObsConfigMapper extends BaseMapper<TSysObsConfig> { |
| | | |
| | | } |
| | |
| | | @TableField("live_type") |
| | | private Integer liveType; |
| | | |
| | | @ApiModelProperty(value = "密码") |
| | | @TableField("password") |
| | | private String password; |
| | | @ApiModelProperty(value = "直播地址") |
| | | @TableField("live_url") |
| | | private String liveUrl; |
| | | |
| | | @ApiModelProperty(value = "详情") |
| | | @TableField("live_detail") |
New file |
| | |
| | | package com.ruoyi.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * obs文件上传配置 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-09-11 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_sys_obs_config") |
| | | @ApiModel(value="TSysObsConfig对象", description="obs文件上传配置") |
| | | public class TSysObsConfig implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @TableField("endPoint") |
| | | private String endPoint; |
| | | |
| | | @TableField("accessKeyId") |
| | | private String accessKeyId; |
| | | |
| | | @TableField("accessKeySecret") |
| | | private String accessKeySecret; |
| | | |
| | | @TableField("bucketName") |
| | | private String bucketName; |
| | | |
| | | @TableField("obs_url") |
| | | private String obsUrl; |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.ruoyi.common.core.domain.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | @ApiModelProperty(value = "库存管理条件 不足传1") |
| | | private Integer type; |
| | | |
| | | |
| | | @ApiModelProperty(value = "供应商id/诊所id") |
| | | private String supplierClinicId; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.model.TSysObsConfig; |
| | | |
| | | /** |
| | | * <p> |
| | | * obs文件上传配置 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-09-11 |
| | | */ |
| | | public interface TSysObsConfigService extends IService<TSysObsConfig> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.mapper.TSysObsConfigMapper; |
| | | import com.ruoyi.system.model.TSysObsConfig; |
| | | import com.ruoyi.system.service.TSysObsConfigService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * obs文件上传配置 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2025-09-11 |
| | | */ |
| | | @Service |
| | | public class TSysObsConfigServiceImpl extends ServiceImpl<TSysObsConfigMapper, TSysObsConfig> implements TSysObsConfigService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.utils.util; |
| | | |
| | | import com.obs.services.ObsClient; |
| | | import com.obs.services.model.ObjectMetadata; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.UUID; |
| | | |
| | | public class ObsUploadUtil { |
| | | //OBS图片访问域名 |
| | | public static String endPoint = "obs.cn-south-1.myhuaweicloud.com"; |
| | | public static String accessKeyId = "HPUA5AQBALRF13NDF1BK"; |
| | | public static String accessKeySecret = "4t19xNQip1rCeZpWTRSu96VWsY7bEZtPnLwwPxiH"; |
| | | public static String bucketName = "haizhentong"; |
| | | public static String oss_domain = "https://haizhentong.obs.cn-south-1.myhuaweicloud.com/"; |
| | | |
| | | |
| | | // 创建ObsClient实例 |
| | | public static ObsClient obsClient = new ObsClient(accessKeyId, accessKeySecret, endPoint); |
| | | |
| | | public static String obsUpload(MultipartFile file) throws IOException{ |
| | | String fileName = ""; |
| | | if(file!=null && !"".equals(file.getOriginalFilename()) && file.getOriginalFilename()!=null){ |
| | | InputStream content = file.getInputStream();//获得指定文件的输入流 |
| | | ObjectMetadata meta = new ObjectMetadata();// 创建上传Object的Metadata |
| | | meta.setContentLength(file.getSize()); // 必须设置ContentLength |
| | | String originalFilename = file.getOriginalFilename(); |
| | | fileName = UUID.randomUUID().toString().replaceAll("-","") + originalFilename.subSequence(originalFilename.lastIndexOf("."), originalFilename.length()); |
| | | obsClient.putObject(bucketName,"file/"+fileName,content,meta);// 上传Object. |
| | | if(fileName != null && !"".equals(fileName)){ |
| | | System.out.println(fileName); |
| | | fileName = oss_domain+"file/"+fileName; |
| | | } |
| | | } |
| | | return fileName; |
| | | } |
| | | |
| | | /** |
| | | * 删除某个Object |
| | | * |
| | | * @param bucketUrl |
| | | * @return |
| | | */ |
| | | public static boolean deleteObject(String bucketUrl) { |
| | | try { |
| | | bucketUrl=bucketUrl.replace(oss_domain+"web",""); |
| | | // 删除Object. |
| | | obsClient.deleteObject(bucketName, bucketUrl); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return false; |
| | | } finally { |
| | | //ossClient.shutdown(); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | } |
| | |
| | | and state = #{query.state} |
| | | </if> |
| | | <if test="user.roleType != null and user.roleType == 4 "> |
| | | and goods_source =1 and supplier_clinic_id =#{user.userId} |
| | | and goods_source =1 and supplier_clinic_id = #{query.supplierClinicId} |
| | | </if> |
| | | <if test="user.roleType != null and user.roleType == 5 "> |
| | | and goods_source =2 and supplier_clinic_id =#{user.userId} |
| | | and goods_source =2 and supplier_clinic_id = #{query.supplierClinicId} |
| | | </if> |
| | | order by create_time desc |
| | | </select> |
| | |
| | | <result column="live_mode" property="liveMode" /> |
| | | <result column="live_lecturer" property="liveLecturer" /> |
| | | <result column="live_type" property="liveType" /> |
| | | <result column="password" property="password" /> |
| | | <result column="live_url" property="liveUrl" /> |
| | | <result column="live_detail" property="liveDetail" /> |
| | | <result column="push_type" property="pushType" /> |
| | | <result column="create_time" property="createTime" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, live_title, live_cover, live_introduction, start_time,end_time, expected_duration, live_way, live_mode, |
| | | id, live_title, live_cover, live_introduction, start_time,end_time, expected_duration, live_way, live_mode,live_url, |
| | | live_lecturer, live_type, password, live_detail, push_type, create_time, update_time, create_by, update_by, disabled |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.TSysLiveVO"> |
New file |
| | |
| | | <?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.ruoyi.system.mapper.TSysObsConfigMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.model.TSysObsConfig"> |
| | | <id column="id" property="id" /> |
| | | <result column="endPoint" property="endPoint" /> |
| | | <result column="accessKeyId" property="accessKeyId" /> |
| | | <result column="accessKeySecret" property="accessKeySecret" /> |
| | | <result column="bucketName" property="bucketName" /> |
| | | <result column="obs_url" property="obsUrl" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, endPoint, accessKeyId, accessKeySecret, bucketName, obs_url |
| | | </sql> |
| | | |
| | | </mapper> |