Merge remote-tracking branch 'remotes/origin/yufei' into master
| | |
| | | |
| | | import java.io.InputStream; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.nanometer.smartlab.entity.BaseMeta; |
| | | import com.nanometer.smartlab.entity.SysLaboratory; |
| | | import com.nanometer.smartlab.service.SysLaboratoryService; |
| | | import com.nanometer.smartlab.service.*; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.apache.log4j.Logger; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | |
| | | |
| | | import com.nanometer.smartlab.entity.SysController; |
| | | import com.nanometer.smartlab.entity.SysLaboratoryContainer; |
| | | import com.nanometer.smartlab.service.BaseMetaService; |
| | | import com.nanometer.smartlab.service.SysControllerService; |
| | | import com.nanometer.smartlab.service.SysLaboratoryContainerService; |
| | | import com.nanometer.smartlab.util.Constants; |
| | | import com.nanometer.smartlab.util.FacesUtils; |
| | | |
| | |
| | | private BaseMetaService baseMetaService; |
| | | @Resource |
| | | private SysLaboratoryService sysLaboratoryService; |
| | | @Resource |
| | | private SysProjectService sysProjectService; |
| | | /** |
| | | * 数据源 |
| | | */ |
| | |
| | | public void export2Excel(){ |
| | | |
| | | try { |
| | | List<Map> list = sysLaboratoryContainerService.exportExcelList(laboratoryType, laboratoryName); |
| | | List<Map> list = sysLaboratoryContainerService.exportExcelList(laboratoryType, laboratoryName,project,controllerName); |
| | | sysLaboratoryContainerService.export2Excel(list); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | System.out.println("value : "+valuesList); |
| | | SysLaboratoryContainer sysLaboratoryContainer=new SysLaboratoryContainer(); |
| | | sysLaboratoryContainer.setLaboratoryId(getLabId(sysLaboratories,valuesList.get(0))); |
| | | sysLaboratoryContainer.setControllerCode(getConCode(sysControllers,valuesList.get(1))); |
| | | sysLaboratoryContainer.setContainerCode(valuesList.get(2)); |
| | | sysLaboratoryContainer.setType(getBaseMetaId(typeList,valuesList.get(3))); |
| | | sysLaboratoryContainer.setInfoCode(valuesList.get(4)); |
| | | sysLaboratoryContainer.setStructure(getBaseMetaId(struList,valuesList.get(5))); |
| | | sysLaboratoryContainer.setName(valuesList.get(6)); |
| | | if(valuesList.get(3).equals("智能柜")){ |
| | | sysLaboratoryContainer.setCharacterLeft(getBaseMetaId(charList,valuesList.get(7))); |
| | | sysLaboratoryContainer.setCharacterRight(getBaseMetaId(charList,valuesList.get(8))); |
| | | if (!valuesList.get(1).replace(" ","").isEmpty()){ |
| | | List<String> projects = Arrays.asList(valuesList.get(1).split(",")); |
| | | for (String project : projects) { |
| | | //不存再就直接推出 |
| | | if (!sysProjectService.isExistProject(project)) { |
| | | throw new Exception("课题组不存在,(" + i + "行)"); |
| | | } |
| | | } |
| | | //都存在就设置 |
| | | sysLaboratoryContainer.setProject(valuesList.get(1).replace(" ","")); |
| | | }else{ |
| | | sysLaboratoryContainer.setProject(null); |
| | | } |
| | | sysLaboratoryContainer.setControllerCode(getConCode(sysControllers,valuesList.get(2))); |
| | | sysLaboratoryContainer.setContainerCode(valuesList.get(3)); |
| | | sysLaboratoryContainer.setType(getBaseMetaId(typeList,valuesList.get(4))); |
| | | sysLaboratoryContainer.setInfoCode(valuesList.get(5)); |
| | | sysLaboratoryContainer.setStructure(getBaseMetaId(struList,valuesList.get(6))); |
| | | sysLaboratoryContainer.setName(valuesList.get(7)); |
| | | if(valuesList.get(4).equals("智能柜")){ |
| | | sysLaboratoryContainer.setCharacterLeft(getBaseMetaId(charList,valuesList.get(8))); |
| | | sysLaboratoryContainer.setCharacterRight(getBaseMetaId(charList,valuesList.get(9))); |
| | | } |
| | | sysLaboratoryContainers.add(sysLaboratoryContainer); |
| | | } |
| | |
| | | |
| | | public void exportLab2Excel(){ |
| | | try { |
| | | List<Map> list = sysLaboratoryService.exportLabList(type, name); |
| | | List<Map> list = sysLaboratoryService.exportLabList(type, name,project); |
| | | sysLaboratoryService.exportLab2Excel(list); |
| | | FacesUtils.info("导出成功"); |
| | | }catch (Exception e){ |
| | |
| | | /** |
| | | * Created by cmower on 17/11/20. |
| | | */ |
| | | @Controller |
| | | @PropertySource(value = "WEB-INF/config.properties",encoding = "utf-8") |
| | | @Controller |
| | | @Scope("session") |
| | | public class WarehouseStockMngController extends BaseController { |
| | | |
| | |
| | | FacesUtils.info("至少选择一个"); |
| | | return; |
| | | } |
| | | |
| | | this.userId = getUser().getId(); |
| | | this.menuController.goToPage(Constants.PAGE_WAREHOUSE_REAGENT_USE_NEW, Constants.PAGE_WAREHOUSE_STOCK_MNG); |
| | | } |
| | | // |
| | |
| | | } |
| | | } |
| | | checkTable = null; |
| | | // |
| | | this.userId = selectedTmpOrderList.get(0).getApplyUser(); |
| | | |
| | | this.menuController.goToPage(Constants.PAGE_WAREHOUSE_REAGENT_USE_NEW_PERSON, Constants.PAGE_WAREHOUSE_STOCK_MNG); |
| | | } |
| | |
| | | <result property="arrivalNum" column="arrival_num"></result> |
| | | <result property="status" column="status" typeHandler="com.nanometer.smartlab.entity.handler.ApplyStatusHandler"></result> |
| | | <result property="applyUserId" column="apply_user_id"></result> |
| | | <result property="applyUser" column="apply_user"></result> |
| | | <result property="arrivalTime" column="arrival_time"></result> |
| | | <result property="articleNumber" column="articleNumber"></result> |
| | | <result property="projectManage" column="projectManage"/> |
| | |
| | | bm1.meta_value productHome, |
| | | sr.dangerous_flag, |
| | | oa.num, |
| | | oa.apply_user_id apply_user, |
| | | oa.used, |
| | | su.`name` apply_user_id, |
| | | su.project, |
| | |
| | | void insertOpeReagentStatus2(OpeReagentStatus ors); |
| | | |
| | | int countReagentByArticleAndWarehouse(Map params); |
| | | |
| | | void updateArticleNumberByRCode(String code, String articleNumber); |
| | | } |
| | |
| | | <update id="updateByReId" parameterType="java.util.Map"> |
| | | update ope_reagent_status set reagent_id=#{newReId} where reagent_id=#{oldReId} |
| | | </update> |
| | | <update id="updateArticleNumberByRCode"> |
| | | update ope_reagent_status set article_number = #{1} |
| | | where reagent_code = #{0} |
| | | </update> |
| | | |
| | | <select id="selectReagentCodesByReId" parameterType="java.lang.String" resultType="java.lang.String"> |
| | | select reagent_code from ope_reagent_status WHERE |
| | |
| | | ouf.reagent_code reagentCode, |
| | | sr.product_sn productSn, |
| | | sr.NAME reagentName, |
| | | bm1.meta_value reagentFormat, |
| | | CONCAT(sr.per_box,bm1.meta_value) perInfo, |
| | | bm.meta_value reagentFormat, |
| | | CONCAT(sr.main_metering,bm1.meta_value) perInfo, |
| | | bm2.meta_value productHome, |
| | | bm3.meta_value controlProducts |
| | | from `ope_use_flow` ouf |
| | |
| | | bm1.meta_value containerType , |
| | | slc.info_code infoCode , |
| | | bm3.meta_value structure, |
| | | slc.`name` name |
| | | slc.`name` name, |
| | | slc.project |
| | | FROM |
| | | sys_laboratory_container slc |
| | | LEFT JOIN base_meta bm1 ON bm1.id = slc.type |
| | |
| | | <if test="name != null and name != ''"> |
| | | and sl.name like concat("%",#{name},"%") |
| | | </if> |
| | | <if test="project != null and project != ''"> |
| | | and slc.project like concat("%",#{project},"%") |
| | | </if> |
| | | <if test="controllerName != null and controllerName != ''"> |
| | | and sc.controller_name like concat("%",#{controllerName},"%") |
| | | </if> |
| | | order by sl.name ASC,sc.controller_name,slc.container_code,slc.name |
| | | |
| | | </select> |
| | |
| | | CONCAT(location1,'-',location2) |
| | | END |
| | | location, |
| | | bm2.meta_value department |
| | | bm2.meta_value department, |
| | | sl.project |
| | | from sys_laboratory as sl |
| | | LEFT JOIN base_meta bm1 on bm1.id = sl.type |
| | | left JOIN base_meta bm2 on bm2.id = sl.department |
| | |
| | | <if test="type != null and type != ''"> |
| | | and sl.type = #{type}; |
| | | </if> |
| | | <if test="project != null and project != ''"> |
| | | and sl.project like concat("%",#{project},"%") |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getSysLaboratoryTotalCount" parameterType="java.util.Map" resultType="int"> |
| | |
| | | |
| | | private String project; |
| | | private String projectManage; |
| | | private String applyUser; |
| | | |
| | | public ApplyStatus getStatus() { |
| | | return status; |
| | |
| | | public void setCacheUpdateList(List<OpeWarehouseReserve> cacheUpdateList) { |
| | | this.cacheUpdateList = cacheUpdateList; |
| | | } |
| | | |
| | | public String getApplyUser() { |
| | | return applyUser; |
| | | } |
| | | |
| | | public void setApplyUser(String applyUser) { |
| | | this.applyUser = applyUser; |
| | | } |
| | | } |
| | |
| | | void updateOpeReagentStatus(OpeReagentStatus opeReagentStatus); |
| | | |
| | | int getReagentNumInWarehouse(String id, String articleNumber, String warehouseId); |
| | | |
| | | } |
| | |
| | | List<BaseMeta> baseMetaList = baseMetaDao.getBaseMetaList(metaMap); |
| | | opeUseFlow.setOperateState(baseMetaList.get(0).getId()); |
| | | this.opeUseFlowService.insertOpeUseFlow(opeUseFlow); |
| | | //更新试剂状态表 :批号 |
| | | opeReagentStatusDao.updateArticleNumberByRCode(reagentCodes.get(0),warehouseReserve.getArticleNumber()); |
| | | |
| | | reagentCodes.remove(0); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | Map selectLocationByContainerCode(String containerCode); |
| | | |
| | | List<Map> exportExcelList(String laboratoryType, String laboratoryName); |
| | | List<Map> exportExcelList(String laboratoryType, String laboratoryName,String project,String controllerName); |
| | | |
| | | void export2Excel(List<Map> list) throws Exception; |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map> exportExcelList(String laboratoryType, String laboratoryName) { |
| | | public List<Map> exportExcelList(String laboratoryType, String laboratoryName,String project,String controllerName) { |
| | | Map<String, String> params = new HashMap<>(); |
| | | params.put("type", laboratoryType); |
| | | params.put("name", laboratoryName); |
| | | params.put("project", project); |
| | | params.put("controllerName", controllerName); |
| | | return sysLaboratoryContainerDao.exportExcelList(params); |
| | | } |
| | | |
| | |
| | | map.put("infoCode", "临时存储库状态码"); |
| | | map.put("structure", "临时存储库结构"); |
| | | map.put("name", "临时存储库名称"); |
| | | map.put("project", "课题组"); |
| | | ExcelUtils.export2Excel(list,"实验室临时存储库管理",map); |
| | | |
| | | } |
| | |
| | | |
| | | void exportLab2Excel(List<Map> list) throws Exception; |
| | | |
| | | List<Map> exportLabList(String type, String name); |
| | | List<Map> exportLabList(String type, String name,String project); |
| | | |
| | | List<LaboratoryVo.Laboratory> getLaboratoryByProject(String project); |
| | | |
| | |
| | | map.put("barCode", "地址码"); |
| | | map.put("location", "地址"); |
| | | map.put("department", "部门"); |
| | | map.put("project", "课题组"); |
| | | ExcelUtils.export2Excel(list,"实验室信息",map); |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map> exportLabList(String type, String name) { |
| | | public List<Map> exportLabList(String type, String name,String project) { |
| | | Map<String,String> params = new HashMap<>(); |
| | | params.put("type", type); |
| | | params.put("name", name); |
| | | params.put("project", project); |
| | | return sysLaboratoryDao.exportLabList(params); |
| | | } |
| | | |
| | |
| | | <h:outputText value="#{row.name}"></h:outputText> |
| | | </p:column> |
| | | |
| | | <p:column headerText="所属项目组"> |
| | | <p:column headerText="课题组"> |
| | | <h:outputText value="#{row.project}"></h:outputText> |
| | | </p:column> |
| | | |
| | |
| | | <h:outputText value="#{row.articleNumber}"></h:outputText> |
| | | </p:column> |
| | | |
| | | <p:column headerText="申领人"> |
| | | <h:outputText value="#{row.applyUserId}"></h:outputText> |
| | | </p:column> |
| | | |
| | | <p:column headerText="申请数量"> |
| | | <h:outputText value="#{row.num}"></h:outputText> |
| | | </p:column> |