| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.system.domain.TFoundationConfig; |
| | | import com.ruoyi.system.domain.TFoundationPerson; |
| | | import com.ruoyi.system.domain.TShop; |
| | | import com.ruoyi.system.dto.TFoundationPersonBatchDTO; |
| | | import com.ruoyi.system.dto.TFoundationPersonDTO; |
| | | import com.ruoyi.system.query.TFoundationPersonQuery; |
| | | import com.ruoyi.system.service.TFoundationConfigService; |
| | | import com.ruoyi.system.service.TFoundationPersonService; |
| | | import com.ruoyi.system.service.TShopService; |
| | | import com.ruoyi.system.vo.TFoundationPersonVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import oshi.driver.unix.aix.Ls; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | |
| | | public class TFoundationPersonController { |
| | | private final TFoundationPersonService foundationPersonService; |
| | | private final TFoundationConfigService foundationConfigService; |
| | | private final TShopService shopService; |
| | | |
| | | @Autowired |
| | | public TFoundationPersonController(TFoundationPersonService foundationPersonService, TFoundationConfigService foundationConfigService) { |
| | | public TFoundationPersonController(TFoundationPersonService foundationPersonService, TFoundationConfigService foundationConfigService, TShopService shopService) { |
| | | this.foundationPersonService = foundationPersonService; |
| | | this.foundationConfigService = foundationConfigService; |
| | | this.shopService = shopService; |
| | | } |
| | | /** |
| | | * 查询基础设置列表 |
| | | */ |
| | | @ApiOperation( value = "查询基础设置列表") |
| | | @PostMapping(value = "/list") |
| | | public AjaxResult<List<TFoundationPersonVO>> list() { |
| | | return AjaxResult.success(foundationPersonService.getList()); |
| | | public AjaxResult<PageInfo<TFoundationPersonVO>> list(@RequestBody TFoundationPersonQuery query) { |
| | | return AjaxResult.success(foundationPersonService.getList(query)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiOperation( value = "添加基础设置") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TFoundationPersonDTO dto) { |
| | | dto.setCreateTime(LocalDateTime.now()); |
| | | public AjaxResult<Boolean> add(@RequestBody TFoundationPersonBatchDTO dto) { |
| | | foundationPersonService.add(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | |
| | | */ |
| | | @ApiOperation( value = "修改基础设置") |
| | | @PostMapping(value = "/update") |
| | | public AjaxResult<Boolean> update(@RequestBody TFoundationPersonDTO dto) { |
| | | public AjaxResult<Boolean> update(@RequestBody TFoundationPersonBatchDTO dto) { |
| | | foundationPersonService.edit(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | |
| | | TFoundationPersonVO foundationPersonVO = new TFoundationPersonVO(); |
| | | BeanUtils.copyProperties(foundationPerson, foundationPersonVO); |
| | | foundationPersonVO.setFoundationConfigs(list); |
| | | // 查询店铺 |
| | | TShop shop = shopService.getById(foundationPersonVO.getShopId()); |
| | | foundationPersonVO.setShop(shop); |
| | | return AjaxResult.success(foundationPersonVO); |
| | | } |
| | | |