| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.BaseModel; |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.WebUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.*; |
| | |
| | | */ |
| | | @ApiOperation(value = "诊所 一键获取商品 获取全部") |
| | | @PostMapping(value = "/getAllGoodsList") |
| | | @Log(title = "商品管理-诊所 一键获取商品", businessType = BusinessType.INSERT) |
| | | public R<?> getAllGoodsList() { |
| | | SysUser user = tokenService.getLoginUser().getUser(); |
| | | Integer roleType = user.getRoleType(); |
| | |
| | | |
| | | @ApiOperation(value = "供应商添加商品") |
| | | @PostMapping(value = "/add") |
| | | @Log(title = "商品管理-供应商添加", businessType = BusinessType.INSERT) |
| | | public R<Boolean> add(@Validated @RequestBody TErpGoodsAddDto dto) { |
| | | SysUser user = tokenService.getLoginUser().getUser(); |
| | | if (erpGoodsService.isExit(dto.getGoodsIdCode(), dto.getQuasiNumber(),null)) { |
| | |
| | | } |
| | | @ApiOperation(value = "诊所添加商品") |
| | | @PostMapping(value = "/clinicAdd") |
| | | @Log(title = "商品管理-诊所添加", businessType = BusinessType.INSERT) |
| | | public R<Boolean> clinicAdd(@Validated @RequestBody TErpClinicGoodsAddDto dto) { |
| | | SysUser user = tokenService.getLoginUser().getUser(); |
| | | if (erpGoodsService.isExit(dto.getGoodsIdCode(), dto.getQuasiNumber(),null)) { |
| | |
| | | |
| | | @ApiOperation(value = "诊所编辑商品") |
| | | @PostMapping(value = "/clinicUpdate") |
| | | @Log(title = "商品管理-诊所编辑", businessType = BusinessType.UPDATE) |
| | | public R<Boolean> clinicUpdate(@Validated @RequestBody TErpClinicGoodsUpdateDto dto) { |
| | | SysUser user = tokenService.getLoginUser().getUser(); |
| | | if (erpGoodsService.isExit(dto.getGoodsIdCode(), dto.getQuasiNumber(),dto.getId())) { |
| | |
| | | |
| | | @ApiOperation(value = "供应商/诊所 删除商品") |
| | | @DeleteMapping(value = "/delete/{id}") |
| | | @Log(title = "商品管理-删除", businessType = BusinessType.DELETE) |
| | | public R<Boolean> delete(@PathVariable String id) { |
| | | TErpGoods goods = erpGoodsService.getById(id); |
| | | SysUser user = tokenService.getLoginUser().getUser(); |
| | |
| | | |
| | | @ApiOperation(value = "诊所 一键添加商品") |
| | | @PostMapping(value = "/addSupplierGoods") |
| | | @Log(title = "商品管理-诊所一键添加商品", businessType = BusinessType.INSERT) |
| | | public R<Boolean> addSupplierGoods(@RequestBody AddSupplierGoodsDto dto) { |
| | | // List<String> split = Arrays.asList(goodsIds.split(",")); |
| | | List<TErpGoods> list = erpGoodsService.list(new LambdaQueryWrapper<TErpGoods>().in(TErpGoods::getId, dto.getGoodsIds())); |
| | |
| | | */ |
| | | @ApiOperation(value = "供应商启用 停用商品") |
| | | @PostMapping(value = "/updateStatus") |
| | | @Log(title = "商品管理-供应商启用/停用商品", businessType = BusinessType.UPDATE) |
| | | public R<Boolean> updateStatus(@RequestBody TErpGoodsUpdateStatusDto dto) { |
| | | TErpGoods goods = erpGoodsService.getById(dto.getId()); |
| | | if(dto.getState()==1 && goods.getTypeId()==null){ |
| | |
| | | |
| | | @ApiOperation(value = "供应商完善商品") |
| | | @PostMapping(value = "/saveDataInfo") |
| | | @Log(title = "商品管理-供应商完善商品", businessType = BusinessType.UPDATE) |
| | | public R<Boolean> saveDataInfo(@RequestBody @Valid TErpGoodsInfoSaveDto dto) { |
| | | SysUser user = tokenService.getLoginUser().getUser(); |
| | | Integer roleType = user.getRoleType(); |
| | |
| | | |
| | | @ApiOperation(value = "商品管理信息导出--导出") |
| | | @PostMapping("/export") |
| | | @Log(title = "商品管理-导出", businessType = BusinessType.EXPORT) |
| | | public void listExport(@RequestBody TErpGoodsQuery query) |
| | | { |
| | | SysUser user = tokenService.getLoginUser().getUser(); |
| | |
| | | |
| | | @ApiOperation(value = "商品管理信息导入") |
| | | @PostMapping("/importFile") |
| | | @Log(title = "商品管理-导入", businessType = BusinessType.IMPORT) |
| | | public AjaxResult importFile(@RequestParam(value = "file") MultipartFile file ) { |
| | | |
| | | SysUser user = tokenService.getLoginUser().getUser(); |
| | |
| | | |
| | | @ApiOperation(value = "平台设置分佣") |
| | | @PostMapping(value = "/setCommission") |
| | | @Log(title = "商品管理-平台设置分佣", businessType = BusinessType.UPDATE) |
| | | public R<Boolean> setCommission(@RequestBody @Valid TErpGoodsSetCommissionDto dto) { |
| | | |
| | | SysUser user = tokenService.getLoginUser().getUser(); |