修改--修改资源位默认图片时,在sys_source_default中更新数据
This commit is contained in:
parent
89b3b10c3e
commit
add6b430e7
@ -62,11 +62,15 @@ public class SysSourceController extends BaseController {
|
||||
private IUserWorkService userWorkService;
|
||||
|
||||
|
||||
// 设置各景区默认价格和北京图片
|
||||
// 设置各景区默认价格和背景图片
|
||||
@Autowired
|
||||
private ISysScenicDefaultService sysScenicDefaultService;
|
||||
|
||||
|
||||
// 设置资源位默认价格和背景图片
|
||||
@Autowired
|
||||
private ISysSourceDefaultService sysSourceDefaultService;
|
||||
|
||||
|
||||
// 状态
|
||||
/*
|
||||
@ -735,7 +739,9 @@ public class SysSourceController extends BaseController {
|
||||
|
||||
}
|
||||
// 产品管理--设置--批量修改指定资源位图片
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:goods:list')")
|
||||
@Transactional
|
||||
@PostMapping("/changeMultiSourceImage")
|
||||
public AjaxResult changeMultiSourceImage(@RequestParam("sourceImage") MultipartFile sourceImage,
|
||||
@RequestParam("sourceStrList") String sourceStrList) {
|
||||
@ -766,13 +772,11 @@ public class SysSourceController extends BaseController {
|
||||
// 修改资源位的图片, 先都能修改吧
|
||||
SysSource sysSource = sysSourceService.selectSysSourceBySourceId(sourceId);
|
||||
sysSource.setWorkAddress(sourceImagePath);
|
||||
int flag = sysSourceService.updateSysSource(sysSource);
|
||||
if (flag == 0){
|
||||
return error("修改资源位默认图像失败");
|
||||
}
|
||||
else{
|
||||
continue;
|
||||
}
|
||||
sysSourceService.updateSysSource(sysSource);
|
||||
|
||||
|
||||
// sys_source_default修改资源位默认图片
|
||||
sysSourceDefaultService.updateSysSourceDefaultWorkBySourceId(sourceId, sourceImagePath);
|
||||
|
||||
}
|
||||
AjaxResult ajax = success();
|
||||
|
||||
@ -1,104 +1,104 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
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.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.SysSourceDefault;
|
||||
import com.ruoyi.system.service.ISysSourceDefaultService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 资源位默认配置Controller
|
||||
*
|
||||
* @author haotian
|
||||
* @date 2025-04-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/default")
|
||||
public class SysSourceDefaultController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISysSourceDefaultService sysSourceDefaultService;
|
||||
|
||||
/**
|
||||
* 查询资源位默认配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:default:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysSourceDefault sysSourceDefault)
|
||||
{
|
||||
startPage();
|
||||
List<SysSourceDefault> list = sysSourceDefaultService.selectSysSourceDefaultList(sysSourceDefault);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出资源位默认配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:default:export')")
|
||||
@Log(title = "资源位默认配置", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysSourceDefault sysSourceDefault)
|
||||
{
|
||||
List<SysSourceDefault> list = sysSourceDefaultService.selectSysSourceDefaultList(sysSourceDefault);
|
||||
ExcelUtil<SysSourceDefault> util = new ExcelUtil<SysSourceDefault>(SysSourceDefault.class);
|
||||
util.exportExcel(response, list, "资源位默认配置数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取资源位默认配置详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:default:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(sysSourceDefaultService.selectSysSourceDefaultById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增资源位默认配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:default:add')")
|
||||
@Log(title = "资源位默认配置", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysSourceDefault sysSourceDefault)
|
||||
{
|
||||
return toAjax(sysSourceDefaultService.insertSysSourceDefault(sysSourceDefault));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改资源位默认配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:default:edit')")
|
||||
@Log(title = "资源位默认配置", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysSourceDefault sysSourceDefault)
|
||||
{
|
||||
return toAjax(sysSourceDefaultService.updateSysSourceDefault(sysSourceDefault));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除资源位默认配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:default:remove')")
|
||||
@Log(title = "资源位默认配置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(sysSourceDefaultService.deleteSysSourceDefaultByIds(ids));
|
||||
}
|
||||
}
|
||||
//package com.ruoyi.system.controller;
|
||||
//
|
||||
//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.ruoyi.common.annotation.Log;
|
||||
//import com.ruoyi.common.core.controller.BaseController;
|
||||
//import com.ruoyi.common.core.domain.AjaxResult;
|
||||
//import com.ruoyi.common.enums.BusinessType;
|
||||
//import com.ruoyi.system.domain.SysSourceDefault;
|
||||
//import com.ruoyi.system.service.ISysSourceDefaultService;
|
||||
//import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
//import com.ruoyi.common.core.page.TableDataInfo;
|
||||
//
|
||||
///**
|
||||
// * 资源位默认配置Controller
|
||||
// *
|
||||
// * @author haotian
|
||||
// * @date 2025-04-21
|
||||
// */
|
||||
//@RestController
|
||||
//@RequestMapping("/system/default")
|
||||
//public class SysSourceDefaultController extends BaseController
|
||||
//{
|
||||
// @Autowired
|
||||
// private ISysSourceDefaultService sysSourceDefaultService;
|
||||
//
|
||||
// /**
|
||||
// * 查询资源位默认配置列表
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('system:default:list')")
|
||||
// @GetMapping("/list")
|
||||
// public TableDataInfo list(SysSourceDefault sysSourceDefault)
|
||||
// {
|
||||
// startPage();
|
||||
// List<SysSourceDefault> list = sysSourceDefaultService.selectSysSourceDefaultList(sysSourceDefault);
|
||||
// return getDataTable(list);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 导出资源位默认配置列表
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('system:default:export')")
|
||||
// @Log(title = "资源位默认配置", businessType = BusinessType.EXPORT)
|
||||
// @PostMapping("/export")
|
||||
// public void export(HttpServletResponse response, SysSourceDefault sysSourceDefault)
|
||||
// {
|
||||
// List<SysSourceDefault> list = sysSourceDefaultService.selectSysSourceDefaultList(sysSourceDefault);
|
||||
// ExcelUtil<SysSourceDefault> util = new ExcelUtil<SysSourceDefault>(SysSourceDefault.class);
|
||||
// util.exportExcel(response, list, "资源位默认配置数据");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取资源位默认配置详细信息
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('system:default:query')")
|
||||
// @GetMapping(value = "/{id}")
|
||||
// public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
// {
|
||||
// return success(sysSourceDefaultService.selectSysSourceDefaultById(id));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 新增资源位默认配置
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('system:default:add')")
|
||||
// @Log(title = "资源位默认配置", businessType = BusinessType.INSERT)
|
||||
// @PostMapping
|
||||
// public AjaxResult add(@RequestBody SysSourceDefault sysSourceDefault)
|
||||
// {
|
||||
// return toAjax(sysSourceDefaultService.insertSysSourceDefault(sysSourceDefault));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 修改资源位默认配置
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('system:default:edit')")
|
||||
// @Log(title = "资源位默认配置", businessType = BusinessType.UPDATE)
|
||||
// @PutMapping
|
||||
// public AjaxResult edit(@RequestBody SysSourceDefault sysSourceDefault)
|
||||
// {
|
||||
// return toAjax(sysSourceDefaultService.updateSysSourceDefault(sysSourceDefault));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 删除资源位默认配置
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('system:default:remove')")
|
||||
// @Log(title = "资源位默认配置", businessType = BusinessType.DELETE)
|
||||
// @DeleteMapping("/{ids}")
|
||||
// public AjaxResult remove(@PathVariable Long[] ids)
|
||||
// {
|
||||
// return toAjax(sysSourceDefaultService.deleteSysSourceDefaultByIds(ids));
|
||||
// }
|
||||
//}
|
||||
|
||||
@ -2,7 +2,8 @@ package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysSourceDefault;
|
||||
|
||||
//import io.lettuce.core.dynamic.annotation.Param;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
/**
|
||||
* 资源位默认配置Mapper接口
|
||||
*
|
||||
@ -58,4 +59,10 @@ public interface SysSourceDefaultMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysSourceDefaultByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
*
|
||||
* 根据资源位id修改默认背景图片@Param("city")
|
||||
* */
|
||||
public int updateSysSourceDefaultWorkBySourceId(@Param("sourceId") Long sourceId, @Param("workAddress") String workAddress);
|
||||
}
|
||||
|
||||
@ -58,4 +58,10 @@ public interface ISysSourceDefaultService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysSourceDefaultById(Long id);
|
||||
|
||||
/**
|
||||
*
|
||||
* 根据资源位id修改默认背景图片
|
||||
* */
|
||||
public int updateSysSourceDefaultWorkBySourceId(Long sourceId, String workAddress);
|
||||
}
|
||||
|
||||
@ -93,4 +93,13 @@ public class SysSourceDefaultServiceImpl implements ISysSourceDefaultService
|
||||
{
|
||||
return sysSourceDefaultMapper.deleteSysSourceDefaultById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 根据资源位id修改默认背景图片
|
||||
* */
|
||||
@Override
|
||||
public int updateSysSourceDefaultWorkBySourceId(Long sourceId, String workAddress){
|
||||
return sysSourceDefaultMapper.updateSysSourceDefaultWorkBySourceId(sourceId, workAddress);
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,6 +72,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="updateSysSourceDefaultWorkBySourceId">
|
||||
update sys_source_default set work_address = #{workAddress} where source_id = #{sourceId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysSourceDefaultById" parameterType="Long">
|
||||
delete from sys_source_default where id = #{id}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user