| | |
| | | import com.consum.base.service.BaseGoodsTemplateServiceImpl; |
| | | import com.consum.base.service.BaseWarehouseServiceImpl; |
| | | import com.consum.base.service.LWhGoodsService; |
| | | import com.consum.model.po.BaseGoodsModels; |
| | | import com.consum.model.po.BaseGoodsTemplate; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.SDictData; |
| | | import com.consum.model.po.*; |
| | | import com.consum.model.vo.BaseGoodsTemplateVo; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.web.ResponseValue; |
| | |
| | | */ |
| | | @PostMapping("/add") |
| | | public ResponseValue add(@RequestBody BaseGoodsTemplateParam param) { |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | if (param.getCategoryId() == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | if (param.getCategoryId() == null) { |
| | | return ResponseValue.error("分类为空"); |
| | | } |
| | |
| | | return ResponseValue.error("物品名称已存在"); |
| | | } |
| | | |
| | | int result = this.baseGoodsTemplateService.add(param, this.getCurrentUser()); |
| | | int result = this.baseGoodsTemplateService.add(param, sysInfo); |
| | | if (result > 0) { |
| | | return ResponseValue.success(1); |
| | | } |
| | |
| | | */ |
| | | @GetMapping("/list") |
| | | public ResponseValue queryList(BaseGoodsTemplateParam param) { |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | if (currentUser == null) { |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | param.setAgencyId(Long.valueOf(sysInfo.getTenantId())); |
| | | GenericPager<BaseGoodsTemplate> pager = this.baseGoodsTemplateService.queryList(param); |
| | | return ResponseValue.success(pager); |
| | | } |
| | |
| | | |
| | | @GetMapping("/query/goodsTemplate") |
| | | public ResponseValue queryGoodsTemplateByCategoryId(Long agencyId, Long categoryId) { |
| | | List<BaseGoodsTemplate> list = this.baseGoodsTemplateService.queryGoodsTemplateByCategoryId(agencyId, categoryId); |
| | | List<BaseGoodsTemplate> list = this.baseGoodsTemplateService.queryGoodsTemplateByCategoryId(agencyId, categoryId,null,null); |
| | | if (list == null) { |
| | | return ResponseValue.error("查询失败!"); |
| | | } |
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("categoryId", categoryId); |
| | | |
| | | List<BaseWarehouse> baseWarehouseList = baseWarehouseService.getByAgencyId(agencyId,(short)1,(short)1); |
| | | if (CollectionUtils.isEmpty(baseWarehouseList)){ |
| | | List<BaseWarehouse> baseWarehouseList = baseWarehouseService.getByAgencyId(agencyId, (short) 1, (short) 1); |
| | | if (CollectionUtils.isEmpty(baseWarehouseList)) { |
| | | return ResponseValue.error("机构无默认仓库!"); |
| | | |
| | | } |