Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/assestmanagement/ExpensiveGoods.java =================================================================== diff -u -r20845 -r21469 --- ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/assestmanagement/ExpensiveGoods.java (.../ExpensiveGoods.java) (revision 20845) +++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/assestmanagement/ExpensiveGoods.java (.../ExpensiveGoods.java) (revision 21469) @@ -25,40 +25,39 @@ import com.forgon.tools.hibernate.ObjectDao; import com.forgon.tools.string.StringTools; - /** * @author jeffli 2017年11月9日 下午1:54:28 * */ @Entity @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class ExpensiveGoods { - - public final static SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); + + public final static SimpleDateFormat DATE_FORMAT = new SimpleDateFormat( + "yyyy-MM-dd"); public final static String CONSTANT_YES = "能"; public final static String CONSTANT_NO = "否"; - - + public final static String TYPE_NAME = "高值耗材"; - + public static String GRADE_FIRST = "一类"; public static String GRADE_SECOND = "二类"; public static String GRADE_THIRD = "三类"; - + public static List gradeList = new ArrayList(); - static{ + static { gradeList.add(GRADE_FIRST); gradeList.add(GRADE_SECOND); gradeList.add(GRADE_THIRD); } - + /** * id */ private Long id; - + private String guid; - + /** * 名称 */ @@ -67,42 +66,42 @@ * 语音提示名称 */ private String ttsName; - + /** * 外部编码 */ private String externalCode; - + /** * 总数 */ private Long amount = 0L; - + /** * 类型(如复大肿瘤分为耗材与介入一次性耗材) */ private String type; - + /** * 能否作为器械包材料 */ private String isPartOfTousseMaterial; - + /** * 能否被科室申请 */ private String isApplicationMaterial = CONSTANT_YES; - + /** * 供应室物品 */ private String isSupplyRoomGoods = Constants.STR_YES; - + /** * 拼音简称 */ private String spelling; - + /** * 五笔简码 */ @@ -112,32 +111,32 @@ * 最小库存 */ private Integer minStorage; - + /** * 最大库存 */ private Integer maxStorage; - + /** * 参考价 */ private Double referencePrice; - + /** * 规格 */ private String specification; - + /** * 包装规格 */ private String packageSpec; - + /** * 单位 */ private String unit; - + /** * 最小申请数量 */ @@ -152,56 +151,53 @@ * 注册证号 */ private String certification; - + /** * 分类级别(分一类、二类、三类.按药监局标准分别表示不与人体皮肤接触、用于皮肤表面及用于人体类) */ private String grade; - + /** - * 在标签中是否打印,值为是或者否。如果标签中配置打印一次性物品,并且此处为是,则会在标签纸中打印 - *
如果标签中配置不打印一次性物品,则不会在标签纸中打印 + * 在标签中是否打印,值为是或者否。如果标签中配置打印一次性物品,并且此处为是,则会在标签纸中打印
+ * 如果标签中配置不打印一次性物品,则不会在标签纸中打印 */ private String printInLabel; - + /** * 物资系统的物资编码,用于与物资系统交互 */ private String inventorySerialNumber; - - - + /** - * his接口同步时返回的id(同步科室接口时如接口返回科室id属性,则记录到字段) - * 省医物资接口需要用到 + * his接口同步时返回的id(同步科室接口时如接口返回科室id属性,则记录到字段) 省医物资接口需要用到 */ private Long idFromHisSync; - + /** * 顺序号,用于科室申领批量打印发货及打印一次性物品到纸质单据上时按此顺序号从小大到排序 */ private Integer sequence = 0; - + /** * 不需要盘点的科室编码,默认都是要盘点的 , 多个科室(多仓库)编码用逗号分割,编码开始、结束也拼接上了逗号,如:,001,021,392,222, */ private String notInventoryDeptCode; - + /** * 不保存到数据库,用于判断是否做了修改 */ private String orginalName; - + /** * 不保存到数据库,用于判断是否做了修改 */ private String orginalApplicationSpecification; - + /** * 不保存到数据库,用于判断是否做了修改 */ private String originalGoodsType; - + /** * 不保存到数据库,用于判断是否做了修改 */ @@ -210,12 +206,26 @@ * 注册证id */ private Long certificationId; - + /** + * 收费码 + */ + private String chargeCode; + /** + * 平台代码 + */ + private String platformCode; + /** + * 是否植入物 + */ + private String isImplant; + @JsonIgnore - public static Map ColumnNameAndPoPropertyNameMap= new LinkedHashMap(8); - - public static final String[] filterProperties = {"gradeList", "ColumnNameAndPoPropertyNameMap"}; - + public static Map ColumnNameAndPoPropertyNameMap = new LinkedHashMap( + 8); + + public static final String[] filterProperties = { "gradeList", + "ColumnNameAndPoPropertyNameMap" }; + static { ColumnNameAndPoPropertyNameMap.put("物品名称", "name"); ColumnNameAndPoPropertyNameMap.put("规格", "specification"); @@ -224,12 +234,13 @@ ColumnNameAndPoPropertyNameMap.put("物品类型", "goodsType"); ColumnNameAndPoPropertyNameMap.put("外部编码", "externalCode"); ColumnNameAndPoPropertyNameMap.put("单位", "unit"); -// ColumnNameAndPoPropertyNameMap.put("拼音码", "spelling"); -// ColumnNameAndPoPropertyNameMap.put("五笔码", "wbCode"); + // ColumnNameAndPoPropertyNameMap.put("拼音码", "spelling"); + // ColumnNameAndPoPropertyNameMap.put("五笔码", "wbCode"); ColumnNameAndPoPropertyNameMap.put("参考价", "referencePrice"); ColumnNameAndPoPropertyNameMap.put("最小库存", "minStorage"); ColumnNameAndPoPropertyNameMap.put("最大库存", "maxStorage"); - ColumnNameAndPoPropertyNameMap.put("能否作为器械包材料", "isPartOfTousseMaterial"); + ColumnNameAndPoPropertyNameMap.put("能否作为器械包材料", + "isPartOfTousseMaterial"); ColumnNameAndPoPropertyNameMap.put("能否被科室申请", "isApplicationMaterial"); ColumnNameAndPoPropertyNameMap.put("是否消毒中心物品", "isSupplyRoomGoods"); ColumnNameAndPoPropertyNameMap.put("是否打印标签", "printInLabel"); @@ -280,10 +291,9 @@ } public void setAmount(Long amount) { - if(amount == null){ + if (amount == null) { this.amount = 0L; - } - else{ + } else { this.amount = amount; } } @@ -311,7 +321,7 @@ public void setSpelling(String spelling) { this.spelling = spelling; } - + public String getWbCode() { return wbCode; } @@ -424,67 +434,74 @@ public void setGrade(String grade) { this.grade = grade; } - + public String getNotInventoryDeptCode() { return notInventoryDeptCode; } public void setNotInventoryDeptCode(String notInventoryDeptCode) { this.notInventoryDeptCode = notInventoryDeptCode; } - + /** * 默认值为是 + * * @return */ public String getPrintInLabel() { - printInLabel = StringTools.defaultIfEmpty(printInLabel, Constants.STR_YES); + printInLabel = StringTools.defaultIfEmpty(printInLabel, + Constants.STR_YES); return printInLabel; } + /** * 如果参数不为是或者否,则修改为是 + * * @param printInLabel */ public void setPrintInLabel(String printInLabel) { - if(!Constants.STR_YES.equals(printInLabel) && !Constants.STR_NO.equals(printInLabel)){ + if (!Constants.STR_YES.equals(printInLabel) + && !Constants.STR_NO.equals(printInLabel)) { printInLabel = Constants.STR_YES; } this.printInLabel = printInLabel; } + /** * 判断是否在标签中打印。非持久化属性 + * * @return */ - public boolean printInLabel(){ + public boolean printInLabel() { return Constants.STR_YES.equals(getPrintInLabel()); } @Transient public String getShowName() { return ExpensiveGoodsUtils.getExpensiveGoodsShowName(this); } - + @Transient public String getShowNameForSmallestUnit() { if (StringUtils.isNotBlank(this.specification)) { return this.name + "[" + this.specification + "]"; } return this.name; } - + public void setShowName() { - + } public String getIsSupplyRoomGoods() { - if(isSupplyRoomGoods == null || "".equals(isSupplyRoomGoods)){ + if (isSupplyRoomGoods == null || "".equals(isSupplyRoomGoods)) { isSupplyRoomGoods = Constants.STR_NO; } return isSupplyRoomGoods; } public void setIsSupplyRoomGoods(String isSupplyRoomGoods) { - if(isSupplyRoomGoods == null || "".equals(isSupplyRoomGoods)){ + if (isSupplyRoomGoods == null || "".equals(isSupplyRoomGoods)) { isSupplyRoomGoods = Constants.STR_NO; } this.isSupplyRoomGoods = isSupplyRoomGoods; @@ -506,15 +523,39 @@ this.packageSpec = packageSpec; } + public String getChargeCode() { + return chargeCode; + } + + public String getPlatformCode() { + return platformCode; + } + + public String getIsImplant() { + return isImplant; + } + + public void setChargeCode(String chargeCode) { + this.chargeCode = chargeCode; + } + + public void setPlatformCode(String platformCode) { + this.platformCode = platformCode; + } + + public void setIsImplant(String isImplant) { + this.isImplant = isImplant; + } + // 调整库存,只是在原有库存上调整,不整个重新计算 - public void adjustAmount(long amountChange){ + public void adjustAmount(long amountChange) { long amount = this.amount + amountChange; - if(amount < 0){ + if (amount < 0) { throw new RuntimeException("库存不能小于0!"); } this.amount = amount; } - + public String getGuid() { return guid; } @@ -540,7 +581,6 @@ this.originalGoodsType = originalGoodsType; } - @Transient public String getUnitForDisplay() { return unit; @@ -556,36 +596,39 @@ this.orginalApplicationSpecification = orginalApplicationSpecification; } - @Column(columnDefinition="int default 0") + @Column(columnDefinition = "int default 0") public Integer getSequence() { return sequence; } public void setSequence(Integer sequence) { this.sequence = sequence; } - + /** * 获取显示的规格 + * * @return */ - public String showSpecification(){ + public String showSpecification() { return specification; } /** * 是否盘点物品 + * * @return */ @Transient public String getIsInventoryGoods() { - String orgUnitCoding = AcegiHelper.getLoginUser().getOrgUnitCodingFromSupplyRoomConfig(); + String orgUnitCoding = AcegiHelper.getLoginUser() + .getOrgUnitCodingFromSupplyRoomConfig(); String inventoryDepartCoding = getNotInventoryDeptCode(); - String codingStr = formartDepartmentCode(orgUnitCoding,true); + String codingStr = formartDepartmentCode(orgUnitCoding, true); String isInventoryGoods = Constants.STR_YES; if (StringUtils.isNotBlank(inventoryDepartCoding)) { int index = inventoryDepartCoding.indexOf(codingStr); - if(index != -1){ + if (index != -1) { isInventoryGoods = Constants.STR_NO; } } @@ -594,67 +637,72 @@ @Transient public void setNotInventoryGoods(String isInventoryGoods) { - //页面不填,默认是需要盘点的 + // 页面不填,默认是需要盘点的 if (StringUtils.isBlank(isInventoryGoods)) { isInventoryGoods = Constants.STR_YES; } - String orgUnitCoding = AcegiHelper.getLoginUser().getOrgUnitCodingFromSupplyRoomConfig(); + String orgUnitCoding = AcegiHelper.getLoginUser() + .getOrgUnitCodingFromSupplyRoomConfig(); setDepartCoding(isInventoryGoods, orgUnitCoding); } - private void setDepartCoding(String isInventoryGoods, String orgUnitCoding) { - if(StringUtils.isNotBlank(orgUnitCoding)){ + if (StringUtils.isNotBlank(orgUnitCoding)) { String notInventoryDeptCode = getNotInventoryDeptCode(); - String codingStr = formartDepartmentCode(orgUnitCoding,true); + String codingStr = formartDepartmentCode(orgUnitCoding, true); if (Constants.STR_NO.equals(isInventoryGoods)) { if (StringUtils.isBlank(notInventoryDeptCode)) { notInventoryDeptCode = codingStr; } else { int index = notInventoryDeptCode.indexOf(codingStr); if (index == -1) { - notInventoryDeptCode += formartDepartmentCode(orgUnitCoding, false); + notInventoryDeptCode += formartDepartmentCode( + orgUnitCoding, false); } } setNotInventoryDeptCode(notInventoryDeptCode); } else { if (StringUtils.isNotBlank(notInventoryDeptCode)) { - String [] codeArray = notInventoryDeptCode.split(","); + String[] codeArray = notInventoryDeptCode.split(","); StringBuffer buff = new StringBuffer(); for (int i = 0; i < codeArray.length; i++) { String code = codeArray[i]; - if(StringUtils.isBlank(code)){ + if (StringUtils.isBlank(code)) { continue; } - if(StringUtils.equals(code, orgUnitCoding)){ + if (StringUtils.equals(code, orgUnitCoding)) { continue; } - if(buff.length() > 0){ + if (buff.length() > 0) { buff.append(","); } buff.append(code); } - if(buff.length() == 0 ){ + if (buff.length() == 0) { setNotInventoryDeptCode(""); - }else{ - setNotInventoryDeptCode(formartDepartmentCode(buff.toString(), true)); + } else { + setNotInventoryDeptCode(formartDepartmentCode( + buff.toString(), true)); } } } } } - - private String formartDepartmentCode(String orgUnitCoding,boolean isNull){ - if(isNull){ + + private String formartDepartmentCode(String orgUnitCoding, boolean isNull) { + if (isNull) { return ("," + orgUnitCoding + ","); - }else{ + } else { return orgUnitCoding + ","; } } - - public RegistrationCertification getRegistrationCertification(ObjectDao objectDao){ - if(certificationId != null){ - return (RegistrationCertification)objectDao.getByProperty(RegistrationCertification.class.getSimpleName(), "id", certificationId); + + public RegistrationCertification getRegistrationCertification( + ObjectDao objectDao) { + if (certificationId != null) { + return (RegistrationCertification) objectDao.getByProperty( + RegistrationCertification.class.getSimpleName(), "id", + certificationId); } return null; }