| | |
| | | OpeWarehouseReserveService opeWarehouseReserveService; |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public List<SysReagent> getSysReagentList(String name, String cas, String supplierId,Integer type, Integer first, Integer pageSize) { |
| | | public List<SysReagent> getSysReagentList(String name, String cas, Long supplierId,Integer type, Integer first, Integer pageSize) { |
| | | try { |
| | | Map<String, Object> params = new HashMap<String, Object>(); |
| | | if (StringUtils.isNotBlank(name)) { |
| | |
| | | if (StringUtils.isNotBlank(cas)) { |
| | | params.put("cas", "%" + cas + "%"); |
| | | } |
| | | if (StringUtils.isNotBlank(supplierId)) { |
| | | if (supplierId!=null) { |
| | | params.put("supplierId", supplierId); |
| | | } |
| | | if(type!=null){ |
| | |
| | | } |
| | | } |
| | | |
| | | public List<SysReagent> getSysReagentListNew(String name, String cas, String supplierId,Integer type, Integer first, Integer pageSize,String productSn) { |
| | | public List<SysReagent> getSysReagentListNew(String name, String cas, Long supplierId,Integer type, Integer first, Integer pageSize,String productSn) { |
| | | try { |
| | | Map<String, Object> params = new HashMap<String, Object>(); |
| | | params.put("name", name); |
| | | params.put("cas", cas); |
| | | params.put("supplierId", supplierId); |
| | | params.put("type", type); |
| | | params.put("first", first); |
| | | params.put("type", type); |
| | | params.put("pageSize", pageSize); |
| | | params.put("productSn", productSn); |
| | | return this.sysReagentDao.getSysReagentListNew(params); |
| | |
| | | * @date 2020/12/1 17:04 |
| | | */ |
| | | @Override |
| | | public int favorCount(SysUser user, String name, String cas, String supplierId, String productSn, Integer favorFlag) { |
| | | public int favorCount(SysUser user, String name, String cas, Long supplierId, String productSn, Integer favorFlag) { |
| | | |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("user", user.getId()); |
| | |
| | | * @date 2020/12/1 17:04 |
| | | */ |
| | | @Override |
| | | public List<SysReagent> favorList(SysUser user, String name, String cas, String supplierId, String productSn, Integer favorFlag, Integer first, Integer pageSize) { |
| | | public List<SysReagent> favorList(SysUser user, String name, String cas, Long supplierId, String productSn, Integer favorFlag, Integer first, Integer pageSize) { |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("user", user.getId()); |
| | | params.put("favorFlag", favorFlag); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public int reagentCount(SysUser user, String name, String cas, String supplierId, String productSn) { |
| | | public int reagentCount(SysUser user, String name, String cas, Long supplierId, String productSn) { |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("user", user.getId()); |
| | | params.put("name", name); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<SysReagent> reagentList(SysUser user, String name, String cas, String supplierId, String productSn, int first, int pageSize,int count) { |
| | | public List<SysReagent> reagentList(SysUser user, String name, String cas, Long supplierId, String productSn, int first, int pageSize,int count) { |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("user", user.getId()); |
| | | params.put("name", name); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public String getReagentUnitByReagentId(String reagentId) { |
| | | public String getReagentUnitByReagentId(Long reagentId) { |
| | | return sysReagentDao.getReagentUnitByReagentId(reagentId); |
| | | } |
| | | |
| | | @Override |
| | | public List<SysReagent> getReagent(String name, String cas, String factory, String specifications, String packing) { |
| | | Map<String, String> params = new HashMap<>(); |
| | | public List<SysReagent> getReagent(String name, String cas, Long factory, Long specifications, Long packing) { |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("name", name); |
| | | params.put("cas", cas); |
| | | params.put("factory", factory); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public SysReagent getRowData(String rowKey) { |
| | | public SysReagent getRowData(Long rowKey) { |
| | | return sysReagentDao.getRowData(rowKey); |
| | | } |
| | | |
| | | @Override |
| | | public SysReagent getSysReagentListNewRowData(String rowKey) { |
| | | public SysReagent getSysReagentListNewRowData(Long rowKey) { |
| | | return sysReagentDao.getSysReagentListNewRowData(rowKey); |
| | | } |
| | | |
| | | @Override |
| | | public boolean export2Excel(List<Map> list, Integer type) throws Exception { |
| | | Map<String,String> map = new LinkedHashMap<>(); |
| | | if (type == 0){ |
| | | if (type==null||type == 0){ |
| | | map.put("kind", "种类"); |
| | | map.put("name", "名称"); |
| | | map.put("productSn", "产品编号"); |
| | | map.put("product_sn", "产品编号"); |
| | | map.put("cas", "CAS"); |
| | | map.put("reagentType", "试剂类型"); |
| | | map.put("reagentCharacter", "危险性质"); |
| | | map.put("reagent_type", "试剂类型"); |
| | | map.put("reagent_character", "危险性质"); |
| | | map.put("supplierName", "供应商"); |
| | | map.put("productHomeName", "厂家"); |
| | | map.put("reagentFormat", "规格"); |
| | | map.put("reagentUnit", "包装"); |
| | | map.put("product_home", "厂家"); |
| | | map.put("reagent_format", "规格"); |
| | | map.put("reagent_unit", "包装"); |
| | | map.put("price", "含税售价"); |
| | | map.put("perBox", "每箱数量"); |
| | | map.put("per_box", "每箱数量"); |
| | | ExcelUtils.export2Excel(list,"耗材列表",map); |
| | | }else { |
| | | map.put("kind", "种类"); |
| | | map.put("name", "试剂名称"); |
| | | map.put("control_products_name", "管制品"); |
| | | map.put("productSn", "产品编号"); |
| | | map.put("control_products", "管制品"); |
| | | map.put("product_sn", "产品编号"); |
| | | map.put("cas", "CAS"); |
| | | map.put("reagentType", "试剂类型"); |
| | | map.put("reagentCharacter", "危险性质"); |
| | | map.put("reagent_type", "试剂类型"); |
| | | map.put("reagent_character", "危险性质"); |
| | | map.put("supplierName", "供应商"); |
| | | map.put("productHomeName", "厂家"); |
| | | map.put("reagentFormat", "规格"); |
| | | map.put("reagentUnit", "包装"); |
| | | map.put("product_home", "厂家"); |
| | | map.put("reagent_format", "规格"); |
| | | map.put("reagent_unit", "包装"); |
| | | map.put("price", "含税售价"); |
| | | // map.put("originprice", "原始售价"); |
| | | map.put("perBox", "每箱数量"); |
| | | map.put("per_box", "每箱数量"); |
| | | map.put("safetynum", "安全库存"); |
| | | ExcelUtils.export2Excel(list,"试剂列表",map); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map> selectAll(String name, String cas, String supplierId, Integer type, String productSn) { |
| | | public List<Map> selectAll(String name, String cas, Long supplierId, Integer type, String productSn) { |
| | | Map<String, Object> params = new HashMap<String, Object>(); |
| | | params.put("name", name); |
| | | params.put("cas", cas); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void updateSysReagentPrice(String reagentId, BigDecimal applyPrice) { |
| | | public void updateSysReagentPrice(Long reagentId, BigDecimal applyPrice) { |
| | | sysReagentDao.updateSysReagentPriceById(reagentId, applyPrice); |
| | | } |
| | | |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public int getSysReagentTotalCount(String name, String cas, String supplierId,Integer type) { |
| | | public int getSysReagentTotalCount(String name, String cas, Long supplierId,Integer type) { |
| | | try { |
| | | Map<String, Object> params = new HashMap<String, Object>(); |
| | | if (StringUtils.isNotBlank(name)) { |
| | |
| | | } |
| | | |
| | | |
| | | public int getSysReagentTotalCountNew(String name, String cas, String supplierId,Integer type,String productSn) { |
| | | public int getSysReagentTotalCountNew(String name, String cas, Long supplierId,Integer type,String productSn) { |
| | | try { |
| | | Map<String, Object> params = new HashMap<String, Object>(); |
| | | params.put("name", name); |
| | |
| | | |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public SysReagent getSysReagent(String id) { |
| | | public SysReagent getSysReagent(Long id) { |
| | | try { |
| | | return this.sysReagentDao.getSysReagent(id); |
| | | } catch (DataAccessException e) { |
| | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public SysReagent insertSysReagent(SysReagent sysReagent) { |
| | | try { |
| | | if (sysReagent.getId() == null) { |
| | | sysReagent.setId(IDUtils.uuid()); |
| | | } |
| | | // if (sysReagent.getId() == null) { |
| | | // sysReagent.setId(IDUtils.uuid()); |
| | | // } |
| | | sysReagent.setName(sysReagent.getName().trim()); |
| | | this.sysReagentDao.insertSysReagent(sysReagent); |
| | | return sysReagent; |
| | |
| | | return false; |
| | | } |
| | | |
| | | List<String> ids = new ArrayList<String>(); |
| | | List<Long> ids = new ArrayList<Long>(); |
| | | for (SysReagent sysReagent : sysReagentList) { |
| | | //判断试剂在库中是否存在 |
| | | int count = opeWarehouseReserveService.getOpeWarehouseReserveTotalCount(sysReagent.getId(), sysReagent.getSupplierId()); |
| | |
| | | this.sysReagentDao.updateSysReagentForExport(sysReagent); |
| | | } |
| | | }else{ |
| | | if (sysReagent.getId() == null) { |
| | | sysReagent.setId(IDUtils.uuid()); |
| | | } |
| | | // if (sysReagent.getId() == null) { |
| | | // sysReagent.setId(IDUtils.uuid()); |
| | | // } |
| | | this.sysReagentDao.insertSysReagent(sysReagent); |
| | | } |
| | | i++; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map getReagentDetail(String id) { |
| | | public Map getReagentDetail(Long id) { |
| | | return sysReagentDao.getSysReagentDetail(id); |
| | | } |
| | | |
| | |
| | | sysReagent.setId(sysReagentTmpl.getId()); |
| | | this.sysReagentDao.updateSysReagentForExport(sysReagent); |
| | | }else{ |
| | | if (sysReagent.getId() == null) { |
| | | sysReagent.setId(IDUtils.uuid()); |
| | | } |
| | | // if (sysReagent.getId() == null) { |
| | | // sysReagent.setId(IDUtils.uuid()); |
| | | // } |
| | | this.sysReagentDao.insertSysReagent(sysReagent); |
| | | } |
| | | i++; |