| | |
| | | import com.consum.base.Constants; |
| | | import com.consum.base.core.CodeGeneratorService; |
| | | import com.consum.base.pojo.BaseWarehouseParam; |
| | | import com.consum.base.util.IdUtil; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.FinSysTenant; |
| | | import com.consum.model.po.FinSysTenantDepartment; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.base.core.utils.IdUtil; |
| | | import com.consum.model.po.*; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | |
| | | private FinSysTenantDepartmentServiceImpl departmentService; |
| | | @Autowired |
| | | private FinSysTenantUserServiceImpl userService; |
| | | @Autowired |
| | | private SDictDataServiceImpl sDictDataService; |
| | | |
| | | /** |
| | | * @Description 新增 |
| | |
| | | baseWarehouse.setId(IdUtil.generateId()); |
| | | baseWarehouse.setWarehouseType(Constants.WAREHOUSE_TYPE_TENANT); |
| | | baseWarehouse.setWarehouseCode(codeGeneratorService.createWarehouseCode()); |
| | | // //根据机构id查询机构 |
| | | // FinSysTenant finSysTenant = finSysTenantService.get(new FinSysTenant(baseWarehouse.getAgencyId())); |
| | | // if (finSysTenant != null) { |
| | | // baseWarehouse.setParentAgencyId(finSysTenant.getParentId()); |
| | | // baseWarehouse.setAgencyName(finSysTenant.getName()); |
| | | // } |
| | | //根据机构id查询机构 |
| | | FinSysTenant finSysTenant = finSysTenantService.get(new FinSysTenant(baseWarehouse.getAgencyId())); |
| | | if (finSysTenant != null) { |
| | | baseWarehouse.setParentAgencyId(finSysTenant.getParentId()); |
| | | baseWarehouse.setAgencyName(finSysTenant.getName()); |
| | | } |
| | | //根据CLASSIFICATION_CODE查询CLASSIFICATION_NAME |
| | | SDictData dictData = this.sDictDataService.get(new SDictData(Long.valueOf(param.getClassificationCode()))); |
| | | if (dictData != null) { |
| | | baseWarehouse.setClassificationName(dictData.getDict_label()); |
| | | } |
| | | baseWarehouse.setIsDefault(Constants.IS_DEFAULT_YES); |
| | | |
| | | return this.insert(baseWarehouse); |
| | |
| | | * @Date 2023/10/26 |
| | | */ |
| | | public int updateBaseWarehouse(BaseWarehouse baseWarehouse) { |
| | | SDictData SDictData = this.sDictDataService.get(new SDictData(Long.valueOf(baseWarehouse.getClassificationCode()))); |
| | | if (SDictData != null) { |
| | | baseWarehouse.setClassificationName(SDictData.getDict_label()); |
| | | } |
| | | //根据机构id查询机构 |
| | | FinSysTenant finSysTenant = finSysTenantService.get(new FinSysTenant(baseWarehouse.getAgencyId())); |
| | | if (finSysTenant != null) { |
| | | baseWarehouse.setParentAgencyId(finSysTenant.getParentId()); |
| | | baseWarehouse.setAgencyName(finSysTenant.getName()); |
| | | } |
| | | return this.update(baseWarehouse); |
| | | } |
| | | |