完成修改资源位价格。
This commit is contained in:
parent
044f0638f4
commit
3f2224f18f
@ -96,7 +96,7 @@ public class BackstageController {
|
||||
@PostMapping("/changeUserStatus")
|
||||
public AjaxResult changeUserState(@RequestBody UpdateUserStateDto updateUserStateDto){
|
||||
|
||||
if(isAtuthority(Constants.USER_TYPE_ADMIN)){
|
||||
if(isAuthority(Constants.USER_TYPE_ADMIN)){
|
||||
String username = updateUserStateDto.getUsername();
|
||||
String status = updateUserStateDto.getStatus();
|
||||
|
||||
@ -118,7 +118,7 @@ public class BackstageController {
|
||||
@GetMapping("/getUserCount")
|
||||
public AjaxResult getUserCount(){
|
||||
|
||||
if(isAtuthority(Constants.USER_TYPE_ADMIN)) {
|
||||
if(isAuthority(Constants.USER_TYPE_ADMIN)) {
|
||||
|
||||
AjaxResult ajax = new AjaxResult();
|
||||
|
||||
@ -134,7 +134,7 @@ public class BackstageController {
|
||||
|
||||
@GetMapping("/getSeUserCount")
|
||||
public AjaxResult getSeUserCount(){
|
||||
if(isAtuthority(Constants.USER_TYPE_ADMIN)){
|
||||
if(isAuthority(Constants.USER_TYPE_ADMIN)){
|
||||
AjaxResult ajax = new AjaxResult();
|
||||
// startPage();
|
||||
List<SeUserCountDto> seUserCount = sysUserCountService.getSeUserCount();
|
||||
@ -149,7 +149,7 @@ public class BackstageController {
|
||||
// 获取所有用户作品
|
||||
@GetMapping("/getAllUserWork")
|
||||
public AjaxResult getAllUserWork(){
|
||||
if(isAtuthority(Constants.USER_TYPE_ADMIN)){
|
||||
if(isAuthority(Constants.USER_TYPE_ADMIN)){
|
||||
AjaxResult ajax = new AjaxResult();
|
||||
startPage();
|
||||
List<UserWork> userWorkList = userWorkService.selectUserWorkList(new UserWork());
|
||||
@ -164,7 +164,7 @@ public class BackstageController {
|
||||
// 获取近7天作品总数
|
||||
@GetMapping("/getSeUserWorkCount")
|
||||
public AjaxResult getSeUserWorkCount(){
|
||||
if(isAtuthority(Constants.USER_TYPE_ADMIN)){
|
||||
if(isAuthority(Constants.USER_TYPE_ADMIN)){
|
||||
AjaxResult ajax = new AjaxResult();
|
||||
startPage();
|
||||
List<SeUserWorkCountDto> seUserWorkCount = sysUserWorkCountService.getSeUserWorkCount();
|
||||
@ -237,7 +237,7 @@ public class BackstageController {
|
||||
* 获取所有城市数景区数资源位数*/
|
||||
@GetMapping("stCityScenicSource")
|
||||
public AjaxResult getAllCity(){
|
||||
if(isAtuthority(Constants.USER_TYPE_ADMIN)) {
|
||||
if(isAuthority(Constants.USER_TYPE_ADMIN)) {
|
||||
int city_count = sysCityService.selectSysCityList(new SysCity()).size();
|
||||
|
||||
int scenic_count = sysScenicService.selectSysScenicList(new SysScenic()).size();
|
||||
@ -257,7 +257,7 @@ public class BackstageController {
|
||||
* 获取所有资源位详情*/
|
||||
@GetMapping("getAllSource")
|
||||
public AjaxResult getAllSource(){
|
||||
if(isAtuthority(Constants.USER_TYPE_ADMIN)){
|
||||
if(isAuthority(Constants.USER_TYPE_ADMIN)){
|
||||
startPage();
|
||||
List<SysSource> sysSourceList = sysSourceService.selectSysSourceList(new SysSource());
|
||||
AjaxResult ajax = new AjaxResult();
|
||||
@ -271,7 +271,7 @@ public class BackstageController {
|
||||
@PostMapping("/changeSourceBackground")
|
||||
public AjaxResult updateUserInfo(@RequestParam("changeSourceBackgroundDto") String changeSourceBackgroundDt,@RequestParam("work") MultipartFile work)
|
||||
{
|
||||
if(isAtuthority(Constants.USER_TYPE_ADMIN)) {
|
||||
if(isAuthority(Constants.USER_TYPE_ADMIN)) {
|
||||
|
||||
|
||||
|
||||
@ -324,6 +324,30 @@ public class BackstageController {
|
||||
// return AjaxResult.success();
|
||||
}
|
||||
|
||||
//修改资源位价格,
|
||||
// 参数: 城市,景区,区域,价格
|
||||
@PostMapping("/changeSourcePrice")
|
||||
public AjaxResult changeSourcePrice(@RequestBody ChangeSourcePriceDto changeSourcePriceDto){
|
||||
if(isAuthority(Constants.USER_TYPE_ADMIN)) {
|
||||
String city = changeSourcePriceDto.getCity();
|
||||
String scenic = changeSourcePriceDto.getScenic();
|
||||
String part = changeSourcePriceDto.getPart();
|
||||
SourcePriceDto price = changeSourcePriceDto.getPrice();
|
||||
|
||||
System.out.println(price.toString());
|
||||
|
||||
int back = sysSourceService.updateDefaultSourcePrice(city, scenic, part, price.toString());
|
||||
|
||||
if(back > 0){
|
||||
return success("更新资源位默认价格成功");
|
||||
}
|
||||
return error("更新资源位默认价格失败");
|
||||
|
||||
}
|
||||
return error("无权限");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -395,7 +419,7 @@ public class BackstageController {
|
||||
rspData.setMsg("无权限");
|
||||
return rspData;
|
||||
}
|
||||
private boolean isAtuthority(String type){
|
||||
private boolean isAuthority(String type){
|
||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||
Long userId = user.getUserId();
|
||||
SysUser user1 = sysUserService.selectUserById(userId);
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
package com.ruoyi.system.domain.dto;
|
||||
|
||||
public class ChangeSourcePriceDto {
|
||||
private String city;
|
||||
private String scenic;
|
||||
private String part;
|
||||
private SourcePriceDto price;
|
||||
|
||||
public String getCity() {
|
||||
return city;
|
||||
}
|
||||
public void setCity(String city) {
|
||||
this.city = city;
|
||||
}
|
||||
public String getScenic() {
|
||||
return scenic;
|
||||
}
|
||||
public void setScenic(String scenic) {
|
||||
this.scenic = scenic;
|
||||
}
|
||||
public String getPart() {
|
||||
return part;
|
||||
}
|
||||
public void setPart(String part) {
|
||||
this.part = part;
|
||||
}
|
||||
public SourcePriceDto getPrice() {
|
||||
return price;
|
||||
}
|
||||
public void setPrice(SourcePriceDto price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package com.ruoyi.system.domain.dto;
|
||||
|
||||
public class SourcePriceDto {
|
||||
private String one;
|
||||
private String seven;
|
||||
private String fifteen;
|
||||
private String thirty;
|
||||
|
||||
public String getOne() {
|
||||
return one;
|
||||
}
|
||||
public void setOne(String one) {
|
||||
this.one = one;
|
||||
}
|
||||
public String getSeven() {
|
||||
return seven;
|
||||
}
|
||||
|
||||
public void setSeven(String seven) {
|
||||
this.seven = seven;
|
||||
}
|
||||
|
||||
public String getFifteen() {
|
||||
return fifteen;
|
||||
}
|
||||
|
||||
public void setFifteen(String fifteen) {
|
||||
this.fifteen = fifteen;
|
||||
}
|
||||
|
||||
public String getThirty() {
|
||||
return thirty;
|
||||
}
|
||||
|
||||
public void setThirty(String thirty) {
|
||||
this.thirty = thirty;
|
||||
}
|
||||
public String toString(){
|
||||
return "{" +
|
||||
"\"one\": " + one +
|
||||
", \"seven\": " + seven +
|
||||
", \"fifteen\": " + fifteen +
|
||||
", \"thirty\": " + thirty +"}";
|
||||
}
|
||||
|
||||
}
|
||||
@ -2,6 +2,7 @@ package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysSource;
|
||||
import com.ruoyi.system.domain.dto.SourcePriceDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
@ -49,6 +50,8 @@ public interface SysSourceMapper
|
||||
* */
|
||||
public int updateDefaultSourceWorkAddress(@Param("city") String city,@Param("scenic") String scenic,@Param("part") String part,@Param("sourceStatus") String sourceStatus, @Param("workAddress")String workAddress);
|
||||
|
||||
public int updateDefaultSourcePrice(@Param("city") String city,@Param("scenic") String scenic,@Param("part") String part, @Param("price") String price);
|
||||
|
||||
/**
|
||||
* 删除资源位
|
||||
*
|
||||
|
||||
@ -2,6 +2,8 @@ package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysSource;
|
||||
import com.ruoyi.system.domain.dto.ChangeSourcePriceDto;
|
||||
import com.ruoyi.system.domain.dto.SourcePriceDto;
|
||||
|
||||
/**
|
||||
* 资源位Service接口
|
||||
@ -48,6 +50,12 @@ public interface ISysSourceService
|
||||
* */
|
||||
public int updateDefaultSourceWorkAddress(String city, String scenic, String part, String sourceStatus, String workAddress);
|
||||
|
||||
/*
|
||||
*更新默认价格
|
||||
*/
|
||||
public int updateDefaultSourcePrice(String city, String scenic, String part, String price);
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除资源位
|
||||
*
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.system.domain.dto.SourcePriceDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.SysSourceMapper;
|
||||
@ -73,6 +75,12 @@ public class SysSourceServiceImpl implements ISysSourceService
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateDefaultSourcePrice(String city, String scenic, String part, String price){
|
||||
return sysSourceMapper.updateDefaultSourcePrice(city, scenic, part, price);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除资源位
|
||||
*
|
||||
|
||||
@ -111,6 +111,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<update id="updateDefaultSourceWorkAddress" parameterType="String">
|
||||
update sys_source set work_address = #{workAddress} where city = #{city} and scenic = #{scenic} and part = #{part} and source_status = #{sourceStatus}
|
||||
</update>
|
||||
<update id="updateDefaultSourcePrice">
|
||||
update sys_source set price = #{price} where city = #{city} and scenic = #{scenic} and part = #{part}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysSourceBySourceId" parameterType="Long">
|
||||
delete from sys_source where source_id = #{sourceId}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user