| | |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.TErpGoodsAddDto; |
| | | import com.ruoyi.system.dto.TErpGoodsUpdateStatus; |
| | | import com.ruoyi.system.dto.TErpGoodsInfoSaveDto; |
| | | import com.ruoyi.system.dto.TErpGoodsUpdateStatusDto; |
| | | import com.ruoyi.system.model.TErpGoods; |
| | | import com.ruoyi.system.query.TErpGoodsQuery; |
| | | import com.ruoyi.system.query.TErpIssueReportingQuery; |
| | | import com.ruoyi.system.service.TCrmClinicService; |
| | | import com.ruoyi.system.service.TCrmSupplierService; |
| | | import com.ruoyi.system.service.TErpGoodsService; |
| | | import com.ruoyi.system.service.TErpIssueReportingService; |
| | | import com.ruoyi.system.vo.TErpGoodsVO; |
| | | import com.ruoyi.system.vo.TErpIssueReportingVO; |
| | | 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 javax.validation.Valid; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @ApiOperation(value = "供应商添加商品") |
| | | @PostMapping(value = "/add") |
| | | public R<Boolean> add(@Validated @RequestBody TErpGoodsAddDto dto) { |
| | | if (erpGoodsService.isExit(dto.getGoodsIdCode())) { |
| | | SysUser user = tokenService.getLoginUser().getUser(); |
| | | if (erpGoodsService.isExit(dto.getGoodsIdCode(), dto.getQuasiNumber())) { |
| | | return R.fail("erp商品已存在"); |
| | | } |
| | | TErpGoods goods = new TErpGoods(); |
| | | goods.setSupplierId(user.getClinicId()); |
| | | goods.setSupplierClinicId(user.getUserId().toString()); |
| | | goods.setGoodsIdCode(dto.getGoodsIdCode()); |
| | | goods.setQuasiNumber(dto.getQuasiNumber()); |
| | | goods.setManufacturer(dto.getManufacturer()); |
| | |
| | | boolean b = erpGoodsService.updateById(goods); |
| | | return R.ok(b); |
| | | } |
| | | |
| | | @ApiOperation(value = "供应商完善商品") |
| | | @PostMapping(value = "/saveDataInfo") |
| | | public R<Boolean> saveDataInfo(@RequestBody @Valid TErpGoodsInfoSaveDto dto) { |
| | | TErpGoods goods = erpGoodsService.getById(dto.getId()); |
| | | BeanUtils.copyProperties(dto,goods); |
| | | return R.ok(erpGoodsService.updateById(goods)); |
| | | } |
| | | |
| | | @ApiOperation(value = "供应商商品详情") |
| | | @GetMapping(value = "/detail/{id}") |
| | | public R<TErpGoods> detail( @PathVariable String id) { |
| | | TErpGoods goods = erpGoodsService.getById(id); |
| | | return R.ok(goods); |
| | | } |
| | | |
| | | |
| | | } |
| | | |