| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.ClinicOutboundGoodsDto; |
| | | import com.ruoyi.system.dto.InventoryDto; |
| | | import com.ruoyi.system.dto.clinicWarehouseGoodsDto; |
| | | import com.ruoyi.system.model.TCrmClinic; |
| | | import com.ruoyi.system.model.TCrmSupplier; |
| | | import com.ruoyi.system.query.TErpGoodsInventoryQuery; |
| | | import com.ruoyi.system.query.TErpGoodsQuery; |
| | | import com.ruoyi.system.query.TErpInventoryQuery; |
| | | import com.ruoyi.system.query.ValidityPeriodWarningQuery; |
| | | import com.ruoyi.system.model.TErpClinicOutbound; |
| | | import com.ruoyi.system.model.TErpGoods; |
| | | import com.ruoyi.system.query.*; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/t-erp-clinic-warehousing") |
| | | @Api(tags = "诊所库存管理") |
| | | public class TErpClinicWarehousingController { |
| | | |
| | | private final TErpClinicWarehousingService erpClinicWarehousingService; |
| | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取erp问题上报管理列表 |
| | | */ |
| | | @ApiOperation(value = "诊所 入库列表") |
| | | @PostMapping(value = "/warehousePageList") |
| | | public R<PageInfo<TErpClinicWarehousePageListVO>> warehousePageList(@RequestBody TClinicWarehouseQuery query) { |
| | | |
| | | SysUser user = tokenService.getLoginUser().getUser(); |
| | | Integer roleType = user.getRoleType(); |
| | | String supplierClinicId =null; |
| | | if(roleType == 5){ |
| | | // 诊所 |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | supplierClinicId = crmClinic.getId(); |
| | | } |
| | | |
| | | return R.ok(erpClinicWarehousingService.warehousePageList(query,user,supplierClinicId)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "诊所 入库商品列表") |
| | | @PostMapping(value = "/warehouseGoodsPageList") |
| | | public R<Page<TErpGoods>> warehouseGoodsPageList(@RequestBody TClinicGoodsWarehouseQuery query) { |
| | | |
| | | SysUser user = tokenService.getLoginUser().getUser(); |
| | | Integer roleType = user.getRoleType(); |
| | | String supplierClinicId =null; |
| | | if(roleType == 5){ |
| | | // 诊所 |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | supplierClinicId = crmClinic.getId(); |
| | | } |
| | | |
| | | return R.ok(erpGoodsService.warehouseGoodsPageList(query,user,supplierClinicId)); |
| | | } |
| | | @ApiOperation(value = "诊所 入库商品详情") |
| | | @GetMapping(value = "/warehouseGoodsDetail/{id}") |
| | | public R<WarehouseGoodsDetailVo> warehouseGoodsDetail(@PathVariable String id) { |
| | | SysUser user = tokenService.getLoginUser().getUser(); |
| | | Integer roleType = user.getRoleType(); |
| | | String supplierClinicId =null; |
| | | if(roleType == 5){ |
| | | // 诊所 |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | supplierClinicId = crmClinic.getId(); |
| | | } |
| | | |
| | | return R.ok(erpGoodsService.warehouseGoodsDetail(id)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "诊所 出库商品详情") |
| | | @GetMapping(value = "/outboundGoodsDetail/{id}") |
| | | public R<OutboundGoodsDetailVo> outboundGoodsDetail(@PathVariable String id) { |
| | | SysUser user = tokenService.getLoginUser().getUser(); |
| | | Integer roleType = user.getRoleType(); |
| | | String supplierClinicId =null; |
| | | if(roleType == 5){ |
| | | // 诊所 |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | supplierClinicId = crmClinic.getId(); |
| | | } |
| | | |
| | | return R.ok(erpGoodsService.outboundGoodsDetail(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "诊所 入库商品操作") |
| | | @PostMapping(value = "/warehouseGoods") |
| | | public R<?> warehouseGoods(@RequestBody @Valid List<clinicWarehouseGoodsDto> dtos) { |
| | | SysUser user = tokenService.getLoginUser().getUser(); |
| | | Integer roleType = user.getRoleType(); |
| | | String supplierClinicId =null; |
| | | if(roleType == 5){ |
| | | // 诊所 |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | supplierClinicId = crmClinic.getId(); |
| | | } |
| | | erpClinicWarehousingService.warehouseGoods(dtos,user,supplierClinicId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取erp问题上报管理列表 |
| | | */ |
| | | @ApiOperation(value = "诊所 出库列表") |
| | | @PostMapping(value = "/outboundPageList") |
| | | public R<PageInfo<TErpClinicOutboundPageListVO>> outboundPageList(@RequestBody TClinicOutboundQuery query) { |
| | | SysUser user = tokenService.getLoginUser().getUser(); |
| | | Integer roleType = user.getRoleType(); |
| | | String supplierClinicId =null; |
| | | if(roleType == 5){ |
| | | // 诊所 |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | supplierClinicId = crmClinic.getId(); |
| | | } |
| | | |
| | | return R.ok(erpClinicWarehousingService.outboundPageList(query,user,supplierClinicId)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "诊所 出库商品操作") |
| | | @PostMapping(value = "/outboundGoods") |
| | | public R<?> outboundGoods(@RequestBody @Valid ClinicOutboundGoodsDto dto) { |
| | | SysUser user = tokenService.getLoginUser().getUser(); |
| | | Integer roleType = user.getRoleType(); |
| | | String supplierClinicId =null; |
| | | if(roleType == 5){ |
| | | // 诊所 |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, user.getUserId()) |
| | | .last("LIMIT 1")); |
| | | supplierClinicId = crmClinic.getId(); |
| | | } |
| | | erpClinicWarehousingService.outboundGoods(dto,user,supplierClinicId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |