| | |
| | | import com.ruoyi.system.dto.*; |
| | | import com.ruoyi.system.importExcel.TErpGoodsExcel; |
| | | import com.ruoyi.system.model.*; |
| | | import com.ruoyi.system.query.PageAddListQuery; |
| | | import com.ruoyi.system.query.TErpGoodsAdminQuery; |
| | | import com.ruoyi.system.query.TErpGoodsQuery; |
| | | import com.ruoyi.system.service.*; |
| | |
| | | */ |
| | | @ApiOperation(value = "诊所 一键获取商品分页列表") |
| | | @PostMapping(value = "/pageAddList") |
| | | public R<Page<TErpGoods>> pageAddList(@RequestBody BasePage query) { |
| | | public R<Page<TErpGoods>> pageAddList(@RequestBody PageAddListQuery query) { |
| | | SysUser user = tokenService.getLoginUser().getUser(); |
| | | Integer roleType = user.getRoleType(); |
| | | String clinicSupplierId=null; |
| | |
| | | } |
| | | Page<TErpGoods> tErpGoodsPage = new Page<>(query.getPageNum(), query.getPageSize()); |
| | | |
| | | Page<TErpGoods> page = erpGoodsService.page(tErpGoodsPage, new LambdaQueryWrapper<TErpGoods>().eq(TErpGoods::getGoodsSource, 1).eq(TErpGoods::getState,1).eq(BaseModel::getDisabled, 0).isNotNull(TErpGoods::getPlatformCommissionPrice).last("and (NOT FIND_IN_SET(" + clinicSupplierId + ",clinic_ids) or clinic_ids is null)")); |
| | | for (TErpGoods record : page.getRecords()) { |
| | | TCrmSupplier byId = crmSupplierService.getById(record.getSupplierClinicId()); |
| | | record.setSupplierName(byId.getSupplierName()); |
| | | |
| | | |
| | | TErpGoodsType byId1 = erpGoodsTypeService.getById(record.getTypeId()); |
| | | record.setTypeName(byId1.getTypeName()); |
| | | |
| | | } |
| | | return R.ok(page); |
| | | List<TErpGoods> page = erpGoodsService.pageAddList(tErpGoodsPage,clinicSupplierId,query); |
| | | tErpGoodsPage.setRecords(page); |
| | | return R.ok(tErpGoodsPage); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | goods.setCreateId(user.getUserId().toString()); |
| | | goods.setGoodsIdCode(dto.getGoodsIdCode()); |
| | | goods.setClinicPurchasePrice(dto.getSalesAmount()); |
| | | // goods.setClinicPurchasePrice(dto.getSalesAmount()); |
| | | return R.ok(erpGoodsService.save(goods)); |
| | | } |
| | | |